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/dist/cjs/ccxt.js
CHANGED
|
@@ -68,10 +68,10 @@ var derive = require('./src/derive.js');
|
|
|
68
68
|
var digifinex = require('./src/digifinex.js');
|
|
69
69
|
var dydx = require('./src/dydx.js');
|
|
70
70
|
var exmo = require('./src/exmo.js');
|
|
71
|
+
var extended = require('./src/extended.js');
|
|
71
72
|
var fmfwio = require('./src/fmfwio.js');
|
|
72
73
|
var foxbit = require('./src/foxbit.js');
|
|
73
74
|
var gate = require('./src/gate.js');
|
|
74
|
-
var gateio = require('./src/gateio.js');
|
|
75
75
|
var gemini = require('./src/gemini.js');
|
|
76
76
|
var grvt = require('./src/grvt.js');
|
|
77
77
|
var hashkey = require('./src/hashkey.js');
|
|
@@ -100,7 +100,6 @@ var novadax = require('./src/novadax.js');
|
|
|
100
100
|
var okx = require('./src/okx.js');
|
|
101
101
|
var okxus = require('./src/okxus.js');
|
|
102
102
|
var onetrading = require('./src/onetrading.js');
|
|
103
|
-
var oxfun = require('./src/oxfun.js');
|
|
104
103
|
var p2b = require('./src/p2b.js');
|
|
105
104
|
var pacifica = require('./src/pacifica.js');
|
|
106
105
|
var paradex = require('./src/paradex.js');
|
|
@@ -162,8 +161,8 @@ var deribit$1 = require('./src/pro/deribit.js');
|
|
|
162
161
|
var derive$1 = require('./src/pro/derive.js');
|
|
163
162
|
var dydx$1 = require('./src/pro/dydx.js');
|
|
164
163
|
var exmo$1 = require('./src/pro/exmo.js');
|
|
164
|
+
var extended$1 = require('./src/pro/extended.js');
|
|
165
165
|
var gate$1 = require('./src/pro/gate.js');
|
|
166
|
-
var gateio$1 = require('./src/pro/gateio.js');
|
|
167
166
|
var gemini$1 = require('./src/pro/gemini.js');
|
|
168
167
|
var grvt$1 = require('./src/pro/grvt.js');
|
|
169
168
|
var hashkey$1 = require('./src/pro/hashkey.js');
|
|
@@ -187,7 +186,6 @@ var ndax$1 = require('./src/pro/ndax.js');
|
|
|
187
186
|
var okx$1 = require('./src/pro/okx.js');
|
|
188
187
|
var okxus$1 = require('./src/pro/okxus.js');
|
|
189
188
|
var onetrading$1 = require('./src/pro/onetrading.js');
|
|
190
|
-
var oxfun$1 = require('./src/pro/oxfun.js');
|
|
191
189
|
var p2b$1 = require('./src/pro/p2b.js');
|
|
192
190
|
var pacifica$1 = require('./src/pro/pacifica.js');
|
|
193
191
|
var paradex$1 = require('./src/pro/paradex.js');
|
|
@@ -203,7 +201,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
203
201
|
|
|
204
202
|
//-----------------------------------------------------------------------------
|
|
205
203
|
// this is updated by vss.js when building
|
|
206
|
-
const version = '4.5.
|
|
204
|
+
const version = '4.5.57';
|
|
207
205
|
Exchange["default"].ccxtVersion = version;
|
|
208
206
|
const exchanges = {
|
|
209
207
|
'aftermath': aftermath["default"],
|
|
@@ -266,10 +264,10 @@ const exchanges = {
|
|
|
266
264
|
'digifinex': digifinex["default"],
|
|
267
265
|
'dydx': dydx["default"],
|
|
268
266
|
'exmo': exmo["default"],
|
|
267
|
+
'extended': extended["default"],
|
|
269
268
|
'fmfwio': fmfwio["default"],
|
|
270
269
|
'foxbit': foxbit["default"],
|
|
271
270
|
'gate': gate["default"],
|
|
272
|
-
'gateio': gateio["default"],
|
|
273
271
|
'gemini': gemini["default"],
|
|
274
272
|
'grvt': grvt["default"],
|
|
275
273
|
'hashkey': hashkey["default"],
|
|
@@ -298,7 +296,6 @@ const exchanges = {
|
|
|
298
296
|
'okx': okx["default"],
|
|
299
297
|
'okxus': okxus["default"],
|
|
300
298
|
'onetrading': onetrading["default"],
|
|
301
|
-
'oxfun': oxfun["default"],
|
|
302
299
|
'p2b': p2b["default"],
|
|
303
300
|
'pacifica': pacifica["default"],
|
|
304
301
|
'paradex': paradex["default"],
|
|
@@ -362,8 +359,8 @@ const pro = {
|
|
|
362
359
|
'derive': derive$1["default"],
|
|
363
360
|
'dydx': dydx$1["default"],
|
|
364
361
|
'exmo': exmo$1["default"],
|
|
362
|
+
'extended': extended$1["default"],
|
|
365
363
|
'gate': gate$1["default"],
|
|
366
|
-
'gateio': gateio$1["default"],
|
|
367
364
|
'gemini': gemini$1["default"],
|
|
368
365
|
'grvt': grvt$1["default"],
|
|
369
366
|
'hashkey': hashkey$1["default"],
|
|
@@ -387,7 +384,6 @@ const pro = {
|
|
|
387
384
|
'okx': okx$1["default"],
|
|
388
385
|
'okxus': okxus$1["default"],
|
|
389
386
|
'onetrading': onetrading$1["default"],
|
|
390
|
-
'oxfun': oxfun$1["default"],
|
|
391
387
|
'p2b': p2b$1["default"],
|
|
392
388
|
'pacifica': pacifica$1["default"],
|
|
393
389
|
'paradex': paradex$1["default"],
|
|
@@ -512,10 +508,10 @@ exports.derive = derive["default"];
|
|
|
512
508
|
exports.digifinex = digifinex["default"];
|
|
513
509
|
exports.dydx = dydx["default"];
|
|
514
510
|
exports.exmo = exmo["default"];
|
|
511
|
+
exports.extended = extended["default"];
|
|
515
512
|
exports.fmfwio = fmfwio["default"];
|
|
516
513
|
exports.foxbit = foxbit["default"];
|
|
517
514
|
exports.gate = gate["default"];
|
|
518
|
-
exports.gateio = gateio["default"];
|
|
519
515
|
exports.gemini = gemini["default"];
|
|
520
516
|
exports.grvt = grvt["default"];
|
|
521
517
|
exports.hashkey = hashkey["default"];
|
|
@@ -544,7 +540,6 @@ exports.novadax = novadax["default"];
|
|
|
544
540
|
exports.okx = okx["default"];
|
|
545
541
|
exports.okxus = okxus["default"];
|
|
546
542
|
exports.onetrading = onetrading["default"];
|
|
547
|
-
exports.oxfun = oxfun["default"];
|
|
548
543
|
exports.p2b = p2b["default"];
|
|
549
544
|
exports.pacifica = pacifica["default"];
|
|
550
545
|
exports.paradex = paradex["default"];
|
package/dist/cjs/src/apex.js
CHANGED
|
@@ -513,7 +513,7 @@ class apex extends apex$1["default"] {
|
|
|
513
513
|
const tokenName = this.safeString(token, 'token');
|
|
514
514
|
if (tokenName === currencyId) {
|
|
515
515
|
const networkId = this.safeString(chain, 'chainId');
|
|
516
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
516
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
517
517
|
networks[networkCode] = {
|
|
518
518
|
'info': chain,
|
|
519
519
|
'id': networkId,
|
package/dist/cjs/src/arkham.js
CHANGED
|
@@ -493,7 +493,7 @@ class arkham extends arkham$1["default"] {
|
|
|
493
493
|
for (let j = 0; j < chains.length; j++) {
|
|
494
494
|
const chain = chains[j];
|
|
495
495
|
const networkId = this.safeString(chain, 'symbol');
|
|
496
|
-
const network = this.networkIdToCode(networkId);
|
|
496
|
+
const network = this.networkIdToCode(networkId, code);
|
|
497
497
|
networks[network] = {
|
|
498
498
|
'info': chain,
|
|
499
499
|
'id': networkId,
|
|
@@ -1822,7 +1822,7 @@ class arkham extends arkham$1["default"] {
|
|
|
1822
1822
|
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddressesByNetwork() requires a "network" param');
|
|
1823
1823
|
}
|
|
1824
1824
|
const request = {
|
|
1825
|
-
'chain': this.networkCodeToId(networkCode),
|
|
1825
|
+
'chain': this.networkCodeToId(networkCode, code),
|
|
1826
1826
|
};
|
|
1827
1827
|
const response = await this.v1PrivateGetAccountDepositAddresses(this.extend(request, params));
|
|
1828
1828
|
//
|
|
@@ -1939,7 +1939,7 @@ class arkham extends arkham$1["default"] {
|
|
|
1939
1939
|
'txid': this.safeString(transaction, 'transactionHash'),
|
|
1940
1940
|
'type': undefined,
|
|
1941
1941
|
'currency': code,
|
|
1942
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'chain')),
|
|
1942
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'chain'), code),
|
|
1943
1943
|
'amount': this.safeNumber(transaction, 'amount'),
|
|
1944
1944
|
'status': status,
|
|
1945
1945
|
'timestamp': timestamp,
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -538,7 +538,7 @@ class ascendex extends ascendex$1["default"] {
|
|
|
538
538
|
for (let j = 0; j < chains.length; j++) {
|
|
539
539
|
const networkEtnry = chains[j];
|
|
540
540
|
const networkId = this.safeString(networkEtnry, 'chainName');
|
|
541
|
-
const networkCode = this.networkCodeToId(networkId);
|
|
541
|
+
const networkCode = this.networkCodeToId(networkId, code);
|
|
542
542
|
networks[networkCode] = {
|
|
543
543
|
'fee': this.safeNumber(networkEtnry, 'withdrawFee'),
|
|
544
544
|
'active': undefined,
|
|
@@ -2598,7 +2598,7 @@ class ascendex extends ascendex$1["default"] {
|
|
|
2598
2598
|
await this.loadMarkets();
|
|
2599
2599
|
const currency = this.currency(code);
|
|
2600
2600
|
const networkCode = this.safeString2(params, 'network', 'chainName');
|
|
2601
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
2601
|
+
const networkId = this.networkCodeToId(networkCode, currency['code']);
|
|
2602
2602
|
params = this.omit(params, ['chainName']);
|
|
2603
2603
|
const request = {
|
|
2604
2604
|
'asset': currency['id'],
|
package/dist/cjs/src/aster.js
CHANGED
|
@@ -2117,8 +2117,10 @@ class aster extends aster$1["default"] {
|
|
|
2117
2117
|
// }
|
|
2118
2118
|
//
|
|
2119
2119
|
const info = order;
|
|
2120
|
+
const positionSide = this.safeString(order, 'positionSide');
|
|
2121
|
+
const defaultType = (positionSide !== undefined) ? 'swap' : 'spot';
|
|
2120
2122
|
const marketId = this.safeString(order, 'symbol');
|
|
2121
|
-
market = this.safeMarket(marketId, market);
|
|
2123
|
+
market = this.safeMarket(marketId, market, undefined, defaultType);
|
|
2122
2124
|
const side = this.safeStringLower(order, 'side');
|
|
2123
2125
|
const timestamp = this.safeInteger(order, 'time');
|
|
2124
2126
|
const statusId = this.safeStringUpper(order, 'status');
|
|
@@ -3062,7 +3064,7 @@ class aster extends aster$1["default"] {
|
|
|
3062
3064
|
// }
|
|
3063
3065
|
//
|
|
3064
3066
|
const marketId = this.safeString(marginMode, 'symbol');
|
|
3065
|
-
market = this.safeMarket(marketId, market);
|
|
3067
|
+
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
3066
3068
|
return {
|
|
3067
3069
|
'info': marginMode,
|
|
3068
3070
|
'symbol': market['symbol'],
|
|
@@ -4117,7 +4119,8 @@ class aster extends aster$1["default"] {
|
|
|
4117
4119
|
// Sign using EIP-712 typed data per the AsterSignTransaction spec
|
|
4118
4120
|
const zeroAddress = this.safeString(this.options, 'zeroAddress', '0x0000000000000000000000000000000000000000');
|
|
4119
4121
|
const v3ChainId = this.safeInteger(this.options, 'v3ChainId', 1666);
|
|
4120
|
-
const
|
|
4122
|
+
const walletAddress = this.ethGetAddressFromPrivateKey(this.privateKey);
|
|
4123
|
+
const signerAddress = this.safeString(this.options, 'signerAddress', walletAddress); // default to user's wallet
|
|
4121
4124
|
if (signerAddress === undefined) {
|
|
4122
4125
|
throw new errors.ArgumentsRequired(this.id + ' requires signerAddress in options when use v3 api');
|
|
4123
4126
|
}
|
|
@@ -4136,7 +4139,7 @@ class aster extends aster$1["default"] {
|
|
|
4136
4139
|
// Note: timestamp and recvWindow are not used for v3; nonce replaces timestamp
|
|
4137
4140
|
const finalParams = this.extend({
|
|
4138
4141
|
'nonce': nonce.toString(),
|
|
4139
|
-
'user':
|
|
4142
|
+
'user': walletAddress,
|
|
4140
4143
|
'signer': signerAddress,
|
|
4141
4144
|
}, params);
|
|
4142
4145
|
let paramString = undefined;
|
package/dist/cjs/src/backpack.js
CHANGED
|
@@ -542,7 +542,7 @@ class backpack extends backpack$1["default"] {
|
|
|
542
542
|
const network = networks[j];
|
|
543
543
|
const networkId = this.safeString(network, 'blockchain');
|
|
544
544
|
const networkIdLowerCase = this.safeStringLower(network, 'blockchain');
|
|
545
|
-
const networkCode = this.networkIdToCode(networkIdLowerCase);
|
|
545
|
+
const networkCode = this.networkIdToCode(networkIdLowerCase, code);
|
|
546
546
|
parsedNetworks[networkCode] = {
|
|
547
547
|
'id': networkId,
|
|
548
548
|
'network': networkCode,
|
|
@@ -1454,7 +1454,7 @@ class backpack extends backpack$1["default"] {
|
|
|
1454
1454
|
request['clientId'] = tag; // memo or tag
|
|
1455
1455
|
}
|
|
1456
1456
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
1457
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
1457
|
+
const networkId = this.networkCodeToId(networkCode, currency['code']);
|
|
1458
1458
|
if (networkId === undefined) {
|
|
1459
1459
|
throw new errors.BadRequest(this.id + ' withdraw() requires a network parameter');
|
|
1460
1460
|
}
|
|
@@ -1543,7 +1543,7 @@ class backpack extends backpack$1["default"] {
|
|
|
1543
1543
|
const timestamp = this.parse8601(this.safeString(transaction, 'createdAt'));
|
|
1544
1544
|
const amount = this.safeNumber(transaction, 'quantity');
|
|
1545
1545
|
const networkId = this.safeStringLower2(transaction, 'source', 'blockchain');
|
|
1546
|
-
const network = this.networkIdToCode(networkId);
|
|
1546
|
+
const network = this.networkIdToCode(networkId, code);
|
|
1547
1547
|
const addressTo = this.safeString(transaction, 'toAddress');
|
|
1548
1548
|
const addressFrom = this.safeString(transaction, 'fromAddress');
|
|
1549
1549
|
const tag = this.safeString(transaction, 'platformMemo');
|
|
@@ -1611,7 +1611,7 @@ class backpack extends backpack$1["default"] {
|
|
|
1611
1611
|
}
|
|
1612
1612
|
const currency = this.currency(code);
|
|
1613
1613
|
const request = {
|
|
1614
|
-
'blockchain': this.networkCodeToId(networkCode),
|
|
1614
|
+
'blockchain': this.networkCodeToId(networkCode, currency['code']),
|
|
1615
1615
|
};
|
|
1616
1616
|
const response = await this.privateGetWapiV1CapitalDepositAddress(this.extend(request, params));
|
|
1617
1617
|
return this.parseDepositAddress(response, currency);
|
|
@@ -57,7 +57,7 @@ function _interopNamespace(e) {
|
|
|
57
57
|
// ----------------------------------------------------------------------------
|
|
58
58
|
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,
|
|
59
59
|
// ecdsa,
|
|
60
|
-
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;
|
|
60
|
+
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;
|
|
61
61
|
// ----------------------------------------------------------------------------
|
|
62
62
|
let protobufMexc = undefined;
|
|
63
63
|
let encodeAsAny = undefined;
|
|
@@ -1411,6 +1411,16 @@ class Exchange {
|
|
|
1411
1411
|
const signature = index$1.sign(msgHash.replace('0x', ''), pri.replace('0x', ''));
|
|
1412
1412
|
return this.json([signature.r.toString(), signature.s.toString()]);
|
|
1413
1413
|
}
|
|
1414
|
+
extendedStarknetSign(msgHash, pri) {
|
|
1415
|
+
const signature = index$1.sign(msgHash.replace('0x', ''), pri.replace('0x', ''));
|
|
1416
|
+
return this.json([signature.r.toString(), signature.s.toString()]);
|
|
1417
|
+
}
|
|
1418
|
+
extendedStarknetGetSelectorFromName(name) {
|
|
1419
|
+
return selector.getSelectorFromName(name);
|
|
1420
|
+
}
|
|
1421
|
+
extendedStarknetComputePoseidonHashOnElements(data) {
|
|
1422
|
+
return classHash.computePoseidonHashOnElements(data);
|
|
1423
|
+
}
|
|
1414
1424
|
async getZKContractSignatureObj(seed, params = {}) {
|
|
1415
1425
|
const formattedSlotId = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'slotId')), sha256.sha256, 'hex'))).toString();
|
|
1416
1426
|
const formattedNonce = BigInt('0x' + this.remove0xPrefix(this.hash(this.encode(this.safeString(params, 'nonce')), sha256.sha256, 'hex'))).toString();
|
|
@@ -1621,7 +1631,7 @@ class Exchange {
|
|
|
1621
1631
|
if (wasmExecPath === undefined || wasmExecPath === '') {
|
|
1622
1632
|
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"');
|
|
1623
1633
|
}
|
|
1624
|
-
await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(wasmExecPath);
|
|
1634
|
+
await (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(filePathToFileUrlForWindows(wasmExecPath));
|
|
1625
1635
|
const go = new globalThis.Go();
|
|
1626
1636
|
// read wasm from disks
|
|
1627
1637
|
const bytes = new Uint8Array(readFile(libraryPath, null)); // it should point to lighter.wasm
|
|
@@ -2145,23 +2155,31 @@ class Exchange {
|
|
|
2145
2155
|
}
|
|
2146
2156
|
return defaultValue;
|
|
2147
2157
|
}
|
|
2148
|
-
safeBool2(
|
|
2158
|
+
safeBool2(dictionaryOrList, key1, key2, defaultValue = undefined) {
|
|
2149
2159
|
/**
|
|
2150
2160
|
* @ignore
|
|
2151
2161
|
* @method
|
|
2152
2162
|
* @description safely extract boolean value from dictionary or list
|
|
2153
2163
|
* @returns {bool | undefined}
|
|
2154
2164
|
*/
|
|
2155
|
-
|
|
2165
|
+
const value = this.safeValue(dictionaryOrList, key1);
|
|
2166
|
+
if (typeof value === 'boolean') {
|
|
2167
|
+
return value;
|
|
2168
|
+
}
|
|
2169
|
+
const value2 = this.safeValue(dictionaryOrList, key2);
|
|
2170
|
+
if (typeof value2 === 'boolean') {
|
|
2171
|
+
return value2;
|
|
2172
|
+
}
|
|
2173
|
+
return defaultValue;
|
|
2156
2174
|
}
|
|
2157
|
-
safeBool(
|
|
2175
|
+
safeBool(dictionaryOrList, key, defaultValue = undefined) {
|
|
2158
2176
|
/**
|
|
2159
2177
|
* @ignore
|
|
2160
2178
|
* @method
|
|
2161
2179
|
* @description safely extract boolean value from dictionary or list
|
|
2162
2180
|
* @returns {bool | undefined}
|
|
2163
2181
|
*/
|
|
2164
|
-
const value = this.safeValue(
|
|
2182
|
+
const value = this.safeValue(dictionaryOrList, key, defaultValue);
|
|
2165
2183
|
if (typeof value === 'boolean') {
|
|
2166
2184
|
return value;
|
|
2167
2185
|
}
|
|
@@ -2183,14 +2201,14 @@ class Exchange {
|
|
|
2183
2201
|
}
|
|
2184
2202
|
return defaultValue;
|
|
2185
2203
|
}
|
|
2186
|
-
safeDict(
|
|
2204
|
+
safeDict(dictionaryOrList, key, defaultValue = undefined) {
|
|
2187
2205
|
/**
|
|
2188
2206
|
* @ignore
|
|
2189
2207
|
* @method
|
|
2190
2208
|
* @description safely extract a dictionary from dictionary or list
|
|
2191
2209
|
* @returns {object | undefined}
|
|
2192
2210
|
*/
|
|
2193
|
-
const value = this.safeValue(
|
|
2211
|
+
const value = this.safeValue(dictionaryOrList, key, defaultValue);
|
|
2194
2212
|
if (value === undefined) {
|
|
2195
2213
|
return defaultValue;
|
|
2196
2214
|
}
|
|
@@ -2199,14 +2217,22 @@ class Exchange {
|
|
|
2199
2217
|
}
|
|
2200
2218
|
return defaultValue;
|
|
2201
2219
|
}
|
|
2202
|
-
safeDict2(
|
|
2220
|
+
safeDict2(dictionaryOrList, key1, key2, defaultValue = undefined) {
|
|
2203
2221
|
/**
|
|
2204
2222
|
* @ignore
|
|
2205
2223
|
* @method
|
|
2206
2224
|
* @description safely extract a dictionary from dictionary or list
|
|
2207
2225
|
* @returns {object | undefined}
|
|
2208
2226
|
*/
|
|
2209
|
-
|
|
2227
|
+
const value = this.safeValue(dictionaryOrList, key1);
|
|
2228
|
+
if ((value !== undefined) && (typeof value === 'object') && !Array.isArray(value)) {
|
|
2229
|
+
return value;
|
|
2230
|
+
}
|
|
2231
|
+
const value2 = this.safeValue(dictionaryOrList, key2);
|
|
2232
|
+
if ((value2 !== undefined) && (typeof value2 === 'object') && !Array.isArray(value2)) {
|
|
2233
|
+
return value2;
|
|
2234
|
+
}
|
|
2235
|
+
return defaultValue;
|
|
2210
2236
|
}
|
|
2211
2237
|
safeListN(dictionaryOrList, keys, defaultValue = undefined) {
|
|
2212
2238
|
/**
|
|
@@ -2234,7 +2260,15 @@ class Exchange {
|
|
|
2234
2260
|
* @description safely extract an Array from dictionary or list
|
|
2235
2261
|
* @returns {Array | undefined}
|
|
2236
2262
|
*/
|
|
2237
|
-
|
|
2263
|
+
const value = this.safeValue(dictionaryOrList, key1);
|
|
2264
|
+
if ((value !== undefined) && Array.isArray(value)) {
|
|
2265
|
+
return value;
|
|
2266
|
+
}
|
|
2267
|
+
const value2 = this.safeValue(dictionaryOrList, key2);
|
|
2268
|
+
if ((value2 !== undefined) && Array.isArray(value2)) {
|
|
2269
|
+
return value2;
|
|
2270
|
+
}
|
|
2271
|
+
return defaultValue;
|
|
2238
2272
|
}
|
|
2239
2273
|
safeList(dictionaryOrList, key, defaultValue = undefined) {
|
|
2240
2274
|
/**
|
|
@@ -2262,7 +2296,7 @@ class Exchange {
|
|
|
2262
2296
|
}
|
|
2263
2297
|
handleDeltasWithKeys(bookSide, deltas, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
2264
2298
|
for (let i = 0; i < deltas.length; i++) {
|
|
2265
|
-
const bidAsk = this.
|
|
2299
|
+
const bidAsk = this.parseOrderBookBidAsk(deltas[i], priceKey, amountKey, countOrIdKey);
|
|
2266
2300
|
bookSide.storeArray(bidAsk);
|
|
2267
2301
|
}
|
|
2268
2302
|
}
|
|
@@ -2719,6 +2753,9 @@ class Exchange {
|
|
|
2719
2753
|
const arr = this.toArray(rawCurrencies);
|
|
2720
2754
|
for (let i = 0; i < arr.length; i++) {
|
|
2721
2755
|
const parsed = this.parseCurrency(arr[i]);
|
|
2756
|
+
if (parsed === undefined) {
|
|
2757
|
+
continue;
|
|
2758
|
+
}
|
|
2722
2759
|
const code = parsed['code'];
|
|
2723
2760
|
result[code] = parsed;
|
|
2724
2761
|
}
|
|
@@ -3244,21 +3281,6 @@ class Exchange {
|
|
|
3244
3281
|
if (currencyWithdraw === undefined || withdraw) {
|
|
3245
3282
|
currency['withdraw'] = withdraw;
|
|
3246
3283
|
}
|
|
3247
|
-
// set network 'active' to false if D or W is disabled
|
|
3248
|
-
let active = this.safeBool(network, 'active');
|
|
3249
|
-
if (active === undefined) {
|
|
3250
|
-
if (deposit && withdraw) {
|
|
3251
|
-
currency['networks'][key]['active'] = true;
|
|
3252
|
-
}
|
|
3253
|
-
else if (deposit !== undefined && withdraw !== undefined) {
|
|
3254
|
-
currency['networks'][key]['active'] = false;
|
|
3255
|
-
}
|
|
3256
|
-
}
|
|
3257
|
-
active = this.safeBool(currency['networks'][key], 'active'); // dict might have been updated on above lines, so access directly instead of `network` variable
|
|
3258
|
-
const currencyActive = this.safeBool(currency, 'active');
|
|
3259
|
-
if (currencyActive === undefined || active) {
|
|
3260
|
-
currency['active'] = active;
|
|
3261
|
-
}
|
|
3262
3284
|
// find lowest fee (which is more desired)
|
|
3263
3285
|
const fee = this.safeString(network, 'fee');
|
|
3264
3286
|
const feeMain = this.safeString(currency, 'fee');
|
|
@@ -4108,6 +4130,21 @@ class Exchange {
|
|
|
4108
4130
|
}
|
|
4109
4131
|
return arr[length - 1];
|
|
4110
4132
|
}
|
|
4133
|
+
addKeyInArrayItems(obj, keyName) {
|
|
4134
|
+
const result = [];
|
|
4135
|
+
const keys = Object.keys(obj);
|
|
4136
|
+
for (let i = 0; i < keys.length; i++) {
|
|
4137
|
+
const key = keys[i];
|
|
4138
|
+
const item = obj[key];
|
|
4139
|
+
if (item === undefined) {
|
|
4140
|
+
continue;
|
|
4141
|
+
}
|
|
4142
|
+
const itemWithKey = this.extend({}, item);
|
|
4143
|
+
itemWithKey[keyName] = key;
|
|
4144
|
+
result.push(itemWithKey);
|
|
4145
|
+
}
|
|
4146
|
+
return result;
|
|
4147
|
+
}
|
|
4111
4148
|
invertFlatStringDictionary(dict) {
|
|
4112
4149
|
const reversed = {};
|
|
4113
4150
|
const keys = Object.keys(dict);
|
|
@@ -4534,11 +4571,11 @@ class Exchange {
|
|
|
4534
4571
|
}
|
|
4535
4572
|
return result;
|
|
4536
4573
|
}
|
|
4537
|
-
|
|
4574
|
+
parseOrderBookBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
4538
4575
|
bidasks = this.toArray(bidasks);
|
|
4539
4576
|
const result = [];
|
|
4540
4577
|
for (let i = 0; i < bidasks.length; i++) {
|
|
4541
|
-
result.push(this.
|
|
4578
|
+
result.push(this.parseOrderBookBidAsk(bidasks[i], priceKey, amountKey, countOrIdKey));
|
|
4542
4579
|
}
|
|
4543
4580
|
return result;
|
|
4544
4581
|
}
|
|
@@ -4788,8 +4825,8 @@ class Exchange {
|
|
|
4788
4825
|
return this.parseNumber(value, d);
|
|
4789
4826
|
}
|
|
4790
4827
|
parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
4791
|
-
const bids = this.
|
|
4792
|
-
const asks = this.
|
|
4828
|
+
const bids = this.parseOrderBookBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
4829
|
+
const asks = this.parseOrderBookBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
|
|
4793
4830
|
return {
|
|
4794
4831
|
'symbol': symbol,
|
|
4795
4832
|
'bids': this.sortBy(bids, 0, true),
|
|
@@ -5347,7 +5384,7 @@ class Exchange {
|
|
|
5347
5384
|
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
5348
5385
|
throw new errors.NotSupported(this.id + ' fetchLedgerEntry() is not supported yet');
|
|
5349
5386
|
}
|
|
5350
|
-
|
|
5387
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
5351
5388
|
const price = this.safeFloat(bidask, priceKey);
|
|
5352
5389
|
const amount = this.safeFloat(bidask, amountKey);
|
|
5353
5390
|
const countOrId = this.safeInteger(bidask, countOrIdKey);
|
|
@@ -27,6 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
let fsSyncModule = null;
|
|
28
28
|
let osSyncModule = null;
|
|
29
29
|
let pathSyncModule = null;
|
|
30
|
+
let urlSyncModule = null;
|
|
30
31
|
/* ------------------------------------------------------------------------ */
|
|
31
32
|
/**
|
|
32
33
|
* Initialize synchronous file system module (Node.js only)
|
|
@@ -53,6 +54,12 @@ async function initFileSystem() {
|
|
|
53
54
|
}
|
|
54
55
|
catch (e) { } // Silent fail in browser or if path is unavailable
|
|
55
56
|
}
|
|
57
|
+
if (urlSyncModule === null) {
|
|
58
|
+
try {
|
|
59
|
+
urlSyncModule = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(/* webpackIgnore: true */ 'node:url')); });
|
|
60
|
+
}
|
|
61
|
+
catch (e) { } // Silent fail in browser or if url is unavailable
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
64
|
}
|
|
58
65
|
if (platform.isNode) {
|
|
@@ -152,8 +159,26 @@ function existsFile(path) {
|
|
|
152
159
|
return false;
|
|
153
160
|
}
|
|
154
161
|
}
|
|
162
|
+
/* ------------------------------------------------------------------------ */
|
|
163
|
+
/**
|
|
164
|
+
* Convert file-path to file-url format on Windows, to avoid ESM loader error when using absolute paths, like:
|
|
165
|
+
* 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)
|
|
166
|
+
* @param filePath File path to check
|
|
167
|
+
* @returns filepath original or converted to file URL format on Windows
|
|
168
|
+
*/
|
|
169
|
+
function filePathToFileUrlForWindows(filePath) {
|
|
170
|
+
if (!platform.isNode || !filePath || filePath.startsWith('file://') || osSyncModule === null || urlSyncModule === null) {
|
|
171
|
+
return filePath;
|
|
172
|
+
}
|
|
173
|
+
if (osSyncModule.platform() !== 'win32') {
|
|
174
|
+
return filePath;
|
|
175
|
+
}
|
|
176
|
+
const looksLikeWindowsPath = /^[a-zA-Z]:[\\/]/.test(filePath) || filePath.startsWith('\\\\');
|
|
177
|
+
return looksLikeWindowsPath ? urlSyncModule.pathToFileURL(filePath).href : filePath;
|
|
178
|
+
}
|
|
155
179
|
|
|
156
180
|
exports.existsFile = existsFile;
|
|
181
|
+
exports.filePathToFileUrlForWindows = filePathToFileUrlForWindows;
|
|
157
182
|
exports.getTempDir = getTempDir;
|
|
158
183
|
exports.initFileSystem = initFileSystem;
|
|
159
184
|
exports.readFile = readFile;
|
|
@@ -161,6 +161,7 @@ exports.roundTimeframe = misc.roundTimeframe;
|
|
|
161
161
|
exports.selfIsDefined = misc.selfIsDefined;
|
|
162
162
|
exports.vwap = misc.vwap;
|
|
163
163
|
exports.existsFile = io.existsFile;
|
|
164
|
+
exports.filePathToFileUrlForWindows = io.filePathToFileUrlForWindows;
|
|
164
165
|
exports.getTempDir = io.getTempDir;
|
|
165
166
|
exports.initFileSystem = io.initFileSystem;
|
|
166
167
|
exports.readFile = io.readFile;
|
package/dist/cjs/src/bigone.js
CHANGED
|
@@ -533,7 +533,7 @@ class bigone extends bigone$1["default"] {
|
|
|
533
533
|
for (let j = 0; j < chains.length; j++) {
|
|
534
534
|
const chain = chains[j];
|
|
535
535
|
const networkId = this.safeString(chain, 'gateway_name');
|
|
536
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
536
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
537
537
|
const deposit = this.safeBool(chain, 'is_deposit_enabled');
|
|
538
538
|
const withdraw = this.safeBool(chain, 'is_withdrawal_enabled');
|
|
539
539
|
const minDepositAmount = this.safeString(chain, 'min_deposit_amount');
|
|
@@ -2007,7 +2007,7 @@ class bigone extends bigone$1["default"] {
|
|
|
2007
2007
|
return {
|
|
2008
2008
|
'info': response,
|
|
2009
2009
|
'currency': code,
|
|
2010
|
-
'network': this.networkIdToCode(selectedNetworkId),
|
|
2010
|
+
'network': this.networkIdToCode(selectedNetworkId, code),
|
|
2011
2011
|
'address': address,
|
|
2012
2012
|
'tag': tag,
|
|
2013
2013
|
};
|
|
@@ -2313,7 +2313,7 @@ class bigone extends bigone$1["default"] {
|
|
|
2313
2313
|
let networkCode = undefined;
|
|
2314
2314
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2315
2315
|
if (networkCode !== undefined) {
|
|
2316
|
-
request['gateway_name'] = this.networkCodeToId(networkCode);
|
|
2316
|
+
request['gateway_name'] = this.networkCodeToId(networkCode, currency['code']);
|
|
2317
2317
|
}
|
|
2318
2318
|
// requires write permission on the wallet
|
|
2319
2319
|
const response = await this.privatePostWithdrawals(this.extend(request, params));
|