ccxt-ir 4.17.0 → 4.18.0

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 (65) 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 +34 -1
  6. package/dist/cjs/package.json +1 -1
  7. package/dist/cjs/src/baazar.js +160 -0
  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/talapp.js +156 -0
  15. package/dist/cjs/src/zarafza.js +159 -0
  16. package/dist/cjs/src/zarminex.js +162 -0
  17. package/dist/cjs/src/zarniv.js +178 -0
  18. package/js/ccxt.d.ts +35 -2
  19. package/js/ccxt.js +24 -2
  20. package/js/src/abstract/baazar.d.ts +8 -0
  21. package/js/src/abstract/baazar.js +11 -0
  22. package/js/src/abstract/daric.d.ts +8 -0
  23. package/js/src/abstract/daric.js +11 -0
  24. package/js/src/abstract/digikalagold.d.ts +8 -0
  25. package/js/src/abstract/digikalagold.js +11 -0
  26. package/js/src/abstract/goldcore.d.ts +8 -0
  27. package/js/src/abstract/goldcore.js +11 -0
  28. package/js/src/abstract/goldika.d.ts +8 -0
  29. package/js/src/abstract/goldika.js +11 -0
  30. package/js/src/abstract/goldis.d.ts +8 -0
  31. package/js/src/abstract/goldis.js +11 -0
  32. package/js/src/abstract/hamrahgold.d.ts +8 -0
  33. package/js/src/abstract/hamrahgold.js +11 -0
  34. package/js/src/abstract/talapp.d.ts +8 -0
  35. package/js/src/abstract/talapp.js +11 -0
  36. package/js/src/abstract/zarafza.d.ts +8 -0
  37. package/js/src/abstract/zarafza.js +11 -0
  38. package/js/src/abstract/zarminex.d.ts +8 -0
  39. package/js/src/abstract/zarminex.js +11 -0
  40. package/js/src/abstract/zarniv.d.ts +9 -0
  41. package/js/src/abstract/zarniv.js +11 -0
  42. package/js/src/baazar.d.ts +20 -0
  43. package/js/src/baazar.js +159 -0
  44. package/js/src/daric.d.ts +22 -0
  45. package/js/src/daric.js +180 -0
  46. package/js/src/digikalagold.d.ts +21 -0
  47. package/js/src/digikalagold.js +177 -0
  48. package/js/src/goldcore.d.ts +20 -0
  49. package/js/src/goldcore.js +154 -0
  50. package/js/src/goldika.d.ts +20 -0
  51. package/js/src/goldika.js +162 -0
  52. package/js/src/goldis.d.ts +21 -0
  53. package/js/src/goldis.js +156 -0
  54. package/js/src/hamrahgold.d.ts +21 -0
  55. package/js/src/hamrahgold.js +170 -0
  56. package/js/src/talapp.d.ts +20 -0
  57. package/js/src/talapp.js +155 -0
  58. package/js/src/zarafza.d.ts +20 -0
  59. package/js/src/zarafza.js +158 -0
  60. package/js/src/zarminex.d.ts +20 -0
  61. package/js/src/zarminex.js +161 -0
  62. package/js/src/zarniv.d.ts +21 -0
  63. package/js/src/zarniv.js +177 -0
  64. package/js/test.js +50 -43
  65. package/package.json +1 -1
@@ -0,0 +1,156 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Exchange = require('./base/Exchange.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class talapp
11
+ * @augments Exchange
12
+ */
13
+ class talapp extends Exchange["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'talapp',
17
+ 'name': 'Talapp',
18
+ 'countries': ['IR'],
19
+ 'rateLimit': 1000,
20
+ 'version': 'v1',
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://talapp.ir',
41
+ },
42
+ 'www': 'https://talapp.ir',
43
+ 'doc': 'https://talapp.ir/wp-json/talapp/v1/gold-prices',
44
+ },
45
+ 'api': {
46
+ 'public': {
47
+ 'get': {
48
+ 'wp-json/talapp/v1/gold-prices': 1,
49
+ },
50
+ },
51
+ },
52
+ });
53
+ }
54
+ async fetchMarkets(params = {}) {
55
+ const response = await this.publicGetWpJsonTalappV1GoldPrices(params);
56
+ return [this.parseMarket(response)];
57
+ }
58
+ parseMarket(response) {
59
+ const stale = this.safeBool(response, 'stale', false);
60
+ return {
61
+ 'id': 'XAU18IRT',
62
+ 'symbol': 'XAU18/IRT',
63
+ 'base': 'XAU18',
64
+ 'quote': 'IRT',
65
+ 'settle': undefined,
66
+ 'baseId': 'XAU18',
67
+ 'quoteId': 'IRT',
68
+ 'settleId': undefined,
69
+ 'type': 'otc',
70
+ 'spot': false,
71
+ 'margin': false,
72
+ 'swap': false,
73
+ 'future': false,
74
+ 'option': false,
75
+ 'active': !stale,
76
+ 'contract': false,
77
+ 'linear': undefined,
78
+ 'inverse': undefined,
79
+ 'contractSize': undefined,
80
+ 'expiry': undefined,
81
+ 'expiryDatetime': undefined,
82
+ 'strike': undefined,
83
+ 'optionType': undefined,
84
+ 'precision': {
85
+ 'amount': undefined,
86
+ 'price': undefined,
87
+ },
88
+ 'limits': {
89
+ 'leverage': { 'min': undefined, 'max': undefined },
90
+ 'amount': { 'min': undefined, 'max': undefined },
91
+ 'price': { 'min': undefined, 'max': undefined },
92
+ 'cost': { 'min': undefined, 'max': undefined },
93
+ },
94
+ 'created': undefined,
95
+ 'info': response,
96
+ };
97
+ }
98
+ async fetchTicker(symbol, params = {}) {
99
+ await this.loadMarkets();
100
+ const market = this.market(symbol);
101
+ const response = await this.publicGetWpJsonTalappV1GoldPrices(params);
102
+ return this.parseTicker(response, market);
103
+ }
104
+ async fetchTickers(symbols = undefined, params = {}) {
105
+ await this.loadMarkets();
106
+ if (symbols !== undefined) {
107
+ symbols = this.marketSymbols(symbols);
108
+ }
109
+ const response = await this.publicGetWpJsonTalappV1GoldPrices(params);
110
+ const market = this.market('XAU18/IRT');
111
+ const ticker = this.parseTicker(response, market);
112
+ const result = {};
113
+ result[ticker['symbol']] = ticker;
114
+ return this.filterByArrayTickers(result, 'symbol', symbols);
115
+ }
116
+ parseTicker(response, market = undefined) {
117
+ const fetchedAt = this.safeString(response, 'fetched_at');
118
+ let timestamp = undefined;
119
+ if (fetchedAt !== undefined) {
120
+ timestamp = this.parse8601(fetchedAt.replace(' ', 'T') + '+03:30');
121
+ }
122
+ return this.safeTicker({
123
+ 'symbol': market['symbol'],
124
+ 'timestamp': timestamp,
125
+ 'datetime': undefined,
126
+ 'high': undefined,
127
+ 'low': undefined,
128
+ 'bid': this.safeNumber(response, 'buy_gold'),
129
+ 'bidVolume': undefined,
130
+ 'ask': this.safeNumber(response, 'sell_gold'),
131
+ 'askVolume': undefined,
132
+ 'vwap': undefined,
133
+ 'open': undefined,
134
+ 'close': this.safeNumber(response, 'sell_gold'),
135
+ 'last': this.safeNumber(response, 'sell_gold'),
136
+ 'previousClose': undefined,
137
+ 'change': undefined,
138
+ 'percentage': this.safeNumber(response, 'sell_diff'),
139
+ 'average': undefined,
140
+ 'baseVolume': undefined,
141
+ 'quoteVolume': undefined,
142
+ 'info': response,
143
+ }, market);
144
+ }
145
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
146
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
147
+ const query = this.omit(params, this.extractParams(path));
148
+ if (Object.keys(query).length) {
149
+ url += '?' + this.urlencode(query);
150
+ }
151
+ headers = { 'Accept': 'application/json' };
152
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
153
+ }
154
+ }
155
+
156
+ exports["default"] = talapp;
@@ -0,0 +1,159 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Exchange = require('./base/Exchange.js');
6
+
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
+ }
157
+ }
158
+
159
+ exports["default"] = zarafza;
@@ -0,0 +1,162 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Exchange = require('./base/Exchange.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class zarminex
11
+ * @augments Exchange
12
+ */
13
+ class zarminex extends Exchange["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'zarminex',
17
+ 'name': 'Zarminex',
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.zarminex.ir',
41
+ },
42
+ 'www': 'https://zarminex.ir',
43
+ 'doc': 'https://api.zarminex.ir/function_url/',
44
+ },
45
+ 'api': {
46
+ 'public': {
47
+ 'get': {
48
+ 'function_url': 1,
49
+ },
50
+ },
51
+ },
52
+ });
53
+ }
54
+ async fetchMarkets(params = {}) {
55
+ const response = await this.publicGetFunctionUrl(params);
56
+ return [this.parseMarket(response)];
57
+ }
58
+ parseMarket(response) {
59
+ return {
60
+ 'id': 'XAU18IRT',
61
+ 'symbol': 'XAU18/IRT',
62
+ 'base': 'XAU18',
63
+ 'quote': 'IRT',
64
+ 'settle': undefined,
65
+ 'baseId': 'XAU18',
66
+ 'quoteId': 'IRT',
67
+ 'settleId': undefined,
68
+ 'type': 'otc',
69
+ 'spot': false,
70
+ 'margin': false,
71
+ 'swap': false,
72
+ 'future': false,
73
+ 'option': false,
74
+ 'active': this.safeNumber(response, 'cached_price') !== undefined,
75
+ 'contract': false,
76
+ 'linear': undefined,
77
+ 'inverse': undefined,
78
+ 'contractSize': undefined,
79
+ 'expiry': undefined,
80
+ 'expiryDatetime': undefined,
81
+ 'strike': undefined,
82
+ 'optionType': undefined,
83
+ 'precision': {
84
+ 'amount': undefined,
85
+ 'price': undefined,
86
+ },
87
+ 'limits': {
88
+ 'leverage': { 'min': undefined, 'max': undefined },
89
+ 'amount': { 'min': undefined, 'max': undefined },
90
+ 'price': { 'min': undefined, 'max': undefined },
91
+ 'cost': { 'min': undefined, 'max': undefined },
92
+ },
93
+ 'created': undefined,
94
+ 'info': response,
95
+ };
96
+ }
97
+ async fetchTicker(symbol, params = {}) {
98
+ await this.loadMarkets();
99
+ const market = this.market(symbol);
100
+ const response = await this.publicGetFunctionUrl(params);
101
+ return this.parseTicker(response, market);
102
+ }
103
+ async fetchTickers(symbols = undefined, params = {}) {
104
+ await this.loadMarkets();
105
+ if (symbols !== undefined) {
106
+ symbols = this.marketSymbols(symbols);
107
+ }
108
+ const response = await this.publicGetFunctionUrl(params);
109
+ const market = this.market('XAU18/IRT');
110
+ const ticker = this.parseTicker(response, market);
111
+ const result = {};
112
+ result[ticker['symbol']] = ticker;
113
+ return this.filterByArrayTickers(result, 'symbol', symbols);
114
+ }
115
+ parseTicker(response, market = undefined) {
116
+ let bid = this.safeNumber(response, 'sell');
117
+ let ask = this.safeNumber(response, 'buy');
118
+ let last = this.safeNumber(response, 'cached_price');
119
+ if (bid !== undefined) {
120
+ bid = bid / 10;
121
+ }
122
+ if (ask !== undefined) {
123
+ ask = ask / 10;
124
+ }
125
+ if (last !== undefined) {
126
+ last = last / 10;
127
+ }
128
+ return this.safeTicker({
129
+ 'symbol': market['symbol'],
130
+ 'timestamp': undefined,
131
+ 'datetime': undefined,
132
+ 'high': undefined,
133
+ 'low': undefined,
134
+ 'bid': bid,
135
+ 'bidVolume': undefined,
136
+ 'ask': ask,
137
+ 'askVolume': undefined,
138
+ 'vwap': undefined,
139
+ 'open': undefined,
140
+ 'close': last,
141
+ 'last': last,
142
+ 'previousClose': undefined,
143
+ 'change': undefined,
144
+ 'percentage': undefined,
145
+ 'average': undefined,
146
+ 'baseVolume': undefined,
147
+ 'quoteVolume': undefined,
148
+ 'info': response,
149
+ }, market);
150
+ }
151
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
152
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
153
+ const query = this.omit(params, this.extractParams(path));
154
+ if (Object.keys(query).length) {
155
+ url += '?' + this.urlencode(query);
156
+ }
157
+ headers = { 'Accept': 'application/json' };
158
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
159
+ }
160
+ }
161
+
162
+ exports["default"] = zarminex;
@@ -0,0 +1,178 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Exchange = require('./base/Exchange.js');
6
+
7
+ // ----------------------------------------------------------------------------
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * @class zarniv
11
+ * @augments Exchange
12
+ */
13
+ class zarniv extends Exchange["default"] {
14
+ describe() {
15
+ return this.deepExtend(super.describe(), {
16
+ 'id': 'zarniv',
17
+ 'name': 'Zarniv',
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://zarniv.ir',
41
+ },
42
+ 'www': 'https://zarniv.ir',
43
+ 'doc': 'https://zarniv.ir/user/get_gold_price/',
44
+ },
45
+ 'api': {
46
+ 'public': {
47
+ 'get': {
48
+ 'user/get_gold_price': 1,
49
+ 'user/get_silver_price': 1,
50
+ },
51
+ },
52
+ },
53
+ });
54
+ }
55
+ fetchPrice(metal, params = {}) {
56
+ if (metal === 'gold') {
57
+ return this.publicGetUserGetGoldPrice(params);
58
+ }
59
+ return this.publicGetUserGetSilverPrice(params);
60
+ }
61
+ async fetchMarkets(params = {}) {
62
+ const goldResponse = await this.fetchPrice('gold', params);
63
+ const silverResponse = await this.fetchPrice('silver', params);
64
+ return [
65
+ this.parseMarketEntry(goldResponse, 'gold'),
66
+ this.parseMarketEntry(silverResponse, 'silver'),
67
+ ];
68
+ }
69
+ parseMarketEntry(response, metal) {
70
+ let base = 'XAG';
71
+ if (metal === 'gold') {
72
+ base = 'XAU18';
73
+ }
74
+ const quote = 'IRT';
75
+ return {
76
+ 'id': base + quote,
77
+ 'symbol': base + '/' + quote,
78
+ 'base': base,
79
+ 'quote': quote,
80
+ 'settle': undefined,
81
+ 'baseId': metal,
82
+ 'quoteId': quote,
83
+ 'settleId': undefined,
84
+ 'type': 'otc',
85
+ 'spot': false,
86
+ 'margin': false,
87
+ 'swap': false,
88
+ 'future': false,
89
+ 'option': false,
90
+ 'active': this.safeNumber(response, 'base_price_per_gram') !== undefined,
91
+ 'contract': false,
92
+ 'linear': undefined,
93
+ 'inverse': undefined,
94
+ 'contractSize': undefined,
95
+ 'expiry': undefined,
96
+ 'expiryDatetime': undefined,
97
+ 'strike': undefined,
98
+ 'optionType': undefined,
99
+ 'precision': {
100
+ 'amount': undefined,
101
+ 'price': undefined,
102
+ },
103
+ 'limits': {
104
+ 'leverage': { 'min': undefined, 'max': undefined },
105
+ 'amount': { 'min': undefined, 'max': undefined },
106
+ 'price': { 'min': undefined, 'max': undefined },
107
+ 'cost': { 'min': undefined, 'max': undefined },
108
+ },
109
+ 'created': undefined,
110
+ 'info': response,
111
+ };
112
+ }
113
+ async fetchTicker(symbol, params = {}) {
114
+ await this.loadMarkets();
115
+ const market = this.market(symbol);
116
+ const response = await this.fetchPrice(market['baseId'], params);
117
+ return this.parseTicker(response, market);
118
+ }
119
+ async fetchTickers(symbols = undefined, params = {}) {
120
+ await this.loadMarkets();
121
+ if (symbols !== undefined) {
122
+ symbols = this.marketSymbols(symbols);
123
+ }
124
+ const goldResponse = await this.fetchPrice('gold', params);
125
+ const silverResponse = await this.fetchPrice('silver', params);
126
+ const goldMarket = this.market('XAU18/IRT');
127
+ const silverMarket = this.market('XAG/IRT');
128
+ const goldTicker = this.parseTicker(goldResponse, goldMarket);
129
+ const silverTicker = this.parseTicker(silverResponse, silverMarket);
130
+ const result = {};
131
+ result[goldTicker['symbol']] = goldTicker;
132
+ result[silverTicker['symbol']] = silverTicker;
133
+ return this.filterByArrayTickers(result, 'symbol', symbols);
134
+ }
135
+ parseTicker(response, market = undefined) {
136
+ const serverTime = this.safeString(response, 'server_time');
137
+ let timestamp = undefined;
138
+ if (serverTime !== undefined) {
139
+ timestamp = this.parse8601(serverTime + '+03:30');
140
+ }
141
+ const bid = this.safeNumber(response, 'sell_price_per_gram');
142
+ const ask = this.safeNumber(response, 'buy_price_per_gram');
143
+ const last = this.safeNumber(response, 'base_price_per_gram');
144
+ return this.safeTicker({
145
+ 'symbol': market['symbol'],
146
+ 'timestamp': timestamp,
147
+ 'datetime': undefined,
148
+ 'high': undefined,
149
+ 'low': undefined,
150
+ 'bid': bid,
151
+ 'bidVolume': undefined,
152
+ 'ask': ask,
153
+ 'askVolume': undefined,
154
+ 'vwap': undefined,
155
+ 'open': undefined,
156
+ 'close': last,
157
+ 'last': last,
158
+ 'previousClose': undefined,
159
+ 'change': undefined,
160
+ 'percentage': undefined,
161
+ 'average': undefined,
162
+ 'baseVolume': undefined,
163
+ 'quoteVolume': undefined,
164
+ 'info': response,
165
+ }, market);
166
+ }
167
+ sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
168
+ let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
169
+ const query = this.omit(params, this.extractParams(path));
170
+ if (Object.keys(query).length) {
171
+ url += '?' + this.urlencode(query);
172
+ }
173
+ headers = { 'Accept': 'application/json' };
174
+ return { 'url': url, 'method': method, 'body': body, 'headers': headers };
175
+ }
176
+ }
177
+
178
+ exports["default"] = zarniv;