xync-client 0.0.103.dev2__py3-none-any.whl → 0.0.105__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.
Potentially problematic release.
This version of xync-client might be problematic. Click here for more details.
- xync_client/Abc/Ex.py +10 -6
- xync_client/Gate/ex.py +3 -0
- {xync_client-0.0.103.dev2.dist-info → xync_client-0.0.105.dist-info}/METADATA +1 -1
- {xync_client-0.0.103.dev2.dist-info → xync_client-0.0.105.dist-info}/RECORD +6 -6
- {xync_client-0.0.103.dev2.dist-info → xync_client-0.0.105.dist-info}/WHEEL +0 -0
- {xync_client-0.0.103.dev2.dist-info → xync_client-0.0.105.dist-info}/top_level.txt +0 -0
xync_client/Abc/Ex.py
CHANGED
|
@@ -91,9 +91,15 @@ class BaseExClient(HttpClient):
|
|
|
91
91
|
async def set_curs(self, cookies: dict = None) -> bool:
|
|
92
92
|
# Curs
|
|
93
93
|
cur_pyds: dict[str, CurEx] = await self.curs()
|
|
94
|
+
old_curs = {c.ticker: c.id for c in await models.Cur.all()}
|
|
94
95
|
curs: dict[int | str, models.Cur] = {
|
|
95
|
-
exid: (
|
|
96
|
-
|
|
96
|
+
exid: (
|
|
97
|
+
await models.Cur.update_or_create(
|
|
98
|
+
{"rate": cur_pyd.rate or 0, "id": old_curs.get(cur_pyd.ticker, await models.Cur.all().count() + 1)},
|
|
99
|
+
ticker=cur_pyd.ticker,
|
|
100
|
+
)
|
|
101
|
+
)[0]
|
|
102
|
+
for i, (exid, cur_pyd) in enumerate(cur_pyds.items())
|
|
97
103
|
}
|
|
98
104
|
curexs = [
|
|
99
105
|
models.CurEx(**c.model_dump(exclude_none=True), cur=curs[c.exid], ex=self.ex) for c in cur_pyds.values()
|
|
@@ -209,7 +215,7 @@ class BaseExClient(HttpClient):
|
|
|
209
215
|
coinexs: dict[str, CoinEx] = await self.coins()
|
|
210
216
|
coins_db: dict[int, models.Coin] = {
|
|
211
217
|
c.exid: (
|
|
212
|
-
await models.Coin.update_or_create({"scale": c.scale
|
|
218
|
+
await models.Coin.update_or_create({"scale": c.scale or self.coin_scales[c.ticker]}, ticker=c.ticker)
|
|
213
219
|
)[0]
|
|
214
220
|
for c in coinexs.values()
|
|
215
221
|
}
|
|
@@ -236,13 +242,11 @@ class BaseExClient(HttpClient):
|
|
|
236
242
|
}
|
|
237
243
|
prs: tuple[dict, dict] = await self.pairs()
|
|
238
244
|
for is_sell in (0, 1):
|
|
239
|
-
pss: list[models.PairSide] = []
|
|
240
245
|
for cur, coinz in prs[is_sell].items():
|
|
241
246
|
for coin in coinz:
|
|
242
247
|
pair, _ = await models.Pair.get_or_create(coin=coins[coin], cur=curs[cur])
|
|
243
248
|
# pairex, _ = await models.PairEx.get_or_create(pair=pair, ex=self.ex) # todo: разные ли комишки на покупку и продажу?
|
|
244
|
-
|
|
245
|
-
await models.PairSide.bulk_create(pss, ignore_conflicts=True)
|
|
249
|
+
await models.PairSide.update_or_create(is_sell=is_sell, pair=pair)
|
|
246
250
|
return True
|
|
247
251
|
|
|
248
252
|
# Сохранение чужого объявления (с Pm-ами) в бд
|
xync_client/Gate/ex.py
CHANGED
|
@@ -19,6 +19,8 @@ class ExClient(BaseExClient):
|
|
|
19
19
|
"BTC": 8,
|
|
20
20
|
"ETH": 8,
|
|
21
21
|
"DOGE": 8,
|
|
22
|
+
"TON": 8,
|
|
23
|
+
"NOT": 8,
|
|
22
24
|
"USDC": 2,
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -94,6 +96,7 @@ async def main():
|
|
|
94
96
|
async with FileClient(TOKEN) as b:
|
|
95
97
|
cl = ExClient(gt, b)
|
|
96
98
|
await cl.set_pairs()
|
|
99
|
+
pms = await cl.set_coins()
|
|
97
100
|
pms = await cl.cur_pms_map()
|
|
98
101
|
pms = await cl.set_pms()
|
|
99
102
|
pms = await cl.set_coins()
|
|
@@ -5,7 +5,7 @@ xync_client/Abc/Agent.py,sha256=OJaJ1RIMDYAS4xeefeXxVIVI0EKnMczQtrO35MLzqr4,5390
|
|
|
5
5
|
xync_client/Abc/Asset.py,sha256=hlgyFaU9byr2N2r8Heh-_ICx49SKuKxfRTUA4yQWmEw,454
|
|
6
6
|
xync_client/Abc/Auth.py,sha256=OPQXN7_XYQZP9431ylFksd6JDusbKG8N_1g6CXTZ6yY,1495
|
|
7
7
|
xync_client/Abc/BaseTest.py,sha256=vaAs5Z4HYV7k_C3zQz6JKO75s2hXtVbBI3-0Srkzv5Q,2388
|
|
8
|
-
xync_client/Abc/Ex.py,sha256=
|
|
8
|
+
xync_client/Abc/Ex.py,sha256=n41-XCjoIV-KpC_lK3jO049tQKbFmE0eDU3SDlgZTws,12986
|
|
9
9
|
xync_client/Abc/Exception.py,sha256=Sts7RpP370NBdjaH_cyXDdHtjge8zXNUGWCrKw49Zyk,482
|
|
10
10
|
xync_client/Abc/InAgent.py,sha256=svKGATUM0c9YIDDEVLc-NxpUNWqZoVr5PjxoxK64RKs,650
|
|
11
11
|
xync_client/Abc/Order.py,sha256=7-FGIJu5z9aYi0A_eJV4F-cp_6Mz_izNpefexDQZvHw,2428
|
|
@@ -43,7 +43,7 @@ xync_client/Bybit/ws.py,sha256=OQjZHo_MiAH1dlOs3c-aUZBKyqToNTmH560udh6RYDE,1431
|
|
|
43
43
|
xync_client/Bybit/etype/ad.py,sha256=HJOHi9KrbLQMpwEyd4oA8436QTNRqrd2HWFF-JNZGDo,8066
|
|
44
44
|
xync_client/Bybit/etype/cred.py,sha256=dgFExLB4e5Wf6SqfU9SOdeooHQa84DRbTGm_OJhNw_o,1354
|
|
45
45
|
xync_client/Bybit/etype/order.py,sha256=M9hxHCELTb2llz2c8q0QrfG-lCxuUb-Zwmag82ggXn0,8073
|
|
46
|
-
xync_client/Gate/ex.py,sha256=
|
|
46
|
+
xync_client/Gate/ex.py,sha256=1vSXctCOyZfYDojkHU6u4YSXwYTLg-e7BfAdGKvZ_UM,3727
|
|
47
47
|
xync_client/Gate/premarket.py,sha256=IW-CgkmNJePJR2j_NRfULNKTePMX35XlhldqdiO76zY,2138
|
|
48
48
|
xync_client/Gate/etype/ad.py,sha256=-EwtFcOWWvtE6UjaOdsuXWDTCVjAIRK0kSEsqPP4Yls,1296
|
|
49
49
|
xync_client/Gmail/__init__.py,sha256=6aXhqtiVS5lA6O_W1276kamnixlH5OmUFklqwbVG4RA,4647
|
|
@@ -94,7 +94,7 @@ xync_client/TgWallet/order.py,sha256=BOmBx5WWfJv0-_-A8DcR-Xd8utqO_VTmSqSegm0cteQ
|
|
|
94
94
|
xync_client/TgWallet/pyd.py,sha256=Ys3E8b3RLuyQ26frWT0F0BorkNxVpxnd18tY4Gp9dik,5636
|
|
95
95
|
xync_client/TgWallet/pyro.py,sha256=2K7QWdo48k4MbbgQt90gdz_HiPck69Njm4xaMjIVgoo,1440
|
|
96
96
|
xync_client/TgWallet/web.py,sha256=kDcv9SKKQPe91mw1qJBpbuyKYCAmZdfdHJylHumLBVU,1608
|
|
97
|
-
xync_client-0.0.
|
|
98
|
-
xync_client-0.0.
|
|
99
|
-
xync_client-0.0.
|
|
100
|
-
xync_client-0.0.
|
|
97
|
+
xync_client-0.0.105.dist-info/METADATA,sha256=M41YGcSXFZYPOq2QDYuWpHXsvM-S5RkWxuGX7iohS3w,964
|
|
98
|
+
xync_client-0.0.105.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
99
|
+
xync_client-0.0.105.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
|
|
100
|
+
xync_client-0.0.105.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|