Bridge API reference¶
The public testnet gateway is https://api-testnet.veylor.cash. It serves the maker and relayer routes below. An HTTP quote is enough to preview a price. A wallet is needed to authorize a swap, verify escrow on Ethereum, create a shielded Zcash payment and recover it if the swap refunds.
The public mainnet API is coming soon. For a first request and sample fee calculation, follow the testnet quickstart.
Forward API reference¶
Use these routes for shielded TAZ to Sepolia tUSD. Append each path to the gateway URL. POST requests use JSON. For a custom wallet, use the public Rust client to construct proofs, check the contract and determine when to reveal the user share.
| Method and path | Purpose |
|---|---|
GET /maker/v1/info |
Read the Zcash network, chain ID, swap contract and token. |
GET /relayer/v1/terms |
Read the relayer address, fee and expiry for this deployment. |
POST /maker/v1/quote |
Send units and a nonzero Ethereum payout. A shielded payout also binds the wallet-generated payoutNote. |
POST /maker/v1/quote/{quoteId}/accept |
Send the wallet’s userShare, userProof and viewingKeys. Save the returned swapId, deadlines and ticket before depositing. |
POST /relayer/v1/claim |
Submit the claim prepared by the client when the contract permits it. Send the accepted swap’s ZecSwap-Ticket header. |
POST /relayer/v1/payout |
Submit the client’s signed payout and shield data for a claimed swap, with the same ticket. |
Choose the payout route before requesting the quote. For shielded tUSD, use Route::Railgun with the wallet-generated note and a relayer fee limit. For regular tUSD, use Route::Account with a signing Ethereum connection. Set payout to that signer’s address and omit payoutNote. The signer pays Sepolia ETH for the on-chain claim and withdrawal. The two relayer POST endpoints in the table apply only to the shielded route. Reference CLI route selection
On 402 feeRequired after broadcasting the open fee, wait for the existing payment to be mined and retry the same acceptance after Retry-After. On 503, respect Retry-After when supplied. Keep the original state across retries so a timeout cannot trigger a second payment.
Reverse API reference¶
For Sepolia tUSD to shielded TAZ, check reverseEnabled in maker info. A wallet with a funded Railgun balance authorizes escrow first, then authorizes settlement after observing the Zcash deposit. The quickstart CLI’s swap command runs the forward direction. For reverse swaps use a wallet integration with the public reverse client. Reverse client
| Method and path | Purpose |
|---|---|
POST /maker/v1/reverse/quote |
Request terms with units, the wallet’s swap authorization address (user) and its committed refundNote. |
POST /maker/v1/reverse/quote/{quoteId}/accept |
Accept the checked quote. Persist the swap and set up the local Zcash account that will watch for the joint deposit before funding. |
POST /relayer/v1/reverse/fund |
When reverse funding is offered in relayer terms, submit the wallet’s prepared Railgun funding transaction. Confirm escrow on Sepolia. |
GET /maker/v1/reverse/swaps/{swapId} |
Read progress. The wallet independently scans Zcash for the full spendable deposit. |
POST /relayer/v1/reverse/ready |
Submit the wallet’s second authorization after it has verified that deposit. Follow the maker’s claim, then sweep the ZEC home. |
POST /relayer/v1/reverse/refund and POST /relayer/v1/reverse/refund-payout |
Recover eligible escrow and return tokens to the committed Railgun refund note. Use the client to check the contract state and deadlines first. |
The protocol guide explains when each side can claim or refund. Use the public wire types when constructing a request for a particular swap. Reverse request types · Reverse flow
Build a wallet integration¶
A quote-only tool needs the discovery, terms and quote endpoints above. For an agent that spends TAZ, run the CLI with a persistent wallet directory or integrate the Rust client into your wallet. The gateway handles quoting and relaying. Your wallet holds the keys, builds the proofs, broadcasts the Zcash payments and follows the swap on Sepolia.
| Integration step | Reference client behavior |
|---|---|
| Configure a wallet for a shielded payout | Construct User with Network::Testnet, Settlement::read_only, the pinned token, and Route::Railgun with your relayer fee cap. Set the maker fee cap with with_max_open_fee. |
| Quote and budget | Reserve a fresh wallet swap index. User::quote(index, units) checks the deployment and maker proof and binds the payout to the wallet. Apply your spend limit to this quote’s depositZat and fees before paying. Parse token amounts and fees as integer base units. |
| Open the swap | Persist the index and Quoted together. If Quoted::fee_due returns a fee, save the prepared payment’s transaction ID before broadcasting and wait for it to be mined. Call User::accept and persist the returned UserSwap. |
| Fund and settle | User::verify checks the opened swap and returns the joint account. Save the deposit transaction ID before broadcasting. Follow User::state on Sepolia. Use User::claim for settlement and User::refund_key to recover a deposited balance after an on-chain refund. |
- The CLI’s working implementation covers swap-index allocation, payment persistence, resuming and sweeping a refund. Forward swap driver
- The Rust client implements the wallet checks, proof construction, claim windows and payout confirmation. Wallet client
- The wire types define the JSON field names, integer encodings, proofs and payout signatures. Maker types · Relayer types
- The protocol describes fee address validation, quote expiry and retrying an acceptance after payment. Open fee protocol