xync-client 0.0.104__py3-none-any.whl → 0.0.106__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 +9 -5
- xync_client/Bybit/agent.py +3 -3
- {xync_client-0.0.104.dist-info → xync_client-0.0.106.dist-info}/METADATA +1 -1
- {xync_client-0.0.104.dist-info → xync_client-0.0.106.dist-info}/RECORD +6 -6
- {xync_client-0.0.104.dist-info → xync_client-0.0.106.dist-info}/WHEEL +0 -0
- {xync_client-0.0.104.dist-info → xync_client-0.0.106.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()
|
|
@@ -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/Bybit/agent.py
CHANGED
|
@@ -641,7 +641,7 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
641
641
|
expiration = datetime.now(timezone.utc) - timedelta(minutes=15)
|
|
642
642
|
if race.updated_at < expiration:
|
|
643
643
|
ceils, hp, vmf, zplace = await self.get_ceils(coinex, curex, pmexs, 0.001, True)
|
|
644
|
-
race.ceil = ceils[int(taker_side)] * 10**curex.scale
|
|
644
|
+
race.ceil = int(ceils[int(taker_side)] * 10**curex.scale)
|
|
645
645
|
await race.save()
|
|
646
646
|
# upd pair race
|
|
647
647
|
if prace := await models.Race.annotate(pms_count=Count("road__ad__pms")).get_or_none(
|
|
@@ -652,7 +652,7 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
652
652
|
road__ad__pms__id__in=pm_ids,
|
|
653
653
|
pms_count=len(pm_ids),
|
|
654
654
|
):
|
|
655
|
-
prace.ceil = ceils[int(not taker_side)] * 10**curex.scale
|
|
655
|
+
prace.ceil = int(ceils[int(not taker_side)] * 10**curex.scale)
|
|
656
656
|
await prace.save()
|
|
657
657
|
|
|
658
658
|
last_vol = volume
|
|
@@ -1207,7 +1207,7 @@ async def main():
|
|
|
1207
1207
|
# await s.curs.add(rub.cur)
|
|
1208
1208
|
|
|
1209
1209
|
# пока порешали рейс-кондишн, очищаем сиротские условия при каждом запуске
|
|
1210
|
-
[await c.delete() for c in await Cond.filter(ads__isnull=True)]
|
|
1210
|
+
# [await c.delete() for c in await Cond.filter(ads__isnull=True)]
|
|
1211
1211
|
cl.all_conds = {
|
|
1212
1212
|
c.id: (c.raw_txt, {a.maker.exid for a in c.ads}) for c in await Cond.all().prefetch_related("ads__maker")
|
|
1213
1213
|
}
|
|
@@ -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
|
|
@@ -34,7 +34,7 @@ xync_client/BitGet/ex.py,sha256=nAexKRkguIhq4fYP1tkIaou6oBFjjV2xwlajlJ-9DAE,3757
|
|
|
34
34
|
xync_client/BitGet/etype/ad.py,sha256=fysSW47wGYjSOPUqY864z857AJz4gjN-nOkI1Jxd27U,1838
|
|
35
35
|
xync_client/BitPapa/ex.py,sha256=U-RRB_RSOtErfRgxOZYWegZ_td_uZO37YKo3Jxchf_w,912
|
|
36
36
|
xync_client/Bybit/InAgent.py,sha256=WeBnc5etElWbAThdw7o8Oc9bmsj9nq7vrvgAGw2ASG8,20841
|
|
37
|
-
xync_client/Bybit/agent.py,sha256=
|
|
37
|
+
xync_client/Bybit/agent.py,sha256=ypo2MXLP5IAjJto1r0WXu1bLYgyON7mXE0XBL95LeDg,58801
|
|
38
38
|
xync_client/Bybit/ex.py,sha256=DgPOmnjphcSCSsO4ZQjnIlWICNzdtKhNIpVsU93s99k,4707
|
|
39
39
|
xync_client/Bybit/order.py,sha256=H4UIb8hxFGnw1hZuSbr0yZ4qeaCOIZOMc6jEst0ycBs,1713
|
|
40
40
|
xync_client/Bybit/web_earn.py,sha256=qjqS10xlFc8r40IhDdPZ0LxA2dFEGbvBGXdsrUUJCMo,3019
|
|
@@ -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.106.dist-info/METADATA,sha256=TKDjFaA30YolM4mTiC7mK8XJ8PSwxRP9Jhqq9GHG1Lc,964
|
|
98
|
+
xync_client-0.0.106.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
99
|
+
xync_client-0.0.106.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
|
|
100
|
+
xync_client-0.0.106.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|