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

Validate clearing transaction of an AppAgent

POST
https://api.trait.tech/tx/examine/clearing_transaction
Submit new transaction
The endpoint checks whether the provided clearing transaction will be accepted by the blockchain.
The endpoint performs all checks using the state of the blockchain for the specified finalised block.
The endpoint doesn't take into account any pending transactions, not finalised by the blockchain yet.

Request

Body Params application/json
Request params for the endpoint `/tx/examine/clearing_transaction`.
tx
object (ClearingTransactionPayload) 
required
Payload of a Clearing transaction.
tx_origin
string 
Tx Origin
required
The signatory responsible for the transaction, i.e. owner or admin of AppAgent.
>= 47 characters<= 49 characters
Match pattern:
^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{47,49}$
app_agent_id
integer 
App Agent Id
required
AppAgent ID initiating the transaction.
>= 0<= 4294967295
atomics
array[object (ClearingTransactionAtomic) {1}] 
Atomics
required
The list of atomic operations included in the transaction.
Example
{
    "tx": {
        "tx_origin": "ttmcLgs3b7tegED6wRMFAA6WLYWhYeCL1TgHv6u4VDWptiz8L",
        "app_agent_id": 1017,
        "atomics": [
            {
                "actions": [
                    {
                        "action_origin": {
                            "app_agent_address": "ttrnYjkipbBQVVvpcx349CsAvbQvF35JrXHosmbAULSZa7Uyv"
                        },
                        "module_name": "Nfts",
                        "function_name": "mint",
                        "arguments": [
                            17,
                            10000,
                            "ttmLfYytQ5CgTCrwrCZYUXRN6R4sJeDzSxmAqGAgRnhmeBCzB"
                        ]
                    }
                ]
            }
        ]
    }
}

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/examine/clearing_transaction' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tx": {
        "tx_origin": "ttmcLgs3b7tegED6wRMFAA6WLYWhYeCL1TgHv6u4VDWptiz8L",
        "app_agent_id": 1017,
        "atomics": [
            {
                "actions": [
                    {
                        "action_origin": {
                            "app_agent_address": "ttrnYjkipbBQVVvpcx349CsAvbQvF35JrXHosmbAULSZa7Uyv"
                        },
                        "module_name": "Nfts",
                        "function_name": "mint",
                        "arguments": [
                            17,
                            10000,
                            "ttmLfYytQ5CgTCrwrCZYUXRN6R4sJeDzSxmAqGAgRnhmeBCzB"
                        ]
                    }
                ]
            }
        ]
    }
}'

Responses

🟢200OK
application/json
Successful Response
Body
Response schema for the endpoint `/tx/examine/clearing_transaction`.
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 (ClearingTransactionExaminationInfo) 
required
Examination info for clearing transaction.
acceptance
boolean 
Acceptance
required
true if the transaction will be accepted by the blockchain.
rejection_info
Rejection Info
required
Description of rejection details.
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,
        "rejection_info": null
    }
}
🟠422Parameter Error
Modified at 2024-11-21 18:59:09
Previous
Validate transfer of nft tokens
Next
Build info for new transaction
Built with