Skip to main content
Flow 文档是你在 POST /compose 请求中于 compose.flow 下提交的 JSON 主体。本页是服务所接受的 wire format 参考。权威 schema 随 @lifi/composer-sdk 一起发布;当此处的细节与 SDK 冲突时,以 SDK 为准,请提交 issue。

Top-level: Flow

FlowInput

resource inputs 与 handle inputs 的联合。Schema:FlowInputSchema = Union(ResourceInputSchema, HandleInputSchema)。

ResourceInput

Schemas:ResourceInputSchema、ResourceSchema。

HandleInput

Schema:HandleInputSchema、SolTypeSchema。

Call (node)

Schemas:CallSchema、AppliedGuardSchema。

BindValue

bind 条目为两种结构之一。Schema:BindValueSchema = Union(RefSchema, LiteralBindingSchema)。

Ref

$ref 是一个点路径(dotpath),恰好为以下三种结构之一,参见 References:
  • input.<name>
  • context.<sender|executionAddress>
  • <nodeId>.<port>
Schema:RefSchema。

LiteralBinding

Schema:LiteralBindingSchema。

AppliedGuard

Schema:AppliedGuardSchema。

Resource

Schema:ResourceSchema。

SolType

受支持的 Solidity 标量类型的字面量联合:uint8、uint16、uint32、uint64、uint128、uint256、int128、int256、address、bool、bytes、bytes4、bytes32、string。 Schema:SolTypeSchema。

Worked example

swap-and-zap 快速上手会产生一个 Flow,在 builder.build() 之后序列化为:

See also