File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -938,11 +938,15 @@ class OpsClient : public Client<OpsClient>
938
938
939
939
940
940
// crtp infrastructure end
941
-
942
-
941
+
942
+ ;
943
943
944
944
public:
945
945
friend Client;
946
+ bool _testnet_mode;
947
+
948
+ void set_testnet_mode (const bool status);
949
+ bool get_testnet_mode ();
946
950
947
951
OpsClient ();
948
952
OpsClient (const std::string key, const std::string secret);
Original file line number Diff line number Diff line change @@ -7384,6 +7384,26 @@ void OpsClient::v_init_ws_session()
7384
7384
this ->_ws_client ->set_gzip_conversion (1 );
7385
7385
}
7386
7386
7387
+ /* *
7388
+ Enables / disables testnet mode
7389
+ @param status - a boolean for enabling / disabling
7390
+ */
7391
+ void OpsClient::set_testnet_mode (const bool status)
7392
+ {
7393
+ if (status) this ->_ws_client ->set_host_port (_WS_BASE_FUTURES_USDT_TESTNET, _WS_PORT_FUTURES);
7394
+ else this ->_ws_client ->set_host_port (_WS_BASE_FUTURES_USDT, _WS_PORT_FUTURES);
7395
+ this ->_testnet_mode = status;
7396
+ }
7397
+
7398
+ /* *
7399
+ Get current testnet mode status
7400
+ @return 1 if enabled, 0 if disabled
7401
+ */
7402
+ bool OpsClient::get_testnet_mode ()
7403
+ {
7404
+ return this ->_testnet_mode ;
7405
+ }
7406
+
7387
7407
/* *
7388
7408
Create a ListenKey
7389
7409
@return an std::string representing the ListenKey
You can’t perform that action at this time.
0 commit comments