Returns the base URL for the KuCoin API, determined by the following priority:
Arguments
- url
Character string representing the base URL. Defaults to Sys.getenv("KC-API-ENDPOINT")
.
Value
Character string containing the determined base URL.
Details
Uses the explicitly provided url
parameter if specified.
If url
is NULL
or empty, checks the "KC-API-ENDPOINT"
environment variable.
Falls back to the default "https://api.kucoin.com"
if neither above source provides a value.
Examples
if (FALSE) { # \dontrun{
# Default behavior (uses environment variable or fallback)
get_base_url() # Might return "https://api.kucoin.com" if KC-API-ENDPOINT is unset
# Explicit URL
get_base_url("https://testnet.kucoin.com") # Returns "https://testnet.kucoin.com"
} # }