refactor: replace useDemoTrading with demoTrading in RestClientOptions for consistency
This commit is contained in:
@@ -92,7 +92,6 @@ export default abstract class BaseRestClient {
|
|||||||
constructor(
|
constructor(
|
||||||
restOptions: RestClientOptions = {},
|
restOptions: RestClientOptions = {},
|
||||||
networkOptions: AxiosRequestConfig = {},
|
networkOptions: AxiosRequestConfig = {},
|
||||||
useDemoTrading: boolean = false,
|
|
||||||
) {
|
) {
|
||||||
this.options = {
|
this.options = {
|
||||||
recvWindow: 5000,
|
recvWindow: 5000,
|
||||||
@@ -111,7 +110,7 @@ export default abstract class BaseRestClient {
|
|||||||
'X-CHANNEL-API-CODE': 'hbnni',
|
'X-CHANNEL-API-CODE': 'hbnni',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
locale: 'en-US',
|
locale: 'en-US',
|
||||||
...(useDemoTrading ? { paptrading: '1' } : {}),
|
...(restOptions.demoTrading ? { paptrading: '1' } : {}),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ export interface RestClientOptions {
|
|||||||
/** Set to `true` to connect to testnet. Uses the live environment by default. */
|
/** Set to `true` to connect to testnet. Uses the live environment by default. */
|
||||||
// testnet?: boolean;
|
// testnet?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to use Bitget's demo trading: https://www.bitget.com/api-doc/common/demotrading/restapi.
|
||||||
|
*
|
||||||
|
* Disabled by default.
|
||||||
|
*/
|
||||||
|
demoTrading?: boolean;
|
||||||
|
|
||||||
/** Override the max size of the request window (in ms) */
|
/** Override the max size of the request window (in ms) */
|
||||||
recvWindow?: number;
|
recvWindow?: number;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user