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/apex.js
CHANGED
|
@@ -508,7 +508,7 @@ export default class apex extends Exchange {
|
|
|
508
508
|
const tokenName = this.safeString(token, 'token');
|
|
509
509
|
if (tokenName === currencyId) {
|
|
510
510
|
const networkId = this.safeString(chain, 'chainId');
|
|
511
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
511
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
512
512
|
networks[networkCode] = {
|
|
513
513
|
'info': chain,
|
|
514
514
|
'id': networkId,
|
package/js/src/arkham.js
CHANGED
|
@@ -488,7 +488,7 @@ export default class arkham extends Exchange {
|
|
|
488
488
|
for (let j = 0; j < chains.length; j++) {
|
|
489
489
|
const chain = chains[j];
|
|
490
490
|
const networkId = this.safeString(chain, 'symbol');
|
|
491
|
-
const network = this.networkIdToCode(networkId);
|
|
491
|
+
const network = this.networkIdToCode(networkId, code);
|
|
492
492
|
networks[network] = {
|
|
493
493
|
'info': chain,
|
|
494
494
|
'id': networkId,
|
|
@@ -1817,7 +1817,7 @@ export default class arkham extends Exchange {
|
|
|
1817
1817
|
throw new ArgumentsRequired(this.id + ' fetchDepositAddressesByNetwork() requires a "network" param');
|
|
1818
1818
|
}
|
|
1819
1819
|
const request = {
|
|
1820
|
-
'chain': this.networkCodeToId(networkCode),
|
|
1820
|
+
'chain': this.networkCodeToId(networkCode, code),
|
|
1821
1821
|
};
|
|
1822
1822
|
const response = await this.v1PrivateGetAccountDepositAddresses(this.extend(request, params));
|
|
1823
1823
|
//
|
|
@@ -1934,7 +1934,7 @@ export default class arkham extends Exchange {
|
|
|
1934
1934
|
'txid': this.safeString(transaction, 'transactionHash'),
|
|
1935
1935
|
'type': undefined,
|
|
1936
1936
|
'currency': code,
|
|
1937
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'chain')),
|
|
1937
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'chain'), code),
|
|
1938
1938
|
'amount': this.safeNumber(transaction, 'amount'),
|
|
1939
1939
|
'status': status,
|
|
1940
1940
|
'timestamp': timestamp,
|
package/js/src/ascendex.js
CHANGED
|
@@ -533,7 +533,7 @@ export default class ascendex extends Exchange {
|
|
|
533
533
|
for (let j = 0; j < chains.length; j++) {
|
|
534
534
|
const networkEtnry = chains[j];
|
|
535
535
|
const networkId = this.safeString(networkEtnry, 'chainName');
|
|
536
|
-
const networkCode = this.networkCodeToId(networkId);
|
|
536
|
+
const networkCode = this.networkCodeToId(networkId, code);
|
|
537
537
|
networks[networkCode] = {
|
|
538
538
|
'fee': this.safeNumber(networkEtnry, 'withdrawFee'),
|
|
539
539
|
'active': undefined,
|
|
@@ -2593,7 +2593,7 @@ export default class ascendex extends Exchange {
|
|
|
2593
2593
|
await this.loadMarkets();
|
|
2594
2594
|
const currency = this.currency(code);
|
|
2595
2595
|
const networkCode = this.safeString2(params, 'network', 'chainName');
|
|
2596
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
2596
|
+
const networkId = this.networkCodeToId(networkCode, currency['code']);
|
|
2597
2597
|
params = this.omit(params, ['chainName']);
|
|
2598
2598
|
const request = {
|
|
2599
2599
|
'asset': currency['id'],
|
package/js/src/aster.js
CHANGED
|
@@ -2112,8 +2112,10 @@ export default class aster extends Exchange {
|
|
|
2112
2112
|
// }
|
|
2113
2113
|
//
|
|
2114
2114
|
const info = order;
|
|
2115
|
+
const positionSide = this.safeString(order, 'positionSide');
|
|
2116
|
+
const defaultType = (positionSide !== undefined) ? 'swap' : 'spot';
|
|
2115
2117
|
const marketId = this.safeString(order, 'symbol');
|
|
2116
|
-
market = this.safeMarket(marketId, market);
|
|
2118
|
+
market = this.safeMarket(marketId, market, undefined, defaultType);
|
|
2117
2119
|
const side = this.safeStringLower(order, 'side');
|
|
2118
2120
|
const timestamp = this.safeInteger(order, 'time');
|
|
2119
2121
|
const statusId = this.safeStringUpper(order, 'status');
|
|
@@ -3057,7 +3059,7 @@ export default class aster extends Exchange {
|
|
|
3057
3059
|
// }
|
|
3058
3060
|
//
|
|
3059
3061
|
const marketId = this.safeString(marginMode, 'symbol');
|
|
3060
|
-
market = this.safeMarket(marketId, market);
|
|
3062
|
+
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
3061
3063
|
return {
|
|
3062
3064
|
'info': marginMode,
|
|
3063
3065
|
'symbol': market['symbol'],
|
|
@@ -4112,7 +4114,8 @@ export default class aster extends Exchange {
|
|
|
4112
4114
|
// Sign using EIP-712 typed data per the AsterSignTransaction spec
|
|
4113
4115
|
const zeroAddress = this.safeString(this.options, 'zeroAddress', '0x0000000000000000000000000000000000000000');
|
|
4114
4116
|
const v3ChainId = this.safeInteger(this.options, 'v3ChainId', 1666);
|
|
4115
|
-
const
|
|
4117
|
+
const walletAddress = this.ethGetAddressFromPrivateKey(this.privateKey);
|
|
4118
|
+
const signerAddress = this.safeString(this.options, 'signerAddress', walletAddress); // default to user's wallet
|
|
4116
4119
|
if (signerAddress === undefined) {
|
|
4117
4120
|
throw new ArgumentsRequired(this.id + ' requires signerAddress in options when use v3 api');
|
|
4118
4121
|
}
|
|
@@ -4131,7 +4134,7 @@ export default class aster extends Exchange {
|
|
|
4131
4134
|
// Note: timestamp and recvWindow are not used for v3; nonce replaces timestamp
|
|
4132
4135
|
const finalParams = this.extend({
|
|
4133
4136
|
'nonce': nonce.toString(),
|
|
4134
|
-
'user':
|
|
4137
|
+
'user': walletAddress,
|
|
4135
4138
|
'signer': signerAddress,
|
|
4136
4139
|
}, params);
|
|
4137
4140
|
let paramString = undefined;
|
package/js/src/backpack.js
CHANGED
|
@@ -537,7 +537,7 @@ export default class backpack extends Exchange {
|
|
|
537
537
|
const network = networks[j];
|
|
538
538
|
const networkId = this.safeString(network, 'blockchain');
|
|
539
539
|
const networkIdLowerCase = this.safeStringLower(network, 'blockchain');
|
|
540
|
-
const networkCode = this.networkIdToCode(networkIdLowerCase);
|
|
540
|
+
const networkCode = this.networkIdToCode(networkIdLowerCase, code);
|
|
541
541
|
parsedNetworks[networkCode] = {
|
|
542
542
|
'id': networkId,
|
|
543
543
|
'network': networkCode,
|
|
@@ -1449,7 +1449,7 @@ export default class backpack extends Exchange {
|
|
|
1449
1449
|
request['clientId'] = tag; // memo or tag
|
|
1450
1450
|
}
|
|
1451
1451
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
1452
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
1452
|
+
const networkId = this.networkCodeToId(networkCode, currency['code']);
|
|
1453
1453
|
if (networkId === undefined) {
|
|
1454
1454
|
throw new BadRequest(this.id + ' withdraw() requires a network parameter');
|
|
1455
1455
|
}
|
|
@@ -1538,7 +1538,7 @@ export default class backpack extends Exchange {
|
|
|
1538
1538
|
const timestamp = this.parse8601(this.safeString(transaction, 'createdAt'));
|
|
1539
1539
|
const amount = this.safeNumber(transaction, 'quantity');
|
|
1540
1540
|
const networkId = this.safeStringLower2(transaction, 'source', 'blockchain');
|
|
1541
|
-
const network = this.networkIdToCode(networkId);
|
|
1541
|
+
const network = this.networkIdToCode(networkId, code);
|
|
1542
1542
|
const addressTo = this.safeString(transaction, 'toAddress');
|
|
1543
1543
|
const addressFrom = this.safeString(transaction, 'fromAddress');
|
|
1544
1544
|
const tag = this.safeString(transaction, 'platformMemo');
|
|
@@ -1606,7 +1606,7 @@ export default class backpack extends Exchange {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
const currency = this.currency(code);
|
|
1608
1608
|
const request = {
|
|
1609
|
-
'blockchain': this.networkCodeToId(networkCode),
|
|
1609
|
+
'blockchain': this.networkCodeToId(networkCode, currency['code']),
|
|
1610
1610
|
};
|
|
1611
1611
|
const response = await this.privateGetWapiV1CapitalDepositAddress(this.extend(request, params));
|
|
1612
1612
|
return this.parseDepositAddress(response, currency);
|
|
@@ -395,6 +395,9 @@ export default class Exchange {
|
|
|
395
395
|
};
|
|
396
396
|
starknetEncodeStructuredData(domain: any, messageTypes: any, messageData: any, address: any): string;
|
|
397
397
|
starknetSign(msgHash: any, pri: any): string;
|
|
398
|
+
extendedStarknetSign(msgHash: any, pri: any): string;
|
|
399
|
+
extendedStarknetGetSelectorFromName(name: any): string;
|
|
400
|
+
extendedStarknetComputePoseidonHashOnElements(data: any): string;
|
|
398
401
|
getZKContractSignatureObj(seed: any, params?: {}): Promise<any>;
|
|
399
402
|
getZKTransferSignatureObj(seed: any, params?: {}): Promise<any>;
|
|
400
403
|
loadDydxProtos(): Promise<void>;
|
|
@@ -431,11 +434,11 @@ export default class Exchange {
|
|
|
431
434
|
lighterSignChangePubkey(signer: any, request: any): any[];
|
|
432
435
|
describe(): any;
|
|
433
436
|
safeBoolN(dictionaryOrList: any, keys: IndexType[], defaultValue?: boolean): boolean | undefined;
|
|
434
|
-
safeBool2(
|
|
435
|
-
safeBool(
|
|
437
|
+
safeBool2(dictionaryOrList: any, key1: IndexType, key2: IndexType, defaultValue?: boolean): boolean | undefined;
|
|
438
|
+
safeBool(dictionaryOrList: any, key: IndexType, defaultValue?: boolean): boolean | undefined;
|
|
436
439
|
safeDictN(dictionaryOrList: any, keys: IndexType[], defaultValue?: Dictionary<any>): Dictionary<any> | undefined;
|
|
437
|
-
safeDict(
|
|
438
|
-
safeDict2(
|
|
440
|
+
safeDict(dictionaryOrList: any, key: IndexType, defaultValue?: Dictionary<any>): Dictionary<any> | undefined;
|
|
441
|
+
safeDict2(dictionaryOrList: any, key1: IndexType, key2: string, defaultValue?: Dictionary<any>): Dictionary<any> | undefined;
|
|
439
442
|
safeListN(dictionaryOrList: any, keys: IndexType[], defaultValue?: any[]): any[] | undefined;
|
|
440
443
|
isDictionary(value: any): boolean;
|
|
441
444
|
safeList2(dictionaryOrList: any, key1: IndexType, key2: string, defaultValue?: any[]): any[] | undefined;
|
|
@@ -634,6 +637,7 @@ export default class Exchange {
|
|
|
634
637
|
parsedFeeAndFees(container: any): Dictionary<any>[];
|
|
635
638
|
parseFeeNumeric(fee: any): any;
|
|
636
639
|
findNearestCeiling(arr: number[], providedValue: number): number;
|
|
640
|
+
addKeyInArrayItems(obj: any, keyName: any): any[];
|
|
637
641
|
invertFlatStringDictionary(dict: any): {};
|
|
638
642
|
stringToBase16(str: any): string;
|
|
639
643
|
reduceFeesByCurrency(fees: any): any[];
|
|
@@ -658,7 +662,7 @@ export default class Exchange {
|
|
|
658
662
|
marketsForSymbols(symbols?: Strings): any[];
|
|
659
663
|
marketSymbols(symbols?: Strings, type?: Str, allowEmpty?: boolean, sameTypeOnly?: boolean, sameSubTypeOnly?: boolean): any[];
|
|
660
664
|
marketCodes(codes?: Strings): any[];
|
|
661
|
-
|
|
665
|
+
parseOrderBookBidsAsks(bidasks: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): any[];
|
|
662
666
|
fetchL2OrderBook(symbol: string, limit?: Int, params?: {}): Promise<any>;
|
|
663
667
|
filterBySymbol(objects: any, symbol?: Str): any;
|
|
664
668
|
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
@@ -757,7 +761,7 @@ export default class Exchange {
|
|
|
757
761
|
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<BorrowInterest[]>;
|
|
758
762
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
759
763
|
fetchLedgerEntry(id: string, code?: Str, params?: {}): Promise<LedgerEntry>;
|
|
760
|
-
|
|
764
|
+
parseOrderBookBidAsk(bidask: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): number[];
|
|
761
765
|
safeCurrency(currencyId: Str, currency?: Currency): CurrencyInterface;
|
|
762
766
|
safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
|
|
763
767
|
marketOrNull(symbol?: Str): MarketInterface;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -32,7 +32,7 @@ import { exportMnemonicAndPrivateKey, deriveHDKeyFromMnemonic } from '../static_
|
|
|
32
32
|
import { Long } from '../static_dependencies/dydx-v4-client/helpers.js';
|
|
33
33
|
const { isNode, selfIsDefined, deepExtend, extend, clone, unique, indexBy, sortBy, sortBy2, safeFloat2, groupBy, aggregate, uuid, unCamelCase, precisionFromString, Throttler, capitalize, now, decimalToPrecision, safeValue, safeValue2, safeString, safeString2, seconds, milliseconds, binaryToBase16, numberToBE, base16ToBinary, iso8601, omit, isJsonEncodedObject, safeInteger, sum, omitZero, implodeParams, extractParams, json, binaryConcat, hash,
|
|
34
34
|
// ecdsa,
|
|
35
|
-
arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, sort, inArray, isEmpty, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep, readFile, writeFile, existsFile, getTempDir, } = functions;
|
|
35
|
+
arrayConcat, encode, urlencode, hmac, numberToString, roundTimeframe, parseTimeframe, safeInteger2, safeStringLower, parse8601, yyyymmdd, safeStringUpper, safeTimestamp, binaryConcatArray, ymdhms, stringToBase64, decode, uuid22, safeIntegerProduct2, safeIntegerProduct, safeStringLower2, yymmdd, base58ToBinary, binaryToBase58, safeTimestamp2, rawencode, keysort, sort, inArray, isEmpty, filterBy, uuid16, safeFloat, base64ToBinary, safeStringUpper2, urlencodeWithArrayRepeat, microseconds, binaryToBase64, strip, toArray, safeFloatN, safeIntegerN, safeIntegerProductN, safeTimestampN, safeValueN, safeStringN, safeStringLowerN, safeStringUpperN, urlencodeNested, urlencodeBase64, parseDate, ymd, base64ToString, crc32, packb, TRUNCATE, ROUND, DECIMAL_PLACES, NO_PADDING, TICK_SIZE, SIGNIFICANT_DIGITS, sleep, readFile, writeFile, existsFile, getTempDir, filePathToFileUrlForWindows, } = functions;
|
|
36
36
|
// ----------------------------------------------------------------------------
|
|
37
37
|
let protobufMexc = undefined;
|
|
38
38
|
let encodeAsAny = undefined;
|
|
@@ -1394,6 +1394,16 @@ export default class Exchange {
|
|
|
1394
1394
|
const signature = starknetCurveSign(msgHash.replace('0x', ''), pri.replace('0x', ''));
|
|
1395
1395
|
return this.json([signature.r.toString(), signature.s.toString()]);
|
|
1396
1396
|
}
|
|
1397
|
+
extendedStarknetSign(msgHash, pri) {
|
|
1398
|
+
const signature = starknetCurveSign(msgHash.replace('0x', ''), pri.replace('0x', ''));
|
|
1399
|
+
return this.json([signature.r.toString(), signature.s.toString()]);
|
|
1400
|
+
}
|
|
1401
|
+
extendedStarknetGetSelectorFromName(name) {
|
|
1402
|
+
return Starknet.hash.getSelectorFromName(name);
|
|
1403
|
+
}
|
|
1404
|
+
extendedStarknetComputePoseidonHashOnElements(data) {
|
|
1405
|
+
return Starknet.hash.computePoseidonHashOnElements(data);
|
|
1406
|
+
}
|
|
1397
1407
|
async getZKContractSignatureObj(seed, params = {}) {
|
|
1398
1408
|
const formattedSlotId = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'slotId')), sha256, 'hex'))).toString();
|
|
1399
1409
|
const formattedNonce = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'nonce')), sha256, 'hex'))).toString();
|
|
@@ -1604,7 +1614,7 @@ export default class Exchange {
|
|
|
1604
1614
|
if (wasmExecPath === undefined || wasmExecPath === '') {
|
|
1605
1615
|
throw new Error('loadLighterLibrary() requires "wasmExecPath" that should point to `wasm_exec.js`. You can check the location of the file locally if you have GO installed or download it here https://github.com/ccxt/lighter-wasm.\nExample: exchanges.options["wasmExecPath"] = "/opt/homebrew/opt/go/libexec/lib/wasm/wasm_exec.js"');
|
|
1606
1616
|
}
|
|
1607
|
-
await import(wasmExecPath);
|
|
1617
|
+
await import(filePathToFileUrlForWindows(wasmExecPath));
|
|
1608
1618
|
const go = new globalThis.Go();
|
|
1609
1619
|
// read wasm from disks
|
|
1610
1620
|
const bytes = new Uint8Array(readFile(libraryPath, null)); // it should point to lighter.wasm
|
|
@@ -2128,23 +2138,31 @@ export default class Exchange {
|
|
|
2128
2138
|
}
|
|
2129
2139
|
return defaultValue;
|
|
2130
2140
|
}
|
|
2131
|
-
safeBool2(
|
|
2141
|
+
safeBool2(dictionaryOrList, key1, key2, defaultValue = undefined) {
|
|
2132
2142
|
/**
|
|
2133
2143
|
* @ignore
|
|
2134
2144
|
* @method
|
|
2135
2145
|
* @description safely extract boolean value from dictionary or list
|
|
2136
2146
|
* @returns {bool | undefined}
|
|
2137
2147
|
*/
|
|
2138
|
-
|
|
2148
|
+
const value = this.safeValue(dictionaryOrList, key1);
|
|
2149
|
+
if (typeof value === 'boolean') {
|
|
2150
|
+
return value;
|
|
2151
|
+
}
|
|
2152
|
+
const value2 = this.safeValue(dictionaryOrList, key2);
|
|
2153
|
+
if (typeof value2 === 'boolean') {
|
|
2154
|
+
return value2;
|
|
2155
|
+
}
|
|
2156
|
+
return defaultValue;
|
|
2139
2157
|
}
|
|
2140
|
-
safeBool(
|
|
2158
|
+
safeBool(dictionaryOrList, key, defaultValue = undefined) {
|
|
2141
2159
|
/**
|
|
2142
2160
|
* @ignore
|
|
2143
2161
|
* @method
|
|
2144
2162
|
* @description safely extract boolean value from dictionary or list
|
|
2145
2163
|
* @returns {bool | undefined}
|
|
2146
2164
|
*/
|
|
2147
|
-
const value = this.safeValue(
|
|
2165
|
+
const value = this.safeValue(dictionaryOrList, key, defaultValue);
|
|
2148
2166
|
if (typeof value === 'boolean') {
|
|
2149
2167
|
return value;
|
|
2150
2168
|
}
|
|
@@ -2166,14 +2184,14 @@ export default class Exchange {
|
|
|
2166
2184
|
}
|
|
2167
2185
|
return defaultValue;
|
|
2168
2186
|
}
|
|
2169
|
-
safeDict(
|
|
2187
|
+
safeDict(dictionaryOrList, key, defaultValue = undefined) {
|
|
2170
2188
|
/**
|
|
2171
2189
|
* @ignore
|
|
2172
2190
|
* @method
|
|
2173
2191
|
* @description safely extract a dictionary from dictionary or list
|
|
2174
2192
|
* @returns {object | undefined}
|
|
2175
2193
|
*/
|
|
2176
|
-
const value = this.safeValue(
|
|
2194
|
+
const value = this.safeValue(dictionaryOrList, key, defaultValue);
|
|
2177
2195
|
if (value === undefined) {
|
|
2178
2196
|
return defaultValue;
|
|
2179
2197
|
}
|
|
@@ -2182,14 +2200,22 @@ export default class Exchange {
|
|
|
2182
2200
|
}
|
|
2183
2201
|
return defaultValue;
|
|
2184
2202
|
}
|
|
2185
|
-
safeDict2(
|
|
2203
|
+
safeDict2(dictionaryOrList, key1, key2, defaultValue = undefined) {
|
|
2186
2204
|
/**
|
|
2187
2205
|
* @ignore
|
|
2188
2206
|
* @method
|
|
2189
2207
|
* @description safely extract a dictionary from dictionary or list
|
|
2190
2208
|
* @returns {object | undefined}
|
|
2191
2209
|
*/
|
|
2192
|
-
|
|
2210
|
+
const value = this.safeValue(dictionaryOrList, key1);
|
|
2211
|
+
if ((value !== undefined) && (typeof value === 'object') && !Array.isArray(value)) {
|
|
2212
|
+
return value;
|
|
2213
|
+
}
|
|
2214
|
+
const value2 = this.safeValue(dictionaryOrList, key2);
|
|
2215
|
+
if ((value2 !== undefined) && (typeof value2 === 'object') && !Array.isArray(value2)) {
|
|
2216
|
+
return value2;
|
|
2217
|
+
}
|
|
2218
|
+
return defaultValue;
|
|
2193
2219
|
}
|
|
2194
2220
|
safeListN(dictionaryOrList, keys, defaultValue = undefined) {
|
|
2195
2221
|
/**
|
|
@@ -2217,7 +2243,15 @@ export default class Exchange {
|
|
|
2217
2243
|
* @description safely extract an Array from dictionary or list
|
|
2218
2244
|
* @returns {Array | undefined}
|
|
2219
2245
|
*/
|
|
2220
|
-
|
|
2246
|
+
const value = this.safeValue(dictionaryOrList, key1);
|
|
2247
|
+
if ((value !== undefined) && Array.isArray(value)) {
|
|
2248
|
+
return value;
|
|
2249
|
+
}
|
|
2250
|
+
const value2 = this.safeValue(dictionaryOrList, key2);
|
|
2251
|
+
if ((value2 !== undefined) && Array.isArray(value2)) {
|
|
2252
|
+
return value2;
|
|
2253
|
+
}
|
|
2254
|
+
return defaultValue;
|
|
2221
2255
|
}
|
|
2222
2256
|
safeList(dictionaryOrList, key, defaultValue = undefined) {
|
|
2223
2257
|
/**
|
|
@@ -2245,7 +2279,7 @@ export default class Exchange {
|
|
|
2245
2279
|
}
|
|
2246
2280
|
handleDeltasWithKeys(bookSide, deltas, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
2247
2281
|
for (let i = 0; i < deltas.length; i++) {
|
|
2248
|
-
const bidAsk = this.
|
|
2282
|
+
const bidAsk = this.parseOrderBookBidAsk(deltas[i], priceKey, amountKey, countOrIdKey);
|
|
2249
2283
|
bookSide.storeArray(bidAsk);
|
|
2250
2284
|
}
|
|
2251
2285
|
}
|
|
@@ -2702,6 +2736,9 @@ export default class Exchange {
|
|
|
2702
2736
|
const arr = this.toArray(rawCurrencies);
|
|
2703
2737
|
for (let i = 0; i < arr.length; i++) {
|
|
2704
2738
|
const parsed = this.parseCurrency(arr[i]);
|
|
2739
|
+
if (parsed === undefined) {
|
|
2740
|
+
continue;
|
|
2741
|
+
}
|
|
2705
2742
|
const code = parsed['code'];
|
|
2706
2743
|
result[code] = parsed;
|
|
2707
2744
|
}
|
|
@@ -3227,21 +3264,6 @@ export default class Exchange {
|
|
|
3227
3264
|
if (currencyWithdraw === undefined || withdraw) {
|
|
3228
3265
|
currency['withdraw'] = withdraw;
|
|
3229
3266
|
}
|
|
3230
|
-
// set network 'active' to false if D or W is disabled
|
|
3231
|
-
let active = this.safeBool(network, 'active');
|
|
3232
|
-
if (active === undefined) {
|
|
3233
|
-
if (deposit && withdraw) {
|
|
3234
|
-
currency['networks'][key]['active'] = true;
|
|
3235
|
-
}
|
|
3236
|
-
else if (deposit !== undefined && withdraw !== undefined) {
|
|
3237
|
-
currency['networks'][key]['active'] = false;
|
|
3238
|
-
}
|
|
3239
|
-
}
|
|
3240
|
-
active = this.safeBool(currency['networks'][key], 'active'); // dict might have been updated on above lines, so access directly instead of `network` variable
|
|
3241
|
-
const currencyActive = this.safeBool(currency, 'active');
|
|
3242
|
-
if (currencyActive === undefined || active) {
|
|
3243
|
-
currency['active'] = active;
|
|
3244
|
-
}
|
|
3245
3267
|
// find lowest fee (which is more desired)
|
|
3246
3268
|
const fee = this.safeString(network, 'fee');
|
|
3247
3269
|
const feeMain = this.safeString(currency, 'fee');
|
|
@@ -4091,6 +4113,21 @@ export default class Exchange {
|
|
|
4091
4113
|
}
|
|
4092
4114
|
return arr[length - 1];
|
|
4093
4115
|
}
|
|
4116
|
+
addKeyInArrayItems(obj, keyName) {
|
|
4117
|
+
const result = [];
|
|
4118
|
+
const keys = Object.keys(obj);
|
|
4119
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4120
|
+
const key = keys[i];
|
|
4121
|
+
const item = obj[key];
|
|
4122
|
+
if (item === undefined) {
|
|
4123
|
+
continue;
|
|
4124
|
+
}
|
|
4125
|
+
const itemWithKey = this.extend({}, item);
|
|
4126
|
+
itemWithKey[keyName] = key;
|
|
4127
|
+
result.push(itemWithKey);
|
|
4128
|
+
}
|
|
4129
|
+
return result;
|
|
4130
|
+
}
|
|
4094
4131
|
invertFlatStringDictionary(dict) {
|
|
4095
4132
|
const reversed = {};
|
|
4096
4133
|
const keys = Object.keys(dict);
|
|
@@ -4517,11 +4554,11 @@ export default class Exchange {
|
|
|
4517
4554
|
}
|
|
4518
4555
|
return result;
|
|
4519
4556
|
}
|
|
4520
|
-
|
|
4557
|
+
parseOrderBookBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
4521
4558
|
bidasks = this.toArray(bidasks);
|
|
4522
4559
|
const result = [];
|
|
4523
4560
|
for (let i = 0; i < bidasks.length; i++) {
|
|
4524
|
-
result.push(this.
|
|
4561
|
+
result.push(this.parseOrderBookBidAsk(bidasks[i], priceKey, amountKey, countOrIdKey));
|
|
4525
4562
|
}
|
|
4526
4563
|
return result;
|
|
4527
4564
|
}
|
|
@@ -4771,8 +4808,8 @@ export default class Exchange {
|
|
|
4771
4808
|
return this.parseNumber(value, d);
|
|
4772
4809
|
}
|
|
4773
4810
|
parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
4774
|
-
const bids = this.
|
|
4775
|
-
const asks = this.
|
|
4811
|
+
const bids = this.parseOrderBookBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
4812
|
+
const asks = this.parseOrderBookBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
|
|
4776
4813
|
return {
|
|
4777
4814
|
'symbol': symbol,
|
|
4778
4815
|
'bids': this.sortBy(bids, 0, true),
|
|
@@ -5330,7 +5367,7 @@ export default class Exchange {
|
|
|
5330
5367
|
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
5331
5368
|
throw new NotSupported(this.id + ' fetchLedgerEntry() is not supported yet');
|
|
5332
5369
|
}
|
|
5333
|
-
|
|
5370
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
5334
5371
|
const price = this.safeFloat(bidask, priceKey);
|
|
5335
5372
|
const amount = this.safeFloat(bidask, amountKey);
|
|
5336
5373
|
const countOrId = this.safeInteger(bidask, countOrIdKey);
|
|
@@ -30,3 +30,10 @@ export declare function writeFile(path: string, data: string, encoding?: BufferE
|
|
|
30
30
|
* @returns true if file exists, false otherwise
|
|
31
31
|
*/
|
|
32
32
|
export declare function existsFile(path: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Convert file-path to file-url format on Windows, to avoid ESM loader error when using absolute paths, like:
|
|
35
|
+
* Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:195:11)
|
|
36
|
+
* @param filePath File path to check
|
|
37
|
+
* @returns filepath original or converted to file URL format on Windows
|
|
38
|
+
*/
|
|
39
|
+
export declare function filePathToFileUrlForWindows(filePath: string): string;
|
|
@@ -4,6 +4,7 @@ import { isNode } from './platform.js';
|
|
|
4
4
|
let fsSyncModule = null;
|
|
5
5
|
let osSyncModule = null;
|
|
6
6
|
let pathSyncModule = null;
|
|
7
|
+
let urlSyncModule = null;
|
|
7
8
|
/* ------------------------------------------------------------------------ */
|
|
8
9
|
/**
|
|
9
10
|
* Initialize synchronous file system module (Node.js only)
|
|
@@ -30,6 +31,12 @@ export async function initFileSystem() {
|
|
|
30
31
|
}
|
|
31
32
|
catch (e) { } // Silent fail in browser or if path is unavailable
|
|
32
33
|
}
|
|
34
|
+
if (urlSyncModule === null) {
|
|
35
|
+
try {
|
|
36
|
+
urlSyncModule = await import(/* webpackIgnore: true */ 'node:url');
|
|
37
|
+
}
|
|
38
|
+
catch (e) { } // Silent fail in browser or if url is unavailable
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
if (isNode) {
|
|
@@ -129,3 +136,20 @@ export function existsFile(path) {
|
|
|
129
136
|
return false;
|
|
130
137
|
}
|
|
131
138
|
}
|
|
139
|
+
/* ------------------------------------------------------------------------ */
|
|
140
|
+
/**
|
|
141
|
+
* Convert file-path to file-url format on Windows, to avoid ESM loader error when using absolute paths, like:
|
|
142
|
+
* Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:' at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:195:11)
|
|
143
|
+
* @param filePath File path to check
|
|
144
|
+
* @returns filepath original or converted to file URL format on Windows
|
|
145
|
+
*/
|
|
146
|
+
export function filePathToFileUrlForWindows(filePath) {
|
|
147
|
+
if (!isNode || !filePath || filePath.startsWith('file://') || osSyncModule === null || urlSyncModule === null) {
|
|
148
|
+
return filePath;
|
|
149
|
+
}
|
|
150
|
+
if (osSyncModule.platform() !== 'win32') {
|
|
151
|
+
return filePath;
|
|
152
|
+
}
|
|
153
|
+
const looksLikeWindowsPath = /^[a-zA-Z]:[\\/]/.test(filePath) || filePath.startsWith('\\\\');
|
|
154
|
+
return looksLikeWindowsPath ? urlSyncModule.pathToFileURL(filePath).href : filePath;
|
|
155
|
+
}
|
package/js/src/bigone.js
CHANGED
|
@@ -528,7 +528,7 @@ export default class bigone extends Exchange {
|
|
|
528
528
|
for (let j = 0; j < chains.length; j++) {
|
|
529
529
|
const chain = chains[j];
|
|
530
530
|
const networkId = this.safeString(chain, 'gateway_name');
|
|
531
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
531
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
532
532
|
const deposit = this.safeBool(chain, 'is_deposit_enabled');
|
|
533
533
|
const withdraw = this.safeBool(chain, 'is_withdrawal_enabled');
|
|
534
534
|
const minDepositAmount = this.safeString(chain, 'min_deposit_amount');
|
|
@@ -2002,7 +2002,7 @@ export default class bigone extends Exchange {
|
|
|
2002
2002
|
return {
|
|
2003
2003
|
'info': response,
|
|
2004
2004
|
'currency': code,
|
|
2005
|
-
'network': this.networkIdToCode(selectedNetworkId),
|
|
2005
|
+
'network': this.networkIdToCode(selectedNetworkId, code),
|
|
2006
2006
|
'address': address,
|
|
2007
2007
|
'tag': tag,
|
|
2008
2008
|
};
|
|
@@ -2308,7 +2308,7 @@ export default class bigone extends Exchange {
|
|
|
2308
2308
|
let networkCode = undefined;
|
|
2309
2309
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2310
2310
|
if (networkCode !== undefined) {
|
|
2311
|
-
request['gateway_name'] = this.networkCodeToId(networkCode);
|
|
2311
|
+
request['gateway_name'] = this.networkCodeToId(networkCode, currency['code']);
|
|
2312
2312
|
}
|
|
2313
2313
|
// requires write permission on the wallet
|
|
2314
2314
|
const response = await this.privatePostWithdrawals(this.extend(request, params));
|
package/js/src/binance.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export default class binance extends Exchange {
|
|
|
44
44
|
* @returns {object} an associative dictionary of currencies
|
|
45
45
|
*/
|
|
46
46
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
47
|
+
parseCurrenciesCustom(responseCurrencies: any, marginablesById: any): Currencies;
|
|
48
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
47
49
|
/**
|
|
48
50
|
* @method
|
|
49
51
|
* @name binance#fetchMarkets
|