ccxt-ir 4.17.0 → 4.18.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 (102) hide show
  1. package/README.md +4 -4
  2. package/dist/373.ccxt.browser.js +1 -1
  3. package/dist/373.ccxt.browser.min.js +1 -1
  4. package/dist/ccxt.browser.min.js +15 -15
  5. package/dist/cjs/ccxt.js +277 -244
  6. package/dist/cjs/src/baazar.js +160 -0
  7. package/dist/cjs/src/base/Exchange.js +7364 -7364
  8. package/dist/cjs/src/daric.js +181 -0
  9. package/dist/cjs/src/digikalagold.js +178 -0
  10. package/dist/cjs/src/goldcore.js +155 -0
  11. package/dist/cjs/src/goldika.js +163 -0
  12. package/dist/cjs/src/goldis.js +157 -0
  13. package/dist/cjs/src/hamrahgold.js +171 -0
  14. package/dist/cjs/src/iranexchange.js +390 -390
  15. package/dist/cjs/src/melligold.js +210 -210
  16. package/dist/cjs/src/milligold.js +146 -146
  17. package/dist/cjs/src/talaavan.js +155 -0
  18. package/dist/cjs/src/talapp.js +156 -0
  19. package/dist/cjs/src/technogold.js +143 -143
  20. package/dist/cjs/src/wallgold.js +154 -154
  21. package/dist/cjs/src/zarafza.js +159 -0
  22. package/dist/cjs/src/zarminex.js +162 -0
  23. package/dist/cjs/src/zarniv.js +178 -0
  24. package/js/ccxt.d.ts +751 -718
  25. package/js/ccxt.js +543 -521
  26. package/js/src/abstract/baazar.d.ts +8 -0
  27. package/js/src/abstract/baazar.js +11 -0
  28. package/js/src/abstract/daric.d.ts +8 -0
  29. package/js/src/abstract/daric.js +11 -0
  30. package/js/src/abstract/digikalagold.d.ts +8 -0
  31. package/js/src/abstract/digikalagold.js +11 -0
  32. package/js/src/abstract/goldcore.d.ts +8 -0
  33. package/js/src/abstract/goldcore.js +11 -0
  34. package/js/src/abstract/goldika.d.ts +8 -0
  35. package/js/src/abstract/goldika.js +11 -0
  36. package/js/src/abstract/goldis.d.ts +8 -0
  37. package/js/src/abstract/goldis.js +11 -0
  38. package/js/src/abstract/hamrahgold.d.ts +8 -0
  39. package/js/src/abstract/hamrahgold.js +11 -0
  40. package/js/src/abstract/melligold.d.ts +8 -8
  41. package/js/src/abstract/melligold.js +5 -5
  42. package/js/src/abstract/milligold.d.ts +8 -8
  43. package/js/src/abstract/milligold.js +5 -5
  44. package/js/src/abstract/talaavan.d.ts +8 -0
  45. package/js/src/abstract/talaavan.js +11 -0
  46. package/js/src/abstract/talapp.d.ts +8 -0
  47. package/js/src/abstract/talapp.js +11 -0
  48. package/js/src/abstract/technogold.d.ts +8 -8
  49. package/js/src/abstract/technogold.js +5 -5
  50. package/js/src/abstract/wallgold.d.ts +8 -8
  51. package/js/src/abstract/wallgold.js +5 -5
  52. package/js/src/abstract/zarafza.d.ts +8 -0
  53. package/js/src/abstract/zarafza.js +11 -0
  54. package/js/src/abstract/zarminex.d.ts +8 -0
  55. package/js/src/abstract/zarminex.js +11 -0
  56. package/js/src/abstract/zarniv.d.ts +9 -0
  57. package/js/src/abstract/zarniv.js +11 -0
  58. package/js/src/baazar.d.ts +20 -0
  59. package/js/src/baazar.js +159 -0
  60. package/js/src/base/Exchange.d.ts +926 -926
  61. package/js/src/base/Exchange.js +7397 -7397
  62. package/js/src/coinbaseexchange.d.ts +334 -334
  63. package/js/src/daric.d.ts +22 -0
  64. package/js/src/daric.js +180 -0
  65. package/js/src/digikalagold.d.ts +21 -0
  66. package/js/src/digikalagold.js +177 -0
  67. package/js/src/goldika.d.ts +20 -0
  68. package/js/src/goldika.js +162 -0
  69. package/js/src/goldis.d.ts +21 -0
  70. package/js/src/goldis.js +156 -0
  71. package/js/src/hamrahgold.d.ts +21 -0
  72. package/js/src/hamrahgold.js +170 -0
  73. package/js/src/iranexchange.js +393 -393
  74. package/js/src/melligold.d.ts +21 -21
  75. package/js/src/melligold.js +214 -214
  76. package/js/src/milligold.d.ts +20 -20
  77. package/js/src/milligold.js +149 -149
  78. package/js/src/protobuf/mexc/compiled.d.cts +2 -2
  79. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  80. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  81. package/js/src/static_dependencies/qs/formats.d.cts +8 -8
  82. package/js/src/static_dependencies/qs/index.d.cts +4 -4
  83. package/js/src/static_dependencies/qs/parse.d.cts +2 -2
  84. package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
  85. package/js/src/static_dependencies/qs/utils.d.cts +9 -9
  86. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  87. package/js/src/talaavan.d.ts +20 -0
  88. package/js/src/talaavan.js +154 -0
  89. package/js/src/talapp.d.ts +20 -0
  90. package/js/src/talapp.js +155 -0
  91. package/js/src/technogold.d.ts +20 -20
  92. package/js/src/technogold.js +146 -146
  93. package/js/src/wallgold.d.ts +21 -21
  94. package/js/src/wallgold.js +157 -157
  95. package/js/src/zarafza.d.ts +20 -0
  96. package/js/src/zarafza.js +158 -0
  97. package/js/src/zarminex.d.ts +20 -0
  98. package/js/src/zarminex.js +161 -0
  99. package/js/src/zarniv.d.ts +21 -0
  100. package/js/src/zarniv.js +177 -0
  101. package/js/test.js +61 -61
  102. package/package.json +1 -1
@@ -6,216 +6,216 @@ var Exchange = require('./base/Exchange.js');
6
6
  var errors = require('./base/errors.js');
7
7
 
8
8
  // ----------------------------------------------------------------------------
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * @class melligold
12
- * @augments Exchange
13
- */
14
- class melligold extends Exchange["default"] {
15
- describe() {
16
- return this.deepExtend(super.describe(), {
17
- 'id': 'melligold',
18
- 'name': 'MelliGold',
19
- 'countries': ['IR'],
20
- 'rateLimit': 1000,
21
- 'version': '1',
22
- 'certified': false,
23
- 'pro': false,
24
- 'has': {
25
- 'CORS': undefined,
26
- 'spot': false,
27
- 'margin': false,
28
- 'swap': false,
29
- 'future': false,
30
- 'option': false,
31
- 'fetchMarkets': true,
32
- 'fetchTicker': true,
33
- 'fetchTickers': true,
34
- 'otc': true,
35
- },
36
- 'options': {
37
- 'defaultType': 'otc',
38
- 'melligoldCookie': undefined,
39
- 'manualRedirect': true,
40
- },
41
- 'urls': {
42
- 'api': {
43
- 'public': 'https://melligold.com',
44
- },
45
- 'www': 'https://melligold.com',
46
- 'doc': 'https://melligold.com',
47
- },
48
- 'api': {
49
- 'public': {
50
- 'get': {
51
- 'api/v1/exchange/buy-sell-price/': 1,
52
- },
53
- },
54
- },
55
- });
56
- }
57
- async fetchMarkets(params = {}) {
58
- const symbols = ['XAU18', 'XAG'];
59
- const result = [];
60
- for (let i = 0; i < symbols.length; i++) {
61
- const response = await this.requestWithCookie(this.extend({
62
- 'symbol': symbols[i],
63
- 'format': 'json',
64
- }, params));
65
- result.push(this.parseMarket(response, symbols[i]));
66
- }
67
- return result;
68
- }
69
- async requestWithCookie(params = {}) {
70
- let response = undefined;
71
- let error = undefined;
72
- try {
73
- response = await this.publicGetApiV1ExchangeBuySellPrice(params);
74
- }
75
- catch (e) {
76
- error = e;
77
- }
78
- if (this.safeValue(response, 'data') !== undefined) {
79
- return response;
80
- }
81
- const responseHeaders = this.last_response_headers || {};
82
- const setCookie = this.safeString(responseHeaders, 'Set-Cookie');
83
- if (setCookie !== undefined) {
84
- const cookies = setCookie.split(', ');
85
- const values = [];
86
- for (let i = 0; i < cookies.length; i++) {
87
- values.push(cookies[i].split(';')[0]);
88
- }
89
- const cookie = values.join('; ');
90
- if (cookie !== '' && cookie !== this.options['melligoldCookie']) {
91
- this.options['melligoldCookie'] = cookie;
92
- response = await this.publicGetApiV1ExchangeBuySellPrice(params);
93
- if (this.safeValue(response, 'data') !== undefined) {
94
- return response;
95
- }
96
- }
97
- }
98
- if (error !== undefined) {
99
- throw error;
100
- }
101
- throw new errors.ExchangeError(this.id + ' returned an invalid response');
102
- }
103
- parseMarket(response, baseId = undefined) {
104
- const data = this.safeDict(response, 'data', {});
105
- const lowerAmounts = this.safeDict(data, 'lower_amounts', {});
106
- const base = this.safeCurrencyCode(baseId);
107
- const quote = 'IRT';
108
- return {
109
- 'id': base + quote,
110
- 'symbol': base + '/' + quote,
111
- 'base': base,
112
- 'quote': quote,
113
- 'settle': undefined,
114
- 'baseId': baseId,
115
- 'quoteId': quote,
116
- 'settleId': undefined,
117
- 'type': 'otc',
118
- 'spot': false,
119
- 'margin': false,
120
- 'swap': false,
121
- 'future': false,
122
- 'option': false,
123
- 'active': true,
124
- 'contract': false,
125
- 'linear': undefined,
126
- 'inverse': undefined,
127
- 'contractSize': undefined,
128
- 'expiry': undefined,
129
- 'expiryDatetime': undefined,
130
- 'strike': undefined,
131
- 'optionType': undefined,
132
- 'precision': {
133
- 'amount': undefined,
134
- 'price': undefined,
135
- },
136
- 'limits': {
137
- 'leverage': { 'min': undefined, 'max': undefined },
138
- 'amount': { 'min': undefined, 'max': undefined },
139
- 'price': { 'min': undefined, 'max': undefined },
140
- 'cost': {
141
- 'min': this.safeNumber(lowerAmounts, 'buy_toman'),
142
- 'max': undefined,
143
- },
144
- },
145
- 'created': undefined,
146
- 'info': response,
147
- };
148
- }
149
- async fetchTicker(symbol, params = {}) {
150
- await this.loadMarkets();
151
- const market = this.market(symbol);
152
- const response = await this.requestWithCookie(this.extend({
153
- 'symbol': market['baseId'],
154
- 'format': 'json',
155
- }, params));
156
- return this.parseTicker(response, market);
157
- }
158
- async fetchTickers(symbols = undefined, params = {}) {
159
- await this.loadMarkets();
160
- if (symbols !== undefined) {
161
- symbols = this.marketSymbols(symbols);
162
- }
163
- const result = {};
164
- const marketSymbols = ['XAU18/IRT', 'XAG/IRT'];
165
- for (let i = 0; i < marketSymbols.length; i++) {
166
- const market = this.market(marketSymbols[i]);
167
- const response = await this.requestWithCookie(this.extend({
168
- 'symbol': market['baseId'],
169
- 'format': 'json',
170
- }, params));
171
- const ticker = this.parseTicker(response, market);
172
- result[ticker['symbol']] = ticker;
173
- }
174
- return this.filterByArrayTickers(result, 'symbol', symbols);
175
- }
176
- parseTicker(response, market = undefined) {
177
- const data = this.safeDict(response, 'data', {});
178
- const buy = this.safeNumber(data, 'price_buy');
179
- const sell = this.safeNumber(data, 'price_sell');
180
- return this.safeTicker({
181
- 'symbol': market['symbol'],
182
- 'timestamp': this.safeTimestamp(data, 'timestamp'),
183
- 'datetime': undefined,
184
- 'high': undefined,
185
- 'low': undefined,
186
- 'bid': sell,
187
- 'bidVolume': undefined,
188
- 'ask': buy,
189
- 'askVolume': undefined,
190
- 'vwap': undefined,
191
- 'open': undefined,
192
- 'close': buy,
193
- 'last': buy,
194
- 'previousClose': undefined,
195
- 'change': undefined,
196
- 'percentage': undefined,
197
- 'average': undefined,
198
- 'baseVolume': undefined,
199
- 'quoteVolume': undefined,
200
- 'info': response,
201
- }, market);
202
- }
203
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
204
- let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
205
- const query = this.omit(params, this.extractParams(path));
206
- if (Object.keys(query).length) {
207
- url += '?' + this.urlencode(query);
208
- }
209
- headers = {
210
- 'Accept': 'application/json',
211
- 'Content-Type': 'application/json',
212
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
213
- };
214
- if (this.options['melligoldCookie'] !== undefined) {
215
- headers['Cookie'] = this.options['melligoldCookie'];
216
- }
217
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
218
- }
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * @class melligold
12
+ * @augments Exchange
13
+ */
14
+ class melligold extends Exchange["default"] {
15
+ describe() {
16
+ return this.deepExtend(super.describe(), {
17
+ 'id': 'melligold',
18
+ 'name': 'MelliGold',
19
+ 'countries': ['IR'],
20
+ 'rateLimit': 1000,
21
+ 'version': '1',
22
+ 'certified': false,
23
+ 'pro': false,
24
+ 'has': {
25
+ 'CORS': undefined,
26
+ 'spot': false,
27
+ 'margin': false,
28
+ 'swap': false,
29
+ 'future': false,
30
+ 'option': false,
31
+ 'fetchMarkets': true,
32
+ 'fetchTicker': true,
33
+ 'fetchTickers': true,
34
+ 'otc': true,
35
+ },
36
+ 'options': {
37
+ 'defaultType': 'otc',
38
+ 'melligoldCookie': undefined,
39
+ 'manualRedirect': true,
40
+ },
41
+ 'urls': {
42
+ 'api': {
43
+ 'public': 'https://melligold.com',
44
+ },
45
+ 'www': 'https://melligold.com',
46
+ 'doc': 'https://melligold.com',
47
+ },
48
+ 'api': {
49
+ 'public': {
50
+ 'get': {
51
+ 'api/v1/exchange/buy-sell-price/': 1,
52
+ },
53
+ },
54
+ },
55
+ });
56
+ }
57
+ async fetchMarkets(params = {}) {
58
+ const symbols = ['XAU18', 'XAG'];
59
+ const result = [];
60
+ for (let i = 0; i < symbols.length; i++) {
61
+ const response = await this.requestWithCookie(this.extend({
62
+ 'symbol': symbols[i],
63
+ 'format': 'json',
64
+ }, params));
65
+ result.push(this.parseMarket(response, symbols[i]));
66
+ }
67
+ return result;
68
+ }
69
+ async requestWithCookie(params = {}) {
70
+ let response = undefined;
71
+ let error = undefined;
72
+ try {
73
+ response = await this.publicGetApiV1ExchangeBuySellPrice(params);
74
+ }
75
+ catch (e) {
76
+ error = e;
77
+ }
78
+ if (this.safeValue(response, 'data') !== undefined) {
79
+ return response;
80
+ }
81
+ const responseHeaders = this.last_response_headers || {};
82
+ const setCookie = this.safeString(responseHeaders, 'Set-Cookie');
83
+ if (setCookie !== undefined) {
84
+ const cookies = setCookie.split(', ');
85
+ const values = [];
86
+ for (let i = 0; i < cookies.length; i++) {
87
+ values.push(cookies[i].split(';')[0]);
88
+ }
89
+ const cookie = values.join('; ');
90
+ if (cookie !== '' && cookie !== this.options['melligoldCookie']) {
91
+ this.options['melligoldCookie'] = cookie;
92
+ response = await this.publicGetApiV1ExchangeBuySellPrice(params);
93
+ if (this.safeValue(response, 'data') !== undefined) {
94
+ return response;
95
+ }
96
+ }
97
+ }
98
+ if (error !== undefined) {
99
+ throw error;
100
+ }
101
+ throw new errors.ExchangeError(this.id + ' returned an invalid response');
102
+ }
103
+ parseMarket(response, baseId = undefined) {
104
+ const data = this.safeDict(response, 'data', {});
105
+ const lowerAmounts = this.safeDict(data, 'lower_amounts', {});
106
+ const base = this.safeCurrencyCode(baseId);
107
+ const quote = 'IRT';
108
+ return {
109
+ 'id': base + quote,
110
+ 'symbol': base + '/' + quote,
111
+ 'base': base,
112
+ 'quote': quote,
113
+ 'settle': undefined,
114
+ 'baseId': baseId,
115
+ 'quoteId': quote,
116
+ 'settleId': undefined,
117
+ 'type': 'otc',
118
+ 'spot': false,
119
+ 'margin': false,
120
+ 'swap': false,
121
+ 'future': false,
122
+ 'option': false,
123
+ 'active': true,
124
+ 'contract': false,
125
+ 'linear': undefined,
126
+ 'inverse': undefined,
127
+ 'contractSize': undefined,
128
+ 'expiry': undefined,
129
+ 'expiryDatetime': undefined,
130
+ 'strike': undefined,
131
+ 'optionType': undefined,
132
+ 'precision': {
133
+ 'amount': undefined,
134
+ 'price': undefined,
135
+ },
136
+ 'limits': {
137
+ 'leverage': { 'min': undefined, 'max': undefined },
138
+ 'amount': { 'min': undefined, 'max': undefined },
139
+ 'price': { 'min': undefined, 'max': undefined },
140
+ 'cost': {
141
+ 'min': this.safeNumber(lowerAmounts, 'buy_toman'),
142
+ 'max': undefined,
143
+ },
144
+ },
145
+ 'created': undefined,
146
+ 'info': response,
147
+ };
148
+ }
149
+ async fetchTicker(symbol, params = {}) {
150
+ await this.loadMarkets();
151
+ const market = this.market(symbol);
152
+ const response = await this.requestWithCookie(this.extend({
153
+ 'symbol': market['baseId'],
154
+ 'format': 'json',
155
+ }, params));
156
+ return this.parseTicker(response, market);
157
+ }
158
+ async fetchTickers(symbols = undefined, params = {}) {
159
+ await this.loadMarkets();
160
+ if (symbols !== undefined) {
161
+ symbols = this.marketSymbols(symbols);
162
+ }
163
+ const result = {};
164
+ const marketSymbols = ['XAU18/IRT', 'XAG/IRT'];
165
+ for (let i = 0; i < marketSymbols.length; i++) {
166
+ const market = this.market(marketSymbols[i]);
167
+ const response = await this.requestWithCookie(this.extend({
168
+ 'symbol': market['baseId'],
169
+ 'format': 'json',
170
+ }, params));
171
+ const ticker = this.parseTicker(response, market);
172
+ result[ticker['symbol']] = ticker;
173
+ }
174
+ return this.filterByArrayTickers(result, 'symbol', symbols);
175
+ }
176
+ parseTicker(response, market = undefined) {
177
+ const data = this.safeDict(response, 'data', {});
178
+ const buy = this.safeNumber(data, 'price_buy');
179
+ const sell = this.safeNumber(data, 'price_sell');
180
+ return this.safeTicker({
181
+ 'symbol': market['symbol'],
182
+ 'timestamp': this.safeTimestamp(data, 'timestamp'),
183
+ 'datetime': undefined,
184
+ 'high': undefined,
185
+ 'low': undefined,
186
+ 'bid': sell,
187
+ 'bidVolume': undefined,
188
+ 'ask': buy,
189
+ 'askVolume': undefined,
190
+ 'vwap': undefined,
191
+ 'open': undefined,
192
+ 'close': buy,
193
+ 'last': buy,
194
+ 'previousClose': undefined,
195
+ 'change': undefined,
196
+ 'percentage': undefined,
197
+ 'average': undefined,
198
+ 'baseVolume': undefined,
199
+ 'quoteVolume': undefined,
200
+ 'info': response,
201
+ }, market);
202
+ }
203
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
204
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
205
+ const query = this.omit(params, this.extractParams(path));
206
+ if (Object.keys(query).length) {
207
+ url += '?' + this.urlencode(query);
208
+ }
209
+ headers = {
210
+ 'Accept': 'application/json',
211
+ 'Content-Type': 'application/json',
212
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
213
+ };
214
+ if (this.options['melligoldCookie'] !== undefined) {
215
+ headers['Cookie'] = this.options['melligoldCookie'];
216
+ }
217
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
218
+ }
219
219
  }
220
220
 
221
221
  exports["default"] = melligold;