Developers

Get currency

List every currency with its id and decimals.

On this page

URLs and generated code samples on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.

SDKclient.get_currency(...)
HTTPPOST https://market-data.testnet.grvt.io/full/v1/currency, or /lite/v1/currency for lite names (the SDKs' default)
WebSocketmethod v1/currency on wss://market-data.testnet.grvt.io/ws/full, or /ws/lite for lite names
AuthNone (public)
RetriesRead: the SDKs retry retryable errors (rules)
Contract idinstrument.get_currency (RPCGetCurrencyV1)

Request

Body type ApiGetCurrencyRequest. Fields the server fills are left out.

No fields.

Response

Body type ApiGetCurrencyResponse (the same object is the JSON-RPC result over WebSocket).

resultlite name rarray<CurrencyDetail>required#
The list of currencies
  • idlite name iinteger (uint16)required#
    The integer value of the currency
  • symbollite name sstringrequired#
    The name of the currency
  • balance_decimalslite name bdinteger (int8)required#
    The balance decimals of the currency
  • quantity_multiplierlite name qmstring (uint64)required#
    The quantity multiplier of the currency

Errors

Errors come back as {"code", "message", "status"} (lite {"c", "m", "s"}) with the HTTP status. Codes this call can return (all error codes):

4 errors any call can return; none specific to this one
1002InternalServer500
Internal Server Error
1003InvalidRequest400
Request could not be processed due to malformed syntax
1004NotFound404
Data Not Found
1006RateLimit429retryable
You have surpassed the allocated rate limit for your tier

Example

Example code
from grvt import Grvt

with Grvt(env="testnet") as client:
    resp = client.get_currency()
    print(resp)

Raw HTTP (set GRVT_DOMAIN, see Environments):

With full field names:

curl -sS "https://market-data.testnet.grvt.io/full/v1/currency" \
  -H "Content-Type: application/json" \
  --data '{}'

With lite field names:

curl -sS "https://market-data.testnet.grvt.io/lite/v1/currency" \
  -H "Content-Type: application/json" \
  --data '{}'
Run on testnet
esc

↑ ↓ move↵ open⇧↵ open .mdTry an error code like 2002

Keyboard shortcuts

⌘ K
Search the docs
/
Search
l
Next code language (Python → TypeScript → Go → Rust → curl → WebSocket)
j / k
Next / previous page
t
Light / dark theme
?
This help
Esc
Close dialogs and drawers