Checks
Pre-flight: would this spend be allowed by the wallet's policy?
POST
/v1/checksThe decision is made from the wallet's in-memory Durable Object state, after one database read to resolve the active policy version. allow/deny with the violated rule and remaining budget. Counterparty screening (#35) is folded in when configured.
Request body
walletstring(required)amount_usdstring(required)tokenstring(required)counterpartystring
Responses
200allow/deny with rule + remaining budget
allowedboolean(required)rulestring,null(required)reasonstring,null(required)remaining_daily_usdstring(required)policy_versioninteger(required)
403COUNTERPARTY_BLOCKED — sanctioned counterparty
404No policy for the wallet
Example
curl -X POST https://api.cofferline.com/v1/checks \
-H "authorization: Bearer $TOKEN" \
-H "content-type: application/json" \
-d '{"wallet":"…","amount_usd":"…","token":"…"}'
Pre-flight: would this prediction-market order be allowed?
POST
/v1/checks/pm-orderEvaluates the wallet's prediction_markets policy rules (per-market cap, daily loss stop, resolution exposure, market allowlist) against the prospective order, under the policy's exposure_basis (gross by default; net offsets YES/NO held in the same market). The response reports the basis used and both bases' floored figures. Geo-gated: venue-restricted jurisdictions receive 451 (JURISDICTION_BLOCKED); unknown origins fail closed.
Request body
walletstring(required)condition_idstring(required)cost_usdstring(required)stateobject
Responses
200allow/deny with the violated rule
allowedboolean(required)rulestring,null(required)reasonstring,null(required)remaining_market_cap_usdstring,null(required)policy_versioninteger(required)exposure_basis"gross" | "net"(required)exposureobject(required)
404No policy for the wallet
451JURISDICTION_BLOCKED — venue-restricted jurisdiction
503UNAVAILABLE — the server-side exposure floor could not be established (#251), so an exposure-adding order cannot be honestly pre-flighted. Same behavior as the order route itself.
Example
curl -X POST https://api.cofferline.com/v1/checks/pm-order \
-H "authorization: Bearer $TOKEN" \
-H "content-type: application/json" \
-d '{"wallet":"…","condition_id":"…","cost_usd":"…"}'