Author Topic: List all assets using python-bitshares  (Read 1510 times)

0 Members and 1 Guest are viewing this topic.

Offline jackingyang

  • Full Member
  • ***
  • Posts: 81
    • View Profile
  • BitShares: bts0207
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

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
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 ..

Offline jackingyang

  • Full Member
  • ***
  • Posts: 81
    • View Profile
  • BitShares: bts0207
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.

Offline jackingyang

  • Full Member
  • ***
  • Posts: 81
    • View Profile
  • BitShares: bts0207