Comment on page
avax.getAtomicTx
Gets a transaction by its ID.
The
avax.getAtomicTx
command is used to obtain a transaction using its ID. The command has an optional encoding parameter specifying the format for the transaction it returns. The format can be either c58b or hex, but defaults to cb58.
avax.getAtomicTx({
txID: string,
encoding: string, //optional
}) -> {
tx: string,
encoding: string,
blockHeight: string
}
txID
is the transaction ID. It should be in cb58 format.encoding
is the encoding format to use. Can be eithercb58
orhex
. Defaults tocb58
.
tx
is the transaction encoded toencoding
.encoding
is theencoding
.blockHeight
is the height of the block which the transaction was included in.
Request
curl -X POST --data '{
"jsonrpc":"2.0",
"id" :1,
"method" :"avax.getAtomicTx",
"params" :{
"txID":"2GD5SRYJQr2kw5jE73trBFiAgVQyrCaeg223TaTyJFYXf2kPty",
"encoding": "cb58"
}
}' -H 'content-type:application/json;' https://ava-mainnet.blastapi.io/<project-id>/ext/bc/C/avax
Result
{
"jsonrpc": "2.0",
"result": {
"tx": "111111115k3oJsP1JGxvsZPFh1WXzSYNVDtvgvZ4qDWtAs5ccogA1RtT3Me5x8xgkj7cyxaNGEHuMv5U34qo94fnvHweLeSRf31ggt3MoD7MHSDw6LbiXeaJa3uwBDHzd6tPxw17478X13Ff7DkHtbWYYx2WTcJYk4nVP2swCHjBE3uQjmu6RdhtgZCxvnD6YVpEsXqvam6cDzpf5BLaosYCSt5p8SmLU2ppaSb6DPA4EW4679ygUxiDNP3SFagjUvzSrfBJRFCzsan4ZJqH8haYqpJL42TUN4q3eFKvscZfp2v2WWEEwJYmJP4Nc1P7wndeMxPFEm3vjkBaVUZ5k25TpYtghq6Kx897dVNaMSsTAoudwqTR1cCUGiR3bLfi82MgnvuApsYqtRfaD9deSHc8UA1ohPehkj9eaY",
"encoding": "cb58",
"blockHeight": "1"
},
"id": 1
}
Last modified 1yr ago