From bf83068cf7b7a038effb3a91103531601d482f10 Mon Sep 17 00:00:00 2001 From: Rodrigo Branas Date: Wed, 4 Dec 2024 09:46:07 -0300 Subject: [PATCH] Update ASSETS.md --- packages/graphql/ASSETS.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/packages/graphql/ASSETS.md b/packages/graphql/ASSETS.md index 473db2b5..db50b627 100644 --- a/packages/graphql/ASSETS.md +++ b/packages/graphql/ASSETS.md @@ -30,3 +30,36 @@ the result contains a JSON with the asset information, here are the details abou | verified | true if asset is in Fuel's verified assets list | | owner | Current assetId owner (NFTs only) | | uri | Parsed URL from “metadata.uri” or “metadata.URI”. Some [logic](https://github.com/FuelLabs/fuel-ex-demo/blob/ee73408a0ef0323eeb92414d5ed92d65e3f3f78f/packages/graphql/src/infra/gateway/AssetGateway.ts#L63-L95) is applied to try defining a reasonable uri for the API consumer | + +### Instructions for consuming Assets data owned by an Account from Indexer API + +API endpoint: +`/accounts/
/assets?last=` - get assets owned by an account (including NFTs) + +URLs to consume: +- Mainnet: https://mainnet-explorer.fuel.network +- Testnet: https://explorer-indexer-testnet.fuel.network + + +`curl` example of usage +``` +curl 'https://mainnet-explorer.fuel.network/accounts/0x196a68Ba237e921FeC5F01552E5e4df60b2619900254DD4cDe42557814508F57/assets?last=10' +``` + + +the result contains a JSON with an array of asset information and balance of each asset, here are the details about each prop: +| Property | Description | +|----------|-------------| +| balance | Balance of the asset owner by account | +| assetId | Actual ID of the asset | +| contractId | Contract ID that minted the asset | +| subId | SubId used to calculate the assetId | +| name | Asset name | +| symbol | Asset symbol | +| decimals | Asset decimals configuration | +| suspicious | true if symbol matches any verified asset symbols | +| metadata | Key-value object with SRC7/SRC9 standard metadata | +| isNFT | true if asset is NFT ( [supply=1, decimals=0](https://docs.fuel.network/docs/sway-standards/src-20-native-asset/#non-fungible-asset-restrictions) )| +| verified | true if asset is in Fuel's verified assets list | +| owner | Current assetId owner (NFTs only) | +| uri | Parsed URL from “metadata.uri” or “metadata.URI”. Some [logic](https://github.com/FuelLabs/fuel-ex-demo/blob/ee73408a0ef0323eeb92414d5ed92d65e3f3f78f/packages/graphql/src/infra/gateway/AssetGateway.ts#L63-L95) is applied to try defining a reasonable uri for the API consumer |