xync-client 0.0.128__tar.gz → 0.0.130__tar.gz
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-0.0.128/xync_client.egg-info → xync_client-0.0.130}/PKG-INFO +2 -2
- {xync_client-0.0.128 → xync_client-0.0.130}/pyproject.toml +1 -1
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/InAgent.py +43 -12
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/agent.py +78 -91
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Payeer/__init__.py +1 -1
- xync_client-0.0.130/xync_client/details.py +27 -0
- {xync_client-0.0.128 → xync_client-0.0.130/xync_client.egg-info}/PKG-INFO +2 -2
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client.egg-info/SOURCES.txt +1 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client.egg-info/requires.txt +1 -1
- {xync_client-0.0.128 → xync_client-0.0.130}/.env.sample +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/.gitignore +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/README.md +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/makefile +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/setup.cfg +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/TestAgent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/TestAsset.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/TestEx.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/TestOrder.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/Exception.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/PmAgent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Abc/xtype.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/BitPapa/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/etype/order.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/order.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Gmail/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/KuCoin/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Mexc/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/MTS/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Ozon/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Payeer/.gitignore +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Payeer/api.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Payeer/login.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Sber/utils.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Volet/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Xync/__main__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Xync/ed.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/Pms/Yandex/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/ex.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/__init__.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/loader.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.128 → xync_client-0.0.130}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xync-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.130
|
|
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
|
|
@@ -14,7 +14,7 @@ Requires-Dist: python-binance
|
|
|
14
14
|
Requires-Dist: pybit
|
|
15
15
|
Requires-Dist: pyotp
|
|
16
16
|
Requires-Dist: pypng
|
|
17
|
-
Requires-Dist: kurigram
|
|
17
|
+
Requires-Dist: kurigram
|
|
18
18
|
Requires-Dist: payeer-api
|
|
19
19
|
Requires-Dist: playwright
|
|
20
20
|
Requires-Dist: python-dotenv
|
|
@@ -5,7 +5,7 @@ from datetime import datetime, timezone
|
|
|
5
5
|
from uuid import uuid4
|
|
6
6
|
|
|
7
7
|
import websockets
|
|
8
|
-
from asyncio import run
|
|
8
|
+
from asyncio import run, sleep
|
|
9
9
|
from decimal import Decimal
|
|
10
10
|
|
|
11
11
|
from playwright.async_api import async_playwright
|
|
@@ -118,8 +118,8 @@ class InAgentClient(BaseInAgentClient):
|
|
|
118
118
|
dict(
|
|
119
119
|
amount=int(float(order.amount) * 100),
|
|
120
120
|
accepted_at=datetime.now(timezone.utc),
|
|
121
|
+
order=order_db,
|
|
121
122
|
),
|
|
122
|
-
order=order_db,
|
|
123
123
|
# pm_id=order_db.cred.pmcur.pm_id,
|
|
124
124
|
pmid=tid,
|
|
125
125
|
)
|
|
@@ -128,8 +128,22 @@ class InAgentClient(BaseInAgentClient):
|
|
|
128
128
|
continue
|
|
129
129
|
|
|
130
130
|
# если висят незавершенные продажи с такой же суммой
|
|
131
|
-
pos = await self.agent_client.get_orders_active(1)
|
|
132
|
-
if [
|
|
131
|
+
pos = (await self.agent_client.get_orders_active(1))["result"]["items"]
|
|
132
|
+
if [
|
|
133
|
+
o
|
|
134
|
+
for o in pos
|
|
135
|
+
if (
|
|
136
|
+
o["amount"] == order.amount
|
|
137
|
+
and o["id"] != upd.id
|
|
138
|
+
and int(order.createDate) < int(o["createDate"]) + 3600 * 000
|
|
139
|
+
)
|
|
140
|
+
]:
|
|
141
|
+
await self.agent_client.ex_client.bot.send(
|
|
142
|
+
f"[Duplicate amount!]"
|
|
143
|
+
f"(https://www.bybit.com/ru-RU/p2p/orderList/{order.id})",
|
|
144
|
+
self.agent_client.actor.person.user.username_id,
|
|
145
|
+
)
|
|
146
|
+
logging.warning("Duplicate amount!")
|
|
133
147
|
continue
|
|
134
148
|
|
|
135
149
|
# !!! ОТПРАВЛЯЕМ ДЕНЬГИ !!!
|
|
@@ -205,8 +219,8 @@ class InAgentClient(BaseInAgentClient):
|
|
|
205
219
|
msg, _ = await models.Msg.update_or_create(
|
|
206
220
|
{
|
|
207
221
|
"to_maker": upd.userId == self.agent_client.actor.exid and im_taker,
|
|
222
|
+
"sent_at": datetime.fromtimestamp(float(upd.createDate) / 1000),
|
|
208
223
|
},
|
|
209
|
-
sent_at=datetime.fromtimestamp(float(upd.createDate) / 1000),
|
|
210
224
|
txt=upd.message,
|
|
211
225
|
order=order_db,
|
|
212
226
|
)
|
|
@@ -302,7 +316,10 @@ class InAgentClient(BaseInAgentClient):
|
|
|
302
316
|
)
|
|
303
317
|
# проверяем не отправляли ли мы уже перевод по этому ордеру
|
|
304
318
|
if t := await models.Transfer.get_or_none(order=order_db, amount=order_db.amount):
|
|
305
|
-
await pma.bot.send(
|
|
319
|
+
await pma.bot.send(
|
|
320
|
+
f"Order# {order_db.exid}: Double send {fmt_am}{cur} to {dest} #{t.pmid}!",
|
|
321
|
+
self.agent_client.actor.person.user.username_id,
|
|
322
|
+
)
|
|
306
323
|
raise Exception(f"Order# {order_db.exid}: Double send {fmt_am}{cur} to {dest} #{t.pmid}!")
|
|
307
324
|
|
|
308
325
|
# ставим в бд статус "оплачен"
|
|
@@ -317,12 +334,22 @@ class InAgentClient(BaseInAgentClient):
|
|
|
317
334
|
order=order_db,
|
|
318
335
|
pmid=tid,
|
|
319
336
|
)
|
|
320
|
-
# отправляем продавцу чек
|
|
321
|
-
|
|
337
|
+
await self.send_receipt(str(order_db.exid), tid) # отправляем продавцу чек
|
|
338
|
+
logging.info(f"Order {order_db.exid} PAID at {datetime.now()}: {fmt_am}!")
|
|
339
|
+
|
|
340
|
+
async def send_receipt(self, oexid: str, tid: int) -> tuple[PmAgentClient | None, models.CredEx] | None:
|
|
341
|
+
try:
|
|
342
|
+
if res := self.agent_client.api.upload_chat_file(upload_file=f"tmp/{tid}.png").get("result"):
|
|
343
|
+
await sleep(0.5)
|
|
322
344
|
self.agent_client.api.send_chat_message(
|
|
323
|
-
orderId=
|
|
345
|
+
orderId=oexid, contentType="pic", message=res["url"], msgUuid=uuid4().hex
|
|
324
346
|
)
|
|
325
|
-
|
|
347
|
+
except Exception as e:
|
|
348
|
+
logging.error(e)
|
|
349
|
+
await sleep(0.5)
|
|
350
|
+
self.agent_client.api.send_chat_message(
|
|
351
|
+
orderId=oexid, contentType="str", message=f"#{tid}", msgUuid=uuid4().hex
|
|
352
|
+
)
|
|
326
353
|
|
|
327
354
|
async def get_pma_by_cdex(self, order: OrderFull) -> tuple[PmAgentClient | None, models.CredEx] | None:
|
|
328
355
|
cdxs = await models.CredEx.filter(
|
|
@@ -370,13 +397,17 @@ async def main():
|
|
|
370
397
|
)
|
|
371
398
|
|
|
372
399
|
async with FileClient(TOKEN) as b:
|
|
400
|
+
b: FileClient
|
|
373
401
|
cl: InAgentClient = actor.in_client(b)
|
|
374
402
|
# await cl.agent_client.export_my_ads()
|
|
375
403
|
payeer_cl = Client(actor.person.user.username_id)
|
|
376
404
|
for pma in actor.person.user.pm_agents:
|
|
377
405
|
cl.pmacs[pma.pm_id] = await payeer_cl.start(await async_playwright().start(), False)
|
|
378
|
-
|
|
379
|
-
|
|
406
|
+
try:
|
|
407
|
+
_ = await cl.start_listen()
|
|
408
|
+
except Exception as e:
|
|
409
|
+
await b.send("😱Bybit InAgent CRASHED!!!😱", actor.person.user.username_id)
|
|
410
|
+
await b.send(e.__repr__(), actor.person.user.username_id)
|
|
380
411
|
await cl.agent_client.close()
|
|
381
412
|
|
|
382
413
|
|
|
@@ -666,7 +666,12 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
666
666
|
volume = asset.free * 10**-coinex.scale
|
|
667
667
|
volume = str(round(volume, coinex.scale))
|
|
668
668
|
|
|
669
|
-
|
|
669
|
+
try:
|
|
670
|
+
ads: list[Ad] = await self.ads(coinex, curex, taker_side, pmexs)
|
|
671
|
+
except Exception:
|
|
672
|
+
await sleep(1)
|
|
673
|
+
ads: list[Ad] = await self.ads(coinex, curex, taker_side, pmexs)
|
|
674
|
+
|
|
670
675
|
if race.vm_filter:
|
|
671
676
|
ads = [ad for ad in ads if "VA" in ad.authTag]
|
|
672
677
|
self.overprice_filter(ads, race.ceil * 10**-curex.scale, k) # обрезаем сверху все ads дороже нашего потолка
|
|
@@ -757,12 +762,7 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
757
762
|
raise e
|
|
758
763
|
elif ExcCode(e.status_code) == ExcCode.InsufficientBalance:
|
|
759
764
|
asset = await models.Asset.get(addr__actor=self.actor, addr__coin_id=coinex.coin_id)
|
|
760
|
-
req.quantity = str(
|
|
761
|
-
round(
|
|
762
|
-
asset.free * 10**-coinex.scale,
|
|
763
|
-
coinex.scale or coinex.coin.scale,
|
|
764
|
-
)
|
|
765
|
-
)
|
|
765
|
+
req.quantity = str(round(asset.free * 10**-coinex.scale, coinex.scale))
|
|
766
766
|
_res = self.ad_upd(req)
|
|
767
767
|
elif ExcCode(e.status_code) == ExcCode.RareLimit:
|
|
768
768
|
sad = [
|
|
@@ -1186,94 +1186,81 @@ async def main():
|
|
|
1186
1186
|
actor = (
|
|
1187
1187
|
await models.Actor.filter(ex_id=4, agent__isnull=False).prefetch_related("ex", "agent", "person__user").first()
|
|
1188
1188
|
)
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1189
|
+
filebot = FileClient(TOKEN)
|
|
1190
|
+
await filebot.start()
|
|
1191
|
+
# b.add_handler(MessageHandler(cond_start_handler, command("cond")))
|
|
1192
|
+
cl: AgentClient = actor.client(filebot)
|
|
1193
|
+
|
|
1194
|
+
# await cl.ex_client.set_pairs()
|
|
1195
|
+
# await cl.ex_client.set_pms()
|
|
1196
|
+
# await cl.set_creds()
|
|
1197
|
+
# await cl.export_my_ads()
|
|
1198
|
+
|
|
1199
|
+
# создание гонок по мои активным объявам:
|
|
1200
|
+
# for ma in cl.my_ads():
|
|
1201
|
+
# my_ad = await models.MyAd.get(ad__exid=ma.id).prefetch_related('ad__pms', 'ad__pair_side__pair')
|
|
1202
|
+
# race, _ = await models.Race.update_or_create(
|
|
1203
|
+
# {"started": True, "vm_filter": True, "target_place": 5},
|
|
1204
|
+
# road=my_ad
|
|
1205
|
+
# )
|
|
1206
|
+
|
|
1207
|
+
# for name in names:
|
|
1208
|
+
# s, _ = await models.Synonym.update_or_create(typ=SynonymType.name, txt=name)
|
|
1209
|
+
# await s.curs.add(rub.cur)
|
|
1210
|
+
|
|
1211
|
+
# пока порешали рейс-кондишн, очищаем сиротские условия при каждом запуске
|
|
1212
|
+
# [await c.delete() for c in await Cond.filter(ads__isnull=True)]
|
|
1213
|
+
cl.all_conds = {
|
|
1214
|
+
c.id: (c.raw_txt, {a.maker.exid for a in c.ads}) for c in await Cond.all().prefetch_related("ads__maker")
|
|
1215
|
+
}
|
|
1216
|
+
for curr, old in await CondSim.filter().values_list("cond_id", "cond_rel_id"):
|
|
1217
|
+
cl.cond_sims[curr] = old
|
|
1218
|
+
cl.rcond_sims[old] |= {curr}
|
|
1219
|
+
|
|
1220
|
+
cl.build_tree()
|
|
1221
|
+
a = set()
|
|
1222
|
+
|
|
1223
|
+
def check_tree(tre):
|
|
1224
|
+
for p, c in tre.items():
|
|
1225
|
+
a.add(p)
|
|
1226
|
+
check_tree(c)
|
|
1227
|
+
|
|
1228
|
+
for pr, ch in cl.tree.items():
|
|
1229
|
+
check_tree(ch)
|
|
1230
|
+
if ct := set(cl.tree.keys()) & a:
|
|
1231
|
+
logging.exception(f"cycle cids: {ct}")
|
|
1232
|
+
|
|
1233
|
+
# await cl.get_api_orders(43, 1741294800000, 1749157199999)
|
|
1234
|
+
|
|
1235
|
+
races = await models.Race.filter(started=True).prefetch_related(
|
|
1236
|
+
"road__ad__pair_side__pair__cur",
|
|
1237
|
+
"road__ad__pms",
|
|
1238
|
+
)
|
|
1239
|
+
tasks = [asyncio.create_task(cl.racing(race), name=f"Rc{race.id}") for race in races]
|
|
1240
|
+
# await cl.actual_cond()
|
|
1241
|
+
try:
|
|
1241
1242
|
await gather(
|
|
1242
1243
|
*tasks
|
|
1243
1244
|
# cl.get_api_orders(), # 10, 1738357200000, 1742504399999
|
|
1244
|
-
# cl.racing(usdt, rub, False, ["volet"], 83.88), # гонка в стакане покупки - мы продаем
|
|
1245
|
-
# cl.racing(usdt, rub, True, ["volet"], 81.51), # гонка в стакане продажи - мы покупаем
|
|
1246
|
-
# cl.racing(usdt, rub, False, ["payeer"], 81.49), # гонка в стакане покупки - мы продаем
|
|
1247
|
-
# cl.racing(usdt, rub, True, ["payeer"], 80.7), # гонка в стакане продажи - мы покупаем
|
|
1248
|
-
# cl.racing(eth, rub, False, ["volet"], 300_000),
|
|
1249
|
-
# cl.racing(eth, rub, True, ["volet"], 296_000),
|
|
1250
|
-
# cl.racing(eth, rub, False, ["payeer"], 300_000),
|
|
1251
|
-
# cl.racing(eth, rub, True, ["payeer"], 296_000),
|
|
1252
|
-
# cl.racing(btc, rub, False, ["volet"], 9_800_000),
|
|
1253
|
-
# cl.racing(btc, rub, True, ["volet"], 9_700_000),
|
|
1254
|
-
# cl.racing(btc, rub, False, ["payeer"], 9_800_000),
|
|
1255
|
-
# cl.racing(btc, rub, True, ["payeer"], 9_700_000),
|
|
1256
|
-
# cl.racing(usdc, rub, False, ["volet"], 80.98),
|
|
1257
|
-
# cl.racing(usdc, rub, True, ["volet"], 80.01),
|
|
1258
|
-
# cl.racing(usdc, rub, False, ["payeer"], 80.98),
|
|
1259
|
-
# cl.racing(usdc, rub, True, ["payeer"], 80.01),
|
|
1260
|
-
# cl.parse_ads(usdt, rub, False, ceil=81, volume=360),
|
|
1261
|
-
# cl.parse_ads(usdt, rub, True, ceil=80, volume=360),
|
|
1262
1245
|
)
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1246
|
+
except Exception as e:
|
|
1247
|
+
await filebot.send("🤬Bybit agent CRASHED!!!🤬", actor.person.user.username_id)
|
|
1248
|
+
await filebot.send(e.__repr__(), actor.person.user.username_id)
|
|
1249
|
+
raise e
|
|
1250
|
+
# bor = BaseOrderReq(
|
|
1251
|
+
# ad_id="1861440060199632896",
|
|
1252
|
+
# # asset_amount=40,
|
|
1253
|
+
# fiat_amount=3000,
|
|
1254
|
+
# amount_is_fiat=True,
|
|
1255
|
+
# is_sell=False,
|
|
1256
|
+
# cur_exid=rub.exid,
|
|
1257
|
+
# coin_exid=usdt.exid,
|
|
1258
|
+
# coin_scale=usdt.coin.scale,
|
|
1259
|
+
# )
|
|
1260
|
+
# res: OrderResp = await cl.order_request(bor)
|
|
1261
|
+
# await cl.cancel_order(res.orderId)
|
|
1262
|
+
await filebot.stop()
|
|
1263
|
+
await cl.close()
|
|
1277
1264
|
|
|
1278
1265
|
|
|
1279
1266
|
if __name__ == "__main__":
|
|
@@ -82,7 +82,7 @@ class Client(PmAgentClient):
|
|
|
82
82
|
await page.click(f".history-id-{trans_num} a.link")
|
|
83
83
|
sleep(1)
|
|
84
84
|
receipt = await page.query_selector(".ui-dialog.ui-corner-all")
|
|
85
|
-
return trans_num, await receipt.screenshot(path=f"tmp/{
|
|
85
|
+
return trans_num, await receipt.screenshot(path=f"tmp/{trans_num}.png"), int(has_amount - amount)
|
|
86
86
|
else:
|
|
87
87
|
await self.bot.send("Payeer хз", self.uid, photo=await self.page.screenshot())
|
|
88
88
|
return -1
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from xync_client.loader import TORM
|
|
3
|
+
from x_model import init_db
|
|
4
|
+
from xync_schema import models
|
|
5
|
+
import re
|
|
6
|
+
from typing import List, Dict
|
|
7
|
+
|
|
8
|
+
phrases = ["дай(те)?", "номер", "рек(и|визиты)", "карту", "банк(и|а)?", "куда", "(на )?как(ой|ую)", "актуал"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
async def request_for_details(phrases_to_find) -> List[Dict[str, str]]:
|
|
12
|
+
_ = await init_db(TORM, True)
|
|
13
|
+
msgs = await models.Msg.all().values("txt")
|
|
14
|
+
patterns = [re.compile(rf"\b{phrase}\b", re.IGNORECASE) for phrase in phrases_to_find]
|
|
15
|
+
results = []
|
|
16
|
+
for msg in msgs:
|
|
17
|
+
if not msg["txt"]:
|
|
18
|
+
continue
|
|
19
|
+
for pattern in patterns:
|
|
20
|
+
if pattern.search(msg["txt"]):
|
|
21
|
+
results.append({pattern.pattern: msg["txt"]})
|
|
22
|
+
|
|
23
|
+
return results
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
if __name__ == "__main__":
|
|
27
|
+
asyncio.run(request_for_details(phrases))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xync-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.130
|
|
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
|
|
@@ -14,7 +14,7 @@ Requires-Dist: python-binance
|
|
|
14
14
|
Requires-Dist: pybit
|
|
15
15
|
Requires-Dist: pyotp
|
|
16
16
|
Requires-Dist: pypng
|
|
17
|
-
Requires-Dist: kurigram
|
|
17
|
+
Requires-Dist: kurigram
|
|
18
18
|
Requires-Dist: payeer-api
|
|
19
19
|
Requires-Dist: playwright
|
|
20
20
|
Requires-Dist: python-dotenv
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|