ccxt-ir 4.18.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 (98) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +257 -257
  4. package/dist/cjs/package.json +1 -1
  5. package/dist/cjs/src/baazar.js +150 -150
  6. package/dist/cjs/src/base/Exchange.js +7364 -7364
  7. package/dist/cjs/src/daric.js +171 -171
  8. package/dist/cjs/src/digikalagold.js +167 -167
  9. package/dist/cjs/src/goldika.js +153 -153
  10. package/dist/cjs/src/goldis.js +147 -147
  11. package/dist/cjs/src/hamrahgold.js +161 -161
  12. package/dist/cjs/src/iranexchange.js +390 -390
  13. package/dist/cjs/src/melligold.js +210 -210
  14. package/dist/cjs/src/milligold.js +146 -146
  15. package/dist/cjs/src/talaavan.js +155 -0
  16. package/dist/cjs/src/talapp.js +146 -146
  17. package/dist/cjs/src/technogold.js +143 -143
  18. package/dist/cjs/src/wallgold.js +154 -154
  19. package/dist/cjs/src/zarafza.js +149 -149
  20. package/dist/cjs/src/zarminex.js +152 -152
  21. package/dist/cjs/src/zarniv.js +168 -168
  22. package/js/ccxt.d.ts +751 -751
  23. package/js/ccxt.js +543 -543
  24. package/js/src/abstract/baazar.d.ts +8 -8
  25. package/js/src/abstract/baazar.js +5 -5
  26. package/js/src/abstract/daric.d.ts +8 -8
  27. package/js/src/abstract/daric.js +5 -5
  28. package/js/src/abstract/digikalagold.d.ts +8 -8
  29. package/js/src/abstract/digikalagold.js +5 -5
  30. package/js/src/abstract/goldika.d.ts +8 -8
  31. package/js/src/abstract/goldika.js +5 -5
  32. package/js/src/abstract/goldis.d.ts +8 -8
  33. package/js/src/abstract/goldis.js +5 -5
  34. package/js/src/abstract/hamrahgold.d.ts +8 -8
  35. package/js/src/abstract/hamrahgold.js +5 -5
  36. package/js/src/abstract/melligold.d.ts +8 -8
  37. package/js/src/abstract/melligold.js +5 -5
  38. package/js/src/abstract/milligold.d.ts +8 -8
  39. package/js/src/abstract/milligold.js +5 -5
  40. package/js/src/abstract/talaavan.d.ts +8 -0
  41. package/js/src/abstract/talaavan.js +11 -0
  42. package/js/src/abstract/talapp.d.ts +8 -8
  43. package/js/src/abstract/talapp.js +5 -5
  44. package/js/src/abstract/technogold.d.ts +8 -8
  45. package/js/src/abstract/technogold.js +5 -5
  46. package/js/src/abstract/wallgold.d.ts +8 -8
  47. package/js/src/abstract/wallgold.js +5 -5
  48. package/js/src/abstract/zarafza.d.ts +8 -8
  49. package/js/src/abstract/zarafza.js +5 -5
  50. package/js/src/abstract/zarminex.d.ts +8 -8
  51. package/js/src/abstract/zarminex.js +5 -5
  52. package/js/src/abstract/zarniv.d.ts +9 -9
  53. package/js/src/abstract/zarniv.js +5 -5
  54. package/js/src/baazar.d.ts +20 -20
  55. package/js/src/baazar.js +153 -153
  56. package/js/src/base/Exchange.d.ts +926 -926
  57. package/js/src/base/Exchange.js +7397 -7397
  58. package/js/src/coinbaseexchange.d.ts +334 -334
  59. package/js/src/daric.d.ts +22 -22
  60. package/js/src/daric.js +174 -174
  61. package/js/src/digikalagold.d.ts +21 -21
  62. package/js/src/digikalagold.js +171 -171
  63. package/js/src/goldika.d.ts +20 -20
  64. package/js/src/goldika.js +156 -156
  65. package/js/src/goldis.d.ts +21 -21
  66. package/js/src/goldis.js +150 -150
  67. package/js/src/hamrahgold.d.ts +21 -21
  68. package/js/src/hamrahgold.js +164 -164
  69. package/js/src/iranexchange.js +393 -393
  70. package/js/src/melligold.d.ts +21 -21
  71. package/js/src/melligold.js +214 -214
  72. package/js/src/milligold.d.ts +20 -20
  73. package/js/src/milligold.js +149 -149
  74. package/js/src/protobuf/mexc/compiled.d.cts +2 -2
  75. package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
  76. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
  77. package/js/src/static_dependencies/qs/formats.d.cts +8 -8
  78. package/js/src/static_dependencies/qs/index.d.cts +4 -4
  79. package/js/src/static_dependencies/qs/parse.d.cts +2 -2
  80. package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
  81. package/js/src/static_dependencies/qs/utils.d.cts +9 -9
  82. package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
  83. package/js/src/{goldcore.d.ts → talaavan.d.ts} +20 -20
  84. package/js/src/{goldcore.js → talaavan.js} +148 -148
  85. package/js/src/talapp.d.ts +20 -20
  86. package/js/src/talapp.js +149 -149
  87. package/js/src/technogold.d.ts +20 -20
  88. package/js/src/technogold.js +146 -146
  89. package/js/src/wallgold.d.ts +21 -21
  90. package/js/src/wallgold.js +157 -157
  91. package/js/src/zarafza.d.ts +20 -20
  92. package/js/src/zarafza.js +152 -152
  93. package/js/src/zarminex.d.ts +20 -20
  94. package/js/src/zarminex.js +155 -155
  95. package/js/src/zarniv.d.ts +21 -21
  96. package/js/src/zarniv.js +171 -171
  97. package/js/test.js +61 -68
  98. package/package.json +1 -1
@@ -5,160 +5,160 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var Exchange = require('./base/Exchange.js');
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
- // ---------------------------------------------------------------------------
9
- /**
10
- * @class wallgold
11
- * @augments Exchange
12
- */
13
- class wallgold extends Exchange["default"] {
14
- describe() {
15
- return this.deepExtend(super.describe(), {
16
- 'id': 'wallgold',
17
- 'name': 'WallGold',
18
- 'countries': ['IR'],
19
- 'rateLimit': 1000,
20
- 'version': '1',
21
- 'certified': false,
22
- 'pro': false,
23
- 'has': {
24
- 'CORS': undefined,
25
- 'spot': false,
26
- 'margin': false,
27
- 'swap': false,
28
- 'future': false,
29
- 'option': false,
30
- 'fetchMarkets': true,
31
- 'fetchTicker': true,
32
- 'fetchTickers': true,
33
- 'otc': true,
34
- },
35
- 'options': {
36
- 'defaultType': 'otc',
37
- },
38
- 'urls': {
39
- 'api': {
40
- 'public': 'https://api.wallgold.ir',
41
- },
42
- 'www': 'https://wallgold.ir',
43
- 'doc': 'https://wallgold.ir',
44
- },
45
- 'api': {
46
- 'public': {
47
- 'get': {
48
- 'api/v1/price': 1,
49
- },
50
- },
51
- },
52
- });
53
- }
54
- async fetchMarkets(params = {}) {
55
- const response = await this.fetchPrice('buy', params);
56
- return [this.parseMarket(response)];
57
- }
58
- fetchPrice(side, params = {}) {
59
- return this.publicGetApiV1Price(this.extend({
60
- 'side': side,
61
- 'symbol': 'GLD_18C_750TMN',
62
- }, params));
63
- }
64
- parseMarket(response) {
65
- return {
66
- 'id': 'XAU18IRT',
67
- 'symbol': 'XAU18/IRT',
68
- 'base': 'XAU18',
69
- 'quote': 'IRT',
70
- 'settle': undefined,
71
- 'baseId': 'XAU18',
72
- 'quoteId': 'IRT',
73
- 'settleId': undefined,
74
- 'type': 'otc',
75
- 'spot': false,
76
- 'margin': false,
77
- 'swap': false,
78
- 'future': false,
79
- 'option': false,
80
- 'active': this.safeBool(response, 'success', true),
81
- 'contract': false,
82
- 'linear': undefined,
83
- 'inverse': undefined,
84
- 'contractSize': undefined,
85
- 'expiry': undefined,
86
- 'expiryDatetime': undefined,
87
- 'strike': undefined,
88
- 'optionType': undefined,
89
- 'precision': {
90
- 'amount': undefined,
91
- 'price': undefined,
92
- },
93
- 'limits': {
94
- 'leverage': { 'min': undefined, 'max': undefined },
95
- 'amount': { 'min': undefined, 'max': undefined },
96
- 'price': { 'min': undefined, 'max': undefined },
97
- 'cost': { 'min': undefined, 'max': undefined },
98
- },
99
- 'created': undefined,
100
- 'info': response,
101
- };
102
- }
103
- async fetchTicker(symbol, params = {}) {
104
- await this.loadMarkets();
105
- const market = this.market(symbol);
106
- const buyResponse = await this.fetchPrice('buy', params);
107
- const sellResponse = await this.fetchPrice('sell', params);
108
- return this.parseTicker(buyResponse, market, sellResponse);
109
- }
110
- async fetchTickers(symbols = undefined, params = {}) {
111
- await this.loadMarkets();
112
- if (symbols !== undefined) {
113
- symbols = this.marketSymbols(symbols);
114
- }
115
- const market = this.market('XAU18/IRT');
116
- const buyResponse = await this.fetchPrice('buy', params);
117
- const sellResponse = await this.fetchPrice('sell', params);
118
- const ticker = this.parseTicker(buyResponse, market, sellResponse);
119
- const result = {};
120
- result[ticker['symbol']] = ticker;
121
- return this.filterByArrayTickers(result, 'symbol', symbols);
122
- }
123
- parseTicker(buyResponse, market = undefined, sellResponse = undefined) {
124
- const buyResult = this.safeDict(buyResponse, 'result', {});
125
- const sellResult = this.safeDict(sellResponse, 'result', buyResult);
126
- const bid = this.safeNumber(buyResult, 'price');
127
- const ask = this.safeNumber(sellResult, 'price');
128
- const currentTime = this.safeString(buyResult, 'currentTime');
129
- const timestamp = currentTime ? this.parse8601(currentTime) : undefined;
130
- return this.safeTicker({
131
- 'symbol': market['symbol'],
132
- 'timestamp': timestamp,
133
- 'datetime': undefined,
134
- 'high': undefined,
135
- 'low': undefined,
136
- 'bid': bid,
137
- 'bidVolume': undefined,
138
- 'ask': ask,
139
- 'askVolume': undefined,
140
- 'vwap': undefined,
141
- 'open': undefined,
142
- 'close': ask,
143
- 'last': ask,
144
- 'previousClose': undefined,
145
- 'change': undefined,
146
- 'percentage': undefined,
147
- 'average': undefined,
148
- 'baseVolume': undefined,
149
- 'quoteVolume': undefined,
150
- 'info': { 'buy': buyResponse, 'sell': sellResponse },
151
- }, market);
152
- }
153
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
154
- let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
155
- const query = this.omit(params, this.extractParams(path));
156
- if (Object.keys(query).length) {
157
- url += '?' + this.urlencode(query);
158
- }
159
- headers = { 'Content-Type': 'application/json' };
160
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
161
- }
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class wallgold
11
+ * @augments Exchange
12
+ */
13
+ class wallgold extends Exchange["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'wallgold',
17
+ 'name': 'WallGold',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': '1',
21
+ 'certified': false,
22
+ 'pro': false,
23
+ 'has': {
24
+ 'CORS': undefined,
25
+ 'spot': false,
26
+ 'margin': false,
27
+ 'swap': false,
28
+ 'future': false,
29
+ 'option': false,
30
+ 'fetchMarkets': true,
31
+ 'fetchTicker': true,
32
+ 'fetchTickers': true,
33
+ 'otc': true,
34
+ },
35
+ 'options': {
36
+ 'defaultType': 'otc',
37
+ },
38
+ 'urls': {
39
+ 'api': {
40
+ 'public': 'https://api.wallgold.ir',
41
+ },
42
+ 'www': 'https://wallgold.ir',
43
+ 'doc': 'https://wallgold.ir',
44
+ },
45
+ 'api': {
46
+ 'public': {
47
+ 'get': {
48
+ 'api/v1/price': 1,
49
+ },
50
+ },
51
+ },
52
+ });
53
+ }
54
+ async fetchMarkets(params = {}) {
55
+ const response = await this.fetchPrice('buy', params);
56
+ return [this.parseMarket(response)];
57
+ }
58
+ fetchPrice(side, params = {}) {
59
+ return this.publicGetApiV1Price(this.extend({
60
+ 'side': side,
61
+ 'symbol': 'GLD_18C_750TMN',
62
+ }, params));
63
+ }
64
+ parseMarket(response) {
65
+ return {
66
+ 'id': 'XAU18IRT',
67
+ 'symbol': 'XAU18/IRT',
68
+ 'base': 'XAU18',
69
+ 'quote': 'IRT',
70
+ 'settle': undefined,
71
+ 'baseId': 'XAU18',
72
+ 'quoteId': 'IRT',
73
+ 'settleId': undefined,
74
+ 'type': 'otc',
75
+ 'spot': false,
76
+ 'margin': false,
77
+ 'swap': false,
78
+ 'future': false,
79
+ 'option': false,
80
+ 'active': this.safeBool(response, 'success', true),
81
+ 'contract': false,
82
+ 'linear': undefined,
83
+ 'inverse': undefined,
84
+ 'contractSize': undefined,
85
+ 'expiry': undefined,
86
+ 'expiryDatetime': undefined,
87
+ 'strike': undefined,
88
+ 'optionType': undefined,
89
+ 'precision': {
90
+ 'amount': undefined,
91
+ 'price': undefined,
92
+ },
93
+ 'limits': {
94
+ 'leverage': { 'min': undefined, 'max': undefined },
95
+ 'amount': { 'min': undefined, 'max': undefined },
96
+ 'price': { 'min': undefined, 'max': undefined },
97
+ 'cost': { 'min': undefined, 'max': undefined },
98
+ },
99
+ 'created': undefined,
100
+ 'info': response,
101
+ };
102
+ }
103
+ async fetchTicker(symbol, params = {}) {
104
+ await this.loadMarkets();
105
+ const market = this.market(symbol);
106
+ const buyResponse = await this.fetchPrice('buy', params);
107
+ const sellResponse = await this.fetchPrice('sell', params);
108
+ return this.parseTicker(buyResponse, market, sellResponse);
109
+ }
110
+ async fetchTickers(symbols = undefined, params = {}) {
111
+ await this.loadMarkets();
112
+ if (symbols !== undefined) {
113
+ symbols = this.marketSymbols(symbols);
114
+ }
115
+ const market = this.market('XAU18/IRT');
116
+ const buyResponse = await this.fetchPrice('buy', params);
117
+ const sellResponse = await this.fetchPrice('sell', params);
118
+ const ticker = this.parseTicker(buyResponse, market, sellResponse);
119
+ const result = {};
120
+ result[ticker['symbol']] = ticker;
121
+ return this.filterByArrayTickers(result, 'symbol', symbols);
122
+ }
123
+ parseTicker(buyResponse, market = undefined, sellResponse = undefined) {
124
+ const buyResult = this.safeDict(buyResponse, 'result', {});
125
+ const sellResult = this.safeDict(sellResponse, 'result', buyResult);
126
+ const bid = this.safeNumber(buyResult, 'price');
127
+ const ask = this.safeNumber(sellResult, 'price');
128
+ const currentTime = this.safeString(buyResult, 'currentTime');
129
+ const timestamp = currentTime ? this.parse8601(currentTime) : undefined;
130
+ return this.safeTicker({
131
+ 'symbol': market['symbol'],
132
+ 'timestamp': timestamp,
133
+ 'datetime': undefined,
134
+ 'high': undefined,
135
+ 'low': undefined,
136
+ 'bid': bid,
137
+ 'bidVolume': undefined,
138
+ 'ask': ask,
139
+ 'askVolume': undefined,
140
+ 'vwap': undefined,
141
+ 'open': undefined,
142
+ 'close': ask,
143
+ 'last': ask,
144
+ 'previousClose': undefined,
145
+ 'change': undefined,
146
+ 'percentage': undefined,
147
+ 'average': undefined,
148
+ 'baseVolume': undefined,
149
+ 'quoteVolume': undefined,
150
+ 'info': { 'buy': buyResponse, 'sell': sellResponse },
151
+ }, market);
152
+ }
153
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
154
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
155
+ const query = this.omit(params, this.extractParams(path));
156
+ if (Object.keys(query).length) {
157
+ url += '?' + this.urlencode(query);
158
+ }
159
+ headers = { 'Content-Type': 'application/json' };
160
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
161
+ }
162
162
  }
163
163
 
164
164
  exports["default"] = wallgold;
@@ -5,155 +5,155 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var Exchange = require('./base/Exchange.js');
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
- // ---------------------------------------------------------------------------
9
- /**
10
- * @class zarafza
11
- * @augments Exchange
12
- */
13
- class zarafza extends Exchange["default"] {
14
- describe() {
15
- return this.deepExtend(super.describe(), {
16
- 'id': 'zarafza',
17
- 'name': 'Zarafza',
18
- 'countries': ['IR'],
19
- 'rateLimit': 1000,
20
- 'version': 'v2',
21
- 'certified': false,
22
- 'pro': false,
23
- 'has': {
24
- 'CORS': undefined,
25
- 'spot': false,
26
- 'margin': false,
27
- 'swap': false,
28
- 'future': false,
29
- 'option': false,
30
- 'fetchMarkets': true,
31
- 'fetchTicker': true,
32
- 'fetchTickers': true,
33
- 'otc': true,
34
- },
35
- 'options': {
36
- 'defaultType': 'otc',
37
- },
38
- 'urls': {
39
- 'api': {
40
- 'public': 'https://api.zarafza.com',
41
- },
42
- 'www': 'https://zarafza.com',
43
- 'doc': 'https://api.zarafza.com/v2/prices',
44
- },
45
- 'api': {
46
- 'public': {
47
- 'get': {
48
- 'v2/prices': 1,
49
- },
50
- },
51
- },
52
- });
53
- }
54
- async fetchMarkets(params = {}) {
55
- const response = await this.publicGetV2Prices(params);
56
- return [this.parseMarket(response)];
57
- }
58
- parseMarket(response) {
59
- const data = this.safeDict(response, 'data', {});
60
- const gold = this.safeDict(data, 'G18', {});
61
- const sell = this.safeDict(gold, 'sell', {});
62
- return {
63
- 'id': 'G18',
64
- 'symbol': 'XAU18/IRT',
65
- 'base': 'XAU18',
66
- 'quote': 'IRT',
67
- 'settle': undefined,
68
- 'baseId': 'G18',
69
- 'quoteId': 'IRT',
70
- 'settleId': undefined,
71
- 'type': 'otc',
72
- 'spot': false,
73
- 'margin': false,
74
- 'swap': false,
75
- 'future': false,
76
- 'option': false,
77
- 'active': this.safeNumber(sell, 'price') !== undefined,
78
- 'contract': false,
79
- 'linear': undefined,
80
- 'inverse': undefined,
81
- 'contractSize': undefined,
82
- 'expiry': undefined,
83
- 'expiryDatetime': undefined,
84
- 'strike': undefined,
85
- 'optionType': undefined,
86
- 'precision': {
87
- 'amount': undefined,
88
- 'price': undefined,
89
- },
90
- 'limits': {
91
- 'leverage': { 'min': undefined, 'max': undefined },
92
- 'amount': { 'min': undefined, 'max': undefined },
93
- 'price': { 'min': undefined, 'max': undefined },
94
- 'cost': { 'min': undefined, 'max': undefined },
95
- },
96
- 'created': undefined,
97
- 'info': gold,
98
- };
99
- }
100
- async fetchTicker(symbol, params = {}) {
101
- await this.loadMarkets();
102
- const market = this.market(symbol);
103
- const response = await this.publicGetV2Prices(params);
104
- return this.parseTicker(response, market);
105
- }
106
- async fetchTickers(symbols = undefined, params = {}) {
107
- await this.loadMarkets();
108
- if (symbols !== undefined) {
109
- symbols = this.marketSymbols(symbols);
110
- }
111
- const response = await this.publicGetV2Prices(params);
112
- const market = this.market('XAU18/IRT');
113
- const ticker = this.parseTicker(response, market);
114
- const result = {};
115
- result[ticker['symbol']] = ticker;
116
- return this.filterByArrayTickers(result, 'symbol', symbols);
117
- }
118
- parseTicker(response, market = undefined) {
119
- const data = this.safeDict(response, 'data', {});
120
- const gold = this.safeDict(data, 'G18', {});
121
- const buy = this.safeDict(gold, 'buy', {});
122
- const sell = this.safeDict(gold, 'sell', {});
123
- const bid = this.safeNumber(buy, 'price');
124
- const ask = this.safeNumber(sell, 'price');
125
- return this.safeTicker({
126
- 'symbol': market['symbol'],
127
- 'timestamp': undefined,
128
- 'datetime': undefined,
129
- 'high': undefined,
130
- 'low': undefined,
131
- 'bid': bid,
132
- 'bidVolume': undefined,
133
- 'ask': ask,
134
- 'askVolume': undefined,
135
- 'vwap': undefined,
136
- 'open': undefined,
137
- 'close': ask,
138
- 'last': ask,
139
- 'previousClose': undefined,
140
- 'change': undefined,
141
- 'percentage': this.safeNumber(sell, 'change'),
142
- 'average': undefined,
143
- 'baseVolume': this.safeNumber(gold, 'volume'),
144
- 'quoteVolume': undefined,
145
- 'info': gold,
146
- }, market);
147
- }
148
- sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
149
- let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
150
- const query = this.omit(params, this.extractParams(path));
151
- if (Object.keys(query).length) {
152
- url += '?' + this.urlencode(query);
153
- }
154
- headers = { 'Accept': 'application/json' };
155
- return { 'url': url, 'method': method, 'body': body, 'headers': headers };
156
- }
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class zarafza
11
+ * @augments Exchange
12
+ */
13
+ class zarafza extends Exchange["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'zarafza',
17
+ 'name': 'Zarafza',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': 'v2',
21
+ 'certified': false,
22
+ 'pro': false,
23
+ 'has': {
24
+ 'CORS': undefined,
25
+ 'spot': false,
26
+ 'margin': false,
27
+ 'swap': false,
28
+ 'future': false,
29
+ 'option': false,
30
+ 'fetchMarkets': true,
31
+ 'fetchTicker': true,
32
+ 'fetchTickers': true,
33
+ 'otc': true,
34
+ },
35
+ 'options': {
36
+ 'defaultType': 'otc',
37
+ },
38
+ 'urls': {
39
+ 'api': {
40
+ 'public': 'https://api.zarafza.com',
41
+ },
42
+ 'www': 'https://zarafza.com',
43
+ 'doc': 'https://api.zarafza.com/v2/prices',
44
+ },
45
+ 'api': {
46
+ 'public': {
47
+ 'get': {
48
+ 'v2/prices': 1,
49
+ },
50
+ },
51
+ },
52
+ });
53
+ }
54
+ async fetchMarkets(params = {}) {
55
+ const response = await this.publicGetV2Prices(params);
56
+ return [this.parseMarket(response)];
57
+ }
58
+ parseMarket(response) {
59
+ const data = this.safeDict(response, 'data', {});
60
+ const gold = this.safeDict(data, 'G18', {});
61
+ const sell = this.safeDict(gold, 'sell', {});
62
+ return {
63
+ 'id': 'G18',
64
+ 'symbol': 'XAU18/IRT',
65
+ 'base': 'XAU18',
66
+ 'quote': 'IRT',
67
+ 'settle': undefined,
68
+ 'baseId': 'G18',
69
+ 'quoteId': 'IRT',
70
+ 'settleId': undefined,
71
+ 'type': 'otc',
72
+ 'spot': false,
73
+ 'margin': false,
74
+ 'swap': false,
75
+ 'future': false,
76
+ 'option': false,
77
+ 'active': this.safeNumber(sell, 'price') !== undefined,
78
+ 'contract': false,
79
+ 'linear': undefined,
80
+ 'inverse': undefined,
81
+ 'contractSize': undefined,
82
+ 'expiry': undefined,
83
+ 'expiryDatetime': undefined,
84
+ 'strike': undefined,
85
+ 'optionType': undefined,
86
+ 'precision': {
87
+ 'amount': undefined,
88
+ 'price': undefined,
89
+ },
90
+ 'limits': {
91
+ 'leverage': { 'min': undefined, 'max': undefined },
92
+ 'amount': { 'min': undefined, 'max': undefined },
93
+ 'price': { 'min': undefined, 'max': undefined },
94
+ 'cost': { 'min': undefined, 'max': undefined },
95
+ },
96
+ 'created': undefined,
97
+ 'info': gold,
98
+ };
99
+ }
100
+ async fetchTicker(symbol, params = {}) {
101
+ await this.loadMarkets();
102
+ const market = this.market(symbol);
103
+ const response = await this.publicGetV2Prices(params);
104
+ return this.parseTicker(response, market);
105
+ }
106
+ async fetchTickers(symbols = undefined, params = {}) {
107
+ await this.loadMarkets();
108
+ if (symbols !== undefined) {
109
+ symbols = this.marketSymbols(symbols);
110
+ }
111
+ const response = await this.publicGetV2Prices(params);
112
+ const market = this.market('XAU18/IRT');
113
+ const ticker = this.parseTicker(response, market);
114
+ const result = {};
115
+ result[ticker['symbol']] = ticker;
116
+ return this.filterByArrayTickers(result, 'symbol', symbols);
117
+ }
118
+ parseTicker(response, market = undefined) {
119
+ const data = this.safeDict(response, 'data', {});
120
+ const gold = this.safeDict(data, 'G18', {});
121
+ const buy = this.safeDict(gold, 'buy', {});
122
+ const sell = this.safeDict(gold, 'sell', {});
123
+ const bid = this.safeNumber(buy, 'price');
124
+ const ask = this.safeNumber(sell, 'price');
125
+ return this.safeTicker({
126
+ 'symbol': market['symbol'],
127
+ 'timestamp': undefined,
128
+ 'datetime': undefined,
129
+ 'high': undefined,
130
+ 'low': undefined,
131
+ 'bid': bid,
132
+ 'bidVolume': undefined,
133
+ 'ask': ask,
134
+ 'askVolume': undefined,
135
+ 'vwap': undefined,
136
+ 'open': undefined,
137
+ 'close': ask,
138
+ 'last': ask,
139
+ 'previousClose': undefined,
140
+ 'change': undefined,
141
+ 'percentage': this.safeNumber(sell, 'change'),
142
+ 'average': undefined,
143
+ 'baseVolume': this.safeNumber(gold, 'volume'),
144
+ 'quoteVolume': undefined,
145
+ 'info': gold,
146
+ }, market);
147
+ }
148
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
149
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
150
+ const query = this.omit(params, this.extractParams(path));
151
+ if (Object.keys(query).length) {
152
+ url += '?' + this.urlencode(query);
153
+ }
154
+ headers = { 'Accept': 'application/json' };
155
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
156
+ }
157
157
  }
158
158
 
159
159
  exports["default"] = zarafza;