Kit
Functions

assertIsTransactionMessageWithinSizeLimit

assertIsTransactionMessageWithinSizeLimit<TTransactionMessage>(transactionMessage): asserts transactionMessage is TransactionMessageWithinSizeLimit & TTransactionMessage

Asserts that a given transaction message is within the size limit when compiled into a transaction.

Throws a SolanaError of code SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT if the transaction message exceeds the size limit.

Type Parameters

Type ParameterDescription
TTransactionMessage extends Readonly<{ instructions: readonly Instruction<string, readonly (AccountLookupMeta<string, string> | AccountMeta<string>)[]>[]; version: TransactionVersion; }> & TransactionMessageWithFeePayer<string>The type of the given transaction message.

Parameters

ParameterType
transactionMessageTTransactionMessage

Returns

asserts transactionMessage is TransactionMessageWithinSizeLimit & TTransactionMessage

Example

assertIsTransactionMessageWithinSizeLimit(transactionMessage);
transactionMessage satisfies TransactionMessageWithinSizeLimit;

On this page