getBatchBlockPayloadWithOutputs

Kadena RPC

Overview

The /chain/{chain}/payload/outputs/batch endpoint retrieves a batch of block payloads along with their outputs, given a set of payload hashes. This method enables efficient bulk data retrieval, particularly useful for applications requiring detailed information across multiple blocks.

Parameters

NameTypeRequiredDescription
apiVersionstringYesVersion of Kadena API, e.g., "0.0"
nodeVersionenumYesNode version, one of: "test-singleton", "development", "mainnet01", "testnet04"
chainstringYesThe specific chain ID from which to retrieve data.

Request Body

You should include an array of payload hashes for which payloads with outputs are to be retrieved:

{
  "payloadHashes": ["hash1", "hash2", ...]
}

Returns

A successful call to this endpoint returns an array of the requested block payloads with outputs. The results may be returned in any order.

FieldDescription
transactionsAn array of transactions included in each payload.
outputsDetailed outputs of each transaction.
minerDataData about the miner who mined each block.
transactionsHashA hash of the transactions included in each payload.
outputsHashA hash of the outputs from the transactions in each payload.
payloadHashThe hash of each payload itself, confirming the payload retrieved.

Request Example

curl --location --request POST 'https://api.tatum.io/v3/blockchain/node/kadena-mainnet/{api_key})/chainweb/{apiVersion}/{nodeVersion}/chain/{chain}/payload/outputs/batch' \
--header 'Content-Type: application/json' \
--data-raw '{
"payloadHashes": ["hash1", "hash2"]
}'
// yarn add @tatumio/tatum

import { TatumSDK, Kadena, Network } from "@tatumio/tatum";

const tatum = await TatumSDK.init<Kadena>({ network: Network.KADENA_MAINNET });

const payloadOutputsBatch = await tatum.kadena.getPayloadOutputsBatch({
  network: {
    apiVersion: "0.0",
    nodeVersion: "mainnet01",
    chain: "0", // Example chain ID
  },
  payloadHashes: ["hash1", "hash2"],
});

console.log(payloadOutputsBatch);

await tatum.destroy(); // Destroy Tatum SDK - needed for stopping background jobs