set_okxr_options: Set or get okxr options

View source: R/def_constants.R

set_okxr_optionsR Documentation

Set or get okxr options

Description

Convenience wrapper to set global options for okxr, such as whether to return raw data instead of parsed data.

Usage

set_okxr_options(raw_data = NULL, timeout = NULL)

Arguments

raw_data

Logical. If 'TRUE', return raw API 'data'. If 'NULL', the current value is left unchanged.

timeout

Numeric. HTTP request timeout in seconds. If 'NULL', the current value is left unchanged.

Value

An invisible named list with the current package options: 'raw_data' (logical) and 'timeout' (numeric seconds). This return value can be used to inspect the effective option state.

Examples

old <- getOption("okxr.raw_data")
old_timeout <- getOption("okxr.timeout")
set_okxr_options(raw_data = TRUE)
set_okxr_options(timeout = 5)
options(okxr.raw_data = old, okxr.timeout = old_timeout)

set_okxr_options()  # check current values

okxr documentation built on May 8, 2026, 5:09 p.m.