Skip to content
anew
08 · Documentation

API

The site's API routes with request and response examples, and the upstream API they wrap.

The site has four routes under /api. Each one forwards a request to NEAR Intents 1Click, or to Relay for the fallback price, and returns the answer without storing it. Anyone can call them, and the quote limit applies to you as it does to the site's own pages. In the examples, … marks a value that differs per order or moves with the market.

POST /api/quote

Field Type Required Meaning
amount string yes ZEC, for example "0.1", up to eight decimals
dry boolean no, defaults to true false asks for a live quote with a deposit address
recipient string for live quotes your 0x address on Robinhood Chain
refundTo string for live quotes your transparent Zcash address, t1… or t3…

A dry quote prices the road and creates nothing; if the body carries no valid addresses, the server substitutes throwaway ones. A live quote needs a valid 0x recipient and a valid transparent refund address, and it makes 1Click issue a one-time deposit address. The route takes any positive amount; the 0.01 to 2 ZEC bounds belong to the Start page.

POST /api/quote
{ "amount": "0.1", "dry": false, "recipient": "0x…", "refundTo": "t1…" }
{
  "dry": false,
  "quote": {
    "amountIn": "0.1",
    "amountInUsd": "…",
    "amountOut": "0.0597…",
    "amountOutWei": "…",
    "amountOutUsd": "…",
    "minAmountOutWei": "…",
    "timeEstimate": 454,
    "withdrawFeeWei": "10000000000000",
    "refundFeeZats": "32000",
    "depositAddress": "t1…",
    "depositMemo": null,
    "deadline": "…"
  },
  "appFees": [{ "bps": 25, "ours": false }],
  "recipient": "0x…",
  "correlationId": "…"
}
  • amountOut is net of every fee in the quote, and amountOutWei is the same amount in wei. minAmountOutWei is amountOut less the 1% slippage tolerance. timeEstimate is in seconds, counted from the moment the deposit confirms.
  • withdrawFeeWei and refundFeeZats carry the delivery fee and the refund fee, 0.00001 ETH and 0.00032 ZEC as observed on 2026-09-22.
  • deadline is the deadline 1Click returns. On 2026-09-22 it sat 72 hours after the thirty-minute deadline the site requested, and it marks the time the deposit address goes inactive. Refunds begin at the requested deadline.
  • appFees lists each app fee in the quote in basis points, and ours is true for Anew's. The entry that is not Anew's is 1Click's platform fee on keyless quotes: 20 bps on 2026-09-23 and 25 bps the day before, so read the number in the response rather than this page.
  • depositMemo passes 1Click's memo field through, and ZEC deposits carry none. correlationId is 1Click's id for the request. A dry quote returns null for depositAddress, depositMemo, deadline and recipient.

Errors come back as { "error": "…" }: 400 for a bad amount or address, 429 once a connection passes thirty quotes in a minute, and 422 or 502 when 1Click refuses or does not answer.

GET /api/status?d=<depositAddress>

{
  "ok": true,
  "status": "SUCCESS",
  "updatedAt": "…",
  "deposited": "0.1",
  "amountIn": "0.1",
  "amountOut": "0.0597…",
  "amountOutUsd": "…",
  "refunded": "…",
  "refundReason": null,
  "originTx": ["…"],
  "destinationTx": ["0x…"],
  "confirmedRecipient": "0x…",
  "confirmedRefundTo": "t1…",
  "confirmedAsset": "nep141:hood.omft.near"
}

status is one of PENDING_DEPOSIT, KNOWN_DEPOSIT_TX, PROCESSING, SUCCESS, INCOMPLETE_DEPOSIT, REFUNDED or FAILED. The route does not return EXPIRED; the Start page sets that label itself once the deadline 1Click returned passes with no deposit. originTx holds Zcash transaction ids: the deposit on a success, the refund on a refund. destinationTx holds Robinhood Chain transaction hashes. refundReason values seen on 2026-09-22 include PARTIAL_DEPOSIT, AMOUNT_LESS_THAN_MIN_AMOUNT_OUT, NO_LIQUIDITY and UNKNOWN. The three confirmed… fields repeat what NEAR Intents recorded for the deposit address, from quoteResponse.quoteRequest in 1Click's answer; the deposit screen compares the recipient and the asset with your choice. Errors: 400 without a deposit address, 404 when 1Click does not know the address, 429 when one connection asks too often, 502 when 1Click does not answer.

POST /api/deposit

POST /api/deposit
{ "depositAddress": "t1…", "txHash": "…" }
{ "ok": true, "status": "…" }

Optional. It hands 1Click the Zcash transaction id (64 hex characters) that paid the deposit address, so that NEAR Intents picks the deposit up sooner. 1Click finds the deposit without it. On 2026-09-22 1Click accepted a made-up transaction id without complaint, so "ok": true confirms delivery of the id, and says nothing about whether the transaction exists. Errors: 400 for a missing deposit address or a malformed transaction id, 429 when one connection sends too many, 502 when 1Click refuses or does not answer.

GET /api/rails

{
  "updatedAt": "…",
  "probeZec": "0.1",
  "direct": { "ok": true, "out": "0.0597…", "usd": "…", "seconds": 454 },
  "fallback": { "ok": true, "arbOut": "…", "out": "…", "seconds": … },
  "prices": { "zec": …, "eth": … },
  "fee": { "bps": 0, "live": false }
}

direct is a dry quote for 0.1 ZEC on the direct rail. fallback holds the ETH on Arbitrum One after the first leg (arbOut), the ETH on Robinhood Chain after the Relay hop (out), and Relay's time estimate for the hop (seconds). A leg that fails comes back as { "ok": false, "message": "…" }. prices are USD prices from the 1Click token list. fee is this deployment's Anew fee, and live turns true once it is above zero. The server caches the answer for sixty seconds.

Upstream: NEAR Intents 1Click

Base https://1click.chaindefuser.com/v0. The server adds authorization: Bearer <ONECLICK_JWT> when the operator sets a partner key; without one, 1Click adds its own app fee, 20 bps on 2026-09-23.

POST /v0/quote, as Anew sends it:

{
  "dry": false,
  "swapType": "EXACT_INPUT",
  "slippageTolerance": 100,
  "originAsset": "nep141:zec.omft.near",
  "depositType": "ORIGIN_CHAIN",
  "destinationAsset": "nep141:hood.omft.near",
  "amount": "10000000",
  "refundTo": "t1…",
  "refundType": "ORIGIN_CHAIN",
  "recipient": "0x…",
  "recipientType": "DESTINATION_CHAIN",
  "deadline": "…"
}

With a fee recipient configured, the body adds "appFees": [{ "recipient": "<ANEW_FEE_RECIPIENT>", "fee": <ANEW_FEE_BPS> }]. For the fallback price, /api/rails sends a dry version of the same body with destinationAsset set to nep141:arb.omft.near.

GET /v0/status?depositAddress=… needs no key and answers for anyone's deposit address. It returns the status, the swap details and the full original quote, recipient and refund address included, so you can read the recipient without Anew. The NEAR Intents explorer shows the same swap at https://explorer.near-intents.org/transactions/<depositAddress>.

POST /v0/deposit/submit takes { "txHash", "depositAddress" }. GET /v0/tokens returns the token list with prices.

Upstream: Relay

/api/rails sends POST https://api.relay.link/quote for native ETH on Arbitrum One to native ETH on Robinhood Chain, for the amount the first leg returns. It reads the output amount and the time estimate and signs nothing.

Reading the chain

The RPC is https://rpc.mainnet.chain.robinhood.com, chain id 4663. Onchain lists the reads the pages make.