resolveMaxInstructionsPerTransaction
Resolves the maximum number of instructions a message packer may put in a transaction message.
Falls back to the default of 16 when no value is provided, which leaves headroom for inner
instructions (CPIs) that are not visible at planning time. A provided value must be a positive
integer no greater than 64 — the number of top-level instructions the transaction format can
encode.
This is typically the first thing a custom MessagePacker does with the maxInstructions
option it receives in packMessageToCapacity.
Parameters
| Parameter | Type |
|---|---|
maxInstructions? | number |
Returns
number
Example
Throws
Throws a SolanaError with code
SOLANA_ERROR__INSTRUCTION_PLANS__INVALID_MAX_INSTRUCTIONS_PER_TRANSACTION if the provided
value is not a positive integer or exceeds the transaction format's instruction limit.