Import
Usage
Parameters
Thesubmit function accepts a SubmitInstructionInput:
| Property | Type | Required | Description |
|---|---|---|---|
role | string | Yes | Your role: "seller" or "buyer". |
party | InstructionPartyInput | Yes | Your party details. |
legs | InstructionLegInput[] | Yes | What you’re delivering. |
templateSlug | string | Yes | The settlement template to use. |
timeoutAt | string | Yes | ISO 8601 datetime for settlement timeout. |
tradeReference | string | No | Existing trade reference to match. Omit for new trade. |
feeMode | "seller_pays" | "buyer_pays" | "split" | No | Fee mode override. |
InstructionPartyInput
| Property | Type | Required | Description |
|---|---|---|---|
external_reference | string | Yes | Your internal account or entity ID. |
name | string | No | Display name for the party. |
wallet_address | string | Yes | On-chain wallet address (for compliance screening). |
chain_id | number | No | Blockchain network for the wallet. |
InstructionLegInput
| Property | Type | Required | Description |
|---|---|---|---|
instrument_id | string | Yes | Token address, ISIN, or currency code. |
quantity | string | Yes | Amount to deliver (as string for precision). |
direction | "deliver" | "receive" | Yes | Usually "deliver" (what you’re sending). |
leg_type | string | No | Defaults to "asset_delivery". |
chain_id | number | No | Blockchain network for this leg. |
token_standard | string | No | e.g., "ERC-20", "ERC-3643". |
Return Type
| Property | Type | Description |
|---|---|---|
submit | function | Submit the instruction. Returns the result and throws on error. |
result | InstructionResult | null | Result of the last submission. |
isSubmitting | boolean | true while the submission is in progress. |
error | string | null | Error message from the last submission. |
reset | () => void | Clear result and error for a new submission. |
InstructionResult
| Property | Type | Description |
|---|---|---|
id | string | The instruction UUID. |
tradeReference | string | The trade reference (generated if not provided). |
status | string | "pending_match" or "matched". |
settlementId | string | null | Settlement ID if matched, null if pending. |
role | string | The role you submitted as. |
createdAt | string | ISO 8601 creation timestamp. |
Bilateral Flow
The bilateral settlement flow works in two steps:- First party submits - Gets
status: "pending_match"and a trade reference - Second party submits with same trade reference - Gets
status: "matched"and a settlement ID