parseTransactionPlanInput

function parseTransactionPlanInput(input): TransactionPlan;

Parses a TransactionPlanInput and returns a TransactionPlan.

This function handles the following input types:

Parameters

ParameterTypeDescription
inputTransactionPlanInputThe input to parse into a transaction plan.

Returns

TransactionPlan

The parsed transaction plan.

Examples

Parsing a single transaction message.

const plan = parseTransactionPlanInput(myTransactionMessage);
// Equivalent to: singleTransactionPlan(myTransactionMessage)

Parsing an array of transaction messages.

const plan = parseTransactionPlanInput([messageA, messageB]);
// Equivalent to: sequentialTransactionPlan([messageA, messageB])

Parsing a mixed array with nested plans.

const plan = parseTransactionPlanInput([
  messageA,
  parallelTransactionPlan([messageB, messageC]),
]);
// Returns a sequential plan containing:
// - A single transaction plan for messageA.
// - The parallel plan for messageB and messageC.

Single-element arrays are unwrapped.

const plan = parseTransactionPlanInput([myTransactionMessage]);
// Equivalent to: singleTransactionPlan(myTransactionMessage)

See

On this page