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

0 Members and 1 Guest are viewing this topic.

Offline runestone

Alright, I'll play around with BitShares().rpc.CALLNAME().

One more question. What's the syntax for e.g. openledger's assets? I'd like to make market orders (buy/sell) with for example open.LTC ? (hence, the reason why I was looking for a full list of asset name/IDs)
Br, Rune
~ Please vote on blockbasis-witness
~ https://www.blockbasis.com

Offline xeroc

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

The callname for listing asset however, i cannot remember ;)

Offline xeroc

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

The callname for listing asset however, i cannot remember ;)

Offline runestone

I was looking at BlockchainObject but the documentation for this class if rather limited. It's expecting "data", but what kind of data exactly? A few examples would be great.
Br, Rune
~ Please vote on blockbasis-witness
~ https://www.blockbasis.com

Offline sschiessl

  • Administrator
  • Hero Member
  • *****
  • Posts: 662
    • View Profile
  • BitShares: sschiessl
BlockchainObject is the base abstract class, use the Object class you actually want to have (Asset, Account, etc.)

Offline runestone

Question 1) What's the best way to get a list of all asset symbols/ids using python-bitshares?

Question 2) The code below return an unexpected error: AttributeError: 'BlockchainObject' object has no attribute 'refresh'
Code: [Select]
from bitshares.blockchainobject import BlockchainObject
obj = BlockchainObject({}, use_cache=False)
print(obj.items())
Why?
Br, Rune
~ Please vote on blockbasis-witness
~ https://www.blockbasis.com