Skip to content

API Reference ​

All endpoints are under /api/v1 and require authentication (see Authentication →).

▸API ConfigurationNot configured
Every endpoint, payload, and response on this page follows this choice.

Base URL ​

http://localhost:8100/api/v1

Endpoints Summary ​

MethodEndpointDescription
Health
GET/healthHealth check (no auth required)
Wallets
POST/wallets/createCreate custodial EVM wallet
GET/walletsGet wallet by userId
GET/wallets/balanceNative CELO + token balances
Assets (Dynamic)
GET/assetsList all registered assets
GET/assets/:symbol/balanceToken balance
POST/assets/:symbol/mintMint tokens to wallet
POST/:symbol/sendTransfer tokens
POST/assets/:symbol/approveApprove spender
POST/assets/:symbol/burnBurn (relayer, requires approval)
POST/assets/:symbol/burn-by-holderBurn (holder, no approval)
IMC & Airtime (see full reference →)
POST/airtime/redeemRedeem a user's IMC for Airtel airtime (lock → send → burn)
GET/admin/imc/airtime🔒 Gateway mode, bonus, CBK rate, float
GET/admin/imc/airtime-topup/quote🔒 Preview the IMC a top-up mints
POST/admin/imc/airtime-topup🔒 Book a gateway top-up and mint its IMC to the treasury
POST/imc/book🔑 Book a gateway top-up with its receipt number and mint its IMC (your API keys)
POST/imc/book-and-send🔑 The same, then deliver the minted IMC to toAddress
GET/admin/imc/treasury🔒 Treasury address and IMC balance
Exchange Rates (Central Bank of Kenya — see full reference →)
GET/ratesEvery CBK rate plus the engine's stablecoins, in KES
GET/rates/convertConvert between currencies/stablecoins at CBK mid
Networks
GET/networksThe active network and the view-only one (X-Network header)
Tokenization
POST/tokenize/airtimeMint airtime-backed asset (platform only, airtime-backed)
GET/tokenize/status/:idCheck status
Receipt Tokenization (self-service, tenant-defined — see full reference →)
POST/tokenize/receipt/standardsDefine your own receipt schema
GET/tokenize/receipt/standardsList your standards
POST/tokenize/receipt/depositDeposit a claim under a standard
POST/tokenize/receipt/:id/verifyVerify → mints on-chain, once
POST/tokenize/receipt/:id/rejectReject a claim (no mint)
POST/tokenize/receipt/:id/redeemRedeem (burn) outstanding quantity
GET/tokenize/receipt/:idGet one receipt
GET/tokenize/receiptList your receipts
AMM (Swaps, Celo/Uniswap V2)
GET/swap/quoteGet swap price quote
POST/swap/tokensExecute token swap
GET/swap/poolsList pools + reserves
Stellar AMM (CAP-38 — see full reference →)
GET/stellar/poolsGet pool reserves
GET/stellar/swap/quoteGet swap price quote
POST/stellar/swap/executeExecute swap
POST/admin/stellar/pools/createCreate pool
POST/admin/stellar/pools/depositDeposit liquidity
POST/admin/stellar/pools/withdrawWithdraw liquidity
IMM & Treasury (Internal Market Maker — see full reference →)
GET/imm/quoteGet rate-table quote
POST/imm/swapExecute swap — vault-backed if funded, synthetic mint fallback otherwise
POST/admin/imm/ratesSet a rate
GET/admin/imm/ratesList rates
GET/admin/imm/exposureCheck net exposure
GET/admin/imm/vaultCheck vault balance vs. ledger inventory
POST/admin/imm/vault/fundFund the vault with real reserves
POST/admin/imm/rebalanceFlatten vault imbalance via the AMM
POST/GET/admin/corridor/nodesCreate/list Treasury vault nodes
POST/admin/corridor/nodes/:id/seedSeed a node's initial capital
POST/GET/admin/corridor/corridorsCreate/list Treasury corridors
POST/admin/corridor/corridors/:id/executeRun one honest, balance-checked cycle
POST/admin/corridor/corridors/:id/kill-switchHalt one corridor
POST/admin/corridor/kill-switchHalt every corridor (tenant-wide)
POST/admin/corridor/rebalance/checkRun a portfolio deviation check
POST/admin/imm/cycles/preview🔒 Project the KES → Airtime → IMC → USDT cycle model
POST/GET/admin/imm/cycles🔒 Start/list arbitrage cycle runs
GET/admin/imm/cycles/:id🔒 One run with every cycle
POST/admin/imm/cycles/:id/withdraw🔒 Operator-confirmed final USDT withdrawal
Journal
GET/journalList journal entries
GET/journal/balancesAccount balances
Admin
POST/admin/tenantsCreate tenant
GET/admin/tenantsList tenants
POST/admin/assets/:symbol/registerRegister asset
DELETE/admin/assets/:symbolDeregister asset
POST/admin/pools/createCreate pool
POST/admin/pools/fundFund pool
Token Factory
POST/tokens/createDeploy + register a new token
GET/tokensList tenant's tokens
GET/tokens/:idGet token by ID
POST/tokens/:id/mintMint token
POST/tokens/:id/burnBurn token
Bridge
POST/bridge/wrapWrap a token into YSH
POST/bridge/unwrapUnwrap YSH back to a token
POST/bridge/multi-wrapWrap several tokens into YSH at once
GET/bridge/positions/:userGet wrapped YSH position
PSP Top-up
POST/admin/topup/stk-pushMobile-money STK push (deposit)
POST/admin/topup/transferMobile-money B2C transfer (withdrawal)
POST/psp/callbackPSP delivery callback (signature-verified, not X-Service-Token)

Test It ​

Health Check ​

Health Check
curl -X GET "http://localhost:8100/health" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
Response200
{
  "status": "ok",
  "service": "comet-engine",
  "chains": [
    "celo",
    "stellar"
  ]
}

chains lists whatever's actually configured on this instance — a fresh install shows just ["celo"] until Stellar (or any other chain) is set up. See Setting Up Stellar →.

List Assets ​

List Assets
curl -X GET "http://localhost:8100/api/v1/assets" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
Response200
{
  "assets": [
    {
      "symbol": "USDT",
      "contract": "0x3C8E...DDDF",
      "decimals": 6
    },
    {
      "symbol": "IMC",
      "contract": "0xF150...d5A2",
      "decimals": 6
    }
  ],
  "count": 2
}

Create Wallet → Mint → Balance → Burn ​

The same one user (userId: 1) through each step — pick a chain once, the whole sequence below follows it. Full reference for each of these: Wallets, Assets, Tokenization.

Create Wallet (Celo)
curl -X POST "http://localhost:8100/api/v1/wallets/create" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -d '{
  "userId": 1
}'
Response200
{
  "address": "0xe3f53fe54f8e1b5e8c86f070e4c9c2c7fa641d0d",
  "existing": true
}
Mint a token (Celo)
curl -X POST "http://localhost:8100/api/v1/assets/ctest/mint" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -d '{
  "userId": 1,
  "amountBase": 10000000,
  "externalId": "mint-001"
}'
Response200
{
  "amount": 10,
  "chain": "celo",
  "symbol": "IMC",
  "txHash": "0x..."
}
IMC Balance (Celo)
curl -X GET "http://localhost:8100/api/v1/assets/imc/balance?userId=1&tenantSlug=comet" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
Response200
{
  "symbol": "IMC",
  "chain": "celo",
  "balance": "10000000",
  "decimals": 6,
  "humanAmount": 10
}
Burn IMC (Celo)
curl -X POST "http://localhost:8100/api/v1/assets/imc/burn-by-holder" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -d '{
  "userId": 1,
  "amountBase": 3000000,
  "externalId": "burn-001"
}'
Response200
{
  "txHash": "0x...",
  "chain": "celo",
  "symbol": "IMC",
  "amount": 3
}

Token Swap Quote ​

The Celo Uniswap V2 AMM specifically — no Stellar equivalent (see Stellar AMM for that chain's separate native mechanism), so no toggle below.

Swap Quote
curl -X GET "http://localhost:8100/api/v1/swap/quote?from=USDT&to=IMC&amountIn=1000000" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET"
Response200
{
  "from": "USDT",
  "to": "IMC",
  "amountIn": "1000000",
  "amounts": [
    "1000000",
    "997000"
  ]
}

Execute Swap ​

Execute Swap
curl -X POST "http://localhost:8100/api/v1/swap/tokens" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -d '{
  "userId": 1,
  "from": "USDT",
  "to": "IMC",
  "amountIn": "1000000"
}'
Response200
{
  "status": "success",
  "from": "USDT",
  "to": "IMC",
  "txHash": "0x...",
  "chainId": 11142220
}

Tokenize Airtime ​

Tokenize Airtime (Celo)
curl -X POST "http://localhost:8100/api/v1/tokenize/airtime" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -d '{
  "userId": 1,
  "amountBase": "10000000",
  "externalId": "airtime-001",
  "chain": "celo"
}'
Response200
{
  "status": "success",
  "asset": "IMC",
  "type": "airtime",
  "chain": "celo",
  "txHash": "0x..."
}

Authentication Headers ​

HeaderAuth MethodUse For
X-API-Key + X-API-SecretPer-tenant API key/secretEvery endpoint above except /admin/*
X-Service-TokenService token (full access)/admin/* platform-operator routes only

See Authentication → for details.

Error Responses ​

json
{
  "error": "human-readable message",
  "details": "optional sanitized detail"
}
CodeMeaning
400Bad request / missing fields
401Auth required or invalid credentials
404Wallet, tenant, or asset not found
500Internal error
502On-chain operation failed

Released under the MIT License.