ccxt 4.4.82 → 4.4.86
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 +6 -9
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +6 -17
- package/dist/cjs/src/abstract/bittrade.js +9 -0
- package/dist/cjs/src/apex.js +2 -1
- package/dist/cjs/src/ascendex.js +189 -155
- package/dist/cjs/src/base/Exchange.js +15 -2
- package/dist/cjs/src/bequant.js +1 -1
- package/dist/cjs/src/bitget.js +6 -7
- package/dist/cjs/src/bitmart.js +1 -1
- package/dist/cjs/src/bitrue.js +14 -35
- package/dist/cjs/src/bitso.js +33 -0
- package/dist/cjs/src/bitstamp.js +33 -0
- package/dist/cjs/src/bittrade.js +2049 -0
- package/dist/cjs/src/blofin.js +154 -13
- package/dist/cjs/src/btcbox.js +25 -5
- package/dist/cjs/src/bybit.js +16 -40
- package/dist/cjs/src/cex.js +2 -4
- package/dist/cjs/src/coinbase.js +58 -46
- package/dist/cjs/src/coinbaseexchange.js +142 -32
- package/dist/cjs/src/coincatch.js +14 -67
- package/dist/cjs/src/coinex.js +29 -32
- package/dist/cjs/src/coinlist.js +16 -15
- package/dist/cjs/src/coinmetro.js +22 -11
- package/dist/cjs/src/coinone.js +8 -10
- package/dist/cjs/src/coinsph.js +126 -1
- package/dist/cjs/src/cryptocom.js +111 -1
- package/dist/cjs/src/cryptomus.js +43 -89
- package/dist/cjs/src/delta.js +76 -36
- package/dist/cjs/src/deribit.js +4 -5
- package/dist/cjs/src/derive.js +46 -10
- package/dist/cjs/src/ellipx.js +175 -79
- package/dist/cjs/src/gate.js +1 -1
- package/dist/cjs/src/gemini.js +3 -5
- package/dist/cjs/src/hitbtc.js +56 -69
- package/dist/cjs/src/hollaex.js +107 -49
- package/dist/cjs/src/htx.js +20 -44
- package/dist/cjs/src/hyperliquid.js +6 -6
- package/dist/cjs/src/kraken.js +29 -24
- package/dist/cjs/src/kucoinfutures.js +6 -0
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/ndax.js +25 -24
- package/dist/cjs/src/okcoin.js +12 -31
- package/dist/cjs/src/okx.js +9 -0
- package/dist/cjs/src/onetrading.js +9 -6
- package/dist/cjs/src/oxfun.js +42 -114
- package/dist/cjs/src/paradex.js +124 -4
- package/dist/cjs/src/pro/binance.js +32 -33
- package/dist/cjs/src/pro/bithumb.js +5 -3
- package/dist/cjs/src/pro/bittrade.js +605 -0
- package/dist/cjs/src/pro/kraken.js +289 -79
- package/dist/cjs/src/pro/luno.js +6 -5
- package/dist/cjs/src/pro/mexc.js +304 -7
- package/dist/cjs/src/pro/poloniex.js +6 -2
- package/examples/js/cli.js +127 -13
- package/js/ccxt.d.ts +8 -20
- package/js/ccxt.js +6 -14
- package/js/src/abstract/blofin.d.ts +8 -0
- package/js/src/abstract/btcbox.d.ts +1 -0
- package/js/src/abstract/myokx.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +2 -0
- package/js/src/apex.js +2 -1
- package/js/src/ascendex.d.ts +2 -0
- package/js/src/ascendex.js +189 -155
- package/js/src/base/Exchange.d.ts +15 -1
- package/js/src/base/Exchange.js +15 -2
- package/js/src/base/types.d.ts +3 -0
- package/js/src/bequant.js +1 -1
- package/js/src/bitget.js +6 -7
- package/js/src/bitmart.js +1 -1
- package/js/src/bitrue.js +14 -35
- package/js/src/bitso.js +33 -0
- package/js/src/bitstamp.js +33 -0
- package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
- package/js/src/{huobijp.js → bittrade.js} +35 -35
- package/js/src/blofin.d.ts +42 -2
- package/js/src/blofin.js +154 -13
- package/js/src/btcbox.js +25 -5
- package/js/src/bybit.js +16 -40
- package/js/src/cex.js +2 -4
- package/js/src/coinbase.js +58 -46
- package/js/src/coinbaseexchange.js +142 -32
- package/js/src/coincatch.js +14 -67
- package/js/src/coinex.js +28 -29
- package/js/src/coinlist.js +16 -15
- package/js/src/coinmetro.js +22 -11
- package/js/src/coinone.js +8 -10
- package/js/src/coinsph.d.ts +10 -1
- package/js/src/coinsph.js +126 -1
- package/js/src/cryptocom.d.ts +10 -1
- package/js/src/cryptocom.js +111 -1
- package/js/src/cryptomus.js +43 -89
- package/js/src/delta.js +76 -36
- package/js/src/deribit.js +4 -5
- package/js/src/derive.js +46 -10
- package/js/src/ellipx.d.ts +2 -3
- package/js/src/ellipx.js +175 -80
- package/js/src/gate.js +1 -1
- package/js/src/gemini.js +3 -5
- package/js/src/hitbtc.js +56 -69
- package/js/src/hollaex.js +107 -49
- package/js/src/htx.js +20 -44
- package/js/src/hyperliquid.js +6 -6
- package/js/src/kraken.js +29 -24
- package/js/src/kucoinfutures.d.ts +1 -0
- package/js/src/kucoinfutures.js +6 -0
- package/js/src/lbank.js +1 -1
- package/js/src/mexc.js +2 -2
- package/js/src/ndax.js +25 -24
- package/js/src/okcoin.js +12 -31
- package/js/src/okx.js +9 -0
- package/js/src/onetrading.js +9 -6
- package/js/src/oxfun.js +42 -114
- package/js/src/paradex.d.ts +12 -1
- package/js/src/paradex.js +124 -4
- package/js/src/pro/binance.d.ts +26 -26
- package/js/src/pro/binance.js +32 -33
- package/js/src/pro/bithumb.js +5 -3
- package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
- package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
- package/js/src/pro/kraken.d.ts +7 -6
- package/js/src/pro/kraken.js +290 -80
- package/js/src/pro/luno.js +6 -5
- package/js/src/pro/mexc.d.ts +58 -0
- package/js/src/pro/mexc.js +304 -7
- package/js/src/pro/poloniex.d.ts +1 -1
- package/js/src/pro/poloniex.js +6 -2
- package/package.json +1 -1
- package/js/src/abstract/bl3p.d.ts +0 -22
- package/js/src/abstract/huobijp.js +0 -11
- package/js/src/abstract/idex.d.ts +0 -29
- package/js/src/abstract/idex.js +0 -11
- package/js/src/abstract/kuna.d.ts +0 -185
- package/js/src/abstract/kuna.js +0 -11
- package/js/src/bl3p.d.ts +0 -116
- package/js/src/bl3p.js +0 -552
- package/js/src/idex.d.ts +0 -312
- package/js/src/idex.js +0 -1961
- package/js/src/kuna.d.ts +0 -335
- package/js/src/kuna.js +0 -2006
- package/js/src/pro/idex.d.ts +0 -81
- package/js/src/pro/idex.js +0 -720
- /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
- /package/js/src/abstract/{bl3p.js → bittrade.js} +0 -0
|
@@ -1531,6 +1531,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1531
1531
|
* @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
|
1532
1532
|
* @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
|
|
1533
1533
|
* @param {float} [params.cost] the cost of the order in units of USDT
|
|
1534
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', default is 'isolated'
|
|
1534
1535
|
* ----------------- Exchange Specific Parameters -----------------
|
|
1535
1536
|
* @param {float} [params.leverage] Leverage size of the order (mandatory param in request, default is 1)
|
|
1536
1537
|
* @param {string} [params.clientOid] client order id, defaults to uuid if not passed
|
|
@@ -1634,6 +1635,11 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1634
1635
|
'type': type,
|
|
1635
1636
|
'leverage': 1,
|
|
1636
1637
|
};
|
|
1638
|
+
const marginModeUpper = this.safeStringUpper(params, 'marginMode');
|
|
1639
|
+
if (marginModeUpper !== undefined) {
|
|
1640
|
+
params = this.omit(params, 'marginMode');
|
|
1641
|
+
request['marginMode'] = marginModeUpper;
|
|
1642
|
+
}
|
|
1637
1643
|
const cost = this.safeString(params, 'cost');
|
|
1638
1644
|
params = this.omit(params, 'cost');
|
|
1639
1645
|
if (cost !== undefined) {
|
package/dist/cjs/src/lbank.js
CHANGED
|
@@ -876,7 +876,7 @@ class lbank extends lbank$1 {
|
|
|
876
876
|
if (market['swap']) {
|
|
877
877
|
return this.parseOrderBook(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'volume');
|
|
878
878
|
}
|
|
879
|
-
return this.parseOrderBook(orderbook, market['symbol'], timestamp);
|
|
879
|
+
return this.parseOrderBook(orderbook, market['symbol'], timestamp, 'bids', 'asks', 1, 0);
|
|
880
880
|
}
|
|
881
881
|
parseTrade(trade, market = undefined) {
|
|
882
882
|
//
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -1087,7 +1087,6 @@ class mexc extends mexc$1 {
|
|
|
1087
1087
|
const currency = response[i];
|
|
1088
1088
|
const id = this.safeString(currency, 'coin');
|
|
1089
1089
|
const code = this.safeCurrencyCode(id);
|
|
1090
|
-
const name = this.safeString(currency, 'name');
|
|
1091
1090
|
const networks = {};
|
|
1092
1091
|
const chains = this.safeValue(currency, 'networkList', []);
|
|
1093
1092
|
for (let j = 0; j < chains.length; j++) {
|
|
@@ -1109,13 +1108,14 @@ class mexc extends mexc$1 {
|
|
|
1109
1108
|
'max': this.safeString(chain, 'withdrawMax'),
|
|
1110
1109
|
},
|
|
1111
1110
|
},
|
|
1111
|
+
'contract': this.safeString(chain, 'contract'),
|
|
1112
1112
|
};
|
|
1113
1113
|
}
|
|
1114
1114
|
result[code] = this.safeCurrencyStructure({
|
|
1115
1115
|
'info': currency,
|
|
1116
1116
|
'id': id,
|
|
1117
1117
|
'code': code,
|
|
1118
|
-
'name': name,
|
|
1118
|
+
'name': this.safeString(currency, 'name'),
|
|
1119
1119
|
'active': undefined,
|
|
1120
1120
|
'deposit': undefined,
|
|
1121
1121
|
'withdraw': undefined,
|
package/dist/cjs/src/ndax.js
CHANGED
|
@@ -452,45 +452,45 @@ class ndax extends ndax$1 {
|
|
|
452
452
|
};
|
|
453
453
|
const response = await this.publicGetGetProducts(this.extend(request, params));
|
|
454
454
|
//
|
|
455
|
-
//
|
|
456
|
-
//
|
|
457
|
-
//
|
|
458
|
-
//
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
//
|
|
466
|
-
//
|
|
467
|
-
//
|
|
468
|
-
//
|
|
455
|
+
// [
|
|
456
|
+
// {
|
|
457
|
+
// "OMSId": "1",
|
|
458
|
+
// "ProductId": "1",
|
|
459
|
+
// "Product": "BTC",
|
|
460
|
+
// "ProductFullName": "Bitcoin",
|
|
461
|
+
// "MasterDataUniqueProductSymbol": "",
|
|
462
|
+
// "ProductType": "CryptoCurrency",
|
|
463
|
+
// "DecimalPlaces": "8",
|
|
464
|
+
// "TickSize": "0.0000000100000000000000000000",
|
|
465
|
+
// "DepositEnabled": true,
|
|
466
|
+
// "WithdrawEnabled": true,
|
|
467
|
+
// "NoFees": false,
|
|
468
|
+
// "IsDisabled": false,
|
|
469
|
+
// "MarginEnabled": false
|
|
470
|
+
// },
|
|
471
|
+
// ...
|
|
469
472
|
//
|
|
470
473
|
const result = {};
|
|
471
474
|
for (let i = 0; i < response.length; i++) {
|
|
472
475
|
const currency = response[i];
|
|
473
476
|
const id = this.safeString(currency, 'ProductId');
|
|
474
|
-
const
|
|
477
|
+
const code = this.safeCurrencyCode(this.safeString(currency, 'Product'));
|
|
475
478
|
const ProductType = this.safeString(currency, 'ProductType');
|
|
476
479
|
let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
|
|
477
480
|
if (ProductType === 'Unknown') {
|
|
478
481
|
// such currency is just a blanket entry
|
|
479
482
|
type = 'other';
|
|
480
483
|
}
|
|
481
|
-
|
|
482
|
-
const isDisabled = this.safeValue(currency, 'IsDisabled');
|
|
483
|
-
const active = !isDisabled;
|
|
484
|
-
result[code] = {
|
|
484
|
+
result[code] = this.safeCurrencyStructure({
|
|
485
485
|
'id': id,
|
|
486
|
-
'name':
|
|
486
|
+
'name': this.safeString(currency, 'ProductFullName'),
|
|
487
487
|
'code': code,
|
|
488
488
|
'type': type,
|
|
489
489
|
'precision': this.safeNumber(currency, 'TickSize'),
|
|
490
490
|
'info': currency,
|
|
491
|
-
'active':
|
|
492
|
-
'deposit':
|
|
493
|
-
'withdraw':
|
|
491
|
+
'active': !this.safeBool(currency, 'IsDisabled'),
|
|
492
|
+
'deposit': this.safeBool(currency, 'DepositEnabled'),
|
|
493
|
+
'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
|
|
494
494
|
'fee': undefined,
|
|
495
495
|
'limits': {
|
|
496
496
|
'amount': {
|
|
@@ -503,7 +503,8 @@ class ndax extends ndax$1 {
|
|
|
503
503
|
},
|
|
504
504
|
},
|
|
505
505
|
'networks': {},
|
|
506
|
-
|
|
506
|
+
'margin': this.safeBool(currency, 'MarginEnabled'),
|
|
507
|
+
});
|
|
507
508
|
}
|
|
508
509
|
return result;
|
|
509
510
|
}
|
package/dist/cjs/src/okcoin.js
CHANGED
|
@@ -826,49 +826,30 @@ class okcoin extends okcoin$1 {
|
|
|
826
826
|
}
|
|
827
827
|
else {
|
|
828
828
|
const response = await this.privateGetAssetCurrencies(params);
|
|
829
|
-
const data = this.
|
|
829
|
+
const data = this.safeList(response, 'data', []);
|
|
830
830
|
const result = {};
|
|
831
831
|
const dataByCurrencyId = this.groupBy(data, 'ccy');
|
|
832
832
|
const currencyIds = Object.keys(dataByCurrencyId);
|
|
833
833
|
for (let i = 0; i < currencyIds.length; i++) {
|
|
834
834
|
const currencyId = currencyIds[i];
|
|
835
|
-
const
|
|
836
|
-
const code = currency['code'];
|
|
835
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
837
836
|
const chains = dataByCurrencyId[currencyId];
|
|
838
837
|
const networks = {};
|
|
839
|
-
let currencyActive = false;
|
|
840
|
-
let depositEnabled = false;
|
|
841
|
-
let withdrawEnabled = false;
|
|
842
|
-
let maxPrecision = undefined;
|
|
843
838
|
for (let j = 0; j < chains.length; j++) {
|
|
844
839
|
const chain = chains[j];
|
|
845
|
-
const canDeposit = this.safeValue(chain, 'canDep');
|
|
846
|
-
depositEnabled = (canDeposit) ? canDeposit : depositEnabled;
|
|
847
|
-
const canWithdraw = this.safeValue(chain, 'canWd');
|
|
848
|
-
withdrawEnabled = (canWithdraw) ? canWithdraw : withdrawEnabled;
|
|
849
|
-
const canInternal = this.safeValue(chain, 'canInternal');
|
|
850
|
-
const active = (canDeposit && canWithdraw && canInternal) ? true : false;
|
|
851
|
-
currencyActive = (active) ? active : currencyActive;
|
|
852
840
|
const networkId = this.safeString(chain, 'chain');
|
|
853
841
|
if ((networkId !== undefined) && (networkId.indexOf('-') >= 0)) {
|
|
854
842
|
const parts = networkId.split('-');
|
|
855
843
|
const chainPart = this.safeString(parts, 1, networkId);
|
|
856
844
|
const networkCode = this.networkIdToCode(chainPart);
|
|
857
|
-
const precision = this.parsePrecision(this.safeString(chain, 'wdTickSz'));
|
|
858
|
-
if (maxPrecision === undefined) {
|
|
859
|
-
maxPrecision = precision;
|
|
860
|
-
}
|
|
861
|
-
else {
|
|
862
|
-
maxPrecision = Precise["default"].stringMin(maxPrecision, precision);
|
|
863
|
-
}
|
|
864
845
|
networks[networkCode] = {
|
|
865
846
|
'id': networkId,
|
|
866
847
|
'network': networkCode,
|
|
867
|
-
'active':
|
|
868
|
-
'deposit':
|
|
869
|
-
'withdraw':
|
|
848
|
+
'active': undefined,
|
|
849
|
+
'deposit': this.safeBool(chain, 'canDep'),
|
|
850
|
+
'withdraw': this.safeBool(chain, 'canWd'),
|
|
870
851
|
'fee': this.safeNumber(chain, 'minFee'),
|
|
871
|
-
'precision': this.parseNumber(
|
|
852
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
|
|
872
853
|
'limits': {
|
|
873
854
|
'withdraw': {
|
|
874
855
|
'min': this.safeNumber(chain, 'minWd'),
|
|
@@ -880,16 +861,16 @@ class okcoin extends okcoin$1 {
|
|
|
880
861
|
}
|
|
881
862
|
}
|
|
882
863
|
const firstChain = this.safeValue(chains, 0);
|
|
883
|
-
result[code] = {
|
|
864
|
+
result[code] = this.safeCurrencyStructure({
|
|
884
865
|
'info': chains,
|
|
885
866
|
'code': code,
|
|
886
867
|
'id': currencyId,
|
|
887
868
|
'name': this.safeString(firstChain, 'name'),
|
|
888
|
-
'active':
|
|
889
|
-
'deposit':
|
|
890
|
-
'withdraw':
|
|
869
|
+
'active': undefined,
|
|
870
|
+
'deposit': undefined,
|
|
871
|
+
'withdraw': undefined,
|
|
891
872
|
'fee': undefined,
|
|
892
|
-
'precision':
|
|
873
|
+
'precision': undefined,
|
|
893
874
|
'limits': {
|
|
894
875
|
'amount': {
|
|
895
876
|
'min': undefined,
|
|
@@ -897,7 +878,7 @@ class okcoin extends okcoin$1 {
|
|
|
897
878
|
},
|
|
898
879
|
},
|
|
899
880
|
'networks': networks,
|
|
900
|
-
};
|
|
881
|
+
});
|
|
901
882
|
}
|
|
902
883
|
return result;
|
|
903
884
|
}
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -363,6 +363,7 @@ class okx extends okx$1 {
|
|
|
363
363
|
'account/spot-manual-borrow-repay': 10,
|
|
364
364
|
'account/set-auto-repay': 4,
|
|
365
365
|
'account/spot-borrow-repay-history': 4,
|
|
366
|
+
'account/move-positions-history': 10,
|
|
366
367
|
// subaccount
|
|
367
368
|
'users/subaccount/list': 10,
|
|
368
369
|
'account/subaccount/balances': 10 / 3,
|
|
@@ -500,6 +501,7 @@ class okx extends okx$1 {
|
|
|
500
501
|
'account/fixed-loan/manual-reborrow': 5,
|
|
501
502
|
'account/fixed-loan/repay-borrowing-order': 5,
|
|
502
503
|
'account/bills-history-archive': 72000,
|
|
504
|
+
'account/move-positions': 10,
|
|
503
505
|
// subaccount
|
|
504
506
|
'users/subaccount/modify-apikey': 10,
|
|
505
507
|
'asset/subaccount/transfer': 10,
|
|
@@ -966,6 +968,13 @@ class okx extends okx$1 {
|
|
|
966
968
|
'70010': errors.BadRequest,
|
|
967
969
|
'70013': errors.BadRequest,
|
|
968
970
|
'70016': errors.BadRequest,
|
|
971
|
+
'70060': errors.BadRequest,
|
|
972
|
+
'70061': errors.BadRequest,
|
|
973
|
+
'70062': errors.BadRequest,
|
|
974
|
+
'70064': errors.BadRequest,
|
|
975
|
+
'70065': errors.BadRequest,
|
|
976
|
+
'70066': errors.BadRequest,
|
|
977
|
+
'70067': errors.BadRequest,
|
|
969
978
|
'1009': errors.BadRequest,
|
|
970
979
|
'4001': errors.AuthenticationError,
|
|
971
980
|
'4002': errors.BadRequest,
|
|
@@ -392,9 +392,12 @@ class onetrading extends onetrading$1 {
|
|
|
392
392
|
//
|
|
393
393
|
// [
|
|
394
394
|
// {
|
|
395
|
-
// "code":"
|
|
396
|
-
// "precision":
|
|
397
|
-
//
|
|
395
|
+
// "code": "USDT",
|
|
396
|
+
// "precision": 6,
|
|
397
|
+
// "unified_cryptoasset_id": 825,
|
|
398
|
+
// "name": "Tether USDt",
|
|
399
|
+
// "collateral_percentage": 0
|
|
400
|
+
// },
|
|
398
401
|
// ]
|
|
399
402
|
//
|
|
400
403
|
const result = {};
|
|
@@ -402,10 +405,10 @@ class onetrading extends onetrading$1 {
|
|
|
402
405
|
const currency = response[i];
|
|
403
406
|
const id = this.safeString(currency, 'code');
|
|
404
407
|
const code = this.safeCurrencyCode(id);
|
|
405
|
-
result[code] = {
|
|
408
|
+
result[code] = this.safeCurrencyStructure({
|
|
406
409
|
'id': id,
|
|
407
410
|
'code': code,
|
|
408
|
-
'name':
|
|
411
|
+
'name': this.safeString(currency, 'name'),
|
|
409
412
|
'info': currency,
|
|
410
413
|
'active': undefined,
|
|
411
414
|
'fee': undefined,
|
|
@@ -417,7 +420,7 @@ class onetrading extends onetrading$1 {
|
|
|
417
420
|
'withdraw': { 'min': undefined, 'max': undefined },
|
|
418
421
|
},
|
|
419
422
|
'networks': {},
|
|
420
|
-
};
|
|
423
|
+
});
|
|
421
424
|
}
|
|
422
425
|
return result;
|
|
423
426
|
}
|
package/dist/cjs/src/oxfun.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var oxfun$1 = require('./abstract/oxfun.js');
|
|
4
|
-
var Precise = require('./base/Precise.js');
|
|
5
4
|
var errors = require('./base/errors.js');
|
|
6
5
|
var number = require('./base/functions/number.js');
|
|
7
6
|
var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
|
|
@@ -599,66 +598,7 @@ class oxfun extends oxfun$1 {
|
|
|
599
598
|
// "minDeposit": "0.00010",
|
|
600
599
|
// "minWithdrawal": "0.00010"
|
|
601
600
|
// },
|
|
602
|
-
//
|
|
603
|
-
// "network": "Arbitrum",
|
|
604
|
-
// "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
|
|
605
|
-
// "transactionPrecision": "18",
|
|
606
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
607
|
-
// "canDeposit": true,
|
|
608
|
-
// "canWithdraw": true,
|
|
609
|
-
// "minDeposit": "0.00010",
|
|
610
|
-
// "minWithdrawal": "0.00010"
|
|
611
|
-
// },
|
|
612
|
-
// {
|
|
613
|
-
// "network": "Ethereum",
|
|
614
|
-
// "tokenId": "0xba0Dda8762C24dA9487f5FA026a9B64b695A07Ea",
|
|
615
|
-
// "transactionPrecision": "18",
|
|
616
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
617
|
-
// "canDeposit": true,
|
|
618
|
-
// "canWithdraw": true,
|
|
619
|
-
// "minDeposit": "0.00010",
|
|
620
|
-
// "minWithdrawal": "0.00010"
|
|
621
|
-
// },
|
|
622
|
-
// {
|
|
623
|
-
// "network": "Arbitrum",
|
|
624
|
-
// "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
|
|
625
|
-
// "transactionPrecision": "18",
|
|
626
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
627
|
-
// "canDeposit": true,
|
|
628
|
-
// "canWithdraw": false,
|
|
629
|
-
// "minDeposit": "0.00010",
|
|
630
|
-
// "minWithdrawal": "0.00010"
|
|
631
|
-
// },
|
|
632
|
-
// {
|
|
633
|
-
// "network": "Avalanche",
|
|
634
|
-
// "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
|
|
635
|
-
// "transactionPrecision": "18",
|
|
636
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
637
|
-
// "canDeposit": true,
|
|
638
|
-
// "canWithdraw": false,
|
|
639
|
-
// "minDeposit": "0.00010",
|
|
640
|
-
// "minWithdrawal": "0.00010"
|
|
641
|
-
// },
|
|
642
|
-
// {
|
|
643
|
-
// "network": "Solana",
|
|
644
|
-
// "tokenId": "DV3845GEAVXfwpyVGGgWbqBVCtzHdCXNCGfcdboSEuZz",
|
|
645
|
-
// "transactionPrecision": "8",
|
|
646
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
647
|
-
// "canDeposit": true,
|
|
648
|
-
// "canWithdraw": true,
|
|
649
|
-
// "minDeposit": "0.00010",
|
|
650
|
-
// "minWithdrawal": "0.00010"
|
|
651
|
-
// },
|
|
652
|
-
// {
|
|
653
|
-
// "network": "Ethereum",
|
|
654
|
-
// "tokenId": "0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f",
|
|
655
|
-
// "transactionPrecision": "18",
|
|
656
|
-
// "isWithdrawalFeeChargedToUser": true,
|
|
657
|
-
// "canDeposit": true,
|
|
658
|
-
// "canWithdraw": false,
|
|
659
|
-
// "minDeposit": "0.00010",
|
|
660
|
-
// "minWithdrawal": "0.00010"
|
|
661
|
-
// }
|
|
601
|
+
// ...
|
|
662
602
|
// ]
|
|
663
603
|
// },
|
|
664
604
|
// {
|
|
@@ -708,79 +648,67 @@ class oxfun extends oxfun$1 {
|
|
|
708
648
|
const parts = fullId.split('.');
|
|
709
649
|
const id = parts[0];
|
|
710
650
|
const code = this.safeCurrencyCode(id);
|
|
711
|
-
|
|
651
|
+
if (!(code in result)) {
|
|
652
|
+
result[code] = {
|
|
653
|
+
'id': id,
|
|
654
|
+
'code': code,
|
|
655
|
+
'precision': undefined,
|
|
656
|
+
'type': undefined,
|
|
657
|
+
'name': undefined,
|
|
658
|
+
'active': undefined,
|
|
659
|
+
'deposit': undefined,
|
|
660
|
+
'withdraw': undefined,
|
|
661
|
+
'fee': undefined,
|
|
662
|
+
'limits': {
|
|
663
|
+
'withdraw': {
|
|
664
|
+
'min': undefined,
|
|
665
|
+
'max': undefined,
|
|
666
|
+
},
|
|
667
|
+
'deposit': {
|
|
668
|
+
'min': undefined,
|
|
669
|
+
'max': undefined,
|
|
670
|
+
},
|
|
671
|
+
},
|
|
672
|
+
'networks': {},
|
|
673
|
+
'info': [],
|
|
674
|
+
};
|
|
675
|
+
}
|
|
712
676
|
const chains = this.safeList(currency, 'networkList', []);
|
|
713
|
-
let currencyMaxPrecision = undefined;
|
|
714
|
-
let currencyDepositEnabled = undefined;
|
|
715
|
-
let currencyWithdrawEnabled = undefined;
|
|
716
677
|
for (let j = 0; j < chains.length; j++) {
|
|
717
678
|
const chain = chains[j];
|
|
718
679
|
const networkId = this.safeString(chain, 'network');
|
|
719
680
|
const networkCode = this.networkIdToCode(networkId);
|
|
720
|
-
|
|
721
|
-
const withdraw = this.safeBool(chain, 'canWithdraw');
|
|
722
|
-
const active = (deposit && withdraw);
|
|
723
|
-
const minDeposit = this.safeString(chain, 'minDeposit');
|
|
724
|
-
const minWithdrawal = this.safeString(chain, 'minWithdrawal');
|
|
725
|
-
const precision = this.parsePrecision(this.safeString(chain, 'transactionPrecision'));
|
|
726
|
-
networks[networkCode] = {
|
|
681
|
+
result[code]['networks'][networkCode] = {
|
|
727
682
|
'id': networkId,
|
|
728
683
|
'network': networkCode,
|
|
729
684
|
'margin': undefined,
|
|
730
|
-
'deposit':
|
|
731
|
-
'withdraw':
|
|
732
|
-
'active':
|
|
685
|
+
'deposit': this.safeBool(chain, 'canDeposit'),
|
|
686
|
+
'withdraw': this.safeBool(chain, 'canWithdraw'),
|
|
687
|
+
'active': undefined,
|
|
733
688
|
'fee': undefined,
|
|
734
|
-
'precision': this.parseNumber(
|
|
689
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'transactionPrecision'))),
|
|
735
690
|
'limits': {
|
|
736
691
|
'deposit': {
|
|
737
|
-
'min': minDeposit,
|
|
692
|
+
'min': this.safeNumber(chain, 'minDeposit'),
|
|
738
693
|
'max': undefined,
|
|
739
694
|
},
|
|
740
695
|
'withdraw': {
|
|
741
|
-
'min': minWithdrawal,
|
|
696
|
+
'min': this.safeNumber(chain, 'minWithdrawal'),
|
|
742
697
|
'max': undefined,
|
|
743
698
|
},
|
|
744
699
|
},
|
|
745
700
|
'info': chain,
|
|
746
701
|
};
|
|
747
|
-
if ((currencyDepositEnabled === undefined) || deposit) {
|
|
748
|
-
currencyDepositEnabled = deposit;
|
|
749
|
-
}
|
|
750
|
-
if ((currencyWithdrawEnabled === undefined) || withdraw) {
|
|
751
|
-
currencyWithdrawEnabled = withdraw;
|
|
752
|
-
}
|
|
753
|
-
if ((currencyMaxPrecision === undefined) || Precise["default"].stringGt(currencyMaxPrecision, precision)) {
|
|
754
|
-
currencyMaxPrecision = precision;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
if (code in result) {
|
|
758
|
-
// checking for specific ids as USDC.ARB
|
|
759
|
-
networks = this.extend(result[code]['networks'], networks);
|
|
760
702
|
}
|
|
761
|
-
result[code]
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
'precision': this.parseNumber(currencyMaxPrecision),
|
|
771
|
-
'limits': {
|
|
772
|
-
'amount': {
|
|
773
|
-
'min': undefined,
|
|
774
|
-
'max': undefined,
|
|
775
|
-
},
|
|
776
|
-
'withdraw': {
|
|
777
|
-
'min': undefined,
|
|
778
|
-
'max': undefined,
|
|
779
|
-
},
|
|
780
|
-
},
|
|
781
|
-
'networks': networks,
|
|
782
|
-
'info': currency,
|
|
783
|
-
};
|
|
703
|
+
const infos = this.safeList(result[code], 'info', []);
|
|
704
|
+
infos.push(currency);
|
|
705
|
+
result[code]['info'] = infos;
|
|
706
|
+
}
|
|
707
|
+
// only after all entries are formed in currencies, restructure each entry
|
|
708
|
+
const allKeys = Object.keys(result);
|
|
709
|
+
for (let i = 0; i < allKeys.length; i++) {
|
|
710
|
+
const code = allKeys[i];
|
|
711
|
+
result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
|
|
784
712
|
}
|
|
785
713
|
return result;
|
|
786
714
|
}
|