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

Submit transaction

POST
https://api.trait.tech/tx/submit
Submit new transaction
The endpoint allows to submits a new transaction to the blockchain.
Transaction must be compiled into the bytes and signed by private key.

Request

Body Params application/json
Request params for the endpoint `/tx/submit`.
tx_hex
string 
Tx Hex
required
Built and signed transaction, ready to submit to the blockchain node. HEX encoded.
Example
{
    "tx_hex": "0x6f098b2f7e24e3b8a38247819eb3cacc15ab9acf0f370bc282a036541fd0882f9463de152ae46693d798920db205bad728575416d9962bd1afd52d3fcbf4830385a895b2ec4841597e17dfa8cb4f1fbe4fa60bbafc0c24a39f4311217fa5b273ef651e02"
}

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/tx/submit' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tx_hex": "0x6f098b2f7e24e3b8a38247819eb3cacc15ab9acf0f370bc282a036541fd0882f9463de152ae46693d798920db205bad728575416d9962bd1afd52d3fcbf4830385a895b2ec4841597e17dfa8cb4f1fbe4fa60bbafc0c24a39f4311217fa5b273ef651e02"
}'

Responses

🟢200OK
application/json
Successful Response
Body
Response schema for the endpoint `/tx/submit`.
metadata
object (ResponseMetadata) 
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.
data
object (TxSubmissionInfo) 
required
Information with results of submission of transaction to the blockchain.
acceptance
boolean 
Acceptance
required
true if transaction was accepted by the blockchain node and blockchain started to process it.
success_info
Success Info
required
Information about successful submission of TX
rejection_info
Rejection Info
required
Information about rejection of TX
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": {
        "acceptance": true,
        "success_info": {
            "tx_hash": "0xa96cde3f830cc96d793dcbede08d7f27457fb462a11e0297d0f76e44031f3640"
        },
        "rejection_info": null
    }
}
🟠422Parameter Error
Modified at 2024-11-21 18:59:09
Previous
Build info for new transaction
Next
Get transaction status
Built with