Skip to content

API Reference

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

API ConfigurationNot configured

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)
Tokenization
POST/tokenize/airtimeMint airtime-backed asset
GET/tokenize/status/:idCheck status
AMM (Swaps)
GET/swap/quoteGet swap price quote
POST/swap/tokensExecute token swap
GET/swap/poolsList pools + reserves
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-Service-Token: YOUR_TOKEN_HERE"
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-Service-Token: YOUR_TOKEN_HERE"
Response200
{ "assets": [{ "symbol": "USDT", "contract": "0x3C8E...DDDF", "decimals": 6 }, { "symbol": "IMC", "contract": "0xF150...d5A2", "decimals": 6 }], "count": 2 }

Create Wallet

Create Wallet
curl -X POST "http://localhost:8100/api/v1/wallets/create" \
  -H "Content-Type: application/json" \
  -H "X-Service-Token: YOUR_TOKEN_HERE" \
  -d '{"userId": 1}'
Response200
{ "address": "0xe3f53fe54f8e1b5e8c86f070e4c9c2c7fa641d0d", "existing": true }

Mint IMC

Mint IMC
curl -X POST "http://localhost:8100/api/v1/assets/imc/mint" \
  -H "Content-Type: application/json" \
  -H "X-Service-Token: YOUR_TOKEN_HERE" \
  -d '{"userId": 1, "amountBase": 10000000, "externalId": "mint-001"}'
Response200
{ "amount": 10, "chain": "celo", "symbol": "IMC", "txHash": "0x..." }

Check IMC Balance

IMC Balance
curl -X GET "http://localhost:8100/api/v1/assets/imc/balance?userId=1&tenantSlug=comet" \
  -H "Content-Type: application/json" \
  -H "X-Service-Token: YOUR_TOKEN_HERE"
Response200
{ "symbol": "IMC", "chain": "celo", "balance": "10000000", "decimals": 6, "humanAmount": 10 }

Burn IMC (Holder)

Burn IMC
curl -X POST "http://localhost:8100/api/v1/assets/imc/burn-by-holder" \
  -H "Content-Type: application/json" \
  -H "X-Service-Token: YOUR_TOKEN_HERE" \
  -d '{"userId": 1, "amountBase": 3000000, "externalId": "burn-001"}'
Response200
{ "txHash": "0x...", "chain": "celo", "symbol": "IMC", "amount": 3 }

Token Swap Quote

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-Service-Token: YOUR_TOKEN_HERE"
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-Service-Token: YOUR_TOKEN_HERE" \
  -d '{"userId": 1, "from": "USDT", "to": "IMC", "amountIn": "1000000"}'
Response200
{ "status": "success", "from": "USDT", "to": "IMC", "txHash": "0x...", "chainId": 11142220 }

Tokenize Airtime

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

Authentication Headers

HeaderAuth Method
X-API-Key + X-API-SecretPer-tenant API key/secret
X-Service-TokenService token (full access)

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.