xync-client 0.0.104__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 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: (await models.Cur.update_or_create({"rate": cur_pyd.rate or 0}, ticker=cur_pyd.ticker))[0]
96
- for exid, cur_pyd in cur_pyds.items()
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()
@@ -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
- pss += [models.PairSide(is_sell=is_sell, pair=pair)]
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-ами) в бд
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-client
3
- Version: 0.0.104
3
+ Version: 0.0.105
4
4
  Author-email: Mike Artemiev <mixartemev@gmail.com>
5
5
  Project-URL: Homepage, https://gitlab.com/XyncNet/client
6
6
  Project-URL: Repository, https://gitlab.com/XyncNet/client
@@ -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=vVsmbT78w92NUUYLYpKuzcNErpFjYkZgCq94dFOsCgA,12845
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
@@ -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.104.dist-info/METADATA,sha256=cUCyEhCqDsCfCG0l0i-fIY3cayy35TcjGkIojnblf8A,964
98
- xync_client-0.0.104.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- xync_client-0.0.104.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
100
- xync_client-0.0.104.dist-info/RECORD,,
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,,