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
@@ -5,223 +5,223 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var balinex$1 = require('./abstract/balinex.js');
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
- // ---------------------------------------------------------------------------
9
- /**
10
- * @class balinex
11
- * @augments Exchange
12
- */
13
- class balinex extends balinex$1["default"] {
14
- describe() {
15
- return this.deepExtend(super.describe(), {
16
- 'id': 'balinex',
17
- 'name': 'Balinex',
18
- 'countries': ['IR'],
19
- 'rateLimit': 1000,
20
- 'version': '1',
21
- 'certified': false,
22
- 'pro': false,
23
- 'has': {
24
- 'CORS': undefined,
25
- 'spot': true,
26
- 'margin': false,
27
- 'swap': false,
28
- 'future': false,
29
- 'option': false,
30
- 'fetchMarkets': true,
31
- 'fetchTicker': true,
32
- 'fetchTickers': true,
33
- },
34
- 'urls': {
35
- 'logo': 'https://balinex.com/favicon.ico',
36
- 'api': {
37
- 'public': 'https://api.balinex.com',
38
- },
39
- 'www': 'https://balinex.com',
40
- 'doc': [
41
- 'https://api.balinex.com/public/markets',
42
- ],
43
- },
44
- 'api': {
45
- 'public': {
46
- 'get': {
47
- 'public/markets': 1,
48
- },
49
- },
50
- },
51
- });
52
- }
53
- async fetchMarkets(params = {}) {
54
- /**
55
- * @method
56
- * @name balinex#fetchMarkets
57
- * @description retrieves data on all markets for balinex
58
- * @see https://api.balinex.com/public/markets
59
- * @param {object} [params] extra parameters specific to the exchange API endpoint
60
- * @returns {object[]} an array of objects representing market data
61
- */
62
- const response = await this.publicGetPublicMarkets(params);
63
- const data = this.safeDict(response, 'result', {});
64
- const items = this.safeList(data, 'items', []);
65
- const result = [];
66
- for (let i = 0; i < items.length; i++) {
67
- result.push(this.parseMarket(items[i]));
68
- }
69
- return result;
70
- }
71
- parseMarket(market) {
72
- // {
73
- // "productId": "ADAUSDT",
74
- // "baseCurrency": "ADA",
75
- // "quoteCurrency": "USDT",
76
- // "baseScale": 2,
77
- // "quoteScale": 4,
78
- // "lastPrice": "0.2047",
79
- // "openPrice24h": "0.2089",
80
- // "highPrice24h": "0.2103",
81
- // "lowPrice24h": "0.2012",
82
- // "volume24h": "1530110.38",
83
- // "quoteVolume24h": "313213.5968",
84
- // "priceChange24h": "-0.0042",
85
- // "percentChange24h": "-2.01",
86
- // "allowBuy": true,
87
- // "allowSell": true
88
- // }
89
- const id = this.safeString(market, 'productId');
90
- const baseId = this.safeString(market, 'baseCurrency');
91
- const quoteId = this.safeString(market, 'quoteCurrency');
92
- const base = this.safeCurrencyCode(baseId);
93
- const quote = this.safeCurrencyCode(quoteId);
94
- const allowBuy = this.safeBool(market, 'allowBuy', false);
95
- const allowSell = this.safeBool(market, 'allowSell', false);
96
- return {
97
- 'id': id,
98
- 'symbol': base + '/' + quote,
99
- 'base': base,
100
- 'quote': quote,
101
- 'settle': undefined,
102
- 'baseId': baseId,
103
- 'quoteId': quoteId,
104
- 'settleId': undefined,
105
- 'type': 'spot',
106
- 'spot': true,
107
- 'margin': false,
108
- 'swap': false,
109
- 'future': false,
110
- 'option': false,
111
- 'active': allowBuy && allowSell,
112
- 'contract': false,
113
- 'linear': undefined,
114
- 'inverse': undefined,
115
- 'contractSize': undefined,
116
- 'expiry': undefined,
117
- 'expiryDatetime': undefined,
118
- 'strike': undefined,
119
- 'optionType': undefined,
120
- 'precision': {
121
- 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseScale'))),
122
- 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteScale'))),
123
- },
124
- 'limits': {
125
- 'leverage': { 'min': undefined, 'max': undefined },
126
- 'amount': { 'min': undefined, 'max': undefined },
127
- 'price': { 'min': undefined, 'max': undefined },
128
- 'cost': { 'min': undefined, 'max': undefined },
129
- },
130
- 'created': undefined,
131
- 'info': market,
132
- };
133
- }
134
- async fetchTickers(symbols = undefined, params = {}) {
135
- /**
136
- * @method
137
- * @name balinex#fetchTickers
138
- * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
139
- * @see https://api.balinex.com/public/markets
140
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
141
- * @param {object} [params] extra parameters specific to the exchange API endpoint
142
- * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
143
- */
144
- await this.loadMarkets();
145
- if (symbols !== undefined) {
146
- symbols = this.marketSymbols(symbols);
147
- }
148
- const response = await this.publicGetPublicMarkets(params);
149
- const data = this.safeDict(response, 'result', {});
150
- const items = this.safeList(data, 'items', []);
151
- const result = {};
152
- for (let i = 0; i < items.length; i++) {
153
- const ticker = this.parseTicker(items[i]);
154
- const symbol = ticker['symbol'];
155
- result[symbol] = ticker;
156
- }
157
- return this.filterByArrayTickers(result, 'symbol', symbols);
158
- }
159
- async fetchTicker(symbol, params = {}) {
160
- /**
161
- * @method
162
- * @name balinex#fetchTicker
163
- * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
164
- * @see https://api.balinex.com/public/markets
165
- * @param {string} symbol unified symbol of the market to fetch the ticker for
166
- * @param {object} [params] extra parameters specific to the exchange API endpoint
167
- * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
168
- */
169
- const ticker = await this.fetchTickers([symbol], params);
170
- return ticker[symbol];
171
- }
172
- parseTicker(ticker, market = undefined) {
173
- // {
174
- // "productId": "BTCIRT",
175
- // "baseCurrency": "BTC",
176
- // "quoteCurrency": "IRT",
177
- // "baseScale": 7,
178
- // "quoteScale": 0,
179
- // "lastPrice": "21703802224",
180
- // "openPrice24h": "21816018777",
181
- // "highPrice24h": "21823312074",
182
- // "lowPrice24h": "21341032776",
183
- // "volume24h": "1.4538258",
184
- // "quoteVolume24h": "31553547631",
185
- // "priceChange24h": "-112216553",
186
- // "percentChange24h": "-0.51",
187
- // "allowBuy": true,
188
- // "allowSell": true
189
- // }
190
- const marketId = this.safeString(ticker, 'productId');
191
- market = this.safeMarket(marketId, market);
192
- const last = this.safeString(ticker, 'lastPrice');
193
- return this.safeTicker({
194
- 'symbol': market['symbol'],
195
- 'timestamp': undefined,
196
- 'datetime': undefined,
197
- 'high': this.safeString(ticker, 'highPrice24h'),
198
- 'low': this.safeString(ticker, 'lowPrice24h'),
199
- 'bid': undefined,
200
- 'bidVolume': undefined,
201
- 'ask': undefined,
202
- 'askVolume': undefined,
203
- 'vwap': undefined,
204
- 'open': this.safeString(ticker, 'openPrice24h'),
205
- 'close': last,
206
- 'last': last,
207
- 'previousClose': undefined,
208
- 'change': this.safeString(ticker, 'priceChange24h'),
209
- 'percentage': this.safeString(ticker, 'percentChange24h'),
210
- 'average': undefined,
211
- 'baseVolume': this.safeString(ticker, 'volume24h'),
212
- 'quoteVolume': this.safeString(ticker, 'quoteVolume24h'),
213
- 'info': ticker,
214
- }, market);
215
- }
216
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
217
- let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
218
- const query = this.omit(params, this.extractParams(path));
219
- if (Object.keys(query).length) {
220
- url += '?' + this.urlencode(query);
221
- }
222
- headers = { 'Accept': 'application/json' };
223
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
224
- }
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class balinex
11
+ * @augments Exchange
12
+ */
13
+ class balinex extends balinex$1["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'balinex',
17
+ 'name': 'Balinex',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': '1',
21
+ 'certified': false,
22
+ 'pro': false,
23
+ 'has': {
24
+ 'CORS': undefined,
25
+ 'spot': true,
26
+ 'margin': false,
27
+ 'swap': false,
28
+ 'future': false,
29
+ 'option': false,
30
+ 'fetchMarkets': true,
31
+ 'fetchTicker': true,
32
+ 'fetchTickers': true,
33
+ },
34
+ 'urls': {
35
+ 'logo': 'https://balinex.com/favicon.ico',
36
+ 'api': {
37
+ 'public': 'https://api.balinex.com',
38
+ },
39
+ 'www': 'https://balinex.com',
40
+ 'doc': [
41
+ 'https://api.balinex.com/public/markets',
42
+ ],
43
+ },
44
+ 'api': {
45
+ 'public': {
46
+ 'get': {
47
+ 'public/markets': 1,
48
+ },
49
+ },
50
+ },
51
+ });
52
+ }
53
+ async fetchMarkets(params = {}) {
54
+ /**
55
+ * @method
56
+ * @name balinex#fetchMarkets
57
+ * @description retrieves data on all markets for balinex
58
+ * @see https://api.balinex.com/public/markets
59
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
60
+ * @returns {object[]} an array of objects representing market data
61
+ */
62
+ const response = await this.publicGetPublicMarkets(params);
63
+ const data = this.safeDict(response, 'result', {});
64
+ const items = this.safeList(data, 'items', []);
65
+ const result = [];
66
+ for (let i = 0; i < items.length; i++) {
67
+ result.push(this.parseMarket(items[i]));
68
+ }
69
+ return result;
70
+ }
71
+ parseMarket(market) {
72
+ // {
73
+ // "productId": "ADAUSDT",
74
+ // "baseCurrency": "ADA",
75
+ // "quoteCurrency": "USDT",
76
+ // "baseScale": 2,
77
+ // "quoteScale": 4,
78
+ // "lastPrice": "0.2047",
79
+ // "openPrice24h": "0.2089",
80
+ // "highPrice24h": "0.2103",
81
+ // "lowPrice24h": "0.2012",
82
+ // "volume24h": "1530110.38",
83
+ // "quoteVolume24h": "313213.5968",
84
+ // "priceChange24h": "-0.0042",
85
+ // "percentChange24h": "-2.01",
86
+ // "allowBuy": true,
87
+ // "allowSell": true
88
+ // }
89
+ const id = this.safeString(market, 'productId');
90
+ const baseId = this.safeString(market, 'baseCurrency');
91
+ const quoteId = this.safeString(market, 'quoteCurrency');
92
+ const base = this.safeCurrencyCode(baseId);
93
+ const quote = this.safeCurrencyCode(quoteId);
94
+ const allowBuy = this.safeBool(market, 'allowBuy', false);
95
+ const allowSell = this.safeBool(market, 'allowSell', false);
96
+ return {
97
+ 'id': id,
98
+ 'symbol': base + '/' + quote,
99
+ 'base': base,
100
+ 'quote': quote,
101
+ 'settle': undefined,
102
+ 'baseId': baseId,
103
+ 'quoteId': quoteId,
104
+ 'settleId': undefined,
105
+ 'type': 'spot',
106
+ 'spot': true,
107
+ 'margin': false,
108
+ 'swap': false,
109
+ 'future': false,
110
+ 'option': false,
111
+ 'active': allowBuy && allowSell,
112
+ 'contract': false,
113
+ 'linear': undefined,
114
+ 'inverse': undefined,
115
+ 'contractSize': undefined,
116
+ 'expiry': undefined,
117
+ 'expiryDatetime': undefined,
118
+ 'strike': undefined,
119
+ 'optionType': undefined,
120
+ 'precision': {
121
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseScale'))),
122
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteScale'))),
123
+ },
124
+ 'limits': {
125
+ 'leverage': { 'min': undefined, 'max': undefined },
126
+ 'amount': { 'min': undefined, 'max': undefined },
127
+ 'price': { 'min': undefined, 'max': undefined },
128
+ 'cost': { 'min': undefined, 'max': undefined },
129
+ },
130
+ 'created': undefined,
131
+ 'info': market,
132
+ };
133
+ }
134
+ async fetchTickers(symbols = undefined, params = {}) {
135
+ /**
136
+ * @method
137
+ * @name balinex#fetchTickers
138
+ * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
139
+ * @see https://api.balinex.com/public/markets
140
+ * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
141
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
142
+ * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
143
+ */
144
+ await this.loadMarkets();
145
+ if (symbols !== undefined) {
146
+ symbols = this.marketSymbols(symbols);
147
+ }
148
+ const response = await this.publicGetPublicMarkets(params);
149
+ const data = this.safeDict(response, 'result', {});
150
+ const items = this.safeList(data, 'items', []);
151
+ const result = {};
152
+ for (let i = 0; i < items.length; i++) {
153
+ const ticker = this.parseTicker(items[i]);
154
+ const symbol = ticker['symbol'];
155
+ result[symbol] = ticker;
156
+ }
157
+ return this.filterByArrayTickers(result, 'symbol', symbols);
158
+ }
159
+ async fetchTicker(symbol, params = {}) {
160
+ /**
161
+ * @method
162
+ * @name balinex#fetchTicker
163
+ * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
164
+ * @see https://api.balinex.com/public/markets
165
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
166
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
167
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
168
+ */
169
+ const ticker = await this.fetchTickers([symbol], params);
170
+ return ticker[symbol];
171
+ }
172
+ parseTicker(ticker, market = undefined) {
173
+ // {
174
+ // "productId": "BTCIRT",
175
+ // "baseCurrency": "BTC",
176
+ // "quoteCurrency": "IRT",
177
+ // "baseScale": 7,
178
+ // "quoteScale": 0,
179
+ // "lastPrice": "21703802224",
180
+ // "openPrice24h": "21816018777",
181
+ // "highPrice24h": "21823312074",
182
+ // "lowPrice24h": "21341032776",
183
+ // "volume24h": "1.4538258",
184
+ // "quoteVolume24h": "31553547631",
185
+ // "priceChange24h": "-112216553",
186
+ // "percentChange24h": "-0.51",
187
+ // "allowBuy": true,
188
+ // "allowSell": true
189
+ // }
190
+ const marketId = this.safeString(ticker, 'productId');
191
+ market = this.safeMarket(marketId, market);
192
+ const last = this.safeString(ticker, 'lastPrice');
193
+ return this.safeTicker({
194
+ 'symbol': market['symbol'],
195
+ 'timestamp': undefined,
196
+ 'datetime': undefined,
197
+ 'high': this.safeString(ticker, 'highPrice24h'),
198
+ 'low': this.safeString(ticker, 'lowPrice24h'),
199
+ 'bid': undefined,
200
+ 'bidVolume': undefined,
201
+ 'ask': undefined,
202
+ 'askVolume': undefined,
203
+ 'vwap': undefined,
204
+ 'open': this.safeString(ticker, 'openPrice24h'),
205
+ 'close': last,
206
+ 'last': last,
207
+ 'previousClose': undefined,
208
+ 'change': this.safeString(ticker, 'priceChange24h'),
209
+ 'percentage': this.safeString(ticker, 'percentChange24h'),
210
+ 'average': undefined,
211
+ 'baseVolume': this.safeString(ticker, 'volume24h'),
212
+ 'quoteVolume': this.safeString(ticker, 'quoteVolume24h'),
213
+ 'info': ticker,
214
+ }, market);
215
+ }
216
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
217
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
218
+ const query = this.omit(params, this.extractParams(path));
219
+ if (Object.keys(query).length) {
220
+ url += '?' + this.urlencode(query);
221
+ }
222
+ headers = { 'Accept': 'application/json' };
223
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
224
+ }
225
225
  }
226
226
 
227
227
  exports["default"] = balinex;