Skip to main content
POST
Reveal phase — triggers SwapERC20 settlement

Authorizations

Authorization
string
header
required

TESTNET posture: simulated signature bearer — the token is the caller's 0x (address-as-identity; no per-request signature verification). Real EIP-191/EIP-712-verified bearers + SIWE (EIP-4361) sessions for the hosted UI arrive in v1.7.0. The settlement security boundary is the EIP-712 Order signature verified by SwapERC20 on-chain, not this credential. See docs/auth-posture-testnet.md.

Headers

Idempotency-Key
string

Response-REPLAY aid, NOT the correctness mechanism (R4-5): once-only settlement is a SERVER invariant (transactional claim-before-execute, SV-2 — LANDED 2026-11-18). Scope = one logical reveal (one commitId); TTL = the commitment's lifetime; same key with a DIFFERENT body or caller → 400 IDEMPOTENCY_REUSED (SV-3, LANDED 2026-11-18). Still send it on every attempt: with it, a retried reveal gets the stored response; without it, a retried reveal after a lost response relies on ALREADY_REVEALED (400) as the recovery answer.

Body

application/json

The revealed order must reproduce the STORED commitment hash over the STORED commitNonce + commitmentExpiry (server values authoritative). ORDERING INVARIANT (R4-14): revealDeadline ≤ commitmentExpiry == order.expiry (pinned to SV-8 verification).

commitId
string
required
order
object
required

The exact 9-field SwapERC20 EIP-712 struct + 2 auxiliary submission fields. Field names are contract-bound; do not rename.

Response

Order verified and settled (check onChain/settlementMode before any explorer link)

orderId
string
required
txHash
string | null
required

Receipt-confirmed hash when settled on-chain; NULL for a DB-simulated settlement. Front ends MUST surface settlementMode and MUST NOT link a simulated result to an explorer. (C8/R2-3 — the v0.1.0 contract typed a required string while the server wired a synthetic hash; that lie is fixed here.)

status
enum<string>
required
Available options:
executed
order
object
required

The exact 9-field SwapERC20 EIP-712 struct + 2 auxiliary submission fields. Field names are contract-bound; do not rename.

onChain
boolean
required

true = settled via a REAL SwapERC20 transaction; false = DB-simulated.

settlementMode
enum<string>

ADDITIVE server field (C8); clients derive it from onChain when absent.

Available options:
on-chain,
simulated
blockNumber
integer | null
explorerUrl
string | null
entryPoint
enum<string>

Which SwapERC20 entry executed — RESOLVED FROM THE STORED COMMIT SENDER (SV-6b, LANDED 2026-11-18; the rule is the contract now): sender-bound commit → swap(); zero-sender (permissionless) commit → swapAnySender(). NOT chosen by the caller at reveal.

Available options:
swap,
swapAnySender
settlement
object

Convenience echo for display; authoritative data is the order + txHash.