Skip to content

Commit 624d931

Browse files
authored
feat: create docs for Assets API endpoint (#614)
1 parent fb43e29 commit 624d931

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

packages/graphql/ASSETS.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Fuel Explorer Indexer - Assets API
2+
### Instructions for consuming Assets data from Indexer API
3+
4+
API endpoint:
5+
`/assets/<assetId>` - get information about any asset (including NFTs)
6+
7+
URLs to consume:
8+
- Mainnet: https://explorer-indexer-mainnet.fuel.network
9+
- Testnet: https://explorer-indexer-testnet.fuel.network
10+
11+
12+
`curl` example of usage
13+
```
14+
curl 'https://explorer-indexer-mainnet.fuel.network/assets/0x44b09d7143aa7b1aac7844ee9cfc38893b12d20c3822ecb18dbf2c6846ea63f0'
15+
```
16+
17+
18+
the result contains a JSON with the asset information, here are the details about each prop:
19+
| Property | Description |
20+
|----------|-------------|
21+
| assetId | Actual ID of the asset |
22+
| contractId | Contract ID that minted the asset |
23+
| subId | SubId used to calculate the assetId |
24+
| name | Asset name |
25+
| symbol | Asset symbol |
26+
| decimals | Asset decimals configuration |
27+
| suspicious | true if symbol matches any verified asset symbols |
28+
| metadata | Key-value object with SRC7/SRC9 standard metadata |
29+
| 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) )|
30+
| verified | true if asset is in Fuel's verified assets list |
31+
| owner | Current assetId owner (NFTs only) |
32+
| 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 |

0 commit comments

Comments
 (0)