blockfrost / blockfrost-rust

Rust SDK for Blockfrost.io
Apache License 2.0
16 stars 17 forks source link

Asset information needlessly expensive to query #45

Closed the-Minister-0001 closed 10 months ago

the-Minister-0001 commented 10 months ago

With the long awaited release of 1.0.0, many things changed for the better. Sadly, querying assets has gotten severely worse.

Specifically, querying asset metadata has become significantly more expensive due to multiple API calls being required to fetch the most recent metadata.

Version 0.2.1 offered fields analogous to the fields provided by GET /assets/{assetid}, which includes the metadata and onchain_metadata fields. This has been replaced an instance of AssetsInner, which only contains asset and quantity.

Instead of querying the asset by its id, I need to use the following steps to get the metadata:

Either I'm overlooking something obvious or this really is now the only way to get asset's metadata properly. Anyway, I fail to see why the fields currently provided by the endpoint are not included in the AssetsInner model, as this seems to be fairly free to implement.

Again, if I'm overlooking something, I'd be glad to know. Cheers!

the-Minister-0001 commented 10 months ago

From what I understand, all that is needed to restore old functionality is to replace using AssetsInner with Asset in src/api/endpoints/assets.rs.