@binance/margin-trading 9.0.1 → 10.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 +1 -396
- package/dist/index.d.ts +1 -396
- package/dist/index.js +33 -447
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -427
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
// src/margin-trading.ts
|
|
8
8
|
import {
|
|
9
9
|
buildUserAgent,
|
|
10
|
-
ConfigurationRestAPI as
|
|
10
|
+
ConfigurationRestAPI as ConfigurationRestAPI8,
|
|
11
11
|
ConfigurationWebsocketStreams as ConfigurationWebsocketStreams2,
|
|
12
12
|
MARGIN_TRADING_REST_API_PROD_URL,
|
|
13
13
|
MARGIN_TRADING_WS_STREAMS_PROD_URL
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
17
|
var name = "@binance/margin-trading";
|
|
18
|
-
var version = "
|
|
18
|
+
var version = "10.0.0";
|
|
19
19
|
|
|
20
20
|
// src/rest-api/index.ts
|
|
21
21
|
var rest_api_exports = {};
|
|
@@ -33,7 +33,6 @@ __export(rest_api_exports, {
|
|
|
33
33
|
RestAPI: () => RestAPI,
|
|
34
34
|
RiskDataStreamApi: () => RiskDataStreamApi,
|
|
35
35
|
TradeApi: () => TradeApi,
|
|
36
|
-
TradeDataStreamApi: () => TradeDataStreamApi,
|
|
37
36
|
TransferApi: () => TransferApi
|
|
38
37
|
});
|
|
39
38
|
|
|
@@ -4114,337 +4113,11 @@ var MarginAccountNewOtocoNewOrderRespTypeEnum = /* @__PURE__ */ ((MarginAccountN
|
|
|
4114
4113
|
return MarginAccountNewOtocoNewOrderRespTypeEnum2;
|
|
4115
4114
|
})(MarginAccountNewOtocoNewOrderRespTypeEnum || {});
|
|
4116
4115
|
|
|
4117
|
-
// src/rest-api/modules/
|
|
4116
|
+
// src/rest-api/modules/transfer-api.ts
|
|
4118
4117
|
import {
|
|
4119
4118
|
assertParamExists as assertParamExists6,
|
|
4120
4119
|
sendRequest as sendRequest6
|
|
4121
4120
|
} from "@binance/common";
|
|
4122
|
-
var TradeDataStreamApiAxiosParamCreator = function(configuration) {
|
|
4123
|
-
return {
|
|
4124
|
-
/**
|
|
4125
|
-
* Close out a isolated margin user data stream.
|
|
4126
|
-
*
|
|
4127
|
-
* Weight: 3000
|
|
4128
|
-
*
|
|
4129
|
-
* @summary Close Isolated Margin User Data Stream (USER_STREAM)
|
|
4130
|
-
* @param {string} symbol
|
|
4131
|
-
* @param {string} listenkey
|
|
4132
|
-
*
|
|
4133
|
-
* @deprecated
|
|
4134
|
-
* @throws {RequiredError}
|
|
4135
|
-
*/
|
|
4136
|
-
closeIsolatedMarginUserDataStream: async (symbol, listenkey) => {
|
|
4137
|
-
assertParamExists6("closeIsolatedMarginUserDataStream", "symbol", symbol);
|
|
4138
|
-
assertParamExists6("closeIsolatedMarginUserDataStream", "listenkey", listenkey);
|
|
4139
|
-
const localVarQueryParameter = {};
|
|
4140
|
-
if (symbol !== void 0 && symbol !== null) {
|
|
4141
|
-
localVarQueryParameter["symbol"] = symbol;
|
|
4142
|
-
}
|
|
4143
|
-
if (listenkey !== void 0 && listenkey !== null) {
|
|
4144
|
-
localVarQueryParameter["listenkey"] = listenkey;
|
|
4145
|
-
}
|
|
4146
|
-
let _timeUnit;
|
|
4147
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
4148
|
-
return {
|
|
4149
|
-
endpoint: "/sapi/v1/userDataStream/isolated",
|
|
4150
|
-
method: "DELETE",
|
|
4151
|
-
params: localVarQueryParameter,
|
|
4152
|
-
timeUnit: _timeUnit
|
|
4153
|
-
};
|
|
4154
|
-
},
|
|
4155
|
-
/**
|
|
4156
|
-
* Close out a Margin user data stream.
|
|
4157
|
-
*
|
|
4158
|
-
* Weight: 3000
|
|
4159
|
-
*
|
|
4160
|
-
* @summary Close Margin User Data Stream (USER_STREAM)
|
|
4161
|
-
* @param {string} listenkey
|
|
4162
|
-
*
|
|
4163
|
-
* @deprecated
|
|
4164
|
-
* @throws {RequiredError}
|
|
4165
|
-
*/
|
|
4166
|
-
closeMarginUserDataStream: async (listenkey) => {
|
|
4167
|
-
assertParamExists6("closeMarginUserDataStream", "listenkey", listenkey);
|
|
4168
|
-
const localVarQueryParameter = {};
|
|
4169
|
-
if (listenkey !== void 0 && listenkey !== null) {
|
|
4170
|
-
localVarQueryParameter["listenkey"] = listenkey;
|
|
4171
|
-
}
|
|
4172
|
-
let _timeUnit;
|
|
4173
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
4174
|
-
return {
|
|
4175
|
-
endpoint: "/sapi/v1/userDataStream",
|
|
4176
|
-
method: "DELETE",
|
|
4177
|
-
params: localVarQueryParameter,
|
|
4178
|
-
timeUnit: _timeUnit
|
|
4179
|
-
};
|
|
4180
|
-
},
|
|
4181
|
-
/**
|
|
4182
|
-
* Keepalive an isolated margin user data stream to prevent a time out.
|
|
4183
|
-
*
|
|
4184
|
-
* Weight: 1
|
|
4185
|
-
*
|
|
4186
|
-
* @summary Keepalive Isolated Margin User Data Stream (USER_STREAM)
|
|
4187
|
-
* @param {string} symbol
|
|
4188
|
-
* @param {string} listenKey
|
|
4189
|
-
*
|
|
4190
|
-
* @deprecated
|
|
4191
|
-
* @throws {RequiredError}
|
|
4192
|
-
*/
|
|
4193
|
-
keepaliveIsolatedMarginUserDataStream: async (symbol, listenKey) => {
|
|
4194
|
-
assertParamExists6("keepaliveIsolatedMarginUserDataStream", "symbol", symbol);
|
|
4195
|
-
assertParamExists6("keepaliveIsolatedMarginUserDataStream", "listenKey", listenKey);
|
|
4196
|
-
const localVarQueryParameter = {};
|
|
4197
|
-
if (symbol !== void 0 && symbol !== null) {
|
|
4198
|
-
localVarQueryParameter["symbol"] = symbol;
|
|
4199
|
-
}
|
|
4200
|
-
if (listenKey !== void 0 && listenKey !== null) {
|
|
4201
|
-
localVarQueryParameter["listenKey"] = listenKey;
|
|
4202
|
-
}
|
|
4203
|
-
let _timeUnit;
|
|
4204
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
4205
|
-
return {
|
|
4206
|
-
endpoint: "/sapi/v1/userDataStream/isolated",
|
|
4207
|
-
method: "PUT",
|
|
4208
|
-
params: localVarQueryParameter,
|
|
4209
|
-
timeUnit: _timeUnit
|
|
4210
|
-
};
|
|
4211
|
-
},
|
|
4212
|
-
/**
|
|
4213
|
-
* Keepalive a margin user data stream to prevent a time out.
|
|
4214
|
-
*
|
|
4215
|
-
* Weight: 1
|
|
4216
|
-
*
|
|
4217
|
-
* @summary Keepalive Margin User Data Stream (USER_STREAM)
|
|
4218
|
-
* @param {string} listenKey
|
|
4219
|
-
*
|
|
4220
|
-
* @deprecated
|
|
4221
|
-
* @throws {RequiredError}
|
|
4222
|
-
*/
|
|
4223
|
-
keepaliveMarginUserDataStream: async (listenKey) => {
|
|
4224
|
-
assertParamExists6("keepaliveMarginUserDataStream", "listenKey", listenKey);
|
|
4225
|
-
const localVarQueryParameter = {};
|
|
4226
|
-
if (listenKey !== void 0 && listenKey !== null) {
|
|
4227
|
-
localVarQueryParameter["listenKey"] = listenKey;
|
|
4228
|
-
}
|
|
4229
|
-
let _timeUnit;
|
|
4230
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
4231
|
-
return {
|
|
4232
|
-
endpoint: "/sapi/v1/userDataStream",
|
|
4233
|
-
method: "PUT",
|
|
4234
|
-
params: localVarQueryParameter,
|
|
4235
|
-
timeUnit: _timeUnit
|
|
4236
|
-
};
|
|
4237
|
-
},
|
|
4238
|
-
/**
|
|
4239
|
-
* Start a new isolated margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
|
|
4240
|
-
*
|
|
4241
|
-
* Weight: 1
|
|
4242
|
-
*
|
|
4243
|
-
* @summary Start Isolated Margin User Data Stream (USER_STREAM)
|
|
4244
|
-
* @param {string} symbol
|
|
4245
|
-
*
|
|
4246
|
-
* @deprecated
|
|
4247
|
-
* @throws {RequiredError}
|
|
4248
|
-
*/
|
|
4249
|
-
startIsolatedMarginUserDataStream: async (symbol) => {
|
|
4250
|
-
assertParamExists6("startIsolatedMarginUserDataStream", "symbol", symbol);
|
|
4251
|
-
const localVarQueryParameter = {};
|
|
4252
|
-
if (symbol !== void 0 && symbol !== null) {
|
|
4253
|
-
localVarQueryParameter["symbol"] = symbol;
|
|
4254
|
-
}
|
|
4255
|
-
let _timeUnit;
|
|
4256
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
4257
|
-
return {
|
|
4258
|
-
endpoint: "/sapi/v1/userDataStream/isolated",
|
|
4259
|
-
method: "POST",
|
|
4260
|
-
params: localVarQueryParameter,
|
|
4261
|
-
timeUnit: _timeUnit
|
|
4262
|
-
};
|
|
4263
|
-
},
|
|
4264
|
-
/**
|
|
4265
|
-
* Start a new margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
|
|
4266
|
-
*
|
|
4267
|
-
* Weight: 1
|
|
4268
|
-
*
|
|
4269
|
-
* @summary Start Margin User Data Stream (USER_STREAM)
|
|
4270
|
-
*
|
|
4271
|
-
* @deprecated
|
|
4272
|
-
* @throws {RequiredError}
|
|
4273
|
-
*/
|
|
4274
|
-
startMarginUserDataStream: async () => {
|
|
4275
|
-
const localVarQueryParameter = {};
|
|
4276
|
-
let _timeUnit;
|
|
4277
|
-
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
4278
|
-
return {
|
|
4279
|
-
endpoint: "/sapi/v1/userDataStream",
|
|
4280
|
-
method: "POST",
|
|
4281
|
-
params: localVarQueryParameter,
|
|
4282
|
-
timeUnit: _timeUnit
|
|
4283
|
-
};
|
|
4284
|
-
}
|
|
4285
|
-
};
|
|
4286
|
-
};
|
|
4287
|
-
var TradeDataStreamApi = class {
|
|
4288
|
-
constructor(configuration) {
|
|
4289
|
-
this.configuration = configuration;
|
|
4290
|
-
this.localVarAxiosParamCreator = TradeDataStreamApiAxiosParamCreator(configuration);
|
|
4291
|
-
}
|
|
4292
|
-
/**
|
|
4293
|
-
* Close out a isolated margin user data stream.
|
|
4294
|
-
*
|
|
4295
|
-
* Weight: 3000
|
|
4296
|
-
*
|
|
4297
|
-
* @summary Close Isolated Margin User Data Stream (USER_STREAM)
|
|
4298
|
-
* @param {CloseIsolatedMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
4299
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
4300
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
4301
|
-
* @memberof TradeDataStreamApi
|
|
4302
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Isolated-Margin-User-Data-Stream Binance API Documentation}
|
|
4303
|
-
*/
|
|
4304
|
-
async closeIsolatedMarginUserDataStream(requestParameters) {
|
|
4305
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.closeIsolatedMarginUserDataStream(
|
|
4306
|
-
requestParameters?.symbol,
|
|
4307
|
-
requestParameters?.listenkey
|
|
4308
|
-
);
|
|
4309
|
-
return sendRequest6(
|
|
4310
|
-
this.configuration,
|
|
4311
|
-
localVarAxiosArgs.endpoint,
|
|
4312
|
-
localVarAxiosArgs.method,
|
|
4313
|
-
localVarAxiosArgs.params,
|
|
4314
|
-
localVarAxiosArgs?.timeUnit,
|
|
4315
|
-
{ isSigned: false }
|
|
4316
|
-
);
|
|
4317
|
-
}
|
|
4318
|
-
/**
|
|
4319
|
-
* Close out a Margin user data stream.
|
|
4320
|
-
*
|
|
4321
|
-
* Weight: 3000
|
|
4322
|
-
*
|
|
4323
|
-
* @summary Close Margin User Data Stream (USER_STREAM)
|
|
4324
|
-
* @param {CloseMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
4325
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
4326
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
4327
|
-
* @memberof TradeDataStreamApi
|
|
4328
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Margin-User-Data-Stream Binance API Documentation}
|
|
4329
|
-
*/
|
|
4330
|
-
async closeMarginUserDataStream(requestParameters) {
|
|
4331
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.closeMarginUserDataStream(
|
|
4332
|
-
requestParameters?.listenkey
|
|
4333
|
-
);
|
|
4334
|
-
return sendRequest6(
|
|
4335
|
-
this.configuration,
|
|
4336
|
-
localVarAxiosArgs.endpoint,
|
|
4337
|
-
localVarAxiosArgs.method,
|
|
4338
|
-
localVarAxiosArgs.params,
|
|
4339
|
-
localVarAxiosArgs?.timeUnit,
|
|
4340
|
-
{ isSigned: false }
|
|
4341
|
-
);
|
|
4342
|
-
}
|
|
4343
|
-
/**
|
|
4344
|
-
* Keepalive an isolated margin user data stream to prevent a time out.
|
|
4345
|
-
*
|
|
4346
|
-
* Weight: 1
|
|
4347
|
-
*
|
|
4348
|
-
* @summary Keepalive Isolated Margin User Data Stream (USER_STREAM)
|
|
4349
|
-
* @param {KeepaliveIsolatedMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
4350
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
4351
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
4352
|
-
* @memberof TradeDataStreamApi
|
|
4353
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Isolated-Margin-User-Data-Stream Binance API Documentation}
|
|
4354
|
-
*/
|
|
4355
|
-
async keepaliveIsolatedMarginUserDataStream(requestParameters) {
|
|
4356
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.keepaliveIsolatedMarginUserDataStream(
|
|
4357
|
-
requestParameters?.symbol,
|
|
4358
|
-
requestParameters?.listenKey
|
|
4359
|
-
);
|
|
4360
|
-
return sendRequest6(
|
|
4361
|
-
this.configuration,
|
|
4362
|
-
localVarAxiosArgs.endpoint,
|
|
4363
|
-
localVarAxiosArgs.method,
|
|
4364
|
-
localVarAxiosArgs.params,
|
|
4365
|
-
localVarAxiosArgs?.timeUnit,
|
|
4366
|
-
{ isSigned: false }
|
|
4367
|
-
);
|
|
4368
|
-
}
|
|
4369
|
-
/**
|
|
4370
|
-
* Keepalive a margin user data stream to prevent a time out.
|
|
4371
|
-
*
|
|
4372
|
-
* Weight: 1
|
|
4373
|
-
*
|
|
4374
|
-
* @summary Keepalive Margin User Data Stream (USER_STREAM)
|
|
4375
|
-
* @param {KeepaliveMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
4376
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
4377
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
4378
|
-
* @memberof TradeDataStreamApi
|
|
4379
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Margin-User-Data-Stream Binance API Documentation}
|
|
4380
|
-
*/
|
|
4381
|
-
async keepaliveMarginUserDataStream(requestParameters) {
|
|
4382
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.keepaliveMarginUserDataStream(
|
|
4383
|
-
requestParameters?.listenKey
|
|
4384
|
-
);
|
|
4385
|
-
return sendRequest6(
|
|
4386
|
-
this.configuration,
|
|
4387
|
-
localVarAxiosArgs.endpoint,
|
|
4388
|
-
localVarAxiosArgs.method,
|
|
4389
|
-
localVarAxiosArgs.params,
|
|
4390
|
-
localVarAxiosArgs?.timeUnit,
|
|
4391
|
-
{ isSigned: false }
|
|
4392
|
-
);
|
|
4393
|
-
}
|
|
4394
|
-
/**
|
|
4395
|
-
* Start a new isolated margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
|
|
4396
|
-
*
|
|
4397
|
-
* Weight: 1
|
|
4398
|
-
*
|
|
4399
|
-
* @summary Start Isolated Margin User Data Stream (USER_STREAM)
|
|
4400
|
-
* @param {StartIsolatedMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
4401
|
-
* @returns {Promise<RestApiResponse<StartIsolatedMarginUserDataStreamResponse>>}
|
|
4402
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
4403
|
-
* @memberof TradeDataStreamApi
|
|
4404
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Isolated-Margin-User-Data-Stream Binance API Documentation}
|
|
4405
|
-
*/
|
|
4406
|
-
async startIsolatedMarginUserDataStream(requestParameters) {
|
|
4407
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.startIsolatedMarginUserDataStream(
|
|
4408
|
-
requestParameters?.symbol
|
|
4409
|
-
);
|
|
4410
|
-
return sendRequest6(
|
|
4411
|
-
this.configuration,
|
|
4412
|
-
localVarAxiosArgs.endpoint,
|
|
4413
|
-
localVarAxiosArgs.method,
|
|
4414
|
-
localVarAxiosArgs.params,
|
|
4415
|
-
localVarAxiosArgs?.timeUnit,
|
|
4416
|
-
{ isSigned: false }
|
|
4417
|
-
);
|
|
4418
|
-
}
|
|
4419
|
-
/**
|
|
4420
|
-
* Start a new margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
|
|
4421
|
-
*
|
|
4422
|
-
* Weight: 1
|
|
4423
|
-
*
|
|
4424
|
-
* @summary Start Margin User Data Stream (USER_STREAM)
|
|
4425
|
-
* @returns {Promise<RestApiResponse<StartMarginUserDataStreamResponse>>}
|
|
4426
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
4427
|
-
* @memberof TradeDataStreamApi
|
|
4428
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Margin-User-Data-Stream Binance API Documentation}
|
|
4429
|
-
*/
|
|
4430
|
-
async startMarginUserDataStream() {
|
|
4431
|
-
const localVarAxiosArgs = await this.localVarAxiosParamCreator.startMarginUserDataStream();
|
|
4432
|
-
return sendRequest6(
|
|
4433
|
-
this.configuration,
|
|
4434
|
-
localVarAxiosArgs.endpoint,
|
|
4435
|
-
localVarAxiosArgs.method,
|
|
4436
|
-
localVarAxiosArgs.params,
|
|
4437
|
-
localVarAxiosArgs?.timeUnit,
|
|
4438
|
-
{ isSigned: false }
|
|
4439
|
-
);
|
|
4440
|
-
}
|
|
4441
|
-
};
|
|
4442
|
-
|
|
4443
|
-
// src/rest-api/modules/transfer-api.ts
|
|
4444
|
-
import {
|
|
4445
|
-
assertParamExists as assertParamExists7,
|
|
4446
|
-
sendRequest as sendRequest7
|
|
4447
|
-
} from "@binance/common";
|
|
4448
4121
|
var TransferApiAxiosParamCreator = function(configuration) {
|
|
4449
4122
|
return {
|
|
4450
4123
|
/**
|
|
@@ -4518,7 +4191,7 @@ var TransferApiAxiosParamCreator = function(configuration) {
|
|
|
4518
4191
|
* @throws {RequiredError}
|
|
4519
4192
|
*/
|
|
4520
4193
|
queryMaxTransferOutAmount: async (asset, isolatedSymbol, recvWindow) => {
|
|
4521
|
-
|
|
4194
|
+
assertParamExists6("queryMaxTransferOutAmount", "asset", asset);
|
|
4522
4195
|
const localVarQueryParameter = {};
|
|
4523
4196
|
if (asset !== void 0 && asset !== null) {
|
|
4524
4197
|
localVarQueryParameter["asset"] = asset;
|
|
@@ -4572,7 +4245,7 @@ var TransferApi = class {
|
|
|
4572
4245
|
requestParameters?.isolatedSymbol,
|
|
4573
4246
|
requestParameters?.recvWindow
|
|
4574
4247
|
);
|
|
4575
|
-
return
|
|
4248
|
+
return sendRequest6(
|
|
4576
4249
|
this.configuration,
|
|
4577
4250
|
localVarAxiosArgs.endpoint,
|
|
4578
4251
|
localVarAxiosArgs.method,
|
|
@@ -4601,7 +4274,7 @@ var TransferApi = class {
|
|
|
4601
4274
|
requestParameters?.isolatedSymbol,
|
|
4602
4275
|
requestParameters?.recvWindow
|
|
4603
4276
|
);
|
|
4604
|
-
return
|
|
4277
|
+
return sendRequest6(
|
|
4605
4278
|
this.configuration,
|
|
4606
4279
|
localVarAxiosArgs.endpoint,
|
|
4607
4280
|
localVarAxiosArgs.method,
|
|
@@ -4613,7 +4286,7 @@ var TransferApi = class {
|
|
|
4613
4286
|
};
|
|
4614
4287
|
|
|
4615
4288
|
// src/rest-api/rest-api.ts
|
|
4616
|
-
import { sendRequest as
|
|
4289
|
+
import { sendRequest as sendRequest7 } from "@binance/common";
|
|
4617
4290
|
var RestAPI = class {
|
|
4618
4291
|
constructor(configuration) {
|
|
4619
4292
|
this.configuration = configuration;
|
|
@@ -4622,7 +4295,6 @@ var RestAPI = class {
|
|
|
4622
4295
|
this.marketDataApi = new MarketDataApi(configuration);
|
|
4623
4296
|
this.riskDataStreamApi = new RiskDataStreamApi(configuration);
|
|
4624
4297
|
this.tradeApi = new TradeApi(configuration);
|
|
4625
|
-
this.tradeDataStreamApi = new TradeDataStreamApi(configuration);
|
|
4626
4298
|
this.transferApi = new TransferApi(configuration);
|
|
4627
4299
|
}
|
|
4628
4300
|
/**
|
|
@@ -4634,7 +4306,7 @@ var RestAPI = class {
|
|
|
4634
4306
|
* @returns A promise resolving to the response data object.
|
|
4635
4307
|
*/
|
|
4636
4308
|
sendRequest(endpoint, method, params = {}) {
|
|
4637
|
-
return
|
|
4309
|
+
return sendRequest7(this.configuration, endpoint, method, params, void 0);
|
|
4638
4310
|
}
|
|
4639
4311
|
/**
|
|
4640
4312
|
* Generic function to send a signed request.
|
|
@@ -4645,7 +4317,7 @@ var RestAPI = class {
|
|
|
4645
4317
|
* @returns A promise resolving to the response data object.
|
|
4646
4318
|
*/
|
|
4647
4319
|
sendSignedRequest(endpoint, method, params = {}) {
|
|
4648
|
-
return
|
|
4320
|
+
return sendRequest7(this.configuration, endpoint, method, params, void 0, {
|
|
4649
4321
|
isSigned: true
|
|
4650
4322
|
});
|
|
4651
4323
|
}
|
|
@@ -5596,95 +5268,6 @@ var RestAPI = class {
|
|
|
5596
5268
|
smallLiabilityExchange(requestParameters) {
|
|
5597
5269
|
return this.tradeApi.smallLiabilityExchange(requestParameters);
|
|
5598
5270
|
}
|
|
5599
|
-
/**
|
|
5600
|
-
* Close out a isolated margin user data stream.
|
|
5601
|
-
*
|
|
5602
|
-
* Weight: 3000
|
|
5603
|
-
*
|
|
5604
|
-
* @summary Close Isolated Margin User Data Stream (USER_STREAM)
|
|
5605
|
-
* @param {CloseIsolatedMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
5606
|
-
* @deprecated
|
|
5607
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
5608
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
5609
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Isolated-Margin-User-Data-Stream Binance API Documentation}
|
|
5610
|
-
*/
|
|
5611
|
-
closeIsolatedMarginUserDataStream(requestParameters) {
|
|
5612
|
-
return this.tradeDataStreamApi.closeIsolatedMarginUserDataStream(requestParameters);
|
|
5613
|
-
}
|
|
5614
|
-
/**
|
|
5615
|
-
* Close out a Margin user data stream.
|
|
5616
|
-
*
|
|
5617
|
-
* Weight: 3000
|
|
5618
|
-
*
|
|
5619
|
-
* @summary Close Margin User Data Stream (USER_STREAM)
|
|
5620
|
-
* @param {CloseMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
5621
|
-
* @deprecated
|
|
5622
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
5623
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
5624
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Margin-User-Data-Stream Binance API Documentation}
|
|
5625
|
-
*/
|
|
5626
|
-
closeMarginUserDataStream(requestParameters) {
|
|
5627
|
-
return this.tradeDataStreamApi.closeMarginUserDataStream(requestParameters);
|
|
5628
|
-
}
|
|
5629
|
-
/**
|
|
5630
|
-
* Keepalive an isolated margin user data stream to prevent a time out.
|
|
5631
|
-
*
|
|
5632
|
-
* Weight: 1
|
|
5633
|
-
*
|
|
5634
|
-
* @summary Keepalive Isolated Margin User Data Stream (USER_STREAM)
|
|
5635
|
-
* @param {KeepaliveIsolatedMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
5636
|
-
* @deprecated
|
|
5637
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
5638
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
5639
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Isolated-Margin-User-Data-Stream Binance API Documentation}
|
|
5640
|
-
*/
|
|
5641
|
-
keepaliveIsolatedMarginUserDataStream(requestParameters) {
|
|
5642
|
-
return this.tradeDataStreamApi.keepaliveIsolatedMarginUserDataStream(requestParameters);
|
|
5643
|
-
}
|
|
5644
|
-
/**
|
|
5645
|
-
* Keepalive a margin user data stream to prevent a time out.
|
|
5646
|
-
*
|
|
5647
|
-
* Weight: 1
|
|
5648
|
-
*
|
|
5649
|
-
* @summary Keepalive Margin User Data Stream (USER_STREAM)
|
|
5650
|
-
* @param {KeepaliveMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
5651
|
-
* @deprecated
|
|
5652
|
-
* @returns {Promise<RestApiResponse<void>>}
|
|
5653
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
5654
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Margin-User-Data-Stream Binance API Documentation}
|
|
5655
|
-
*/
|
|
5656
|
-
keepaliveMarginUserDataStream(requestParameters) {
|
|
5657
|
-
return this.tradeDataStreamApi.keepaliveMarginUserDataStream(requestParameters);
|
|
5658
|
-
}
|
|
5659
|
-
/**
|
|
5660
|
-
* Start a new isolated margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
|
|
5661
|
-
*
|
|
5662
|
-
* Weight: 1
|
|
5663
|
-
*
|
|
5664
|
-
* @summary Start Isolated Margin User Data Stream (USER_STREAM)
|
|
5665
|
-
* @param {StartIsolatedMarginUserDataStreamRequest} requestParameters Request parameters.
|
|
5666
|
-
* @deprecated
|
|
5667
|
-
* @returns {Promise<RestApiResponse<StartIsolatedMarginUserDataStreamResponse>>}
|
|
5668
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
5669
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Isolated-Margin-User-Data-Stream Binance API Documentation}
|
|
5670
|
-
*/
|
|
5671
|
-
startIsolatedMarginUserDataStream(requestParameters) {
|
|
5672
|
-
return this.tradeDataStreamApi.startIsolatedMarginUserDataStream(requestParameters);
|
|
5673
|
-
}
|
|
5674
|
-
/**
|
|
5675
|
-
* Start a new margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes.
|
|
5676
|
-
*
|
|
5677
|
-
* Weight: 1
|
|
5678
|
-
*
|
|
5679
|
-
* @summary Start Margin User Data Stream (USER_STREAM)
|
|
5680
|
-
* @deprecated
|
|
5681
|
-
* @returns {Promise<RestApiResponse<StartMarginUserDataStreamResponse>>}
|
|
5682
|
-
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
5683
|
-
* @see {@link https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Margin-User-Data-Stream Binance API Documentation}
|
|
5684
|
-
*/
|
|
5685
|
-
startMarginUserDataStream() {
|
|
5686
|
-
return this.tradeDataStreamApi.startMarginUserDataStream();
|
|
5687
|
-
}
|
|
5688
5271
|
/**
|
|
5689
5272
|
* Get Cross Margin Transfer History
|
|
5690
5273
|
*
|
|
@@ -5869,7 +5452,7 @@ var MarginTrading = class {
|
|
|
5869
5452
|
constructor(config) {
|
|
5870
5453
|
const userAgent = buildUserAgent(name, version);
|
|
5871
5454
|
if (config?.configurationRestAPI) {
|
|
5872
|
-
const configRestAPI = new
|
|
5455
|
+
const configRestAPI = new ConfigurationRestAPI8(
|
|
5873
5456
|
config.configurationRestAPI
|
|
5874
5457
|
);
|
|
5875
5458
|
configRestAPI.basePath = configRestAPI.basePath || MARGIN_TRADING_REST_API_PROD_URL;
|