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

Top-level: Flow

FlowInput

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

ResourceInput

Schemas:ResourceInputSchemaResourceSchema

HandleInput

Schema:HandleInputSchemaSolTypeSchema

Call (node)

Schemas:CallSchemaAppliedGuardSchema

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 标量类型的字面量联合:uint8uint16uint32uint64uint128uint256int128int256addressboolbytesbytes4bytes32string Schema:SolTypeSchema

Worked example

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

See also