Build
Relayer API
On this page
Base: https://batin.vercel.app/api. JSON in, JSON out. Errors are { code, error } with a matching HTTP status. Testnet only.
GET /relay/v1/info
{ "relayer": "0x…", "chainId": "1328", "pool": "0x5cCd…7E72",
"minUnshieldFee": { "1": "10000000000000000", "2": "50000" },
"limits": { "sponsoredPerClientPerHour": 5, "paidPerClientPerHour": 30, "sponsoredPerDay": 200, "perInstance": true },
"balanceWei": "…", "testnetOnly": true }
Proofs must name relayer in their ext data.
POST /relay/v1/transact
Body: a proved transaction in the SDK wire format (provedTxToJSON). Response: { "hash": "0x…" }, returned once the transaction is mined.
| Code | Status | Meaning |
|---|---|---|
NoShields |
400 | Deposits are never relayed; the depositor sends them |
BadKind, BadAsset, BadTx, BadCiphertext, DuplicateNullifier |
400 | Malformed or not a transfer, claim or withdrawal |
WrongChain / WrongPool |
400 | The proof is bound to another deployment |
RelayerMismatch |
400 | The proof names another relayer |
FeeTooLow |
400 | Below the minimum withdrawal fee |
UnknownRoot |
400 | Root not known on-chain; resync and re-prove |
NullifierSpent |
409 | Already spent or in flight (a claim race was lost) |
RateLimited / DailyBudget |
429 | Try later |
RelayerEmpty |
503 | The testnet relayer is out of SEI |
ChainUnavailable |
502 | RPC trouble |
POST /asp/v1/approve
Body: { "id": "12", "commitments": ["0x…32 bytes", "0x…32 bytes"] }. The service reads deposits(id) and approves only a pending deposit whose keccak256(abi.encode(c0, c1)) matches the record. It approves everything else on testnet. Response { "hash", "state": "approved" }. Limited to 20 requests per hour per client.
A daily cron (/asp/v1/sweep, secret-protected) approves anything left pending from the last three days.
POST /sponsor/v1/gas
Body: { "address": "0x…" }. Gas for one USDC deposit from a wallet's own Sei address. A deposit has to be sent by the depositor (only it can refund), so the relayer can't send it; instead, if the address holds at least 0.5 USDC and too little SEI for gas, the sponsor sends the difference up to about 900,000 gas at the current price. Responses: Sent (with hash), HasGas, NothingToMove, SponsorEmpty (the sponsor keeps 0.25 SEI back for claims and withdrawals), DailyLimit, RateLimited (one per address and three per client a day). SEI deposits pay their own gas and never use it.
GET /status
Pool size, deposit count, the relayer and ASP addresses, and this instance's counters.
Limits are soft
Each Vercel function instance keeps its own counters, so a determined client can exceed them by hitting several instances. The hard limit is the relayer account's balance, which is kept small. A production relayer needs a shared store and per-account quotas.
Source: apps/web/content/docs/relayer-api.md