getTransactionSizeLimit

function getTransactionSizeLimit(transaction): number;

Returns the maximum size in bytes allowed for the given transaction.

The size limit depends on the transaction version: version 1 transactions allow up to V1_TRANSACTION_SIZE_LIMIT bytes, while legacy and v0 transactions are capped at LEGACY_TRANSACTION_SIZE_LIMIT bytes.

Parameters

ParameterTypeDescription
transactionTransactionThe transaction whose size limit to retrieve.

Returns

number

The maximum number of bytes the transaction may occupy.

Example

const sizeLimit = getTransactionSizeLimit(transaction);

See

On this page