Cryptocom

CryptoExchangeAPIs.Cryptocom.CryptocomClientType
CryptocomClient <: 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.
source
CryptoExchangeAPIs.Cryptocom.CryptocomAPIErrorType
CryptocomAPIError{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.
source
CryptoExchangeAPIs.Cryptocom.DataType
Data{D} <: AbstractAPIsData

Required fields

  • id::Int64: Return id.
  • method::String: Return method endpoint.
  • code::String: Return code.
  • result::D: Request result data.
source

Spot

CryptoExchangeAPIs.Cryptocom.Spot.Candle.candleFunction
candle(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.

GET public/get-candlestick

Parameters:

ParameterTypeRequiredDescription
instrument_nameStringtrue
timeframeTimeIntervalfalsem1 m5 m15 m30 h1 h2 h4 h12 d1 d7 d14 M1
countInt64false
start_tsInt64false
end_tsInt64false

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"
  }
}
source
CryptoExchangeAPIs.Cryptocom.Spot.GetInstruments.get_instrumentsFunction
get_instruments(client::CryptocomClient, query::GetInstrumentsQuery)
get_instruments(client::CryptocomClient = Cryptocom.Spot.public_client; kw...)

Provides information on all supported instruments.

GET public/get-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
      },
      ...
    ]
  }
}
source
CryptoExchangeAPIs.Cryptocom.Spot.Ticker.tickerFunction
ticker(client::CryptocomClient, query::TickerQuery)
ticker(client::CryptocomClient = Cryptocom.Spot.public_client; kw...)

Fetches the public tickers for all or a particular instrument.

GET public/get-tickers

Parameters:

ParameterTypeRequiredDescription
instrument_nameStringfalse

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"
      }
    ]
  }
}
source