agent
swap

Deprecated: create plus an informational fresh quote

Deprecated; use /agent/swap/create. Same request (quote-bound, idempotency-key required) and response as create, plus an informational fresh data.quote. The quoteId governs, not the fresh quote.

post/agent/swap/execute

Request

  • Base URL: https://xmrtousdc.xyz/api/v1
  • URL: https://xmrtousdc.xyz/api/v1/agent/swap/execute
  • Auth: none declared. Required headers: idempotency-key

Headers

idempotency-keystring required

Required on agent create and execute (400 idempotency_key_required without it). Use a new random value per order, such as a UUID from crypto.randomUUID(); never a guessable one, because anyone who knows the key can look the order up. Reuse it only to retry this same create: the same key and body return the same order (header idempotent-replayed: true) with its live state. Retry with it after network errors, timeouts and 503 order_outcome_unknown.

Request body

quoteIdstring required

data.quoteId from POST /agent/swap/quote. Required by default (400 quote_required).

tostring

Destination, needed only when the quote had none. x2u: EVM address (0x + 40 hex; a mixed-case address must pass EIP-55; never the zero address or a token contract). u2x: Monero mainnet address (95 or 106 chars, checksum verified). Surrounding spaces are trimmed.

direction'x2u' | 'u2x'

Optional; must match the quote.

amountstring

Optional; must equal the quote's data.amount.

quoteIntentDigeststring

Optional: data.intentCommitment.digest from the quote (requires quoteId). Swapper compares it with the stored quote before creating a new order; a mismatch is 409 quote_intent_mismatch.

sessionIdstring uuid

Optional grouping UUID. Usually omit it: the BFF derives one from the idempotency-key, and GET /agent/swap/orders?idempotencyKey= finds the order either way.

Example request

{
  "to": "0x1111111111111111111111111111111111111111"
}

Response

Execute response (create response plus an informational data.quote)

okboolean
operationstring
state'waiting_for_funding' | 'deposit_detected' | 'swap_processing' | 'refunding' | 'completed' | 'terminal_failure' | 'unknown' | 'queued'

waiting_for_funding for a new order; a replayed or recovered create reports the live state. queued only on a 202 (QueuedCreateResponse): no order yet.

terminalboolean

Live value (false for a new order).

outcome'completed' | 'refunded' | 'failed' | 'expired' | 'null' nullable
replayedboolean

true when this replays an earlier create under the same idempotency-key: state, terminal, outcome, next and payable are read from the live order.

recoveredboolean

true when the order was found after an unknown provider outcome; live state as for replayed.

Example response

{
  "operation": "swap.create",
  "data": {
    "deposit": {
      "payment": {
        "uri": "monero:<deposit address>?tx_amount=0.5",
        "gas": {
          "symbol": "ETH",
          "chain": "Arbitrum One"
        }
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.