ccxt 4.5.55 → 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 +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- 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 +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- 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 +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.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/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- 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/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.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 +3 -3
- 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 +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- 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/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- 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 +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- 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 +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- 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 +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- 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 +72 -76
- 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 +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- 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 +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- 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 +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.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/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- 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/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- 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/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- 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 +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- 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 -2924
- 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
|
@@ -317,6 +317,7 @@ export default class mexc extends Exchange {
|
|
|
317
317
|
'position/funding_records': 2,
|
|
318
318
|
'position/position_mode': 2,
|
|
319
319
|
'order/list/open_orders/{symbol}': 2,
|
|
320
|
+
'order/list/open_orders': 2,
|
|
320
321
|
'order/list/history_orders': 2,
|
|
321
322
|
'order/list/order_deals/v3': 2,
|
|
322
323
|
'order/external/{symbol}/{external_oid}': 2,
|
|
@@ -1145,56 +1146,54 @@ export default class mexc extends Exchange {
|
|
|
1145
1146
|
// ]
|
|
1146
1147
|
// }
|
|
1147
1148
|
//
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
'active': undefined,
|
|
1164
|
-
'deposit': this.safeBool(chain, 'depositEnable', false),
|
|
1165
|
-
'withdraw': this.safeBool(chain, 'withdrawEnable', false),
|
|
1166
|
-
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1167
|
-
'precision': undefined,
|
|
1168
|
-
'limits': {
|
|
1169
|
-
'withdraw': {
|
|
1170
|
-
'min': this.safeString(chain, 'withdrawMin'),
|
|
1171
|
-
'max': this.safeString(chain, 'withdrawMax'),
|
|
1172
|
-
},
|
|
1173
|
-
},
|
|
1174
|
-
'contract': this.safeString(chain, 'contract'),
|
|
1175
|
-
};
|
|
1176
|
-
}
|
|
1177
|
-
result[code] = this.safeCurrencyStructure({
|
|
1178
|
-
'info': currency,
|
|
1179
|
-
'id': id,
|
|
1180
|
-
'code': code,
|
|
1181
|
-
'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,
|
|
1182
1164
|
'active': undefined,
|
|
1183
|
-
'deposit':
|
|
1184
|
-
'withdraw':
|
|
1185
|
-
'fee':
|
|
1165
|
+
'deposit': this.safeBool(chain, 'depositEnable', false),
|
|
1166
|
+
'withdraw': this.safeBool(chain, 'withdrawEnable', false),
|
|
1167
|
+
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1186
1168
|
'precision': undefined,
|
|
1187
1169
|
'limits': {
|
|
1188
|
-
'
|
|
1189
|
-
'min':
|
|
1190
|
-
'max':
|
|
1170
|
+
'withdraw': {
|
|
1171
|
+
'min': this.safeString(chain, 'withdrawMin'),
|
|
1172
|
+
'max': this.safeString(chain, 'withdrawMax'),
|
|
1191
1173
|
},
|
|
1192
1174
|
},
|
|
1193
|
-
'
|
|
1194
|
-
|
|
1195
|
-
});
|
|
1175
|
+
'contract': this.safeString(chain, 'contract'),
|
|
1176
|
+
};
|
|
1196
1177
|
}
|
|
1197
|
-
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
|
+
});
|
|
1198
1197
|
}
|
|
1199
1198
|
/**
|
|
1200
1199
|
* @method
|
|
@@ -1532,7 +1531,7 @@ export default class mexc extends Exchange {
|
|
|
1532
1531
|
}
|
|
1533
1532
|
return orderbook;
|
|
1534
1533
|
}
|
|
1535
|
-
|
|
1534
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
1536
1535
|
const countKey = 2;
|
|
1537
1536
|
const price = this.safeNumber(bidask, priceKey);
|
|
1538
1537
|
const amount = this.safeNumber(bidask, amountKey);
|
|
@@ -2591,8 +2590,10 @@ export default class mexc extends Exchange {
|
|
|
2591
2590
|
// Trigger
|
|
2592
2591
|
// {"success":true,"code":0,"data":259208506303929856}
|
|
2593
2592
|
//
|
|
2594
|
-
|
|
2595
|
-
|
|
2593
|
+
// {"success":true,"code":0,"data":{"orderId":"814218083416790528","ts":1779795118533}}
|
|
2594
|
+
//
|
|
2595
|
+
const data = this.safeDict(response, 'data');
|
|
2596
|
+
return this.safeOrder({ 'id': this.safeString(data, 'orderId'), 'timestamp': this.safeInteger(data, 'ts') }, market);
|
|
2596
2597
|
}
|
|
2597
2598
|
/**
|
|
2598
2599
|
* @method
|
|
@@ -3125,8 +3126,12 @@ export default class mexc extends Exchange {
|
|
|
3125
3126
|
return this.parseOrders(response, market, since, limit);
|
|
3126
3127
|
}
|
|
3127
3128
|
else {
|
|
3128
|
-
|
|
3129
|
-
|
|
3129
|
+
if (limit === undefined) {
|
|
3130
|
+
request['page_size'] = 100; // max
|
|
3131
|
+
}
|
|
3132
|
+
const swapResponse = await this.contractPrivateGetOrderListOpenOrders(this.extend(request, params));
|
|
3133
|
+
const data = this.safeList(swapResponse, 'data', []);
|
|
3134
|
+
return this.parseOrders(data, market, since, limit, params);
|
|
3130
3135
|
}
|
|
3131
3136
|
}
|
|
3132
3137
|
/**
|
|
@@ -3916,7 +3921,7 @@ export default class mexc extends Exchange {
|
|
|
3916
3921
|
for (let i = 0; i < wallet.length; i++) {
|
|
3917
3922
|
const entry = wallet[i];
|
|
3918
3923
|
const marketId = this.safeString(entry, 'symbol');
|
|
3919
|
-
const symbol = this.safeSymbol(marketId
|
|
3924
|
+
const symbol = this.safeSymbol(marketId);
|
|
3920
3925
|
const base = this.safeValue(entry, 'baseAsset', {});
|
|
3921
3926
|
const quote = this.safeValue(entry, 'quoteAsset', {});
|
|
3922
3927
|
const baseCode = this.safeCurrencyCode(this.safeString(base, 'asset'));
|
|
@@ -4726,14 +4731,17 @@ export default class mexc extends Exchange {
|
|
|
4726
4731
|
}
|
|
4727
4732
|
while (Precise.stringLt(floor, maxVol)) {
|
|
4728
4733
|
const cap = Precise.stringAdd(floor, riskIncrVol);
|
|
4734
|
+
const minNotional = this.parseNumber(floor);
|
|
4735
|
+
const mainMarginRate = this.parseNumber(maintenanceMarginRate);
|
|
4736
|
+
const maxLev = this.parseNumber(Precise.stringDiv('1', initialMarginRate));
|
|
4729
4737
|
tiers.push({
|
|
4730
4738
|
'tier': this.parseNumber(Precise.stringDiv(cap, riskIncrVol)),
|
|
4731
4739
|
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
4732
4740
|
'currency': this.safeCurrencyCode(quoteId),
|
|
4733
|
-
'minNotional':
|
|
4741
|
+
'minNotional': minNotional,
|
|
4734
4742
|
'maxNotional': this.parseNumber(cap),
|
|
4735
|
-
'maintenanceMarginRate':
|
|
4736
|
-
'maxLeverage':
|
|
4743
|
+
'maintenanceMarginRate': mainMarginRate,
|
|
4744
|
+
'maxLeverage': maxLev,
|
|
4737
4745
|
'info': info,
|
|
4738
4746
|
});
|
|
4739
4747
|
initialMarginRate = Precise.stringAdd(initialMarginRate, riskIncrImr);
|
|
@@ -4753,11 +4761,12 @@ export default class mexc extends Exchange {
|
|
|
4753
4761
|
//
|
|
4754
4762
|
const address = this.safeString(depositAddress, 'address');
|
|
4755
4763
|
const currencyId = this.safeString(depositAddress, 'coin');
|
|
4764
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4756
4765
|
const networkId = this.safeString(depositAddress, 'netWork');
|
|
4757
4766
|
return {
|
|
4758
4767
|
'info': depositAddress,
|
|
4759
|
-
'currency':
|
|
4760
|
-
'network': this.networkIdToCode(networkId,
|
|
4768
|
+
'currency': code,
|
|
4769
|
+
'network': this.networkIdToCode(networkId, code),
|
|
4761
4770
|
'address': address,
|
|
4762
4771
|
'tag': this.safeString(depositAddress, 'memo'),
|
|
4763
4772
|
};
|
|
@@ -5076,12 +5085,12 @@ export default class mexc extends Exchange {
|
|
|
5076
5085
|
if (currencyWithNetwork !== undefined) {
|
|
5077
5086
|
currencyId = currencyWithNetwork.split('-')[0];
|
|
5078
5087
|
}
|
|
5088
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
5079
5089
|
let network = undefined;
|
|
5080
5090
|
const rawNetwork = this.safeString(transaction, 'network');
|
|
5081
5091
|
if (rawNetwork !== undefined) {
|
|
5082
|
-
network = this.networkIdToCode(rawNetwork);
|
|
5092
|
+
network = this.networkIdToCode(rawNetwork, code);
|
|
5083
5093
|
}
|
|
5084
|
-
const code = this.safeCurrencyCode(currencyId, currency);
|
|
5085
5094
|
const status = this.parseTransactionStatusByType(this.safeString(transaction, 'status'), type);
|
|
5086
5095
|
let amountString = this.safeString(transaction, 'amount');
|
|
5087
5096
|
const address = this.safeString(transaction, 'address');
|
|
@@ -5359,8 +5368,8 @@ export default class mexc extends Exchange {
|
|
|
5359
5368
|
* @description fetch a history of internal transfers made on an account
|
|
5360
5369
|
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
|
5361
5370
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
|
5362
|
-
* @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
|
|
5363
|
-
* @param code
|
|
5371
|
+
* @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
|
|
5372
|
+
* @param {string} [code] unified currency code of the currency transferred
|
|
5364
5373
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
5365
5374
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
5366
5375
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -6098,8 +6107,8 @@ export default class mexc extends Exchange {
|
|
|
6098
6107
|
if (market['spot']) {
|
|
6099
6108
|
throw new BadSymbol(this.id + ' setMarginMode() supports contract markets only');
|
|
6100
6109
|
}
|
|
6101
|
-
|
|
6102
|
-
if (
|
|
6110
|
+
const marginModeLower = marginMode.toLowerCase();
|
|
6111
|
+
if (marginModeLower !== 'isolated' && marginModeLower !== 'cross') {
|
|
6103
6112
|
throw new BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
|
|
6104
6113
|
}
|
|
6105
6114
|
const leverage = this.safeInteger(params, 'leverage');
|
|
@@ -6109,7 +6118,7 @@ export default class mexc extends Exchange {
|
|
|
6109
6118
|
const direction = this.safeStringLower2(params, 'direction', 'positionId');
|
|
6110
6119
|
const request = {
|
|
6111
6120
|
'leverage': leverage,
|
|
6112
|
-
'openType': (
|
|
6121
|
+
'openType': (marginModeLower === 'isolated') ? 1 : 2,
|
|
6113
6122
|
};
|
|
6114
6123
|
if (symbol !== undefined) {
|
|
6115
6124
|
request['symbol'] = market['id'];
|
|
@@ -6225,7 +6234,7 @@ export default class mexc extends Exchange {
|
|
|
6225
6234
|
if (success === true) {
|
|
6226
6235
|
return undefined;
|
|
6227
6236
|
}
|
|
6228
|
-
const responseCode = this.safeString(response, 'code'
|
|
6237
|
+
const responseCode = this.safeString(response, 'code');
|
|
6229
6238
|
if ((responseCode !== undefined) && (responseCode !== '200') && (responseCode !== '0')) {
|
|
6230
6239
|
const feedback = this.id + ' ' + body;
|
|
6231
6240
|
this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
|
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);
|
|
@@ -1400,7 +1398,7 @@ export default class modetrade extends Exchange {
|
|
|
1400
1398
|
'fok': 'FOK',
|
|
1401
1399
|
'post_only': 'PO',
|
|
1402
1400
|
};
|
|
1403
|
-
return this.safeString(timeInForces, timeInForce
|
|
1401
|
+
return this.safeString(timeInForces, timeInForce);
|
|
1404
1402
|
}
|
|
1405
1403
|
parseOrderStatus(status) {
|
|
1406
1404
|
if (status !== undefined) {
|
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);
|
|
@@ -1818,6 +1829,9 @@ export default class okx extends Exchange {
|
|
|
1818
1829
|
let maxLeverage = this.safeString(market, 'lever', '1');
|
|
1819
1830
|
maxLeverage = Precise.stringMax(maxLeverage, '1');
|
|
1820
1831
|
const maxSpotCost = this.safeNumber(market, 'maxMktSz');
|
|
1832
|
+
const leverageAboveOne = Precise.stringGt(maxLeverage, '1');
|
|
1833
|
+
const quoteEqualSettle = (quoteId === settleId);
|
|
1834
|
+
const baseEqualSettle = (baseId === settleId);
|
|
1821
1835
|
const status = this.safeString(market, 'state');
|
|
1822
1836
|
const instIdCode = this.safeInteger(market, 'instIdCode');
|
|
1823
1837
|
return this.extend(fees, {
|
|
@@ -1832,14 +1846,14 @@ export default class okx extends Exchange {
|
|
|
1832
1846
|
'settleId': settleId,
|
|
1833
1847
|
'type': type,
|
|
1834
1848
|
'spot': spot,
|
|
1835
|
-
'margin': spot &&
|
|
1849
|
+
'margin': spot && leverageAboveOne,
|
|
1836
1850
|
'swap': swap,
|
|
1837
1851
|
'future': future,
|
|
1838
1852
|
'option': option,
|
|
1839
1853
|
'active': status === 'live',
|
|
1840
1854
|
'contract': contract,
|
|
1841
|
-
'linear': contract ?
|
|
1842
|
-
'inverse': contract ?
|
|
1855
|
+
'linear': contract ? quoteEqualSettle : undefined,
|
|
1856
|
+
'inverse': contract ? baseEqualSettle : undefined,
|
|
1843
1857
|
'contractSize': contract ? this.safeNumber(market, 'ctVal') : undefined,
|
|
1844
1858
|
'expiry': expiry,
|
|
1845
1859
|
'expiryDatetime': this.iso8601(expiry),
|
|
@@ -1930,6 +1944,10 @@ export default class okx extends Exchange {
|
|
|
1930
1944
|
const marketsWithoutTest = [];
|
|
1931
1945
|
for (let i = 0; i < dataResponse.length; i++) {
|
|
1932
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
|
+
}
|
|
1933
1951
|
if (this.isSandboxModeEnabled) {
|
|
1934
1952
|
const instFamily = this.safeString(data, 'instFamily', '');
|
|
1935
1953
|
if (instFamily.startsWith('TEST')) {
|
|
@@ -9200,7 +9218,7 @@ export default class okx extends Exchange {
|
|
|
9200
9218
|
request['end'] = until;
|
|
9201
9219
|
}
|
|
9202
9220
|
if (timeframe !== undefined) {
|
|
9203
|
-
request['period'] = timeframe;
|
|
9221
|
+
request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
|
|
9204
9222
|
}
|
|
9205
9223
|
if (since !== undefined) {
|
|
9206
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/p2b.js
CHANGED
|
@@ -1108,10 +1108,12 @@ export default class p2b extends Exchange {
|
|
|
1108
1108
|
throw new BadRequest(this.id + ' fetchMyTrades () the time between since and params["until"] cannot be greater than 24 hours');
|
|
1109
1109
|
}
|
|
1110
1110
|
const market = this.market(symbol);
|
|
1111
|
+
const sinceSec = this.parseToInt(since / 1000);
|
|
1112
|
+
const untilSec = this.parseToInt(until / 1000);
|
|
1111
1113
|
const request = {
|
|
1112
1114
|
'market': market['id'],
|
|
1113
|
-
'startTime':
|
|
1114
|
-
'endTime':
|
|
1115
|
+
'startTime': sinceSec,
|
|
1116
|
+
'endTime': untilSec,
|
|
1115
1117
|
};
|
|
1116
1118
|
if (limit !== undefined) {
|
|
1117
1119
|
request['limit'] = limit;
|
|
@@ -1184,9 +1186,11 @@ export default class p2b extends Exchange {
|
|
|
1184
1186
|
if ((until - since) > 86400000) {
|
|
1185
1187
|
throw new BadRequest(this.id + ' fetchClosedOrders () the time between since and params["until"] cannot be greater than 24 hours');
|
|
1186
1188
|
}
|
|
1189
|
+
const sinceSec = this.parseToInt(since / 1000);
|
|
1190
|
+
const untilSec = this.parseToInt(until / 1000);
|
|
1187
1191
|
const request = {
|
|
1188
|
-
'startTime':
|
|
1189
|
-
'endTime':
|
|
1192
|
+
'startTime': sinceSec,
|
|
1193
|
+
'endTime': untilSec,
|
|
1190
1194
|
};
|
|
1191
1195
|
if (market !== undefined) {
|
|
1192
1196
|
request['market'] = market['id'];
|