ccxt 4.3.4 → 4.3.6
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/README.md +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +299 -6
- package/dist/cjs/src/binance.js +24 -17
- package/dist/cjs/src/bingx.js +45 -0
- package/dist/cjs/src/bitmex.js +24 -0
- package/dist/cjs/src/bybit.js +86 -0
- package/dist/cjs/src/coinbase.js +5 -4
- package/dist/cjs/src/coinex.js +30 -32
- package/dist/cjs/src/cryptocom.js +32 -0
- package/dist/cjs/src/htx.js +28 -0
- package/dist/cjs/src/hyperliquid.js +40 -0
- package/dist/cjs/src/kraken.js +30 -0
- package/dist/cjs/src/krakenfutures.js +28 -0
- package/dist/cjs/src/kucoin.js +53 -3
- package/dist/cjs/src/kucoinfutures.js +2 -2
- package/dist/cjs/src/okx.js +113 -0
- package/dist/cjs/src/pro/binance.js +439 -75
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/woo.js +0 -1
- package/dist/cjs/src/whitebit.js +174 -2
- package/dist/cjs/src/woo.js +29 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/whitebit.d.ts +21 -0
- package/js/src/abstract/woo.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +52 -3
- package/js/src/base/Exchange.js +299 -6
- package/js/src/binance.d.ts +4 -0
- package/js/src/binance.js +24 -17
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +45 -0
- package/js/src/bitmex.d.ts +1 -0
- package/js/src/bitmex.js +24 -0
- package/js/src/bybit.d.ts +2 -1
- package/js/src/bybit.js +86 -0
- package/js/src/coinbase.js +5 -4
- package/js/src/coinex.js +30 -32
- package/js/src/cryptocom.d.ts +2 -1
- package/js/src/cryptocom.js +32 -0
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +28 -0
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +40 -0
- package/js/src/kraken.d.ts +1 -0
- package/js/src/kraken.js +30 -0
- package/js/src/krakenfutures.d.ts +1 -0
- package/js/src/krakenfutures.js +28 -0
- package/js/src/kucoin.d.ts +1 -0
- package/js/src/kucoin.js +53 -3
- package/js/src/kucoinfutures.js +2 -2
- package/js/src/okx.d.ts +3 -1
- package/js/src/okx.js +113 -0
- package/js/src/pro/binance.d.ts +9 -1
- package/js/src/pro/binance.js +439 -75
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/cex.d.ts +1 -1
- package/js/src/pro/lbank.d.ts +1 -1
- package/js/src/pro/woo.js +0 -1
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/whitebit.d.ts +3 -0
- package/js/src/whitebit.js +174 -2
- package/js/src/woo.d.ts +2 -1
- package/js/src/woo.js +29 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,13 +213,13 @@ console.log(version, Object.keys(exchanges));
|
|
|
213
213
|
|
|
214
214
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
215
215
|
|
|
216
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
217
|
-
* unpkg: https://unpkg.com/ccxt@4.3.
|
|
216
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.3.6/dist/ccxt.browser.js
|
|
217
|
+
* unpkg: https://unpkg.com/ccxt@4.3.6/dist/ccxt.browser.js
|
|
218
218
|
|
|
219
219
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
220
220
|
|
|
221
221
|
```HTML
|
|
222
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.
|
|
222
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.3.6/dist/ccxt.browser.js"></script>
|
|
223
223
|
```
|
|
224
224
|
|
|
225
225
|
Creates a global `ccxt` object:
|
package/dist/cjs/ccxt.js
CHANGED
|
@@ -182,7 +182,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
182
182
|
|
|
183
183
|
//-----------------------------------------------------------------------------
|
|
184
184
|
// this is updated by vss.js when building
|
|
185
|
-
const version = '4.3.
|
|
185
|
+
const version = '4.3.6';
|
|
186
186
|
Exchange["default"].ccxtVersion = version;
|
|
187
187
|
const exchanges = {
|
|
188
188
|
'ace': ace,
|
|
@@ -374,35 +374,55 @@ class Exchange {
|
|
|
374
374
|
'cancelAllOrders': undefined,
|
|
375
375
|
'cancelAllOrdersWs': undefined,
|
|
376
376
|
'cancelOrder': true,
|
|
377
|
+
'cancelOrderWs': undefined,
|
|
377
378
|
'cancelOrders': undefined,
|
|
378
379
|
'cancelOrdersWs': undefined,
|
|
379
|
-
'cancelOrderWs': undefined,
|
|
380
380
|
'closeAllPositions': undefined,
|
|
381
381
|
'closePosition': undefined,
|
|
382
382
|
'createDepositAddress': undefined,
|
|
383
383
|
'createLimitBuyOrder': undefined,
|
|
384
|
+
'createLimitBuyOrderWs': undefined,
|
|
384
385
|
'createLimitOrder': true,
|
|
386
|
+
'createLimitOrderWs': undefined,
|
|
385
387
|
'createLimitSellOrder': undefined,
|
|
388
|
+
'createLimitSellOrderWs': undefined,
|
|
386
389
|
'createMarketBuyOrder': undefined,
|
|
390
|
+
'createMarketBuyOrderWs': undefined,
|
|
387
391
|
'createMarketBuyOrderWithCost': undefined,
|
|
392
|
+
'createMarketBuyOrderWithCostWs': undefined,
|
|
388
393
|
'createMarketOrder': true,
|
|
394
|
+
'createMarketOrderWs': true,
|
|
389
395
|
'createMarketOrderWithCost': undefined,
|
|
396
|
+
'createMarketOrderWithCostWs': undefined,
|
|
390
397
|
'createMarketSellOrder': undefined,
|
|
398
|
+
'createMarketSellOrderWs': undefined,
|
|
391
399
|
'createMarketSellOrderWithCost': undefined,
|
|
400
|
+
'createMarketSellOrderWithCostWs': undefined,
|
|
392
401
|
'createOrder': true,
|
|
402
|
+
'createOrderWs': undefined,
|
|
393
403
|
'createOrders': undefined,
|
|
394
404
|
'createOrderWithTakeProfitAndStopLoss': undefined,
|
|
395
|
-
'
|
|
405
|
+
'createOrderWithTakeProfitAndStopLossWs': undefined,
|
|
396
406
|
'createPostOnlyOrder': undefined,
|
|
407
|
+
'createPostOnlyOrderWs': undefined,
|
|
397
408
|
'createReduceOnlyOrder': undefined,
|
|
409
|
+
'createReduceOnlyOrderWs': undefined,
|
|
398
410
|
'createStopLimitOrder': undefined,
|
|
411
|
+
'createStopLimitOrderWs': undefined,
|
|
399
412
|
'createStopLossOrder': undefined,
|
|
413
|
+
'createStopLossOrderWs': undefined,
|
|
400
414
|
'createStopMarketOrder': undefined,
|
|
415
|
+
'createStopMarketOrderWs': undefined,
|
|
401
416
|
'createStopOrder': undefined,
|
|
417
|
+
'createStopOrderWs': undefined,
|
|
402
418
|
'createTakeProfitOrder': undefined,
|
|
419
|
+
'createTakeProfitOrderWs': undefined,
|
|
403
420
|
'createTrailingAmountOrder': undefined,
|
|
421
|
+
'createTrailingAmountOrderWs': undefined,
|
|
404
422
|
'createTrailingPercentOrder': undefined,
|
|
423
|
+
'createTrailingPercentOrderWs': undefined,
|
|
405
424
|
'createTriggerOrder': undefined,
|
|
425
|
+
'createTriggerOrderWs': undefined,
|
|
406
426
|
'deposit': undefined,
|
|
407
427
|
'editOrder': 'emulated',
|
|
408
428
|
'editOrderWs': undefined,
|
|
@@ -485,16 +505,20 @@ class Exchange {
|
|
|
485
505
|
'fetchOrderWs': undefined,
|
|
486
506
|
'fetchPermissions': undefined,
|
|
487
507
|
'fetchPosition': undefined,
|
|
508
|
+
'fetchPositionWs': undefined,
|
|
488
509
|
'fetchPositionMode': undefined,
|
|
489
510
|
'fetchPositions': undefined,
|
|
511
|
+
'fetchPositionsWs': undefined,
|
|
490
512
|
'fetchPositionsForSymbol': undefined,
|
|
513
|
+
'fetchPositionsForSymbolWs': undefined,
|
|
491
514
|
'fetchPositionsRisk': undefined,
|
|
492
515
|
'fetchPremiumIndexOHLCV': undefined,
|
|
493
516
|
'fetchSettlementHistory': undefined,
|
|
494
517
|
'fetchStatus': undefined,
|
|
495
518
|
'fetchTicker': true,
|
|
496
|
-
'fetchTickers': undefined,
|
|
497
519
|
'fetchTickerWs': undefined,
|
|
520
|
+
'fetchTickers': undefined,
|
|
521
|
+
'fetchTickersWs': undefined,
|
|
498
522
|
'fetchTime': undefined,
|
|
499
523
|
'fetchTrades': true,
|
|
500
524
|
'fetchTradesWs': undefined,
|
|
@@ -3784,6 +3808,9 @@ class Exchange {
|
|
|
3784
3808
|
async fetchPosition(symbol, params = {}) {
|
|
3785
3809
|
throw new errors.NotSupported(this.id + ' fetchPosition() is not supported yet');
|
|
3786
3810
|
}
|
|
3811
|
+
async fetchPositionWs(symbol, params = {}) {
|
|
3812
|
+
throw new errors.NotSupported(this.id + ' fetchPositionWs() is not supported yet');
|
|
3813
|
+
}
|
|
3787
3814
|
async watchPosition(symbol = undefined, params = {}) {
|
|
3788
3815
|
throw new errors.NotSupported(this.id + ' watchPosition() is not supported yet');
|
|
3789
3816
|
}
|
|
@@ -3804,9 +3831,23 @@ class Exchange {
|
|
|
3804
3831
|
*/
|
|
3805
3832
|
throw new errors.NotSupported(this.id + ' fetchPositionsForSymbol() is not supported yet');
|
|
3806
3833
|
}
|
|
3834
|
+
async fetchPositionsForSymbolWs(symbol, params = {}) {
|
|
3835
|
+
/**
|
|
3836
|
+
* @method
|
|
3837
|
+
* @name exchange#fetchPositionsForSymbol
|
|
3838
|
+
* @description fetches all open positions for specific symbol, unlike fetchPositions (which is designed to work with multiple symbols) so this method might be preffered for one-market position, because of less rate-limit consumption and speed
|
|
3839
|
+
* @param {string} symbol unified market symbol
|
|
3840
|
+
* @param {object} params extra parameters specific to the endpoint
|
|
3841
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure} with maximum 3 items - possible one position for "one-way" mode, and possible two positions (long & short) for "two-way" (a.k.a. hedge) mode
|
|
3842
|
+
*/
|
|
3843
|
+
throw new errors.NotSupported(this.id + ' fetchPositionsForSymbol() is not supported yet');
|
|
3844
|
+
}
|
|
3807
3845
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
3808
3846
|
throw new errors.NotSupported(this.id + ' fetchPositions() is not supported yet');
|
|
3809
3847
|
}
|
|
3848
|
+
async fetchPositionsWs(symbols = undefined, params = {}) {
|
|
3849
|
+
throw new errors.NotSupported(this.id + ' fetchPositions() is not supported yet');
|
|
3850
|
+
}
|
|
3810
3851
|
async fetchPositionsRisk(symbols = undefined, params = {}) {
|
|
3811
3852
|
throw new errors.NotSupported(this.id + ' fetchPositionsRisk() is not supported yet');
|
|
3812
3853
|
}
|
|
@@ -4183,12 +4224,33 @@ class Exchange {
|
|
|
4183
4224
|
throw new errors.NotSupported(this.id + ' fetchTicker() is not supported yet');
|
|
4184
4225
|
}
|
|
4185
4226
|
}
|
|
4227
|
+
async fetchTickerWs(symbol, params = {}) {
|
|
4228
|
+
if (this.has['fetchTickersWs']) {
|
|
4229
|
+
await this.loadMarkets();
|
|
4230
|
+
const market = this.market(symbol);
|
|
4231
|
+
symbol = market['symbol'];
|
|
4232
|
+
const tickers = await this.fetchTickerWs(symbol, params);
|
|
4233
|
+
const ticker = this.safeDict(tickers, symbol);
|
|
4234
|
+
if (ticker === undefined) {
|
|
4235
|
+
throw new errors.NullResponse(this.id + ' fetchTickers() could not find a ticker for ' + symbol);
|
|
4236
|
+
}
|
|
4237
|
+
else {
|
|
4238
|
+
return ticker;
|
|
4239
|
+
}
|
|
4240
|
+
}
|
|
4241
|
+
else {
|
|
4242
|
+
throw new errors.NotSupported(this.id + ' fetchTicker() is not supported yet');
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4186
4245
|
async watchTicker(symbol, params = {}) {
|
|
4187
4246
|
throw new errors.NotSupported(this.id + ' watchTicker() is not supported yet');
|
|
4188
4247
|
}
|
|
4189
4248
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
4190
4249
|
throw new errors.NotSupported(this.id + ' fetchTickers() is not supported yet');
|
|
4191
4250
|
}
|
|
4251
|
+
async fetchTickersWs(symbols = undefined, params = {}) {
|
|
4252
|
+
throw new errors.NotSupported(this.id + ' fetchTickers() is not supported yet');
|
|
4253
|
+
}
|
|
4192
4254
|
async fetchOrderBooks(symbols = undefined, limit = undefined, params = {}) {
|
|
4193
4255
|
throw new errors.NotSupported(this.id + ' fetchOrderBooks() is not supported yet');
|
|
4194
4256
|
}
|
|
@@ -4243,6 +4305,33 @@ class Exchange {
|
|
|
4243
4305
|
}
|
|
4244
4306
|
throw new errors.NotSupported(this.id + ' createTrailingAmountOrder() is not supported yet');
|
|
4245
4307
|
}
|
|
4308
|
+
async createTrailingAmountOrderWs(symbol, type, side, amount, price = undefined, trailingAmount = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
4309
|
+
/**
|
|
4310
|
+
* @method
|
|
4311
|
+
* @name createTrailingAmountOrderWs
|
|
4312
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingAmount
|
|
4313
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4314
|
+
* @param {string} type 'market' or 'limit'
|
|
4315
|
+
* @param {string} side 'buy' or 'sell'
|
|
4316
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
4317
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
4318
|
+
* @param {float} trailingAmount the quote amount to trail away from the current market price
|
|
4319
|
+
* @param {float} [trailingTriggerPrice] the price to activate a trailing order, default uses the price argument
|
|
4320
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4321
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4322
|
+
*/
|
|
4323
|
+
if (trailingAmount === undefined) {
|
|
4324
|
+
throw new errors.ArgumentsRequired(this.id + ' createTrailingAmountOrderWs() requires a trailingAmount argument');
|
|
4325
|
+
}
|
|
4326
|
+
params['trailingAmount'] = trailingAmount;
|
|
4327
|
+
if (trailingTriggerPrice !== undefined) {
|
|
4328
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
4329
|
+
}
|
|
4330
|
+
if (this.has['createTrailingAmountOrderWs']) {
|
|
4331
|
+
return await this.createOrderWs(symbol, type, side, amount, price, params);
|
|
4332
|
+
}
|
|
4333
|
+
throw new errors.NotSupported(this.id + ' createTrailingAmountOrderWs() is not supported yet');
|
|
4334
|
+
}
|
|
4246
4335
|
async createTrailingPercentOrder(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
4247
4336
|
/**
|
|
4248
4337
|
* @method
|
|
@@ -4270,6 +4359,33 @@ class Exchange {
|
|
|
4270
4359
|
}
|
|
4271
4360
|
throw new errors.NotSupported(this.id + ' createTrailingPercentOrder() is not supported yet');
|
|
4272
4361
|
}
|
|
4362
|
+
async createTrailingPercentOrderWs(symbol, type, side, amount, price = undefined, trailingPercent = undefined, trailingTriggerPrice = undefined, params = {}) {
|
|
4363
|
+
/**
|
|
4364
|
+
* @method
|
|
4365
|
+
* @name createTrailingPercentOrderWs
|
|
4366
|
+
* @description create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
|
4367
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4368
|
+
* @param {string} type 'market' or 'limit'
|
|
4369
|
+
* @param {string} side 'buy' or 'sell'
|
|
4370
|
+
* @param {float} amount how much you want to trade in units of the base currency, or number of contracts
|
|
4371
|
+
* @param {float} [price] the price for the order to be filled at, in units of the quote currency, ignored in market orders
|
|
4372
|
+
* @param {float} trailingPercent the percent to trail away from the current market price
|
|
4373
|
+
* @param {float} [trailingTriggerPrice] the price to activate a trailing order, default uses the price argument
|
|
4374
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4375
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4376
|
+
*/
|
|
4377
|
+
if (trailingPercent === undefined) {
|
|
4378
|
+
throw new errors.ArgumentsRequired(this.id + ' createTrailingPercentOrderWs() requires a trailingPercent argument');
|
|
4379
|
+
}
|
|
4380
|
+
params['trailingPercent'] = trailingPercent;
|
|
4381
|
+
if (trailingTriggerPrice !== undefined) {
|
|
4382
|
+
params['trailingTriggerPrice'] = trailingTriggerPrice;
|
|
4383
|
+
}
|
|
4384
|
+
if (this.has['createTrailingPercentOrderWs']) {
|
|
4385
|
+
return await this.createOrderWs(symbol, type, side, amount, price, params);
|
|
4386
|
+
}
|
|
4387
|
+
throw new errors.NotSupported(this.id + ' createTrailingPercentOrderWs() is not supported yet');
|
|
4388
|
+
}
|
|
4273
4389
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
4274
4390
|
/**
|
|
4275
4391
|
* @method
|
|
@@ -4316,6 +4432,22 @@ class Exchange {
|
|
|
4316
4432
|
}
|
|
4317
4433
|
throw new errors.NotSupported(this.id + ' createMarketSellOrderWithCost() is not supported yet');
|
|
4318
4434
|
}
|
|
4435
|
+
async createMarketOrderWithCostWs(symbol, side, cost, params = {}) {
|
|
4436
|
+
/**
|
|
4437
|
+
* @method
|
|
4438
|
+
* @name createMarketOrderWithCostWs
|
|
4439
|
+
* @description create a market order by providing the symbol, side and cost
|
|
4440
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4441
|
+
* @param {string} side 'buy' or 'sell'
|
|
4442
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
4443
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4444
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4445
|
+
*/
|
|
4446
|
+
if (this.has['createMarketOrderWithCostWs'] || (this.has['createMarketBuyOrderWithCostWs'] && this.has['createMarketSellOrderWithCostWs'])) {
|
|
4447
|
+
return await this.createOrderWs(symbol, 'market', side, cost, 1, params);
|
|
4448
|
+
}
|
|
4449
|
+
throw new errors.NotSupported(this.id + ' createMarketOrderWithCostWs() is not supported yet');
|
|
4450
|
+
}
|
|
4319
4451
|
async createTriggerOrder(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
|
|
4320
4452
|
/**
|
|
4321
4453
|
* @method
|
|
@@ -4339,6 +4471,29 @@ class Exchange {
|
|
|
4339
4471
|
}
|
|
4340
4472
|
throw new errors.NotSupported(this.id + ' createTriggerOrder() is not supported yet');
|
|
4341
4473
|
}
|
|
4474
|
+
async createTriggerOrderWs(symbol, type, side, amount, price = undefined, triggerPrice = undefined, params = {}) {
|
|
4475
|
+
/**
|
|
4476
|
+
* @method
|
|
4477
|
+
* @name createTriggerOrderWs
|
|
4478
|
+
* @description create a trigger stop order (type 1)
|
|
4479
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4480
|
+
* @param {string} type 'market' or 'limit'
|
|
4481
|
+
* @param {string} side 'buy' or 'sell'
|
|
4482
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
4483
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
4484
|
+
* @param {float} triggerPrice the price to trigger the stop order, in units of the quote currency
|
|
4485
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4486
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4487
|
+
*/
|
|
4488
|
+
if (triggerPrice === undefined) {
|
|
4489
|
+
throw new errors.ArgumentsRequired(this.id + ' createTriggerOrderWs() requires a triggerPrice argument');
|
|
4490
|
+
}
|
|
4491
|
+
params['triggerPrice'] = triggerPrice;
|
|
4492
|
+
if (this.has['createTriggerOrderWs']) {
|
|
4493
|
+
return await this.createOrderWs(symbol, type, side, amount, price, params);
|
|
4494
|
+
}
|
|
4495
|
+
throw new errors.NotSupported(this.id + ' createTriggerOrderWs() is not supported yet');
|
|
4496
|
+
}
|
|
4342
4497
|
async createStopLossOrder(symbol, type, side, amount, price = undefined, stopLossPrice = undefined, params = {}) {
|
|
4343
4498
|
/**
|
|
4344
4499
|
* @method
|
|
@@ -4362,6 +4517,29 @@ class Exchange {
|
|
|
4362
4517
|
}
|
|
4363
4518
|
throw new errors.NotSupported(this.id + ' createStopLossOrder() is not supported yet');
|
|
4364
4519
|
}
|
|
4520
|
+
async createStopLossOrderWs(symbol, type, side, amount, price = undefined, stopLossPrice = undefined, params = {}) {
|
|
4521
|
+
/**
|
|
4522
|
+
* @method
|
|
4523
|
+
* @name createStopLossOrderWs
|
|
4524
|
+
* @description create a trigger stop loss order (type 2)
|
|
4525
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4526
|
+
* @param {string} type 'market' or 'limit'
|
|
4527
|
+
* @param {string} side 'buy' or 'sell'
|
|
4528
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
4529
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
4530
|
+
* @param {float} stopLossPrice the price to trigger the stop loss order, in units of the quote currency
|
|
4531
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4532
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4533
|
+
*/
|
|
4534
|
+
if (stopLossPrice === undefined) {
|
|
4535
|
+
throw new errors.ArgumentsRequired(this.id + ' createStopLossOrderWs() requires a stopLossPrice argument');
|
|
4536
|
+
}
|
|
4537
|
+
params['stopLossPrice'] = stopLossPrice;
|
|
4538
|
+
if (this.has['createStopLossOrderWs']) {
|
|
4539
|
+
return await this.createOrderWs(symbol, type, side, amount, price, params);
|
|
4540
|
+
}
|
|
4541
|
+
throw new errors.NotSupported(this.id + ' createStopLossOrderWs() is not supported yet');
|
|
4542
|
+
}
|
|
4365
4543
|
async createTakeProfitOrder(symbol, type, side, amount, price = undefined, takeProfitPrice = undefined, params = {}) {
|
|
4366
4544
|
/**
|
|
4367
4545
|
* @method
|
|
@@ -4385,6 +4563,29 @@ class Exchange {
|
|
|
4385
4563
|
}
|
|
4386
4564
|
throw new errors.NotSupported(this.id + ' createTakeProfitOrder() is not supported yet');
|
|
4387
4565
|
}
|
|
4566
|
+
async createTakeProfitOrderWs(symbol, type, side, amount, price = undefined, takeProfitPrice = undefined, params = {}) {
|
|
4567
|
+
/**
|
|
4568
|
+
* @method
|
|
4569
|
+
* @name createTakeProfitOrderWs
|
|
4570
|
+
* @description create a trigger take profit order (type 2)
|
|
4571
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4572
|
+
* @param {string} type 'market' or 'limit'
|
|
4573
|
+
* @param {string} side 'buy' or 'sell'
|
|
4574
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
4575
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
4576
|
+
* @param {float} takeProfitPrice the price to trigger the take profit order, in units of the quote currency
|
|
4577
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4578
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4579
|
+
*/
|
|
4580
|
+
if (takeProfitPrice === undefined) {
|
|
4581
|
+
throw new errors.ArgumentsRequired(this.id + ' createTakeProfitOrderWs() requires a takeProfitPrice argument');
|
|
4582
|
+
}
|
|
4583
|
+
params['takeProfitPrice'] = takeProfitPrice;
|
|
4584
|
+
if (this.has['createTakeProfitOrderWs']) {
|
|
4585
|
+
return await this.createOrderWs(symbol, type, side, amount, price, params);
|
|
4586
|
+
}
|
|
4587
|
+
throw new errors.NotSupported(this.id + ' createTakeProfitOrderWs() is not supported yet');
|
|
4588
|
+
}
|
|
4388
4589
|
async createOrderWithTakeProfitAndStopLoss(symbol, type, side, amount, price = undefined, takeProfit = undefined, stopLoss = undefined, params = {}) {
|
|
4389
4590
|
/**
|
|
4390
4591
|
* @method
|
|
@@ -4408,6 +4609,13 @@ class Exchange {
|
|
|
4408
4609
|
* @param {float} [params.stopLossAmount] *not available on all exchanges* the amount for a stop loss
|
|
4409
4610
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4410
4611
|
*/
|
|
4612
|
+
params = this.setTakeProfitAndStopLossParams(symbol, type, side, amount, price, takeProfit, stopLoss, params);
|
|
4613
|
+
if (this.has['createOrderWithTakeProfitAndStopLoss']) {
|
|
4614
|
+
return await this.createOrder(symbol, type, side, amount, price, params);
|
|
4615
|
+
}
|
|
4616
|
+
throw new errors.NotSupported(this.id + ' createOrderWithTakeProfitAndStopLoss() is not supported yet');
|
|
4617
|
+
}
|
|
4618
|
+
setTakeProfitAndStopLossParams(symbol, type, side, amount, price = undefined, takeProfit = undefined, stopLoss = undefined, params = {}) {
|
|
4411
4619
|
if ((takeProfit === undefined) && (stopLoss === undefined)) {
|
|
4412
4620
|
throw new errors.ArgumentsRequired(this.id + ' createOrderWithTakeProfitAndStopLoss() requires either a takeProfit or stopLoss argument');
|
|
4413
4621
|
}
|
|
@@ -4454,10 +4662,36 @@ class Exchange {
|
|
|
4454
4662
|
params['stopLoss']['amount'] = this.parseToNumeric(stopLossAmount);
|
|
4455
4663
|
}
|
|
4456
4664
|
params = this.omit(params, ['takeProfitType', 'takeProfitPriceType', 'takeProfitLimitPrice', 'takeProfitAmount', 'stopLossType', 'stopLossPriceType', 'stopLossLimitPrice', 'stopLossAmount']);
|
|
4457
|
-
|
|
4458
|
-
|
|
4665
|
+
return params;
|
|
4666
|
+
}
|
|
4667
|
+
async createOrderWithTakeProfitAndStopLossWs(symbol, type, side, amount, price = undefined, takeProfit = undefined, stopLoss = undefined, params = {}) {
|
|
4668
|
+
/**
|
|
4669
|
+
* @method
|
|
4670
|
+
* @name createOrderWithTakeProfitAndStopLossWs
|
|
4671
|
+
* @description create an order with a stop loss or take profit attached (type 3)
|
|
4672
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4673
|
+
* @param {string} type 'market' or 'limit'
|
|
4674
|
+
* @param {string} side 'buy' or 'sell'
|
|
4675
|
+
* @param {float} amount how much you want to trade in units of the base currency or the number of contracts
|
|
4676
|
+
* @param {float} [price] the price to fulfill the order, in units of the quote currency, ignored in market orders
|
|
4677
|
+
* @param {float} [takeProfit] the take profit price, in units of the quote currency
|
|
4678
|
+
* @param {float} [stopLoss] the stop loss price, in units of the quote currency
|
|
4679
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4680
|
+
* @param {string} [params.takeProfitType] *not available on all exchanges* 'limit' or 'market'
|
|
4681
|
+
* @param {string} [params.stopLossType] *not available on all exchanges* 'limit' or 'market'
|
|
4682
|
+
* @param {string} [params.takeProfitPriceType] *not available on all exchanges* 'last', 'mark' or 'index'
|
|
4683
|
+
* @param {string} [params.stopLossPriceType] *not available on all exchanges* 'last', 'mark' or 'index'
|
|
4684
|
+
* @param {float} [params.takeProfitLimitPrice] *not available on all exchanges* limit price for a limit take profit order
|
|
4685
|
+
* @param {float} [params.stopLossLimitPrice] *not available on all exchanges* stop loss for a limit stop loss order
|
|
4686
|
+
* @param {float} [params.takeProfitAmount] *not available on all exchanges* the amount for a take profit
|
|
4687
|
+
* @param {float} [params.stopLossAmount] *not available on all exchanges* the amount for a stop loss
|
|
4688
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4689
|
+
*/
|
|
4690
|
+
params = this.setTakeProfitAndStopLossParams(symbol, type, side, amount, price, takeProfit, stopLoss, params);
|
|
4691
|
+
if (this.has['createOrderWithTakeProfitAndStopLossWs']) {
|
|
4692
|
+
return await this.createOrderWs(symbol, type, side, amount, price, params);
|
|
4459
4693
|
}
|
|
4460
|
-
throw new errors.NotSupported(this.id + '
|
|
4694
|
+
throw new errors.NotSupported(this.id + ' createOrderWithTakeProfitAndStopLossWs() is not supported yet');
|
|
4461
4695
|
}
|
|
4462
4696
|
async createOrders(orders, params = {}) {
|
|
4463
4697
|
throw new errors.NotSupported(this.id + ' createOrders() is not supported yet');
|
|
@@ -4477,6 +4711,9 @@ class Exchange {
|
|
|
4477
4711
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
4478
4712
|
throw new errors.NotSupported(this.id + ' cancelAllOrders() is not supported yet');
|
|
4479
4713
|
}
|
|
4714
|
+
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
4715
|
+
throw new errors.NotSupported(this.id + ' cancelAllOrdersAfter() is not supported yet');
|
|
4716
|
+
}
|
|
4480
4717
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
4481
4718
|
throw new errors.NotSupported(this.id + ' cancelOrdersForSymbols() is not supported yet');
|
|
4482
4719
|
}
|
|
@@ -4699,21 +4936,39 @@ class Exchange {
|
|
|
4699
4936
|
async createLimitOrder(symbol, side, amount, price, params = {}) {
|
|
4700
4937
|
return await this.createOrder(symbol, 'limit', side, amount, price, params);
|
|
4701
4938
|
}
|
|
4939
|
+
async createLimitOrderWs(symbol, side, amount, price, params = {}) {
|
|
4940
|
+
return await this.createOrderWs(symbol, 'limit', side, amount, price, params);
|
|
4941
|
+
}
|
|
4702
4942
|
async createMarketOrder(symbol, side, amount, price = undefined, params = {}) {
|
|
4703
4943
|
return await this.createOrder(symbol, 'market', side, amount, price, params);
|
|
4704
4944
|
}
|
|
4945
|
+
async createMarketOrderWs(symbol, side, amount, price = undefined, params = {}) {
|
|
4946
|
+
return await this.createOrderWs(symbol, 'market', side, amount, price, params);
|
|
4947
|
+
}
|
|
4705
4948
|
async createLimitBuyOrder(symbol, amount, price, params = {}) {
|
|
4706
4949
|
return await this.createOrder(symbol, 'limit', 'buy', amount, price, params);
|
|
4707
4950
|
}
|
|
4951
|
+
async createLimitBuyOrderWs(symbol, amount, price, params = {}) {
|
|
4952
|
+
return await this.createOrderWs(symbol, 'limit', 'buy', amount, price, params);
|
|
4953
|
+
}
|
|
4708
4954
|
async createLimitSellOrder(symbol, amount, price, params = {}) {
|
|
4709
4955
|
return await this.createOrder(symbol, 'limit', 'sell', amount, price, params);
|
|
4710
4956
|
}
|
|
4957
|
+
async createLimitSellOrderWs(symbol, amount, price, params = {}) {
|
|
4958
|
+
return await this.createOrderWs(symbol, 'limit', 'sell', amount, price, params);
|
|
4959
|
+
}
|
|
4711
4960
|
async createMarketBuyOrder(symbol, amount, params = {}) {
|
|
4712
4961
|
return await this.createOrder(symbol, 'market', 'buy', amount, undefined, params);
|
|
4713
4962
|
}
|
|
4963
|
+
async createMarketBuyOrderWs(symbol, amount, params = {}) {
|
|
4964
|
+
return await this.createOrderWs(symbol, 'market', 'buy', amount, undefined, params);
|
|
4965
|
+
}
|
|
4714
4966
|
async createMarketSellOrder(symbol, amount, params = {}) {
|
|
4715
4967
|
return await this.createOrder(symbol, 'market', 'sell', amount, undefined, params);
|
|
4716
4968
|
}
|
|
4969
|
+
async createMarketSellOrderWs(symbol, amount, params = {}) {
|
|
4970
|
+
return await this.createOrderWs(symbol, 'market', 'sell', amount, undefined, params);
|
|
4971
|
+
}
|
|
4717
4972
|
costToPrecision(symbol, cost) {
|
|
4718
4973
|
const market = this.market(symbol);
|
|
4719
4974
|
return this.decimalToPrecision(cost, TRUNCATE, market['precision']['price'], this.precisionMode, this.paddingMode);
|
|
@@ -4849,6 +5104,13 @@ class Exchange {
|
|
|
4849
5104
|
const query = this.extend(params, { 'postOnly': true });
|
|
4850
5105
|
return await this.createOrder(symbol, type, side, amount, price, query);
|
|
4851
5106
|
}
|
|
5107
|
+
async createPostOnlyOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
5108
|
+
if (!this.has['createPostOnlyOrderWs']) {
|
|
5109
|
+
throw new errors.NotSupported(this.id + 'createPostOnlyOrderWs() is not supported yet');
|
|
5110
|
+
}
|
|
5111
|
+
const query = this.extend(params, { 'postOnly': true });
|
|
5112
|
+
return await this.createOrderWs(symbol, type, side, amount, price, query);
|
|
5113
|
+
}
|
|
4852
5114
|
async createReduceOnlyOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
4853
5115
|
if (!this.has['createReduceOnlyOrder']) {
|
|
4854
5116
|
throw new errors.NotSupported(this.id + 'createReduceOnlyOrder() is not supported yet');
|
|
@@ -4856,6 +5118,13 @@ class Exchange {
|
|
|
4856
5118
|
const query = this.extend(params, { 'reduceOnly': true });
|
|
4857
5119
|
return await this.createOrder(symbol, type, side, amount, price, query);
|
|
4858
5120
|
}
|
|
5121
|
+
async createReduceOnlyOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
5122
|
+
if (!this.has['createReduceOnlyOrderWs']) {
|
|
5123
|
+
throw new errors.NotSupported(this.id + 'createReduceOnlyOrderWs() is not supported yet');
|
|
5124
|
+
}
|
|
5125
|
+
const query = this.extend(params, { 'reduceOnly': true });
|
|
5126
|
+
return await this.createOrderWs(symbol, type, side, amount, price, query);
|
|
5127
|
+
}
|
|
4859
5128
|
async createStopOrder(symbol, type, side, amount, price = undefined, stopPrice = undefined, params = {}) {
|
|
4860
5129
|
if (!this.has['createStopOrder']) {
|
|
4861
5130
|
throw new errors.NotSupported(this.id + ' createStopOrder() is not supported yet');
|
|
@@ -4866,6 +5135,16 @@ class Exchange {
|
|
|
4866
5135
|
const query = this.extend(params, { 'stopPrice': stopPrice });
|
|
4867
5136
|
return await this.createOrder(symbol, type, side, amount, price, query);
|
|
4868
5137
|
}
|
|
5138
|
+
async createStopOrderWs(symbol, type, side, amount, price = undefined, stopPrice = undefined, params = {}) {
|
|
5139
|
+
if (!this.has['createStopOrderWs']) {
|
|
5140
|
+
throw new errors.NotSupported(this.id + ' createStopOrderWs() is not supported yet');
|
|
5141
|
+
}
|
|
5142
|
+
if (stopPrice === undefined) {
|
|
5143
|
+
throw new errors.ArgumentsRequired(this.id + ' createStopOrderWs() requires a stopPrice argument');
|
|
5144
|
+
}
|
|
5145
|
+
const query = this.extend(params, { 'stopPrice': stopPrice });
|
|
5146
|
+
return await this.createOrderWs(symbol, type, side, amount, price, query);
|
|
5147
|
+
}
|
|
4869
5148
|
async createStopLimitOrder(symbol, side, amount, price, stopPrice, params = {}) {
|
|
4870
5149
|
if (!this.has['createStopLimitOrder']) {
|
|
4871
5150
|
throw new errors.NotSupported(this.id + ' createStopLimitOrder() is not supported yet');
|
|
@@ -4873,6 +5152,13 @@ class Exchange {
|
|
|
4873
5152
|
const query = this.extend(params, { 'stopPrice': stopPrice });
|
|
4874
5153
|
return await this.createOrder(symbol, 'limit', side, amount, price, query);
|
|
4875
5154
|
}
|
|
5155
|
+
async createStopLimitOrderWs(symbol, side, amount, price, stopPrice, params = {}) {
|
|
5156
|
+
if (!this.has['createStopLimitOrderWs']) {
|
|
5157
|
+
throw new errors.NotSupported(this.id + ' createStopLimitOrderWs() is not supported yet');
|
|
5158
|
+
}
|
|
5159
|
+
const query = this.extend(params, { 'stopPrice': stopPrice });
|
|
5160
|
+
return await this.createOrderWs(symbol, 'limit', side, amount, price, query);
|
|
5161
|
+
}
|
|
4876
5162
|
async createStopMarketOrder(symbol, side, amount, stopPrice, params = {}) {
|
|
4877
5163
|
if (!this.has['createStopMarketOrder']) {
|
|
4878
5164
|
throw new errors.NotSupported(this.id + ' createStopMarketOrder() is not supported yet');
|
|
@@ -4880,6 +5166,13 @@ class Exchange {
|
|
|
4880
5166
|
const query = this.extend(params, { 'stopPrice': stopPrice });
|
|
4881
5167
|
return await this.createOrder(symbol, 'market', side, amount, undefined, query);
|
|
4882
5168
|
}
|
|
5169
|
+
async createStopMarketOrderWs(symbol, side, amount, stopPrice, params = {}) {
|
|
5170
|
+
if (!this.has['createStopMarketOrderWs']) {
|
|
5171
|
+
throw new errors.NotSupported(this.id + ' createStopMarketOrderWs() is not supported yet');
|
|
5172
|
+
}
|
|
5173
|
+
const query = this.extend(params, { 'stopPrice': stopPrice });
|
|
5174
|
+
return await this.createOrderWs(symbol, 'market', side, amount, undefined, query);
|
|
5175
|
+
}
|
|
4883
5176
|
safeCurrencyCode(currencyId, currency = undefined) {
|
|
4884
5177
|
currency = this.safeCurrency(currencyId, currency);
|
|
4885
5178
|
return currency['code'];
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -321,6 +321,7 @@ class binance extends binance$1 {
|
|
|
321
321
|
'capital/deposit/subAddress': 0.1,
|
|
322
322
|
'capital/deposit/subHisrec': 0.1,
|
|
323
323
|
'capital/withdraw/history': 1800,
|
|
324
|
+
'capital/withdraw/address/list': 10,
|
|
324
325
|
'capital/contract/convertible-coins': 4.0002,
|
|
325
326
|
'convert/tradeFlow': 20.001,
|
|
326
327
|
'convert/exchangeInfo': 50,
|
|
@@ -4107,6 +4108,7 @@ class binance extends binance$1 {
|
|
|
4107
4108
|
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4108
4109
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4109
4110
|
* @param {string} [params.subType] "linear" or "inverse"
|
|
4111
|
+
* @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
|
|
4110
4112
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4111
4113
|
*/
|
|
4112
4114
|
await this.loadMarkets();
|
|
@@ -4945,23 +4947,7 @@ class binance extends binance$1 {
|
|
|
4945
4947
|
params = this.omit(params, ['quoteOrderQty', 'cost', 'stopPrice', 'newClientOrderId', 'clientOrderId', 'postOnly']);
|
|
4946
4948
|
return this.extend(request, params);
|
|
4947
4949
|
}
|
|
4948
|
-
|
|
4949
|
-
/**
|
|
4950
|
-
* @method
|
|
4951
|
-
* @name binance#editContractOrder
|
|
4952
|
-
* @description edit a trade order
|
|
4953
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#modify-order-trade
|
|
4954
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#modify-order-trade
|
|
4955
|
-
* @param {string} id cancel order id
|
|
4956
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4957
|
-
* @param {string} type 'market' or 'limit'
|
|
4958
|
-
* @param {string} side 'buy' or 'sell'
|
|
4959
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4960
|
-
* @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
|
|
4961
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4962
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4963
|
-
*/
|
|
4964
|
-
await this.loadMarkets();
|
|
4950
|
+
editContractOrderRequest(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
4965
4951
|
const market = this.market(symbol);
|
|
4966
4952
|
if (!market['contract']) {
|
|
4967
4953
|
throw new errors.NotSupported(this.id + ' editContractOrder() does not support ' + market['type'] + ' orders');
|
|
@@ -4980,6 +4966,27 @@ class binance extends binance$1 {
|
|
|
4980
4966
|
request['origClientOrderId'] = clientOrderId;
|
|
4981
4967
|
}
|
|
4982
4968
|
params = this.omit(params, ['clientOrderId', 'newClientOrderId']);
|
|
4969
|
+
return request;
|
|
4970
|
+
}
|
|
4971
|
+
async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
4972
|
+
/**
|
|
4973
|
+
* @method
|
|
4974
|
+
* @name binance#editContractOrder
|
|
4975
|
+
* @description edit a trade order
|
|
4976
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#modify-order-trade
|
|
4977
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#modify-order-trade
|
|
4978
|
+
* @param {string} id cancel order id
|
|
4979
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4980
|
+
* @param {string} type 'market' or 'limit'
|
|
4981
|
+
* @param {string} side 'buy' or 'sell'
|
|
4982
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4983
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
|
|
4984
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4985
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4986
|
+
*/
|
|
4987
|
+
await this.loadMarkets();
|
|
4988
|
+
const market = this.market(symbol);
|
|
4989
|
+
const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
|
|
4983
4990
|
let response = undefined;
|
|
4984
4991
|
if (market['linear']) {
|
|
4985
4992
|
response = await this.fapiPrivatePutOrder(this.extend(request, params));
|