File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,20 @@ str product::get_symbol()
295295 return sym;
296296}
297297
298+ str product::get_base_asset ()
299+ {
300+ str base;
301+ get_attr ( attr_id ( " base" ), base);
302+ return base;
303+ }
304+
305+ str product::get_quote_currency ()
306+ {
307+ str quote;
308+ get_attr ( attr_id ( " quote_currency" ), quote);
309+ return quote;
310+ }
311+
298312void product::reset ()
299313{
300314 reset_err ();
@@ -491,6 +505,16 @@ str price::get_symbol()
491505 return prod_->get_symbol ();
492506}
493507
508+ str price::get_base_asset ()
509+ {
510+ return prod_->get_base_asset ();
511+ }
512+
513+ str price::get_quote_currency ()
514+ {
515+ return prod_->get_quote_currency ();
516+ }
517+
494518bool price::get_attr ( attr_id aid, str& val ) const
495519{
496520 return prod_->get_attr ( aid, val );
Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ namespace pc
157157
158158 // symbol from attr_dict
159159 str get_symbol ();
160+ // Get the base currency (from attr_dict)
161+ str get_base_asset ();
162+ // Get the quote currency (from attr_dict)
163+ str get_quote_currency ();
160164
161165 // iterate through associated price accounts (quotes) associated
162166 // with this product
@@ -243,6 +247,12 @@ namespace pc
243247 // convenience wrapper equiv to: get_product()->get_symbol()
244248 str get_symbol ();
245249
250+ // Get the base asset for the product (from the list of product attributes).
251+ str get_base_asset ();
252+
253+ // Get the quote currency for the product (from the list of product attributes).
254+ str get_quote_currency ();
255+
246256 // convenience wrapper equiv to: get_product()->get_sttr()
247257 bool get_attr ( attr_id, str& ) const ;
248258
You can’t perform that action at this time.
0 commit comments