Author Topic: Obtain the current supply of a UIA in pybitshares  (Read 2153 times)

0 Members and 1 Guest are viewing this topic.

Offline doug


Offline doug

I'm having difficulty obtaining the current supply of a UIA using pybitshares.
When I look at the data in the Asset() call I see the "dynamic_asset_data_id" which is what I believe I need to access to obtain the current_supply for the UIA (I believe this from reading the Graphene doc).

I have the following code that provides me with the asset info:

a = Asset(asset_id)
pprint(a)
for i in a:
    print(i, a)

I obtain the following output when "asset_id" = "1.3.4106":

<Asset 1.3.4106>
symbol RUDEX.EOS
dynamic_asset_data_id 2.3.4106
options {'issuer_permissions': 79, 'extensions': [], 'description': '{"main":"RUDEX.EOS asset is backed 1:1 by the real EOS on EOS blockchain (https://eos.io), and can be deposited and withdrawn using gateway operated by RuDEX (https://rudex.org).","short_name":"EOS","market":""}', 'max_market_fee': 0, 'whitelist_markets': [], 'core_exchange_rate': {'quote': {'amount': 10000, 'asset_id': '1.3.4106'}, 'base': {'amount': 3000000, 'asset_id': '1.3.0'}}, 'whitelist_authorities': [], 'max_supply': '100000000000000', 'blacklist_authorities': [], 'flags': 4, 'market_fee_percent': 0, 'blacklist_markets': []}
issuer 1.2.384252
permissions {'white_list': True, 'transfer_restricted': True, 'witness_fed_asset': False, 'override_authority': True, 'disable_confidential': True, 'charge_market_fee': True, 'disable_force_settle': False, 'global_settle': False, 'committee_fed_asset': False}
description {'market': '', 'short_name': 'EOS', 'main': 'RUDEX.EOS asset is backed 1:1 by the real EOS on EOS blockchain (https://eos.io), and can be deposited and withdrawn using gateway operated by RuDEX (https://rudex.org).'}
precision 4
id 1.3.4106
flags {'white_list': False, 'transfer_restricted': False, 'witness_fed_asset': False, 'override_authority': True, 'disable_confidential': False, 'charge_market_fee': False, 'disable_force_settle': False, 'global_settle': False, 'committee_fed_asset': False}


The output in orange above is what I believe I need to inspect to obtain the current supply of the UIA.

I have tried to use the AssetId call from the bitsharesbase.objects:

from bitsharesbase.objects import AssetId

o = AssetId('2.3.4901')
pprint(o)

which outputs:
<bitsharesbase.objects.ObjectId object at 0x7fcd39eef400>

I have tried a number of approaches but I keep getting error messages like: argument of type ObjectId is not iterable.

I'm struggling to inspect that object!

Can anyone give me a pybitshares example of how to obtain the current_supply for a UIA?

« Last Edit: January 01, 2019, 09:27:03 pm by doug »