API: `devnet-bridge` (devnet gateway)
A read-mostly HTTP gateway that serves the console's API shape from the org
A read-mostly HTTP gateway that serves the console's API shape from the org
devnet. It reaches the devnet EVM via the wallet-api REST facade
(chainId 8675399) and enriches holders from the devnet holder database.
Selected by the console's Devnet environment toggle.
The bridge reaches the devnet chain only over HTTPS REST (
pkg/walletapi), avoiding heavy on-chain SDK dependencies.
Configuration
| Env var | Purpose |
|---|---|
DATABASE_URL (required) | devnet holder database (enrichment) |
BRIDGE_ADDR | HTTP listen address |
WALLET_API_URL | enables wallet-api mode |
WALLET_API_KEY | Bearer key for the wallet-api |
WALLET_CHAIN_ID | chain id (default 8675399) |
WALLET_SEED_USERS | CSV of user ids whose wallets are fetched on boot |
CORS
Access-Control-Allow-Origin: *, methods GET, POST, DELETE, OPTIONS, and
Access-Control-Allow-Headers: Authorization, Content-Type, Accept, X-Actor-Id, X-Checker-Id (Authorization is required because the console sends a Bearer token).
Modes & endpoints
Plain-DB mode (no WALLET_API_URL) - read-only; all writes return 405.
GET /health->{ok, wallet_api:false}- Reads:
/tokens,/positions(?token=),/holders,/holders/{id}/positions,/wallets/{wallet}/statement,/wallets/{wallet}/activity,/identity/{wallet},/eligibility/{wallet},/audit,/audit/verify,/identity/events,/distributions. - Subledger slice under
/sub/*:/sub/accounts,/sub/recon/status, plus/sub/payouts,/sub/holds,/sub/journal,/sub/wire-intents,/sub/bank/transactions(mostly empty in this phase).
Wallet-api mode (WALLET_API_URL set) - on-chain reads come from the
wallet-api; the holder database only enriches holders (name, email, jurisdiction,
accreditation, KYC status).
GET /health->{ok, wallet_api:true}- Reads:
/tokens(live supply),/positions,/holders,/holders/{id}/positions,/wallets/{wallet}/statement,/wallets/{wallet}/assets,/contracts,/operations,/jobs/{id}. - Writes (proxy to wallet-api as async jobs):
POST /lifecycle/mint,POST /lifecycle/burn,POST /asset(create asset),POST /deposit(USDL). Not supported by the wallet-api surface:/lifecycle/{freeze,unfreeze, forced-transfer}->501.
Data shapes
Responses match the console's FE dialect (same shapes as ta-api for
/tokens, /positions, /holders, /wallets/{wallet}/statement). Balances are
normalized to base units; the bridge converts the wallet-api's DISPLAY units at
the boundary. Async writes return {job_id}; poll GET /jobs/{id}.