ccxt-ir 4.16.3 → 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.
- package/README.md +4 -4
- package/dist/373.ccxt.browser.js +1 -1
- package/dist/373.ccxt.browser.min.js +1 -1
- package/dist/ccxt.browser.min.js +15 -15
- package/dist/cjs/ccxt.js +46 -1
- package/dist/cjs/src/asacoine.js +359 -359
- package/dist/cjs/src/baazar.js +160 -0
- package/dist/cjs/src/base/Exchange.js +7364 -7360
- package/dist/cjs/src/bitpin.js +478 -478
- package/dist/cjs/src/daric.js +181 -0
- package/dist/cjs/src/digikalagold.js +178 -0
- package/dist/cjs/src/goldcore.js +155 -0
- package/dist/cjs/src/goldika.js +163 -0
- package/dist/cjs/src/goldis.js +157 -0
- package/dist/cjs/src/hamrahgold.js +171 -0
- package/dist/cjs/src/iranexchange.js +390 -390
- package/dist/cjs/src/melligold.js +221 -0
- package/dist/cjs/src/milligold.js +156 -0
- package/dist/cjs/src/talapp.js +156 -0
- package/dist/cjs/src/technogold.js +153 -0
- package/dist/cjs/src/wallgold.js +164 -0
- package/dist/cjs/src/zarafza.js +159 -0
- package/dist/cjs/src/zarminex.js +162 -0
- package/dist/cjs/src/zarniv.js +178 -0
- package/js/ccxt.d.ts +47 -2
- package/js/ccxt.js +32 -2
- package/js/src/abstract/baazar.d.ts +8 -0
- package/js/src/abstract/baazar.js +11 -0
- package/js/src/abstract/daric.d.ts +8 -0
- package/js/src/abstract/daric.js +11 -0
- package/js/src/abstract/digikalagold.d.ts +8 -0
- package/js/src/abstract/digikalagold.js +11 -0
- package/js/src/abstract/goldcore.d.ts +8 -0
- package/js/src/abstract/goldcore.js +11 -0
- package/js/src/abstract/goldika.d.ts +8 -0
- package/js/src/abstract/goldika.js +11 -0
- package/js/src/abstract/goldis.d.ts +8 -0
- package/js/src/abstract/goldis.js +11 -0
- package/js/src/abstract/hamrahgold.d.ts +8 -0
- package/js/src/abstract/hamrahgold.js +11 -0
- package/js/src/abstract/melligold.d.ts +8 -0
- package/js/src/abstract/melligold.js +11 -0
- package/js/src/abstract/milligold.d.ts +8 -0
- package/js/src/abstract/milligold.js +11 -0
- package/js/src/abstract/talapp.d.ts +8 -0
- package/js/src/abstract/talapp.js +11 -0
- package/js/src/abstract/technogold.d.ts +8 -0
- package/js/src/abstract/technogold.js +11 -0
- package/js/src/abstract/wallgold.d.ts +8 -0
- package/js/src/abstract/wallgold.js +11 -0
- package/js/src/abstract/zarafza.d.ts +8 -0
- package/js/src/abstract/zarafza.js +11 -0
- package/js/src/abstract/zarminex.d.ts +8 -0
- package/js/src/abstract/zarminex.js +11 -0
- package/js/src/abstract/zarniv.d.ts +9 -0
- package/js/src/abstract/zarniv.js +11 -0
- package/js/src/asacoine.d.ts +23 -23
- package/js/src/asacoine.js +363 -363
- package/js/src/baazar.d.ts +20 -0
- package/js/src/baazar.js +159 -0
- package/js/src/base/Exchange.d.ts +2 -2
- package/js/src/base/Exchange.js +7397 -7393
- package/js/src/bitpin.js +481 -481
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/daric.d.ts +22 -0
- package/js/src/daric.js +180 -0
- package/js/src/digikalagold.d.ts +21 -0
- package/js/src/digikalagold.js +177 -0
- package/js/src/goldcore.d.ts +20 -0
- package/js/src/goldcore.js +154 -0
- package/js/src/goldika.d.ts +20 -0
- package/js/src/goldika.js +162 -0
- package/js/src/goldis.d.ts +21 -0
- package/js/src/goldis.js +156 -0
- package/js/src/hamrahgold.d.ts +21 -0
- package/js/src/hamrahgold.js +170 -0
- package/js/src/iranexchange.js +393 -393
- package/js/src/melligold.d.ts +21 -0
- package/js/src/melligold.js +220 -0
- package/js/src/milligold.d.ts +20 -0
- package/js/src/milligold.js +155 -0
- package/js/src/protobuf/mexc/compiled.d.cts +0 -6
- package/js/src/static_dependencies/fflake/browser.d.ts +5 -5
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/static_dependencies/qs/formats.d.cts +0 -6
- package/js/src/static_dependencies/qs/index.d.cts +0 -6
- package/js/src/static_dependencies/qs/parse.d.cts +0 -6
- package/js/src/static_dependencies/qs/stringify.d.cts +0 -6
- package/js/src/static_dependencies/qs/utils.d.cts +0 -6
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
- package/js/src/talapp.d.ts +20 -0
- package/js/src/talapp.js +155 -0
- package/js/src/technogold.d.ts +20 -0
- package/js/src/technogold.js +152 -0
- package/js/src/wallgold.d.ts +21 -0
- package/js/src/wallgold.js +163 -0
- package/js/src/zarafza.d.ts +20 -0
- package/js/src/zarafza.js +158 -0
- package/js/src/zarminex.d.ts +20 -0
- package/js/src/zarminex.js +161 -0
- package/js/src/zarniv.d.ts +21 -0
- package/js/src/zarniv.js +177 -0
- package/js/test.js +60 -71
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Exchange from './base/Exchange.js';
|
|
2
|
+
import { Market, Strings, Ticker, Tickers } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class melligold
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class melligold extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
10
|
+
requestWithCookie(params?: {}): Promise<any>;
|
|
11
|
+
parseMarket(response: any, baseId?: string): Market;
|
|
12
|
+
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
13
|
+
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
14
|
+
parseTicker(response: any, market?: Market): Ticker;
|
|
15
|
+
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
16
|
+
url: string;
|
|
17
|
+
method: string;
|
|
18
|
+
body: any;
|
|
19
|
+
headers: any;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
import Exchange from './base/Exchange.js';
|
|
9
|
+
import { ExchangeError } from './base/errors.js';
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
/**
|
|
12
|
+
* @class melligold
|
|
13
|
+
* @augments Exchange
|
|
14
|
+
*/
|
|
15
|
+
export default class melligold extends Exchange {
|
|
16
|
+
describe() {
|
|
17
|
+
return this.deepExtend(super.describe(), {
|
|
18
|
+
'id': 'melligold',
|
|
19
|
+
'name': 'MelliGold',
|
|
20
|
+
'countries': ['IR'],
|
|
21
|
+
'rateLimit': 1000,
|
|
22
|
+
'version': '1',
|
|
23
|
+
'certified': false,
|
|
24
|
+
'pro': false,
|
|
25
|
+
'has': {
|
|
26
|
+
'CORS': undefined,
|
|
27
|
+
'spot': false,
|
|
28
|
+
'margin': false,
|
|
29
|
+
'swap': false,
|
|
30
|
+
'future': false,
|
|
31
|
+
'option': false,
|
|
32
|
+
'fetchMarkets': true,
|
|
33
|
+
'fetchTicker': true,
|
|
34
|
+
'fetchTickers': true,
|
|
35
|
+
'otc': true,
|
|
36
|
+
},
|
|
37
|
+
'options': {
|
|
38
|
+
'defaultType': 'otc',
|
|
39
|
+
'melligoldCookie': undefined,
|
|
40
|
+
'manualRedirect': true,
|
|
41
|
+
},
|
|
42
|
+
'urls': {
|
|
43
|
+
'api': {
|
|
44
|
+
'public': 'https://melligold.com',
|
|
45
|
+
},
|
|
46
|
+
'www': 'https://melligold.com',
|
|
47
|
+
'doc': 'https://melligold.com',
|
|
48
|
+
},
|
|
49
|
+
'api': {
|
|
50
|
+
'public': {
|
|
51
|
+
'get': {
|
|
52
|
+
'api/v1/exchange/buy-sell-price/': 1,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async fetchMarkets(params = {}) {
|
|
59
|
+
const symbols = ['XAU18', 'XAG'];
|
|
60
|
+
const result = [];
|
|
61
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
62
|
+
const response = await this.requestWithCookie(this.extend({
|
|
63
|
+
'symbol': symbols[i],
|
|
64
|
+
'format': 'json',
|
|
65
|
+
}, params));
|
|
66
|
+
result.push(this.parseMarket(response, symbols[i]));
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
async requestWithCookie(params = {}) {
|
|
71
|
+
let response = undefined;
|
|
72
|
+
let error = undefined;
|
|
73
|
+
try {
|
|
74
|
+
response = await this.publicGetApiV1ExchangeBuySellPrice(params);
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
error = e;
|
|
78
|
+
}
|
|
79
|
+
if (this.safeValue(response, 'data') !== undefined) {
|
|
80
|
+
return response;
|
|
81
|
+
}
|
|
82
|
+
const responseHeaders = this.last_response_headers || {};
|
|
83
|
+
const setCookie = this.safeString(responseHeaders, 'Set-Cookie');
|
|
84
|
+
if (setCookie !== undefined) {
|
|
85
|
+
const cookies = setCookie.split(', ');
|
|
86
|
+
const values = [];
|
|
87
|
+
for (let i = 0; i < cookies.length; i++) {
|
|
88
|
+
values.push(cookies[i].split(';')[0]);
|
|
89
|
+
}
|
|
90
|
+
const cookie = values.join('; ');
|
|
91
|
+
if (cookie !== '' && cookie !== this.options['melligoldCookie']) {
|
|
92
|
+
this.options['melligoldCookie'] = cookie;
|
|
93
|
+
response = await this.publicGetApiV1ExchangeBuySellPrice(params);
|
|
94
|
+
if (this.safeValue(response, 'data') !== undefined) {
|
|
95
|
+
return response;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (error !== undefined) {
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
throw new ExchangeError(this.id + ' returned an invalid response');
|
|
103
|
+
}
|
|
104
|
+
parseMarket(response, baseId = undefined) {
|
|
105
|
+
const data = this.safeDict(response, 'data', {});
|
|
106
|
+
const lowerAmounts = this.safeDict(data, 'lower_amounts', {});
|
|
107
|
+
const base = this.safeCurrencyCode(baseId);
|
|
108
|
+
const quote = 'IRT';
|
|
109
|
+
return {
|
|
110
|
+
'id': base + quote,
|
|
111
|
+
'symbol': base + '/' + quote,
|
|
112
|
+
'base': base,
|
|
113
|
+
'quote': quote,
|
|
114
|
+
'settle': undefined,
|
|
115
|
+
'baseId': baseId,
|
|
116
|
+
'quoteId': quote,
|
|
117
|
+
'settleId': undefined,
|
|
118
|
+
'type': 'otc',
|
|
119
|
+
'spot': false,
|
|
120
|
+
'margin': false,
|
|
121
|
+
'swap': false,
|
|
122
|
+
'future': false,
|
|
123
|
+
'option': false,
|
|
124
|
+
'active': true,
|
|
125
|
+
'contract': false,
|
|
126
|
+
'linear': undefined,
|
|
127
|
+
'inverse': undefined,
|
|
128
|
+
'contractSize': undefined,
|
|
129
|
+
'expiry': undefined,
|
|
130
|
+
'expiryDatetime': undefined,
|
|
131
|
+
'strike': undefined,
|
|
132
|
+
'optionType': undefined,
|
|
133
|
+
'precision': {
|
|
134
|
+
'amount': undefined,
|
|
135
|
+
'price': undefined,
|
|
136
|
+
},
|
|
137
|
+
'limits': {
|
|
138
|
+
'leverage': { 'min': undefined, 'max': undefined },
|
|
139
|
+
'amount': { 'min': undefined, 'max': undefined },
|
|
140
|
+
'price': { 'min': undefined, 'max': undefined },
|
|
141
|
+
'cost': {
|
|
142
|
+
'min': this.safeNumber(lowerAmounts, 'buy_toman'),
|
|
143
|
+
'max': undefined,
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
'created': undefined,
|
|
147
|
+
'info': response,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async fetchTicker(symbol, params = {}) {
|
|
151
|
+
await this.loadMarkets();
|
|
152
|
+
const market = this.market(symbol);
|
|
153
|
+
const response = await this.requestWithCookie(this.extend({
|
|
154
|
+
'symbol': market['baseId'],
|
|
155
|
+
'format': 'json',
|
|
156
|
+
}, params));
|
|
157
|
+
return this.parseTicker(response, market);
|
|
158
|
+
}
|
|
159
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
160
|
+
await this.loadMarkets();
|
|
161
|
+
if (symbols !== undefined) {
|
|
162
|
+
symbols = this.marketSymbols(symbols);
|
|
163
|
+
}
|
|
164
|
+
const result = {};
|
|
165
|
+
const marketSymbols = ['XAU18/IRT', 'XAG/IRT'];
|
|
166
|
+
for (let i = 0; i < marketSymbols.length; i++) {
|
|
167
|
+
const market = this.market(marketSymbols[i]);
|
|
168
|
+
const response = await this.requestWithCookie(this.extend({
|
|
169
|
+
'symbol': market['baseId'],
|
|
170
|
+
'format': 'json',
|
|
171
|
+
}, params));
|
|
172
|
+
const ticker = this.parseTicker(response, market);
|
|
173
|
+
result[ticker['symbol']] = ticker;
|
|
174
|
+
}
|
|
175
|
+
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
176
|
+
}
|
|
177
|
+
parseTicker(response, market = undefined) {
|
|
178
|
+
const data = this.safeDict(response, 'data', {});
|
|
179
|
+
const buy = this.safeNumber(data, 'price_buy');
|
|
180
|
+
const sell = this.safeNumber(data, 'price_sell');
|
|
181
|
+
return this.safeTicker({
|
|
182
|
+
'symbol': market['symbol'],
|
|
183
|
+
'timestamp': this.safeTimestamp(data, 'timestamp'),
|
|
184
|
+
'datetime': undefined,
|
|
185
|
+
'high': undefined,
|
|
186
|
+
'low': undefined,
|
|
187
|
+
'bid': sell,
|
|
188
|
+
'bidVolume': undefined,
|
|
189
|
+
'ask': buy,
|
|
190
|
+
'askVolume': undefined,
|
|
191
|
+
'vwap': undefined,
|
|
192
|
+
'open': undefined,
|
|
193
|
+
'close': buy,
|
|
194
|
+
'last': buy,
|
|
195
|
+
'previousClose': undefined,
|
|
196
|
+
'change': undefined,
|
|
197
|
+
'percentage': undefined,
|
|
198
|
+
'average': undefined,
|
|
199
|
+
'baseVolume': undefined,
|
|
200
|
+
'quoteVolume': undefined,
|
|
201
|
+
'info': response,
|
|
202
|
+
}, market);
|
|
203
|
+
}
|
|
204
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
205
|
+
let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
|
|
206
|
+
const query = this.omit(params, this.extractParams(path));
|
|
207
|
+
if (Object.keys(query).length) {
|
|
208
|
+
url += '?' + this.urlencode(query);
|
|
209
|
+
}
|
|
210
|
+
headers = {
|
|
211
|
+
'Accept': 'application/json',
|
|
212
|
+
'Content-Type': 'application/json',
|
|
213
|
+
'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',
|
|
214
|
+
};
|
|
215
|
+
if (this.options['melligoldCookie'] !== undefined) {
|
|
216
|
+
headers['Cookie'] = this.options['melligoldCookie'];
|
|
217
|
+
}
|
|
218
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Exchange from './base/Exchange.js';
|
|
2
|
+
import { Market, Strings, Ticker, Tickers } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class milligold
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class milligold extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
10
|
+
parseMarket(response: any): Market;
|
|
11
|
+
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
12
|
+
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
13
|
+
parseTicker(response: any, market?: Market): Ticker;
|
|
14
|
+
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
15
|
+
url: string;
|
|
16
|
+
method: string;
|
|
17
|
+
body: any;
|
|
18
|
+
headers: any;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// ----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
import Exchange from './base/Exchange.js';
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
/**
|
|
11
|
+
* @class milligold
|
|
12
|
+
* @augments Exchange
|
|
13
|
+
*/
|
|
14
|
+
export default class milligold extends Exchange {
|
|
15
|
+
describe() {
|
|
16
|
+
return this.deepExtend(super.describe(), {
|
|
17
|
+
'id': 'milligold',
|
|
18
|
+
'name': 'Milli Gold',
|
|
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
|
+
},
|
|
39
|
+
'urls': {
|
|
40
|
+
'api': {
|
|
41
|
+
'public': 'https://milli.gold',
|
|
42
|
+
},
|
|
43
|
+
'www': 'https://milli.gold',
|
|
44
|
+
'doc': 'https://milli.gold',
|
|
45
|
+
},
|
|
46
|
+
'api': {
|
|
47
|
+
'public': {
|
|
48
|
+
'get': {
|
|
49
|
+
'api/v1/public/milli-price/external': 1,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async fetchMarkets(params = {}) {
|
|
56
|
+
const response = await this.publicGetApiV1PublicMilliPriceExternal(params);
|
|
57
|
+
return [this.parseMarket(response)];
|
|
58
|
+
}
|
|
59
|
+
parseMarket(response) {
|
|
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': this.safeInteger(response, 'code') === 0,
|
|
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.publicGetApiV1PublicMilliPriceExternal(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 market = this.market('XAU18/IRT');
|
|
110
|
+
const response = await this.publicGetApiV1PublicMilliPriceExternal(params);
|
|
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 data = this.safeDict(response, 'data', {});
|
|
118
|
+
const price = this.safeNumber(data, 'price18');
|
|
119
|
+
const date = this.safeString(data, 'date');
|
|
120
|
+
const timestamp = date ? this.parse8601(date) : undefined;
|
|
121
|
+
// The endpoint returns the price of 0.01g; normalize to the 1g XAU18 market price.
|
|
122
|
+
const pricePerGram = price * 100;
|
|
123
|
+
return this.safeTicker({
|
|
124
|
+
'symbol': market['symbol'],
|
|
125
|
+
'timestamp': timestamp,
|
|
126
|
+
'datetime': undefined,
|
|
127
|
+
'high': undefined,
|
|
128
|
+
'low': undefined,
|
|
129
|
+
'bid': pricePerGram,
|
|
130
|
+
'bidVolume': undefined,
|
|
131
|
+
'ask': pricePerGram,
|
|
132
|
+
'askVolume': undefined,
|
|
133
|
+
'vwap': undefined,
|
|
134
|
+
'open': undefined,
|
|
135
|
+
'close': pricePerGram,
|
|
136
|
+
'last': pricePerGram,
|
|
137
|
+
'previousClose': undefined,
|
|
138
|
+
'change': undefined,
|
|
139
|
+
'percentage': undefined,
|
|
140
|
+
'average': undefined,
|
|
141
|
+
'baseVolume': undefined,
|
|
142
|
+
'quoteVolume': undefined,
|
|
143
|
+
'info': response,
|
|
144
|
+
}, market);
|
|
145
|
+
}
|
|
146
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
147
|
+
let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
|
|
148
|
+
const query = this.omit(params, this.extractParams(path));
|
|
149
|
+
if (Object.keys(query).length) {
|
|
150
|
+
url += '?' + this.urlencode(query);
|
|
151
|
+
}
|
|
152
|
+
headers = { 'Content-Type': 'application/json' };
|
|
153
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
1
|
export = $root;
|
|
8
2
|
declare var $root: {};
|
|
@@ -5,7 +5,7 @@ export function deflate(data: any, opts: any, cb: any): () => void;
|
|
|
5
5
|
* @param opts The compression options
|
|
6
6
|
* @returns The deflated version of the data
|
|
7
7
|
*/
|
|
8
|
-
export function deflateSync(data: any, opts: any): Uint8Array |
|
|
8
|
+
export function deflateSync(data: any, opts: any): Uint8Array | Uint32Array | Uint16Array;
|
|
9
9
|
export function inflate(data: any, opts: any, cb: any): () => void;
|
|
10
10
|
/**
|
|
11
11
|
* Expands DEFLATE data with no wrapper
|
|
@@ -21,7 +21,7 @@ export function gzip(data: any, opts: any, cb: any): () => void;
|
|
|
21
21
|
* @param opts The compression options
|
|
22
22
|
* @returns The gzipped version of the data
|
|
23
23
|
*/
|
|
24
|
-
export function gzipSync(data: any, opts: any): Uint8Array |
|
|
24
|
+
export function gzipSync(data: any, opts: any): Uint8Array | Uint32Array | Uint16Array;
|
|
25
25
|
export function gunzip(data: any, opts: any, cb: any): () => void;
|
|
26
26
|
/**
|
|
27
27
|
* Expands GZIP data
|
|
@@ -37,7 +37,7 @@ export function zlib(data: any, opts: any, cb: any): () => void;
|
|
|
37
37
|
* @param opts The compression options
|
|
38
38
|
* @returns The zlib-compressed version of the data
|
|
39
39
|
*/
|
|
40
|
-
export function zlibSync(data: any, opts: any): Uint8Array |
|
|
40
|
+
export function zlibSync(data: any, opts: any): Uint8Array | Uint32Array | Uint16Array;
|
|
41
41
|
export function unzlib(data: any, opts: any, cb: any): () => void;
|
|
42
42
|
/**
|
|
43
43
|
* Expands Zlib data
|
|
@@ -61,7 +61,7 @@ export function decompressSync(data: any, out: any): any;
|
|
|
61
61
|
* not need to be true unless decoding a binary string.
|
|
62
62
|
* @returns The string encoded in UTF-8/Latin-1 binary
|
|
63
63
|
*/
|
|
64
|
-
export function strToU8(str: any, latin1: any): Uint8Array |
|
|
64
|
+
export function strToU8(str: any, latin1: any): Uint8Array | Uint32Array | Uint16Array;
|
|
65
65
|
/**
|
|
66
66
|
* Converts a Uint8Array to a string
|
|
67
67
|
* @param dat The data to decode to string
|
|
@@ -69,7 +69,7 @@ export function strToU8(str: any, latin1: any): Uint8Array | Uint16Array | Uint3
|
|
|
69
69
|
* not need to be true unless encoding to binary string.
|
|
70
70
|
* @returns The original UTF-8/Latin-1 string
|
|
71
71
|
*/
|
|
72
|
-
export function strFromU8(dat: any, latin1: any): string | Uint8Array |
|
|
72
|
+
export function strFromU8(dat: any, latin1: any): string | Uint8Array | Uint32Array | Uint16Array;
|
|
73
73
|
export function zip(data: any, opts: any, cb: any): () => void;
|
|
74
74
|
/**
|
|
75
75
|
* Synchronously creates a ZIP file. Prefer using `zip` for better performance
|
|
@@ -15,7 +15,7 @@ export declare class BigInteger {
|
|
|
15
15
|
protected intValue(): number;
|
|
16
16
|
protected byteValue(): number;
|
|
17
17
|
protected shortValue(): number;
|
|
18
|
-
protected signum():
|
|
18
|
+
protected signum(): 1 | 0 | -1;
|
|
19
19
|
toByteArray(): number[];
|
|
20
20
|
protected equals(a: BigInteger): boolean;
|
|
21
21
|
protected min(a: BigInteger): BigInteger;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
1
|
declare const _default: string;
|
|
8
2
|
export declare namespace formatters {
|
|
9
3
|
function RFC1738(value: any): string;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
1
|
import formats = require("./formats.cjs");
|
|
8
2
|
import parse = require("./parse.cjs");
|
|
9
3
|
import stringify = require("./stringify.cjs");
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
1
|
declare function _exports(str: any, opts: any): any;
|
|
8
2
|
export = _exports;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
1
|
declare function _exports(object: any, opts: any): string;
|
|
8
2
|
export = _exports;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
-
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
-
// EDIT THE CORRESPONDENT .ts FILE INSTEAD
|
|
6
|
-
|
|
7
1
|
export function arrayToObject(source: any, options: any): any;
|
|
8
2
|
export function assign(target: any, source: any): any;
|
|
9
3
|
export function combine(a: any, b: any): any[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Abi, FunctionAbi, RawArgs } from '../../../types/index.js';
|
|
2
2
|
import { AbiParserInterface } from './interface.js';
|
|
3
3
|
export declare function createAbiParser(abi: Abi): AbiParserInterface;
|
|
4
|
-
export declare function getAbiVersion(abi: Abi):
|
|
4
|
+
export declare function getAbiVersion(abi: Abi): 1 | 0 | 2;
|
|
5
5
|
export declare function isNoConstructorValid(method: string, argsCalldata: RawArgs, abiMethod?: FunctionAbi): boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Exchange from './base/Exchange.js';
|
|
2
|
+
import { Market, Strings, Ticker, Tickers } from './base/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @class talapp
|
|
5
|
+
* @augments Exchange
|
|
6
|
+
*/
|
|
7
|
+
export default class talapp extends Exchange {
|
|
8
|
+
describe(): any;
|
|
9
|
+
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
10
|
+
parseMarket(response: any): Market;
|
|
11
|
+
fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
|
|
12
|
+
fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
|
|
13
|
+
parseTicker(response: any, market?: Market): Ticker;
|
|
14
|
+
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
15
|
+
url: string;
|
|
16
|
+
method: string;
|
|
17
|
+
body: any;
|
|
18
|
+
headers: any;
|
|
19
|
+
};
|
|
20
|
+
}
|