sendrawtransaction - Zcash
Example code for the sendrawtransaction JSON-RPC method. Complete guide on how to use the sendrawtransaction JSON-RPC method in GetBlock.io Web3 documentation.
This method submits a signed raw transaction to the network. Zebrad has no wallet functionality, so applications must construct and sign transactions using an external wallet (Zallet, Ywallet, Zashi, or a library like pyzcash) before submission. Returns the transaction ID immediately if the transaction is accepted into the mempool.
Parameters
hexstring
string
Yes
Hex-encoded signed serialized transaction
allowhighfees
boolean
No
If true, bypass the high-fee sanity check. Default false
Request
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "sendrawtransaction",
"params": [
"0400008085202f89..."
],
"id": "getblock.io"
}'const axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'sendrawtransaction',
params: [
"0400008085202f89..."
],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data.result);Response
Response Parameters
result
string
32-byte transaction ID of the submitted transaction
Use Cases
Wallet Transaction Submission: Submit locally-signed transactions from Zallet, Ywallet, or Zashi to the network
Bridge Relayer Submission: Cross-chain bridges submit signed transactions relaying messages onto Zcash
Backend Automation: Custody systems using external HSM-backed signers submit signed transactions programmatically
Test Environment Broadcasts: Submit test-signed transactions to Testnet during application development
Error Handling
-22
TX decode failed
Transaction hex is malformed or the byte structure is invalid
-25
TX rejected
Transaction rejected by consensus rules (invalid script, insufficient fee, etc.)
-26
TX not accepted
Transaction rejected by mempool policy (e.g. non-standard, low fee, duplicate)
-27
Transaction already in block chain
This transaction was already mined
-32602
Invalid params
Hex string is malformed
Last updated
Was this helpful?