ccxt 4.5.56 → 4.5.57
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 +10 -9
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/apex.js +1 -1
- package/dist/cjs/src/arkham.js +3 -3
- package/dist/cjs/src/ascendex.js +2 -2
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +69 -32
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +3 -3
- package/dist/cjs/src/binance.js +192 -194
- package/dist/cjs/src/bingx.js +3 -3
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bitmart.js +13 -6
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +2 -2
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +2 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +0 -1
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +26 -3
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +2 -2
- package/dist/cjs/src/coinbaseinternational.js +2 -1
- package/dist/cjs/src/coinex.js +74 -74
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +1 -1
- package/dist/cjs/src/cryptocom.js +46 -48
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +3 -2
- package/dist/cjs/src/delta.js +51 -52
- package/dist/cjs/src/deribit.js +31 -33
- package/dist/cjs/src/derive.js +26 -28
- package/dist/cjs/src/digifinex.js +43 -44
- package/dist/cjs/src/exmo.js +92 -83
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +71 -75
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +41 -43
- package/dist/cjs/src/grvt.js +4 -4
- package/dist/cjs/src/hashkey.js +52 -54
- package/dist/cjs/src/hitbtc.js +3 -13
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +75 -67
- package/dist/cjs/src/hyperliquid.js +41 -42
- package/dist/cjs/src/indodax.js +2 -2
- package/dist/cjs/src/kraken.js +57 -58
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +56 -56
- package/dist/cjs/src/lighter.js +35 -37
- package/dist/cjs/src/luno.js +35 -43
- package/dist/cjs/src/mexc.js +48 -49
- package/dist/cjs/src/modetrade.js +50 -52
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +17 -2
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/phemex.js +43 -45
- package/dist/cjs/src/poloniex.js +17 -12
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +1 -1
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +2 -2
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +65 -54
- package/dist/cjs/src/woofipro.js +53 -47
- package/dist/cjs/src/xt.js +1 -1
- package/dist/cjs/src/zebpay.js +70 -72
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/apex.js +1 -1
- package/js/src/arkham.js +3 -3
- package/js/src/ascendex.js +2 -2
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +69 -32
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +3 -3
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +196 -198
- package/js/src/bingx.js +3 -3
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitget.js +2 -2
- package/js/src/bitmart.js +13 -6
- package/js/src/bitmex.js +1 -1
- package/js/src/bitopro.js +1 -1
- package/js/src/bitrue.js +2 -2
- package/js/src/bitso.js +1 -1
- package/js/src/bitstamp.js +2 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +0 -1
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +26 -3
- package/js/src/bullish.js +6 -5
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +2 -2
- package/js/src/coinbaseinternational.js +2 -1
- package/js/src/coinex.d.ts +1 -0
- package/js/src/coinex.js +74 -74
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +1 -1
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +46 -48
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +3 -2
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +51 -52
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +31 -33
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +26 -28
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +43 -44
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +92 -83
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +71 -75
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +41 -43
- package/js/src/grvt.js +4 -4
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +52 -54
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +3 -13
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +75 -67
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +41 -42
- package/js/src/indodax.js +2 -2
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +57 -58
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +56 -56
- package/js/src/lighter.d.ts +1 -0
- package/js/src/lighter.js +35 -37
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +35 -43
- package/js/src/mexc.d.ts +2 -1
- package/js/src/mexc.js +48 -49
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +50 -52
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +17 -2
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +43 -45
- package/js/src/poloniex.js +17 -12
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +1 -1
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.js +2 -2
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +65 -54
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +53 -47
- package/js/src/xt.js +1 -1
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +70 -72
- package/package.json +7 -7
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2933
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2926
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
package/js/src/mexc.js
CHANGED
|
@@ -1146,56 +1146,54 @@ export default class mexc extends Exchange {
|
|
|
1146
1146
|
// ]
|
|
1147
1147
|
// }
|
|
1148
1148
|
//
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
'active': undefined,
|
|
1165
|
-
'deposit': this.safeBool(chain, 'depositEnable', false),
|
|
1166
|
-
'withdraw': this.safeBool(chain, 'withdrawEnable', false),
|
|
1167
|
-
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1168
|
-
'precision': undefined,
|
|
1169
|
-
'limits': {
|
|
1170
|
-
'withdraw': {
|
|
1171
|
-
'min': this.safeString(chain, 'withdrawMin'),
|
|
1172
|
-
'max': this.safeString(chain, 'withdrawMax'),
|
|
1173
|
-
},
|
|
1174
|
-
},
|
|
1175
|
-
'contract': this.safeString(chain, 'contract'),
|
|
1176
|
-
};
|
|
1177
|
-
}
|
|
1178
|
-
result[code] = this.safeCurrencyStructure({
|
|
1179
|
-
'info': currency,
|
|
1180
|
-
'id': id,
|
|
1181
|
-
'code': code,
|
|
1182
|
-
'name': this.safeString(currency, 'name'),
|
|
1149
|
+
return this.parseCurrencies(response);
|
|
1150
|
+
}
|
|
1151
|
+
parseCurrency(rawCurrency) {
|
|
1152
|
+
const id = this.safeString(rawCurrency, 'coin');
|
|
1153
|
+
const code = this.safeCurrencyCode(id);
|
|
1154
|
+
const networks = {};
|
|
1155
|
+
const chains = this.safeValue(rawCurrency, 'networkList', []);
|
|
1156
|
+
for (let j = 0; j < chains.length; j++) {
|
|
1157
|
+
const chain = chains[j];
|
|
1158
|
+
const networkId = this.safeString2(chain, 'netWork', 'network');
|
|
1159
|
+
const network = this.networkIdToCode(networkId, code);
|
|
1160
|
+
networks[network] = {
|
|
1161
|
+
'info': chain,
|
|
1162
|
+
'id': networkId,
|
|
1163
|
+
'network': network,
|
|
1183
1164
|
'active': undefined,
|
|
1184
|
-
'deposit':
|
|
1185
|
-
'withdraw':
|
|
1186
|
-
'fee':
|
|
1165
|
+
'deposit': this.safeBool(chain, 'depositEnable', false),
|
|
1166
|
+
'withdraw': this.safeBool(chain, 'withdrawEnable', false),
|
|
1167
|
+
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1187
1168
|
'precision': undefined,
|
|
1188
1169
|
'limits': {
|
|
1189
|
-
'
|
|
1190
|
-
'min':
|
|
1191
|
-
'max':
|
|
1170
|
+
'withdraw': {
|
|
1171
|
+
'min': this.safeString(chain, 'withdrawMin'),
|
|
1172
|
+
'max': this.safeString(chain, 'withdrawMax'),
|
|
1192
1173
|
},
|
|
1193
1174
|
},
|
|
1194
|
-
'
|
|
1195
|
-
|
|
1196
|
-
});
|
|
1175
|
+
'contract': this.safeString(chain, 'contract'),
|
|
1176
|
+
};
|
|
1197
1177
|
}
|
|
1198
|
-
return
|
|
1178
|
+
return this.safeCurrencyStructure({
|
|
1179
|
+
'info': rawCurrency,
|
|
1180
|
+
'id': id,
|
|
1181
|
+
'code': code,
|
|
1182
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
1183
|
+
'active': undefined,
|
|
1184
|
+
'deposit': undefined,
|
|
1185
|
+
'withdraw': undefined,
|
|
1186
|
+
'fee': undefined,
|
|
1187
|
+
'precision': undefined,
|
|
1188
|
+
'limits': {
|
|
1189
|
+
'amount': {
|
|
1190
|
+
'min': undefined,
|
|
1191
|
+
'max': undefined,
|
|
1192
|
+
},
|
|
1193
|
+
},
|
|
1194
|
+
'type': 'crypto',
|
|
1195
|
+
'networks': networks,
|
|
1196
|
+
});
|
|
1199
1197
|
}
|
|
1200
1198
|
/**
|
|
1201
1199
|
* @method
|
|
@@ -1533,7 +1531,7 @@ export default class mexc extends Exchange {
|
|
|
1533
1531
|
}
|
|
1534
1532
|
return orderbook;
|
|
1535
1533
|
}
|
|
1536
|
-
|
|
1534
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
1537
1535
|
const countKey = 2;
|
|
1538
1536
|
const price = this.safeNumber(bidask, priceKey);
|
|
1539
1537
|
const amount = this.safeNumber(bidask, amountKey);
|
|
@@ -4763,11 +4761,12 @@ export default class mexc extends Exchange {
|
|
|
4763
4761
|
//
|
|
4764
4762
|
const address = this.safeString(depositAddress, 'address');
|
|
4765
4763
|
const currencyId = this.safeString(depositAddress, 'coin');
|
|
4764
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4766
4765
|
const networkId = this.safeString(depositAddress, 'netWork');
|
|
4767
4766
|
return {
|
|
4768
4767
|
'info': depositAddress,
|
|
4769
|
-
'currency':
|
|
4770
|
-
'network': this.networkIdToCode(networkId,
|
|
4768
|
+
'currency': code,
|
|
4769
|
+
'network': this.networkIdToCode(networkId, code),
|
|
4771
4770
|
'address': address,
|
|
4772
4771
|
'tag': this.safeString(depositAddress, 'memo'),
|
|
4773
4772
|
};
|
|
@@ -5086,12 +5085,12 @@ export default class mexc extends Exchange {
|
|
|
5086
5085
|
if (currencyWithNetwork !== undefined) {
|
|
5087
5086
|
currencyId = currencyWithNetwork.split('-')[0];
|
|
5088
5087
|
}
|
|
5088
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
5089
5089
|
let network = undefined;
|
|
5090
5090
|
const rawNetwork = this.safeString(transaction, 'network');
|
|
5091
5091
|
if (rawNetwork !== undefined) {
|
|
5092
|
-
network = this.networkIdToCode(rawNetwork);
|
|
5092
|
+
network = this.networkIdToCode(rawNetwork, code);
|
|
5093
5093
|
}
|
|
5094
|
-
const code = this.safeCurrencyCode(currencyId, currency);
|
|
5095
5094
|
const status = this.parseTransactionStatusByType(this.safeString(transaction, 'status'), type);
|
|
5096
5095
|
let amountString = this.safeString(transaction, 'amount');
|
|
5097
5096
|
const address = this.safeString(transaction, 'address');
|
package/js/src/modetrade.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export default class modetrade extends Exchange {
|
|
|
50
50
|
* @returns {object} an associative dictionary of currencies
|
|
51
51
|
*/
|
|
52
52
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
53
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
53
54
|
parseTokenAndFeeTemp(item: any, feeTokenKey: any, feeAmountKey: any): any;
|
|
54
55
|
parseTrade(trade: Dict, market?: Market): Trade;
|
|
55
56
|
/**
|
package/js/src/modetrade.js
CHANGED
|
@@ -625,7 +625,6 @@ export default class modetrade extends Exchange {
|
|
|
625
625
|
* @returns {object} an associative dictionary of currencies
|
|
626
626
|
*/
|
|
627
627
|
async fetchCurrencies(params = {}) {
|
|
628
|
-
const result = {};
|
|
629
628
|
const response = await this.v1PublicGetPublicToken(params);
|
|
630
629
|
//
|
|
631
630
|
// {
|
|
@@ -651,66 +650,65 @@ export default class modetrade extends Exchange {
|
|
|
651
650
|
//
|
|
652
651
|
const data = this.safeDict(response, 'data', {});
|
|
653
652
|
const tokenRows = this.safeList(data, 'rows', []);
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
resultingNetworks[networkId] = {
|
|
670
|
-
'id': networkId,
|
|
671
|
-
'network': networkId,
|
|
672
|
-
'limits': {
|
|
673
|
-
'withdraw': {
|
|
674
|
-
'min': undefined,
|
|
675
|
-
'max': undefined,
|
|
676
|
-
},
|
|
677
|
-
'deposit': {
|
|
678
|
-
'min': undefined,
|
|
679
|
-
'max': undefined,
|
|
680
|
-
},
|
|
681
|
-
},
|
|
682
|
-
'active': undefined,
|
|
683
|
-
'deposit': undefined,
|
|
684
|
-
'withdraw': undefined,
|
|
685
|
-
'fee': this.safeNumber(network, 'withdrawal_fee'),
|
|
686
|
-
'precision': this.parseNumber(precision),
|
|
687
|
-
'info': network,
|
|
688
|
-
};
|
|
653
|
+
return this.parseCurrencies(tokenRows);
|
|
654
|
+
}
|
|
655
|
+
parseCurrency(rawCurrency) {
|
|
656
|
+
const currencyId = this.safeString(rawCurrency, 'token');
|
|
657
|
+
const networks = this.safeList(rawCurrency, 'chain_details');
|
|
658
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
659
|
+
let minPrecision = undefined;
|
|
660
|
+
const resultingNetworks = {};
|
|
661
|
+
for (let j = 0; j < networks.length; j++) {
|
|
662
|
+
const network = networks[j];
|
|
663
|
+
// TODO: transform chain id to human readable name
|
|
664
|
+
const networkId = this.safeString(network, 'chain_id');
|
|
665
|
+
const precision = this.parsePrecision(this.safeString(network, 'decimals'));
|
|
666
|
+
if (precision !== undefined) {
|
|
667
|
+
minPrecision = (minPrecision === undefined) ? precision : Precise.stringMin(precision, minPrecision);
|
|
689
668
|
}
|
|
690
|
-
|
|
691
|
-
'id':
|
|
692
|
-
'
|
|
693
|
-
'code': code,
|
|
694
|
-
'precision': this.parseNumber(minPrecision),
|
|
695
|
-
'active': undefined,
|
|
696
|
-
'fee': undefined,
|
|
697
|
-
'networks': resultingNetworks,
|
|
698
|
-
'deposit': undefined,
|
|
699
|
-
'withdraw': undefined,
|
|
669
|
+
resultingNetworks[networkId] = {
|
|
670
|
+
'id': networkId,
|
|
671
|
+
'network': networkId,
|
|
700
672
|
'limits': {
|
|
701
|
-
'
|
|
673
|
+
'withdraw': {
|
|
702
674
|
'min': undefined,
|
|
703
675
|
'max': undefined,
|
|
704
676
|
},
|
|
705
|
-
'
|
|
706
|
-
'min':
|
|
677
|
+
'deposit': {
|
|
678
|
+
'min': undefined,
|
|
707
679
|
'max': undefined,
|
|
708
680
|
},
|
|
709
681
|
},
|
|
710
|
-
'
|
|
711
|
-
|
|
682
|
+
'active': undefined,
|
|
683
|
+
'deposit': undefined,
|
|
684
|
+
'withdraw': undefined,
|
|
685
|
+
'fee': this.safeNumber(network, 'withdrawal_fee'),
|
|
686
|
+
'precision': this.parseNumber(precision),
|
|
687
|
+
'info': network,
|
|
688
|
+
};
|
|
712
689
|
}
|
|
713
|
-
return
|
|
690
|
+
return this.safeCurrencyStructure({
|
|
691
|
+
'id': currencyId,
|
|
692
|
+
'name': currencyId,
|
|
693
|
+
'code': code,
|
|
694
|
+
'precision': this.parseNumber(minPrecision),
|
|
695
|
+
'active': undefined,
|
|
696
|
+
'fee': undefined,
|
|
697
|
+
'networks': resultingNetworks,
|
|
698
|
+
'deposit': undefined,
|
|
699
|
+
'withdraw': undefined,
|
|
700
|
+
'limits': {
|
|
701
|
+
'deposit': {
|
|
702
|
+
'min': undefined,
|
|
703
|
+
'max': undefined,
|
|
704
|
+
},
|
|
705
|
+
'withdraw': {
|
|
706
|
+
'min': this.safeNumber(rawCurrency, 'minimum_withdraw_amount'),
|
|
707
|
+
'max': undefined,
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
'info': rawCurrency,
|
|
711
|
+
});
|
|
714
712
|
}
|
|
715
713
|
parseTokenAndFeeTemp(item, feeTokenKey, feeAmountKey) {
|
|
716
714
|
const feeCost = this.safeString(item, feeAmountKey);
|
package/js/src/ndax.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export default class ndax extends Exchange {
|
|
|
24
24
|
* @returns {object} an associative dictionary of currencies
|
|
25
25
|
*/
|
|
26
26
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
27
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
27
28
|
/**
|
|
28
29
|
* @method
|
|
29
30
|
* @name ndax#fetchMarkets
|
package/js/src/ndax.js
CHANGED
|
@@ -475,43 +475,41 @@ export default class ndax extends Exchange {
|
|
|
475
475
|
// },
|
|
476
476
|
// ...
|
|
477
477
|
//
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
result[code] = this.safeCurrencyStructure({
|
|
490
|
-
'id': id,
|
|
491
|
-
'name': this.safeString(currency, 'ProductFullName'),
|
|
492
|
-
'code': code,
|
|
493
|
-
'type': type,
|
|
494
|
-
'precision': this.safeNumber(currency, 'TickSize'),
|
|
495
|
-
'info': currency,
|
|
496
|
-
'active': !this.safeBool(currency, 'IsDisabled'),
|
|
497
|
-
'deposit': this.safeBool(currency, 'DepositEnabled'),
|
|
498
|
-
'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
|
|
499
|
-
'fee': undefined,
|
|
500
|
-
'limits': {
|
|
501
|
-
'amount': {
|
|
502
|
-
'min': undefined,
|
|
503
|
-
'max': undefined,
|
|
504
|
-
},
|
|
505
|
-
'withdraw': {
|
|
506
|
-
'min': undefined,
|
|
507
|
-
'max': undefined,
|
|
508
|
-
},
|
|
509
|
-
},
|
|
510
|
-
'networks': {},
|
|
511
|
-
'margin': this.safeBool(currency, 'MarginEnabled'),
|
|
512
|
-
});
|
|
478
|
+
return this.parseCurrencies(response);
|
|
479
|
+
}
|
|
480
|
+
parseCurrency(rawCurrency) {
|
|
481
|
+
const id = this.safeString(rawCurrency, 'ProductId');
|
|
482
|
+
const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'Product'));
|
|
483
|
+
const ProductType = this.safeString(rawCurrency, 'ProductType');
|
|
484
|
+
let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
|
|
485
|
+
if (ProductType === 'Unknown') {
|
|
486
|
+
// such currency is just a blanket entry
|
|
487
|
+
type = 'other';
|
|
513
488
|
}
|
|
514
|
-
return
|
|
489
|
+
return this.safeCurrencyStructure({
|
|
490
|
+
'id': id,
|
|
491
|
+
'name': this.safeString(rawCurrency, 'ProductFullName'),
|
|
492
|
+
'code': code,
|
|
493
|
+
'type': type,
|
|
494
|
+
'precision': this.safeNumber(rawCurrency, 'TickSize'),
|
|
495
|
+
'info': rawCurrency,
|
|
496
|
+
'active': !this.safeBool(rawCurrency, 'IsDisabled'),
|
|
497
|
+
'deposit': this.safeBool(rawCurrency, 'DepositEnabled'),
|
|
498
|
+
'withdraw': this.safeBool(rawCurrency, 'WithdrawEnabled'),
|
|
499
|
+
'fee': undefined,
|
|
500
|
+
'limits': {
|
|
501
|
+
'amount': {
|
|
502
|
+
'min': undefined,
|
|
503
|
+
'max': undefined,
|
|
504
|
+
},
|
|
505
|
+
'withdraw': {
|
|
506
|
+
'min': undefined,
|
|
507
|
+
'max': undefined,
|
|
508
|
+
},
|
|
509
|
+
},
|
|
510
|
+
'networks': {},
|
|
511
|
+
'margin': this.safeBool(rawCurrency, 'MarginEnabled'),
|
|
512
|
+
});
|
|
515
513
|
}
|
|
516
514
|
/**
|
|
517
515
|
* @method
|
|
@@ -661,7 +659,7 @@ export default class ndax extends Exchange {
|
|
|
661
659
|
const newNonce = this.safeInteger(level, 0);
|
|
662
660
|
nonce = Math.max(nonce, newNonce);
|
|
663
661
|
}
|
|
664
|
-
const bidask = this.
|
|
662
|
+
const bidask = this.parseOrderBookBidAsk(level, priceKey, amountKey);
|
|
665
663
|
const levelSide = this.safeInteger(level, 9);
|
|
666
664
|
const side = levelSide ? asksKey : bidsKey;
|
|
667
665
|
const resultSide = result[side];
|
package/js/src/okx.js
CHANGED
|
@@ -1512,7 +1512,18 @@ export default class okx extends Exchange {
|
|
|
1512
1512
|
};
|
|
1513
1513
|
}
|
|
1514
1514
|
safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
|
|
1515
|
-
|
|
1515
|
+
let isOption = false;
|
|
1516
|
+
if (marketId !== undefined) {
|
|
1517
|
+
const parts = marketId.split('-');
|
|
1518
|
+
const partsLength = parts.length;
|
|
1519
|
+
// a valid OKX option ends with the call/put flag and carries expiry+strike segments,
|
|
1520
|
+
// e.g. the market id BTC-USD-220325-194000-P (5 parts) or the unified symbol
|
|
1521
|
+
// BTC/USD:USD-260611-54000-C (4 parts). Requiring more than 3 dash-separated parts avoids
|
|
1522
|
+
// misclassifying ordinary ids that merely contain "-C"/"-P" (such as a SPOT id like
|
|
1523
|
+
// "PERFTESTA-PERFTESTB") as expired options, which would crash createExpiredOptionMarket
|
|
1524
|
+
// on the missing expiry.
|
|
1525
|
+
isOption = (partsLength > 3) && (marketId.endsWith('-C') || marketId.endsWith('-P'));
|
|
1526
|
+
}
|
|
1516
1527
|
if (isOption && !(marketId in this.markets_by_id)) {
|
|
1517
1528
|
// handle expired option contracts
|
|
1518
1529
|
return this.createExpiredOptionMarket(marketId);
|
|
@@ -1933,6 +1944,10 @@ export default class okx extends Exchange {
|
|
|
1933
1944
|
const marketsWithoutTest = [];
|
|
1934
1945
|
for (let i = 0; i < dataResponse.length; i++) {
|
|
1935
1946
|
const data = dataResponse[i];
|
|
1947
|
+
const instId = this.safeString(data, 'instId', '');
|
|
1948
|
+
if (instId === '') {
|
|
1949
|
+
continue; // skip broken "preopen" placeholder instruments that have no instId
|
|
1950
|
+
}
|
|
1936
1951
|
if (this.isSandboxModeEnabled) {
|
|
1937
1952
|
const instFamily = this.safeString(data, 'instFamily', '');
|
|
1938
1953
|
if (instFamily.startsWith('TEST')) {
|
|
@@ -9203,7 +9218,7 @@ export default class okx extends Exchange {
|
|
|
9203
9218
|
request['end'] = until;
|
|
9204
9219
|
}
|
|
9205
9220
|
if (timeframe !== undefined) {
|
|
9206
|
-
request['period'] = timeframe;
|
|
9221
|
+
request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
|
|
9207
9222
|
}
|
|
9208
9223
|
if (since !== undefined) {
|
|
9209
9224
|
request['begin'] = since;
|
package/js/src/onetrading.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/onetrading.js';
|
|
2
|
-
import type { Balances, Currencies, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, int } from './base/types.js';
|
|
2
|
+
import type { Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, int } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class onetrading
|
|
5
5
|
* @augments Exchange
|
|
@@ -24,6 +24,7 @@ export default class onetrading extends Exchange {
|
|
|
24
24
|
* @returns {object} an associative dictionary of currencies
|
|
25
25
|
*/
|
|
26
26
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
27
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
27
28
|
/**
|
|
28
29
|
* @method
|
|
29
30
|
* @name onetrading#fetchMarkets
|
package/js/src/onetrading.js
CHANGED
|
@@ -430,29 +430,27 @@ export default class onetrading extends Exchange {
|
|
|
430
430
|
// },
|
|
431
431
|
// ]
|
|
432
432
|
//
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
return result;
|
|
433
|
+
return this.parseCurrencies(response);
|
|
434
|
+
}
|
|
435
|
+
parseCurrency(rawCurrency) {
|
|
436
|
+
const id = this.safeString(rawCurrency, 'code');
|
|
437
|
+
const code = this.safeCurrencyCode(id);
|
|
438
|
+
return this.safeCurrencyStructure({
|
|
439
|
+
'id': id,
|
|
440
|
+
'code': code,
|
|
441
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
442
|
+
'info': rawCurrency,
|
|
443
|
+
'active': undefined,
|
|
444
|
+
'fee': undefined,
|
|
445
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
|
|
446
|
+
'withdraw': undefined,
|
|
447
|
+
'deposit': undefined,
|
|
448
|
+
'limits': {
|
|
449
|
+
'amount': { 'min': undefined, 'max': undefined },
|
|
450
|
+
'withdraw': { 'min': undefined, 'max': undefined },
|
|
451
|
+
},
|
|
452
|
+
'networks': {},
|
|
453
|
+
});
|
|
456
454
|
}
|
|
457
455
|
/**
|
|
458
456
|
* @method
|
package/js/src/phemex.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export default class phemex extends Exchange {
|
|
|
26
26
|
* @returns {object} an associative dictionary of currencies
|
|
27
27
|
*/
|
|
28
28
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
29
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
29
30
|
customParseBidAsk(bidask: any, priceKey?: number, amountKey?: number, market?: Market): number[];
|
|
30
31
|
customParseOrderBook(orderbook: any, symbol: any, timestamp?: any, bidsKey?: string, asksKey?: string, priceKey?: number, amountKey?: number, market?: Market): any;
|
|
31
32
|
/**
|
package/js/src/phemex.js
CHANGED
|
@@ -1139,50 +1139,48 @@ export default class phemex extends Exchange {
|
|
|
1139
1139
|
// }
|
|
1140
1140
|
const data = this.safeValue(response, 'data', {});
|
|
1141
1141
|
const currencies = this.safeValue(data, 'currencies', []);
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
},
|
|
1175
|
-
'withdraw': {
|
|
1176
|
-
'min': undefined,
|
|
1177
|
-
'max': undefined,
|
|
1178
|
-
},
|
|
1142
|
+
return this.parseCurrencies(currencies);
|
|
1143
|
+
}
|
|
1144
|
+
parseCurrency(rawCurrency) {
|
|
1145
|
+
const id = this.safeString(rawCurrency, 'currency');
|
|
1146
|
+
const code = this.safeCurrencyCode(id);
|
|
1147
|
+
const valueScaleString = this.safeString(rawCurrency, 'valueScale');
|
|
1148
|
+
const valueScale = parseInt(valueScaleString);
|
|
1149
|
+
const minValueEv = this.safeString(rawCurrency, 'minValueEv');
|
|
1150
|
+
const maxValueEv = this.safeString(rawCurrency, 'maxValueEv');
|
|
1151
|
+
let minAmount = undefined;
|
|
1152
|
+
let maxAmount = undefined;
|
|
1153
|
+
let precision = undefined;
|
|
1154
|
+
if (valueScale !== undefined) {
|
|
1155
|
+
const precisionString = this.parsePrecision(valueScaleString);
|
|
1156
|
+
precision = this.parseNumber(precisionString);
|
|
1157
|
+
minAmount = this.parseNumber(Precise.stringMul(minValueEv, precisionString));
|
|
1158
|
+
maxAmount = this.parseNumber(Precise.stringMul(maxValueEv, precisionString));
|
|
1159
|
+
}
|
|
1160
|
+
return this.safeCurrencyStructure({
|
|
1161
|
+
'id': id,
|
|
1162
|
+
'info': rawCurrency,
|
|
1163
|
+
'code': code,
|
|
1164
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
1165
|
+
'active': this.safeString(rawCurrency, 'status') === 'Listed',
|
|
1166
|
+
'deposit': undefined,
|
|
1167
|
+
'withdraw': undefined,
|
|
1168
|
+
'fee': undefined,
|
|
1169
|
+
'precision': precision,
|
|
1170
|
+
'limits': {
|
|
1171
|
+
'amount': {
|
|
1172
|
+
'min': minAmount,
|
|
1173
|
+
'max': maxAmount,
|
|
1179
1174
|
},
|
|
1180
|
-
'
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1175
|
+
'withdraw': {
|
|
1176
|
+
'min': undefined,
|
|
1177
|
+
'max': undefined,
|
|
1178
|
+
},
|
|
1179
|
+
},
|
|
1180
|
+
'valueScale': valueScale,
|
|
1181
|
+
'networks': undefined,
|
|
1182
|
+
'type': 'crypto',
|
|
1183
|
+
});
|
|
1186
1184
|
}
|
|
1187
1185
|
customParseBidAsk(bidask, priceKey = 0, amountKey = 1, market = undefined) {
|
|
1188
1186
|
if (market === undefined) {
|
|
@@ -3806,7 +3804,7 @@ export default class phemex extends Exchange {
|
|
|
3806
3804
|
'txid': txid,
|
|
3807
3805
|
'timestamp': timestamp,
|
|
3808
3806
|
'datetime': this.iso8601(timestamp),
|
|
3809
|
-
'network': this.networkIdToCode(networkId),
|
|
3807
|
+
'network': this.networkIdToCode(networkId, code),
|
|
3810
3808
|
'address': address,
|
|
3811
3809
|
'addressTo': address,
|
|
3812
3810
|
'addressFrom': undefined,
|
|
@@ -5079,7 +5077,7 @@ export default class phemex extends Exchange {
|
|
|
5079
5077
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
5080
5078
|
let networkId = undefined;
|
|
5081
5079
|
if (networkCode !== undefined) {
|
|
5082
|
-
networkId = this.networkCodeToId(networkCode);
|
|
5080
|
+
networkId = this.networkCodeToId(networkCode, code);
|
|
5083
5081
|
}
|
|
5084
5082
|
const stableCoins = this.safeValue(this.options, 'stableCoins');
|
|
5085
5083
|
if (networkId === undefined) {
|