Skip to main content
NEAR Intents exposes a WebSocket endpoint for market makers (solvers) to receive and respond to quote requests in real-time. Endpoint: wss://solver-relay-v2.chaindefuser.com/ws

subscribe

Subscribe to quote requests or quote status events.
params[0]
string
required
Subscription name: "quote" or "quote_status"
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "subscribe",
  "params": ["quote"]
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "00000000-0000-0000-0000-000000000000"
}
Response fields:
  • result - Subscription ID used for receiving events and unsubscribing

quote events

After subscribing to "quote", you’ll receive events like this:
Event
{
  "jsonrpc": "2.0",
  "method": "subscribe",
  "params": {
    "subscription": "00000000-0000-0000-0000-000000000000",
    "quote_id": "00000000-0000-0000-0000-000000000000",
    "defuse_asset_identifier_in": "nep141:ft1.near",
    "defuse_asset_identifier_out": "nep141:ft2.near",
    "exact_amount_in": "1000",
    "min_deadline_ms": 60000
  }
}
Only one of exact_amount_in or exact_amount_out will be specified in each request.

quote_status events

After subscribing to "quote_status", you’ll receive settlement notifications:
Event
{
  "jsonrpc": "2.0",
  "method": "subscribe",
  "params": {
    "quote_hash": "00000000000000000000000000000000",
    "intent_hash": "00000000000000000000000000000000",
    "tx_hash": "8yFNEk7GmRcM3NMJihwCKXt8ZANLpL2koVFWWH1MEEj"
  }
}

quote_response

Respond to a quote request with a signed intent. A unique id is required in the JSON-RPC message.
quote_id
string
required
Quote request identifier from the event
quote_output
object
required
  • amount_out - Proposed amount for exact_amount_in requests
  • amount_in - Proposed amount for exact_amount_out requests
signed_data
object
required
Signed intent data (same format as publish_intent)
other_quote_hashes
string[]
Optional hashes of other quotes needed to fulfill this intent
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "quote_response",
  "params": [
    {
      "quote_id": "00000000-0000-0000-0000-000000000000",
      "quote_output": {
        "amount_out": "300"
      },
      "signed_data": {
        "standard": "nep413",
        "payload": {
          "recipient": "intents.near",
          "nonce": "Vij2xgAlKBKzAEiS6N1S/hcQLaHzX2s1fNKhBDblXT4=",
          "message": "{\"deadline\":\"2024-10-14T12:53:40.000Z\",\"intents\":[{\"intent\":\"token_diff\",\"diff\":{\"nep141:ft2.near\":\"-300\",\"nep141:ft1.near\":\"500\"}}],\"signer_id\":\"solver.near\"}"
        },
        "public_key": "ed25519:C3jXhkGhEx88Gj7XKtUziJKXEBMRaJ67bWFkxJikVxZ2",
        "signature": "ed25519:WQXG37prMyT4f1vp6JSvamsjqDR5fSnDiinSPaCoq9sPcDgFGPRiMWX7csqqudDbzc8i6wrfpemgpVX2wQDmwww"
      }
    }
  ]
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "OK"
}
Response fields:
  • result - "OK" when the quote response is accepted

unsubscribe

Unsubscribe from a subscription.
params[0]
string
required
Subscription ID returned by subscribe
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "unsubscribe",
  "params": ["00000000-0000-0000-0000-000000000000"]
}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "OK"
}
Response fields:
  • result - "OK" when unsubscribed successfully