From 0599ce89e06a07c4b5940a24643210e7fb5297b0 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 28 Apr 2025 12:39:10 +0200 Subject: [PATCH 1/2] chore(): updated examples --- examples/rest-private-futures.ts | 5 +++++ examples/rest-private-spot.ts | 4 ++++ examples/rest-trade-futures.ts | 5 +++++ examples/rest-trade-spot.ts | 5 +++++ examples/ws-private.ts | 5 +++++ 5 files changed, 24 insertions(+) diff --git a/examples/rest-private-futures.ts b/examples/rest-private-futures.ts index 6874f44..ccdc842 100644 --- a/examples/rest-private-futures.ts +++ b/examples/rest-private-futures.ts @@ -8,6 +8,11 @@ const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; +// If running from CLI in unix, you can pass env vars as such: +// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-private-futures.ts + +// note the single quotes, preventing special characters such as $ from being incorrectly passed + const client = new RestClientV2({ apiKey: API_KEY, apiSecret: API_SECRET, diff --git a/examples/rest-private-spot.ts b/examples/rest-private-spot.ts index 28c8310..0a4562a 100644 --- a/examples/rest-private-spot.ts +++ b/examples/rest-private-spot.ts @@ -7,6 +7,10 @@ import { RestClientV2 } from '../src/index'; const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; +// If running from CLI in unix, you can pass env vars as such: +// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-private-spot.ts + +// note the single quotes, preventing special characters such as $ from being incorrectly passed const client = new RestClientV2({ apiKey: API_KEY, diff --git a/examples/rest-trade-futures.ts b/examples/rest-trade-futures.ts index 1f2eb5d..f9c3ca3 100644 --- a/examples/rest-trade-futures.ts +++ b/examples/rest-trade-futures.ts @@ -12,6 +12,11 @@ const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; +// If running from CLI in unix, you can pass env vars as such: +// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-futures.ts + +// note the single quotes, preventing special characters such as $ from being incorrectly passed + const client = new RestClientV2({ apiKey: API_KEY, apiSecret: API_SECRET, diff --git a/examples/rest-trade-spot.ts b/examples/rest-trade-spot.ts index 25f5eee..e3b2cbe 100644 --- a/examples/rest-trade-spot.ts +++ b/examples/rest-trade-spot.ts @@ -11,6 +11,11 @@ const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; +// If running from CLI in unix, you can pass env vars as such: +// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-spot.ts + +// note the single quotes, preventing special characters such as $ from being incorrectly passed + const client = new RestClientV2({ apiKey: API_KEY, apiSecret: API_SECRET, diff --git a/examples/ws-private.ts b/examples/ws-private.ts index c623275..fc05fc9 100644 --- a/examples/ws-private.ts +++ b/examples/ws-private.ts @@ -13,6 +13,11 @@ import { DefaultLogger, WebsocketClientV2 } from '../src'; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; + // If running from CLI in unix, you can pass env vars as such: + // API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts + + // note the single quotes, preventing special characters such as $ from being incorrectly passed + const wsClient = new WebsocketClientV2( { apiKey: API_KEY, From 30c2f54836542eb797aa96f0225d2d183197044b Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 28 Apr 2025 13:03:57 +0200 Subject: [PATCH 2/2] chore(): update quotes in examples --- examples/rest-private-futures.ts | 2 +- examples/rest-private-spot.ts | 2 +- examples/rest-trade-futures.ts | 2 +- examples/rest-trade-spot.ts | 2 +- examples/ws-private.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/rest-private-futures.ts b/examples/rest-private-futures.ts index ccdc842..7079c87 100644 --- a/examples/rest-private-futures.ts +++ b/examples/rest-private-futures.ts @@ -9,7 +9,7 @@ const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: -// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-private-futures.ts +// API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-private-futures.ts // note the single quotes, preventing special characters such as $ from being incorrectly passed diff --git a/examples/rest-private-spot.ts b/examples/rest-private-spot.ts index 0a4562a..50465d6 100644 --- a/examples/rest-private-spot.ts +++ b/examples/rest-private-spot.ts @@ -8,7 +8,7 @@ const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: -// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-private-spot.ts +// API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-private-spot.ts // note the single quotes, preventing special characters such as $ from being incorrectly passed diff --git a/examples/rest-trade-futures.ts b/examples/rest-trade-futures.ts index f9c3ca3..0553ff9 100644 --- a/examples/rest-trade-futures.ts +++ b/examples/rest-trade-futures.ts @@ -13,7 +13,7 @@ const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: -// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-futures.ts +// API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-futures.ts // note the single quotes, preventing special characters such as $ from being incorrectly passed diff --git a/examples/rest-trade-spot.ts b/examples/rest-trade-spot.ts index e3b2cbe..555a773 100644 --- a/examples/rest-trade-spot.ts +++ b/examples/rest-trade-spot.ts @@ -12,7 +12,7 @@ const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: -// API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-spot.ts +// API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-spot.ts // note the single quotes, preventing special characters such as $ from being incorrectly passed diff --git a/examples/ws-private.ts b/examples/ws-private.ts index fc05fc9..f610e48 100644 --- a/examples/ws-private.ts +++ b/examples/ws-private.ts @@ -14,7 +14,7 @@ import { DefaultLogger, WebsocketClientV2 } from '../src'; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: - // API_KEY_COM=‘lkm12n3-2ba3-1mxf-fn13-lkm12n3a’ API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts + // API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts // note the single quotes, preventing special characters such as $ from being incorrectly passed