Cryptocom
CryptoExchangeAPIs.Cryptocom.CryptocomClient
— TypeCryptocomClient <: AbstractAPIsClient
Client info.
Required fields
base_url::String
: Base URL for the client.
Optional fields
public_key::String
: Public key for authentication.secret_key::String
: Secret key for authentication.interface::String
: Interface for the client.proxy::String
: Proxy information for the client.account_name::String
: Account name associated with the client.description::String
: Description of the client.
CryptoExchangeAPIs.Cryptocom.CryptocomAPIError
— TypeCryptocomAPIError{T} <: AbstractAPIsError
Exception thrown when an API method fails with code T
.
Required fields
code::Int64
: Error code.
Optional fields
message::String
: Error message.description::String
: Error description.
CryptoExchangeAPIs.Cryptocom.Data
— TypeData{D} <: AbstractAPIsData
Required fields
id::Int64
: Return id.method::String
: Return method endpoint.code::String
: Return code.result::D
: Request result data.
Spot
CryptoExchangeAPIs.Cryptocom.Spot.public_client
— Constantpublic_client = CryptocomClient(; base_url = "https://api.crypto.com/exchange/v1")
CryptoExchangeAPIs.Cryptocom.Spot.Candle.candle
— Functioncandle(client::CryptocomClient, query::CandleQuery)
candle(client::CryptocomClient = Cryptocom.Spot.public_client; kw...)
Retrieves candlesticks (k-line data history) over a given period for an instrument.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
instrument_name | String | true | |
timeframe | TimeInterval | false | m1 m5 m15 m30 h1 h2 h4 h12 d1 d7 d14 M1 |
count | Int64 | false | |
start_ts | Int64 | false | |
end_ts | Int64 | false |
Code samples:
using Serde
using CryptoExchangeAPIs.Cryptocom
result = Cryptocom.Spot.candle(;
instrument_name = "BTC_USDT",
timeframe = Cryptocom.Spot.Candle.M1,
)
to_pretty_json(result.result)
Result:
{
"id":-1,
"method":"public/get-candlestick",
"code":"0",
"result":{
"interval":"1M",
"data":[
{
"o":19000.0,
"h":22982.05,
"l":15492.33,
"c":17170.28,
"v":150666.07457,
"t":"2022-11-01T00:00:00"
},
...
],
"instrument_name":"BTC_USDT"
}
}
CryptoExchangeAPIs.Cryptocom.Spot.GetInstruments.get_instruments
— Functionget_instruments(client::CryptocomClient, query::GetInstrumentsQuery)
get_instruments(client::CryptocomClient = Cryptocom.Spot.public_client; kw...)
Provides information on all supported instruments.
Code samples:
using Serde
using CryptoExchangeAPIs.Cryptocom
result = Cryptocom.Spot.get_instruments()
to_pretty_json(result.result)
Result:
{
"id":-1,
"method":"public/get-instruments",
"code":"0",
"result":{
"data":[
{
"symbol":"ZRX_USDT",
"base_ccy":"ZRX",
"quote_ccy":"USDT",
"inst_type":"CCY_PAIR",
"display_name":"ZRX/USDT",
"quote_decimals":5.0,
"quantity_decimals":0.0,
"price_tick_size":"0.00001",
"qty_tick_size":"1",
"max_leverage":"50",
"tradable":true,
"expiry_timestamp_ms":0,
"underlying_symbol":null
},
...
]
}
}
CryptoExchangeAPIs.Cryptocom.Spot.Ticker.ticker
— Functionticker(client::CryptocomClient, query::TickerQuery)
ticker(client::CryptocomClient = Cryptocom.Spot.public_client; kw...)
Fetches the public tickers for all or a particular instrument.
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
instrument_name | String | false |
Code samples:
using Serde
using CryptoExchangeAPIs.Cryptocom
result = Cryptocom.Spot.ticker(; instrument_name = "BTCUSD-PERP")
to_pretty_json(result.result)
Result:
{
"id":-1,
"method":"public/get-tickers",
"code":"0",
"result":{
"data":[
{
"i":"BTCUSD-PERP",
"h":63090.7,
"l":59671.8,
"a":62296.2,
"v":10797.3637,
"vv":6.6340329849e8,
"oi":1844.5729,
"c":0.0003,
"b":62294.3,
"k":62297.0,
"t":"2024-04-18T13:08:36.304999936"
}
]
}
}