avm.issueTx - AVAX
Example code for the avm.issueTx JSON-RPC method. Complete guide on how to use avm.issueTx JSON-RPC in GetBlock Web3 documentation.
Broadcasts a signed X-Chain transaction to the network. The transaction must be constructed and signed offline (typically via AvalancheJS) and submitted as an encoded blob.
Parameters
tx
string
Yes
Signed transaction blob
encoding
string
No
Encoding — "hex" (default) or "cb58"
Request Example
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ext/bc/X' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "avm.issueTx",
"params": {
"tx": "0x0000000000000003000000000000000000000000000000000000000000000000000000000000000000000000...",
"encoding": "hex"
},
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "avm.issueTx",
"params": {
"tx": "0x0000000000000003000000000000000000000000000000000000000000000000000000000000000000000000...",
"encoding": "hex"
},
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ext/bc/X',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data, null, 2)))
.catch(error => console.log(error));Response Example
Response Parameters
result.txID
string
Transaction ID — use avm.getTxStatus to track inclusion
Use Cases
Broadcasting X-Chain asset transfers
Creating new native assets on Avalanche
Atomic cross-chain operations from X-Chain
Error Handling
404
Not Found
Missing or invalid <ACCESS-TOKEN>
-32602
Invalid params
Request parameters are missing or malformed
429
Too Many Requests
Rate limit exceeded for your plan
-32000
Invalid transaction
Signature invalid, malformed body, or insufficient funds
SDK Integration
Last updated
Was this helpful?