nft_getAsset – Mythos Gaming RPC
nft_getAsset
returns enriched metadata for Mythos NFTs by combining pallet_nfts
storage and collection configuration. Use it to show live ownership inside your game client without decoding SCALE manually; under the hood it reads pallet_nfts::Item
, metadata, and price records in a single pass.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
collectionId | string | Yes | Hex or decimal identifier of the collection |
itemId | string | Yes | Hex or decimal identifier of the item |
at | string | No | Optional block hash for historical queries |
Response Fields
Field | Type | Description |
---|---|---|
collectionId | string | Echo of the requested collection |
itemId | string | Echo of the requested item |
owner | string | Account ID holding the asset |
locked | boolean | Indicates transfer or attribute locks |
metadata | object | UTF-8 metadata and attributes (namespaces flattened) |
price | object | Active listing data from pallet_marketplace , if present |
Request Example
Get details for collection 0xfa
, item 0x02
, minted in block 2,611,955
:
{
"jsonrpc": "2.0",
"method": "nft_getAsset",
"params": [
{ "collectionId": "0xfa", "itemId": "0x02" }
],
"id": 7
}
Response Example
{
"jsonrpc": "2.0",
"result": {
"collectionId": "0xfa",
"itemId": "0x02",
"owner": "0x6f889bd1f2f17cf62f6be41996d0d33df7f8fa7a7f6a0c7003c965c4c068b0d5",
"locked": false,
"metadata": {
"name": "Nitro Nation World Tour Crate",
"season": "S4",
"rarity": "Legendary"
},
"price": null
},
"id": 7
}
The owner and item identifiers match the on-chain nfts.mint
extrinsic at block 2,611,955
.
Error Handling
Code | Meaning | Resolution |
---|---|---|
AssetNotFound | Collection or item missing | Confirm the IDs and ensure the collection exists (check NextCollectionId ). |
InvalidParameter | Malformed IDs | Use decimal strings ("250" ) or hex prefixed with 0x |
Integration Tips
- Cache responses client-side; metadata rarely changes unless admins update attributes.
- Pair with
gaming_getPlayerAssets
to hydrate inventories on login. - Surface DAO badge metadata to highlight governance participation in-game.