-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: NFT metadata not fully parsed #56
Comments
Hi @eddex you are using the outdated The new Service will return an IAssetsService service = serviceCollection.GetRequiredService<IAssetsService>();
var asset = await service.GetAssetsAsync("asset_id");
var json = asset.OnchainMetadata.GetRawText();
var model = JsonSerializer.Deserialize<YourModel>(json); I really like the generic |
Ah ok, didn't realize there were 2 interfaces for the assets, thanks for clarifying! |
The UN-pluralized services will be removed in an upcoming release, i left them in as to not break existing implementations so that people have time to migrate. |
Also, the fields below are not exposed in the response: Also, for OnChainMetadata return type, I personally prefer a dynamic, since I really only care about name and image properties, and those are consistently there. I just ended up writing my own return class and calling the service using Flurl. |
Contact Details
Discord: eddex#6808
What happened?
Blockfrost dotnet version: 0.0.4
Problem
When I get the
Onchain_metadata
of an NFT, blockfrost dotnet only returns theImage
and theName
. I would like to be able to get the rest of the metadata too.Details
The endpoint I use is
/assets/<addet_id>
. This endpoint returns all metadata:Since C# is a statically typed language, the current solution of having a
Onchain_metadata
class in the library is not optimal. This calss only containsImage
andName
. The rest of the data can't be retrieved.Solution proposal
Make an overload of the
IAssetService.AssetsAsync()
method that allows to pass a generic type to the method. This type should be used to parse theOnchain_metadata
.Version
v0.0.1-alpha (default)
In what OS are you experiencing the problem?
Windows, Linux, MacOS, Docker
What version of dotnet are you using?
5.0.x
Relevant log output
No response
The text was updated successfully, but these errors were encountered: