Currencies
- 2 endpoints
List currencies#
GET /currencies
Lists the currencies QBitFlow supports in a mode (native coins and tokens), in one page: a bounded list (hasMore false).
- Auth
- None needed
- On-Behalf-Of
- Not used (public route)
- Idempotency-Key
- Ignored
- Success
- 200
request.sh
curl https://api.qbitflow.app/v2/currencies# 200: a page of Currency ({ items, hasMore: false })// A public route limited to 60 requests a minute per IP: cache the list at start-up. One bounded// list (an array): the live currencies; test: true, the test networks'; main: true, the chains'// native coins only.const currencies = await client.currencies.list();for (const { id, code, name, chain, decimals } of currencies) { console.log(`${id}: ${code} (${name} on ${chain}), ${decimals} decimals`);}# A public route limited to 60 requests a minute: cache the list at start-up. One bounded# list: the live currencies; test=True the test networks'; main=True the native coins only.currencies = client.currencies.list()for currency in currencies: print(currency.id, currency.code, currency.name, currency.chain, currency.decimals)// A public route limited to 60 requests a minute per IP: cache the list at start-up.// One bounded list (a slice): the live currencies; Test: the test networks'; Main: the// chains' native coins only.currencies, err := client.Currencies.List(ctx, nil)if err != nil { log.Fatal(err)}for _, c := range currencies { fmt.Printf("%d: %s (%s on %s), %d decimals\n", c.ID, c.Code, c.Name, c.Chain, c.Decimals)}// One bounded list: the live currencies; test: the test networks'; main: the chains' native coins only.foreach ($client->currencies->list() as $currency) { echo "{$currency->id}: {$currency->code} ({$currency->name} on {$currency->chain}), {$currency->decimals} decimals\n";}Query parameters
testbooleanOptionaltrue for the test-network currencies, false (default) for mainnet
mainbooleanOptionaltrue: only the chains' native coins (ETH, BASE, SOL), no tokens
Response
A page: { "items": Currency[], "hasMore": …, "nextCursor"?: … }. Pass nextCursor back as cursor for the next page; it is absent when hasMore is false.
9 fields of each Currency
idintegerThe currency's id (a public catalog: ids reveal nothing)
codestringWhat requests name it by: CHAIN:TOKEN for a token ("BASE:USDC"), the chain's symbol for its native coin ("ETH")
symbolstringIts symbol ("USDC", "ETH")
namestringIts full name ("USD Coin", "Ethereum")
chainstringThe chain it is on: its native coin's symbol ("ETH", "BASE", "SOL")
decimalsintegerThe decimals of its on-chain amounts (min units = amount × 10^decimals)
addressstringOptionalA token's contract address (EVM) or mint (Solana); absent on a native coin
mainCurrencyIdintegerOptionalA token's chain: its native coin's id; absent on a native coin
testbooleanA test network's currency (true) or a live one (false)
Errors
The common codes only, as any route (what each means):
Get currency#
GET /currencies/
Returns one currency (native or token) by id, test or live: the object every response names a currency with. Unknown id: 404.
- Auth
- None needed
- On-Behalf-Of
- Not used (public route)
- Idempotency-Key
- Ignored
- Success
- 200
request.sh
curl "https://api.qbitflow.app/v2/currencies/$CURRENCY_ID"# 200: a CurrencyPath parameters
idintegerRequired
Response
A Currency.
9 fields of Currency
idintegerThe currency's id (a public catalog: ids reveal nothing)
codestringWhat requests name it by: CHAIN:TOKEN for a token ("BASE:USDC"), the chain's symbol for its native coin ("ETH")
symbolstringIts symbol ("USDC", "ETH")
namestringIts full name ("USD Coin", "Ethereum")
chainstringThe chain it is on: its native coin's symbol ("ETH", "BASE", "SOL")
decimalsintegerThe decimals of its on-chain amounts (min units = amount × 10^decimals)
addressstringOptionalA token's contract address (EVM) or mint (Solana); absent on a native coin
mainCurrencyIdintegerOptionalA token's chain: its native coin's id; absent on a native coin
testbooleanA test network's currency (true) or a live one (false)
Errors
The common codes only, as any route (what each means):
- 400validation_failed
- 404not_found
- 429rate_limit_exceeded
- 500internal
- 504timeout
Edge cases
The contract's rules for these routes: Authentication & roles · The currency object · The list — GET /currencies · Lookup by id — GET /.
Read all 4
Authentication & roles
- The two catalog routes need no credential, and an API key is accepted. A credential changes nothing in the answer: currencies are public data.
- They share a rate limit of 60 requests per minute per client IP; beyond it →
429rate_limit_exceeded(errors). Currencies rarely change: cache them client-side. - The v1 routes
GET /utils/all-available-currencies,/utils/all-main-currencies,/utils/currency/id/:idand/utils/currency/price/:currencyare gone.
The currency object
- One shape, the one every response names a currency with (
Payment.currency,Wallet.currency,TokenWallet.currency, a session'savailableCurrencies…; naming):id,code,symbol,name,chain,decimals,test, and for a tokenaddressandmainCurrencyId. codeis what requests name a currency by:CHAIN:TOKENfor a token ("BASE:USDC"), the chain's symbol for its native coin ("ETH").chainis the chain's native coin's symbol ("ETH","BASE","SOL"): a native coin'schainis its ownsymbol.address(a token's contract or mint) andmainCurrencyId(its chain's native coin) are absent on a native coin. The v1 recursivemainCurrencyobject is gone;isActiveis never serialized.
The list — GET /currencies
- The list envelope (pagination), in one page:
{ "items": [...], "hasMore": false }(a bounded catalog:limitandcursorare ignored). - Every currency, native and token, of a mode:
?test=truelists the test networks' currencies instead of the mainnet ones (defaultfalse; a query flag, not the credential's mode).?main=truekeeps the chains' native coins only (it wasGET /utils/all-main-currencies); the two combine.
Lookup by id — GET /currencies/:id
- Resolves one currency id (a currency object's
id, amainCurrencyId, an id a merchant sends inavailableCurrencyIds). Currencies keep numeric ids (a public catalog: the only numeric ids of the API, naming). Ids are unique across test and live, so no mode is needed: the currency'stestfield says which network it is on. Answers the same object as the list. - Unknown id →
404not_found. Non-numeric:id(a code such asBASE:USDCincluded) →400validation_failedonid.
The codes named here
- 400validation_
failed path/query/body failed binding or validation, or a business rule about one input (a field named in
errors) - 404not_
found unknown or out-of-scope resource; also any route hidden by a guard
- 429rate_
limit_ exceeded rate limit hit (see below)