Skip to content

Request a reverse quote

Preview the token escrow and shielded Zcash payment. The request uses placeholders for the authorization address and refund note. Have the wallet generate both for a swap you intend to fund.

Endpoint
POST /maker/v1/reverse/quote

Examples

This example requests a disposable quote. Use your wallet’s own values for a swap you intend to accept.

cURL
curl -sS "https://api-testnet.veylor.cash/maker/v1/reverse/quote" \
  -H 'Content-Type: application/json' \
  --data '{
  "units": 1000000,
  "user": "0x0000000000000000000000000000000000000001",
  "refundNote": "0x0000000000000000000000000000000000000000000000000000000000000001"
}'
HTTP 200
{
  "terms": {
    "quoteId": "0xc24630c37a4a57a5f7cf50d53bc90d4e6e934c8741922e771023230e9996bb2f",
    "maker": "0x2bac02b5032e9092493814c705f156b49e288922",
    "makerShare": "0x16eba3b9a2608ce0b260e93e17c83bb6e5b2278b2aba74760c20818c6d747fda1f6f847ee0bf1aff6a698c3522edac8aa019e7a1a31f3147ccea3b04da625172",
    "makerProof": "0xf3ef0da5497c914a2de6b8754ae6a2fac67d6664bdf0fd7fe3962a1648dfb60b3a0f37f1d83b639e4d3722effc6a9dbee79821cae2de87051c902d8341d9023d",
    "chainId": 11155111,
    "contract": "0x62ce626c5a30528b8ee33145d491785082a6cf8a",
    "token": "0x64c4a5cb09fe0b706d4cf24dc0a45fff275d727c",
    "amount": "1000000",
    "depositZat": 119116,
    "expiresAt": 1795994189,
    "networkCost": "129963"
  },
  "user": "0x0000000000000000000000000000000000000001",
  "refundNote": "0x0000000000000000000000000000000000000000000000000000000000000001",
  "fundingDeadline": 1795994784,
  "readyDeadline": 1796001084,
  "refundAfter": 1796004684
}

Request body

object · ReverseQuoteRequest

Field JSON type Presence Meaning
units integer · Uint32 Required Number of the maker's token denominations to escrow.
user string · EthereumAddress Required Fresh Ethereum authorization address for this swap.
refundNote string · Hex32 Required Hash committing to the RAILGUN note that will receive any token refund.

Responses

HTTP 200

object · ReverseQuote

Field JSON type Presence Meaning
terms object · ForwardQuote Required Maker quote fields. Here amount is the token input and depositZat is the maker's gross Zcash deposit.
user string · EthereumAddress Required User's swap authorization address.
refundNote string · Hex32 Required Shield-note commitment from the request.
fundingDeadline integer · UnixSeconds Required Last time allowed by the signed opening authorization, in Unix seconds.
readyDeadline integer · UnixSeconds Required The ready authorization must land before this time (t0).
refundAfter integer · UnixSeconds Required From this time (t1), the user may refund a ready reverse escrow.
Fields of terms
Field JSON type Presence Meaning
quoteId string · Hex32 Required Identifier used in the acceptance URL.
maker string · EthereumAddress Required Maker's Ethereum address.
makerShare string · Hex64 Required Maker's public Pallas share, encoded as two 32-byte affine coordinates.
makerProof string · Hex64 Required Proof that the maker knows its share.
chainId integer · Uint64 Required EIP-155 chain ID of the settlement network.
contract string · EthereumAddress Required Ethereum address of the settlement contract.
token string · EthereumAddress Required Ethereum address of the escrow token.
amount string · DecimalUint128 Required Gross escrow value in token base units.
depositZat integer · Uint64 Required Zcash amount payable to the joint account, in zatoshis (100,000,000 per coin).
expiresAt integer · UnixSeconds Required Quote expiry in Unix seconds.
networkCost string · DecimalUint128 Optional Maker's estimated network cost already included in the quote, in token base units.
openFee object · OpenFee Optional A forward maker may require this separate Zcash payment before acceptance.

Errors

HTTP Body Meaning
400 object · ErrorResponse Malformed input or a request rejected for this swap.
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.