avax.getAtomicTx

Returns the specified transaction.

📘

Supported on Avalanche C-Chain (mainnet) only.

Parameters

  • txID - string - The transaction ID in hex format.
  • encoding - string - (optional) The encoding format to use. Can only be hex when a value is provided.

Returns

  • tx - string - The transaction encoded to encoding.
  • encoding - string - The encoding format.
  • blockHeight - string - The height of the block which the transaction was included in.

API Endpoint

The format of an Avalanche C-Chain API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/avalanche-c/ext/bc/C/rpc - for RPC API
https://open-platform.nodereal.io/{{apiKey}}/avalanche-c/ext/bc/C/avax - for AVAX API

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/avalanche-c/ext/bc/C/rpc
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/avalanche-c/ext/bc/C/avax

Example

Request

curl --location --request POST https://open-platform.nodereal.io/{{apiKey}}/avalanche-c/ext/bc/C/avax \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc":"2.0",
    "id"     :1,
    "method" :"avax.getAtomicTx",
    "params" :{
        "txID":"2GD5SRYJQr2kw5jE73trBFiAgVQyrCaeg223TaTyJFYXf2kPty",
        "encoding": "hex"
    }
}'

Result

{
  "jsonrpc": "2.0",
  "result": {
    "tx": "0x000000000000000030399d0775f450604bd2fbc49ce0c5c1c6dfeb2dc2acb8c92c26eeae6e6df4502b19d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf000000018212d6807a0ec9c1b26321418fe7a548180b5be728ce53fe7e98ab5755ed316100000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000005000003a352a382400000000100000000000000018db97c7cece249c2b98bdc0226cc4c2a57bf52fc000003a3529edd17dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000010000000900000001ead19377f015422fbb8731204fcf6d6879dd05146c2d5b5594e2fea2cb420b2f40bd457b71e279e547790b28fe5482f278c76cf39b2dce5c2e6c53352fe6827d002cc7d20d",
    "encoding": "hex",
    "blockHeight": "1"
  },
  "id": 1
}