List all assets using python-bitshares

Started by runestone, March 29, 2018, 01:42:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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
~ [url="https://www.blockbasis.com"]https://www.blockbasis.com[/url]

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 ;)

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 ;)

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
~ [url="https://www.blockbasis.com"]https://www.blockbasis.com[/url]

sschiessl

BlockchainObject is the base abstract class, use the Object class you actually want to have (Asset, Account, etc.)

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'
from bitshares.blockchainobject import BlockchainObject
obj = BlockchainObject({}, use_cache=False)
print(obj.items())

Why?
Br, Rune
~ Please vote on blockbasis-witness
~ [url="https://www.blockbasis.com"]https://www.blockbasis.com[/url]