@medievalrain/binance-ts 0.19.10 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -3
- package/dist/index.mjs +14 -5
- package/package.json +1 -2
package/dist/index.d.mts
CHANGED
|
@@ -86,7 +86,7 @@ type FuturesExchangeInfoFilter = {
|
|
|
86
86
|
positionControlSide: "NONE";
|
|
87
87
|
};
|
|
88
88
|
type FuturesContractType = "PERPETUAL" | "CURRENT_QUARTER" | "NEXT_QUARTER" | "TRADIFI_PERPETUAL" | "CURRENT_QUARTER DELIVERING";
|
|
89
|
-
type FuturesUnderlyingType = "COIN" | "INDEX" | "PREMARKET" | "COMMODITY";
|
|
89
|
+
type FuturesUnderlyingType = "COIN" | "INDEX" | "PREMARKET" | "COMMODITY" | "EQUITY";
|
|
90
90
|
type FuturesOrderType = "LIMIT" | "MARKET" | "STOP" | "TAKE_PROFIT" | "STOP_MARKET" | "TAKE_PROFIT_MARKET" | "TRAILING_STOP_MARKET";
|
|
91
91
|
type FuturesPermissionSet = "GRID" | "COPY" | "DCA" | "PSB" | "RPI";
|
|
92
92
|
type FuturesTimeInForce = "GTC" | "IOC" | "FOK" | "GTX" | "GTD";
|
|
@@ -152,6 +152,7 @@ type FuturesAggregateTrade = {
|
|
|
152
152
|
l: number;
|
|
153
153
|
T: number;
|
|
154
154
|
m: boolean;
|
|
155
|
+
nq: string;
|
|
155
156
|
};
|
|
156
157
|
type FuturesKlineInterval = "1s" | "1m" | "3m" | "5m" | "30m" | "1h" | "2h" | "6h" | "8h" | "12h" | "3d" | "1M";
|
|
157
158
|
type FuturesKline = [number, string, string, string, string, string, number, string, number, string, string, string];
|
|
@@ -888,9 +889,11 @@ declare class SpotRestClient extends BaseRestClient {
|
|
|
888
889
|
//#endregion
|
|
889
890
|
//#region src/rest/client.d.ts
|
|
890
891
|
declare class BinanceRestClient {
|
|
891
|
-
private options?;
|
|
892
892
|
private _futures?;
|
|
893
893
|
private _spot?;
|
|
894
|
+
private apiKey?;
|
|
895
|
+
private apiSecret?;
|
|
896
|
+
private baseUrls?;
|
|
894
897
|
constructor(options?: {
|
|
895
898
|
apiKey?: string;
|
|
896
899
|
apiSecret?: string;
|
|
@@ -898,7 +901,7 @@ declare class BinanceRestClient {
|
|
|
898
901
|
spot?: string;
|
|
899
902
|
futures?: string;
|
|
900
903
|
};
|
|
901
|
-
}
|
|
904
|
+
});
|
|
902
905
|
get futures(): FuturesRestClient;
|
|
903
906
|
get spot(): SpotRestClient;
|
|
904
907
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -457,19 +457,28 @@ var SpotRestClient = class extends BaseRestClient {
|
|
|
457
457
|
var BinanceRestClient = class {
|
|
458
458
|
_futures;
|
|
459
459
|
_spot;
|
|
460
|
+
apiKey;
|
|
461
|
+
apiSecret;
|
|
462
|
+
baseUrls;
|
|
460
463
|
constructor(options) {
|
|
461
|
-
this.
|
|
464
|
+
this.apiKey = options?.apiKey;
|
|
465
|
+
this.apiSecret = options?.apiSecret;
|
|
466
|
+
this.baseUrls = options?.baseUrls;
|
|
462
467
|
}
|
|
463
468
|
get futures() {
|
|
464
469
|
if (!this._futures) this._futures = new FuturesRestClient({
|
|
465
|
-
apiKey: this.
|
|
466
|
-
apiSecret: this.
|
|
467
|
-
baseUrl: this.
|
|
470
|
+
apiKey: this.apiKey,
|
|
471
|
+
apiSecret: this.apiSecret,
|
|
472
|
+
baseUrl: this.baseUrls?.futures
|
|
468
473
|
});
|
|
469
474
|
return this._futures;
|
|
470
475
|
}
|
|
471
476
|
get spot() {
|
|
472
|
-
if (!this._spot) this._spot = new SpotRestClient({
|
|
477
|
+
if (!this._spot) this._spot = new SpotRestClient({
|
|
478
|
+
apiKey: this.apiKey,
|
|
479
|
+
apiSecret: this.apiSecret,
|
|
480
|
+
baseUrl: this.baseUrls?.spot
|
|
481
|
+
});
|
|
473
482
|
return this._spot;
|
|
474
483
|
}
|
|
475
484
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medievalrain/binance-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Binance API SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"@medievalrain/emitter": "0.8.19"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "25.0.10",
|
|
39
38
|
"@typescript/native-preview": "7.0.0-dev.20260128.1",
|
|
40
39
|
"dotenv": "17.2.3",
|
|
41
40
|
"oxfmt": "0.27.0",
|