Author Topic: Distinguish asset types from API  (Read 1572 times)

0 Members and 1 Guest are viewing this topic.

Offline bilthon

Good, thanks for the response! but what about estimating the market cap?

Offline svk

You can identify smartcoins by a field called bitasset_id, only they have it. For each smartcoin you then need to fetch that object with get_objects, and it will contain a boolean field is_prediction_market.
Worker: dev.bitsharesblocks

Offline bilthon

Hello! I'm using the database API, more specifically the "list_assets" call to get the complete list of known assets. Of course, since the maximum number of assets returned is 100, I have to schedule repeated calls with slightly different arguments to the witness in order to retrieve them all.

Now what I want to do is to further classify and filter out this assets. I would like to first be able to tell which assets are UIA, smartcoins or prediction market. And filter out some of them based on their market cap, much like cryptofresh does at the assets list: http://cryptofresh.com/assets. How can this be archieved ideally with the minimal amount of API calls?

I'm sure the witness_fed_asset flag must be set for both smartcoins and prediction markets, but I'm not really sure how to tell them apart. Is it possible to do so just based on the issuer_permissions and/or flags? or will I need to issue more API calls? I don't see how to avoid this, specially to calculate the market cap.

Any thoughts on the issue?