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.
Files changed (40) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +262 -262
  4. package/dist/cjs/package.json +1 -1
  5. package/dist/cjs/src/abstract/balinex.js +1 -1
  6. package/dist/cjs/src/balinex.js +217 -217
  7. package/dist/cjs/src/bitbarg.js +322 -322
  8. package/dist/cjs/src/bitpin.js +34 -24
  9. package/dist/cjs/src/nobitex.js +25 -26
  10. package/dist/cjs/src/swapwallet.js +209 -209
  11. package/dist/cjs/src/wallex.js +105 -18
  12. package/js/ccxt.d.ts +772 -772
  13. package/js/ccxt.js +557 -557
  14. package/js/src/abstract/balinex.d.ts +8 -8
  15. package/js/src/abstract/balinex.js +5 -5
  16. package/js/src/abstract/swapwallet.js +5 -5
  17. package/js/src/abstract/wallex.d.ts +2 -0
  18. package/js/src/balinex.d.ts +20 -20
  19. package/js/src/balinex.js +220 -220
  20. package/js/src/base/Exchange.d.ts +926 -926
  21. package/js/src/bitbarg.js +325 -325
  22. package/js/src/bitpin.d.ts +2 -2
  23. package/js/src/bitpin.js +34 -24
  24. package/js/src/coinbaseexchange.d.ts +334 -334
  25. package/js/src/nobitex.d.ts +2 -2
  26. package/js/src/nobitex.js +25 -26
  27. package/js/src/protobuf/mexc/compiled.d.cts +2 -8
  28. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  29. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  30. package/js/src/static_dependencies/qs/formats.d.cts +8 -14
  31. package/js/src/static_dependencies/qs/index.d.cts +4 -10
  32. package/js/src/static_dependencies/qs/parse.d.cts +2 -8
  33. package/js/src/static_dependencies/qs/stringify.d.cts +2 -8
  34. package/js/src/static_dependencies/qs/utils.d.cts +9 -15
  35. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  36. package/js/src/swapwallet.js +212 -212
  37. package/js/src/wallex.d.ts +2 -2
  38. package/js/src/wallex.js +105 -18
  39. package/js/test.js +51 -62
  40. 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 { balinex } from './ccxt.js';
8
- const exchanges = [
9
- // { 'id': 'technogold', 'Exchange': technogold },
10
- // { 'id': 'baazar', 'Exchange': baazar },
11
- // { 'id': 'hamrahgold', 'Exchange': hamrahgold },
12
- // { 'id': 'zarniv', 'Exchange': zarniv },
13
- // { 'id': 'zarminex', 'Exchange': zarminex },
14
- // { 'id': 'zarafza', 'Exchange': zarafza },
15
- // { 'id': 'daric', 'Exchange': daric },
16
- // { 'id': 'digikalagold', 'Exchange': digikalagold },
17
- // { 'id': 'gerami', 'Exchange': gerami },
18
- // { 'id': 'goldika', 'Exchange': goldika },
19
- // { 'id': 'goldis', 'Exchange': goldis },
20
- { 'id': 'balinex', 'Exchange': balinex },
21
- // { 'id': 'milligold', 'Exchange': milligold },
22
- // { 'id': 'ramzinex', 'Exchange': ramzinex },
23
- // { 'id': 'wallgold', 'Exchange': wallgold },
24
- // { 'id': 'talapp', 'Exchange': talapp },
25
- // { 'id': 'talaavan', 'Exchange': talaavan },
26
- // { 'id': 'talasea', 'Exchange': talasea },
27
- // { 'id': 'zarpin', 'Exchange': zarpin },
28
- ];
29
- async function testExchange(id, ExchangeClass) {
30
- const exchange = new ExchangeClass({
31
- 'enableRateLimit': true,
32
- 'timeout': 20000,
33
- });
34
- try {
35
- const tickers = await exchange.fetchTickers();
36
- const symbols = Object.keys(tickers);
37
- for (let i = 0; i < symbols.length; i++) {
38
- const symbol = symbols[i];
39
- const ticker = tickers[symbol];
40
- const bid = ticker['bid'];
41
- const ask = ticker['ask'];
42
- const last = ticker['last'];
43
- if (bid !== undefined || ask !== undefined) {
44
- let expectedLast = bid;
45
- if (ask !== undefined && (expectedLast === undefined || ask > expectedLast)) {
46
- expectedLast = ask;
47
- }
48
- if (last !== expectedLast) {
49
- throw new Error(symbol + ' last=' + last + ', expected=' + expectedLast);
50
- }
51
- }
52
- console.log(id + ' ' + symbol + ' bid=' + bid + ' ask=' + ask + ' last=' + last + ' high=' + ticker['high'] + ' low=' + ticker['low'] + ' OK');
53
- }
54
- }
55
- finally {
56
- await exchange.close();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt-ir",
3
- "version": "4.24.0",
3
+ "version": "4.24.1",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",