Flow
- Discover vaults and assets through OMS registry endpoints, especially
GET /registry/vaults. - Build and sign a settlement init request.
- Submit
POST /settlement/init. - Read the approval from the
POST /settlement/initresponse, or fetch outstanding user signatures withGET /settlement/signatures/{user_id}. - Executor calls
executeAtomicSettlement(...)on the vault. - Reconcile the vault
Settledevent and OMS inventory/account events.
Raw init
Settlement request amounts are hex integer strings without a0x prefix. Use the live OMS reference for exact current wrappers.
Populate signature with the Ed25519 signature bytes over compact inner before sending.
nonce is omitted or null, the backend selects the next managed settlement nonce for that (user, sub_account, chain). If you set one explicitly, it must not collide with an in-flight lock, and the single-settlement vault call requires the exact current (user, account) settlement counter.
tpluspy
Approval delivery
POST /settlement/init returns an approval object on success. GET /settlement/signatures/{user_id} returns outstanding approval signatures for that user.
Use the REST response or the signatures endpoint as the public integration path. There is no public settlement-approval WebSocket route today.
Vault execution
The caller must be the executor registered for thesettler id. The vault verifies expiry, settler approval, executor binding, nonce, and the CE approval signature, then increments the settlement nonce before the callback. It then calls the executor callback:
expectedAmountIn, the vault pulls tokenIn from the executor with transferFrom, then transfers tokenOut to the executor. The executor must approve the vault for at least the returned tokenIn amount before or during callback execution.
executeAtomicSettlement.