constructionPayloads

How to use it

// Import required libraries and modules from Tatum SDK
import { TatumSDK, CardanoRosetta, Network } from '@tatumio/tatum';

// Initialize the Tatum SDK for Cardano
const tatum = await TatumSDK.init<CardanoRosetta>({ network: Network.CARDANO_ROSETTA });

// Define the input parameters in a single object
const params = {
    networkIdentifier: {
      blockchain: 'CARDANO', // Required: Specifies the blockchain .
      network: 'MAINNET', // Required: Specifies the network name .
      subNetworkIdentifier: {
        network: 'SUB_NETWORK_NAME', // Optional: Specifies the sub-network name .
        metadata: {
          KEY: 'VALUE', // Optional: Specify metadata .
        },
      },
    },
    operations: [
      {
        operation_identifier: {
          index: 1, // Required: Specifies the operation index (number).
          network_index: 0, // Optional: Specifies the network index (number).
        },
        related_operations: [
          {
            index: 2, // Optional: Specifies the related operation index (number).
            network_index: 1, // Optional: Specifies the related network index (number).
          },
        ],
        type: 'OPERATION_TYPE', // Required: Specifies the operation type.
        status: 'OPERATION_STATUS', // Optional: Specifies the operation status .
        account: {
          address: 'ACCOUNT_ADDRESS', // Required: Specifies the account address .
          sub_account: {
            address: 'SUB_ACCOUNT_ADDRESS', // Optional: Specifies the sub-account address .
            metadata: {
              // Optional metadata object for the sub-account
            },
          },
          metadata: {
            // Optional metadata object for the account
          },
        },
        amount: {
          value: 'AMOUNT_VALUE', // Required: Specifies the amount value (string).
          currency: {
            symbol: 'CURRENCY_SYMBOL', // Required: Specifies the currency symbol .
            decimals: 6, // Required: Specifies the currency decimals (number).
            metadata: {
              // Optional metadata for amount object
            },
          },
          metadata: {
            // Optional: Specify metadata here only if applicable.
          },
        },
        coin_change: {
          coin_identifier: {
            identifier: 'COIN_IDENTIFIER', // Required: uniquely identifies a Coin.
          },
          coin_action: 'coin_created', // Required
        },
        metadata: {
          // Op