xync-client 0.0.108__tar.gz → 0.0.111__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.108/xync_client.egg-info → xync_client-0.0.111}/PKG-INFO +2 -1
- {xync_client-0.0.108 → xync_client-0.0.111}/pyproject.toml +1 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/InAgent.py +9 -9
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Payeer/__init__.py +32 -49
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Payeer/login.py +9 -24
- {xync_client-0.0.108 → xync_client-0.0.111/xync_client.egg-info}/PKG-INFO +2 -1
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client.egg-info/requires.txt +1 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/.env.sample +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/.gitignore +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/README.md +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/makefile +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/setup.cfg +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/TestAgent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/TestAsset.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/TestEx.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/TestOrder.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/Exception.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/PmAgent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Abc/xtype.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/BitPapa/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/etype/order.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/order.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Gmail/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/KuCoin/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Mexc/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/MTS/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Ozon/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Payeer/.gitignore +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Payeer/api.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Sber/utils.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Volet/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Xync/__main__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Xync/ed.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/Pms/Yandex/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/ex.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/__init__.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/loader.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client.egg-info/SOURCES.txt +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.108 → xync_client-0.0.111}/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.111
|
|
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,6 +14,7 @@ Requires-Dist: python-binance
|
|
|
14
14
|
Requires-Dist: pybit
|
|
15
15
|
Requires-Dist: pyotp
|
|
16
16
|
Requires-Dist: kurigram
|
|
17
|
+
Requires-Dist: playwright
|
|
17
18
|
Requires-Dist: python-dotenv
|
|
18
19
|
Requires-Dist: python-okx
|
|
19
20
|
Requires-Dist: pyrogram-client
|
|
@@ -126,7 +126,7 @@ class InAgentClient(BaseInAgentClient):
|
|
|
126
126
|
addr__coin_id=order_db.ad.pair_side.pair.coin_id,
|
|
127
127
|
addr__actor=self.agent_client.actor,
|
|
128
128
|
)
|
|
129
|
-
ass.free -=
|
|
129
|
+
ass.free -= int(order_db.amount / order_db.ad.price)
|
|
130
130
|
await ass.save(update_fields=["free"])
|
|
131
131
|
# обновляем остаток валюты
|
|
132
132
|
fiat = await models.Fiat.get(cred_id=order_db.cred_id)
|
|
@@ -247,7 +247,7 @@ class InAgentClient(BaseInAgentClient):
|
|
|
247
247
|
async def send_payment(self, order_db: models.Order, dest):
|
|
248
248
|
if order_db.status not in (OrderStatus.created, OrderStatus.requested):
|
|
249
249
|
return
|
|
250
|
-
|
|
250
|
+
fmt_am = round(order_db.amount * 10**-2, 2)
|
|
251
251
|
pma, cur = await self.get_pma_by_pmex(order_db)
|
|
252
252
|
async with in_transaction():
|
|
253
253
|
# отмечаем ордер на бирже "оплачен"
|
|
@@ -259,9 +259,9 @@ class InAgentClient(BaseInAgentClient):
|
|
|
259
259
|
paymentId=str(credex.exid), # credex.exid
|
|
260
260
|
)
|
|
261
261
|
# проверяем не отправляли ли мы уже перевод по этому ордеру
|
|
262
|
-
if t := await models.Transfer.get_or_none(order=order_db, amount=
|
|
263
|
-
await pma.bot.send(f"Order# {order_db.exid}: Double send {
|
|
264
|
-
raise Exception(f"Order# {order_db.exid}: Double send {
|
|
262
|
+
if t := await models.Transfer.get_or_none(order=order_db, amount=order_db.amount):
|
|
263
|
+
await pma.bot.send(f"Order# {order_db.exid}: Double send {fmt_am}{cur} to {dest} #{t.pmid}!")
|
|
264
|
+
raise Exception(f"Order# {order_db.exid}: Double send {fmt_am}{cur} to {dest} #{t.pmid}!")
|
|
265
265
|
|
|
266
266
|
# ставим в бд статус "оплачен"
|
|
267
267
|
order_db.status = OrderStatus.paid
|
|
@@ -271,13 +271,13 @@ class InAgentClient(BaseInAgentClient):
|
|
|
271
271
|
ass = await models.Asset.get(
|
|
272
272
|
addr__coin_id=order_db.ad.pair_side.pair.coin_id, addr__actor=self.agent_client.actor
|
|
273
273
|
)
|
|
274
|
-
ass.free +=
|
|
274
|
+
ass.free += int(order_db.amount / order_db.ad.price)
|
|
275
275
|
await ass.save(update_fields=["free"])
|
|
276
276
|
# отправляем деньги
|
|
277
|
-
tid, img, rest_amount = await pma.send(dest=dest, amount=
|
|
277
|
+
tid, img, rest_amount = await pma.send(dest=dest, amount=fmt_am, cur=cur)
|
|
278
278
|
# создаем перевод в бд
|
|
279
279
|
t, _ = await models.Transfer.update_or_create(
|
|
280
|
-
{"amount":
|
|
280
|
+
{"amount": order_db.amount},
|
|
281
281
|
order=order_db,
|
|
282
282
|
pmid=tid,
|
|
283
283
|
)
|
|
@@ -288,7 +288,7 @@ class InAgentClient(BaseInAgentClient):
|
|
|
288
288
|
self.agent_client.api.send_chat_message(
|
|
289
289
|
orderId=str(order_db.exid), contentType="pic", message=res["url"], msgUuid=uuid4().hex
|
|
290
290
|
)
|
|
291
|
-
logging.info(f"Order {order_db.exid} PAID at {datetime.now()}: {
|
|
291
|
+
logging.info(f"Order {order_db.exid} PAID at {datetime.now()}: {fmt_am}!")
|
|
292
292
|
|
|
293
293
|
async def get_pma_by_cdex(self, order: OrderFull) -> tuple[PmAgentClient | None, CredEx] | None:
|
|
294
294
|
cdxs = await models.CredEx.filter(
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
from asyncio import run
|
|
3
2
|
from datetime import datetime
|
|
4
3
|
from decimal import Decimal
|
|
@@ -8,7 +7,7 @@ from time import sleep
|
|
|
8
7
|
|
|
9
8
|
from asyncpg.pgproto.pgproto import timedelta
|
|
10
9
|
from payeer_api import PayeerAPI
|
|
11
|
-
from playwright.async_api import async_playwright, Playwright
|
|
10
|
+
from playwright.async_api import async_playwright, Playwright
|
|
12
11
|
from playwright._impl._errors import TimeoutError
|
|
13
12
|
|
|
14
13
|
from xync_client.loader import TORM
|
|
@@ -39,49 +38,58 @@ class Client(PmAgentClient):
|
|
|
39
38
|
await self.page.context.add_cookies([cookie])
|
|
40
39
|
await self.page.goto(self.pages.SEND)
|
|
41
40
|
|
|
42
|
-
async def send(self, dest: str, amount: int, cur: str) -> tuple[int, bytes
|
|
43
|
-
self.last_active = datetime.now()
|
|
41
|
+
async def send(self, dest: str, amount: int, cur: str) -> tuple[int, bytes] | int:
|
|
44
42
|
page = self.page
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
if not page.url.startswith(self.pages.SEND):
|
|
44
|
+
try:
|
|
45
|
+
await page.goto(self.pages.SEND)
|
|
46
|
+
except TimeoutError:
|
|
47
|
+
await login(self.agent)
|
|
48
|
+
for cookie in self.agent.state["cookies"]:
|
|
49
|
+
await page.context.add_cookies([cookie])
|
|
50
|
+
await page.goto("https://payeer.com/en/account/send/")
|
|
52
51
|
fiat_accounts = await page.locator(
|
|
53
52
|
f".balance-item.balance-item--green.balance-item--{cur.lower()}"
|
|
54
53
|
).all_text_contents()
|
|
55
|
-
|
|
56
|
-
if float(amount) <= has_amount:
|
|
54
|
+
if float(amount) <= float(fiat_accounts[0].replace(",", "").strip()):
|
|
57
55
|
await page.locator('input[name="param_ACCOUNT_NUMBER"]').fill(dest)
|
|
58
56
|
await page.locator("select[name=curr_receive]").select_option(value=cur)
|
|
59
|
-
|
|
60
|
-
await page.
|
|
61
|
-
|
|
57
|
+
sleep(0.9)
|
|
58
|
+
await page.locator('input[name="sum_receive"]').fill(str(amount))
|
|
59
|
+
sleep(0.1)
|
|
60
|
+
# await page.locator("div.n-form--title").first.click()
|
|
61
|
+
# sleep(0.1)
|
|
62
|
+
await page.click(".btn.n-form--btn.n-form--btn-mod")
|
|
63
|
+
sleep(0.5)
|
|
64
|
+
await page.click(".btn.n-form--btn.n-form--btn-mod")
|
|
65
|
+
sleep(1.2)
|
|
66
|
+
if await page.locator(".input4").count():
|
|
67
|
+
await page.locator(".input4").fill(self.agent.auth.get("master_key"))
|
|
68
|
+
await page.click(".ok.button_green2")
|
|
69
|
+
sleep(0.1)
|
|
62
70
|
await page.locator(".note_txt").wait_for(state="visible")
|
|
63
71
|
if await page.locator('.note_txt:has-text("successfully completed")').count():
|
|
64
72
|
transaction = await page.locator(".note_txt").all_text_contents()
|
|
65
73
|
trans_num = int(transaction[0].replace("Transaction #", "").split()[0])
|
|
66
74
|
await page.goto("https://payeer.com/ru/account/history/")
|
|
67
75
|
await page.click(f".history-id-{trans_num} a.link")
|
|
68
|
-
|
|
76
|
+
sleep(1)
|
|
69
77
|
receipt = await page.query_selector(".ui-dialog.ui-corner-all")
|
|
70
|
-
return trans_num, await receipt.screenshot(path=f"tmp/{dest}.png")
|
|
78
|
+
return trans_num, await receipt.screenshot(path=f"tmp/{dest}.png")
|
|
71
79
|
else:
|
|
72
80
|
await self.bot.send("Payeer хз", self.uid, photo=await self.page.screenshot())
|
|
73
|
-
|
|
81
|
+
return -1
|
|
74
82
|
else:
|
|
75
|
-
have_amount =
|
|
83
|
+
have_amount = int(fiat_accounts[0].strip())
|
|
76
84
|
await self.bot.send(
|
|
77
85
|
f"Payeer no have {amount}, only {have_amount}{cur} to {dest}",
|
|
78
86
|
self.uid,
|
|
79
87
|
photo=await self.page.screenshot(),
|
|
80
88
|
)
|
|
81
|
-
|
|
89
|
+
return have_amount
|
|
82
90
|
|
|
83
91
|
def check_in(
|
|
84
|
-
self, amount: Decimal | int | float, cur: str,
|
|
92
|
+
self, amount: Decimal | int | float, cur: str, tme: datetime = None, tid: str | int = None
|
|
85
93
|
) -> tuple[Decimal | None, int | None]:
|
|
86
94
|
history = self.api.history(type="incoming", append=tid, count=3)
|
|
87
95
|
if tid:
|
|
@@ -92,7 +100,7 @@ class Client(PmAgentClient):
|
|
|
92
100
|
if (
|
|
93
101
|
amount <= Decimal(h["creditedAmount"]) <= ceil(amount)
|
|
94
102
|
and h["creditedCurrency"] == cur
|
|
95
|
-
and datetime.fromisoformat(h["date"]) >
|
|
103
|
+
and datetime.fromisoformat(h["date"]) > tme - timedelta(minutes=1)
|
|
96
104
|
)
|
|
97
105
|
]
|
|
98
106
|
if not (t := t and t[0]):
|
|
@@ -104,31 +112,6 @@ class Client(PmAgentClient):
|
|
|
104
112
|
async def proof(self) -> bytes: ...
|
|
105
113
|
|
|
106
114
|
|
|
107
|
-
async def fill_amount(loc: Locator, amount: str):
|
|
108
|
-
await loc.wait_for(state="visible")
|
|
109
|
-
await loc.fill(amount)
|
|
110
|
-
sleep(1)
|
|
111
|
-
if await loc.input_value() != amount or await loc.input_value() != amount:
|
|
112
|
-
logging.warning("Fill amount repeated!")
|
|
113
|
-
await fill_amount(loc, amount)
|
|
114
|
-
else:
|
|
115
|
-
...
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
async def click_send(loc: Locator, count: int = 1):
|
|
119
|
-
if await loc.is_visible():
|
|
120
|
-
sleep(1)
|
|
121
|
-
await loc.click(delay=90)
|
|
122
|
-
try:
|
|
123
|
-
await loc.wait_for(state="hidden", timeout=2000 * count)
|
|
124
|
-
except TimeoutError:
|
|
125
|
-
if count < 4:
|
|
126
|
-
logging.warning("Click repeated!")
|
|
127
|
-
await click_send(loc, count + 1)
|
|
128
|
-
else:
|
|
129
|
-
raise TimeoutError
|
|
130
|
-
|
|
131
|
-
|
|
132
115
|
async def main(uid: int):
|
|
133
116
|
from x_model import init_db
|
|
134
117
|
|
|
@@ -136,7 +119,7 @@ async def main(uid: int):
|
|
|
136
119
|
playwright: Playwright = await async_playwright().start()
|
|
137
120
|
pyr = Client(uid)
|
|
138
121
|
try:
|
|
139
|
-
await pyr.start(playwright)
|
|
122
|
+
await pyr.start(playwright, True)
|
|
140
123
|
|
|
141
124
|
dest, amount, cur = "P79619335", 2, "RUB"
|
|
142
125
|
|
|
@@ -1,51 +1,36 @@
|
|
|
1
|
-
from time import sleep
|
|
2
|
-
|
|
3
1
|
from selenium.webdriver.common.by import By
|
|
4
2
|
import undetected_chromedriver as uc
|
|
5
3
|
from xync_schema.models import PmAgent
|
|
6
4
|
from selenium.webdriver.support.ui import WebDriverWait
|
|
7
5
|
from selenium.webdriver.support import expected_conditions as EC
|
|
8
6
|
from selenium.webdriver.common.action_chains import ActionChains
|
|
7
|
+
import time
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
async def login(agent: PmAgent):
|
|
12
|
-
driver = uc.Chrome(no_sandbox=True, headless=
|
|
11
|
+
driver = uc.Chrome(no_sandbox=True, headless=False)
|
|
13
12
|
wait = WebDriverWait(driver, timeout=10)
|
|
14
13
|
try:
|
|
15
|
-
driver.get("https://payeer.com/
|
|
14
|
+
driver.get("https://payeer.com/en/auth")
|
|
16
15
|
wait.until(EC.invisibility_of_element_located((By.TAG_NAME, "lottie-player")))
|
|
17
16
|
login_link = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "button.button_empty")))
|
|
18
|
-
|
|
19
|
-
login_link.click()
|
|
20
|
-
except Exception:
|
|
21
|
-
driver.execute_script("arguments[0].click();", login_link)
|
|
17
|
+
login_link.click()
|
|
22
18
|
email_field = wait.until(EC.presence_of_element_located((By.NAME, "email")))
|
|
23
19
|
email_field.send_keys(agent.auth.get("email"))
|
|
24
20
|
password_field = wait.until(EC.presence_of_element_located((By.NAME, "password")))
|
|
25
21
|
password_field.send_keys(agent.auth.get("password"))
|
|
26
22
|
login_button = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "login-form__login-btn.step1")))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
driver.execute_script("arguments[0].click();", login_button)
|
|
32
|
-
try:
|
|
33
|
-
login_button = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "login-form__login-btn.step1")))
|
|
34
|
-
driver.execute_script("arguments[0].click();", login_button)
|
|
35
|
-
except Exception:
|
|
36
|
-
pass
|
|
23
|
+
login_button.click()
|
|
24
|
+
time.sleep(5)
|
|
25
|
+
login_button.click()
|
|
26
|
+
time.sleep(1)
|
|
37
27
|
if (v := driver.find_elements(By.CLASS_NAME, "form-input-top")) and v[0].text == "Введите проверочный код":
|
|
38
28
|
code = input("Email code: ")
|
|
39
29
|
actions = ActionChains(driver)
|
|
40
30
|
for char in code:
|
|
41
31
|
actions.send_keys(char).perform()
|
|
42
32
|
step2_button = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "login-form__login-btn.step2")))
|
|
43
|
-
|
|
44
|
-
step2_button.click()
|
|
45
|
-
except Exception:
|
|
46
|
-
driver.execute_script("arguments[0].click();", step2_button)
|
|
47
|
-
|
|
48
|
-
sleep(1)
|
|
33
|
+
step2_button.click()
|
|
49
34
|
agent.state = {"cookies": driver.get_cookies()}
|
|
50
35
|
await agent.save()
|
|
51
36
|
finally:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xync-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.111
|
|
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,6 +14,7 @@ Requires-Dist: python-binance
|
|
|
14
14
|
Requires-Dist: pybit
|
|
15
15
|
Requires-Dist: pyotp
|
|
16
16
|
Requires-Dist: kurigram
|
|
17
|
+
Requires-Dist: playwright
|
|
17
18
|
Requires-Dist: python-dotenv
|
|
18
19
|
Requires-Dist: python-okx
|
|
19
20
|
Requires-Dist: pyrogram-client
|
|
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
|
|
File without changes
|