TRAIT DataGate API
  1. Submit new transaction
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. Submit new transaction

Build info for new transaction

POST
https://api.trait.tech/tx/build_info
The endpoint provides all the required info to build and sign a new transaction.
This allows to create new transactions without connection to a blockchain node.

Request

Body Params application/json

Example
{
    "context": {
        "tx_origin": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e"
    }
}

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/tx/build_info' \
--header 'Content-Type: application/json' \
--data-raw '{
    "context": {
        "tx_origin": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e"
    }
}'

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
        }
    },
    "data": {
        "tx_origin": "ttrENnXUfsdTDFwweKjK1dSvCXcAtVVQ9xgARy8iBisAFfc5e",
        "tx_origin_next_tx_index": 1,
        "tx_origin_free_native_token_balance": 1000000000000000000,
        "chain_genesis_block_hash": "0x806dec5d0216895474ef81e2c61dd0cd3e8bc2a7eabb1eb76cdf8e18ad2b49be",
        "chain_name": "Trait Asset Hub",
        "chain_ss58_format": 5335,
        "block_hash": "0xab8006019066f080402ab43da043127b930ef0ffb3349a333222d67c0f542338",
        "block_index": 29702,
        "block_timestamp": 1727581488000,
        "runtime_spec_name": "trait-asset-hub-runtime",
        "runtime_spec_version": 1000,
        "runtime_transaction_version": 1,
        "runtime_metadata_raw": "0x6d6574610e6d0800"
    }
}
🟠422Parameter Error
Modified at 2024-11-21 18:59:09
Previous
Validate clearing transaction of an AppAgent
Next
Submit transaction
Built with