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()
295
295
return sym;
296
296
}
297
297
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
+
298
312
void product::reset ()
299
313
{
300
314
reset_err ();
@@ -491,6 +505,16 @@ str price::get_symbol()
491
505
return prod_->get_symbol ();
492
506
}
493
507
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
+
494
518
bool price::get_attr ( attr_id aid, str& val ) const
495
519
{
496
520
return prod_->get_attr ( aid, val );
Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ namespace pc
157
157
158
158
// symbol from attr_dict
159
159
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 ();
160
164
161
165
// iterate through associated price accounts (quotes) associated
162
166
// with this product
@@ -243,6 +247,12 @@ namespace pc
243
247
// convenience wrapper equiv to: get_product()->get_symbol()
244
248
str get_symbol ();
245
249
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
+
246
256
// convenience wrapper equiv to: get_product()->get_sttr()
247
257
bool get_attr ( attr_id, str& ) const ;
248
258
You can’t perform that action at this time.
0 commit comments