Skip to main content
POST
Propose a swap

Authorizations

x-api-key
string
header
required

An API key (chance_sk_live_…) from https://harness.chance.cc/keys.

Path Parameters

id
string
required

The wallet's id (UUID) or its name.

Body

application/json
sell
string
required

0x token address, ETH, WETH, USDC, or a symbol the wallet holds on this chain.

buy
string
required

0x token address, ETH, WETH or USDC.

amount
string
required

Amount to sell, in the sell token's units.

chain
enum<string>
required

Must be the wallet's chain.

Available options:
ethereum,
base
slippageBps
integer
default:50
Required range: 1 <= x <= 1000
note
string

Context for the judge, treated as untrusted narration.

Response

The proposal outcome and the quote.

txId
string

Escrow transaction id. Poll it at /api/v1/escrow-transactions/{id}.

status
enum<string>
Available options:
blocked,
awaiting_user,
executing,
executed,
failed
verdict
string | null

ALLOW, BLOCK or ESCALATE. BLOCK without a scanId means the wallet's limits refused it before the judge ran.

reasoning
string | null
requestHash
string

Hash of the canonical payload the wallet will sign. Execution recomputes it and refuses on a mismatch.

simulation
object | null
approvalUrl
string | null

Set when the proposal waits for the owner. Send it to them; an API key cannot confirm.

txHash
string | null

Set when the proposal executed.

scanId
string | null

Verification id. Null when no judge ran.

creditsRemaining
integer | null

Null when no credit was charged.

proof
object | null

Null when no judge ran.

swap
object