parseInstructionOrTransactionPlanInput
Parses an InstructionPlanInput or TransactionPlanInput and returns the appropriate plan type.
This function automatically detects whether the input represents instructions or transactions and delegates to the appropriate parser:
- If the input is a transaction message or transaction plan, it delegates to parseTransactionPlanInput.
- Otherwise, it delegates to parseInstructionPlanInput.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | | InstructionPlanInput | TransactionPlanInput | The input to parse, which can be either an instruction-based or transaction-based input. |
Returns
| InstructionPlan
| TransactionPlan
The parsed plan, either an InstructionPlan or a TransactionPlan.
Examples
Parsing an instruction input.
Parsing a transaction message input.