sendrawtransaction - Dogecoin

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

ParameterTypeRequiredDescription
hexstringstringYesThe hex-encoded signed raw transaction
allowhighfeesbooleanNoAllow a fee above the node's safety threshold. Default false

Request

bashcurl --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

javascriptconst 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

pythonimport 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'])

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "sendrawtransaction",
            "params": ["0100000001...", false],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;

    println!("Result: {}", response["result"]);
    Ok(())
}

Response

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

Response Parameters

ParameterTypeDescription
errornull|objectError object when the call fails, otherwise null
idstringRequest identifier matching the request
resultstringTransaction id of the accepted transaction

Acceptance means the node admitted the transaction to its mempool, not that it has been mined. Track it to the required depth before treating a payment as settled.

Dogecoin's minimum relay fee is 0.01 DOGE per kilobyte, far above Bitcoin's default. A fee sized from a Bitcoin-derived constant is rejected with error -26. Size the fee from the Blockbook estimatefee endpoint, and note that a one-block target there returns -1 rather than a usable rate.

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 CodeMessageDescription
-22TX decode failedThe hex is malformed or not a complete transaction
-25Missing inputsAn input does not exist or is already spent
-26Transaction rejectedThe transaction failed a policy or consensus check, such as the minimum relay fee
-27Transaction already in block chainThe transaction has already been mined