ccxt-ir 4.9.13 → 4.9.15
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/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +232 -229
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/abantether.js +344 -344
- package/dist/cjs/src/abstract/bitbarg.js +1 -1
- package/dist/cjs/src/abstract/bitunix.js +1 -1
- package/dist/cjs/src/abstract/bydfi.js +1 -1
- package/dist/cjs/src/abstract/cafearz.js +1 -1
- package/dist/cjs/src/abstract/hamtapay.js +1 -1
- package/dist/cjs/src/abstract/kifpoolme.js +1 -1
- package/dist/cjs/src/abstract/mazdax.js +1 -1
- package/dist/cjs/src/abstract/pingi.js +1 -1
- package/dist/cjs/src/abstract/pooleno.js +1 -1
- package/dist/cjs/src/abstract/tehran_exchange.js +11 -0
- package/dist/cjs/src/afratether.js +347 -347
- package/dist/cjs/src/arzplus.js +572 -572
- package/dist/cjs/src/bitbarg.js +303 -303
- package/dist/cjs/src/bitunix.js +317 -317
- package/dist/cjs/src/bydfi.js +425 -425
- package/dist/cjs/src/cafearz.js +337 -337
- package/dist/cjs/src/hamtapay.js +291 -291
- package/dist/cjs/src/kcex.js +326 -326
- package/dist/cjs/src/kifpoolme.js +401 -401
- package/dist/cjs/src/mazdax.js +525 -526
- package/dist/cjs/src/pingi.js +437 -438
- package/dist/cjs/src/pooleno.js +338 -338
- package/dist/cjs/src/tehran_exchange.js +334 -0
- package/dist/cjs/src/tetherland.js +358 -358
- package/dist/cjs/src/twox.js +362 -362
- package/dist/cjs/src/xt.js +5171 -5171
- package/js/ccxt.d.ts +676 -673
- package/js/ccxt.js +493 -491
- package/js/src/abantether.js +347 -347
- package/js/src/abstract/abantether.d.ts +8 -8
- package/js/src/abstract/arzplus.d.ts +11 -11
- package/js/src/abstract/bitbarg.d.ts +8 -8
- package/js/src/abstract/bitbarg.js +5 -5
- package/js/src/abstract/bitunix.d.ts +9 -9
- package/js/src/abstract/bitunix.js +5 -5
- package/js/src/abstract/bydfi.d.ts +11 -11
- package/js/src/abstract/bydfi.js +5 -5
- package/js/src/abstract/cafearz.d.ts +8 -8
- package/js/src/abstract/cafearz.js +5 -5
- package/js/src/abstract/hamtapay.d.ts +9 -9
- package/js/src/abstract/hamtapay.js +5 -5
- package/js/src/abstract/kcex.d.ts +10 -10
- package/js/src/abstract/kifpoolme.d.ts +9 -9
- package/js/src/abstract/kifpoolme.js +5 -5
- package/js/src/abstract/mazdax.d.ts +11 -11
- package/js/src/abstract/mazdax.js +5 -5
- package/js/src/abstract/pingi.d.ts +9 -9
- package/js/src/abstract/pingi.js +5 -5
- package/js/src/abstract/pooleno.d.ts +8 -8
- package/js/src/abstract/pooleno.js +5 -5
- package/js/src/abstract/tehran_exchange.d.ts +9 -0
- package/js/src/abstract/tehran_exchange.js +11 -0
- package/js/src/afratether.js +350 -350
- package/js/src/arzplus.d.ts +26 -26
- package/js/src/arzplus.js +575 -575
- package/js/src/base/Exchange.d.ts +926 -926
- package/js/src/base/types.d.ts +586 -586
- package/js/src/bitbarg.d.ts +21 -21
- package/js/src/bitbarg.js +306 -306
- package/js/src/bitunix.d.ts +21 -21
- package/js/src/bitunix.js +320 -320
- package/js/src/bydfi.d.ts +23 -23
- package/js/src/bydfi.js +428 -428
- package/js/src/cafearz.d.ts +21 -21
- package/js/src/cafearz.js +340 -340
- package/js/src/coinbaseexchange.d.ts +334 -334
- package/js/src/hamtapay.d.ts +21 -21
- package/js/src/hamtapay.js +294 -294
- package/js/src/kcex.d.ts +21 -21
- package/js/src/kcex.js +329 -329
- package/js/src/kifpoolme.d.ts +23 -23
- package/js/src/kifpoolme.js +404 -404
- package/js/src/mazdax.d.ts +23 -23
- package/js/src/mazdax.js +528 -529
- package/js/src/pingi.d.ts +22 -22
- package/js/src/pingi.js +440 -441
- package/js/src/pooleno.d.ts +21 -21
- package/js/src/pooleno.js +341 -341
- package/js/src/protobuf/mexc/compiled.d.cts +2 -2
- package/js/src/static_dependencies/fflake/browser.d.ts +222 -222
- package/js/src/static_dependencies/jsencrypt/lib/asn1js/asn1.d.ts +51 -51
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +101 -101
- package/js/src/static_dependencies/qs/formats.d.cts +8 -8
- package/js/src/static_dependencies/qs/index.d.cts +4 -4
- package/js/src/static_dependencies/qs/parse.d.cts +2 -2
- package/js/src/static_dependencies/qs/stringify.d.cts +2 -2
- package/js/src/static_dependencies/qs/utils.d.cts +9 -9
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +5 -5
- package/js/src/tehran_exchange.d.ts +21 -0
- package/js/src/tehran_exchange.js +333 -0
- package/js/src/tetherland.js +361 -361
- package/js/src/twox.js +365 -365
- package/js/src/xt.js +5178 -5178
- package/package.json +1 -1
|
@@ -5,364 +5,364 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tetherland$1 = require('./abstract/tetherland.js');
|
|
6
6
|
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
/**
|
|
10
|
-
* @class tetherland
|
|
11
|
-
* @augments Exchange
|
|
12
|
-
* @description Set rateLimit to 1000 if fully verified
|
|
13
|
-
*/
|
|
14
|
-
class tetherland extends tetherland$1["default"] {
|
|
15
|
-
describe() {
|
|
16
|
-
return this.deepExtend(super.describe(), {
|
|
17
|
-
'id': 'tetherland',
|
|
18
|
-
'name': 'TetherLand',
|
|
19
|
-
'countries': ['IR'],
|
|
20
|
-
'rateLimit': 1000,
|
|
21
|
-
'version': '1',
|
|
22
|
-
'certified': false,
|
|
23
|
-
'pro': false,
|
|
24
|
-
'has': {
|
|
25
|
-
'CORS': undefined,
|
|
26
|
-
'spot': true,
|
|
27
|
-
'margin': false,
|
|
28
|
-
'swap': false,
|
|
29
|
-
'future': false,
|
|
30
|
-
'option': false,
|
|
31
|
-
'addMargin': false,
|
|
32
|
-
'cancelAllOrders': false,
|
|
33
|
-
'cancelOrder': false,
|
|
34
|
-
'cancelOrders': false,
|
|
35
|
-
'createDepositAddress': false,
|
|
36
|
-
'createOrder': false,
|
|
37
|
-
'createStopLimitOrder': false,
|
|
38
|
-
'createStopMarketOrder': false,
|
|
39
|
-
'createStopOrder': false,
|
|
40
|
-
'editOrder': false,
|
|
41
|
-
'fetchBalance': false,
|
|
42
|
-
'fetchBorrowInterest': false,
|
|
43
|
-
'fetchBorrowRateHistories': false,
|
|
44
|
-
'fetchBorrowRateHistory': false,
|
|
45
|
-
'fetchClosedOrders': false,
|
|
46
|
-
'fetchCrossBorrowRate': false,
|
|
47
|
-
'fetchCrossBorrowRates': false,
|
|
48
|
-
'fetchCurrencies': false,
|
|
49
|
-
'fetchDepositAddress': false,
|
|
50
|
-
'fetchDeposits': false,
|
|
51
|
-
'fetchFundingHistory': false,
|
|
52
|
-
'fetchFundingRate': false,
|
|
53
|
-
'fetchFundingRateHistory': false,
|
|
54
|
-
'fetchFundingRates': false,
|
|
55
|
-
'fetchIndexOHLCV': false,
|
|
56
|
-
'fetchIsolatedBorrowRate': false,
|
|
57
|
-
'fetchIsolatedBorrowRates': false,
|
|
58
|
-
'fetchL2OrderBook': false,
|
|
59
|
-
'fetchL3OrderBook': false,
|
|
60
|
-
'fetchLedger': false,
|
|
61
|
-
'fetchLedgerEntry': false,
|
|
62
|
-
'fetchLeverageTiers': false,
|
|
63
|
-
'fetchMarkets': true,
|
|
64
|
-
'fetchMarkOHLCV': false,
|
|
65
|
-
'fetchMyTrades': false,
|
|
66
|
-
'fetchOHLCV': false,
|
|
67
|
-
'fetchOpenInterestHistory': false,
|
|
68
|
-
'fetchOpenOrders': false,
|
|
69
|
-
'fetchOrder': false,
|
|
70
|
-
'fetchOrderBook': false,
|
|
71
|
-
'fetchOrders': false,
|
|
72
|
-
'fetchOrderTrades': 'emulated',
|
|
73
|
-
'fetchPositions': false,
|
|
74
|
-
'fetchPremiumIndexOHLCV': false,
|
|
75
|
-
'fetchTicker': true,
|
|
76
|
-
'fetchTickers': true,
|
|
77
|
-
'fetchTime': false,
|
|
78
|
-
'fetchTrades': false,
|
|
79
|
-
'fetchTradingFee': false,
|
|
80
|
-
'fetchTradingFees': false,
|
|
81
|
-
'fetchWithdrawals': false,
|
|
82
|
-
'setLeverage': false,
|
|
83
|
-
'setMarginMode': false,
|
|
84
|
-
'transfer': false,
|
|
85
|
-
'withdraw': false,
|
|
86
|
-
},
|
|
87
|
-
'comment': 'This comment is optional',
|
|
88
|
-
'urls': {
|
|
89
|
-
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/tetherland/64x64.png',
|
|
90
|
-
'api': {
|
|
91
|
-
'public': 'https://service.tetherland.com',
|
|
92
|
-
},
|
|
93
|
-
'www': 'https://tetherland.org',
|
|
94
|
-
'doc': [
|
|
95
|
-
'https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api',
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
'api': {
|
|
99
|
-
'public': {
|
|
100
|
-
'get': {
|
|
101
|
-
'api/v5/currencies': 1,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
'fees': {
|
|
106
|
-
'trading': {
|
|
107
|
-
'tierBased': false,
|
|
108
|
-
'percentage': true,
|
|
109
|
-
'maker': this.parseNumber('0.001'),
|
|
110
|
-
'taker': this.parseNumber('0.001'),
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
async fetchMarkets(params = {}) {
|
|
116
|
-
/**
|
|
117
|
-
* @method
|
|
118
|
-
* @name tetherland#fetchMarkets
|
|
119
|
-
* @description retrieves data on all markets for tetherland
|
|
120
|
-
* @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
|
|
121
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
122
|
-
* @returns {object[]} an array of objects representing market data
|
|
123
|
-
*/
|
|
124
|
-
const response = await this.publicGetApiV5Currencies(params);
|
|
125
|
-
const markets = this.safeList(response, 'data');
|
|
126
|
-
const result = [];
|
|
127
|
-
const quotes = ['USDT', 'IRT'];
|
|
128
|
-
for (let i = 0; i < markets.length; i++) {
|
|
129
|
-
for (let key = 0; key < quotes.length; key++) {
|
|
130
|
-
if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
markets[i]['quote'] = quotes[key];
|
|
134
|
-
const market = this.parseMarket(markets[i]);
|
|
135
|
-
result.push(market);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
parseMarket(market) {
|
|
141
|
-
// {
|
|
142
|
-
// 'name': 'Bitcoin',
|
|
143
|
-
// 'fa_name': 'بیت کوین',
|
|
144
|
-
// 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
|
|
145
|
-
// 'accent_color': '#ff8d00',
|
|
146
|
-
// 'symbol': 'BTC',
|
|
147
|
-
// 'price': '69,497.50',
|
|
148
|
-
// 'toman_amount': 4117726875,
|
|
149
|
-
// 'min_usdt_value': null,
|
|
150
|
-
// 'min_usdt_amount': 15,
|
|
151
|
-
// 'max_usdt_amount': 10000,
|
|
152
|
-
// 'min_value': null,
|
|
153
|
-
// 'max_amount': '0.200000000000',
|
|
154
|
-
// 'min_irr_amount': 883500,
|
|
155
|
-
// 'max_irr_amount': 589000000,
|
|
156
|
-
// 'priority': 1,
|
|
157
|
-
// 'price_round_digit': 2,
|
|
158
|
-
// 'amount_round_digit': 6,
|
|
159
|
-
// 'changes_24h': -2.68,
|
|
160
|
-
// 'changes_7d': 7.522256527082521,
|
|
161
|
-
// 'trendy': 0,
|
|
162
|
-
// 'exchange': null,
|
|
163
|
-
// 'categories': [ ],
|
|
164
|
-
// 'createdAt': null,
|
|
165
|
-
// 'has_staking': true,
|
|
166
|
-
// 'staking_plan': {
|
|
167
|
-
// 'id': 38,
|
|
168
|
-
// 'coin_id': 1,
|
|
169
|
-
// 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
|
|
170
|
-
// 'capacity': '5.00000',
|
|
171
|
-
// 'minimum_staking_amount': '0.00150',
|
|
172
|
-
// 'maximum_staking_amount': '1.00000',
|
|
173
|
-
// 'total_staked': '5.00000',
|
|
174
|
-
// 'largest_benefit': 1.5,
|
|
175
|
-
// 'trendy': 0,
|
|
176
|
-
// 'status': 'COMPLETED',
|
|
177
|
-
// 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگهداری آن از طریق دیفای استیکینگ تامین میشود.',
|
|
178
|
-
// 'created_at': '2023-07-15T13:01:25.000000Z',
|
|
179
|
-
// 'updated_at': '2024-06-01T14:56:40.000000Z',
|
|
180
|
-
// 'deleted_at': null,
|
|
181
|
-
// 'priority': 18,
|
|
182
|
-
// },
|
|
183
|
-
// }
|
|
184
|
-
let [baseId, quoteId] = [this.safeString(market, 'symbol'), this.safeString(market, 'quote')];
|
|
185
|
-
const base = this.safeCurrencyCode(baseId);
|
|
186
|
-
const quote = this.safeCurrencyCode(quoteId);
|
|
187
|
-
const id = base + '/' + quote;
|
|
188
|
-
baseId = baseId.toLowerCase();
|
|
189
|
-
quoteId = quoteId.toLowerCase();
|
|
190
|
-
return {
|
|
191
|
-
'id': id,
|
|
192
|
-
'symbol': base + '/' + quote,
|
|
193
|
-
'base': base,
|
|
194
|
-
'quote': quote,
|
|
195
|
-
'settle': undefined,
|
|
196
|
-
'baseId': baseId,
|
|
197
|
-
'quoteId': quoteId,
|
|
198
|
-
'settleId': undefined,
|
|
199
|
-
'type': 'spot',
|
|
200
|
-
'spot': true,
|
|
201
|
-
'margin': false,
|
|
202
|
-
'swap': false,
|
|
203
|
-
'future': false,
|
|
204
|
-
'option': false,
|
|
205
|
-
'active': true,
|
|
206
|
-
'contract': false,
|
|
207
|
-
'linear': undefined,
|
|
208
|
-
'inverse': undefined,
|
|
209
|
-
'contractSize': undefined,
|
|
210
|
-
'expiry': undefined,
|
|
211
|
-
'expiryDatetime': undefined,
|
|
212
|
-
'strike': undefined,
|
|
213
|
-
'optionType': undefined,
|
|
214
|
-
'precision': {
|
|
215
|
-
'amount': undefined,
|
|
216
|
-
'price': undefined,
|
|
217
|
-
},
|
|
218
|
-
'limits': {
|
|
219
|
-
'leverage': {
|
|
220
|
-
'min': undefined,
|
|
221
|
-
'max': undefined,
|
|
222
|
-
},
|
|
223
|
-
'amount': {
|
|
224
|
-
'min': undefined,
|
|
225
|
-
'max': undefined,
|
|
226
|
-
},
|
|
227
|
-
'price': {
|
|
228
|
-
'min': undefined,
|
|
229
|
-
'max': undefined,
|
|
230
|
-
},
|
|
231
|
-
'cost': {
|
|
232
|
-
'min': undefined,
|
|
233
|
-
'max': undefined,
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
'created': undefined,
|
|
237
|
-
'info': market,
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
async fetchTickers(symbols = undefined, params = {}) {
|
|
241
|
-
/**
|
|
242
|
-
* @method
|
|
243
|
-
* @name tetherland#fetchTickers
|
|
244
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
245
|
-
* @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
|
|
246
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
247
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
248
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
249
|
-
*/
|
|
250
|
-
await this.loadMarkets();
|
|
251
|
-
if (symbols !== undefined) {
|
|
252
|
-
symbols = this.marketSymbols(symbols);
|
|
253
|
-
}
|
|
254
|
-
const response = await this.publicGetApiV5Currencies(params);
|
|
255
|
-
const markets = this.safeList(response, 'data');
|
|
256
|
-
const result = {};
|
|
257
|
-
const quotes = ['USDT', 'IRT'];
|
|
258
|
-
for (let i = 0; i < markets.length; i++) {
|
|
259
|
-
for (let key = 0; key < quotes.length; key++) {
|
|
260
|
-
if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
markets[i]['quote'] = quotes[key];
|
|
264
|
-
markets[i]['id'] = markets[i]['symbol'] + '/' + markets[i]['quote'];
|
|
265
|
-
const market = this.parseTicker(markets[i]);
|
|
266
|
-
const symbol = market['symbol'];
|
|
267
|
-
result[symbol] = market;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
271
|
-
}
|
|
272
|
-
async fetchTicker(symbol, params = {}) {
|
|
273
|
-
/**
|
|
274
|
-
* @method
|
|
275
|
-
* @name tetherland#fetchTicker
|
|
276
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
277
|
-
* @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
|
|
278
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
279
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
280
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
281
|
-
*/
|
|
282
|
-
const ticker = await this.fetchTickers([symbol]);
|
|
283
|
-
return ticker[symbol];
|
|
284
|
-
}
|
|
285
|
-
parseTicker(ticker, market = undefined) {
|
|
286
|
-
// {
|
|
287
|
-
// 'name': 'Bitcoin',
|
|
288
|
-
// 'fa_name': 'بیت کوین',
|
|
289
|
-
// 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
|
|
290
|
-
// 'accent_color': '#ff8d00',
|
|
291
|
-
// 'symbol': 'BTC',
|
|
292
|
-
// 'price': '69,497.50',
|
|
293
|
-
// 'toman_amount': 4117726875,
|
|
294
|
-
// 'min_usdt_value': null,
|
|
295
|
-
// 'min_usdt_amount': 15,
|
|
296
|
-
// 'max_usdt_amount': 10000,
|
|
297
|
-
// 'min_value': null,
|
|
298
|
-
// 'max_amount': '0.200000000000',
|
|
299
|
-
// 'min_irr_amount': 883500,
|
|
300
|
-
// 'max_irr_amount': 589000000,
|
|
301
|
-
// 'priority': 1,
|
|
302
|
-
// 'price_round_digit': 2,
|
|
303
|
-
// 'amount_round_digit': 6,
|
|
304
|
-
// 'changes_24h': -2.68,
|
|
305
|
-
// 'changes_7d': 7.522256527082521,
|
|
306
|
-
// 'trendy': 0,
|
|
307
|
-
// 'exchange': null,
|
|
308
|
-
// 'categories': [ ],
|
|
309
|
-
// 'createdAt': null,
|
|
310
|
-
// 'has_staking': true,
|
|
311
|
-
// 'staking_plan': {
|
|
312
|
-
// 'id': 38,
|
|
313
|
-
// 'coin_id': 1,
|
|
314
|
-
// 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
|
|
315
|
-
// 'capacity': '5.00000',
|
|
316
|
-
// 'minimum_staking_amount': '0.00150',
|
|
317
|
-
// 'maximum_staking_amount': '1.00000',
|
|
318
|
-
// 'total_staked': '5.00000',
|
|
319
|
-
// 'largest_benefit': 1.5,
|
|
320
|
-
// 'trendy': 0,
|
|
321
|
-
// 'status': 'COMPLETED',
|
|
322
|
-
// 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگهداری آن از طریق دیفای استیکینگ تامین میشود.',
|
|
323
|
-
// 'created_at': '2023-07-15T13:01:25.000000Z',
|
|
324
|
-
// 'updated_at': '2024-06-01T14:56:40.000000Z',
|
|
325
|
-
// 'deleted_at': null,
|
|
326
|
-
// 'priority': 18,
|
|
327
|
-
// },
|
|
328
|
-
// }
|
|
329
|
-
const marketType = 'spot';
|
|
330
|
-
const marketId = this.safeString(ticker, 'id');
|
|
331
|
-
const quote = this.safeString(ticker, 'quote');
|
|
332
|
-
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
333
|
-
let last = parseFloat(this.safeString(ticker, 'price', '').replace(',', ''));
|
|
334
|
-
if (quote === 'IRT') {
|
|
335
|
-
last = this.safeFloat(ticker, 'toman_amount', 0);
|
|
336
|
-
}
|
|
337
|
-
const change = this.safeFloat(ticker, 'changes_24h', 0);
|
|
338
|
-
return this.safeTicker({
|
|
339
|
-
'symbol': symbol,
|
|
340
|
-
'timestamp': undefined,
|
|
341
|
-
'datetime': undefined,
|
|
342
|
-
'high': undefined,
|
|
343
|
-
'low': undefined,
|
|
344
|
-
'bid': undefined,
|
|
345
|
-
'bidVolume': undefined,
|
|
346
|
-
'ask': undefined,
|
|
347
|
-
'askVolume': undefined,
|
|
348
|
-
'vwap': undefined,
|
|
349
|
-
'open': undefined,
|
|
350
|
-
'close': last,
|
|
351
|
-
'last': last,
|
|
352
|
-
'previousClose': undefined,
|
|
353
|
-
'change': change,
|
|
354
|
-
'percentage': undefined,
|
|
355
|
-
'average': undefined,
|
|
356
|
-
'baseVolume': undefined,
|
|
357
|
-
'quoteVolume': undefined,
|
|
358
|
-
'info': ticker,
|
|
359
|
-
}, market);
|
|
360
|
-
}
|
|
361
|
-
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
362
|
-
const url = this.urls['api']['public'] + '/' + path;
|
|
363
|
-
headers = { 'Content-Type': 'application/json' };
|
|
364
|
-
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
365
|
-
}
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* @class tetherland
|
|
11
|
+
* @augments Exchange
|
|
12
|
+
* @description Set rateLimit to 1000 if fully verified
|
|
13
|
+
*/
|
|
14
|
+
class tetherland extends tetherland$1["default"] {
|
|
15
|
+
describe() {
|
|
16
|
+
return this.deepExtend(super.describe(), {
|
|
17
|
+
'id': 'tetherland',
|
|
18
|
+
'name': 'TetherLand',
|
|
19
|
+
'countries': ['IR'],
|
|
20
|
+
'rateLimit': 1000,
|
|
21
|
+
'version': '1',
|
|
22
|
+
'certified': false,
|
|
23
|
+
'pro': false,
|
|
24
|
+
'has': {
|
|
25
|
+
'CORS': undefined,
|
|
26
|
+
'spot': true,
|
|
27
|
+
'margin': false,
|
|
28
|
+
'swap': false,
|
|
29
|
+
'future': false,
|
|
30
|
+
'option': false,
|
|
31
|
+
'addMargin': false,
|
|
32
|
+
'cancelAllOrders': false,
|
|
33
|
+
'cancelOrder': false,
|
|
34
|
+
'cancelOrders': false,
|
|
35
|
+
'createDepositAddress': false,
|
|
36
|
+
'createOrder': false,
|
|
37
|
+
'createStopLimitOrder': false,
|
|
38
|
+
'createStopMarketOrder': false,
|
|
39
|
+
'createStopOrder': false,
|
|
40
|
+
'editOrder': false,
|
|
41
|
+
'fetchBalance': false,
|
|
42
|
+
'fetchBorrowInterest': false,
|
|
43
|
+
'fetchBorrowRateHistories': false,
|
|
44
|
+
'fetchBorrowRateHistory': false,
|
|
45
|
+
'fetchClosedOrders': false,
|
|
46
|
+
'fetchCrossBorrowRate': false,
|
|
47
|
+
'fetchCrossBorrowRates': false,
|
|
48
|
+
'fetchCurrencies': false,
|
|
49
|
+
'fetchDepositAddress': false,
|
|
50
|
+
'fetchDeposits': false,
|
|
51
|
+
'fetchFundingHistory': false,
|
|
52
|
+
'fetchFundingRate': false,
|
|
53
|
+
'fetchFundingRateHistory': false,
|
|
54
|
+
'fetchFundingRates': false,
|
|
55
|
+
'fetchIndexOHLCV': false,
|
|
56
|
+
'fetchIsolatedBorrowRate': false,
|
|
57
|
+
'fetchIsolatedBorrowRates': false,
|
|
58
|
+
'fetchL2OrderBook': false,
|
|
59
|
+
'fetchL3OrderBook': false,
|
|
60
|
+
'fetchLedger': false,
|
|
61
|
+
'fetchLedgerEntry': false,
|
|
62
|
+
'fetchLeverageTiers': false,
|
|
63
|
+
'fetchMarkets': true,
|
|
64
|
+
'fetchMarkOHLCV': false,
|
|
65
|
+
'fetchMyTrades': false,
|
|
66
|
+
'fetchOHLCV': false,
|
|
67
|
+
'fetchOpenInterestHistory': false,
|
|
68
|
+
'fetchOpenOrders': false,
|
|
69
|
+
'fetchOrder': false,
|
|
70
|
+
'fetchOrderBook': false,
|
|
71
|
+
'fetchOrders': false,
|
|
72
|
+
'fetchOrderTrades': 'emulated',
|
|
73
|
+
'fetchPositions': false,
|
|
74
|
+
'fetchPremiumIndexOHLCV': false,
|
|
75
|
+
'fetchTicker': true,
|
|
76
|
+
'fetchTickers': true,
|
|
77
|
+
'fetchTime': false,
|
|
78
|
+
'fetchTrades': false,
|
|
79
|
+
'fetchTradingFee': false,
|
|
80
|
+
'fetchTradingFees': false,
|
|
81
|
+
'fetchWithdrawals': false,
|
|
82
|
+
'setLeverage': false,
|
|
83
|
+
'setMarginMode': false,
|
|
84
|
+
'transfer': false,
|
|
85
|
+
'withdraw': false,
|
|
86
|
+
},
|
|
87
|
+
'comment': 'This comment is optional',
|
|
88
|
+
'urls': {
|
|
89
|
+
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/tetherland/64x64.png',
|
|
90
|
+
'api': {
|
|
91
|
+
'public': 'https://service.tetherland.com',
|
|
92
|
+
},
|
|
93
|
+
'www': 'https://tetherland.org',
|
|
94
|
+
'doc': [
|
|
95
|
+
'https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api',
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
'api': {
|
|
99
|
+
'public': {
|
|
100
|
+
'get': {
|
|
101
|
+
'api/v5/currencies': 1,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
'fees': {
|
|
106
|
+
'trading': {
|
|
107
|
+
'tierBased': false,
|
|
108
|
+
'percentage': true,
|
|
109
|
+
'maker': this.parseNumber('0.001'),
|
|
110
|
+
'taker': this.parseNumber('0.001'),
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async fetchMarkets(params = {}) {
|
|
116
|
+
/**
|
|
117
|
+
* @method
|
|
118
|
+
* @name tetherland#fetchMarkets
|
|
119
|
+
* @description retrieves data on all markets for tetherland
|
|
120
|
+
* @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
|
|
121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
122
|
+
* @returns {object[]} an array of objects representing market data
|
|
123
|
+
*/
|
|
124
|
+
const response = await this.publicGetApiV5Currencies(params);
|
|
125
|
+
const markets = this.safeList(response, 'data');
|
|
126
|
+
const result = [];
|
|
127
|
+
const quotes = ['USDT', 'IRT'];
|
|
128
|
+
for (let i = 0; i < markets.length; i++) {
|
|
129
|
+
for (let key = 0; key < quotes.length; key++) {
|
|
130
|
+
if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
markets[i]['quote'] = quotes[key];
|
|
134
|
+
const market = this.parseMarket(markets[i]);
|
|
135
|
+
result.push(market);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
parseMarket(market) {
|
|
141
|
+
// {
|
|
142
|
+
// 'name': 'Bitcoin',
|
|
143
|
+
// 'fa_name': 'بیت کوین',
|
|
144
|
+
// 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
|
|
145
|
+
// 'accent_color': '#ff8d00',
|
|
146
|
+
// 'symbol': 'BTC',
|
|
147
|
+
// 'price': '69,497.50',
|
|
148
|
+
// 'toman_amount': 4117726875,
|
|
149
|
+
// 'min_usdt_value': null,
|
|
150
|
+
// 'min_usdt_amount': 15,
|
|
151
|
+
// 'max_usdt_amount': 10000,
|
|
152
|
+
// 'min_value': null,
|
|
153
|
+
// 'max_amount': '0.200000000000',
|
|
154
|
+
// 'min_irr_amount': 883500,
|
|
155
|
+
// 'max_irr_amount': 589000000,
|
|
156
|
+
// 'priority': 1,
|
|
157
|
+
// 'price_round_digit': 2,
|
|
158
|
+
// 'amount_round_digit': 6,
|
|
159
|
+
// 'changes_24h': -2.68,
|
|
160
|
+
// 'changes_7d': 7.522256527082521,
|
|
161
|
+
// 'trendy': 0,
|
|
162
|
+
// 'exchange': null,
|
|
163
|
+
// 'categories': [ ],
|
|
164
|
+
// 'createdAt': null,
|
|
165
|
+
// 'has_staking': true,
|
|
166
|
+
// 'staking_plan': {
|
|
167
|
+
// 'id': 38,
|
|
168
|
+
// 'coin_id': 1,
|
|
169
|
+
// 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
|
|
170
|
+
// 'capacity': '5.00000',
|
|
171
|
+
// 'minimum_staking_amount': '0.00150',
|
|
172
|
+
// 'maximum_staking_amount': '1.00000',
|
|
173
|
+
// 'total_staked': '5.00000',
|
|
174
|
+
// 'largest_benefit': 1.5,
|
|
175
|
+
// 'trendy': 0,
|
|
176
|
+
// 'status': 'COMPLETED',
|
|
177
|
+
// 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگهداری آن از طریق دیفای استیکینگ تامین میشود.',
|
|
178
|
+
// 'created_at': '2023-07-15T13:01:25.000000Z',
|
|
179
|
+
// 'updated_at': '2024-06-01T14:56:40.000000Z',
|
|
180
|
+
// 'deleted_at': null,
|
|
181
|
+
// 'priority': 18,
|
|
182
|
+
// },
|
|
183
|
+
// }
|
|
184
|
+
let [baseId, quoteId] = [this.safeString(market, 'symbol'), this.safeString(market, 'quote')];
|
|
185
|
+
const base = this.safeCurrencyCode(baseId);
|
|
186
|
+
const quote = this.safeCurrencyCode(quoteId);
|
|
187
|
+
const id = base + '/' + quote;
|
|
188
|
+
baseId = baseId.toLowerCase();
|
|
189
|
+
quoteId = quoteId.toLowerCase();
|
|
190
|
+
return {
|
|
191
|
+
'id': id,
|
|
192
|
+
'symbol': base + '/' + quote,
|
|
193
|
+
'base': base,
|
|
194
|
+
'quote': quote,
|
|
195
|
+
'settle': undefined,
|
|
196
|
+
'baseId': baseId,
|
|
197
|
+
'quoteId': quoteId,
|
|
198
|
+
'settleId': undefined,
|
|
199
|
+
'type': 'spot',
|
|
200
|
+
'spot': true,
|
|
201
|
+
'margin': false,
|
|
202
|
+
'swap': false,
|
|
203
|
+
'future': false,
|
|
204
|
+
'option': false,
|
|
205
|
+
'active': true,
|
|
206
|
+
'contract': false,
|
|
207
|
+
'linear': undefined,
|
|
208
|
+
'inverse': undefined,
|
|
209
|
+
'contractSize': undefined,
|
|
210
|
+
'expiry': undefined,
|
|
211
|
+
'expiryDatetime': undefined,
|
|
212
|
+
'strike': undefined,
|
|
213
|
+
'optionType': undefined,
|
|
214
|
+
'precision': {
|
|
215
|
+
'amount': undefined,
|
|
216
|
+
'price': undefined,
|
|
217
|
+
},
|
|
218
|
+
'limits': {
|
|
219
|
+
'leverage': {
|
|
220
|
+
'min': undefined,
|
|
221
|
+
'max': undefined,
|
|
222
|
+
},
|
|
223
|
+
'amount': {
|
|
224
|
+
'min': undefined,
|
|
225
|
+
'max': undefined,
|
|
226
|
+
},
|
|
227
|
+
'price': {
|
|
228
|
+
'min': undefined,
|
|
229
|
+
'max': undefined,
|
|
230
|
+
},
|
|
231
|
+
'cost': {
|
|
232
|
+
'min': undefined,
|
|
233
|
+
'max': undefined,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
'created': undefined,
|
|
237
|
+
'info': market,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
async fetchTickers(symbols = undefined, params = {}) {
|
|
241
|
+
/**
|
|
242
|
+
* @method
|
|
243
|
+
* @name tetherland#fetchTickers
|
|
244
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
245
|
+
* @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
|
|
246
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
247
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
248
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
249
|
+
*/
|
|
250
|
+
await this.loadMarkets();
|
|
251
|
+
if (symbols !== undefined) {
|
|
252
|
+
symbols = this.marketSymbols(symbols);
|
|
253
|
+
}
|
|
254
|
+
const response = await this.publicGetApiV5Currencies(params);
|
|
255
|
+
const markets = this.safeList(response, 'data');
|
|
256
|
+
const result = {};
|
|
257
|
+
const quotes = ['USDT', 'IRT'];
|
|
258
|
+
for (let i = 0; i < markets.length; i++) {
|
|
259
|
+
for (let key = 0; key < quotes.length; key++) {
|
|
260
|
+
if (markets[i]['symbol'] === 'USDT' && quotes[key] === 'USDT') {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
markets[i]['quote'] = quotes[key];
|
|
264
|
+
markets[i]['id'] = markets[i]['symbol'] + '/' + markets[i]['quote'];
|
|
265
|
+
const market = this.parseTicker(markets[i]);
|
|
266
|
+
const symbol = market['symbol'];
|
|
267
|
+
result[symbol] = market;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
271
|
+
}
|
|
272
|
+
async fetchTicker(symbol, params = {}) {
|
|
273
|
+
/**
|
|
274
|
+
* @method
|
|
275
|
+
* @name tetherland#fetchTicker
|
|
276
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
277
|
+
* @see https://docs.tetherland.com/docs/tetherland/71ca11f41704f-user-api
|
|
278
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
279
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
280
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
281
|
+
*/
|
|
282
|
+
const ticker = await this.fetchTickers([symbol]);
|
|
283
|
+
return ticker[symbol];
|
|
284
|
+
}
|
|
285
|
+
parseTicker(ticker, market = undefined) {
|
|
286
|
+
// {
|
|
287
|
+
// 'name': 'Bitcoin',
|
|
288
|
+
// 'fa_name': 'بیت کوین',
|
|
289
|
+
// 'logo': '/uploads/images/2022/8/masc3iMjEPBTC.svg',
|
|
290
|
+
// 'accent_color': '#ff8d00',
|
|
291
|
+
// 'symbol': 'BTC',
|
|
292
|
+
// 'price': '69,497.50',
|
|
293
|
+
// 'toman_amount': 4117726875,
|
|
294
|
+
// 'min_usdt_value': null,
|
|
295
|
+
// 'min_usdt_amount': 15,
|
|
296
|
+
// 'max_usdt_amount': 10000,
|
|
297
|
+
// 'min_value': null,
|
|
298
|
+
// 'max_amount': '0.200000000000',
|
|
299
|
+
// 'min_irr_amount': 883500,
|
|
300
|
+
// 'max_irr_amount': 589000000,
|
|
301
|
+
// 'priority': 1,
|
|
302
|
+
// 'price_round_digit': 2,
|
|
303
|
+
// 'amount_round_digit': 6,
|
|
304
|
+
// 'changes_24h': -2.68,
|
|
305
|
+
// 'changes_7d': 7.522256527082521,
|
|
306
|
+
// 'trendy': 0,
|
|
307
|
+
// 'exchange': null,
|
|
308
|
+
// 'categories': [ ],
|
|
309
|
+
// 'createdAt': null,
|
|
310
|
+
// 'has_staking': true,
|
|
311
|
+
// 'staking_plan': {
|
|
312
|
+
// 'id': 38,
|
|
313
|
+
// 'coin_id': 1,
|
|
314
|
+
// 'periods': { '30': '1.2', '60': '1.5', 'flex': '1' },
|
|
315
|
+
// 'capacity': '5.00000',
|
|
316
|
+
// 'minimum_staking_amount': '0.00150',
|
|
317
|
+
// 'maximum_staking_amount': '1.00000',
|
|
318
|
+
// 'total_staked': '5.00000',
|
|
319
|
+
// 'largest_benefit': 1.5,
|
|
320
|
+
// 'trendy': 0,
|
|
321
|
+
// 'status': 'COMPLETED',
|
|
322
|
+
// 'info': 'رمزارز مورد نظر PoS نیست و پاداش حاصل از نگهداری آن از طریق دیفای استیکینگ تامین میشود.',
|
|
323
|
+
// 'created_at': '2023-07-15T13:01:25.000000Z',
|
|
324
|
+
// 'updated_at': '2024-06-01T14:56:40.000000Z',
|
|
325
|
+
// 'deleted_at': null,
|
|
326
|
+
// 'priority': 18,
|
|
327
|
+
// },
|
|
328
|
+
// }
|
|
329
|
+
const marketType = 'spot';
|
|
330
|
+
const marketId = this.safeString(ticker, 'id');
|
|
331
|
+
const quote = this.safeString(ticker, 'quote');
|
|
332
|
+
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
|
|
333
|
+
let last = parseFloat(this.safeString(ticker, 'price', '').replace(',', ''));
|
|
334
|
+
if (quote === 'IRT') {
|
|
335
|
+
last = this.safeFloat(ticker, 'toman_amount', 0);
|
|
336
|
+
}
|
|
337
|
+
const change = this.safeFloat(ticker, 'changes_24h', 0);
|
|
338
|
+
return this.safeTicker({
|
|
339
|
+
'symbol': symbol,
|
|
340
|
+
'timestamp': undefined,
|
|
341
|
+
'datetime': undefined,
|
|
342
|
+
'high': undefined,
|
|
343
|
+
'low': undefined,
|
|
344
|
+
'bid': undefined,
|
|
345
|
+
'bidVolume': undefined,
|
|
346
|
+
'ask': undefined,
|
|
347
|
+
'askVolume': undefined,
|
|
348
|
+
'vwap': undefined,
|
|
349
|
+
'open': undefined,
|
|
350
|
+
'close': last,
|
|
351
|
+
'last': last,
|
|
352
|
+
'previousClose': undefined,
|
|
353
|
+
'change': change,
|
|
354
|
+
'percentage': undefined,
|
|
355
|
+
'average': undefined,
|
|
356
|
+
'baseVolume': undefined,
|
|
357
|
+
'quoteVolume': undefined,
|
|
358
|
+
'info': ticker,
|
|
359
|
+
}, market);
|
|
360
|
+
}
|
|
361
|
+
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
362
|
+
const url = this.urls['api']['public'] + '/' + path;
|
|
363
|
+
headers = { 'Content-Type': 'application/json' };
|
|
364
|
+
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
365
|
+
}
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
exports["default"] = tetherland;
|