ZAIC PAYMulti-chain stablecoin wallet

ZAIC PAY API

ZAIC PAY is a USSD-first multi-chain wallet. Server functions are invoked via TanStack RPC (POST /_serverFn/<id>) from the browser; external systems use the public HTTP endpoints below.

Supported chains

  • EVM mainnets: Ethereum, Base, BNB Chain, Polygon, Arbitrum, Optimism, Avalanche
  • EVM testnets: Sepolia, Base Sepolia, BSC Testnet, Polygon Amoy, Arbitrum Sepolia, Optimism Sepolia, Avalanche Fuji
  • Non-EVM testnets: Solana Devnet, Tron Nile, Stellar Testnet, XRP Testnet, Bitcoin Testnet

Endpoints

NameMethodKindDescription
registerUserPOSTServerFnCreate account: phone + 4-6 digit PIN. Provisions Stellar testnet keypair + USDC trustline.
loginWithPinPOSTServerFnAuthenticate with phone + PIN. Sets session cookie.
logoutPOSTServerFnClear the session cookie.
getMyAccountGETServerFnReturn signed-in user, wallet, ledger balances, recent transactions.
provisionMyChainsPOSTServerFnIdempotent: create HD mnemonic (if missing) and derive an address on every supported chain (EVM mainnet+testnet, Solana Devnet, Bitcoin Testnet, Tron Nile, XRP Testnet, Stellar Testnet).
getMyAddressesGETServerFnList addresses the user owns across every chain.
getMyChainBalancesGETServerFnLive on-chain balances across every chain.
sendOnChainPOSTServerFnBody: { chain, network, asset, to, amount, pin }. PIN-gated. Signs & broadcasts on chosen chain.
scanMyDepositsPOSTServerFnScan every chain for new incoming transfers; credit ledger idempotently.
sendByPhonePOSTServerFnOff-chain ledger transfer between ZAIC PAY accounts. Instant.
getChainCatalogGETServerFnMetadata for every supported chain — label, native symbol, assets, faucet.
withdrawEvmPOSTServerFnLegacy: EVM-mainnet ERC-20 withdrawal using the original per-user EVM key.
POST /api/ussdPOSTHTTPAfrica's Talking-compatible USSD handler. Form fields: sessionId, phoneNumber, text. Returns CON/END strings.
POST /api/public/cron/stellar-pollPOSTHTTPCron endpoint that polls Stellar Horizon for new deposits.

USSD menu

*284# →
ZAIC PAY
 1. Check balance (per chain)
 2. Send to phone (off-chain instant)
 3. Withdraw to wallet (chain → asset → address → amount → PIN)
 4. Receive (show address per chain)
 5. Recent activity
 6. Settings

Security

  • BIP39 mnemonic generated per user, encrypted with AES-256-GCM via WALLET_ENCRYPTION_KEY.
  • PINs hashed with bcrypt (Argon2 cannot run in this serverless runtime).
  • Session cookies: HttpOnly, Secure, SameSite=None, 30-day.
  • RLS scoped to auth.uid(); service role only inside server functions.