Transaction

What is a transaction?

A transaction on a blockchain is an instruction that changes the blockchain state. For example, a transaction occurs when one person transfers a digital asset they own to another person.

This guide is designed to walk you through the steps needed to search for a transaction on the network. There are two approaches to performing a search:

  1. Using the prepare-execute model: Using this approach, the first API call will register the search request, and the second API call will perform it.
  2. Using the autoexecute model: Using this approach, there is only one API call, where the search is performed immediately.

In this page, we will only discuss the autoexecute version.

Prerequisites

Call the endpoint

Pass the transaction Id, for which you would like to perform a search, as part of the API path in <transactionId> as follows:

/v2/autoexecution/search/transaction?transactionId=<transactionId>

To get details on the transaction 0x67097e609326cec3449f9bcf3e7ccfbd3bc107dde2de068e1f669f5fa5c82cf2, build you request as below.

curl --request POST \
     --url https://api.overledger.dev/v2/autoexecution/search/transaction?transactionId=0x67097e609326cec3449f9bcf3e7ccfbd3bc107dde2de068e1f669f5fa5c82cf2\`
     --header 'Authorization: Bearer token' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
{
    "location": {
        "technology": "Ethereum",
        "network": "Ethereum Sepolia Testnet"
    }
}

If the request is successful, you will receive a response with the transaction details as below:

{
    "preparationTransactionSearchResponse": {
        "requestId": "071cc96d-2956-4c04-9e22-ca2714f4227c",
        "gatewayFee": {
            "amount": "0",
            "unit": "QNT"
        }
    },
    "executionTransactionSearchResponse": {
        "location": {
            "technology": "Ethereum",
            "network": "ethereum sepolia testnet"
        },
        "type": "CONTRACT_INVOKE",
        "timestamp": "1709896188",
        "status": {
            "value": "SUCCESSFUL",
            "code": "TXN1003",
            "description": "Transaction successful",
            "message": "Transaction successful",
            "timestamp": "1709896440"
        },
        "transaction": {
            "transactionId": "0xc0905f1811403569e54030e553ed99bf104ab27edfdbf8b795457953f4751069",
            "signature": [
                "0xf4a5d493dddf43fb94bbb27b727c16a97ec9aa09a6c5b711ebd78e531429f186",
                "0x671f37a8b653d685937865c6f9e99049abf8f1a39e0387b0d19f23f8970cf8ce",
                "1"
            ],
            "totalPaymentAmount": [
                {
                    "amount": "0",
                    "unit": "ETH"
                }
            ],
            "origin": [
                {
                    "originId": "0x6E32dA6eDbea6b4c794CD50c830753F9b134DEf0",
                    "sequence": "2"
                }
            ],
            "destination": [
                {
                    "destinationId": "0xE9bEa8DdbDbd7994e4E3184B1563570A4B734E55",
                    "smartContract": {
                        "smartContractId": "0xE9bEa8DdbDbd7994e4E3184B1563570A4B734E55",
                        "type": "CONTRACT",
                        "function": {
                            "functionId": "0x94d008ef"
                        }
                    }
                }
            ],
            "fee": {
                "amount": "0",
                "unit": "ETH"
            },
            "nativeData": {
                "hash": "0xc0905f1811403569e54030e553ed99bf104ab27edfdbf8b795457953f4751069",
                "nonce": 2,
                "blockHash": "0xc6619321b4e60241c6c7cba687022c883f363a711760cba05c9845c22d0e7671",
                "blockNumber": 5441628,
                "chainId": 11155111,
                "transactionIndex": 149,
                "from": "0x6e32da6edbea6b4c794cd50c830753f9b134def0",
                "to": "0xe9bea8ddbdbd7994e4e3184b1563570a4b734e55",
                "value": 0,
                "gasPrice": 1143859535,
                "gas": 40940,
                "input": "0x94d008ef0000000000000000000000006e32da6edbea6b4c794cd50c830753f9b134def0000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000050aefdffafe000000000000000000000000000000000000000000000000000000",
                "creates": null,
                "publicKey": null,
                "raw": null,
                "r": "0xf4a5d493dddf43fb94bbb27b727c16a97ec9aa09a6c5b711ebd78e531429f186",
                "s": "0x671f37a8b653d685937865c6f9e99049abf8f1a39e0387b0d19f23f8970cf8ce",
                "v": 1,
                "type": "0x2",
                "maxFeePerGas": 1149777809,
                "maxPriorityFeePerGas": 968028294,
                "accessList": [],
                "chainIdRaw": "0xaa36a7",
                "blockNumberRaw": "0x53085c",
                "transactionIndexRaw": "0x95",
                "valueRaw": "0x0",
                "gasPriceRaw": "0x442de94f",
                "gasRaw": "0x9fec",
                "maxFeePerGasRaw": "0x44883791",
                "maxPriorityFeePerGasRaw": "0x39b2f086",
                "nonceRaw": "0x2"
            }
        }
    }
}