ccxt 4.0.108 → 4.0.110
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/ccxt.browser.js +235 -48
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bitfinex2.js +3 -3
- package/dist/cjs/src/bitflyer.js +17 -0
- package/dist/cjs/src/bitget.js +41 -3
- package/dist/cjs/src/bitmart.js +78 -12
- package/dist/cjs/src/bybit.js +51 -7
- package/dist/cjs/src/phemex.js +45 -23
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/bitfinex2.js +3 -3
- package/js/src/bitflyer.js +17 -0
- package/js/src/bitget.js +41 -3
- package/js/src/bitmart.js +78 -12
- package/js/src/bybit.js +51 -7
- package/js/src/phemex.js +45 -23
- package/package.json +1 -1
package/dist/ccxt.browser.js
CHANGED
|
@@ -35349,9 +35349,6 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
35349
35349
|
else if (type.indexOf('fee') >= 0 || type.indexOf('charged') >= 0) {
|
|
35350
35350
|
return 'fee';
|
|
35351
35351
|
}
|
|
35352
|
-
else if (type.indexOf('exchange') >= 0 || type.indexOf('position') >= 0) {
|
|
35353
|
-
return 'trade';
|
|
35354
|
-
}
|
|
35355
35352
|
else if (type.indexOf('rebate') >= 0) {
|
|
35356
35353
|
return 'rebate';
|
|
35357
35354
|
}
|
|
@@ -35364,6 +35361,9 @@ class bitfinex2 extends _abstract_bitfinex2_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
35364
35361
|
else if (type.indexOf('payment') >= 0) {
|
|
35365
35362
|
return 'payout';
|
|
35366
35363
|
}
|
|
35364
|
+
else if (type.indexOf('exchange') >= 0 || type.indexOf('position') >= 0) {
|
|
35365
|
+
return 'trade';
|
|
35366
|
+
}
|
|
35367
35367
|
else {
|
|
35368
35368
|
return type;
|
|
35369
35369
|
}
|
|
@@ -35845,6 +35845,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
35845
35845
|
* @method
|
|
35846
35846
|
* @name bitflyer#fetchMarkets
|
|
35847
35847
|
* @description retrieves data on all markets for bitflyer
|
|
35848
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#market-list
|
|
35848
35849
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
35849
35850
|
* @returns {object[]} an array of objects representing market data
|
|
35850
35851
|
*/
|
|
@@ -36012,6 +36013,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36012
36013
|
* @method
|
|
36013
36014
|
* @name bitflyer#fetchBalance
|
|
36014
36015
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
36016
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#get-account-asset-balance
|
|
36015
36017
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
36016
36018
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
36017
36019
|
*/
|
|
@@ -36043,6 +36045,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36043
36045
|
* @method
|
|
36044
36046
|
* @name bitflyer#fetchOrderBook
|
|
36045
36047
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
36048
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#order-book
|
|
36046
36049
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
36047
36050
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
36048
36051
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
@@ -36088,6 +36091,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36088
36091
|
* @method
|
|
36089
36092
|
* @name bitflyer#fetchTicker
|
|
36090
36093
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
36094
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#ticker
|
|
36091
36095
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
36092
36096
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
36093
36097
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -36169,6 +36173,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36169
36173
|
* @method
|
|
36170
36174
|
* @name bitflyer#fetchTrades
|
|
36171
36175
|
* @description get the list of most recent trades for a particular symbol
|
|
36176
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#list-executions
|
|
36172
36177
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
36173
36178
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
36174
36179
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -36204,6 +36209,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36204
36209
|
* @method
|
|
36205
36210
|
* @name bitflyer#fetchTradingFee
|
|
36206
36211
|
* @description fetch the trading fees for a market
|
|
36212
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#get-trading-commission
|
|
36207
36213
|
* @param {string} symbol unified market symbol
|
|
36208
36214
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
36209
36215
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -36232,6 +36238,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36232
36238
|
* @method
|
|
36233
36239
|
* @name bitflyer#createOrder
|
|
36234
36240
|
* @description create a trade order
|
|
36241
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#send-a-new-order
|
|
36235
36242
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
36236
36243
|
* @param {string} type 'market' or 'limit'
|
|
36237
36244
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -36261,6 +36268,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36261
36268
|
* @method
|
|
36262
36269
|
* @name bitflyer#cancelOrder
|
|
36263
36270
|
* @description cancels an open order
|
|
36271
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#cancel-order
|
|
36264
36272
|
* @param {string} id order id
|
|
36265
36273
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
36266
36274
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
@@ -36337,6 +36345,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36337
36345
|
* @method
|
|
36338
36346
|
* @name bitflyer#fetchOrders
|
|
36339
36347
|
* @description fetches information on multiple orders made by the user
|
|
36348
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#list-orders
|
|
36340
36349
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
36341
36350
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
36342
36351
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -36364,6 +36373,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36364
36373
|
* @method
|
|
36365
36374
|
* @name bitflyer#fetchOpenOrders
|
|
36366
36375
|
* @description fetch all unfilled currently open orders
|
|
36376
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#list-orders
|
|
36367
36377
|
* @param {string} symbol unified market symbol
|
|
36368
36378
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
36369
36379
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -36380,6 +36390,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36380
36390
|
* @method
|
|
36381
36391
|
* @name bitflyer#fetchClosedOrders
|
|
36382
36392
|
* @description fetches information on multiple closed orders made by the user
|
|
36393
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#list-orders
|
|
36383
36394
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
36384
36395
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
36385
36396
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
@@ -36396,6 +36407,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36396
36407
|
* @method
|
|
36397
36408
|
* @name bitflyer#fetchOrder
|
|
36398
36409
|
* @description fetches information on an order made by the user
|
|
36410
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#list-orders
|
|
36399
36411
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
36400
36412
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
36401
36413
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -36415,6 +36427,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36415
36427
|
* @method
|
|
36416
36428
|
* @name bitflyer#fetchMyTrades
|
|
36417
36429
|
* @description fetch all trades made by the user
|
|
36430
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#list-executions
|
|
36418
36431
|
* @param {string} symbol unified market symbol
|
|
36419
36432
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
36420
36433
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
@@ -36454,6 +36467,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36454
36467
|
* @method
|
|
36455
36468
|
* @name bitflyer#fetchPositions
|
|
36456
36469
|
* @description fetch all open positions
|
|
36470
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#get-open-interest-summary
|
|
36457
36471
|
* @param {string[]} symbols list of unified market symbols
|
|
36458
36472
|
* @param {object} [params] extra parameters specific to the bitflyer api endpoint
|
|
36459
36473
|
* @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
|
|
@@ -36491,6 +36505,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36491
36505
|
* @method
|
|
36492
36506
|
* @name bitflyer#withdraw
|
|
36493
36507
|
* @description make a withdrawal
|
|
36508
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#withdrawing-funds
|
|
36494
36509
|
* @param {string} code unified currency code
|
|
36495
36510
|
* @param {float} amount the amount to withdraw
|
|
36496
36511
|
* @param {string} address the address to withdraw to
|
|
@@ -36522,6 +36537,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36522
36537
|
* @method
|
|
36523
36538
|
* @name bitflyer#fetchDeposits
|
|
36524
36539
|
* @description fetch all deposits made to an account
|
|
36540
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#get-crypto-assets-deposit-history
|
|
36525
36541
|
* @param {string} code unified currency code
|
|
36526
36542
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
36527
36543
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
@@ -36559,6 +36575,7 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
36559
36575
|
* @method
|
|
36560
36576
|
* @name bitflyer#fetchWithdrawals
|
|
36561
36577
|
* @description fetch all withdrawals made from an account
|
|
36578
|
+
* @see https://lightning.bitflyer.com/docs?lang=en#get-crypto-assets-transaction-history
|
|
36562
36579
|
* @param {string} code unified currency code
|
|
36563
36580
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
36564
36581
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
@@ -38454,6 +38471,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
38454
38471
|
'40712': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InsufficientFunds,
|
|
38455
38472
|
'40713': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
|
|
38456
38473
|
'40714': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ExchangeError,
|
|
38474
|
+
'40768': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound,
|
|
38457
38475
|
'41114': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OnMaintenance,
|
|
38458
38476
|
'43011': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
38459
38477
|
'43025': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
@@ -38629,6 +38647,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
38629
38647
|
* @method
|
|
38630
38648
|
* @name bitget#fetchTime
|
|
38631
38649
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
38650
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-server-time
|
|
38632
38651
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
38633
38652
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
38634
38653
|
*/
|
|
@@ -38648,6 +38667,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
38648
38667
|
* @method
|
|
38649
38668
|
* @name bitget#fetchMarkets
|
|
38650
38669
|
* @description retrieves data on all markets for bitget
|
|
38670
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
|
|
38671
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-symbols
|
|
38651
38672
|
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
38652
38673
|
* @returns {object[]} an array of objects representing market data
|
|
38653
38674
|
*/
|
|
@@ -38921,6 +38942,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
38921
38942
|
* @method
|
|
38922
38943
|
* @name bitget#fetchCurrencies
|
|
38923
38944
|
* @description fetches all available currencies on an exchange
|
|
38945
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-list
|
|
38924
38946
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
38925
38947
|
* @returns {object} an associative dictionary of currencies
|
|
38926
38948
|
*/
|
|
@@ -39361,6 +39383,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
39361
39383
|
* @method
|
|
39362
39384
|
* @name bitget#fetchDepositAddress
|
|
39363
39385
|
* @description fetch the deposit address for a currency associated with this account
|
|
39386
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-coin-address
|
|
39364
39387
|
* @param {string} code unified currency code
|
|
39365
39388
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
39366
39389
|
* @returns {object} an [address structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#address-structure}
|
|
@@ -39418,6 +39441,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
39418
39441
|
* @method
|
|
39419
39442
|
* @name bitget#fetchOrderBook
|
|
39420
39443
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
39444
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-depth
|
|
39445
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-depth
|
|
39421
39446
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
39422
39447
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
39423
39448
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -39576,6 +39601,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
39576
39601
|
* @method
|
|
39577
39602
|
* @name bitget#fetchTicker
|
|
39578
39603
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
39604
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-ticker
|
|
39605
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-symbol-ticker
|
|
39579
39606
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
39580
39607
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
39581
39608
|
* @returns {object} a [ticker structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ticker-structure}
|
|
@@ -39907,6 +39934,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
39907
39934
|
* @method
|
|
39908
39935
|
* @name bitget#fetchTradingFee
|
|
39909
39936
|
* @description fetch the trading fees for a market
|
|
39937
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-single-symbol
|
|
39910
39938
|
* @param {string} symbol unified market symbol
|
|
39911
39939
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
39912
39940
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
@@ -39945,6 +39973,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
39945
39973
|
* @method
|
|
39946
39974
|
* @name bitget#fetchTradingFees
|
|
39947
39975
|
* @description fetch the trading fees for multiple markets
|
|
39976
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-symbols
|
|
39948
39977
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
39949
39978
|
* @returns {object} a dictionary of [fee structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure} indexed by market symbols
|
|
39950
39979
|
*/
|
|
@@ -40143,9 +40172,9 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40143
40172
|
/**
|
|
40144
40173
|
* @method
|
|
40145
40174
|
* @name bitget#fetchBalance
|
|
40175
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
40146
40176
|
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-account-assets
|
|
40147
40177
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
|
|
40148
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
40149
40178
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
40150
40179
|
* @returns {object} a [balance structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#balance-structure}
|
|
40151
40180
|
*/
|
|
@@ -40403,13 +40432,13 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40403
40432
|
/**
|
|
40404
40433
|
* @method
|
|
40405
40434
|
* @name bitget#createOrder
|
|
40435
|
+
* @description create a trade order
|
|
40406
40436
|
* @see https://bitgetlimited.github.io/apidoc/en/spot/#place-order
|
|
40407
40437
|
* @see https://bitgetlimited.github.io/apidoc/en/spot/#place-plan-order
|
|
40408
40438
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-order
|
|
40409
40439
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-stop-order
|
|
40410
40440
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-position-tpsl
|
|
40411
40441
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#place-plan-order
|
|
40412
|
-
* @description create a trade order
|
|
40413
40442
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
40414
40443
|
* @param {string} type 'market' or 'limit'
|
|
40415
40444
|
* @param {string} side 'buy' or 'sell' or 'open_long' or 'open_short' or 'close_long' or 'close_short'
|
|
@@ -40602,6 +40631,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40602
40631
|
* @method
|
|
40603
40632
|
* @name bitget#editOrder
|
|
40604
40633
|
* @description edit a trade order
|
|
40634
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#modify-plan-order
|
|
40635
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order
|
|
40636
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#modify-plan-order-tpsl
|
|
40637
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#modify-stop-order
|
|
40605
40638
|
* @param {string} id cancel order id
|
|
40606
40639
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
40607
40640
|
* @param {string} type 'market' or 'limit'
|
|
@@ -40705,6 +40738,10 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40705
40738
|
* @method
|
|
40706
40739
|
* @name bitget#cancelOrder
|
|
40707
40740
|
* @description cancels an open order
|
|
40741
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order
|
|
40742
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-plan-order
|
|
40743
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-order
|
|
40744
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#cancel-plan-order-tpsl
|
|
40708
40745
|
* @param {string} id order id
|
|
40709
40746
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
40710
40747
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -40749,6 +40786,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40749
40786
|
* @method
|
|
40750
40787
|
* @name bitget#cancelOrders
|
|
40751
40788
|
* @description cancel multiple orders
|
|
40789
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#cancel-order-in-batch-v2-single-instruments
|
|
40790
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#batch-cancel-order
|
|
40752
40791
|
* @param {string[]} ids order ids
|
|
40753
40792
|
* @param {string} symbol unified market symbol, default is undefined
|
|
40754
40793
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -40887,6 +40926,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40887
40926
|
* @method
|
|
40888
40927
|
* @name bitget#fetchOrder
|
|
40889
40928
|
* @description fetches information on an order made by the user
|
|
40929
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-details
|
|
40930
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-details
|
|
40890
40931
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
40891
40932
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
40892
40933
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
@@ -40968,11 +41009,11 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
40968
41009
|
/**
|
|
40969
41010
|
* @method
|
|
40970
41011
|
* @name bitget#fetchOpenOrders
|
|
41012
|
+
* @description fetch all unfilled currently open orders
|
|
40971
41013
|
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-order-list
|
|
40972
41014
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-open-order
|
|
40973
41015
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-plan-order-tpsl-list
|
|
40974
41016
|
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-open-order
|
|
40975
|
-
* @description fetch all unfilled currently open orders
|
|
40976
41017
|
* @param {string} symbol unified market symbol
|
|
40977
41018
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
40978
41019
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
@@ -41354,6 +41395,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41354
41395
|
* @method
|
|
41355
41396
|
* @name bitget#fetchLedger
|
|
41356
41397
|
* @description fetch the history of changes, actions done by the user or operations that altered balance of the user
|
|
41398
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-bills
|
|
41357
41399
|
* @param {string} code unified currency code, default is undefined
|
|
41358
41400
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
41359
41401
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
@@ -41497,6 +41539,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41497
41539
|
* @method
|
|
41498
41540
|
* @name bitget#fetchOrderTrades
|
|
41499
41541
|
* @description fetch all the trades made from a single order
|
|
41542
|
+
* @see https://bitgetlimited.github.io/apidoc/en/spot/#get-transaction-details
|
|
41543
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-order-fill-detail
|
|
41500
41544
|
* @param {string} id order id
|
|
41501
41545
|
* @param {string} symbol unified market symbol
|
|
41502
41546
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -41549,6 +41593,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41549
41593
|
* @method
|
|
41550
41594
|
* @name bitget#fetchPosition
|
|
41551
41595
|
* @description fetch data on a single open contract trade position
|
|
41596
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-symbol-position-v2
|
|
41552
41597
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
41553
41598
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
41554
41599
|
* @returns {object} a [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
|
|
@@ -41598,6 +41643,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41598
41643
|
* @method
|
|
41599
41644
|
* @name bitget#fetchPositions
|
|
41600
41645
|
* @description fetch all open positions
|
|
41646
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-all-position-v2
|
|
41647
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-position
|
|
41601
41648
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
41602
41649
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
41603
41650
|
* @returns {object[]} a list of [position structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#position-structure}
|
|
@@ -41857,6 +41904,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41857
41904
|
* @method
|
|
41858
41905
|
* @name bitget#fetchFundingRateHistory
|
|
41859
41906
|
* @description fetches historical funding rate prices
|
|
41907
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-history-funding-rate
|
|
41860
41908
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
41861
41909
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
41862
41910
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
@@ -41913,6 +41961,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
41913
41961
|
* @method
|
|
41914
41962
|
* @name bitget#fetchFundingRate
|
|
41915
41963
|
* @description fetch the current funding rate
|
|
41964
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-current-funding-rate
|
|
41916
41965
|
* @param {string} symbol unified market symbol
|
|
41917
41966
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
41918
41967
|
* @returns {object} a [funding rate structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-structure}
|
|
@@ -42116,6 +42165,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42116
42165
|
* @method
|
|
42117
42166
|
* @name bitget#reduceMargin
|
|
42118
42167
|
* @description remove margin from a position
|
|
42168
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
|
|
42119
42169
|
* @param {string} symbol unified market symbol
|
|
42120
42170
|
* @param {float} amount the amount of margin to remove
|
|
42121
42171
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -42135,6 +42185,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42135
42185
|
* @method
|
|
42136
42186
|
* @name bitget#addMargin
|
|
42137
42187
|
* @description add margin
|
|
42188
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
|
|
42138
42189
|
* @param {string} symbol unified market symbol
|
|
42139
42190
|
* @param {float} amount amount of margin to add
|
|
42140
42191
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -42151,6 +42202,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42151
42202
|
* @method
|
|
42152
42203
|
* @name bitget#fetchLeverage
|
|
42153
42204
|
* @description fetch the set leverage for a market
|
|
42205
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#get-single-account
|
|
42154
42206
|
* @param {string} symbol unified market symbol
|
|
42155
42207
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
42156
42208
|
* @returns {object} a [leverage structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#leverage-structure}
|
|
@@ -42195,6 +42247,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42195
42247
|
* @method
|
|
42196
42248
|
* @name bitget#setLeverage
|
|
42197
42249
|
* @description set the level of leverage for a market
|
|
42250
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#change-leverage
|
|
42198
42251
|
* @param {float} leverage the rate of leverage
|
|
42199
42252
|
* @param {string} symbol unified market symbol
|
|
42200
42253
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -42216,6 +42269,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42216
42269
|
* @method
|
|
42217
42270
|
* @name bitget#setMarginMode
|
|
42218
42271
|
* @description set margin mode to 'cross' or 'isolated'
|
|
42272
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#change-margin-mode
|
|
42219
42273
|
* @param {string} marginMode 'cross' or 'isolated'
|
|
42220
42274
|
* @param {string} symbol unified market symbol
|
|
42221
42275
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -42246,6 +42300,7 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
42246
42300
|
* @method
|
|
42247
42301
|
* @name bitget#setPositionMode
|
|
42248
42302
|
* @description set hedged to true or false for a market
|
|
42303
|
+
* @see https://bitgetlimited.github.io/apidoc/en/mix/#change-hold-mode
|
|
42249
42304
|
* @param {bool} hedged set to true to use dualSidePosition
|
|
42250
42305
|
* @param {string} symbol not used by bitget setPositionMode ()
|
|
42251
42306
|
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
@@ -45738,7 +45793,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
45738
45793
|
// "updateTime" : 1681701559408
|
|
45739
45794
|
// }
|
|
45740
45795
|
//
|
|
45741
|
-
// swap: fetchOpenOrders
|
|
45796
|
+
// swap: fetchOrder, fetchOpenOrders
|
|
45742
45797
|
//
|
|
45743
45798
|
// {
|
|
45744
45799
|
// "order_id": "230935812485489",
|
|
@@ -46281,29 +46336,95 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
46281
46336
|
/**
|
|
46282
46337
|
* @method
|
|
46283
46338
|
* @name bitmart#fetchOrder
|
|
46339
|
+
* @description fetches information on an order made by the user
|
|
46284
46340
|
* @see https://developer-pro.bitmart.com/en/spot/#query-order-by-id-v4-signed
|
|
46285
46341
|
* @see https://developer-pro.bitmart.com/en/spot/#query-order-by-clientorderid-v4-signed
|
|
46286
|
-
* @
|
|
46342
|
+
* @see https://developer-pro.bitmart.com/en/futures/#get-order-detail-keyed
|
|
46343
|
+
* @param {string} id the id of the order
|
|
46287
46344
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
46288
46345
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
46289
|
-
* @param {string} [params.clientOrderId] fetch the order by client order id instead of order id
|
|
46346
|
+
* @param {string} [params.clientOrderId] *spot* fetch the order by client order id instead of order id
|
|
46290
46347
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
46291
46348
|
*/
|
|
46292
46349
|
await this.loadMarkets();
|
|
46293
46350
|
const request = {};
|
|
46294
|
-
|
|
46295
|
-
|
|
46296
|
-
request['orderId'] = id;
|
|
46297
|
-
}
|
|
46351
|
+
let type = undefined;
|
|
46352
|
+
let market = undefined;
|
|
46298
46353
|
let response = undefined;
|
|
46299
|
-
if (
|
|
46300
|
-
|
|
46354
|
+
if (symbol !== undefined) {
|
|
46355
|
+
market = this.market(symbol);
|
|
46301
46356
|
}
|
|
46302
|
-
|
|
46303
|
-
|
|
46357
|
+
[type, params] = this.handleMarketTypeAndParams('fetchOrder', market, params);
|
|
46358
|
+
if (type === 'spot') {
|
|
46359
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
46360
|
+
if (!clientOrderId) {
|
|
46361
|
+
request['orderId'] = id;
|
|
46362
|
+
}
|
|
46363
|
+
if (clientOrderId !== undefined) {
|
|
46364
|
+
response = await this.privatePostSpotV4QueryClientOrder(this.extend(request, params));
|
|
46365
|
+
}
|
|
46366
|
+
else {
|
|
46367
|
+
response = await this.privatePostSpotV4QueryOrder(this.extend(request, params));
|
|
46368
|
+
}
|
|
46369
|
+
}
|
|
46370
|
+
else if (type === 'swap') {
|
|
46371
|
+
this.checkRequiredSymbol('fetchOrder', symbol);
|
|
46372
|
+
request['symbol'] = market['id'];
|
|
46373
|
+
request['order_id'] = id;
|
|
46374
|
+
response = await this.privateGetContractPrivateOrder(this.extend(request, params));
|
|
46304
46375
|
}
|
|
46376
|
+
//
|
|
46377
|
+
// spot
|
|
46378
|
+
//
|
|
46379
|
+
// {
|
|
46380
|
+
// "code": 1000,
|
|
46381
|
+
// "message": "success",
|
|
46382
|
+
// "data": {
|
|
46383
|
+
// "orderId": "183347420821295423",
|
|
46384
|
+
// "clientOrderId": "183347420821295423",
|
|
46385
|
+
// "symbol": "BTC_USDT",
|
|
46386
|
+
// "side": "buy",
|
|
46387
|
+
// "orderMode": "spot",
|
|
46388
|
+
// "type": "limit",
|
|
46389
|
+
// "state": "new",
|
|
46390
|
+
// "price": "24000.00",
|
|
46391
|
+
// "priceAvg": "0.00",
|
|
46392
|
+
// "size": "0.00022",
|
|
46393
|
+
// "filledSize": "0.00000",
|
|
46394
|
+
// "notional": "5.28000000",
|
|
46395
|
+
// "filledNotional": "0.00000000",
|
|
46396
|
+
// "createTime": 1695783014734,
|
|
46397
|
+
// "updateTime": 1695783014762
|
|
46398
|
+
// },
|
|
46399
|
+
// "trace": "ce3e6422c8b44d5fag855348a68693ed.63.14957831547451715"
|
|
46400
|
+
// }
|
|
46401
|
+
//
|
|
46402
|
+
// swap
|
|
46403
|
+
//
|
|
46404
|
+
// {
|
|
46405
|
+
// "code": 1000,
|
|
46406
|
+
// "message": "Ok",
|
|
46407
|
+
// "data": {
|
|
46408
|
+
// "order_id": "230927283405028",
|
|
46409
|
+
// "client_order_id": "",
|
|
46410
|
+
// "price": "23000",
|
|
46411
|
+
// "size": "1",
|
|
46412
|
+
// "symbol": "BTCUSDT",
|
|
46413
|
+
// "state": 2,
|
|
46414
|
+
// "side": 1,
|
|
46415
|
+
// "type": "limit",
|
|
46416
|
+
// "leverage": "10",
|
|
46417
|
+
// "open_type": "isolated",
|
|
46418
|
+
// "deal_avg_price": "0",
|
|
46419
|
+
// "deal_size": "0",
|
|
46420
|
+
// "create_time": 1695783433600,
|
|
46421
|
+
// "update_time": 1695783433613
|
|
46422
|
+
// },
|
|
46423
|
+
// "trace": "4cad855075664097af6ba5257c47605d.63.14957831547451715"
|
|
46424
|
+
// }
|
|
46425
|
+
//
|
|
46305
46426
|
const data = this.safeValue(response, 'data', {});
|
|
46306
|
-
return this.parseOrder(data,
|
|
46427
|
+
return this.parseOrder(data, market);
|
|
46307
46428
|
}
|
|
46308
46429
|
async fetchDepositAddress(code, params = {}) {
|
|
46309
46430
|
/**
|
|
@@ -71118,10 +71239,11 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
71118
71239
|
'10027': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.PermissionDenied,
|
|
71119
71240
|
'10028': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.PermissionDenied,
|
|
71120
71241
|
'10029': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.PermissionDenied,
|
|
71242
|
+
'12137': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
71121
71243
|
'12201': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
71122
71244
|
'12141': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest,
|
|
71123
71245
|
'100028': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.PermissionDenied,
|
|
71124
|
-
'110001': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.
|
|
71246
|
+
'110001': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.OrderNotFound,
|
|
71125
71247
|
'110003': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
71126
71248
|
'110004': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InsufficientFunds,
|
|
71127
71249
|
'110005': _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidOrder,
|
|
@@ -73944,11 +74066,38 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
73944
74066
|
if ((clientOrderId !== undefined) && (clientOrderId.length < 1)) {
|
|
73945
74067
|
clientOrderId = undefined;
|
|
73946
74068
|
}
|
|
74069
|
+
const avgPrice = this.omitZero(this.safeString(order, 'avgPrice'));
|
|
73947
74070
|
const rawTimeInForce = this.safeString(order, 'timeInForce');
|
|
73948
74071
|
const timeInForce = this.parseTimeInForce(rawTimeInForce);
|
|
73949
74072
|
const stopPrice = this.omitZero(this.safeString(order, 'triggerPrice'));
|
|
73950
|
-
const
|
|
73951
|
-
|
|
74073
|
+
const reduceOnly = this.safeValue(order, 'reduceOnly');
|
|
74074
|
+
let takeProfitPrice = this.omitZero(this.safeString(order, 'takeProfit'));
|
|
74075
|
+
let stopLossPrice = this.omitZero(this.safeString(order, 'stopLoss'));
|
|
74076
|
+
const triggerDirection = this.safeString(order, 'triggerDirection');
|
|
74077
|
+
const isAscending = (triggerDirection === '1');
|
|
74078
|
+
const isStopOrderType2 = (stopPrice !== undefined) && reduceOnly;
|
|
74079
|
+
if ((stopLossPrice === undefined) && isStopOrderType2) {
|
|
74080
|
+
// check if order is stop order type 2 - stopLossPrice
|
|
74081
|
+
if (isAscending && (side === 'buy')) {
|
|
74082
|
+
// stopLoss order against short position
|
|
74083
|
+
stopLossPrice = stopPrice;
|
|
74084
|
+
}
|
|
74085
|
+
if (!isAscending && (side === 'sell')) {
|
|
74086
|
+
// stopLoss order against a long position
|
|
74087
|
+
stopLossPrice = stopPrice;
|
|
74088
|
+
}
|
|
74089
|
+
}
|
|
74090
|
+
if ((takeProfitPrice === undefined) && isStopOrderType2) {
|
|
74091
|
+
// check if order is stop order type 2 - takeProfitPrice
|
|
74092
|
+
if (isAscending && (side === 'sell')) {
|
|
74093
|
+
// takeprofit order against a long position
|
|
74094
|
+
takeProfitPrice = stopPrice;
|
|
74095
|
+
}
|
|
74096
|
+
if (!isAscending && (side === 'buy')) {
|
|
74097
|
+
// takeprofit order against a short position
|
|
74098
|
+
takeProfitPrice = stopPrice;
|
|
74099
|
+
}
|
|
74100
|
+
}
|
|
73952
74101
|
return this.safeOrder({
|
|
73953
74102
|
'info': order,
|
|
73954
74103
|
'id': id,
|
|
@@ -73970,7 +74119,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
73970
74119
|
'stopLossPrice': stopLossPrice,
|
|
73971
74120
|
'amount': amount,
|
|
73972
74121
|
'cost': cost,
|
|
73973
|
-
'average':
|
|
74122
|
+
'average': avgPrice,
|
|
73974
74123
|
'filled': filled,
|
|
73975
74124
|
'remaining': remaining,
|
|
73976
74125
|
'status': status,
|
|
@@ -74022,6 +74171,14 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
74022
74171
|
* @param {boolean} [params.isLeverage] *unified spot only* false then spot trading true then margin trading
|
|
74023
74172
|
* @param {string} [params.tpslMode] *contract only* 'full' or 'partial'
|
|
74024
74173
|
* @param {string} [params.mmp] *option only* market maker protection
|
|
74174
|
+
* @param {string} [params.triggerDirection] *contract only* the direction for trigger orders, 'up' or 'down'
|
|
74175
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
74176
|
+
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
74177
|
+
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
74178
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
74179
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
74180
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
74181
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
74025
74182
|
* @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
74026
74183
|
*/
|
|
74027
74184
|
await this.loadMarkets();
|
|
@@ -74127,13 +74284,21 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
74127
74284
|
const isStopLoss = stopLoss !== undefined;
|
|
74128
74285
|
const isTakeProfit = takeProfit !== undefined;
|
|
74129
74286
|
const isBuy = side === 'buy';
|
|
74130
|
-
const
|
|
74287
|
+
const setTriggerDirection = (stopLossTriggerPrice || triggerPrice) ? !isBuy : isBuy;
|
|
74288
|
+
const defaultTriggerDirection = setTriggerDirection ? 2 : 1;
|
|
74289
|
+
const triggerDirection = this.safeString(params, 'triggerDirection');
|
|
74290
|
+
params = this.omit(params, 'triggerDirection');
|
|
74291
|
+
let selectedDirection = defaultTriggerDirection;
|
|
74292
|
+
if (triggerDirection !== undefined) {
|
|
74293
|
+
const isAsending = ((triggerDirection === 'up') || (triggerDirection === '1'));
|
|
74294
|
+
selectedDirection = isAsending ? 1 : 2;
|
|
74295
|
+
}
|
|
74131
74296
|
if (triggerPrice !== undefined) {
|
|
74132
|
-
request['triggerDirection'] =
|
|
74297
|
+
request['triggerDirection'] = selectedDirection;
|
|
74133
74298
|
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
74134
74299
|
}
|
|
74135
74300
|
else if (isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
|
74136
|
-
request['triggerDirection'] =
|
|
74301
|
+
request['triggerDirection'] = selectedDirection;
|
|
74137
74302
|
triggerPrice = isStopLossTriggerOrder ? stopLossTriggerPrice : takeProfitTriggerPrice;
|
|
74138
74303
|
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
74139
74304
|
request['reduceOnly'] = true;
|
|
@@ -183453,9 +183618,10 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
183453
183618
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#query-kline
|
|
183454
183619
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
183455
183620
|
* @param {string} timeframe the length of time each candle represents
|
|
183456
|
-
* @param {int} [since] *emulated not supported by the exchange* timestamp in ms of the earliest candle to fetch
|
|
183621
|
+
* @param {int} [since] *only used for USDT settled contracts, otherwise is emulated and not supported by the exchange* timestamp in ms of the earliest candle to fetch
|
|
183457
183622
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
183458
183623
|
* @param {object} [params] extra parameters specific to the phemex api endpoint
|
|
183624
|
+
* @param {int} [params.until] *USDT settled/ linear swaps only* end time in ms
|
|
183459
183625
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
183460
183626
|
*/
|
|
183461
183627
|
await this.loadMarkets();
|
|
@@ -183465,34 +183631,55 @@ class phemex extends _abstract_phemex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
183465
183631
|
'symbol': market['id'],
|
|
183466
183632
|
'resolution': this.safeString(this.timeframes, timeframe, timeframe),
|
|
183467
183633
|
};
|
|
183468
|
-
const
|
|
183469
|
-
|
|
183470
|
-
|
|
183471
|
-
|
|
183472
|
-
|
|
183473
|
-
|
|
183474
|
-
// phemex also provides kline query with from/to, however, this interface is NOT recommended and does not work properly.
|
|
183475
|
-
// we do not send since param to the exchange, instead we calculate appropriate limit param
|
|
183476
|
-
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
183477
|
-
const timeDelta = this.milliseconds() - since;
|
|
183478
|
-
limit = this.parseToInt(timeDelta / duration); // setting limit to the number of candles after since
|
|
183634
|
+
const until = this.safeInteger2(params, 'until', 'to');
|
|
183635
|
+
params = this.omit(params, ['until']);
|
|
183636
|
+
const usesSpecialFromToEndpoint = ((market['linear'] || market['settle'] === 'USDT')) && ((since !== undefined) || (until !== undefined));
|
|
183637
|
+
let maxLimit = 1000;
|
|
183638
|
+
if (usesSpecialFromToEndpoint) {
|
|
183639
|
+
maxLimit = 2000;
|
|
183479
183640
|
}
|
|
183480
|
-
if (limit
|
|
183641
|
+
if (limit === undefined) {
|
|
183481
183642
|
limit = maxLimit;
|
|
183482
183643
|
}
|
|
183483
|
-
|
|
183484
|
-
for (let i = 0; i < possibleLimitValues.length; i++) {
|
|
183485
|
-
if (limit <= possibleLimitValues[i]) {
|
|
183486
|
-
limit = possibleLimitValues[i];
|
|
183487
|
-
}
|
|
183488
|
-
}
|
|
183489
|
-
}
|
|
183490
|
-
request['limit'] = limit;
|
|
183644
|
+
request['limit'] = Math.min(limit, maxLimit);
|
|
183491
183645
|
let response = undefined;
|
|
183492
183646
|
if (market['linear'] || market['settle'] === 'USDT') {
|
|
183493
|
-
|
|
183647
|
+
if ((until !== undefined) || (since !== undefined)) {
|
|
183648
|
+
const candleDuration = this.parseTimeframe(timeframe);
|
|
183649
|
+
if (since !== undefined) {
|
|
183650
|
+
since = Math.round(since / 1000);
|
|
183651
|
+
request['from'] = since;
|
|
183652
|
+
}
|
|
183653
|
+
else {
|
|
183654
|
+
// when 'to' is defined since is mandatory
|
|
183655
|
+
since = (until / 100) - (maxLimit * candleDuration);
|
|
183656
|
+
}
|
|
183657
|
+
if (until !== undefined) {
|
|
183658
|
+
request['to'] = Math.round(until / 1000);
|
|
183659
|
+
}
|
|
183660
|
+
else {
|
|
183661
|
+
// when since is defined 'to' is mandatory
|
|
183662
|
+
let to = since + (maxLimit * candleDuration);
|
|
183663
|
+
const now = this.seconds();
|
|
183664
|
+
if (to > now) {
|
|
183665
|
+
to = now;
|
|
183666
|
+
}
|
|
183667
|
+
request['to'] = to;
|
|
183668
|
+
}
|
|
183669
|
+
response = await this.publicGetMdV2KlineList(this.extend(request, params));
|
|
183670
|
+
}
|
|
183671
|
+
else {
|
|
183672
|
+
response = await this.publicGetMdV2KlineLast(this.extend(request, params));
|
|
183673
|
+
}
|
|
183494
183674
|
}
|
|
183495
183675
|
else {
|
|
183676
|
+
if (since !== undefined) {
|
|
183677
|
+
// phemex also provides kline query with from/to, however, this interface is NOT recommended and does not work properly.
|
|
183678
|
+
// we do not send since param to the exchange, instead we calculate appropriate limit param
|
|
183679
|
+
const duration = this.parseTimeframe(timeframe) * 1000;
|
|
183680
|
+
const timeDelta = this.milliseconds() - since;
|
|
183681
|
+
limit = this.parseToInt(timeDelta / duration); // setting limit to the number of candles after since
|
|
183682
|
+
}
|
|
183496
183683
|
response = await this.publicGetMdV2Kline(this.extend(request, params));
|
|
183497
183684
|
}
|
|
183498
183685
|
//
|
|
@@ -273177,7 +273364,7 @@ SOFTWARE.
|
|
|
273177
273364
|
|
|
273178
273365
|
//-----------------------------------------------------------------------------
|
|
273179
273366
|
// this is updated by vss.js when building
|
|
273180
|
-
const version = '4.0.
|
|
273367
|
+
const version = '4.0.110';
|
|
273181
273368
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
|
|
273182
273369
|
//-----------------------------------------------------------------------------
|
|
273183
273370
|
|