Retrieve API Key Information (Implementation)
Source:R/impl_account_account_and_funding.R
get_apikey_info_impl.Rd
Fetches detailed API key metadata from the KuCoin API asynchronously. This internal function is intended for use within an R6 class and is not meant for direct end-user consumption, providing details such as permissions and creation time.
Usage
get_apikey_info_impl(
keys = get_api_keys(),
base_url = get_base_url(),
.__coro_env_parent__ = <environment>
)
Arguments
- keys
List containing API configuration parameters from
get_api_keys()
, including:api_key
: Character string; your KuCoin API key.api_secret
: Character string; your KuCoin API secret.api_passphrase
: Character string; your KuCoin API passphrase.key_version
: Character string; API key version (e.g.,"2"
). Defaults toget_api_keys()
.
- base_url
Character string representing the base URL for the API. Defaults to
get_base_url()
.
Value
Promise resolving to a data.table
containing:
uid
(integer): Account UID.subName
(character, optional): Sub-account name (if applicable).remark
(character): API key remarks.apiKey
(character): API key string.apiVersion
(integer): API version.permission
(character): Comma-separated permissions list (e.g., "General, Spot").ipWhitelist
(character, optional): IP whitelist.isMaster
(logical): Master account indicator.createdAt
(integer): Creation time in milliseconds.
Details
Workflow Overview
URL Construction: Combines the base URL (from
get_base_url()
or providedbase_url
) with the endpoint/api/v1/user/api-key
.Header Preparation: Constructs authentication headers using
build_headers()
.API Request: Sends a GET request with a 3-second timeout via
httr::GET()
.Response Processing: Processes the response with
process_kucoin_response()
and converts the"data"
field into adata.table
.
Examples
if (FALSE) { # \dontrun{
keys <- get_api_keys()
base_url <- "https://api.kucoin.com"
main_async <- coro::async(function() {
dt <- await(get_apikey_info_impl(keys = keys, base_url = base_url))
print(dt)
})
main_async()
while (!later::loop_empty()) later::run_now()
} # }