Skip to main content
The Flow document is the JSON body you submit under compose.flow in a POST /compose request. This page is a reference for the wire format the service accepts. The authoritative schema ships with @lifi/composer-sdk; when a detail here conflicts with the SDK, the SDK wins — file an issue.

Top-level: Flow

FlowInput

A union of resource inputs and handle inputs. Schema: FlowInputSchema = Union(ResourceInputSchema, HandleInputSchema).

ResourceInput

Schemas: ResourceInputSchema, ResourceSchema.

HandleInput

Schema: HandleInputSchema, SolTypeSchema.

Call (node)

Schemas: CallSchema, AppliedGuardSchema.

BindValue

bind entries are one of two shapes. Schema: BindValueSchema = Union(RefSchema, LiteralBindingSchema).

Ref

$ref is a dotpath with exactly one of three shapes — see References:
  • input.<name>
  • context.<sender|executionAddress>
  • <nodeId>.<port>
Schema: RefSchema.

LiteralBinding

Schema: LiteralBindingSchema.

AppliedGuard

Schema: AppliedGuardSchema.

Resource

Schema: ResourceSchema.

SolType

Literal union of supported Solidity scalar types: uint8, uint16, uint32, uint64, uint128, uint256, int128, int256, address, bool, bytes, bytes4, bytes32, string. Schema: SolTypeSchema.

Worked example

The swap-and-zap quickstart produces a Flow that, after builder.build(), serialises to:

See also