getTransactionMessageLoadedAccountsDataSizeLimit

function getTransactionMessageLoadedAccountsDataSizeLimit(
    transactionMessage,
): number | undefined;

Returns the loaded accounts data size limit currently set on a transaction message, or undefined if none is set.

This function works with all transaction versions:

  • V1: Reads from the transaction message's config.loadedAccountsDataSizeLimit.
  • Legacy / V0: Searches the instructions for a SetLoadedAccountsDataSizeLimit instruction and decodes its value.

Parameters

ParameterTypeDescription
transactionMessageTransactionMessageThe transaction message to inspect.

Returns

number | undefined

The loaded accounts data size limit in bytes, or undefined if none is set.

Example

const limit = getTransactionMessageLoadedAccountsDataSizeLimit(transactionMessage);
if (limit !== undefined) {
    console.log(`Loaded accounts data size limit: ${limit}`);
}

On this page