TRAIT DataGate API
  1. State
TRAIT DataGate API
  • Intro
  • History
    • Blocks
      POST
    • Transactions
      POST
    • Events
      POST
  • State
    • Info of on-chain entities
      POST
    • Raw single values of blockchain storage
      POST
    • Raw collections of blockchain storage
      POST
  • Tokens
    • Balances of tokens
      POST
    • Transfers of tokens
      POST
  • Submit new transaction
    • Validate transfer of token TRAIT
      POST
    • Validate transfer of fungible tokens
      POST
    • Validate transfer of nft tokens
      POST
    • Validate clearing transaction of an AppAgent
      POST
    • Build info for new transaction
      POST
    • Submit transaction
      POST
    • Get transaction status
      POST
  1. State

Raw collections of blockchain storage

POST
https://api.trait.tech/state/storage_map
The endpoint provides raw values of blockchain state used by internal logic of the blockchain.
This endpopint allows, among other things, to get the state of any token / AppAgent / address.

Request

Body Params application/json

Example
{
    "block": "blockchain_head",
    "storage": {
        "module_name": "Nfts",
        "storage_name": "Collection",
        "data": {
            "key_0": {
                "$in": [
                    56,
                    17
                ]
            }
        }
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.trait.tech/state/storage_map' \
--header 'Content-Type: application/json' \
--data-raw '{
    "block": "blockchain_head",
    "storage": {
        "module_name": "Nfts",
        "storage_name": "Collection",
        "data": {
            "key_0": {
                "$in": [
                    56,
                    17
                ]
            }
        }
    }
}'

Responses

🟢200OK
application/json
Successful Response
Body

Example
{
    "metadata": {
        "request_context": {
            "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
            "block_index": 29702,
            "block_timestamp": 1727581488000
        },
        "blockchain_head": {
            "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
            "block_index": 29702,
            "block_timestamp": 1727581488000
        },
        "pagination": {
            "current_page": 0,
            "next_page_id": "109924cd-b827-4eb1-8901-1f45d2d753e9"
        }
    },
    "data": [
        {
            "module_name": "Nfts",
            "storage_name": "Collection",
            "key_0": 56,
            "key_1": null,
            "key_2": null,
            "key_3": null,
            "storage_value": {
                "owner": {
                    "address": "ttmE1FmLbQzwxDZ3s4GZviJ6iy6d5JeTVSketvtWhZBoMTrbV",
                    "account_id": "0x0304000001fc39587505d395e59c19b3e6f31f066c03ab26f9b2633f8600a2c7",
                    "address_type": "app_agent",
                    "app_agent_id": 1027,
                    "ta_id": null,
                    "address_name": null
                },
                "owner_deposit": 1011130100000000,
                "items": 10,
                "item_metadatas": 10,
                "item_configs": 10,
                "attributes": 0
            },
            "raw_storage_key": "0xe8d49389c2e23e152fdd6364daadd2cc375c4d25bef51e2f32fee9fc557b18200380353fe0c824bfe4038d9b490d395538000000"
        },
        {
            "module_name": "Nfts",
            "storage_name": "Collection",
            "key_0": 17,
            "key_1": null,
            "key_2": null,
            "key_3": null,
            "storage_value": {
                "owner": {
                    "address": "ttrnYjkipbBQVVvpcx349CsAvbQvF35JrXHosmbAULSZa7Uyv",
                    "account_id": "0xf903000001d19712b1c73aa01de7b7764c220ed3d23403f9ef8052e5d2fcc16e",
                    "address_type": "app_agent",
                    "app_agent_id": 1017,
                    "ta_id": null,
                    "address_name": null
                },
                "owner_deposit": 1011130100000000,
                "items": 10,
                "item_metadatas": 10,
                "item_configs": 10,
                "attributes": 0
            },
            "raw_storage_key": "0xe8d49389c2e23e152fdd6364daadd2cc375c4d25bef51e2f32fee9fc557b1820e37562bb4844e827a9b9fc94ab966edb11000000"
        }
    ]
}
🟠422Parameter Error
Modified at 2024-11-21 18:59:09
Previous
Raw single values of blockchain storage
Next
Balances of tokens
Built with