@medievalrain/binance-ts 0.12.0 → 0.13.1
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.ts +17 -6
- package/dist/index.js +20 -10
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CallbackOptions } from "@medievalrain/emitter";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/rest/base-rest-client.d.ts
|
|
4
4
|
type RawSearchParams = Record<string, string | undefined | null | string[] | number | boolean>;
|
|
5
5
|
declare class BaseRestClient {
|
|
6
6
|
private apiKey?;
|
|
@@ -739,8 +739,9 @@ declare class SpotRestClient extends BaseRestClient {
|
|
|
739
739
|
//#endregion
|
|
740
740
|
//#region src/rest/client.d.ts
|
|
741
741
|
declare class BinanceRestClient {
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
private options?;
|
|
743
|
+
private _futures?;
|
|
744
|
+
private _spot?;
|
|
744
745
|
constructor(options?: {
|
|
745
746
|
apiKey?: string;
|
|
746
747
|
apiSecret?: string;
|
|
@@ -748,10 +749,20 @@ declare class BinanceRestClient {
|
|
|
748
749
|
spot?: string;
|
|
749
750
|
futures?: string;
|
|
750
751
|
};
|
|
751
|
-
});
|
|
752
|
+
} | undefined);
|
|
753
|
+
get futures(): FuturesRestClient;
|
|
754
|
+
get spot(): SpotRestClient;
|
|
752
755
|
}
|
|
756
|
+
declare const createBinanceRestClient: (options?: {
|
|
757
|
+
apiKey?: string;
|
|
758
|
+
apiSecret?: string;
|
|
759
|
+
baseUrls?: {
|
|
760
|
+
spot?: string;
|
|
761
|
+
futures?: string;
|
|
762
|
+
};
|
|
763
|
+
}) => BinanceRestClient;
|
|
753
764
|
//#endregion
|
|
754
|
-
//#region src/
|
|
765
|
+
//#region src/rest/api-error.d.ts
|
|
755
766
|
declare class ApiError extends Error {
|
|
756
767
|
endpoint: string;
|
|
757
768
|
constructor({
|
|
@@ -1068,4 +1079,4 @@ declare const createFuturesUserWebsocketClient: ({
|
|
|
1068
1079
|
apiSecret: string;
|
|
1069
1080
|
}) => Promise<FuturesUserWebsocketClient>;
|
|
1070
1081
|
//#endregion
|
|
1071
|
-
export { ApiError,
|
|
1082
|
+
export { ApiError, ErrorMessageParsingError, FuturesAccountAsset, FuturesAccountBalance, FuturesAccountConfig, FuturesAccountInfo, FuturesAccountPosition, type FuturesAggTradeEvent, FuturesAggregateTrade, FuturesAssetIndex, FuturesBasis, type FuturesBookDepthEvent, FuturesBookTicker, type FuturesBookTickerEvent, FuturesCancelOrder, FuturesCheckServerTime, FuturesCommissionRate, FuturesCompositeIndex, FuturesCompositeIndexAsset, FuturesContractType, FuturesDeliveryPrice, FuturesExchangeInfo, FuturesExchangeInfoAsset, FuturesExchangeInfoFilter, FuturesExchangeInfoRateLimit, FuturesExchangeInfoSymbol, FuturesFundingInfo, FuturesFundingRate, FuturesGetListenKey, FuturesIncomeHistory, FuturesIncomeType, FuturesIndexPriceConstituentItem, FuturesIndexPriceConstituents, FuturesInsuranceBalance, FuturesInsuranceBalanceAsset, FuturesKline, FuturesKlineInterval, FuturesLeverageBracket, FuturesLeverageBracketEntry, FuturesLongShortRatio, FuturesMarkPrice, FuturesModifyOrder, FuturesNewOrder, FuturesNewOrderRespType, FuturesOpenInterest, FuturesOpenInterestPeriod, FuturesOpenInterestStats, FuturesOrderBook, FuturesOrderSide, FuturesOrderStatus, FuturesOrderType, FuturesPositionMode, FuturesPositionSide, FuturesPriceMatch, FuturesSelfTradePrevention, FuturesSymbolConfig, FuturesSymbolPrice, FuturesTakerBuySellRatio, FuturesTestConnectivity, FuturesTicker24h, FuturesTimeInForce, FuturesTrade, FuturesUnderlyingType, FuturesUserRateLimit, FuturesWorkingType, MalformedParamError, PermissionSet, ResponseError, WeightError, createBinanceRestClient, createFuturesUserWebsocketClient, createFuturesWebsocketClient };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHmac } from "node:crypto";
|
|
2
2
|
import { createEmitter } from "@medievalrain/emitter";
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/rest/api-error.ts
|
|
5
5
|
var ApiError = class extends Error {
|
|
6
6
|
endpoint;
|
|
7
7
|
constructor({ endpoint, metadata }) {
|
|
@@ -73,7 +73,7 @@ var MalformedParamError = class extends ResponseError {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
//#endregion
|
|
76
|
-
//#region src/
|
|
76
|
+
//#region src/rest/base-rest-client.ts
|
|
77
77
|
var BaseRestClient = class {
|
|
78
78
|
apiKey;
|
|
79
79
|
apiSecret;
|
|
@@ -435,17 +435,27 @@ var SpotRestClient = class extends BaseRestClient {
|
|
|
435
435
|
//#endregion
|
|
436
436
|
//#region src/rest/client.ts
|
|
437
437
|
var BinanceRestClient = class {
|
|
438
|
-
|
|
439
|
-
|
|
438
|
+
_futures;
|
|
439
|
+
_spot;
|
|
440
440
|
constructor(options) {
|
|
441
|
-
this.
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
441
|
+
this.options = options;
|
|
442
|
+
}
|
|
443
|
+
get futures() {
|
|
444
|
+
if (!this._futures) this._futures = new FuturesRestClient({
|
|
445
|
+
apiKey: this.options?.apiKey,
|
|
446
|
+
apiSecret: this.options?.apiSecret,
|
|
447
|
+
baseUrl: this.options?.baseUrls?.futures
|
|
445
448
|
});
|
|
446
|
-
this.
|
|
449
|
+
return this._futures;
|
|
450
|
+
}
|
|
451
|
+
get spot() {
|
|
452
|
+
if (!this._spot) this._spot = new SpotRestClient({ baseUrl: this.options?.baseUrls?.spot });
|
|
453
|
+
return this._spot;
|
|
447
454
|
}
|
|
448
455
|
};
|
|
456
|
+
const createBinanceRestClient = (options) => {
|
|
457
|
+
return new BinanceRestClient(options);
|
|
458
|
+
};
|
|
449
459
|
|
|
450
460
|
//#endregion
|
|
451
461
|
//#region src/websocket/base/client.ts
|
|
@@ -700,4 +710,4 @@ const createFuturesUserWebsocketClient = async ({ baseUrl = "wss://fstream.binan
|
|
|
700
710
|
};
|
|
701
711
|
|
|
702
712
|
//#endregion
|
|
703
|
-
export { ApiError,
|
|
713
|
+
export { ApiError, ErrorMessageParsingError, MalformedParamError, ResponseError, WeightError, createBinanceRestClient, createFuturesUserWebsocketClient, createFuturesWebsocketClient };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medievalrain/binance-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Binance API SDK",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"zod": "4.1.12"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@medievalrain/emitter": "0.8.
|
|
39
|
+
"@medievalrain/emitter": "0.8.1"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
@@ -46,5 +46,8 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public",
|
|
48
48
|
"provenance": true
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=24.11.0"
|
|
49
52
|
}
|
|
50
53
|
}
|