ccxt 4.4.39 → 4.4.41
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.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +32 -21
- package/dist/cjs/src/binance.js +37 -43
- package/dist/cjs/src/bingx.js +4 -3
- package/dist/cjs/src/bit2c.js +0 -1
- package/dist/cjs/src/bitbank.js +0 -1
- package/dist/cjs/src/bitbns.js +0 -1
- package/dist/cjs/src/bitfinex.js +18 -19
- package/dist/cjs/src/bitfinex1.js +0 -1
- package/dist/cjs/src/bitflyer.js +0 -1
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bithumb.js +0 -1
- package/dist/cjs/src/bitmart.js +257 -5
- package/dist/cjs/src/bitmex.js +5 -6
- package/dist/cjs/src/bitopro.js +4 -5
- package/dist/cjs/src/bitrue.js +5 -7
- package/dist/cjs/src/bitso.js +1 -2
- package/dist/cjs/src/bitstamp.js +1 -2
- package/dist/cjs/src/bitteam.js +1 -3
- package/dist/cjs/src/bitvavo.js +2 -4
- package/dist/cjs/src/blockchaincom.js +5 -5
- package/dist/cjs/src/blofin.js +10 -10
- package/dist/cjs/src/btcalpha.js +0 -1
- package/dist/cjs/src/btcbox.js +0 -1
- package/dist/cjs/src/btcmarkets.js +1 -3
- package/dist/cjs/src/bybit.js +10 -11
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +77 -1
- package/dist/cjs/src/coinbaseexchange.js +1 -1
- package/dist/cjs/src/coinbaseinternational.js +62 -0
- package/dist/cjs/src/coincatch.js +1 -1
- package/dist/cjs/src/coinex.js +9 -9
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/cryptocom.js +91 -2
- package/dist/cjs/src/currencycom.js +1 -1
- package/dist/cjs/src/defx.js +1 -2
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/digifinex.js +1 -1
- package/dist/cjs/src/exmo.js +64 -6
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hashkey.js +3 -5
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/hyperliquid.js +66 -2
- package/dist/cjs/src/kraken.js +130 -27
- package/dist/cjs/src/kucoin.js +30 -25
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +138 -2
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/okcoin.js +18 -18
- package/dist/cjs/src/okx.js +27 -22
- package/dist/cjs/src/phemex.js +12 -8
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bybit.js +13 -1
- package/dist/cjs/src/pro/coinex.js +2 -2
- package/dist/cjs/src/pro/gate.js +6 -6
- package/dist/cjs/src/pro/kucoin.js +3 -3
- package/dist/cjs/src/pro/okx.js +11 -11
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/vertex.js +11 -11
- package/dist/cjs/src/woo.js +33 -33
- package/dist/cjs/src/woofipro.js +24 -24
- package/dist/cjs/src/xt.js +31 -28
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +5 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +32 -21
- package/js/src/base/types.d.ts +2 -0
- package/js/src/binance.d.ts +9 -9
- package/js/src/binance.js +37 -43
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +4 -3
- package/js/src/bit2c.js +0 -1
- package/js/src/bitbank.js +0 -1
- package/js/src/bitbns.js +0 -1
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex.js +18 -19
- package/js/src/bitfinex1.js +0 -1
- package/js/src/bitflyer.js +0 -1
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +2 -2
- package/js/src/bithumb.js +0 -1
- package/js/src/bitmart.d.ts +53 -2
- package/js/src/bitmart.js +257 -5
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +5 -6
- package/js/src/bitopro.js +4 -5
- package/js/src/bitrue.js +5 -7
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -2
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +1 -2
- package/js/src/bitteam.js +1 -3
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +2 -4
- package/js/src/blockchaincom.js +5 -5
- package/js/src/blofin.d.ts +3 -3
- package/js/src/blofin.js +10 -10
- package/js/src/btcalpha.js +0 -1
- package/js/src/btcbox.js +0 -1
- package/js/src/btcmarkets.js +1 -3
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +10 -11
- package/js/src/cex.d.ts +1 -1
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +77 -1
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coinbaseexchange.js +1 -1
- package/js/src/coinbaseinternational.js +62 -0
- package/js/src/coincatch.d.ts +1 -1
- package/js/src/coincatch.js +1 -1
- package/js/src/coinex.js +9 -9
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/cryptocom.js +91 -2
- package/js/src/currencycom.d.ts +1 -1
- package/js/src/currencycom.js +1 -1
- package/js/src/defx.d.ts +1 -2
- package/js/src/defx.js +1 -2
- package/js/src/delta.d.ts +1 -1
- package/js/src/delta.js +1 -1
- package/js/src/digifinex.d.ts +1 -1
- package/js/src/digifinex.js +1 -1
- package/js/src/exmo.d.ts +35 -0
- package/js/src/exmo.js +64 -6
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +2 -2
- package/js/src/hashkey.d.ts +1 -1
- package/js/src/hashkey.js +3 -5
- package/js/src/htx.d.ts +1 -1
- package/js/src/htx.js +2 -2
- package/js/src/hyperliquid.d.ts +21 -2
- package/js/src/hyperliquid.js +66 -2
- package/js/src/kraken.d.ts +14 -8
- package/js/src/kraken.js +130 -27
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoin.js +30 -25
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +1 -2
- package/js/src/mexc.js +138 -2
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +1 -1
- package/js/src/okcoin.d.ts +4 -4
- package/js/src/okcoin.js +18 -18
- package/js/src/okx.d.ts +3 -3
- package/js/src/okx.js +27 -22
- package/js/src/phemex.js +12 -8
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +1 -1
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/bybit.js +13 -1
- package/js/src/pro/coinex.js +2 -2
- package/js/src/pro/gate.d.ts +2 -2
- package/js/src/pro/gate.js +6 -6
- package/js/src/pro/kucoin.d.ts +1 -1
- package/js/src/pro/kucoin.js +3 -3
- package/js/src/pro/okx.d.ts +2 -2
- package/js/src/pro/okx.js +11 -11
- package/js/src/pro/upbit.d.ts +3 -3
- package/js/src/pro/upbit.js +3 -3
- package/js/src/vertex.d.ts +3 -3
- package/js/src/vertex.js +11 -11
- package/js/src/woo.d.ts +7 -7
- package/js/src/woo.js +33 -33
- package/js/src/woofipro.d.ts +1 -1
- package/js/src/woofipro.js +24 -24
- package/js/src/xt.d.ts +7 -7
- package/js/src/xt.js +31 -28
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +2 -2
|
@@ -348,6 +348,95 @@ class cryptocom extends cryptocom$1 {
|
|
|
348
348
|
},
|
|
349
349
|
'broker': 'CCXT',
|
|
350
350
|
},
|
|
351
|
+
'features': {
|
|
352
|
+
'default': {
|
|
353
|
+
'sandbox': true,
|
|
354
|
+
'createOrder': {
|
|
355
|
+
'marginMode': true,
|
|
356
|
+
'triggerPrice': true,
|
|
357
|
+
// todo: implementation fix
|
|
358
|
+
'triggerPriceType': {
|
|
359
|
+
'last': true,
|
|
360
|
+
'mark': true,
|
|
361
|
+
'index': true,
|
|
362
|
+
},
|
|
363
|
+
'triggerDirection': false,
|
|
364
|
+
'stopLossPrice': true,
|
|
365
|
+
'takeProfitPrice': true,
|
|
366
|
+
'attachedStopLossTakeProfit': undefined,
|
|
367
|
+
'timeInForce': {
|
|
368
|
+
'IOC': true,
|
|
369
|
+
'FOK': true,
|
|
370
|
+
'PO': true,
|
|
371
|
+
'GTD': false,
|
|
372
|
+
},
|
|
373
|
+
'hedged': false,
|
|
374
|
+
// exchange-supported features
|
|
375
|
+
'selfTradePrevention': true,
|
|
376
|
+
'trailing': false,
|
|
377
|
+
'iceberg': false,
|
|
378
|
+
},
|
|
379
|
+
'createOrders': {
|
|
380
|
+
'max': 10,
|
|
381
|
+
},
|
|
382
|
+
'fetchMyTrades': {
|
|
383
|
+
'marginMode': false,
|
|
384
|
+
'limit': 100,
|
|
385
|
+
'daysBack': undefined,
|
|
386
|
+
'untilDays': 1,
|
|
387
|
+
},
|
|
388
|
+
'fetchOrder': {
|
|
389
|
+
'marginMode': false,
|
|
390
|
+
'trigger': false,
|
|
391
|
+
'trailing': false,
|
|
392
|
+
},
|
|
393
|
+
'fetchOpenOrders': {
|
|
394
|
+
'marginMode': true,
|
|
395
|
+
'limit': 100,
|
|
396
|
+
'trigger': false,
|
|
397
|
+
'trailing': false,
|
|
398
|
+
},
|
|
399
|
+
'fetchOrders': {
|
|
400
|
+
'marginMode': false,
|
|
401
|
+
'limit': 100,
|
|
402
|
+
'daysBack': undefined,
|
|
403
|
+
'untilDays': 1,
|
|
404
|
+
'trigger': false,
|
|
405
|
+
'trailing': false,
|
|
406
|
+
},
|
|
407
|
+
'fetchClosedOrders': {
|
|
408
|
+
'marginMode': false,
|
|
409
|
+
'limit': 100,
|
|
410
|
+
'daysBackClosed': undefined,
|
|
411
|
+
'daysBackCanceled': undefined,
|
|
412
|
+
'untilDays': 1,
|
|
413
|
+
'trigger': false,
|
|
414
|
+
'trailing': false,
|
|
415
|
+
},
|
|
416
|
+
'fetchOHLCV': {
|
|
417
|
+
'limit': 300,
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
'spot': {
|
|
421
|
+
'extends': 'default',
|
|
422
|
+
},
|
|
423
|
+
'swap': {
|
|
424
|
+
'linear': {
|
|
425
|
+
'extends': 'default',
|
|
426
|
+
},
|
|
427
|
+
'inverse': {
|
|
428
|
+
'extends': 'default',
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
'future': {
|
|
432
|
+
'linear': {
|
|
433
|
+
'extends': 'default',
|
|
434
|
+
},
|
|
435
|
+
'inverse': {
|
|
436
|
+
'extends': 'default',
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
},
|
|
351
440
|
// https://exchange-docs.crypto.com/spot/index.html#response-and-reason-codes
|
|
352
441
|
'commonCurrencies': {
|
|
353
442
|
'USD_STABLE_COIN': 'USDC',
|
|
@@ -1187,7 +1276,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
1187
1276
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1188
1277
|
* @param {string} [params.timeInForce] 'GTC', 'IOC', 'FOK' or 'PO'
|
|
1189
1278
|
* @param {string} [params.ref_price_type] 'MARK_PRICE', 'INDEX_PRICE', 'LAST_PRICE' which trigger price type to use, default is MARK_PRICE
|
|
1190
|
-
* @param {float} [params.triggerPrice] price to trigger a
|
|
1279
|
+
* @param {float} [params.triggerPrice] price to trigger a trigger order
|
|
1191
1280
|
* @param {float} [params.stopLossPrice] price to trigger a stop-loss trigger order
|
|
1192
1281
|
* @param {float} [params.takeProfitPrice] price to trigger a take-profit trigger order
|
|
1193
1282
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2403,7 +2492,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
2403
2492
|
* @param {int} [limit] max number of ledger entries to return
|
|
2404
2493
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2405
2494
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
2406
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2495
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2407
2496
|
*/
|
|
2408
2497
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2409
2498
|
await this.loadMarkets();
|
|
@@ -1698,7 +1698,7 @@ class currencycom extends currencycom$1 {
|
|
|
1698
1698
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1699
1699
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1700
1700
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1701
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1701
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1702
1702
|
*/
|
|
1703
1703
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1704
1704
|
await this.loadMarkets();
|
package/dist/cjs/src/defx.js
CHANGED
|
@@ -1346,7 +1346,6 @@ class defx extends defx$1 {
|
|
|
1346
1346
|
* @param {string} id order id
|
|
1347
1347
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
1348
1348
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1349
|
-
* @param {boolean} [params.stop] whether the order is a stop/algo order
|
|
1350
1349
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1351
1350
|
*/
|
|
1352
1351
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
@@ -1779,7 +1778,7 @@ class defx extends defx$1 {
|
|
|
1779
1778
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1780
1779
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
1781
1780
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1782
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1781
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1783
1782
|
*/
|
|
1784
1783
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1785
1784
|
await this.loadMarkets();
|
package/dist/cjs/src/delta.js
CHANGED
|
@@ -2197,7 +2197,7 @@ class delta extends delta$1 {
|
|
|
2197
2197
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2198
2198
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2199
2199
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2200
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2200
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2201
2201
|
*/
|
|
2202
2202
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2203
2203
|
await this.loadMarkets();
|
|
@@ -2643,7 +2643,7 @@ class digifinex extends digifinex$1 {
|
|
|
2643
2643
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2644
2644
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2645
2645
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2646
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2646
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2647
2647
|
*/
|
|
2648
2648
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2649
2649
|
await this.loadMarkets();
|
package/dist/cjs/src/exmo.js
CHANGED
|
@@ -31,6 +31,9 @@ class exmo extends exmo$1 {
|
|
|
31
31
|
'cancelOrder': true,
|
|
32
32
|
'cancelOrders': false,
|
|
33
33
|
'createDepositAddress': false,
|
|
34
|
+
'createMarketBuyOrder': true,
|
|
35
|
+
'createMarketBuyOrderWithCost': true,
|
|
36
|
+
'createMarketOrderWithCost': true,
|
|
34
37
|
'createOrder': true,
|
|
35
38
|
'createStopLimitOrder': true,
|
|
36
39
|
'createStopMarketOrder': true,
|
|
@@ -1406,6 +1409,52 @@ class exmo extends exmo$1 {
|
|
|
1406
1409
|
}
|
|
1407
1410
|
return this.filterBySinceLimit(result, since, limit);
|
|
1408
1411
|
}
|
|
1412
|
+
/**
|
|
1413
|
+
* @method
|
|
1414
|
+
* @name exmo#createMarketOrderWithCost
|
|
1415
|
+
* @description create a market order by providing the symbol, side and cost
|
|
1416
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#80daa469-ec59-4d0a-b229-6a311d8dd1cd
|
|
1417
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1418
|
+
* @param {string} side 'buy' or 'sell'
|
|
1419
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
1420
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1421
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1422
|
+
*/
|
|
1423
|
+
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
1424
|
+
await this.loadMarkets();
|
|
1425
|
+
params = this.extend(params, { 'cost': cost });
|
|
1426
|
+
return await this.createOrder(symbol, 'market', side, cost, undefined, params);
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* @method
|
|
1430
|
+
* @name exmo#createMarketBuyOrderWithCost
|
|
1431
|
+
* @description create a market buy order by providing the symbol and cost
|
|
1432
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#80daa469-ec59-4d0a-b229-6a311d8dd1cd
|
|
1433
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1434
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
1435
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1436
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1437
|
+
*/
|
|
1438
|
+
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
1439
|
+
await this.loadMarkets();
|
|
1440
|
+
params = this.extend(params, { 'cost': cost });
|
|
1441
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* @method
|
|
1445
|
+
* @name exmo#createMarketSellOrderWithCost
|
|
1446
|
+
* @description create a market sell order by providing the symbol and cost
|
|
1447
|
+
* @see https://documenter.getpostman.com/view/10287440/SzYXWKPi#80daa469-ec59-4d0a-b229-6a311d8dd1cd
|
|
1448
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1449
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
1450
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1451
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1452
|
+
*/
|
|
1453
|
+
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
1454
|
+
await this.loadMarkets();
|
|
1455
|
+
params = this.extend(params, { 'cost': cost });
|
|
1456
|
+
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
|
|
1457
|
+
}
|
|
1409
1458
|
/**
|
|
1410
1459
|
* @method
|
|
1411
1460
|
* @name exmo#createOrder
|
|
@@ -1422,6 +1471,7 @@ class exmo extends exmo$1 {
|
|
|
1422
1471
|
* @param {float} [params.stopPrice] the price at which a trigger order is triggered at
|
|
1423
1472
|
* @param {string} [params.timeInForce] *spot only* 'fok', 'ioc' or 'post_only'
|
|
1424
1473
|
* @param {boolean} [params.postOnly] *spot only* true for post only orders
|
|
1474
|
+
* @param {float} [params.cost] *spot only* *market orders only* the cost of the order in the quote currency for market orders
|
|
1425
1475
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1426
1476
|
*/
|
|
1427
1477
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
@@ -1434,11 +1484,12 @@ class exmo extends exmo$1 {
|
|
|
1434
1484
|
throw new errors.BadRequest(this.id + ' only supports isolated margin');
|
|
1435
1485
|
}
|
|
1436
1486
|
const isSpot = (marginMode !== 'isolated');
|
|
1437
|
-
const triggerPrice = this.
|
|
1487
|
+
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
1488
|
+
const cost = this.safeString(params, 'cost');
|
|
1438
1489
|
const request = {
|
|
1439
1490
|
'pair': market['id'],
|
|
1440
1491
|
// 'leverage': 2,
|
|
1441
|
-
'quantity': this.amountToPrecision(market['symbol'], amount),
|
|
1492
|
+
// 'quantity': this.amountToPrecision (market['symbol'], amount),
|
|
1442
1493
|
// spot - buy, sell, market_buy, market_sell, market_buy_total, market_sell_total
|
|
1443
1494
|
// margin - limit_buy, limit_sell, market_buy, market_sell, stop_buy, stop_sell, stop_limit_buy, stop_limit_sell, trailing_stop_buy, trailing_stop_sell
|
|
1444
1495
|
// 'stop_price': this.priceToPrecision (symbol, stopPrice),
|
|
@@ -1447,6 +1498,12 @@ class exmo extends exmo$1 {
|
|
|
1447
1498
|
// 'client_id': 123, // optional, must be a positive integer
|
|
1448
1499
|
// 'comment': '', // up to 50 latin symbols, whitespaces, underscores
|
|
1449
1500
|
};
|
|
1501
|
+
if (cost === undefined) {
|
|
1502
|
+
request['quantity'] = this.amountToPrecision(market['symbol'], amount);
|
|
1503
|
+
}
|
|
1504
|
+
else {
|
|
1505
|
+
request['quantity'] = this.costToPrecision(market['symbol'], cost);
|
|
1506
|
+
}
|
|
1450
1507
|
let clientOrderId = this.safeValue2(params, 'client_id', 'clientOrderId');
|
|
1451
1508
|
if (clientOrderId !== undefined) {
|
|
1452
1509
|
clientOrderId = this.safeInteger2(params, 'client_id', 'clientOrderId');
|
|
@@ -1461,7 +1518,7 @@ class exmo extends exmo$1 {
|
|
|
1461
1518
|
if (!isSpot && (leverage === undefined)) {
|
|
1462
1519
|
throw new errors.ArgumentsRequired(this.id + ' createOrder requires an extra param params["leverage"] for margin orders');
|
|
1463
1520
|
}
|
|
1464
|
-
params = this.omit(params, ['stopPrice', 'stop_price', 'triggerPrice', 'timeInForce', 'client_id', 'clientOrderId']);
|
|
1521
|
+
params = this.omit(params, ['stopPrice', 'stop_price', 'triggerPrice', 'timeInForce', 'client_id', 'clientOrderId', 'cost']);
|
|
1465
1522
|
if (price !== undefined) {
|
|
1466
1523
|
request['price'] = this.priceToPrecision(market['symbol'], price);
|
|
1467
1524
|
}
|
|
@@ -1487,7 +1544,8 @@ class exmo extends exmo$1 {
|
|
|
1487
1544
|
request['type'] = side;
|
|
1488
1545
|
}
|
|
1489
1546
|
else if (type === 'market') {
|
|
1490
|
-
|
|
1547
|
+
const marketSuffix = (cost !== undefined) ? '_total' : '';
|
|
1548
|
+
request['type'] = 'market_' + side + marketSuffix;
|
|
1491
1549
|
}
|
|
1492
1550
|
if (isPostOnly) {
|
|
1493
1551
|
request['exec_type'] = 'post_only';
|
|
@@ -1540,7 +1598,7 @@ class exmo extends exmo$1 {
|
|
|
1540
1598
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1541
1599
|
await this.loadMarkets();
|
|
1542
1600
|
const request = {};
|
|
1543
|
-
const
|
|
1601
|
+
const trigger = this.safeValue2(params, 'trigger', 'stop');
|
|
1544
1602
|
params = this.omit(params, ['trigger', 'stop']);
|
|
1545
1603
|
let marginMode = undefined;
|
|
1546
1604
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
@@ -1556,7 +1614,7 @@ class exmo extends exmo$1 {
|
|
|
1556
1614
|
//
|
|
1557
1615
|
}
|
|
1558
1616
|
else {
|
|
1559
|
-
if (
|
|
1617
|
+
if (trigger) {
|
|
1560
1618
|
request['parent_order_id'] = id;
|
|
1561
1619
|
response = await this.privatePostStopMarketOrderCancel(this.extend(request, params));
|
|
1562
1620
|
//
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -6896,7 +6896,7 @@ class gate extends gate$1 {
|
|
|
6896
6896
|
// ...
|
|
6897
6897
|
// ]
|
|
6898
6898
|
//
|
|
6899
|
-
return this.
|
|
6899
|
+
return this.parseOpenInterestsHistory(response, market, since, limit);
|
|
6900
6900
|
}
|
|
6901
6901
|
parseOpenInterest(interest, market = undefined) {
|
|
6902
6902
|
//
|
|
@@ -7122,7 +7122,7 @@ class gate extends gate$1 {
|
|
|
7122
7122
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7123
7123
|
* @param {int} [params.until] end time in ms
|
|
7124
7124
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7125
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
7125
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
7126
7126
|
*/
|
|
7127
7127
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7128
7128
|
await this.loadMarkets();
|
package/dist/cjs/src/hashkey.js
CHANGED
|
@@ -2238,7 +2238,7 @@ class hashkey extends hashkey$1 {
|
|
|
2238
2238
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
2239
2239
|
* @param {int} [params.flowType] trade, fee, transfer, deposit, withdrawal
|
|
2240
2240
|
* @param {int} [params.accountType] spot, swap, custody
|
|
2241
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
2241
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
2242
2242
|
*/
|
|
2243
2243
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2244
2244
|
const methodName = 'fetchLedger';
|
|
@@ -3479,10 +3479,8 @@ class hashkey extends hashkey$1 {
|
|
|
3479
3479
|
}
|
|
3480
3480
|
}
|
|
3481
3481
|
handleTriggerOptionAndParams(params, methodName, defaultValue = undefined) {
|
|
3482
|
-
let
|
|
3483
|
-
[
|
|
3484
|
-
let isTrigger = isStop;
|
|
3485
|
-
[isTrigger, params] = this.handleOptionAndParams(params, methodName, 'trigger', isTrigger);
|
|
3482
|
+
let isTrigger = defaultValue;
|
|
3483
|
+
[isTrigger, params] = this.handleOptionAndParams2(params, methodName, 'stop', 'trigger', isTrigger);
|
|
3486
3484
|
return [isTrigger, params];
|
|
3487
3485
|
}
|
|
3488
3486
|
parseOrder(order, market = undefined) {
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -8386,7 +8386,7 @@ class htx extends htx$1 {
|
|
|
8386
8386
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8387
8387
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
8388
8388
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
8389
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
8389
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
8390
8390
|
*/
|
|
8391
8391
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8392
8392
|
await this.loadMarkets();
|
|
@@ -8640,7 +8640,7 @@ class htx extends htx$1 {
|
|
|
8640
8640
|
//
|
|
8641
8641
|
const data = this.safeValue(response, 'data');
|
|
8642
8642
|
const tick = this.safeList(data, 'tick');
|
|
8643
|
-
return this.
|
|
8643
|
+
return this.parseOpenInterestsHistory(tick, market, since, limit);
|
|
8644
8644
|
}
|
|
8645
8645
|
/**
|
|
8646
8646
|
* @method
|
|
@@ -85,8 +85,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
85
85
|
'fetchMyLiquidations': false,
|
|
86
86
|
'fetchMyTrades': true,
|
|
87
87
|
'fetchOHLCV': true,
|
|
88
|
-
'fetchOpenInterest':
|
|
88
|
+
'fetchOpenInterest': true,
|
|
89
89
|
'fetchOpenInterestHistory': false,
|
|
90
|
+
'fetchOpenInterests': true,
|
|
90
91
|
'fetchOpenOrders': true,
|
|
91
92
|
'fetchOrder': true,
|
|
92
93
|
'fetchOrderBook': true,
|
|
@@ -3079,7 +3080,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
3079
3080
|
* @param {int} [limit] max number of ledger entries to return
|
|
3080
3081
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3081
3082
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
3082
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
3083
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
3083
3084
|
*/
|
|
3084
3085
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3085
3086
|
await this.loadMarkets();
|
|
@@ -3252,6 +3253,69 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
3252
3253
|
const withdrawals = this.filterByArray(records, 'type', ['withdraw'], false);
|
|
3253
3254
|
return this.parseTransactions(withdrawals, undefined, since, limit);
|
|
3254
3255
|
}
|
|
3256
|
+
/**
|
|
3257
|
+
* @method
|
|
3258
|
+
* @name hyperliquid#fetchOpenInterests
|
|
3259
|
+
* @description Retrieves the open interest for a list of symbols
|
|
3260
|
+
* @param {string[]} [symbols] Unified CCXT market symbol
|
|
3261
|
+
* @param {object} [params] exchange specific parameters
|
|
3262
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
3263
|
+
*/
|
|
3264
|
+
async fetchOpenInterests(symbols = undefined, params = {}) {
|
|
3265
|
+
await this.loadMarkets();
|
|
3266
|
+
symbols = this.marketSymbols(symbols);
|
|
3267
|
+
const swapMarkets = await this.fetchSwapMarkets();
|
|
3268
|
+
const result = this.parseOpenInterests(swapMarkets);
|
|
3269
|
+
return this.filterByArray(result, 'symbol', symbols);
|
|
3270
|
+
}
|
|
3271
|
+
/**
|
|
3272
|
+
* @method
|
|
3273
|
+
* @name hyperliquid#fetchOpenInterest
|
|
3274
|
+
* @description retrieves the open interest of a contract trading pair
|
|
3275
|
+
* @param {string} symbol unified CCXT market symbol
|
|
3276
|
+
* @param {object} [params] exchange specific parameters
|
|
3277
|
+
* @returns {object} an [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
3278
|
+
*/
|
|
3279
|
+
async fetchOpenInterest(symbol, params = {}) {
|
|
3280
|
+
symbol = this.symbol(symbol);
|
|
3281
|
+
await this.loadMarkets();
|
|
3282
|
+
const ois = await this.fetchOpenInterests([symbol], params);
|
|
3283
|
+
return ois[symbol];
|
|
3284
|
+
}
|
|
3285
|
+
parseOpenInterest(interest, market = undefined) {
|
|
3286
|
+
//
|
|
3287
|
+
// {
|
|
3288
|
+
// szDecimals: '2',
|
|
3289
|
+
// name: 'HYPE',
|
|
3290
|
+
// maxLeverage: '3',
|
|
3291
|
+
// funding: '0.00014735',
|
|
3292
|
+
// openInterest: '14677900.74',
|
|
3293
|
+
// prevDayPx: '26.145',
|
|
3294
|
+
// dayNtlVlm: '299643445.12560016',
|
|
3295
|
+
// premium: '0.00081613',
|
|
3296
|
+
// oraclePx: '27.569',
|
|
3297
|
+
// markPx: '27.63',
|
|
3298
|
+
// midPx: '27.599',
|
|
3299
|
+
// impactPxs: [ '27.5915', '27.6319' ],
|
|
3300
|
+
// dayBaseVlm: '10790652.83',
|
|
3301
|
+
// baseId: 159
|
|
3302
|
+
// }
|
|
3303
|
+
//
|
|
3304
|
+
interest = this.safeDict(interest, 'info', {});
|
|
3305
|
+
const coin = this.safeString(interest, 'name');
|
|
3306
|
+
let marketId = undefined;
|
|
3307
|
+
if (coin !== undefined) {
|
|
3308
|
+
marketId = this.coinToMarketId(coin);
|
|
3309
|
+
}
|
|
3310
|
+
return this.safeOpenInterest({
|
|
3311
|
+
'symbol': this.safeSymbol(marketId),
|
|
3312
|
+
'openInterestAmount': this.safeNumber(interest, 'openInterest'),
|
|
3313
|
+
'openInterestValue': undefined,
|
|
3314
|
+
'timestamp': undefined,
|
|
3315
|
+
'datetime': undefined,
|
|
3316
|
+
'info': interest,
|
|
3317
|
+
}, market);
|
|
3318
|
+
}
|
|
3255
3319
|
extractTypeFromDelta(data = []) {
|
|
3256
3320
|
const records = [];
|
|
3257
3321
|
for (let i = 0; i < data.length; i++) {
|