Skip to contents

Returns the base URL for the KuCoin API, determined by the following priority:

Usage

get_base_url(url = Sys.getenv("KC-API-ENDPOINT"))

Arguments

url

Character string representing the base URL. Defaults to Sys.getenv("KC-API-ENDPOINT").

Value

Character string containing the determined base URL.

Details

  1. Uses the explicitly provided url parameter if specified.

  2. If url is NULL or empty, checks the "KC-API-ENDPOINT" environment variable.

  3. 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"
} # }