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

construction/parse - Cardano

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

This endpoint parses a transaction, signed or unsigned, back into its operations. It is used to confirm a constructed transaction matches the original intent before signing or submitting.

Parameters

The request body is a JSON object with the following fields.

Field
Type
Required
Description

network_identifier

object

Yes

The network to parse for

signed

boolean

Yes

Whether the supplied transaction is signed

transaction

string

Yes

The transaction CBOR hex to parse

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/construction/parse' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network_identifier": {
        "blockchain": "cardano",
        "network": "mainnet"
    },
    "signed": false,
    "transaction": "a400818258200e...unsigned-cbor..."
}'
example.js
const response = await fetch(
    'https://go.getblock.io/<ACCESS-TOKEN>/construction/parse',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "signed": false, "transaction": "a400818258200e...unsigned-cbor..."})
    }
);
console.log(await response.json());
example.py
import requests

response = requests.post(
    'https://go.getblock.io/<ACCESS-TOKEN>/construction/parse',
    headers={'Content-Type': 'application/json'},
    json={"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "signed": false, "transaction": "a400818258200e...unsigned-cbor..."}
)

print(response.json())

Response

Response Parameters

Field
Type
Description

operations

array

The operations decoded from the transaction

account_identifier_signers

array

Accounts that signed, for a signed transaction

Use Cases

  • Intent Verification: Confirm a built transaction matches the intent

  • Signer Checks: Read which accounts signed a transaction

  • Debugging: Inspect the operations of a constructed transaction

  • Safety: Validate a transaction before submitting it

Error Handling

Error Code
Message
Description

1

Invalid request

A required construction field is missing or malformed

6

Transaction decode failed

The supplied transaction could not be decoded

14

Invalid signature

A supplied signature is malformed or does not match

5

Internal error

The node failed to process the construction step

Was this helpful?