TRAIT DataGate API
  1. History
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. History

Transactions

POST
https://api.trait.tech/history/transactions
History
The endpoint provides blockchain transactions.
Request params allows to filter transactions by various properties of enclosing blocks,
properties of transactions itself and data (transaction arguments) passed by transaction to the blockchain.
Response contains list of matching transactions, events generated by the transaction.

Request

Body Params application/json
Request
optional
Any of
Request params for the endpoint /history/transactions.
Example:
{"block_receipt":{"block_index":{"max":"blockchain_head"}},"tx_receipt":{"origin":"ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e"},"tx_call":{"module_name":"PlayerTransfers","function_name":"submit_transfer_assets","arguments":{"id":{"$eq":32}}},"presentation":{"sorting":"time_ascending","include_events":false}}
block_receipt
object 
FilterBlockReceipt
optional
Filter by the values contained in the block receipt.
tx_receipt
Tx Receipt
optional
Filter by the values contained in the transaction receipt.
tx_call
Tx Call
optional
Filter by parameters of transaction call.
presentation
object 
HistoryTransactionsPresentation
optional
Configuration of output for the endpoint /history/transactions.
Example
{
    "block_receipt": {
        "block_index": {
            "max": "blockchain_head"
        }
    },
    "tx_receipt": {
        "origin": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e"
    },
    "tx_call": {
        "module_name": "PlayerTransfers",
        "function_name": "submit_transfer_assets",
        "arguments": {
            "id": {
                "$eq": 32
            }
        }
    },
    "presentation": {
        "sorting": "time_ascending",
        "include_events": false
    }
}

Request 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/history/transactions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "block_receipt": {
        "block_index": {
            "max": "blockchain_head"
        }
    },
    "tx_receipt": {
        "origin": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e"
    },
    "tx_call": {
        "module_name": "PlayerTransfers",
        "function_name": "submit_transfer_assets",
        "arguments": {
            "id": {
                "$eq": 32
            }
        }
    },
    "presentation": {
        "sorting": "time_ascending",
        "include_events": false
    }
}'

Responses

🟢200OK
application/json
Successful Response
Body
Response schema for the endpoint `/history/transactions`.
metadata
object (ResponseMetadataPaged) 
required
Metadata for the generated response.
request_context
object (ResponseBlockId) 
required
For the endpoints with historical data: the last block, the data from which is included in the response. For the endpoints with blockchain state data: the block whose state is provided in the response. Request context remains the same for all data pages in the series for the initial request.
blockchain_head
object (ResponseBlockId) 
required
The latest blockchain block currently available.
pagination
object (ResponsePaginationData) 
required
Pagination info for the generated response.
data
array[object (Transaction) {3}] 
Data
required
receipt
Receipt
required
Receipt of a transaction.
arguments
object 
Arguments
required
Object with data passed to the invoked function of blockchain runtime logic. It is an object with keys as the argument names and values as the argument values.
events
array[object (EventTx) {2}] 
Events
required
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": [
        {
            "receipt": {
                "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
                "block_index": 29702,
                "block_timestamp": 1727581488000,
                "tx_type": "signed",
                "tx_hash": "0x4c9d18b01f98df18c8730230afb92be703be19f0884b86113e0e72251b806eb3",
                "tx_index": 2,
                "tx_module": "PlayerTransfers",
                "tx_function": "submit_transfer_assets",
                "tx_origin": {
                    "address": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
                    "account_id": "0xe079a519da31f627a19daf986c30d63ea24c6ce8762a19487d88077aaf1cc033",
                    "address_type": "regular",
                    "app_agent_id": null,
                    "ta_id": null,
                    "address_name": null
                },
                "tx_origin_nonce": 0,
                "events_number": 3
            },
            "arguments": {
                "id": 32,
                "target": {
                    "address": "ttnHxmq7B2xwZnG28puQCw8kgxsXY4yKvucRzRHqJq2gftLW6",
                    "account_id": "0x3244dc7318398fe43dd214d0ffdd1f8d0603a73fc286f4d758caaf5bbfddf702",
                    "address_type": "regular",
                    "app_agent_id": null,
                    "ta_id": null,
                    "address_name": null
                },
                "amount": 5
            },
            "events": [
                {
                    "receipt": {
                        "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
                        "block_index": 29702,
                        "block_timestamp": 1727581488000,
                        "tx_type": "signed",
                        "tx_hash": "0x4c9d18b01f98df18c8730230afb92be703be19f0884b86113e0e72251b806eb3",
                        "tx_index": 2,
                        "tx_module": "PlayerTransfers",
                        "tx_function": "submit_transfer_assets",
                        "tx_origin": {
                            "address": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
                            "account_id": "0xe079a519da31f627a19daf986c30d63ea24c6ce8762a19487d88077aaf1cc033",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "event_index": 1,
                        "event_module": "Assets",
                        "event_name": "Transferred",
                        "event_phase": "ApplyExtrinsic"
                    },
                    "attributes": {
                        "asset_id": 32,
                        "from": {
                            "address": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
                            "account_id": "0xe079a519da31f627a19daf986c30d63ea24c6ce8762a19487d88077aaf1cc033",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "to": {
                            "address": "ttnHxmq7B2xwZnG28puQCw8kgxsXY4yKvucRzRHqJq2gftLW6",
                            "account_id": "0x3244dc7318398fe43dd214d0ffdd1f8d0603a73fc286f4d758caaf5bbfddf702",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "amount": 5
                    }
                },
                {
                    "receipt": {
                        "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
                        "block_index": 29702,
                        "block_timestamp": 1727581488000,
                        "tx_type": "signed",
                        "tx_hash": "0x4c9d18b01f98df18c8730230afb92be703be19f0884b86113e0e72251b806eb3",
                        "tx_index": 2,
                        "tx_module": "PlayerTransfers",
                        "tx_function": "submit_transfer_assets",
                        "tx_origin": {
                            "address": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
                            "account_id": "0xe079a519da31f627a19daf986c30d63ea24c6ce8762a19487d88077aaf1cc033",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "event_index": 2,
                        "event_module": "TransactionPayment",
                        "event_name": "TransactionFeePaid",
                        "event_phase": "ApplyExtrinsic"
                    },
                    "attributes": {
                        "who": {
                            "address": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
                            "account_id": "0xe079a519da31f627a19daf986c30d63ea24c6ce8762a19487d88077aaf1cc033",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "actual_fee": 0,
                        "tip": 0
                    }
                },
                {
                    "receipt": {
                        "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
                        "block_index": 29702,
                        "block_timestamp": 1727581488000,
                        "tx_type": "signed",
                        "tx_hash": "0x4c9d18b01f98df18c8730230afb92be703be19f0884b86113e0e72251b806eb3",
                        "tx_index": 2,
                        "tx_module": "PlayerTransfers",
                        "tx_function": "submit_transfer_assets",
                        "tx_origin": {
                            "address": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
                            "account_id": "0xe079a519da31f627a19daf986c30d63ea24c6ce8762a19487d88077aaf1cc033",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "event_index": 3,
                        "event_module": "System",
                        "event_name": "ExtrinsicSuccess",
                        "event_phase": "ApplyExtrinsic"
                    },
                    "attributes": {
                        "dispatch_info": {
                            "weight": {
                                "ref_time": 452619073,
                                "proof_size": 6208
                            },
                            "class": {
                                "option": "Normal",
                                "payload": null
                            },
                            "pays_fee": {
                                "option": "No",
                                "payload": null
                            }
                        }
                    }
                }
            ]
        },
        {
            "receipt": {
                "block_hash": "0x825629604055537b62aedc82db1d214feb92d0bc7cef450f233e428bbf851403",
                "block_index": 29701,
                "block_timestamp": 1727581482000,
                "tx_type": "signed",
                "tx_hash": "0x6d15b4f2e65d289450ebed790292a6e54c0c64e7b0217575113cc25de42fbabe",
                "tx_index": 2,
                "tx_module": "PlayerTransfers",
                "tx_function": "submit_transfer_nfts",
                "tx_origin": {
                    "address": "ttmfeDNnbqZ2RwJou1L41qhJJuYrEgTNVfb6tYvrjDsGnjkhE",
                    "account_id": "0x16918cb054ffb795a293ecd4dbfd7d3b36a8dc30cc0d769f34d9e9983f403b53",
                    "address_type": "regular",
                    "app_agent_id": null,
                    "ta_id": null,
                    "address_name": null
                },
                "tx_origin_nonce": 144,
                "events_number": 3
            },
            "arguments": {
                "collection": 17,
                "item": 754266,
                "dest": {
                    "address": "ttnCSi8iaGuFXTRvdrzn17cVyUfnHeWqF91sdksdXB19V9y4j",
                    "account_id": "0x2e0f6e39e5306a3905d31c3edff91c53059ddfbd4ec7fe93ea515b5b3bad7e29",
                    "address_type": "regular",
                    "app_agent_id": null,
                    "ta_id": null,
                    "address_name": null
                }
            },
            "events": [
                {
                    "receipt": {
                        "block_hash": "0x825629604055537b62aedc82db1d214feb92d0bc7cef450f233e428bbf851403",
                        "block_index": 29701,
                        "block_timestamp": 1727581482000,
                        "tx_type": "signed",
                        "tx_hash": "0x6d15b4f2e65d289450ebed790292a6e54c0c64e7b0217575113cc25de42fbabe",
                        "tx_index": 2,
                        "tx_module": "PlayerTransfers",
                        "tx_function": "submit_transfer_nfts",
                        "tx_origin": {
                            "address": "ttmfeDNnbqZ2RwJou1L41qhJJuYrEgTNVfb6tYvrjDsGnjkhE",
                            "account_id": "0x16918cb054ffb795a293ecd4dbfd7d3b36a8dc30cc0d769f34d9e9983f403b53",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "event_index": 1,
                        "event_module": "Nfts",
                        "event_name": "Transferred",
                        "event_phase": "ApplyExtrinsic"
                    },
                    "attributes": {
                        "collection": 17,
                        "item": 754266,
                        "from": {
                            "address": "ttmfeDNnbqZ2RwJou1L41qhJJuYrEgTNVfb6tYvrjDsGnjkhE",
                            "account_id": "0x16918cb054ffb795a293ecd4dbfd7d3b36a8dc30cc0d769f34d9e9983f403b53",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "to": {
                            "address": "ttnCSi8iaGuFXTRvdrzn17cVyUfnHeWqF91sdksdXB19V9y4j",
                            "account_id": "0x2e0f6e39e5306a3905d31c3edff91c53059ddfbd4ec7fe93ea515b5b3bad7e29",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        }
                    }
                },
                {
                    "receipt": {
                        "block_hash": "0x825629604055537b62aedc82db1d214feb92d0bc7cef450f233e428bbf851403",
                        "block_index": 29701,
                        "block_timestamp": 1727581482000,
                        "tx_type": "signed",
                        "tx_hash": "0x6d15b4f2e65d289450ebed790292a6e54c0c64e7b0217575113cc25de42fbabe",
                        "tx_index": 2,
                        "tx_module": "PlayerTransfers",
                        "tx_function": "submit_transfer_nfts",
                        "tx_origin": {
                            "address": "ttmfeDNnbqZ2RwJou1L41qhJJuYrEgTNVfb6tYvrjDsGnjkhE",
                            "account_id": "0x16918cb054ffb795a293ecd4dbfd7d3b36a8dc30cc0d769f34d9e9983f403b53",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "event_index": 2,
                        "event_module": "TransactionPayment",
                        "event_name": "TransactionFeePaid",
                        "event_phase": "ApplyExtrinsic"
                    },
                    "attributes": {
                        "who": {
                            "address": "ttmfeDNnbqZ2RwJou1L41qhJJuYrEgTNVfb6tYvrjDsGnjkhE",
                            "account_id": "0x16918cb054ffb795a293ecd4dbfd7d3b36a8dc30cc0d769f34d9e9983f403b53",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "actual_fee": 0,
                        "tip": 0
                    }
                },
                {
                    "receipt": {
                        "block_hash": "0x825629604055537b62aedc82db1d214feb92d0bc7cef450f233e428bbf851403",
                        "block_index": 29701,
                        "block_timestamp": 1727581482000,
                        "tx_type": "signed",
                        "tx_hash": "0x6d15b4f2e65d289450ebed790292a6e54c0c64e7b0217575113cc25de42fbabe",
                        "tx_index": 2,
                        "tx_module": "PlayerTransfers",
                        "tx_function": "submit_transfer_nfts",
                        "tx_origin": {
                            "address": "ttmfeDNnbqZ2RwJou1L41qhJJuYrEgTNVfb6tYvrjDsGnjkhE",
                            "account_id": "0x16918cb054ffb795a293ecd4dbfd7d3b36a8dc30cc0d769f34d9e9983f403b53",
                            "address_type": "regular",
                            "app_agent_id": null,
                            "ta_id": null,
                            "address_name": null
                        },
                        "event_index": 3,
                        "event_module": "System",
                        "event_name": "ExtrinsicSuccess",
                        "event_phase": "ApplyExtrinsic"
                    },
                    "attributes": {
                        "dispatch_info": {
                            "weight": {
                                "ref_time": 468294751,
                                "proof_size": 4326
                            },
                            "class": {
                                "option": "Normal",
                                "payload": null
                            },
                            "pays_fee": {
                                "option": "No",
                                "payload": null
                            }
                        }
                    }
                }
            ]
        }
    ]
}
🟠422Parameter Error
Modified at 2024-11-21 18:59:09
Previous
Blocks
Next
Events
Built with