@binance/margin-trading 10.1.2 → 12.0.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 +343 -33
- package/dist/index.d.ts +343 -33
- package/dist/index.js +134 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +134 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { BadRequestError, ConfigurationRestAPI, ConfigurationWebsocketStreams, C
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@binance/margin-trading";
|
|
6
|
-
var version = "
|
|
6
|
+
var version = "12.0.0";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/rest-api/modules/account-api.ts
|
|
@@ -775,6 +775,32 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
|
775
775
|
timeUnit: _timeUnit
|
|
776
776
|
};
|
|
777
777
|
},
|
|
778
|
+
getMarginAssetRiskBasedLiquidationRatio: async () => {
|
|
779
|
+
const localVarQueryParameter = {};
|
|
780
|
+
const localVarBodyParameter = {};
|
|
781
|
+
let _timeUnit;
|
|
782
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
783
|
+
return {
|
|
784
|
+
endpoint: "/sapi/v1/margin/risk-based-liquidation-ratio",
|
|
785
|
+
method: "GET",
|
|
786
|
+
queryParams: localVarQueryParameter,
|
|
787
|
+
bodyParams: localVarBodyParameter,
|
|
788
|
+
timeUnit: _timeUnit
|
|
789
|
+
};
|
|
790
|
+
},
|
|
791
|
+
getMarginRestrictedAssets: async () => {
|
|
792
|
+
const localVarQueryParameter = {};
|
|
793
|
+
const localVarBodyParameter = {};
|
|
794
|
+
let _timeUnit;
|
|
795
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
796
|
+
return {
|
|
797
|
+
endpoint: "/sapi/v1/margin/restricted-asset",
|
|
798
|
+
method: "GET",
|
|
799
|
+
queryParams: localVarQueryParameter,
|
|
800
|
+
bodyParams: localVarBodyParameter,
|
|
801
|
+
timeUnit: _timeUnit
|
|
802
|
+
};
|
|
803
|
+
},
|
|
778
804
|
queryIsolatedMarginTierData: async (symbol, tier, recvWindow) => {
|
|
779
805
|
assertParamExists("queryIsolatedMarginTierData", "symbol", symbol);
|
|
780
806
|
const localVarQueryParameter = {};
|
|
@@ -962,6 +988,36 @@ var MarketDataApi = class {
|
|
|
962
988
|
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
|
|
963
989
|
}
|
|
964
990
|
/**
|
|
991
|
+
* Get Margin Asset Risk-Based Liquidation Ratio
|
|
992
|
+
*
|
|
993
|
+
* Weight: 1
|
|
994
|
+
*
|
|
995
|
+
* @summary Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA)
|
|
996
|
+
* @returns {Promise<RestApiResponse<GetMarginAssetRiskBasedLiquidationRatioResponse>>}
|
|
997
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
998
|
+
* @memberof MarketDataApi
|
|
999
|
+
* @see {@link https://developers.binance.com/docs/margin_trading/market-data/Get-Margin-Asset-Risk-Based-Liquidation-Ratio Binance API Documentation}
|
|
1000
|
+
*/
|
|
1001
|
+
async getMarginAssetRiskBasedLiquidationRatio() {
|
|
1002
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getMarginAssetRiskBasedLiquidationRatio();
|
|
1003
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Get Margin Restricted Assets
|
|
1007
|
+
*
|
|
1008
|
+
* Weight: 1
|
|
1009
|
+
*
|
|
1010
|
+
* @summary Get Margin Restricted Assets (MARKET_DATA)
|
|
1011
|
+
* @returns {Promise<RestApiResponse<GetMarginRestrictedAssetsResponse>>}
|
|
1012
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
1013
|
+
* @memberof MarketDataApi
|
|
1014
|
+
* @see {@link https://developers.binance.com/docs/margin_trading/market-data/Get-Margin-Restricted-Assets Binance API Documentation}
|
|
1015
|
+
*/
|
|
1016
|
+
async getMarginRestrictedAssets() {
|
|
1017
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getMarginRestrictedAssets();
|
|
1018
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
965
1021
|
* Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
|
|
966
1022
|
*
|
|
967
1023
|
* Weight: 1(IP)
|
|
@@ -1656,6 +1712,26 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
1656
1712
|
timeUnit: _timeUnit
|
|
1657
1713
|
};
|
|
1658
1714
|
},
|
|
1715
|
+
queryPreventedMatches: async (symbol, preventedMatchId, orderId, fromPreventedMatchId, recvWindow, isIsolated) => {
|
|
1716
|
+
assertParamExists("queryPreventedMatches", "symbol", symbol);
|
|
1717
|
+
const localVarQueryParameter = {};
|
|
1718
|
+
const localVarBodyParameter = {};
|
|
1719
|
+
if (symbol !== void 0 && symbol !== null) localVarQueryParameter["symbol"] = symbol;
|
|
1720
|
+
if (preventedMatchId !== void 0 && preventedMatchId !== null) localVarQueryParameter["preventedMatchId"] = preventedMatchId;
|
|
1721
|
+
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
1722
|
+
if (fromPreventedMatchId !== void 0 && fromPreventedMatchId !== null) localVarQueryParameter["fromPreventedMatchId"] = fromPreventedMatchId;
|
|
1723
|
+
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
1724
|
+
if (isIsolated !== void 0 && isIsolated !== null) localVarQueryParameter["isIsolated"] = isIsolated;
|
|
1725
|
+
let _timeUnit;
|
|
1726
|
+
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
1727
|
+
return {
|
|
1728
|
+
endpoint: "/sapi/v1/margin/myPreventedMatches",
|
|
1729
|
+
method: "GET",
|
|
1730
|
+
queryParams: localVarQueryParameter,
|
|
1731
|
+
bodyParams: localVarBodyParameter,
|
|
1732
|
+
timeUnit: _timeUnit
|
|
1733
|
+
};
|
|
1734
|
+
},
|
|
1659
1735
|
querySpecialKey: async (symbol, recvWindow) => {
|
|
1660
1736
|
const localVarQueryParameter = {};
|
|
1661
1737
|
const localVarBodyParameter = {};
|
|
@@ -2140,6 +2216,21 @@ var TradeApi = class {
|
|
|
2140
2216
|
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
2141
2217
|
}
|
|
2142
2218
|
/**
|
|
2219
|
+
*
|
|
2220
|
+
* Weight: 10(IP)
|
|
2221
|
+
*
|
|
2222
|
+
* @summary Query Prevented Matches(USER_DATA)
|
|
2223
|
+
* @param {QueryPreventedMatchesRequest} requestParameters Request parameters.
|
|
2224
|
+
* @returns {Promise<RestApiResponse<QueryPreventedMatchesResponse>>}
|
|
2225
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
2226
|
+
* @memberof TradeApi
|
|
2227
|
+
* @see {@link https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Prevented-Matches Binance API Documentation}
|
|
2228
|
+
*/
|
|
2229
|
+
async queryPreventedMatches(requestParameters) {
|
|
2230
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPreventedMatches(requestParameters?.symbol, requestParameters?.preventedMatchId, requestParameters?.orderId, requestParameters?.fromPreventedMatchId, requestParameters?.recvWindow, requestParameters?.isIsolated);
|
|
2231
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
2232
|
+
}
|
|
2233
|
+
/**
|
|
2143
2234
|
* Query Special Key Information.
|
|
2144
2235
|
*
|
|
2145
2236
|
* This only applies to Special Key for Low Latency Trading.
|
|
@@ -2782,6 +2873,34 @@ var RestAPI = class {
|
|
|
2782
2873
|
return this.marketDataApi.getListSchedule(requestParameters);
|
|
2783
2874
|
}
|
|
2784
2875
|
/**
|
|
2876
|
+
* Get Margin Asset Risk-Based Liquidation Ratio
|
|
2877
|
+
*
|
|
2878
|
+
* Weight: 1
|
|
2879
|
+
*
|
|
2880
|
+
* @summary Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA)
|
|
2881
|
+
*
|
|
2882
|
+
* @returns {Promise<RestApiResponse<GetMarginAssetRiskBasedLiquidationRatioResponse>>}
|
|
2883
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
2884
|
+
* @see {@link https://developers.binance.com/docs/margin_trading/market-data/Get-Margin-Asset-Risk-Based-Liquidation-Ratio Binance API Documentation}
|
|
2885
|
+
*/
|
|
2886
|
+
getMarginAssetRiskBasedLiquidationRatio() {
|
|
2887
|
+
return this.marketDataApi.getMarginAssetRiskBasedLiquidationRatio();
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* Get Margin Restricted Assets
|
|
2891
|
+
*
|
|
2892
|
+
* Weight: 1
|
|
2893
|
+
*
|
|
2894
|
+
* @summary Get Margin Restricted Assets (MARKET_DATA)
|
|
2895
|
+
*
|
|
2896
|
+
* @returns {Promise<RestApiResponse<GetMarginRestrictedAssetsResponse>>}
|
|
2897
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
2898
|
+
* @see {@link https://developers.binance.com/docs/margin_trading/market-data/Get-Margin-Restricted-Assets Binance API Documentation}
|
|
2899
|
+
*/
|
|
2900
|
+
getMarginRestrictedAssets() {
|
|
2901
|
+
return this.marketDataApi.getMarginRestrictedAssets();
|
|
2902
|
+
}
|
|
2903
|
+
/**
|
|
2785
2904
|
* Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
|
|
2786
2905
|
*
|
|
2787
2906
|
* Weight: 1(IP)
|
|
@@ -3288,6 +3407,20 @@ var RestAPI = class {
|
|
|
3288
3407
|
return this.tradeApi.queryMarginAccountsTradeList(requestParameters);
|
|
3289
3408
|
}
|
|
3290
3409
|
/**
|
|
3410
|
+
*
|
|
3411
|
+
* Weight: 10(IP)
|
|
3412
|
+
*
|
|
3413
|
+
* @summary Query Prevented Matches(USER_DATA)
|
|
3414
|
+
* @param {QueryPreventedMatchesRequest} requestParameters Request parameters.
|
|
3415
|
+
*
|
|
3416
|
+
* @returns {Promise<RestApiResponse<QueryPreventedMatchesResponse>>}
|
|
3417
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
3418
|
+
* @see {@link https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Prevented-Matches Binance API Documentation}
|
|
3419
|
+
*/
|
|
3420
|
+
queryPreventedMatches(requestParameters) {
|
|
3421
|
+
return this.tradeApi.queryPreventedMatches(requestParameters);
|
|
3422
|
+
}
|
|
3423
|
+
/**
|
|
3291
3424
|
* Query Special Key Information.
|
|
3292
3425
|
*
|
|
3293
3426
|
* This only applies to Special Key for Low Latency Trading.
|