xync-client 0.0.127__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.127/xync_client.egg-info → xync_client-0.0.130}/PKG-INFO +2 -2
- {xync_client-0.0.127 → xync_client-0.0.130}/pyproject.toml +1 -1
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/InAgent.py +53 -12
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/agent.py +82 -93
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/etype/order.py +1 -1
- {xync_client-0.0.127 → 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.127 → xync_client-0.0.130/xync_client.egg-info}/PKG-INFO +2 -2
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client.egg-info/SOURCES.txt +1 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client.egg-info/requires.txt +1 -1
- {xync_client-0.0.127 → xync_client-0.0.130}/.env.sample +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/.gitignore +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/README.md +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/makefile +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/setup.cfg +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/TestAgent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/TestAsset.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/TestEx.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/TestOrder.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/Exception.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/PmAgent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Abc/xtype.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/BitPapa/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/order.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Gmail/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/KuCoin/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Mexc/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/MTS/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Ozon/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Payeer/.gitignore +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Payeer/api.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Payeer/login.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Sber/utils.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Volet/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Xync/__main__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Xync/ed.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/Pms/Yandex/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/ex.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/__init__.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/loader.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.127 → xync_client-0.0.130}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.127 → 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,10 +5,11 @@ 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
|
|
12
|
+
from pydantic import ValidationError
|
|
12
13
|
from pyro_client.client.file import FileClient
|
|
13
14
|
from tortoise.transactions import in_transaction
|
|
14
15
|
|
|
@@ -78,7 +79,10 @@ class InAgentClient(BaseInAgentClient):
|
|
|
78
79
|
case "OTC_ORDER_STATUS":
|
|
79
80
|
match data["type"]:
|
|
80
81
|
case "STATUS_CHANGE":
|
|
81
|
-
|
|
82
|
+
try:
|
|
83
|
+
upd = StatusChange.model_validate(data["data"])
|
|
84
|
+
except ValidationError as e:
|
|
85
|
+
logging.error(e)
|
|
82
86
|
order = self.agent_client.api.get_order_details(orderId=upd.id)
|
|
83
87
|
order = OrderFull.model_validate(order["result"])
|
|
84
88
|
order_db = await models.Order.get_or_none(
|
|
@@ -114,12 +118,32 @@ class InAgentClient(BaseInAgentClient):
|
|
|
114
118
|
dict(
|
|
115
119
|
amount=int(float(order.amount) * 100),
|
|
116
120
|
accepted_at=datetime.now(timezone.utc),
|
|
121
|
+
order=order_db,
|
|
117
122
|
),
|
|
118
|
-
order=order_db,
|
|
119
123
|
# pm_id=order_db.cred.pmcur.pm_id,
|
|
120
124
|
pmid=tid,
|
|
121
125
|
)
|
|
122
|
-
|
|
126
|
+
|
|
127
|
+
if not is_new: # если по этому платежу уже отпущен другая продажа
|
|
128
|
+
continue
|
|
129
|
+
|
|
130
|
+
# если висят незавершенные продажи с такой же суммой
|
|
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!")
|
|
123
147
|
continue
|
|
124
148
|
|
|
125
149
|
# !!! ОТПРАВЛЯЕМ ДЕНЬГИ !!!
|
|
@@ -195,8 +219,8 @@ class InAgentClient(BaseInAgentClient):
|
|
|
195
219
|
msg, _ = await models.Msg.update_or_create(
|
|
196
220
|
{
|
|
197
221
|
"to_maker": upd.userId == self.agent_client.actor.exid and im_taker,
|
|
222
|
+
"sent_at": datetime.fromtimestamp(float(upd.createDate) / 1000),
|
|
198
223
|
},
|
|
199
|
-
sent_at=datetime.fromtimestamp(float(upd.createDate) / 1000),
|
|
200
224
|
txt=upd.message,
|
|
201
225
|
order=order_db,
|
|
202
226
|
)
|
|
@@ -292,7 +316,10 @@ class InAgentClient(BaseInAgentClient):
|
|
|
292
316
|
)
|
|
293
317
|
# проверяем не отправляли ли мы уже перевод по этому ордеру
|
|
294
318
|
if t := await models.Transfer.get_or_none(order=order_db, amount=order_db.amount):
|
|
295
|
-
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
|
+
)
|
|
296
323
|
raise Exception(f"Order# {order_db.exid}: Double send {fmt_am}{cur} to {dest} #{t.pmid}!")
|
|
297
324
|
|
|
298
325
|
# ставим в бд статус "оплачен"
|
|
@@ -307,12 +334,22 @@ class InAgentClient(BaseInAgentClient):
|
|
|
307
334
|
order=order_db,
|
|
308
335
|
pmid=tid,
|
|
309
336
|
)
|
|
310
|
-
# отправляем продавцу чек
|
|
311
|
-
|
|
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)
|
|
312
344
|
self.agent_client.api.send_chat_message(
|
|
313
|
-
orderId=
|
|
345
|
+
orderId=oexid, contentType="pic", message=res["url"], msgUuid=uuid4().hex
|
|
314
346
|
)
|
|
315
|
-
|
|
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
|
+
)
|
|
316
353
|
|
|
317
354
|
async def get_pma_by_cdex(self, order: OrderFull) -> tuple[PmAgentClient | None, models.CredEx] | None:
|
|
318
355
|
cdxs = await models.CredEx.filter(
|
|
@@ -360,13 +397,17 @@ async def main():
|
|
|
360
397
|
)
|
|
361
398
|
|
|
362
399
|
async with FileClient(TOKEN) as b:
|
|
400
|
+
b: FileClient
|
|
363
401
|
cl: InAgentClient = actor.in_client(b)
|
|
364
402
|
# await cl.agent_client.export_my_ads()
|
|
365
403
|
payeer_cl = Client(actor.person.user.username_id)
|
|
366
404
|
for pma in actor.person.user.pm_agents:
|
|
367
405
|
cl.pmacs[pma.pm_id] = await payeer_cl.start(await async_playwright().start(), False)
|
|
368
|
-
|
|
369
|
-
|
|
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)
|
|
370
411
|
await cl.agent_client.close()
|
|
371
412
|
|
|
372
413
|
|
|
@@ -393,8 +393,10 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
393
393
|
},
|
|
394
394
|
)
|
|
395
395
|
|
|
396
|
-
def get_orders_active(
|
|
397
|
-
|
|
396
|
+
async def get_orders_active(
|
|
397
|
+
self, side: int = None, status: int = None, begin_time: int = None, end_time: int = None, token_id: str = None
|
|
398
|
+
):
|
|
399
|
+
return await self._post(
|
|
398
400
|
"/fiat/otc/order/pending/simplifyList",
|
|
399
401
|
{
|
|
400
402
|
"status": status,
|
|
@@ -664,7 +666,12 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
664
666
|
volume = asset.free * 10**-coinex.scale
|
|
665
667
|
volume = str(round(volume, coinex.scale))
|
|
666
668
|
|
|
667
|
-
|
|
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
|
+
|
|
668
675
|
if race.vm_filter:
|
|
669
676
|
ads = [ad for ad in ads if "VA" in ad.authTag]
|
|
670
677
|
self.overprice_filter(ads, race.ceil * 10**-curex.scale, k) # обрезаем сверху все ads дороже нашего потолка
|
|
@@ -755,12 +762,7 @@ class AgentClient(BaseAgentClient): # Bybit client
|
|
|
755
762
|
raise e
|
|
756
763
|
elif ExcCode(e.status_code) == ExcCode.InsufficientBalance:
|
|
757
764
|
asset = await models.Asset.get(addr__actor=self.actor, addr__coin_id=coinex.coin_id)
|
|
758
|
-
req.quantity = str(
|
|
759
|
-
round(
|
|
760
|
-
asset.free * 10**-coinex.scale,
|
|
761
|
-
coinex.coin.scale or coinex.scale,
|
|
762
|
-
)
|
|
763
|
-
)
|
|
765
|
+
req.quantity = str(round(asset.free * 10**-coinex.scale, coinex.scale))
|
|
764
766
|
_res = self.ad_upd(req)
|
|
765
767
|
elif ExcCode(e.status_code) == ExcCode.RareLimit:
|
|
766
768
|
sad = [
|
|
@@ -1184,94 +1186,81 @@ async def main():
|
|
|
1184
1186
|
actor = (
|
|
1185
1187
|
await models.Actor.filter(ex_id=4, agent__isnull=False).prefetch_related("ex", "agent", "person__user").first()
|
|
1186
1188
|
)
|
|
1187
|
-
|
|
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
|
-
|
|
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:
|
|
1239
1242
|
await gather(
|
|
1240
1243
|
*tasks
|
|
1241
1244
|
# cl.get_api_orders(), # 10, 1738357200000, 1742504399999
|
|
1242
|
-
# cl.racing(usdt, rub, False, ["volet"], 83.88), # гонка в стакане покупки - мы продаем
|
|
1243
|
-
# cl.racing(usdt, rub, True, ["volet"], 81.51), # гонка в стакане продажи - мы покупаем
|
|
1244
|
-
# cl.racing(usdt, rub, False, ["payeer"], 81.49), # гонка в стакане покупки - мы продаем
|
|
1245
|
-
# cl.racing(usdt, rub, True, ["payeer"], 80.7), # гонка в стакане продажи - мы покупаем
|
|
1246
|
-
# cl.racing(eth, rub, False, ["volet"], 300_000),
|
|
1247
|
-
# cl.racing(eth, rub, True, ["volet"], 296_000),
|
|
1248
|
-
# cl.racing(eth, rub, False, ["payeer"], 300_000),
|
|
1249
|
-
# cl.racing(eth, rub, True, ["payeer"], 296_000),
|
|
1250
|
-
# cl.racing(btc, rub, False, ["volet"], 9_800_000),
|
|
1251
|
-
# cl.racing(btc, rub, True, ["volet"], 9_700_000),
|
|
1252
|
-
# cl.racing(btc, rub, False, ["payeer"], 9_800_000),
|
|
1253
|
-
# cl.racing(btc, rub, True, ["payeer"], 9_700_000),
|
|
1254
|
-
# cl.racing(usdc, rub, False, ["volet"], 80.98),
|
|
1255
|
-
# cl.racing(usdc, rub, True, ["volet"], 80.01),
|
|
1256
|
-
# cl.racing(usdc, rub, False, ["payeer"], 80.98),
|
|
1257
|
-
# cl.racing(usdc, rub, True, ["payeer"], 80.01),
|
|
1258
|
-
# cl.parse_ads(usdt, rub, False, ceil=81, volume=360),
|
|
1259
|
-
# cl.parse_ads(usdt, rub, True, ceil=80, volume=360),
|
|
1260
1245
|
)
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
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()
|
|
1275
1264
|
|
|
1276
1265
|
|
|
1277
1266
|
if __name__ == "__main__":
|
|
@@ -297,11 +297,11 @@ class _BaseChange(BaseModel):
|
|
|
297
297
|
userId: int
|
|
298
298
|
makerUserId: int
|
|
299
299
|
id: str
|
|
300
|
-
status: StatusApi
|
|
301
300
|
createDate: int
|
|
302
301
|
side: int
|
|
303
302
|
appealedTimes: int
|
|
304
303
|
totalAppealedTimes: int
|
|
304
|
+
status: StatusApi = None
|
|
305
305
|
|
|
306
306
|
|
|
307
307
|
class StatusChange(_BaseChange):
|
|
@@ -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
|