TransactionPlan

type TransactionPlan = 
  | ParallelTransactionPlan
  | SequentialTransactionPlan
  | SingleTransactionPlan;

A set of transaction messages with constraints on how they can be executed.

This is structured as a recursive tree of plans to allow for parallel execution, sequential execution and combinations of both.

Namely, the following plans are supported:

  • SingleTransactionPlan - A plan that contains a single transaction message. This is the simplest leaf in this tree.
  • ParallelTransactionPlan - A plan that contains other plans that can be executed in parallel.
  • SequentialTransactionPlan - A plan that contains other plans that must be executed sequentially. It also defines whether the plan is divisible meaning that transaction messages inside it can be split into separate batches.

Helpers are provided for each of these plans to make it easier to create them.

Example

const myTransactionPlan: TransactionPlan = parallelTransactionPlan([
  sequentialTransactionPlan([messageA, messageB]),
  messageC,
]);

See

On this page