REST API
A hosted REST API that wraps every external function on every Doga contract. Reads return chain state. Writes return ready-to-sign transaction calldata — your wallet does the signing. The API never holds private keys.
| Base URL | https://core-contracts-production.up.railway.app |
| Chain | Base mainnet (id 8453) |
| Authentication | None for reads. Signature on the resulting tx for writes. |
| Content type | application/json |
Three things to know
-
Base URL is
https://core-contracts-production.up.railway.app. All paths in this section are relative. Reads (GET) are free; writes (POST) return calldata that your wallet signs and submits. -
Writes return unsigned transactions, not receipts. A
POSTto/lending/depositdoesn't deposit — it returns{ to, data, value, chainId }. Pass that toeth_sendTransactionfrom any wallet, or sign locally and relay throughPOST /tx/broadcast. See Security Model. -
BigInts are decimal strings. Amounts, indexes, and IDs that exceed
Number.MAX_SAFE_INTEGERare sent as decimal strings to preserve precision. Same on input. See Conventions.
Hello world
# liveness
curl -s https://core-contracts-production.up.railway.app/health
# {"ok":true,"time":"..."}
# what's deployed
curl -s https://core-contracts-production.up.railway.app/addresses | jq
# all collaterals registered on-chain
curl -s https://core-contracts-production.up.railway.app/collaterals | jq
# build an unsigned deposit tx
curl -sX POST https://core-contracts-production.up.railway.app/lending/deposit \
-H 'content-type: application/json' \
-d '{
"token":"0x4200000000000000000000000000000000000006",
"currency":"KES",
"amount":"1000000000000000000"
}'
The last call returns { to, data, value, chainId, function, args }.
Sign with any wallet — your user's MetaMask, your operator's HSM, your
liquidator's hot wallet — and submit.
Endpoint groups
| Prefix | Wraps | Page |
|---|---|---|
/health, /info, /addresses, /tx | Infrastructure | System & Transactions |
/roles | Roles registry | /roles |
/collaterals | Collateral whitelist + risk params | /collaterals |
/currencies | Fiat currency whitelist + interest accrual | /currencies |
/prices | Chainlink crypto prices | /prices |
/fx | Signed-push FX oracle | /fx |
/allowlist | Per-currency KYC allowlist | /allowlist |
/treasury | Treasury inflows / outflows / bad debt | /treasury |
/lending | The composer — positions, borrows, repays, liquidations, capital deployment | /lending |
Read these before you build
- Conventions — error format, status codes, BigInt encoding, currency codes.
- Security Model — why no keys, how the build-tx pattern works.
- Frontend Integration — wagmi hook, TanStack Query reads, end-to-end deposit + borrow + repay code.