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

submitTransaction - Cardano

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

This method submits a signed, serialized transaction to the network. On success it returns the transaction id; on failure it returns the list of validation errors reported by the node.

Parameters

Parameter
Type
Required
Description

transaction

object

Yes

Object with a cbor field holding the base16 transaction

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "submitTransaction",
    "params": {
        "transaction": {
            "cbor": "84a300818258200e...transaction-cbor-hex...ff"
        }
    },
    "id": "getblock.io"
}'
example.js
const response = await fetch(
    'https://go.getblock.io/<ACCESS-TOKEN>/',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"jsonrpc": "2.0", "method": "submitTransaction", "params": {"transaction": {"cbor": "84a300818258200e...transaction-cbor-hex...ff"}}, "id": "getblock.io"})
    }
);
console.log(await response.json());

Response

Response Parameters

Field
Type
Description

transaction

object

Object containing the accepted transaction id

Use Cases

  • Payment Broadcast: Submit a signed ada or asset transfer

  • dApp Backends: Broadcast transactions built and signed client-side

  • Certificate Submission: Submit staking and governance certificates

  • Retry Flows: Resubmit a dropped transaction from stored CBOR

Error Handling

Error Code
Message
Description

-32602

Invalid params

The transaction CBOR is missing or malformed

3005

Era mismatch

The transaction was built for a different ledger era

3100

Validation failure

The node rejected the transaction; see the failure list in the error data

-32603

Internal error

The node failed to process the submission

Was this helpful?