ccxt-ir 4.24.0 → 4.24.1
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 +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +262 -262
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/abstract/balinex.js +1 -1
- package/dist/cjs/src/balinex.js +217 -217
- package/dist/cjs/src/bitbarg.js +322 -322
- package/dist/cjs/src/bitpin.js +34 -24
- package/dist/cjs/src/nobitex.js +25 -26
- package/dist/cjs/src/swapwallet.js +209 -209
- package/dist/cjs/src/wallex.js +105 -18
- package/js/ccxt.d.ts +772 -772
- package/js/ccxt.js +557 -557
- package/js/src/abstract/balinex.d.ts +8 -8
- package/js/src/abstract/balinex.js +5 -5
- package/js/src/abstract/swapwallet.js +5 -5
- package/js/src/abstract/wallex.d.ts +2 -0
- package/js/src/balinex.d.ts +20 -20
- package/js/src/balinex.js +220 -220
- package/js/src/base/Exchange.d.ts +926 -926
- package/js/src/bitbarg.js +325 -325
- package/js/src/bitpin.d.ts +2 -2
- package/js/src/bitpin.js +34 -24
- package/js/src/coinbaseexchange.d.ts +334 -334
- package/js/src/nobitex.d.ts +2 -2
- package/js/src/nobitex.js +25 -26
- package/js/src/protobuf/mexc/compiled.d.cts +2 -8
- package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
- package/js/src/static_dependencies/qs/formats.d.cts +8 -14
- package/js/src/static_dependencies/qs/index.d.cts +4 -10
- package/js/src/static_dependencies/qs/parse.d.cts +2 -8
- package/js/src/static_dependencies/qs/stringify.d.cts +2 -8
- package/js/src/static_dependencies/qs/utils.d.cts +9 -15
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
- package/js/src/swapwallet.js +212 -212
- package/js/src/wallex.d.ts +2 -2
- package/js/src/wallex.js +105 -18
- package/js/test.js +51 -62
- package/package.json +1 -1
package/js/test.js
CHANGED
|
@@ -4,65 +4,54 @@
|
|
|
4
4
|
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
5
|
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
async function main() {
|
|
60
|
-
for (let i = 0; i < exchanges.length; i++) {
|
|
61
|
-
const entry = exchanges[i];
|
|
62
|
-
await testExchange(entry['id'], entry['Exchange']);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
main().catch((error) => {
|
|
66
|
-
console.error('Gold platform price test failed:', error);
|
|
67
|
-
process.exitCode = 1;
|
|
68
|
-
});
|
|
7
|
+
import ccxt from './ccxt.js';
|
|
8
|
+
// Change these names, or pass them on the command line.
|
|
9
|
+
const exchangeNames = ['bitpin', 'wallex', 'nobitex'];
|
|
10
|
+
const sampleSize = 5;
|
|
11
|
+
async function testExchange(id) {
|
|
12
|
+
if (!ccxt.exchanges.includes(id)) {
|
|
13
|
+
throw new Error('Unknown exchange: ' + id);
|
|
14
|
+
}
|
|
15
|
+
const exchange = new ccxt[id]({ 'enableRateLimit': true, 'timeout': 20000 });
|
|
16
|
+
try {
|
|
17
|
+
const types = ['spot', 'otc'].filter(type => exchange.has[type]);
|
|
18
|
+
if (types.length === 0) {
|
|
19
|
+
types.push('default');
|
|
20
|
+
}
|
|
21
|
+
for (const type of types) {
|
|
22
|
+
// Spot uses the default params; OTC is selected explicitly.
|
|
23
|
+
const params = (type === 'otc') ? { 'type': 'otc' } : {};
|
|
24
|
+
const markets = await exchange.fetchMarkets(params);
|
|
25
|
+
const symbols = markets.slice(0, sampleSize).map(market => market.symbol);
|
|
26
|
+
const tickers = await exchange.fetchTickers(symbols, params);
|
|
27
|
+
console.log('\n' + id + ' ' + type.toUpperCase() + ': ' + markets.length + ' markets');
|
|
28
|
+
console.table(Object.values(tickers).slice(0, sampleSize).map(ticker => ({
|
|
29
|
+
'symbol': ticker.symbol,
|
|
30
|
+
'last': ticker.last,
|
|
31
|
+
'bid': ticker.bid,
|
|
32
|
+
'ask': ticker.ask,
|
|
33
|
+
'high': ticker.high,
|
|
34
|
+
'low': ticker.low,
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
await exchange.close();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function main() {
|
|
43
|
+
const names = process.argv.length > 2 ? process.argv.slice(2) : exchangeNames;
|
|
44
|
+
for (const id of names) {
|
|
45
|
+
try {
|
|
46
|
+
await testExchange(id);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error(id + ' failed:', error);
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
main().catch((error) => {
|
|
55
|
+
console.error(error);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
});
|
package/package.json
CHANGED