ccxt-ir 4.9.4__py2.py3-none-any.whl → 4.9.11__py2.py3-none-any.whl
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.
- ccxt/__init__.py +15 -1
- ccxt/abantether.py +88 -69
- ccxt/abstract/abantether.py +1 -1
- ccxt/abstract/bitbarg.py +5 -0
- ccxt/abstract/bydfi.py +8 -0
- ccxt/abstract/cafearz.py +5 -0
- ccxt/abstract/kifpoolme.py +6 -0
- ccxt/abstract/mazdax.py +8 -0
- ccxt/abstract/pingi.py +6 -0
- ccxt/abstract/pooleno.py +5 -0
- ccxt/afratether.py +84 -36
- ccxt/arzplus.py +31 -17
- ccxt/async_support/__init__.py +15 -1
- ccxt/async_support/abantether.py +88 -69
- ccxt/async_support/afratether.py +84 -36
- ccxt/async_support/arzplus.py +31 -17
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bitbarg.py +298 -0
- ccxt/async_support/bydfi.py +406 -0
- ccxt/async_support/cafearz.py +333 -0
- ccxt/async_support/hamtapay.py +3 -2
- ccxt/async_support/kifpoolme.py +385 -0
- ccxt/async_support/mazdax.py +512 -0
- ccxt/async_support/pingi.py +426 -0
- ccxt/async_support/pooleno.py +331 -0
- ccxt/async_support/tetherland.py +4 -4
- ccxt/async_support/twox.py +53 -29
- ccxt/base/exchange.py +1 -1
- ccxt/bitbarg.py +298 -0
- ccxt/bydfi.py +406 -0
- ccxt/cafearz.py +333 -0
- ccxt/hamtapay.py +3 -2
- ccxt/kifpoolme.py +385 -0
- ccxt/mazdax.py +512 -0
- ccxt/pingi.py +426 -0
- ccxt/pooleno.py +331 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/tetherland.py +4 -4
- ccxt/twox.py +53 -29
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.11.dist-info}/METADATA +8 -8
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.11.dist-info}/RECORD +44 -23
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.11.dist-info}/WHEEL +0 -0
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.11.dist-info}/licenses/LICENSE.txt +0 -0
- {ccxt_ir-4.9.4.dist-info → ccxt_ir-4.9.11.dist-info}/top_level.txt +0 -0
ccxt/pooleno.py
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
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
|
+
|
|
6
|
+
from ccxt.base.exchange import Exchange
|
|
7
|
+
from ccxt.abstract.pooleno import ImplicitAPI
|
|
8
|
+
from ccxt.base.types import Any, Market, Strings, Ticker, Tickers
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class pooleno(Exchange, ImplicitAPI):
|
|
13
|
+
|
|
14
|
+
def describe(self) -> Any:
|
|
15
|
+
return self.deep_extend(super(pooleno, self).describe(), {
|
|
16
|
+
'id': 'pooleno',
|
|
17
|
+
'name': 'Pooleno',
|
|
18
|
+
'countries': ['IR'],
|
|
19
|
+
'rateLimit': 1000,
|
|
20
|
+
'version': '1',
|
|
21
|
+
'certified': False,
|
|
22
|
+
'pro': False,
|
|
23
|
+
'has': {
|
|
24
|
+
'CORS': None,
|
|
25
|
+
'spot': True,
|
|
26
|
+
'margin': False,
|
|
27
|
+
'swap': False,
|
|
28
|
+
'future': False,
|
|
29
|
+
'option': False,
|
|
30
|
+
'addMargin': False,
|
|
31
|
+
'cancelAllOrders': False,
|
|
32
|
+
'cancelOrder': False,
|
|
33
|
+
'cancelOrders': False,
|
|
34
|
+
'createDepositAddress': False,
|
|
35
|
+
'createOrder': False,
|
|
36
|
+
'createStopLimitOrder': False,
|
|
37
|
+
'createStopMarketOrder': False,
|
|
38
|
+
'createStopOrder': False,
|
|
39
|
+
'editOrder': False,
|
|
40
|
+
'fetchBalance': False,
|
|
41
|
+
'fetchBorrowInterest': False,
|
|
42
|
+
'fetchBorrowRateHistories': False,
|
|
43
|
+
'fetchBorrowRateHistory': False,
|
|
44
|
+
'fetchClosedOrders': False,
|
|
45
|
+
'fetchCrossBorrowRate': False,
|
|
46
|
+
'fetchCrossBorrowRates': False,
|
|
47
|
+
'fetchCurrencies': False,
|
|
48
|
+
'fetchDepositAddress': False,
|
|
49
|
+
'fetchDeposits': False,
|
|
50
|
+
'fetchFundingHistory': False,
|
|
51
|
+
'fetchFundingRate': False,
|
|
52
|
+
'fetchFundingRateHistory': False,
|
|
53
|
+
'fetchFundingRates': False,
|
|
54
|
+
'fetchIndexOHLCV': False,
|
|
55
|
+
'fetchIsolatedBorrowRate': False,
|
|
56
|
+
'fetchIsolatedBorrowRates': False,
|
|
57
|
+
'fetchL2OrderBook': False,
|
|
58
|
+
'fetchL3OrderBook': False,
|
|
59
|
+
'fetchLedger': False,
|
|
60
|
+
'fetchLedgerEntry': False,
|
|
61
|
+
'fetchLeverageTiers': False,
|
|
62
|
+
'fetchMarkets': True,
|
|
63
|
+
'fetchMarkOHLCV': False,
|
|
64
|
+
'fetchMyTrades': False,
|
|
65
|
+
'fetchOHLCV': False,
|
|
66
|
+
'fetchOpenInterestHistory': False,
|
|
67
|
+
'fetchOpenOrders': False,
|
|
68
|
+
'fetchOrder': False,
|
|
69
|
+
'fetchOrderBook': False,
|
|
70
|
+
'fetchOrders': False,
|
|
71
|
+
'fetchOrderTrades': 'emulated',
|
|
72
|
+
'fetchPositions': False,
|
|
73
|
+
'fetchPremiumIndexOHLCV': False,
|
|
74
|
+
'fetchTicker': True,
|
|
75
|
+
'fetchTickers': True,
|
|
76
|
+
'fetchTime': False,
|
|
77
|
+
'fetchTrades': False,
|
|
78
|
+
'fetchTradingFee': False,
|
|
79
|
+
'fetchTradingFees': False,
|
|
80
|
+
'fetchWithdrawals': False,
|
|
81
|
+
'setLeverage': False,
|
|
82
|
+
'setMarginMode': False,
|
|
83
|
+
'transfer': False,
|
|
84
|
+
'withdraw': False,
|
|
85
|
+
},
|
|
86
|
+
'comment': 'This comment is optional',
|
|
87
|
+
'urls': {
|
|
88
|
+
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/pooleno/64x64.png',
|
|
89
|
+
'api': {
|
|
90
|
+
'public': 'https://api-beta.pooleno.ir',
|
|
91
|
+
},
|
|
92
|
+
'www': 'https://pooleno.ir',
|
|
93
|
+
'doc': [
|
|
94
|
+
'https://pooleno.ir',
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
'api': {
|
|
98
|
+
'public': {
|
|
99
|
+
'get': {
|
|
100
|
+
'api/v1/tokens/public': 1,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
'fees': {
|
|
105
|
+
'trading': {
|
|
106
|
+
'tierBased': False,
|
|
107
|
+
'percentage': True,
|
|
108
|
+
'maker': self.parse_number('0.001'),
|
|
109
|
+
'taker': self.parse_number('0.001'),
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
|
115
|
+
"""
|
|
116
|
+
retrieves data on all markets for pooleno
|
|
117
|
+
https://api-beta.pooleno.ir/api/v1/tokens/public
|
|
118
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
119
|
+
:returns dict[]: an array of objects representing market data
|
|
120
|
+
"""
|
|
121
|
+
response = self.publicGetApiV1TokensPublic(params)
|
|
122
|
+
payload = self.safe_list(response, 'payload', [])
|
|
123
|
+
result = []
|
|
124
|
+
for i in range(0, len(payload)):
|
|
125
|
+
token = payload[i]
|
|
126
|
+
baseAsset = self.safe_string(token, 'baseAsset')
|
|
127
|
+
quoteAsset = self.safe_string(token, 'quoteAsset')
|
|
128
|
+
# Skip if base equals quote
|
|
129
|
+
if baseAsset == quoteAsset:
|
|
130
|
+
continue
|
|
131
|
+
market = self.parse_market(token)
|
|
132
|
+
result.append(market)
|
|
133
|
+
return result
|
|
134
|
+
|
|
135
|
+
def parse_market(self, market) -> Market:
|
|
136
|
+
# {
|
|
137
|
+
# "baseAsset": "USDT",
|
|
138
|
+
# "quoteAsset": "TMN",
|
|
139
|
+
# "symbolName": "USDT",
|
|
140
|
+
# "longEnName": "Tether",
|
|
141
|
+
# "longFaName": "تتر",
|
|
142
|
+
# "createdAt": "2025-02-25T13:47:27.102Z",
|
|
143
|
+
# "id": "cm43t74jo00000hrm8tw9aspo",
|
|
144
|
+
# "price": "1",
|
|
145
|
+
# "priceTMN": "112950",
|
|
146
|
+
# "sparkline": {
|
|
147
|
+
# "data": [...],
|
|
148
|
+
# "change": -538,
|
|
149
|
+
# "percentage": -0.48,
|
|
150
|
+
# "isPositive": False
|
|
151
|
+
# },
|
|
152
|
+
# "market": {
|
|
153
|
+
# "totalSupply": null,
|
|
154
|
+
# "maxSupply": null,
|
|
155
|
+
# "circulatingSupply": null,
|
|
156
|
+
# "volume24hBase": null,
|
|
157
|
+
# "high24h": null,
|
|
158
|
+
# "low24h": null,
|
|
159
|
+
# "volume24h": null,
|
|
160
|
+
# "marketCap": null
|
|
161
|
+
# },
|
|
162
|
+
# "blockchains": [...]
|
|
163
|
+
# }
|
|
164
|
+
baseId = self.safe_string(market, 'baseAsset')
|
|
165
|
+
quoteId = self.safe_string(market, 'quoteAsset')
|
|
166
|
+
base = self.safe_currency_code(baseId)
|
|
167
|
+
quote = self.safe_currency_code(quoteId)
|
|
168
|
+
id = base + quote
|
|
169
|
+
baseId = baseId.lower()
|
|
170
|
+
quoteId = quoteId.lower()
|
|
171
|
+
return {
|
|
172
|
+
'id': id,
|
|
173
|
+
'symbol': base + '/' + quote,
|
|
174
|
+
'base': base,
|
|
175
|
+
'quote': quote,
|
|
176
|
+
'settle': None,
|
|
177
|
+
'baseId': baseId,
|
|
178
|
+
'quoteId': quoteId,
|
|
179
|
+
'settleId': None,
|
|
180
|
+
'type': 'spot',
|
|
181
|
+
'spot': True,
|
|
182
|
+
'margin': False,
|
|
183
|
+
'swap': False,
|
|
184
|
+
'future': False,
|
|
185
|
+
'option': False,
|
|
186
|
+
'active': True,
|
|
187
|
+
'contract': False,
|
|
188
|
+
'linear': None,
|
|
189
|
+
'inverse': None,
|
|
190
|
+
'contractSize': None,
|
|
191
|
+
'expiry': None,
|
|
192
|
+
'expiryDatetime': None,
|
|
193
|
+
'strike': None,
|
|
194
|
+
'optionType': None,
|
|
195
|
+
'precision': {
|
|
196
|
+
'amount': None,
|
|
197
|
+
'price': None,
|
|
198
|
+
},
|
|
199
|
+
'limits': {
|
|
200
|
+
'leverage': {
|
|
201
|
+
'min': None,
|
|
202
|
+
'max': None,
|
|
203
|
+
},
|
|
204
|
+
'amount': {
|
|
205
|
+
'min': None,
|
|
206
|
+
'max': None,
|
|
207
|
+
},
|
|
208
|
+
'price': {
|
|
209
|
+
'min': None,
|
|
210
|
+
'max': None,
|
|
211
|
+
},
|
|
212
|
+
'cost': {
|
|
213
|
+
'min': None,
|
|
214
|
+
'max': None,
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
'created': None,
|
|
218
|
+
'info': market,
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
|
222
|
+
"""
|
|
223
|
+
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
224
|
+
https://api-beta.pooleno.ir/api/v1/tokens/public
|
|
225
|
+
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
226
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
227
|
+
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
228
|
+
"""
|
|
229
|
+
self.load_markets()
|
|
230
|
+
if symbols is not None:
|
|
231
|
+
symbols = self.market_symbols(symbols)
|
|
232
|
+
response = self.publicGetApiV1TokensPublic(params)
|
|
233
|
+
payload = self.safe_list(response, 'payload', [])
|
|
234
|
+
result = {}
|
|
235
|
+
for i in range(0, len(payload)):
|
|
236
|
+
token = payload[i]
|
|
237
|
+
ticker = self.parse_ticker(token)
|
|
238
|
+
symbol = ticker['symbol']
|
|
239
|
+
result[symbol] = ticker
|
|
240
|
+
return self.filter_by_array_tickers(result, 'symbol', symbols)
|
|
241
|
+
|
|
242
|
+
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
|
243
|
+
"""
|
|
244
|
+
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
245
|
+
https://api-beta.pooleno.ir/api/v1/tokens/public
|
|
246
|
+
:param str symbol: unified symbol of the market to fetch the ticker for
|
|
247
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
248
|
+
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
249
|
+
"""
|
|
250
|
+
ticker = self.fetch_tickers([symbol])
|
|
251
|
+
return ticker[symbol]
|
|
252
|
+
|
|
253
|
+
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
|
254
|
+
# {
|
|
255
|
+
# "baseAsset": "BTC",
|
|
256
|
+
# "quoteAsset": "USDT",
|
|
257
|
+
# "symbolName": "BTC",
|
|
258
|
+
# "longEnName": "Bitcoin",
|
|
259
|
+
# "longFaName": "بیتکوین",
|
|
260
|
+
# "createdAt": "2025-02-25T13:47:27.103Z",
|
|
261
|
+
# "id": "cm43t74jp00010hrmed9i7l76",
|
|
262
|
+
# "price": "115024.7",
|
|
263
|
+
# "priceTMN": "12980537395",
|
|
264
|
+
# "sparkline": {
|
|
265
|
+
# "data": [...],
|
|
266
|
+
# "change": -538,
|
|
267
|
+
# "percentage": -0.48,
|
|
268
|
+
# "isPositive": False
|
|
269
|
+
# },
|
|
270
|
+
# "market": {
|
|
271
|
+
# "totalSupply": null,
|
|
272
|
+
# "maxSupply": null,
|
|
273
|
+
# "circulatingSupply": null,
|
|
274
|
+
# "volume24hBase": null,
|
|
275
|
+
# "high24h": null,
|
|
276
|
+
# "low24h": null,
|
|
277
|
+
# "volume24h": null,
|
|
278
|
+
# "marketCap": null
|
|
279
|
+
# },
|
|
280
|
+
# "blockchains": [...]
|
|
281
|
+
# }
|
|
282
|
+
marketType = 'spot'
|
|
283
|
+
baseAsset = self.safe_string(ticker, 'baseAsset')
|
|
284
|
+
quoteAsset = self.safe_string(ticker, 'quoteAsset')
|
|
285
|
+
marketId = baseAsset + '/' + quoteAsset
|
|
286
|
+
symbol = self.safe_symbol(marketId, market, None, marketType)
|
|
287
|
+
price = self.safe_float(ticker, 'price')
|
|
288
|
+
priceTMN = self.safe_float(ticker, 'priceTMN')
|
|
289
|
+
sparkline = self.safe_dict(ticker, 'sparkline', {})
|
|
290
|
+
change = self.safe_float(sparkline, 'change')
|
|
291
|
+
percentage = self.safe_float(sparkline, 'percentage')
|
|
292
|
+
marketData = self.safe_dict(ticker, 'market', {})
|
|
293
|
+
high24h = self.safe_float(marketData, 'high24h')
|
|
294
|
+
low24h = self.safe_float(marketData, 'low24h')
|
|
295
|
+
volume24h = self.safe_float(marketData, 'volume24h')
|
|
296
|
+
last = None
|
|
297
|
+
baseVolume = None
|
|
298
|
+
if quoteAsset == 'TMN' or quoteAsset == 'IRT':
|
|
299
|
+
# For TMN/IRT pairs, use priceTMN
|
|
300
|
+
last = priceTMN
|
|
301
|
+
else:
|
|
302
|
+
# For other pairs(like USDT), use price
|
|
303
|
+
last = price
|
|
304
|
+
baseVolume = volume24h
|
|
305
|
+
return self.safe_ticker({
|
|
306
|
+
'symbol': symbol,
|
|
307
|
+
'timestamp': None,
|
|
308
|
+
'datetime': None,
|
|
309
|
+
'high': high24h,
|
|
310
|
+
'low': low24h,
|
|
311
|
+
'bid': last,
|
|
312
|
+
'bidVolume': None,
|
|
313
|
+
'ask': last,
|
|
314
|
+
'askVolume': None,
|
|
315
|
+
'vwap': None,
|
|
316
|
+
'open': None,
|
|
317
|
+
'close': last,
|
|
318
|
+
'last': last,
|
|
319
|
+
'previousClose': None,
|
|
320
|
+
'change': change,
|
|
321
|
+
'percentage': percentage,
|
|
322
|
+
'average': None,
|
|
323
|
+
'baseVolume': baseVolume,
|
|
324
|
+
'quoteVolume': None,
|
|
325
|
+
'info': ticker,
|
|
326
|
+
}, market)
|
|
327
|
+
|
|
328
|
+
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
|
329
|
+
url = self.urls['api']['public'] + '/' + path
|
|
330
|
+
headers = {'Content-Type': 'application/json'}
|
|
331
|
+
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
ccxt/pro/__init__.py
CHANGED
ccxt/tetherland.py
CHANGED
|
@@ -87,7 +87,7 @@ class tetherland(Exchange, ImplicitAPI):
|
|
|
87
87
|
'urls': {
|
|
88
88
|
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/tetherland/64x64.png',
|
|
89
89
|
'api': {
|
|
90
|
-
'public': 'https://
|
|
90
|
+
'public': 'https://service.tetherland.com',
|
|
91
91
|
},
|
|
92
92
|
'www': 'https://tetherland.org',
|
|
93
93
|
'doc': [
|
|
@@ -119,7 +119,7 @@ class tetherland(Exchange, ImplicitAPI):
|
|
|
119
119
|
:returns dict[]: an array of objects representing market data
|
|
120
120
|
"""
|
|
121
121
|
response = self.publicGetApiV5Currencies(params)
|
|
122
|
-
markets = self.
|
|
122
|
+
markets = self.safe_list(response, 'data')
|
|
123
123
|
result = []
|
|
124
124
|
quotes = ['USDT', 'IRT']
|
|
125
125
|
for i in range(0, len(markets)):
|
|
@@ -243,7 +243,7 @@ class tetherland(Exchange, ImplicitAPI):
|
|
|
243
243
|
if symbols is not None:
|
|
244
244
|
symbols = self.market_symbols(symbols)
|
|
245
245
|
response = self.publicGetApiV5Currencies(params)
|
|
246
|
-
markets = self.
|
|
246
|
+
markets = self.safe_list(response, 'data')
|
|
247
247
|
result = []
|
|
248
248
|
quotes = ['USDT', 'IRT']
|
|
249
249
|
for i in range(0, len(markets)):
|
|
@@ -316,7 +316,7 @@ class tetherland(Exchange, ImplicitAPI):
|
|
|
316
316
|
marketId = self.safe_string(ticker, 'id')
|
|
317
317
|
quote = self.safe_string(ticker, 'quote')
|
|
318
318
|
symbol = self.safe_symbol(marketId, market, None, marketType)
|
|
319
|
-
last = self.
|
|
319
|
+
last = float(self.safe_string(ticker, 'price', '').replace(',', ''))
|
|
320
320
|
if quote == 'IRT':
|
|
321
321
|
last = self.safe_float(ticker, 'toman_amount', 0)
|
|
322
322
|
change = self.safe_float(ticker, 'changes_24h', 0)
|
ccxt/twox.py
CHANGED
|
@@ -22,7 +22,7 @@ class twox(Exchange, ImplicitAPI):
|
|
|
22
22
|
'pro': False,
|
|
23
23
|
'has': {
|
|
24
24
|
'CORS': None,
|
|
25
|
-
'spot':
|
|
25
|
+
'spot': False,
|
|
26
26
|
'margin': False,
|
|
27
27
|
'swap': False,
|
|
28
28
|
'future': False,
|
|
@@ -78,6 +78,7 @@ class twox(Exchange, ImplicitAPI):
|
|
|
78
78
|
'fetchTradingFee': False,
|
|
79
79
|
'fetchTradingFees': False,
|
|
80
80
|
'fetchWithdrawals': False,
|
|
81
|
+
'otc': True,
|
|
81
82
|
'setLeverage': False,
|
|
82
83
|
'setMarginMode': False,
|
|
83
84
|
'transfer': False,
|
|
@@ -233,7 +234,7 @@ class twox(Exchange, ImplicitAPI):
|
|
|
233
234
|
if symbols is not None:
|
|
234
235
|
symbols = self.market_symbols(symbols)
|
|
235
236
|
response = self.publicGetApiCurrencies(params)
|
|
236
|
-
result =
|
|
237
|
+
result = {}
|
|
237
238
|
quotes = ['IRT', 'USDT']
|
|
238
239
|
for i in range(0, len(response)):
|
|
239
240
|
base = self.safe_string(response[i], 'symbol')
|
|
@@ -262,50 +263,73 @@ class twox(Exchange, ImplicitAPI):
|
|
|
262
263
|
|
|
263
264
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
|
264
265
|
# {
|
|
265
|
-
# sellPrice: 0,
|
|
266
|
-
# buyPrice: 0,
|
|
267
|
-
# latestPrice: 0,
|
|
268
|
-
# weeklyChart: "https://cdn.twox.
|
|
269
|
-
# priceChangePercent: 0,
|
|
270
|
-
#
|
|
266
|
+
# sellPrice: 113201.0,
|
|
267
|
+
# buyPrice: 112151.0,
|
|
268
|
+
# latestPrice: 1.0,
|
|
269
|
+
# weeklyChart: "https://cdn.twox.info/resource/w/tether.webp?v=101313",
|
|
270
|
+
# priceChangePercent: 0.0,
|
|
271
|
+
# sellPriceChange: 0.00,
|
|
272
|
+
# buyPriceChange: 0.00,
|
|
273
|
+
# minAmount: 2.0,
|
|
271
274
|
# tags: [],
|
|
272
275
|
# marketCategories: [],
|
|
273
|
-
# id:
|
|
274
|
-
# symbol: "
|
|
275
|
-
# name: "
|
|
276
|
-
# icon: "https://cdn.twox.
|
|
277
|
-
# persianName: "
|
|
278
|
-
# isStableCoin:
|
|
276
|
+
# id: 2,
|
|
277
|
+
# symbol: "USDT",
|
|
278
|
+
# name: "Tether USDt",
|
|
279
|
+
# icon: "https://cdn.twox.info/resource/c/tether.webp",
|
|
280
|
+
# persianName: "تتر",
|
|
281
|
+
# isStableCoin: True,
|
|
279
282
|
# isActive: True,
|
|
280
|
-
#
|
|
281
|
-
# type: 0,
|
|
283
|
+
# type: 2,
|
|
282
284
|
# isNeedRiskWarning: False,
|
|
283
|
-
# assetPrecision:
|
|
284
|
-
# isLeveragedToken: False,
|
|
285
|
-
# commissionPrecision: 0,
|
|
285
|
+
# assetPrecision: 2,
|
|
286
286
|
# isDepositAllEnable: True,
|
|
287
|
-
#
|
|
287
|
+
# tradeStatus: 1,
|
|
288
288
|
# isWithdrawAllEnable: True,
|
|
289
|
-
# currencySlug: "
|
|
290
|
-
# marketCurrencyId:
|
|
291
|
-
# order:
|
|
289
|
+
# currencySlug: "tether",
|
|
290
|
+
# marketCurrencyId: 825,
|
|
291
|
+
# order: 1,
|
|
292
|
+
# isTrading: True,
|
|
293
|
+
# commissionPrecision: 8,
|
|
294
|
+
# isDepositNeedManualConfirm: False,
|
|
295
|
+
# supportedBy: []
|
|
292
296
|
# },
|
|
293
297
|
marketType = 'otc'
|
|
294
298
|
marketId = self.safe_string(ticker, 'symbol')
|
|
295
299
|
symbol = self.safe_symbol(marketId, market, None, marketType)
|
|
296
|
-
|
|
300
|
+
sellPrice = self.safe_float(ticker, 'sellPrice')
|
|
301
|
+
buyPrice = self.safe_float(ticker, 'buyPrice')
|
|
302
|
+
latestPrice = self.safe_float(ticker, 'latestPrice')
|
|
303
|
+
last = None
|
|
304
|
+
bid = None
|
|
305
|
+
ask = None
|
|
306
|
+
if ticker['quote'] == 'IRT':
|
|
307
|
+
# For IRT pairs, sellPrice is what user pays(ask), buyPrice is what user receives(bid)
|
|
308
|
+
last = sellPrice
|
|
309
|
+
bid = buyPrice
|
|
310
|
+
ask = sellPrice
|
|
311
|
+
else:
|
|
312
|
+
# For USDT pairs, use latestPrice
|
|
313
|
+
last = latestPrice
|
|
314
|
+
bid = buyPrice
|
|
315
|
+
ask = sellPrice
|
|
316
|
+
percentage = self.safe_float(ticker, 'priceChangePercent')
|
|
317
|
+
sellPriceChange = self.safe_float(ticker, 'sellPriceChange')
|
|
318
|
+
buyPriceChange = self.safe_float(ticker, 'buyPriceChange')
|
|
319
|
+
change = None
|
|
297
320
|
if ticker['quote'] == 'IRT':
|
|
298
|
-
|
|
299
|
-
|
|
321
|
+
change = sellPriceChange
|
|
322
|
+
else:
|
|
323
|
+
change = buyPriceChange
|
|
300
324
|
return self.safe_ticker({
|
|
301
325
|
'symbol': symbol,
|
|
302
326
|
'timestamp': None,
|
|
303
327
|
'datetime': None,
|
|
304
328
|
'high': None,
|
|
305
329
|
'low': None,
|
|
306
|
-
'bid':
|
|
330
|
+
'bid': bid,
|
|
307
331
|
'bidVolume': None,
|
|
308
|
-
'ask':
|
|
332
|
+
'ask': ask,
|
|
309
333
|
'askVolume': None,
|
|
310
334
|
'vwap': None,
|
|
311
335
|
'open': None,
|
|
@@ -313,7 +337,7 @@ class twox(Exchange, ImplicitAPI):
|
|
|
313
337
|
'last': last,
|
|
314
338
|
'previousClose': None,
|
|
315
339
|
'change': change,
|
|
316
|
-
'percentage':
|
|
340
|
+
'percentage': percentage,
|
|
317
341
|
'average': None,
|
|
318
342
|
'baseVolume': None,
|
|
319
343
|
'quoteVolume': None,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ccxt-ir
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.11
|
|
4
4
|
Summary: A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges
|
|
5
5
|
Home-page: https://ccxt.com
|
|
6
6
|
Author: Igor Kroitor
|
|
@@ -62,7 +62,7 @@ Dynamic: summary
|
|
|
62
62
|
|
|
63
63
|
# CCXT – CryptoCurrency eXchange Trading Library
|
|
64
64
|
|
|
65
|
-
[](https://www.npmjs.com/package/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.nuget.org/packages/ccxt) [](https://godoc.org/github.com/ccxt/ccxt/go/v4) [](https://discord.gg/ccxt) [](https://www.npmjs.com/package/ccxt) [](https://npmjs.com/package/ccxt) [](https://pypi.python.org/pypi/ccxt) [](https://www.nuget.org/packages/ccxt) [](https://godoc.org/github.com/ccxt/ccxt/go/v4) [](https://discord.gg/ccxt) [](https://github.com/ccxt/ccxt/wiki/Exchange-Markets) [](https://x.com/ccxt_official)
|
|
66
66
|
|
|
67
67
|
A `JavaScript` / `Python` / `PHP` / `C#` / `Go` library for cryptocurrency trading and e-commerce with support for many bitcoin/ether/altcoin exchange markets and merchant APIs.
|
|
68
68
|
|
|
@@ -305,20 +305,20 @@ console.log(version, Object.keys(exchanges));
|
|
|
305
305
|
All-in-one browser bundle (dependencies included), served from a CDN of your choice:
|
|
306
306
|
|
|
307
307
|
<<<<<<< HEAD
|
|
308
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.
|
|
309
|
-
* unpkg: https://unpkg.com/ccxt@4.9.
|
|
308
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.11/dist/ccxt.browser.min.js
|
|
309
|
+
* unpkg: https://unpkg.com/ccxt@4.9.11/dist/ccxt.browser.min.js
|
|
310
310
|
=======
|
|
311
|
-
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.
|
|
312
|
-
* unpkg: https://unpkg.com/ccxt@4.9.
|
|
311
|
+
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.11/dist/ccxt.browser.min.js
|
|
312
|
+
* unpkg: https://unpkg.com/ccxt@4.9.11/dist/ccxt.browser.min.js
|
|
313
313
|
>>>>>>> master
|
|
314
314
|
|
|
315
315
|
CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.
|
|
316
316
|
|
|
317
317
|
```HTML
|
|
318
318
|
<<<<<<< HEAD
|
|
319
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.9.
|
|
319
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.9.11/dist/ccxt.browser.min.js"></script>
|
|
320
320
|
=======
|
|
321
|
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.9.
|
|
321
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.9.11/dist/ccxt.browser.min.js"></script>
|
|
322
322
|
>>>>>>> master
|
|
323
323
|
console.log (ccxt.exchanges) // print all available exchanges
|
|
324
324
|
```
|