signrawtransaction - Dogecoin

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

This method signs inputs for a raw transaction (serialized, hex-encoded).

Notes:

  • Private keys must be provided if wallet doesn't contain them.

  • Returns complete: false if more signatures are needed.

  • Sighash types: ALL, NONE, SINGLE (with optional ANYONECANPAY).

Parameters

Parameter
Type
Required
Description

hexstring

string

Yes

The hex-encoded raw transaction.

prevtxs

array

No

Array of previous transaction outputs.

privkeys

array

No

Array of private keys for signing.

sighashtype

string

No

Signature hash type (default: ALL).

Previous Transaction Object Structure

{
    "txid": "transaction_id",
    "vout": 0,
    "scriptPubKey": "hex_script",
    "redeemScript": "hex_script"
}

Request

Response

Response Parameters

Field
Type
Description

hex

string

The signed raw transaction (hex-encoded).

complete

boolean

True if transaction has all required signatures.

Use Case

The signrawtransaction method is essential for:

  • Signing transactions before broadcast

  • Multi-signature transaction workflows

  • Offline transaction signing

  • Hardware wallet integration

  • Cold storage operations

Error Handling

Error Code
Message
Cause

-22

TX decode failed

Invalid raw transaction hex.

-8

Invalid parameter

Invalid prevtxs or privkeys format.

403

Forbidden

Missing or invalid ACCESS-TOKEN.

Last updated

Was this helpful?