Frontend JSON-RPC API
Endpoint:POST https://solver-relay-v2.chaindefuser.com/rpc
These endpoints are used by frontends to request quotes and publish user intents.
quote
Request price quotes from connected solvers. The Message Bus forwards the request to all solvers, waits up to 3000ms, and returns all available options.Only one of
exact_amount_in or exact_amount_out should be provided, not both.Asset to trade from (e.g.,
nep141:ft1.near)Asset to trade to (e.g.,
nep141:ft2.near)Amount of input token for exchange
Amount of output token for exchange
Minimum validity time for offers (in milliseconds). Shorter times may yield better prices.
Response fields
Response fields
Array of quote responses from solvers:
quote_hash- Quote response hashdefuse_asset_identifier_in- Asset to trade fromdefuse_asset_identifier_out- Asset to trade toamount_in- Input amount (exact if specified, proposed otherwise)amount_out- Output amount (exact if specified, proposed otherwise)expiration_time- Expiration timestamp of the offer
Request
Response
publish_intent
Submit a signed user intent for execution. Supported signature standards:nep413, erc191, raw_ed25519.
- NEP-413
- ERC-191
- Raw Ed25519
Quote response hashes from solvers
standard-"nep413"payload.message- Stringified intent payloadpayload.nonce- Unique noncepayload.recipient-"intents.near"payload.callbackUrl- Optional, for some walletssignature- Signature of the payloadpublic_key- Signer’s public key
Response fields
Response fields
status-"OK"or"FAILED"reason- Error reason (if failed)intent_hash- Intent identifier
Request
get_status
Check the status of an intent’s execution.Intent identifier
Response fields
Response fields
intent_hash- Intent identifierstatus- Execution status (see below)data.hash- NEAR transaction hash (if available)
Status values
Status values
| Status | Description |
|---|---|
PENDING | Intent received, awaiting execution |
TX_BROADCASTED | Transaction sent to the Verifier contract |
SETTLED | Successfully settled on-chain |
NOT_FOUND_OR_NOT_VALID | Intent not received, expired, or execution error |
Request
Response
Solver WebSocket API
Endpoint:wss://solver-relay-v2.chaindefuser.com/ws
Market makers connect via WebSocket to receive and respond to quote requests in real-time.
subscribe
Subscribe to quote requests or quote status events.Subscription name:
"quote" or "quote_status"Request
Response
Quote request event
After subscribing to"quote", you’ll receive events like this:
Event
Only one of
exact_amount_in or exact_amount_out will be specified in each request.quote_response
Respond to a quote request with a signed intent. A uniqueid is required in the JSON-RPC message.
Quote request identifier from the event
amount_out- Proposed amount forexact_amount_inrequestsamount_in- Proposed amount forexact_amount_outrequests
Signed intent data (same format as
publish_intent)Optional hashes of other quotes needed to fulfill this intent
Request
Response
Quote status event
After subscribing to"quote_status", you’ll receive settlement notifications:
Event
unsubscribe
Unsubscribe from a subscription.Request
Response