Skip to contents

Constructs a URL query string from a named list of parameters for KuCoin API requests. The process involves:

Usage

build_query(params)

Arguments

params

Named list of query parameters.

Value

Character string representing the query part of the URL. Returns an empty string ("") if no parameters are provided.

Details

  1. Filtering NULL Values: Removes any parameters with NULL values from the input list.

  2. Concatenating Parameters: Combines remaining key-value pairs into a query string, starting with a ? and formatted as "key1=value1&key2=value2".

Important: For authenticated requests, pass the complete URL (base endpoint + query string) to the header builder to ensure the signature includes the full path.

Examples

if (FALSE) { # \dontrun{
# Basic usage
params <- list(currency = "USDT", type = "main")
build_query(params)  # Returns "?currency=USDT&type=main"

# Empty list
build_query(list())  # Returns ""
} # }