BitShares Forum
Main => Technical Support => Topic started by: runestone on March 29, 2018, 01:42:29 am
-
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'
from bitshares.blockchainobject import BlockchainObject
obj = BlockchainObject({}, use_cache=False)
print(obj.items())
Why?
-
BlockchainObject is the base abstract class, use the Object class you actually want to have (Asset, Account, etc.)
-
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.
-
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 ;)
-
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 ;)
-
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)