Skip to content

Commit e445688

Browse files
committed
refactor: rename useDemo to demoTrading in README and codebase for clarity
1 parent f485407 commit e445688

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const demoFuturesClient = new FuturesClientV2({
183183
apiKey: API_KEY,
184184
apiSecret: API_SECRET,
185185
apiMemo: API_MEMO,
186-
useDemo: true, // Connect to simulated trading environment
186+
demoTrading: true, // Connect to simulated trading environment
187187
});
188188

189189
// Get futures account assets
@@ -302,7 +302,7 @@ const demoWsClient = new WebsocketClient({
302302
apiKey: 'yourAPIKeyHere',
303303
apiSecret: 'yourAPISecretHere',
304304
apiMemo: 'yourAPIMemoHere',
305-
useDemo: true, // Connect to simulated trading environment (V2 Futures only)
305+
demoTrading: true, // Connect to simulated trading environment (V2 Futures only)
306306
});
307307

308308
// Set up event handlers
@@ -347,7 +347,7 @@ For more comprehensive examples, including custom logging and error handling, ch
347347

348348
### Demo Trading
349349

350-
BitMart provides a simulated trading environment for testing futures trading strategies. Enable demo mode by adding `useDemo: true` to your client configuration:
350+
BitMart provides a simulated trading environment for testing futures trading strategies. Enable demo mode by adding `demoTrading: true` to your client configuration:
351351

352352
**REST API (Futures V2 only):**
353353

@@ -356,7 +356,7 @@ const demoClient = new FuturesClientV2({
356356
apiKey: API_KEY,
357357
apiSecret: API_SECRET,
358358
apiMemo: API_MEMO,
359-
useDemo: true, // Uses https://demo-api-cloud-v2.bitmart.com
359+
demoTrading: true, // Uses https://demo-api-cloud-v2.bitmart.com
360360
});
361361
```
362362

@@ -367,7 +367,7 @@ const demoWsClient = new WebsocketClient({
367367
apiKey: API_KEY,
368368
apiSecret: API_SECRET,
369369
apiMemo: API_MEMO,
370-
useDemo: true, // Uses wss://openapi-wsdemo-v2.bitmart.com
370+
demoTrading: true, // Uses wss://openapi-wsdemo-v2.bitmart.com
371371
});
372372
```
373373

src/FuturesClientV2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,13 @@ export class FuturesClientV2 extends BaseRestClient {
514514
* Add available funds to the futures account (Only available in the Simulated-Environment)
515515
*
516516
* Note: This endpoint is only available in the Simulated Trading environment.
517-
* To use this endpoint, create a client instance with useDemo: true
517+
* To use this endpoint, create a client instance with demoTrading: true
518518
* Example:
519519
* const simulatedClient = new FuturesClientV2({
520520
* apiKey: 'your-api-key',
521521
* apiSecret: 'your-api-secret',
522522
* apiMemo: 'your-api-memo',
523-
* useDemo: true
523+
* demoTrading: true
524524
* });
525525
*
526526
* Alternatively, you can manually set baseUrl: 'https://demo-api-cloud-v2.bitmart.com'

src/WebsocketClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export class WebsocketClient extends BaseWebsocketClient<
285285

286286
// Demo environment is only available for V2 Futures
287287
const networkKey =
288-
this.options.useDemo &&
288+
this.options.demoTrading &&
289289
(wsKey === WS_KEY_MAP.futuresPublicV2 ||
290290
wsKey === WS_KEY_MAP.futuresPrivateV2)
291291
? 'demo'

src/lib/requestUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface RestClientOptions {
3232
* For V2 Futures: https://demo-api-cloud-v2.bitmart.com
3333
* Note: The API keys for Simulated-Environment and Prod-Environment are the same.
3434
*/
35-
useDemo?: boolean;
35+
demoTrading?: boolean;
3636

3737
/** Default: true. whether to try and post-process request exceptions (and throw them). */
3838
parseExceptions?: boolean;
@@ -101,7 +101,7 @@ export function getRestBaseUrl(
101101
return restInverseOptions.baseUrl;
102102
}
103103

104-
if (restInverseOptions.useDemo) {
104+
if (restInverseOptions.demoTrading) {
105105
// Demo environment is only available for V2 Futures
106106
if (restClientType === REST_CLIENT_TYPE_ENUM.mainV2) {
107107
return exchangeBaseUrls.demoV2;

src/types/websockets/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface WSClientConfigurableOptions {
4242
* For V2 Futures WebSocket: wss://openapi-wsdemo-v2.bitmart.com
4343
* Note: The API keys for Simulated-Environment and Prod-Environment are the same.
4444
*/
45-
useDemo?: boolean;
45+
demoTrading?: boolean;
4646

4747
/**
4848
* Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method

0 commit comments

Comments
 (0)