curl --request POST \
--url https://api.skia.money/api/reveal \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commitId": "<string>",
"order": {
"nonce": "<string>",
"expiry": "<string>",
"signerWallet": "<string>",
"signerToken": "<string>",
"signerAmount": "<string>",
"protocolFee": "<string>",
"senderWallet": "<string>",
"senderToken": "<string>",
"senderAmount": "<string>",
"signature": "<string>",
"signatureType": 123
}
}
'import requests
url = "https://api.skia.money/api/reveal"
payload = {
"commitId": "<string>",
"order": {
"nonce": "<string>",
"expiry": "<string>",
"signerWallet": "<string>",
"signerToken": "<string>",
"signerAmount": "<string>",
"protocolFee": "<string>",
"senderWallet": "<string>",
"senderToken": "<string>",
"senderAmount": "<string>",
"signature": "<string>",
"signatureType": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
commitId: '<string>',
order: {
nonce: '<string>',
expiry: '<string>',
signerWallet: '<string>',
signerToken: '<string>',
signerAmount: '<string>',
protocolFee: '<string>',
senderWallet: '<string>',
senderToken: '<string>',
senderAmount: '<string>',
signature: '<string>',
signatureType: 123
}
})
};
fetch('https://api.skia.money/api/reveal', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skia.money/api/reveal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'commitId' => '<string>',
'order' => [
'nonce' => '<string>',
'expiry' => '<string>',
'signerWallet' => '<string>',
'signerToken' => '<string>',
'signerAmount' => '<string>',
'protocolFee' => '<string>',
'senderWallet' => '<string>',
'senderToken' => '<string>',
'senderAmount' => '<string>',
'signature' => '<string>',
'signatureType' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.skia.money/api/reveal"
payload := strings.NewReader("{\n \"commitId\": \"<string>\",\n \"order\": {\n \"nonce\": \"<string>\",\n \"expiry\": \"<string>\",\n \"signerWallet\": \"<string>\",\n \"signerToken\": \"<string>\",\n \"signerAmount\": \"<string>\",\n \"protocolFee\": \"<string>\",\n \"senderWallet\": \"<string>\",\n \"senderToken\": \"<string>\",\n \"senderAmount\": \"<string>\",\n \"signature\": \"<string>\",\n \"signatureType\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.skia.money/api/reveal")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"commitId\": \"<string>\",\n \"order\": {\n \"nonce\": \"<string>\",\n \"expiry\": \"<string>\",\n \"signerWallet\": \"<string>\",\n \"signerToken\": \"<string>\",\n \"signerAmount\": \"<string>\",\n \"protocolFee\": \"<string>\",\n \"senderWallet\": \"<string>\",\n \"senderToken\": \"<string>\",\n \"senderAmount\": \"<string>\",\n \"signature\": \"<string>\",\n \"signatureType\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skia.money/api/reveal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commitId\": \"<string>\",\n \"order\": {\n \"nonce\": \"<string>\",\n \"expiry\": \"<string>\",\n \"signerWallet\": \"<string>\",\n \"signerToken\": \"<string>\",\n \"signerAmount\": \"<string>\",\n \"protocolFee\": \"<string>\",\n \"senderWallet\": \"<string>\",\n \"senderToken\": \"<string>\",\n \"senderAmount\": \"<string>\",\n \"signature\": \"<string>\",\n \"signatureType\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"orderId": "<string>",
"txHash": "<string>",
"status": "executed",
"order": {
"nonce": "<string>",
"expiry": "<string>",
"signerWallet": "<string>",
"signerToken": "<string>",
"signerAmount": "<string>",
"protocolFee": "<string>",
"senderWallet": "<string>",
"senderToken": "<string>",
"senderAmount": "<string>",
"signature": "<string>",
"signatureType": 123
},
"onChain": true,
"settlementMode": "on-chain",
"blockNumber": 123,
"explorerUrl": "<string>",
"entryPoint": "swap",
"settlement": {
"chainId": "ethereum",
"soldToken": "<string>",
"soldAmount": "<string>",
"boughtToken": "<string>",
"boughtAmount": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}Reveal phase — triggers SwapERC20 settlement
THE state-creating step. Once-only is a SERVER invariant — transactional claim-before-execute (SV-2, LANDED 2026-11-18: a guarded updateMany claims committed→settling before ANY settlement executes; losers get ALREADY_REVEALED, failed settlements release the claim, crashed claims are reclaimable after a TTL). Idempotency-Key is a response-REPLAY aid, not the correctness mechanism; still send it on every attempt (same key for retries of the same logical reveal). Server recomputes commitmentHash from the order fields + the STORED commitNonce + stored commitmentExpiry — the stored values are authoritative, and the revealed order fields must reproduce the stored hash. Recovery path for ALREADY_REVEALED: re-read order history; the SDK reconstructs the response client-side. NEVER re-reveal after a lost response. NONCE_ALREADY_USED (409) is the advertised exit: if the taker self-settled the signed order first, the commitId is burned and the agent re-quotes.
curl --request POST \
--url https://api.skia.money/api/reveal \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commitId": "<string>",
"order": {
"nonce": "<string>",
"expiry": "<string>",
"signerWallet": "<string>",
"signerToken": "<string>",
"signerAmount": "<string>",
"protocolFee": "<string>",
"senderWallet": "<string>",
"senderToken": "<string>",
"senderAmount": "<string>",
"signature": "<string>",
"signatureType": 123
}
}
'import requests
url = "https://api.skia.money/api/reveal"
payload = {
"commitId": "<string>",
"order": {
"nonce": "<string>",
"expiry": "<string>",
"signerWallet": "<string>",
"signerToken": "<string>",
"signerAmount": "<string>",
"protocolFee": "<string>",
"senderWallet": "<string>",
"senderToken": "<string>",
"senderAmount": "<string>",
"signature": "<string>",
"signatureType": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
commitId: '<string>',
order: {
nonce: '<string>',
expiry: '<string>',
signerWallet: '<string>',
signerToken: '<string>',
signerAmount: '<string>',
protocolFee: '<string>',
senderWallet: '<string>',
senderToken: '<string>',
senderAmount: '<string>',
signature: '<string>',
signatureType: 123
}
})
};
fetch('https://api.skia.money/api/reveal', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.skia.money/api/reveal",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'commitId' => '<string>',
'order' => [
'nonce' => '<string>',
'expiry' => '<string>',
'signerWallet' => '<string>',
'signerToken' => '<string>',
'signerAmount' => '<string>',
'protocolFee' => '<string>',
'senderWallet' => '<string>',
'senderToken' => '<string>',
'senderAmount' => '<string>',
'signature' => '<string>',
'signatureType' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.skia.money/api/reveal"
payload := strings.NewReader("{\n \"commitId\": \"<string>\",\n \"order\": {\n \"nonce\": \"<string>\",\n \"expiry\": \"<string>\",\n \"signerWallet\": \"<string>\",\n \"signerToken\": \"<string>\",\n \"signerAmount\": \"<string>\",\n \"protocolFee\": \"<string>\",\n \"senderWallet\": \"<string>\",\n \"senderToken\": \"<string>\",\n \"senderAmount\": \"<string>\",\n \"signature\": \"<string>\",\n \"signatureType\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.skia.money/api/reveal")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"commitId\": \"<string>\",\n \"order\": {\n \"nonce\": \"<string>\",\n \"expiry\": \"<string>\",\n \"signerWallet\": \"<string>\",\n \"signerToken\": \"<string>\",\n \"signerAmount\": \"<string>\",\n \"protocolFee\": \"<string>\",\n \"senderWallet\": \"<string>\",\n \"senderToken\": \"<string>\",\n \"senderAmount\": \"<string>\",\n \"signature\": \"<string>\",\n \"signatureType\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.skia.money/api/reveal")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"commitId\": \"<string>\",\n \"order\": {\n \"nonce\": \"<string>\",\n \"expiry\": \"<string>\",\n \"signerWallet\": \"<string>\",\n \"signerToken\": \"<string>\",\n \"signerAmount\": \"<string>\",\n \"protocolFee\": \"<string>\",\n \"senderWallet\": \"<string>\",\n \"senderToken\": \"<string>\",\n \"senderAmount\": \"<string>\",\n \"signature\": \"<string>\",\n \"signatureType\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"orderId": "<string>",
"txHash": "<string>",
"status": "executed",
"order": {
"nonce": "<string>",
"expiry": "<string>",
"signerWallet": "<string>",
"signerToken": "<string>",
"signerAmount": "<string>",
"protocolFee": "<string>",
"senderWallet": "<string>",
"senderToken": "<string>",
"senderAmount": "<string>",
"signature": "<string>",
"signatureType": 123
},
"onChain": true,
"settlementMode": "on-chain",
"blockNumber": 123,
"explorerUrl": "<string>",
"entryPoint": "swap",
"settlement": {
"chainId": "ethereum",
"soldToken": "<string>",
"soldAmount": "<string>",
"boughtToken": "<string>",
"boughtAmount": "<string>"
}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}Authorizations
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
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
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).
Response
Order verified and settled (check onChain/settlementMode before any explorer link)
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.)
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.
swap, swapAnySender