assertMaxInstructionsPerTransaction
Asserts that a transaction message holding numInstructions instructions does not exceed the
given maximum number of instructions per transaction.
Use it in a custom MessagePacker before appending an instruction — passing the count the message would have after the append — so the transaction planner knows to pack the instruction into another transaction message.
Parameters
| Parameter | Type |
|---|---|
numInstructions | number |
maxInstructions | number |
Returns
void
Example
Throws
Throws a SolanaError with code
SOLANA_ERROR__INSTRUCTION_PLANS__MAX_INSTRUCTIONS_PER_TRANSACTION_EXCEEDED if
numInstructions exceeds maxInstructions.