For the complete documentation index, see llms.txt. This page is also available as Markdown.

sendrawtransaction - Dogecoin

Example code for the sendrawtransaction JSON-RPC method. Complete guide on how to use sendrawtransaction JSON-RPC in GetBlock Web3 documentation.

This method submits a signed, serialized transaction to the network and returns its transaction id on acceptance. The transaction must already be fully signed.

Parameters

Parameter
Type
Required
Description

hexstring

string

Yes

The hex-encoded signed raw transaction

allowhighfees

boolean

No

Allow a fee above the node's safety threshold. 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": ["0100000001...", false],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');
const { data } = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
  jsonrpc: '2.0', method: 'sendrawtransaction', params: ["0100000001...", false], id: 'getblock.io'
});
console.log(data.result);
example.py
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'sendrawtransaction',
        'params': ["0100000001...", false],
        'id': 'getblock.io'
    }
)

print(response.json()['result'])

Response

{
    "error": null,
    "id": "getblock.io",
    "result": "d0dd61c93cd4a571030c15b5f6a94466a8f7246b986dd318d656c910e6e5a8ed"
}

Response Parameters

Parameter
Type
Description

error

null|object

Error object when the call fails, otherwise null

id

string

Request identifier matching the request

result

string

Transaction id of the accepted transaction

Use Cases

  • Wallet Sends: Broadcast a transaction built and signed on the client

  • Payment Settlement: Push a payout to the network

  • Consolidation: Broadcast a transaction combining several small outputs

  • Retry Flows: Rebroadcast a transaction that has not been mined

Error Handling

Error Code
Message
Description

-22

TX decode failed

The hex is malformed or not a complete transaction

-25

Missing inputs

An input does not exist or is already spent

-26

Transaction rejected

The transaction failed a policy or consensus check, such as the minimum relay fee

-27

Transaction already in block chain

The transaction has already been mined

Last updated

Was this helpful?