Skip to contents

Retrieves a list of all currencies available on KuCoin asynchronously, combining summary and chain-specific details into a data.table.

Usage

get_all_currencies_impl(
  base_url = get_base_url(),
  .__coro_env_parent__ = <environment>
)

Arguments

base_url

Character string; base URL for the KuCoin API. Defaults to get_base_url().

Value

Promise resolving to a data.table containing:

  • Summary Fields:

    • currency (character): Unique currency code.

    • name (character): Short name.

    • fullName (character): Full name.

    • precision (integer): Decimal places.

    • confirms (integer or NA): Block confirmations.

    • contractAddress (character or NA): Primary contract address.

    • isMarginEnabled (logical): Margin trading status.

    • isDebitEnabled (logical): Debit status.

  • Chain-Specific Fields:

    • chainName (character or NA): Blockchain name.

    • withdrawalMinSize (character or NA): Minimum withdrawal amount.

    • depositMinSize (character or NA): Minimum deposit amount.

    • withdrawFeeRate (character or NA): Withdrawal fee rate.

    • withdrawalMinFee (character or NA): Minimum withdrawal fee.

    • isWithdrawEnabled (logical or NA): Withdrawal enabled status.

    • isDepositEnabled (logical or NA): Deposit enabled status.

    • confirms (integer or NA): Chain-specific confirmations.

    • preConfirms (integer or NA): Pre-confirmations.

    • chain_contractAddress (character or NA): Chain-specific contract address.

    • withdrawPrecision (integer or NA): Withdrawal precision.

    • maxWithdraw (character or NA): Maximum withdrawal amount.

    • maxDeposit (character or NA): Maximum deposit amount.

    • needTag (logical or NA): Memo/tag requirement.

    • chainId (character or NA): Blockchain identifier.

    • depositFeeRate (character or NA): Deposit fee rate.

    • withdrawMaxFee (character or NA): Maximum withdrawal fee.

    • depositTierFee (character or NA): Tiered deposit fee.

Details

Workflow Overview

  1. URL Assembly: Combines base_url with /api/v3/currencies.

  2. HTTP Request: Sends a GET request with a 10-second timeout via httr::GET().

  3. Response Processing: Validates the response with process_kucoin_response() and extracts the "data" field.

  4. Data Iteration: Loops through each currency, extracting summary fields and chain data (if present).

  5. Result Assembly: Combines summary and chain data into a data.table, adding dummy chain columns with NA if no chains exist.

API Endpoint

GET https://api.kucoin.com/api/v3/currencies

Usage

Utilised to fetch comprehensive currency details, including multi-chain support, for market analysis or configuration.

Official Documentation

KuCoin Get All Currencies

Examples

if (FALSE) { # \dontrun{
main_async <- coro::async(function() {
  currencies <- await(get_all_currencies_impl())
  print(currencies)
})
main_async()
while (!later::loop_empty()) later::run_now()
} # }