construction/parse - Cardano

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.

FieldTypeRequiredDescription
network_identifierobjectYesThe network to parse for
signedbooleanYesWhether the supplied transaction is signed
transactionstringYesThe transaction CBOR hex to parse

Request

bashcurl --location --request POST 'https://shared.eu-central-1.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

javascriptconst response = await fetch(
    'https://shared.eu-central-1.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

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.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

json{
    "operations": [
        {
            "operation_identifier": {
                "index": 0
            },
            "type": "output",
            "account": {
                "address": "addr1qxy2lpan99fcnhhyzr8w8qk4dqz4mp7g6b8h3r2v5c9d0e1f2g3h4j5k6l7m8n9p0q"
            },
            "amount": {
                "value": "9240398",
                "currency": {
                    "symbol": "ADA",
                    "decimals": 6
                }
            }
        }
    ],
    "account_identifier_signers": []
}

Response Parameters

FieldTypeDescription
operationsarrayThe operations decoded from the transaction
account_identifier_signersarrayAccounts 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 CodeMessageDescription
1Invalid requestA required construction field is missing or malformed
6Transaction decode failedThe supplied transaction could not be decoded
14Invalid signatureA supplied signature is malformed or does not match
5Internal errorThe node failed to process the construction step