Merge pull request #69 from JJ-Cro/master

chore(): updated examples
This commit is contained in:
Tiago
2025-05-12 16:52:36 +01:00
committed by GitHub
5 changed files with 24 additions and 0 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,