ccxt 4.4.77 → 4.4.80
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 +8 -10
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +8 -4
- package/dist/cjs/src/abstract/ace.js +1 -1
- package/dist/cjs/src/abstract/apex.js +9 -0
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/apex.js +1949 -0
- package/dist/cjs/src/ascendex.js +25 -4
- package/dist/cjs/src/base/Exchange.js +42 -2
- package/dist/cjs/src/binance.js +9 -1
- package/dist/cjs/src/bingx.js +3 -3
- package/dist/cjs/src/bitfinex.js +64 -36
- package/dist/cjs/src/bitget.js +191 -138
- package/dist/cjs/src/bitmart.js +7 -2
- package/dist/cjs/src/bitmex.js +16 -8
- package/dist/cjs/src/bitopro.js +5 -1
- package/dist/cjs/src/bitrue.js +2 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitteam.js +2 -0
- package/dist/cjs/src/bitvavo.js +28 -10
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +32 -16
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +18 -2
- package/dist/cjs/src/coincatch.js +68 -0
- package/dist/cjs/src/coinex.js +1 -0
- package/dist/cjs/src/coinlist.js +1 -0
- package/dist/cjs/src/coinone.js +1 -0
- package/dist/cjs/src/delta.js +4 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/hitbtc.js +3 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/htx.js +7 -3
- package/dist/cjs/src/huobijp.js +1 -0
- package/dist/cjs/src/hyperliquid.js +14 -4
- package/dist/cjs/src/kraken.js +2 -0
- package/dist/cjs/src/mexc.js +50 -57
- package/dist/cjs/src/okx.js +1 -1
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/poloniex.js +2 -1
- package/dist/cjs/src/pro/apex.js +1043 -0
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/coinbase.js +45 -68
- package/dist/cjs/src/pro/gate.js +27 -2
- package/dist/cjs/src/pro/hollaex.js +2 -2
- package/dist/cjs/src/pro/p2b.js +2 -2
- package/dist/cjs/src/pro/tradeogre.js +283 -0
- package/dist/cjs/src/pro/upbit.js +43 -0
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2639 -0
- package/dist/cjs/src/timex.js +2 -2
- package/dist/cjs/src/tradeogre.js +2 -1
- package/dist/cjs/src/upbit.js +277 -67
- package/dist/cjs/src/whitebit.js +66 -12
- package/dist/cjs/src/woo.js +3 -1
- package/dist/cjs/src/xt.js +9 -0
- package/js/ccxt.d.ts +11 -5
- package/js/ccxt.js +8 -4
- package/js/src/abstract/apex.d.ts +34 -0
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/apex.d.ts +333 -0
- package/js/src/apex.js +1945 -0
- package/js/src/ascendex.d.ts +3 -3
- package/js/src/ascendex.js +25 -4
- package/js/src/base/Exchange.d.ts +2 -0
- package/js/src/base/Exchange.js +42 -1
- package/js/src/binance.d.ts +7 -7
- package/js/src/binance.js +9 -1
- package/js/src/bingx.js +3 -3
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex.js +64 -36
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitget.d.ts +2 -0
- package/js/src/bitget.js +191 -138
- package/js/src/bitmart.d.ts +5 -4
- package/js/src/bitmart.js +7 -2
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitmex.js +16 -8
- package/js/src/bitopro.js +5 -1
- package/js/src/bitrue.js +2 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitteam.js +2 -0
- package/js/src/bitvavo.js +28 -10
- package/js/src/btcalpha.js +1 -1
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.js +1 -1
- package/js/src/bybit.js +32 -16
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +4 -4
- package/js/src/coinbase.js +18 -2
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coincatch.d.ts +11 -0
- package/js/src/coincatch.js +68 -0
- package/js/src/coinex.js +1 -0
- package/js/src/coinlist.js +1 -0
- package/js/src/coinone.js +1 -0
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/delta.js +4 -0
- package/js/src/deribit.d.ts +4 -4
- package/js/src/deribit.js +1 -0
- package/js/src/derive.d.ts +3 -3
- package/js/src/digifinex.d.ts +4 -4
- package/js/src/hitbtc.js +3 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/htx.d.ts +4 -4
- package/js/src/htx.js +7 -3
- package/js/src/huobijp.js +1 -0
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +14 -4
- package/js/src/kraken.d.ts +3 -3
- package/js/src/kraken.js +2 -0
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/kucoinfutures.d.ts +5 -5
- package/js/src/mexc.d.ts +1 -0
- package/js/src/mexc.js +50 -57
- package/js/src/okx.js +1 -1
- package/js/src/oxfun.d.ts +3 -3
- package/js/src/phemex.d.ts +3 -3
- package/js/src/phemex.js +2 -1
- package/js/src/poloniex.d.ts +3 -3
- package/js/src/poloniex.js +2 -1
- package/js/src/pro/apex.d.ts +160 -0
- package/js/src/pro/apex.js +1038 -0
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/coinbase.d.ts +4 -3
- package/js/src/pro/coinbase.js +45 -66
- package/js/src/pro/gate.js +27 -2
- package/js/src/pro/hollaex.js +2 -2
- package/js/src/pro/p2b.js +2 -2
- package/js/src/pro/tradeogre.d.ts +49 -0
- package/js/src/pro/tradeogre.js +278 -0
- package/js/src/pro/upbit.d.ts +16 -1
- package/js/src/pro/upbit.js +43 -0
- package/js/src/probit.js +1 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.d.ts +1279 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.js +4276 -0
- package/js/src/timex.js +2 -2
- package/js/src/tradeogre.js +2 -1
- package/js/src/upbit.d.ts +75 -23
- package/js/src/upbit.js +277 -67
- package/js/src/vertex.d.ts +3 -3
- package/js/src/whitebit.js +66 -12
- package/js/src/woo.d.ts +4 -4
- package/js/src/woo.js +3 -1
- package/js/src/woofipro.d.ts +4 -4
- package/js/src/xt.d.ts +4 -4
- package/js/src/xt.js +9 -0
- package/package.json +2 -2
- package/js/src/abstract/ace.d.ts +0 -18
- package/js/src/ace.d.ts +0 -158
- package/js/src/ace.js +0 -1175
- /package/js/src/abstract/{ace.js → apex.js} +0 -0
package/js/src/bitmex.js
CHANGED
|
@@ -492,6 +492,7 @@ export default class bitmex extends Exchange {
|
|
|
492
492
|
const maxWithdrawal = this.parseNumber(Precise.stringMul(maxWithdrawalString, precisionString));
|
|
493
493
|
const minDepositString = this.safeString(currency, 'minDepositAmount');
|
|
494
494
|
const minDeposit = this.parseNumber(Precise.stringMul(minDepositString, precisionString));
|
|
495
|
+
const isCrypto = this.safeString(currency, 'currencyType') === 'Crypto';
|
|
495
496
|
result[code] = {
|
|
496
497
|
'id': id,
|
|
497
498
|
'code': code,
|
|
@@ -517,6 +518,7 @@ export default class bitmex extends Exchange {
|
|
|
517
518
|
},
|
|
518
519
|
},
|
|
519
520
|
'networks': networks,
|
|
521
|
+
'type': isCrypto ? 'crypto' : 'other',
|
|
520
522
|
};
|
|
521
523
|
}
|
|
522
524
|
return result;
|
|
@@ -725,11 +727,11 @@ export default class bitmex extends Exchange {
|
|
|
725
727
|
const quote = this.safeCurrencyCode(quoteId);
|
|
726
728
|
const contract = swap || future;
|
|
727
729
|
let contractSize = undefined;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
730
|
+
let isInverse = this.safeValue(market, 'isInverse'); // this is true when BASE and SETTLE are same, i.e. BTC/XXX:BTC
|
|
731
|
+
let isQuanto = this.safeValue(market, 'isQuanto'); // this is true when BASE and SETTLE are different, i.e. AXS/XXX:BTC
|
|
732
|
+
let linear = contract ? (!isInverse && !isQuanto) : undefined;
|
|
731
733
|
const status = this.safeString(market, 'state');
|
|
732
|
-
const active = status
|
|
734
|
+
const active = status === 'Open'; // Open, Settled, Unlisted
|
|
733
735
|
let expiry = undefined;
|
|
734
736
|
let expiryDatetime = undefined;
|
|
735
737
|
let symbol = undefined;
|
|
@@ -746,9 +748,9 @@ export default class bitmex extends Exchange {
|
|
|
746
748
|
const multiplierString = Precise.stringAbs(this.safeString(market, 'multiplier'));
|
|
747
749
|
contractSize = this.parseNumber(multiplierString);
|
|
748
750
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
751
|
+
expiryDatetime = this.safeString(market, 'expiry');
|
|
752
|
+
expiry = this.parse8601(expiryDatetime);
|
|
753
|
+
if (expiry !== undefined) {
|
|
752
754
|
symbol = symbol + '-' + this.yymmdd(expiry);
|
|
753
755
|
}
|
|
754
756
|
}
|
|
@@ -762,6 +764,12 @@ export default class bitmex extends Exchange {
|
|
|
762
764
|
const maxOrderQty = this.safeNumber(market, 'maxOrderQty');
|
|
763
765
|
const initMargin = this.safeString(market, 'initMargin', '1');
|
|
764
766
|
const maxLeverage = this.parseNumber(Precise.stringDiv('1', initMargin));
|
|
767
|
+
// subtype should be undefined for spot markets
|
|
768
|
+
if (spot) {
|
|
769
|
+
isInverse = undefined;
|
|
770
|
+
isQuanto = undefined;
|
|
771
|
+
linear = undefined;
|
|
772
|
+
}
|
|
765
773
|
return {
|
|
766
774
|
'id': id,
|
|
767
775
|
'symbol': symbol,
|
|
@@ -811,7 +819,7 @@ export default class bitmex extends Exchange {
|
|
|
811
819
|
'max': positionIsQuote ? maxOrderQty : undefined,
|
|
812
820
|
},
|
|
813
821
|
},
|
|
814
|
-
'created':
|
|
822
|
+
'created': undefined,
|
|
815
823
|
'info': market,
|
|
816
824
|
};
|
|
817
825
|
}
|
package/js/src/bitopro.js
CHANGED
|
@@ -234,6 +234,7 @@ export default class bitopro extends Exchange {
|
|
|
234
234
|
'BEP20': 'BSC',
|
|
235
235
|
'BSC': 'BSC',
|
|
236
236
|
},
|
|
237
|
+
'fiatCurrencies': ['TWD'], // the only fiat currency for exchange
|
|
237
238
|
},
|
|
238
239
|
'features': {
|
|
239
240
|
'spot': {
|
|
@@ -361,6 +362,7 @@ export default class bitopro extends Exchange {
|
|
|
361
362
|
// }
|
|
362
363
|
//
|
|
363
364
|
const result = {};
|
|
365
|
+
const fiatCurrencies = this.safeList(this.options, 'fiatCurrencies', []);
|
|
364
366
|
for (let i = 0; i < currencies.length; i++) {
|
|
365
367
|
const currency = currencies[i];
|
|
366
368
|
const currencyId = this.safeString(currency, 'currency');
|
|
@@ -380,11 +382,12 @@ export default class bitopro extends Exchange {
|
|
|
380
382
|
'max': undefined,
|
|
381
383
|
},
|
|
382
384
|
};
|
|
385
|
+
const isFiat = this.inArray(code, fiatCurrencies);
|
|
383
386
|
result[code] = {
|
|
384
387
|
'id': currencyId,
|
|
385
388
|
'code': code,
|
|
386
389
|
'info': currency,
|
|
387
|
-
'type':
|
|
390
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
388
391
|
'name': undefined,
|
|
389
392
|
'active': deposit && withdraw,
|
|
390
393
|
'deposit': deposit,
|
|
@@ -392,6 +395,7 @@ export default class bitopro extends Exchange {
|
|
|
392
395
|
'fee': fee,
|
|
393
396
|
'precision': undefined,
|
|
394
397
|
'limits': limits,
|
|
398
|
+
'networks': undefined,
|
|
395
399
|
};
|
|
396
400
|
}
|
|
397
401
|
return result;
|
package/js/src/bitrue.js
CHANGED
|
@@ -816,7 +816,8 @@ export default class bitrue extends Exchange {
|
|
|
816
816
|
'withdraw': withdraw,
|
|
817
817
|
'networks': networks,
|
|
818
818
|
'fee': this.parseNumber(minWithdrawFeeString),
|
|
819
|
-
|
|
819
|
+
'fees': undefined,
|
|
820
|
+
'type': 'crypto',
|
|
820
821
|
'limits': {
|
|
821
822
|
'withdraw': {
|
|
822
823
|
'min': this.parseNumber(minWithdrawString),
|
package/js/src/bitso.js
CHANGED
|
@@ -748,7 +748,7 @@ export default class bitso extends Exchange {
|
|
|
748
748
|
// {
|
|
749
749
|
// "bucket_start_time":1648219140000,
|
|
750
750
|
// "first_trade_time":1648219154990,
|
|
751
|
-
// "last_trade_time":
|
|
751
|
+
// "last_trade_time":1648219189442,
|
|
752
752
|
// "first_rate":"44958.60",
|
|
753
753
|
// "last_rate":"44979.88",
|
|
754
754
|
// "min_rate":"44957.33",
|
package/js/src/bitteam.js
CHANGED
|
@@ -641,6 +641,7 @@ export default class bitteam extends Exchange {
|
|
|
641
641
|
const networkIds = Object.keys(feesByNetworkId);
|
|
642
642
|
const networks = {};
|
|
643
643
|
const networkPrecision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
644
|
+
const typeRaw = this.safeString(currency, 'type');
|
|
644
645
|
for (let j = 0; j < networkIds.length; j++) {
|
|
645
646
|
const networkId = networkIds[j];
|
|
646
647
|
const networkCode = this.networkIdToCode(networkId, code);
|
|
@@ -695,6 +696,7 @@ export default class bitteam extends Exchange {
|
|
|
695
696
|
'max': undefined,
|
|
696
697
|
},
|
|
697
698
|
},
|
|
699
|
+
'type': typeRaw,
|
|
698
700
|
'networks': networks,
|
|
699
701
|
};
|
|
700
702
|
}
|
package/js/src/bitvavo.js
CHANGED
|
@@ -340,6 +340,8 @@ export default class bitvavo extends Exchange {
|
|
|
340
340
|
'ERC20': 'ETH',
|
|
341
341
|
'TRC20': 'TRX',
|
|
342
342
|
},
|
|
343
|
+
'operatorId': undefined,
|
|
344
|
+
'fiatCurrencies': ['EUR'], // only fiat atm
|
|
343
345
|
},
|
|
344
346
|
'precisionMode': SIGNIFICANT_DIGITS,
|
|
345
347
|
'commonCurrencies': {
|
|
@@ -549,24 +551,24 @@ export default class bitvavo extends Exchange {
|
|
|
549
551
|
// },
|
|
550
552
|
// ]
|
|
551
553
|
//
|
|
554
|
+
const fiatCurrencies = this.safeList(this.options, 'fiatCurrencies', []);
|
|
552
555
|
const result = {};
|
|
553
556
|
for (let i = 0; i < currencies.length; i++) {
|
|
554
557
|
const currency = currencies[i];
|
|
555
558
|
const id = this.safeString(currency, 'symbol');
|
|
556
559
|
const code = this.safeCurrencyCode(id);
|
|
560
|
+
const isFiat = this.inArray(code, fiatCurrencies);
|
|
557
561
|
const networks = {};
|
|
558
|
-
const networksArray = this.
|
|
559
|
-
const
|
|
560
|
-
const
|
|
561
|
-
const deposit = (this.safeValue(currency, 'depositStatus') === 'OK');
|
|
562
|
-
const withdrawal = (this.safeValue(currency, 'withdrawalStatus') === 'OK');
|
|
562
|
+
const networksArray = this.safeList(currency, 'networks', []);
|
|
563
|
+
const deposit = this.safeString(currency, 'depositStatus') === 'OK';
|
|
564
|
+
const withdrawal = this.safeString(currency, 'withdrawalStatus') === 'OK';
|
|
563
565
|
const active = deposit && withdrawal;
|
|
564
566
|
const withdrawFee = this.safeNumber(currency, 'withdrawalFee');
|
|
565
567
|
const precision = this.safeInteger(currency, 'decimals', 8);
|
|
566
568
|
const minWithdraw = this.safeNumber(currency, 'withdrawalMinAmount');
|
|
567
|
-
// absolutely all of them have 1 network atm
|
|
568
|
-
|
|
569
|
-
const networkId = networksArray[
|
|
569
|
+
// btw, absolutely all of them have 1 network atm
|
|
570
|
+
for (let j = 0; j < networksArray.length; j++) {
|
|
571
|
+
const networkId = networksArray[j];
|
|
570
572
|
const networkCode = this.networkIdToCode(networkId);
|
|
571
573
|
networks[networkCode] = {
|
|
572
574
|
'info': currency,
|
|
@@ -585,7 +587,7 @@ export default class bitvavo extends Exchange {
|
|
|
585
587
|
},
|
|
586
588
|
};
|
|
587
589
|
}
|
|
588
|
-
result[code] = {
|
|
590
|
+
result[code] = this.safeCurrencyStructure({
|
|
589
591
|
'info': currency,
|
|
590
592
|
'id': id,
|
|
591
593
|
'code': code,
|
|
@@ -596,6 +598,7 @@ export default class bitvavo extends Exchange {
|
|
|
596
598
|
'networks': networks,
|
|
597
599
|
'fee': withdrawFee,
|
|
598
600
|
'precision': precision,
|
|
601
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
599
602
|
'limits': {
|
|
600
603
|
'amount': {
|
|
601
604
|
'min': undefined,
|
|
@@ -610,7 +613,7 @@ export default class bitvavo extends Exchange {
|
|
|
610
613
|
'max': undefined,
|
|
611
614
|
},
|
|
612
615
|
},
|
|
613
|
-
};
|
|
616
|
+
});
|
|
614
617
|
}
|
|
615
618
|
// set currencies here to avoid calling publicGetAssets twice
|
|
616
619
|
this.currencies = this.deepExtend(this.currencies, result);
|
|
@@ -1180,6 +1183,11 @@ export default class bitvavo extends Exchange {
|
|
|
1180
1183
|
if (postOnly) {
|
|
1181
1184
|
request['postOnly'] = true;
|
|
1182
1185
|
}
|
|
1186
|
+
let operatorId = undefined;
|
|
1187
|
+
[operatorId, params] = this.handleOptionAndParams(params, 'createOrder', 'operatorId');
|
|
1188
|
+
if (operatorId !== undefined) {
|
|
1189
|
+
request['operatorId'] = this.parseToInt(operatorId);
|
|
1190
|
+
}
|
|
1183
1191
|
return this.extend(request, params);
|
|
1184
1192
|
}
|
|
1185
1193
|
/**
|
|
@@ -1279,6 +1287,11 @@ export default class bitvavo extends Exchange {
|
|
|
1279
1287
|
if (clientOrderId === undefined) {
|
|
1280
1288
|
request['orderId'] = id;
|
|
1281
1289
|
}
|
|
1290
|
+
let operatorId = undefined;
|
|
1291
|
+
[operatorId, params] = this.handleOptionAndParams(params, 'editOrder', 'operatorId');
|
|
1292
|
+
if (operatorId !== undefined) {
|
|
1293
|
+
request['operatorId'] = this.parseToInt(operatorId);
|
|
1294
|
+
}
|
|
1282
1295
|
request['market'] = market['id'];
|
|
1283
1296
|
return request;
|
|
1284
1297
|
}
|
|
@@ -1315,6 +1328,11 @@ export default class bitvavo extends Exchange {
|
|
|
1315
1328
|
if (clientOrderId === undefined) {
|
|
1316
1329
|
request['orderId'] = id;
|
|
1317
1330
|
}
|
|
1331
|
+
let operatorId = undefined;
|
|
1332
|
+
[operatorId, params] = this.handleOptionAndParams(params, 'cancelOrder', 'operatorId');
|
|
1333
|
+
if (operatorId !== undefined) {
|
|
1334
|
+
request['operatorId'] = this.parseToInt(operatorId);
|
|
1335
|
+
}
|
|
1318
1336
|
return this.extend(request, params);
|
|
1319
1337
|
}
|
|
1320
1338
|
/**
|
package/js/src/btcalpha.js
CHANGED
package/js/src/btcmarkets.js
CHANGED
|
@@ -451,7 +451,7 @@ export default class btcmarkets extends Exchange {
|
|
|
451
451
|
// "marketId":"COMP-AUD",
|
|
452
452
|
// "baseAssetName":"COMP",
|
|
453
453
|
// "quoteAssetName":"AUD",
|
|
454
|
-
// "minOrderAmount":"0.
|
|
454
|
+
// "minOrderAmount":"0.00006",
|
|
455
455
|
// "maxOrderAmount":"1000000",
|
|
456
456
|
// "amountDecimals":"8",
|
|
457
457
|
// "priceDecimals":"2",
|
package/js/src/btcturk.js
CHANGED
|
@@ -239,7 +239,7 @@ export default class btcturk extends Exchange {
|
|
|
239
239
|
// "minPrice": "0.0000000000001",
|
|
240
240
|
// "maxPrice": "10000000",
|
|
241
241
|
// "tickSize": "10",
|
|
242
|
-
// "minExchangeValue": "99.
|
|
242
|
+
// "minExchangeValue": "99.92",
|
|
243
243
|
// "minAmount": null,
|
|
244
244
|
// "maxAmount": null
|
|
245
245
|
// }
|
package/js/src/bybit.js
CHANGED
|
@@ -1020,9 +1020,6 @@ export default class bybit extends Exchange {
|
|
|
1020
1020
|
'usePrivateInstrumentsInfo': false,
|
|
1021
1021
|
'enableDemoTrading': false,
|
|
1022
1022
|
'fetchMarkets': ['spot', 'linear', 'inverse', 'option'],
|
|
1023
|
-
'createOrder': {
|
|
1024
|
-
'method': 'privatePostV5OrderCreate', // 'privatePostV5PositionTradingStop'
|
|
1025
|
-
},
|
|
1026
1023
|
'enableUnifiedMargin': undefined,
|
|
1027
1024
|
'enableUnifiedAccount': undefined,
|
|
1028
1025
|
'unifiedMarginStatus': undefined,
|
|
@@ -2183,7 +2180,7 @@ export default class bybit extends Exchange {
|
|
|
2183
2180
|
'quoteId': quoteId,
|
|
2184
2181
|
'settleId': settleId,
|
|
2185
2182
|
'type': 'option',
|
|
2186
|
-
'subType':
|
|
2183
|
+
'subType': undefined,
|
|
2187
2184
|
'spot': false,
|
|
2188
2185
|
'margin': false,
|
|
2189
2186
|
'swap': false,
|
|
@@ -2191,8 +2188,8 @@ export default class bybit extends Exchange {
|
|
|
2191
2188
|
'option': true,
|
|
2192
2189
|
'active': isActive,
|
|
2193
2190
|
'contract': true,
|
|
2194
|
-
'linear':
|
|
2195
|
-
'inverse':
|
|
2191
|
+
'linear': undefined,
|
|
2192
|
+
'inverse': undefined,
|
|
2196
2193
|
'taker': this.safeNumber(market, 'takerFee', this.parseNumber('0.0006')),
|
|
2197
2194
|
'maker': this.safeNumber(market, 'makerFee', this.parseNumber('0.0001')),
|
|
2198
2195
|
'contractSize': this.parseNumber('1'),
|
|
@@ -3941,12 +3938,23 @@ export default class bybit extends Exchange {
|
|
|
3941
3938
|
const parts = await this.isUnifiedEnabled();
|
|
3942
3939
|
const enableUnifiedAccount = parts[1];
|
|
3943
3940
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
|
|
3941
|
+
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
3942
|
+
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
3944
3943
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
3944
|
+
const isStopLoss = stopLossPrice !== undefined;
|
|
3945
|
+
const isTakeProfit = takeProfitPrice !== undefined;
|
|
3945
3946
|
const orderRequest = this.createOrderRequest(symbol, type, side, amount, price, params, enableUnifiedAccount);
|
|
3946
|
-
|
|
3947
|
-
|
|
3947
|
+
let defaultMethod = undefined;
|
|
3948
|
+
if (isTrailingAmountOrder || isStopLoss || isTakeProfit) {
|
|
3949
|
+
defaultMethod = 'privatePostV5PositionTradingStop';
|
|
3950
|
+
}
|
|
3951
|
+
else {
|
|
3952
|
+
defaultMethod = 'privatePostV5OrderCreate';
|
|
3953
|
+
}
|
|
3954
|
+
let method = undefined;
|
|
3955
|
+
[method, params] = this.handleOptionAndParams(params, 'createOrder', 'method', defaultMethod);
|
|
3948
3956
|
let response = undefined;
|
|
3949
|
-
if (
|
|
3957
|
+
if (method === 'privatePostV5PositionTradingStop') {
|
|
3950
3958
|
response = await this.privatePostV5PositionTradingStop(orderRequest);
|
|
3951
3959
|
}
|
|
3952
3960
|
else {
|
|
@@ -3974,8 +3982,6 @@ export default class bybit extends Exchange {
|
|
|
3974
3982
|
if ((price === undefined) && (lowerCaseType === 'limit')) {
|
|
3975
3983
|
throw new ArgumentsRequired(this.id + ' createOrder requires a price argument for limit orders');
|
|
3976
3984
|
}
|
|
3977
|
-
let defaultMethod = undefined;
|
|
3978
|
-
[defaultMethod, params] = this.handleOptionAndParams(params, 'createOrder', 'method', 'privatePostV5OrderCreate');
|
|
3979
3985
|
const request = {
|
|
3980
3986
|
'symbol': market['id'],
|
|
3981
3987
|
// 'side': this.capitalize (side),
|
|
@@ -4019,7 +4025,16 @@ export default class bybit extends Exchange {
|
|
|
4019
4025
|
const isMarket = lowerCaseType === 'market';
|
|
4020
4026
|
const isLimit = lowerCaseType === 'limit';
|
|
4021
4027
|
const isBuy = side === 'buy';
|
|
4022
|
-
|
|
4028
|
+
let defaultMethod = undefined;
|
|
4029
|
+
if (isTrailingAmountOrder || isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
|
4030
|
+
defaultMethod = 'privatePostV5PositionTradingStop';
|
|
4031
|
+
}
|
|
4032
|
+
else {
|
|
4033
|
+
defaultMethod = 'privatePostV5OrderCreate';
|
|
4034
|
+
}
|
|
4035
|
+
let method = undefined;
|
|
4036
|
+
[method, params] = this.handleOptionAndParams(params, 'createOrder', 'method', defaultMethod);
|
|
4037
|
+
const isAlternativeEndpoint = method === 'privatePostV5PositionTradingStop';
|
|
4023
4038
|
const amountString = this.getAmount(symbol, amount);
|
|
4024
4039
|
const priceString = (price !== undefined) ? this.getPrice(symbol, this.numberToString(price)) : undefined;
|
|
4025
4040
|
if (isTrailingAmountOrder || isAlternativeEndpoint) {
|
|
@@ -4089,15 +4104,15 @@ export default class bybit extends Exchange {
|
|
|
4089
4104
|
if (market['spot']) {
|
|
4090
4105
|
request['category'] = 'spot';
|
|
4091
4106
|
}
|
|
4107
|
+
else if (market['option']) {
|
|
4108
|
+
request['category'] = 'option';
|
|
4109
|
+
}
|
|
4092
4110
|
else if (market['linear']) {
|
|
4093
4111
|
request['category'] = 'linear';
|
|
4094
4112
|
}
|
|
4095
4113
|
else if (market['inverse']) {
|
|
4096
4114
|
request['category'] = 'inverse';
|
|
4097
4115
|
}
|
|
4098
|
-
else if (market['option']) {
|
|
4099
|
-
request['category'] = 'option';
|
|
4100
|
-
}
|
|
4101
4116
|
const cost = this.safeString(params, 'cost');
|
|
4102
4117
|
params = this.omit(params, 'cost');
|
|
4103
4118
|
// if the cost is inferable, let's keep the old logic and ignore marketUnit, to minimize the impact of the changes
|
|
@@ -5975,7 +5990,8 @@ export default class bybit extends Exchange {
|
|
|
5975
5990
|
[subType, params] = this.handleSubTypeAndParams('fetchLedger', undefined, params);
|
|
5976
5991
|
let response = undefined;
|
|
5977
5992
|
if (enableUnified[1]) {
|
|
5978
|
-
|
|
5993
|
+
const unifiedMarginStatus = this.safeInteger(this.options, 'unifiedMarginStatus', 5); // 3/4 uta 1.0, 5/6 uta 2.0
|
|
5994
|
+
if (subType === 'inverse' && (unifiedMarginStatus < 5)) {
|
|
5979
5995
|
response = await this.privateGetV5AccountContractTransactionLog(this.extend(request, params));
|
|
5980
5996
|
}
|
|
5981
5997
|
else {
|
package/js/src/cex.js
CHANGED
|
@@ -547,7 +547,7 @@ export default class cex extends Exchange {
|
|
|
547
547
|
'askVolume': undefined,
|
|
548
548
|
'vwap': undefined,
|
|
549
549
|
'open': undefined,
|
|
550
|
-
'close': this.safeString(ticker, '
|
|
550
|
+
'close': this.safeString(ticker, 'last'),
|
|
551
551
|
'previousClose': undefined,
|
|
552
552
|
'change': this.safeNumber(ticker, 'priceChange'),
|
|
553
553
|
'percentage': this.safeNumber(ticker, 'priceChangePercentage'),
|
package/js/src/coinbase.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/coinbase.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Order, Trade, OHLCV, Ticker, OrderBook, Str, Transaction, Balances, Tickers, Strings, Market, Currency, Num, Account, Currencies, MarketInterface, Conversion, Dict, int, TradingFees, LedgerEntry, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Order, Trade, OHLCV, Ticker, OrderBook, Str, Transaction, Balances, Tickers, Strings, Market, Currency, Num, Account, Currencies, MarketInterface, Conversion, Dict, int, TradingFees, LedgerEntry, DepositAddress, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class coinbase
|
|
5
5
|
* @augments Exchange
|
|
@@ -575,7 +575,7 @@ export default class coinbase extends Exchange {
|
|
|
575
575
|
* @param {string} [params.portfolio] the portfolio UUID to fetch positions for
|
|
576
576
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
577
577
|
*/
|
|
578
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
578
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
579
579
|
/**
|
|
580
580
|
* @method
|
|
581
581
|
* @name coinbase#fetchPosition
|
|
@@ -588,8 +588,8 @@ export default class coinbase extends Exchange {
|
|
|
588
588
|
* @param {string} [params.portfolio] *perpetual/swaps only* the portfolio UUID to fetch the position for, required for perpetual/swaps markets only
|
|
589
589
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
590
590
|
*/
|
|
591
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
592
|
-
parsePosition(position: Dict, market?: Market):
|
|
591
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
592
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
593
593
|
/**
|
|
594
594
|
* @method
|
|
595
595
|
* @name coinbase#fetchTradingFees
|
package/js/src/coinbase.js
CHANGED
|
@@ -1506,7 +1506,21 @@ export default class coinbase extends Exchange {
|
|
|
1506
1506
|
for (let i = 0; i < perpetualData.length; i++) {
|
|
1507
1507
|
result.push(this.parseContractMarket(perpetualData[i], perpetualFeeTier));
|
|
1508
1508
|
}
|
|
1509
|
-
|
|
1509
|
+
const newMarkets = [];
|
|
1510
|
+
for (let i = 0; i < result.length; i++) {
|
|
1511
|
+
const market = result[i];
|
|
1512
|
+
const info = this.safeValue(market, 'info', {});
|
|
1513
|
+
const realMarketIds = this.safeList(info, 'alias_to', []);
|
|
1514
|
+
const length = realMarketIds.length;
|
|
1515
|
+
if (length > 0) {
|
|
1516
|
+
market['alias'] = realMarketIds[0];
|
|
1517
|
+
}
|
|
1518
|
+
else {
|
|
1519
|
+
market['alias'] = undefined;
|
|
1520
|
+
}
|
|
1521
|
+
newMarkets.push(market);
|
|
1522
|
+
}
|
|
1523
|
+
return newMarkets;
|
|
1510
1524
|
}
|
|
1511
1525
|
parseSpotMarket(market, feeTier) {
|
|
1512
1526
|
//
|
|
@@ -1918,6 +1932,7 @@ export default class coinbase extends Exchange {
|
|
|
1918
1932
|
'withdraw': undefined,
|
|
1919
1933
|
'fee': undefined,
|
|
1920
1934
|
'precision': undefined,
|
|
1935
|
+
'networks': {},
|
|
1921
1936
|
'limits': {
|
|
1922
1937
|
'amount': {
|
|
1923
1938
|
'min': this.safeNumber(currency, 'min_size'),
|
|
@@ -2242,10 +2257,11 @@ export default class coinbase extends Exchange {
|
|
|
2242
2257
|
askVolume = this.safeNumber(asks[0], 'size');
|
|
2243
2258
|
}
|
|
2244
2259
|
const marketId = this.safeString(ticker, 'product_id');
|
|
2260
|
+
market = this.safeMarket(marketId, market);
|
|
2245
2261
|
const last = this.safeNumber(ticker, 'price');
|
|
2246
2262
|
const datetime = this.safeString(ticker, 'time');
|
|
2247
2263
|
return this.safeTicker({
|
|
2248
|
-
'symbol':
|
|
2264
|
+
'symbol': market['symbol'],
|
|
2249
2265
|
'timestamp': this.parse8601(datetime),
|
|
2250
2266
|
'datetime': datetime,
|
|
2251
2267
|
'bid': bid,
|
|
@@ -311,7 +311,7 @@ export default class coinbaseexchange extends Exchange {
|
|
|
311
311
|
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
312
312
|
*/
|
|
313
313
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
314
|
-
parseTransactionStatus(transaction: any): "
|
|
314
|
+
parseTransactionStatus(transaction: any): "pending" | "ok" | "failed" | "canceled";
|
|
315
315
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
316
316
|
/**
|
|
317
317
|
* @method
|
package/js/src/coincatch.d.ts
CHANGED
|
@@ -25,6 +25,17 @@ export default class coincatch extends Exchange {
|
|
|
25
25
|
* @returns {object} an associative dictionary of currencies
|
|
26
26
|
*/
|
|
27
27
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
28
|
+
/**
|
|
29
|
+
* @method
|
|
30
|
+
* @name coincatch#fetchDepositWithdrawFees
|
|
31
|
+
* @description fetch deposit and withdraw fees
|
|
32
|
+
* @see https://coincatch.github.io/github.io/en/spot/#get-coin-list
|
|
33
|
+
* @param {string[]} [codes] list of unified currency codes
|
|
34
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
35
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
36
|
+
*/
|
|
37
|
+
fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<any>;
|
|
38
|
+
parseDepositWithdrawFee(fee: any, currency?: Currency): Dict;
|
|
28
39
|
/**
|
|
29
40
|
* @method
|
|
30
41
|
* @name coincatch#fetchMarkets
|
package/js/src/coincatch.js
CHANGED
|
@@ -70,6 +70,7 @@ export default class coincatch extends Exchange {
|
|
|
70
70
|
'fetchDepositAddress': true,
|
|
71
71
|
'fetchDeposits': true,
|
|
72
72
|
'fetchDepositsWithdrawals': false,
|
|
73
|
+
'fetchDepositWithdrawFees': true,
|
|
73
74
|
'fetchFundingHistory': false,
|
|
74
75
|
'fetchFundingRate': true,
|
|
75
76
|
'fetchFundingRateHistory': true,
|
|
@@ -709,6 +710,73 @@ export default class coincatch extends Exchange {
|
|
|
709
710
|
}
|
|
710
711
|
return result;
|
|
711
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* @method
|
|
715
|
+
* @name coincatch#fetchDepositWithdrawFees
|
|
716
|
+
* @description fetch deposit and withdraw fees
|
|
717
|
+
* @see https://coincatch.github.io/github.io/en/spot/#get-coin-list
|
|
718
|
+
* @param {string[]} [codes] list of unified currency codes
|
|
719
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
720
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
721
|
+
*/
|
|
722
|
+
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
723
|
+
await this.loadMarkets();
|
|
724
|
+
const response = await this.publicGetApiSpotV1PublicCurrencies(params);
|
|
725
|
+
const data = this.safeList(response, 'data', []);
|
|
726
|
+
return this.parseDepositWithdrawFees(data, codes, 'coinName');
|
|
727
|
+
}
|
|
728
|
+
parseDepositWithdrawFee(fee, currency = undefined) {
|
|
729
|
+
//
|
|
730
|
+
// {
|
|
731
|
+
// "coinId":"1",
|
|
732
|
+
// "coinName":"BTC",
|
|
733
|
+
// "transfer":"true",
|
|
734
|
+
// "chains":[
|
|
735
|
+
// {
|
|
736
|
+
// "chain":null,
|
|
737
|
+
// "needTag":"false",
|
|
738
|
+
// "withdrawable":"true",
|
|
739
|
+
// "rechargeAble":"true",
|
|
740
|
+
// "withdrawFee":"0.005",
|
|
741
|
+
// "depositConfirm":"1",
|
|
742
|
+
// "withdrawConfirm":"1",
|
|
743
|
+
// "minDepositAmount":"0.001",
|
|
744
|
+
// "minWithdrawAmount":"0.001",
|
|
745
|
+
// "browserUrl":"https://blockchair.com/bitcoin/testnet/transaction/"
|
|
746
|
+
// }
|
|
747
|
+
// ]
|
|
748
|
+
// }
|
|
749
|
+
//
|
|
750
|
+
const chains = this.safeList(fee, 'chains', []);
|
|
751
|
+
const chainsLength = chains.length;
|
|
752
|
+
const result = {
|
|
753
|
+
'info': fee,
|
|
754
|
+
'withdraw': {
|
|
755
|
+
'fee': undefined,
|
|
756
|
+
'percentage': undefined,
|
|
757
|
+
},
|
|
758
|
+
'deposit': {
|
|
759
|
+
'fee': undefined,
|
|
760
|
+
'percentage': undefined,
|
|
761
|
+
},
|
|
762
|
+
'networks': {},
|
|
763
|
+
};
|
|
764
|
+
for (let i = 0; i < chainsLength; i++) {
|
|
765
|
+
const chain = chains[i];
|
|
766
|
+
const networkId = this.safeString(chain, 'chain');
|
|
767
|
+
const currencyCode = this.safeString(currency, 'code');
|
|
768
|
+
const networkCode = this.networkIdToCode(networkId, currencyCode);
|
|
769
|
+
result['networks'][networkCode] = {
|
|
770
|
+
'deposit': { 'fee': undefined, 'percentage': undefined },
|
|
771
|
+
'withdraw': { 'fee': this.safeNumber(chain, 'withdrawFee'), 'percentage': false },
|
|
772
|
+
};
|
|
773
|
+
if (chainsLength === 1) {
|
|
774
|
+
result['withdraw']['fee'] = this.safeNumber(chain, 'withdrawFee');
|
|
775
|
+
result['withdraw']['percentage'] = false;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return result;
|
|
779
|
+
}
|
|
712
780
|
/**
|
|
713
781
|
* @method
|
|
714
782
|
* @name coincatch#fetchMarkets
|
package/js/src/coinex.js
CHANGED
package/js/src/coinlist.js
CHANGED
package/js/src/coinone.js
CHANGED
package/js/src/cryptocom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/cryptocom.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class cryptocom
|
|
5
5
|
* @augments Exchange
|
|
@@ -366,7 +366,7 @@ export default class cryptocom extends Exchange {
|
|
|
366
366
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
367
367
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
368
368
|
*/
|
|
369
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
369
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
370
370
|
/**
|
|
371
371
|
* @method
|
|
372
372
|
* @name cryptocom#fetchPositions
|
|
@@ -376,8 +376,8 @@ export default class cryptocom extends Exchange {
|
|
|
376
376
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
377
377
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
378
378
|
*/
|
|
379
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
380
|
-
parsePosition(position: Dict, market?: Market):
|
|
379
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
380
|
+
parsePosition(position: Dict, market?: Market): Position;
|
|
381
381
|
nonce(): number;
|
|
382
382
|
paramsToString(object: any, level: any): any;
|
|
383
383
|
/**
|