cardano-community / koios-artifacts

Artifacts for https://koios.rest and https://api.koios.rest websites
Creative Commons Attribution 4.0 International
20 stars 25 forks source link

Flag to disable `token_registry_metadata.logo` field in `asset_info` #202

Closed rdlrt closed 1 year ago

rdlrt commented 1 year ago

Also we would like to ask you to make some flag to disable token_registry_metadata.logo field in asset_info GET&POST endpoints (https://api.koios.rest/#post-/asset_info), as it can be disabled only through full filtering of token_registry_metadata jsonb object.

In our lightwallet, updating asset data does not always require a logo, but it does require decimals for example. So requests are sometimes 1-2-5 megabytes.

Quick access link (we just made a separate RPC *crazy*):

https://github.com/ray-network/raygraph-output/blob/d21d2a6a9a269485251f990e74254c95ebc812c4/koios-lite/rpc-extra/assets_info_bulk_no_logo.sql#L55

Originally posted by @ray-robot in https://github.com/cardano-community/koios-artifacts/issues/186#issuecomment-1576479787

rdlrt commented 1 year ago

@ray-robot - hope you dont mind converting that comment to seperate issue here.

Unlike the utxo endpoints in previous issue where we were adding _extended to avoid joins (performance impact), the requirement here is more around verticle filtering for contents within endpoint with details from same table.

Hence, I'd want to be sure to understand that (since consumption is programatic and not manual), wouldnt something like below fit the purpose?

curl -X POST "https://api.koios.rest/api/v0/asset_info?select=policy_id,asset_name_ascii,total_supply,mint_cnt,token_registry_metadata->decimals,token_registry_metadata->ticker"  -H "accept: application/json" -H "content-type: application/json"  -d '{"_asset_list":[["750900e4999ebe0d58f19b634768ba25e525aaf12403bfe8fe130501","424f4f4b"]]}'

# [{"policy_id":"750900e4999ebe0d58f19b634768ba25e525aaf12403bfe8fe130501","asset_name_ascii":"BOOK","total_supply":"10000000000","mint_cnt":1,"decimals":0,"ticker":"BOOK"}]

In general, this (exclusion) would then kinda extend to other fields across different endpoints wherein you might want to exclude transaction metadata details or datum byte which will be similarly large footprints unless filtered. Let us know your views around the same.

xray-robot commented 1 year ago

Ouch, I seem to have missed that such a selection was possible. Yes, it's a perfect fit of course. This Issue can be closed.