BitShares Forum

Main => Technical Support => Topic started by: jackingyang on January 23, 2019, 09:21:13 am

Title: List all assets using python-bitshares
Post by: jackingyang on January 23, 2019, 09:21:13 am
how?
Title: Re: List all assets using python-bitshares
Post by: jackingyang on January 23, 2019, 09:22:55 am
from bitshares.asset import Asset
print(dict(Asset('USD')))


For listing assets, i believe there is no call in pybitshares yet. But you could call any rpc call thru the lib directly to by using

BitShares().rpc.CALLNAME()

It don't work.
Title: Re: List all assets using python-bitshares
Post by: xeroc on January 23, 2019, 10:07:21 am
Assets have an "id" of the form "1.3.xxx". The easiest way to iterate through them would be to just count
from 1.3.0 (BTS) until you get an AssetDoesNotExist exception.
Keep in mind that there are a few empty ids right after 1.3.0 too ..
Title: Re: List all assets using python-bitshares
Post by: jackingyang on January 23, 2019, 10:18:33 am
Assets have an "id" of the form "1.3.xxx". The easiest way to iterate through them would be to just count
from 1.3.0 (BTS) until you get an AssetDoesNotExist exception.
Keep in mind that there are a few empty ids right after 1.3.0 too ..
Thanks