algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::kis::KisWebsocket Struct Reference

A KIS WebSocket approval key and when it was issued. More...

#include <algotradelib/src/brokers/kis/config.hpp>

Public Member Functions

 KisWebsocket ()
 Constructs an empty key.
void from_json (const json::object &doc)
 Reads an approval-key response.
bool valid () const noexcept
 Tests whether the key is set and was received less than a day ago.

Public Attributes

std::string approval_key_
 The approval key.
std::chrono::system_clock::time_point last_auth_time_
 When it was received.

Detailed Description

A KIS WebSocket approval key and when it was issued.

Definition at line 309 of file config.hpp.

Constructor & Destructor Documentation

◆ KisWebsocket()

algotradelib::kis::KisWebsocket::KisWebsocket ( )
inline

Constructs an empty key.

Definition at line 316 of file config.hpp.

Member Function Documentation

◆ from_json()

void algotradelib::kis::KisWebsocket::from_json ( const json::object & doc)
inline

Reads an approval-key response.

Parameters
docThe response.
Exceptions
std::runtime_errorif it has no approval_key.

Definition at line 323 of file config.hpp.

◆ valid()

bool algotradelib::kis::KisWebsocket::valid ( ) const
inlinenoexcept

Tests whether the key is set and was received less than a day ago.

Returns
true if so.

Definition at line 337 of file config.hpp.

Member Data Documentation

◆ approval_key_

std::string algotradelib::kis::KisWebsocket::approval_key_

The approval key.

Definition at line 311 of file config.hpp.

Referenced by from_json(), and valid().

◆ last_auth_time_

std::chrono::system_clock::time_point algotradelib::kis::KisWebsocket::last_auth_time_

When it was received.

Definition at line 313 of file config.hpp.

Referenced by from_json(), and valid().


The documentation for this struct was generated from the following file: