API reference

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

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

  • testbooleanOptional

    true for the test-network currencies, false (default) for mainnet

  • mainbooleanOptional

    true: 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
  • idinteger

    The currency's id (a public catalog: ids reveal nothing)

  • codestring

    What requests name it by: CHAIN:TOKEN for a token ("BASE:USDC"), the chain's symbol for its native coin ("ETH")

  • symbolstring

    Its symbol ("USDC", "ETH")

  • namestring

    Its full name ("USD Coin", "Ethereum")

  • chainstring

    The chain it is on: its native coin's symbol ("ETH", "BASE", "SOL")

  • decimalsinteger

    The decimals of its on-chain amounts (min units = amount × 10^decimals)

  • addressstringOptional

    A token's contract address (EVM) or mint (Solana); absent on a native coin

  • mainCurrencyIdintegerOptional

    A token's chain: its native coin's id; absent on a native coin

  • testboolean

    A 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/:id

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

request.sh

curl "https://api.qbitflow.app/v2/currencies/$CURRENCY_ID"# 200: a Currency

Path parameters

  • idintegerRequired

Response

A Currency.

9 fields of Currency
  • idinteger

    The currency's id (a public catalog: ids reveal nothing)

  • codestring

    What requests name it by: CHAIN:TOKEN for a token ("BASE:USDC"), the chain's symbol for its native coin ("ETH")

  • symbolstring

    Its symbol ("USDC", "ETH")

  • namestring

    Its full name ("USD Coin", "Ethereum")

  • chainstring

    The chain it is on: its native coin's symbol ("ETH", "BASE", "SOL")

  • decimalsinteger

    The decimals of its on-chain amounts (min units = amount × 10^decimals)

  • addressstringOptional

    A token's contract address (EVM) or mint (Solana); absent on a native coin

  • mainCurrencyIdintegerOptional

    A token's chain: its native coin's id; absent on a native coin

  • testboolean

    A test network's currency (true) or a live one (false)

Errors

The common codes only, as any route (what each means):

Edge cases

The contract's rules for these routes: Authentication & roles · The currency object · The list — GET /currencies · Lookup by id — GET /currencies/:id.

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 → 429 rate_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/:id and /utils/currency/price/:currency are gone.

The currency object

  • One shape, the one every response names a currency with (Payment.currency, Wallet.currency, TokenWallet.currency, a session's availableCurrencies…; naming): id, code, symbol, name, chain, decimals, test, and for a token address and mainCurrencyId.
  • code is what requests name a currency by: CHAIN:TOKEN for a token ("BASE:USDC"), the chain's symbol for its native coin ("ETH"). chain is the chain's native coin's symbol ("ETH", "BASE", "SOL"): a native coin's chain is its own symbol.
  • address (a token's contract or mint) and mainCurrencyId (its chain's native coin) are absent on a native coin. The v1 recursive mainCurrency object is gone; isActive is never serialized.

The list — GET /currencies

  • The list envelope (pagination), in one page: { "items": [...], "hasMore": false } (a bounded catalog: limit and cursor are ignored).
  • Every currency, native and token, of a mode: ?test=true lists the test networks' currencies instead of the mainnet ones (default false; a query flag, not the credential's mode). ?main=true keeps the chains' native coins only (it was GET /utils/all-main-currencies); the two combine.

Lookup by id — GET /currencies/:id

  • Resolves one currency id (a currency object's id, a mainCurrencyId, an id a merchant sends in availableCurrencyIds). 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's test field says which network it is on. Answers the same object as the list.
  • Unknown id → 404 not_found. Non-numeric :id (a code such as BASE:USDC included) → 400 validation_failed on id.

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)