Skip to content

Accept a reverse quote

Accept the saved reverse quote. The response supplies the escrow deadlines and swap ticket.

Endpoint
POST /maker/v1/reverse/quote/{quoteId}/accept

Examples

Set QUOTE_ID to the quoteId returned by the maker. Save the request prepared by your wallet as accept-reverse.json.

cURL
curl -sS "https://api-testnet.veylor.cash/maker/v1/reverse/quote/${QUOTE_ID:?}/accept" \
  -H 'Content-Type: application/json' \
  --data-binary @accept-reverse.json
HTTP 200
{
  "swapId": "0x0000000000000000000000000000000000000000000000000000000000000001",
  "t0": 1900000000,
  "t1": 1900003600,
  "ticket": "example-swap-ticket"
}
HTTP 404
{
  "code": "unknownQuote",
  "error": "quote is unknown, expired or already accepted"
}

Request parameters

Name In Type Presence Meaning
quoteId path string · Hex32 Required The quoteId returned for this direction.

Request body

object · ForwardAcceptance

Field JSON type Presence Meaning
userShare string · Hex64 Required User's public Pallas share, encoded as two 32-byte affine coordinates.
userProof string · Hex64 Required Proof of knowledge of the user's swap share.
viewingKeys string · Hex64 Required 64-byte Zcash viewing material for this joint account only.

Responses

HTTP 200

object · ForwardAccepted

Field JSON type Presence Meaning
swapId string · Hex32 Required 32-byte escrow identifier.
t0 integer · UnixSeconds Required End of the initial ready window, in Unix seconds.
t1 integer · UnixSeconds Required Start of the refund window for a ready swap, in Unix seconds.
lateWindow integer · Uint64 Optional Length of the forward maker's refund window after t1, in seconds.
ticket string Required Opaque credential for this swap. Supply it in the ZecSwap-Ticket header on protected relay routes.

Errors

HTTP Body Meaning
400 object · ErrorResponse Malformed input or a request rejected for this swap.
404 object · ErrorResponse Unknown quote, swap or route. An expired quote can be unknown.
413 object · ErrorResponse The request exceeds the service’s body limit.
415 object · ErrorResponse Use Content-Type: application/json.
422 object · ErrorResponse The JSON fields or encoded values do not match the request type.
503 object · ErrorResponse Temporarily unavailable, throttled, or waiting for a chain event. Respect Retry-After when present. Retry-After — Seconds to wait before retrying, when supplied.
Other object · ErrorResponse Other service error. Read code and error.
ErrorResponse fields
Field JSON type Presence Meaning
code string · ErrorCode Required Machine-readable service error code.
error string Required Human-readable detail.