appendTransactionMessageInstructionPlan
Appends all instructions from an instruction plan to a transaction message.
This function flattens the instruction plan into its leaf plans and sequentially appends each instruction to the provided transaction message. It handles both single instructions and message packer plans.
Note that any MessagePackerInstructionPlan is assumed to only append instructions. If it modifies other properties of the transaction message, the type of the returned transaction message may not accurately reflect those changes.
Type Parameters
| Type Parameter | Description |
|---|---|
TTransactionMessage extends TransactionMessage & TransactionMessageWithFeePayer<string> | The type of transaction message being modified. |
Parameters
| Parameter | Type | Description |
|---|---|---|
instructionPlan | InstructionPlan | The instruction plan containing the instructions to append. |
transactionMessage | TTransactionMessage | The transaction message to append instructions to. |
Returns
AppendTransactionMessageInstructions<TTransactionMessage>
The transaction message with all instructions from the plan appended.
Examples
Appending a simple instruction plan to a transaction message.
Appending a sequential instruction plan.