xync-client 0.0.139__tar.gz → 0.0.142__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.139/xync_client.egg-info → xync_client-0.0.142}/PKG-INFO +1 -1
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/PmAgent.py +11 -10
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BitGet/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/InAgent.py +6 -6
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/agent.py +6 -6
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Gate/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Gmail/__init__.py +5 -5
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/KuCoin/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Mexc/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Okx/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Volet/__init__.py +32 -50
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/ex.py +2 -2
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/loader.py +1 -1
- {xync_client-0.0.139 → xync_client-0.0.142/xync_client.egg-info}/PKG-INFO +1 -1
- {xync_client-0.0.139 → xync_client-0.0.142}/.env.sample +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/.gitignore +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/README.md +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/makefile +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/pyproject.toml +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/setup.cfg +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/TestAgent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/TestAsset.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/TestEx.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/TestOrder.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/Exception.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Abc/xtype.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/BitPapa/ex.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/etype/order.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/order.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/MTS/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Ozon/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Payeer/.gitignore +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Payeer/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Payeer/api.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Payeer/login.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Sber/utils.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Xync/__main__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Xync/ed.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/Pms/Yandex/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/__init__.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/details.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client.egg-info/SOURCES.txt +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client.egg-info/requires.txt +0 -0
- {xync_client-0.0.139 → xync_client-0.0.142}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -6,7 +6,9 @@ from enum import StrEnum
|
|
|
6
6
|
|
|
7
7
|
from playwright.async_api import Page, Playwright
|
|
8
8
|
from pyro_client.client.file import FileClient
|
|
9
|
-
from
|
|
9
|
+
from pyro_client.client.user import UserClient
|
|
10
|
+
|
|
11
|
+
from xync_client.loader import NET_TOKEN
|
|
10
12
|
from xync_schema.enums import UserStatus
|
|
11
13
|
from xync_schema.models import PmAgent, User
|
|
12
14
|
|
|
@@ -22,24 +24,22 @@ class PmAgentClient(metaclass=ABCMeta):
|
|
|
22
24
|
OTP_LOGIN = base + "login/otp"
|
|
23
25
|
|
|
24
26
|
norm: str
|
|
25
|
-
uid: int
|
|
26
27
|
agent: PmAgent
|
|
27
|
-
bot: FileClient
|
|
28
|
+
bot: FileClient | UserClient
|
|
28
29
|
page: Page
|
|
29
30
|
pages: type(StrEnum) = Pages
|
|
30
31
|
last_page: int = 0
|
|
31
32
|
last_active: datetime = datetime.now()
|
|
32
33
|
_is_started: bool = False
|
|
33
34
|
|
|
34
|
-
async def start(self, pw: Playwright, headed: bool = False) -> "PmAgentClient":
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
dct.update({"user__username_id": self.uid})
|
|
38
|
-
|
|
39
|
-
self.bot = FileClient(TOKEN)
|
|
35
|
+
async def start(self, pw: Playwright, headed: bool = False, userbot: bool = False) -> "PmAgentClient":
|
|
36
|
+
bot = FileClient(NET_TOKEN)
|
|
37
|
+
self.bot = UserClient(self.uid, bot) if userbot else bot
|
|
40
38
|
await self.bot.start()
|
|
41
39
|
|
|
42
|
-
self.browser = await pw.chromium.launch(
|
|
40
|
+
self.browser = await pw.chromium.launch(
|
|
41
|
+
channel="chromium" if headed else "chromium-headless-shell", headless=not headed
|
|
42
|
+
)
|
|
43
43
|
context = await self.browser.new_context(storage_state=self.agent.state)
|
|
44
44
|
self.page = await context.new_page()
|
|
45
45
|
await self.page.goto(self.pages.SEND) # Оптимистично переходим сразу на страницу отправки
|
|
@@ -90,3 +90,4 @@ class PmAgentClient(metaclass=ABCMeta):
|
|
|
90
90
|
def __init__(self, agent: PmAgent):
|
|
91
91
|
self.agent = agent
|
|
92
92
|
self.uid = agent.user.username_id
|
|
93
|
+
self.norm = agent.pm.norm
|
|
@@ -6,7 +6,7 @@ from x_model import init_db
|
|
|
6
6
|
from xync_client.Abc.Ex import BaseExClient
|
|
7
7
|
from xync_client.Binance.etype import pm, ad
|
|
8
8
|
from xync_client.Abc.xtype import PmEx, MapOfIdsList
|
|
9
|
-
from xync_client.loader import
|
|
9
|
+
from xync_client.loader import NET_TOKEN, TORM
|
|
10
10
|
|
|
11
11
|
from xync_schema.models import Ex
|
|
12
12
|
from xync_schema import xtype
|
|
@@ -139,7 +139,7 @@ class ExClient(BaseExClient):
|
|
|
139
139
|
async def main():
|
|
140
140
|
_ = await init_db(TORM)
|
|
141
141
|
ex = await Ex.get(name="Binance")
|
|
142
|
-
async with FileClient(
|
|
142
|
+
async with FileClient(NET_TOKEN) as b:
|
|
143
143
|
cl = ExClient(ex, b)
|
|
144
144
|
await cl.set_pms()
|
|
145
145
|
await cl.set_coins()
|
|
@@ -8,7 +8,7 @@ from xync_schema import xtype
|
|
|
8
8
|
|
|
9
9
|
from xync_client.Abc.Ex import BaseExClient
|
|
10
10
|
from xync_client.BingX.base import BaseBingXClient
|
|
11
|
-
from xync_client.loader import
|
|
11
|
+
from xync_client.loader import NET_TOKEN, TORM
|
|
12
12
|
from xync_client.Abc.xtype import MapOfIdsList
|
|
13
13
|
from xync_client.BingX.etype import ad, pm
|
|
14
14
|
from xync_client.Abc.xtype import PmEx
|
|
@@ -93,7 +93,7 @@ class ExClient(BaseExClient, BaseBingXClient):
|
|
|
93
93
|
async def main():
|
|
94
94
|
_ = await init_db(TORM, True)
|
|
95
95
|
bg = await Ex.get(name="BingX").prefetch_related("pm_reps")
|
|
96
|
-
async with FileClient(
|
|
96
|
+
async with FileClient(NET_TOKEN) as b:
|
|
97
97
|
b: FileClient
|
|
98
98
|
cl = ExClient(bg, b)
|
|
99
99
|
_ads = await cl.ads(
|
|
@@ -6,7 +6,7 @@ from xync_schema.models import Ex
|
|
|
6
6
|
from xync_schema import xtype
|
|
7
7
|
|
|
8
8
|
from xync_client.Abc.Ex import BaseExClient
|
|
9
|
-
from xync_client.loader import TORM,
|
|
9
|
+
from xync_client.loader import TORM, NET_TOKEN
|
|
10
10
|
from xync_client.Abc.xtype import PmEx, MapOfIdsList
|
|
11
11
|
from xync_client.BitGet.etype import ad
|
|
12
12
|
|
|
@@ -94,7 +94,7 @@ class ExClient(BaseExClient):
|
|
|
94
94
|
async def main():
|
|
95
95
|
_ = await init_db(TORM, True)
|
|
96
96
|
bg = await Ex.get(name="BitGet")
|
|
97
|
-
cl = ExClient(bg, FileClient(
|
|
97
|
+
cl = ExClient(bg, FileClient(NET_TOKEN))
|
|
98
98
|
_ads = await cl.ads("USDT", "RUB", False, [])
|
|
99
99
|
await cl.curs()
|
|
100
100
|
await cl.coins()
|
|
@@ -19,7 +19,6 @@ from xync_client.Abc.PmAgent import PmAgentClient
|
|
|
19
19
|
from xync_schema import models
|
|
20
20
|
from xync_schema.enums import UserStatus, OrderStatus
|
|
21
21
|
|
|
22
|
-
from xync_client.Pms.Payeer import Client
|
|
23
22
|
from xync_client.Bybit.etype.order import (
|
|
24
23
|
StatusChange,
|
|
25
24
|
CountDown,
|
|
@@ -29,7 +28,7 @@ from xync_client.Bybit.etype.order import (
|
|
|
29
28
|
OrderFull,
|
|
30
29
|
StatusApi,
|
|
31
30
|
)
|
|
32
|
-
from xync_client.loader import
|
|
31
|
+
from xync_client.loader import NET_TOKEN
|
|
33
32
|
from xync_client.Abc.InAgent import BaseInAgentClient
|
|
34
33
|
from xync_client.Bybit.agent import AgentClient
|
|
35
34
|
|
|
@@ -407,17 +406,18 @@ async def main():
|
|
|
407
406
|
person__user__status=UserStatus.ACTIVE,
|
|
408
407
|
person__user__pm_agents__isnull=False,
|
|
409
408
|
)
|
|
410
|
-
.prefetch_related("ex", "agent", "
|
|
409
|
+
.prefetch_related("ex", "agent", "person__user__pm_agents__user", "person__user__pm_agents__pm")
|
|
411
410
|
.first()
|
|
412
411
|
)
|
|
413
412
|
|
|
414
|
-
async with FileClient(
|
|
413
|
+
async with FileClient(NET_TOKEN) as b:
|
|
415
414
|
b: FileClient
|
|
416
415
|
cl: InAgentClient = actor.in_client(b)
|
|
417
416
|
# await cl.agent_client.export_my_ads()
|
|
418
|
-
payeer_cl = Client(actor.person.user.username_id)
|
|
417
|
+
# payeer_cl = Client(actor.person.user.username_id)
|
|
419
418
|
for pma in actor.person.user.pm_agents:
|
|
420
|
-
|
|
419
|
+
pcl = pma.client()
|
|
420
|
+
cl.pmacs[pma.pm_id] = await pcl.start(await async_playwright().start(), False)
|
|
421
421
|
try:
|
|
422
422
|
_ = await cl.start_listen()
|
|
423
423
|
except Exception as e:
|
|
@@ -43,7 +43,7 @@ from xync_client.Bybit.etype.order import (
|
|
|
43
43
|
Message,
|
|
44
44
|
Status,
|
|
45
45
|
)
|
|
46
|
-
from xync_client.loader import TORM,
|
|
46
|
+
from xync_client.loader import TORM, NET_TOKEN
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
class NoMakerException(Exception):
|
|
@@ -1264,7 +1264,7 @@ async def main():
|
|
|
1264
1264
|
actor = (
|
|
1265
1265
|
await models.Actor.filter(ex_id=4, agent__isnull=False).prefetch_related("ex", "agent", "person__user").first()
|
|
1266
1266
|
)
|
|
1267
|
-
filebot = FileClient(
|
|
1267
|
+
filebot = FileClient(NET_TOKEN)
|
|
1268
1268
|
await filebot.start()
|
|
1269
1269
|
# b.add_handler(MessageHandler(cond_start_handler, command("cond")))
|
|
1270
1270
|
cl: AgentClient = actor.client(filebot)
|
|
@@ -1315,10 +1315,10 @@ async def main():
|
|
|
1315
1315
|
hist |= papi.history(count=1000, append=list(hist.keys())[-1])
|
|
1316
1316
|
cl.hist = hist
|
|
1317
1317
|
|
|
1318
|
-
cl.completed_orders = await models.Order.filter(status=OrderStatus.completed, transfer__isnull=False).values_list(
|
|
1319
|
-
|
|
1320
|
-
)
|
|
1321
|
-
await cl.get_api_orders() # 43, 1741294800000, 1749157199999)
|
|
1318
|
+
# cl.completed_orders = await models.Order.filter(status=OrderStatus.completed, transfer__isnull=False).values_list(
|
|
1319
|
+
# "exid", flat=True
|
|
1320
|
+
# )
|
|
1321
|
+
# await cl.get_api_orders() # 43, 1741294800000, 1749157199999)
|
|
1322
1322
|
|
|
1323
1323
|
races = await models.Race.filter(started=True).prefetch_related(
|
|
1324
1324
|
"road__ad__pair_side__pair__cur",
|
|
@@ -7,7 +7,7 @@ from xync_schema import models, xtype
|
|
|
7
7
|
from xync_schema.models import Ex, Agent
|
|
8
8
|
|
|
9
9
|
from xync_client.Abc.Ex import BaseExClient
|
|
10
|
-
from xync_client.loader import
|
|
10
|
+
from xync_client.loader import NET_TOKEN
|
|
11
11
|
from xync_client.Bybit.etype import ad
|
|
12
12
|
from xync_client.Abc.xtype import PmEx, MapOfIdsList
|
|
13
13
|
from xync_client.loader import TORM
|
|
@@ -114,7 +114,7 @@ class ExClient(BaseExClient): # Bybit client
|
|
|
114
114
|
async def main():
|
|
115
115
|
_ = await init_db(TORM, True)
|
|
116
116
|
ex = await Ex.get(name="Bybit")
|
|
117
|
-
bot: FileClient = FileClient(
|
|
117
|
+
bot: FileClient = FileClient(NET_TOKEN)
|
|
118
118
|
# await bot.start()
|
|
119
119
|
cl = ExClient(ex, bot)
|
|
120
120
|
await cl.set_pms()
|
|
@@ -6,7 +6,7 @@ from xync_schema.models import Ex
|
|
|
6
6
|
from xync_schema import xtype
|
|
7
7
|
|
|
8
8
|
from xync_client.Abc.Ex import BaseExClient
|
|
9
|
-
from xync_client.loader import
|
|
9
|
+
from xync_client.loader import NET_TOKEN, TORM
|
|
10
10
|
from xync_client.Abc.xtype import PmEx, MapOfIdsList
|
|
11
11
|
from xync_client.Gate.etype import ad
|
|
12
12
|
|
|
@@ -93,7 +93,7 @@ class ExClient(BaseExClient):
|
|
|
93
93
|
async def main():
|
|
94
94
|
_ = await init_db(TORM, True)
|
|
95
95
|
gt = await Ex.get(name="Gate")
|
|
96
|
-
async with FileClient(
|
|
96
|
+
async with FileClient(NET_TOKEN) as b:
|
|
97
97
|
cl = ExClient(gt, b)
|
|
98
98
|
await cl.set_pairs()
|
|
99
99
|
pms = await cl.set_coins()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from playwright.async_api import Page, Playwright
|
|
2
|
-
from pyro_client.client.
|
|
2
|
+
from pyro_client.client.file import FileClient
|
|
3
3
|
from pyro_client.client.user import UserClient
|
|
4
4
|
from xync_schema.models import User, Gmail
|
|
5
5
|
|
|
6
|
-
from xync_client.loader import
|
|
6
|
+
from xync_client.loader import NET_TOKEN
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class GmClient:
|
|
@@ -23,7 +23,7 @@ class GmClient:
|
|
|
23
23
|
login=input(f"{self.user.last_name} gmail login:"), password=input("password:")
|
|
24
24
|
)
|
|
25
25
|
browser = await pw.chromium.launch(
|
|
26
|
-
channel="chrome",
|
|
26
|
+
channel="chrome" if headed else "chromium-headless-shell",
|
|
27
27
|
headless=not headed,
|
|
28
28
|
args=[
|
|
29
29
|
"--disable-blink-features=AutomationControlled",
|
|
@@ -83,8 +83,8 @@ class GmClient:
|
|
|
83
83
|
|
|
84
84
|
async def load_bot(self):
|
|
85
85
|
if not self.bot:
|
|
86
|
-
bot =
|
|
87
|
-
self.bot =
|
|
86
|
+
bot = FileClient(NET_TOKEN)
|
|
87
|
+
self.bot = UserClient(self.uid, bot)
|
|
88
88
|
if not self.bot.is_connected:
|
|
89
89
|
await self.bot.start()
|
|
90
90
|
|
|
@@ -11,7 +11,7 @@ from xync_schema.enums import PmType
|
|
|
11
11
|
from xync_client.Abc.Ex import BaseExClient
|
|
12
12
|
from xync_client.Abc.xtype import PmEx, MapOfIdsList
|
|
13
13
|
from xync_client.Htx.etype import pm, Country, ad
|
|
14
|
-
from xync_client.loader import
|
|
14
|
+
from xync_client.loader import NET_TOKEN
|
|
15
15
|
from xync_client.loader import TORM
|
|
16
16
|
|
|
17
17
|
|
|
@@ -156,7 +156,7 @@ class ExClient(BaseExClient):
|
|
|
156
156
|
async def main():
|
|
157
157
|
_ = await init_db(TORM, True)
|
|
158
158
|
ex = await Ex.get(name="Htx")
|
|
159
|
-
async with FileClient(
|
|
159
|
+
async with FileClient(NET_TOKEN) as b:
|
|
160
160
|
b: FileClient
|
|
161
161
|
cl = ExClient(ex, b)
|
|
162
162
|
await cl.set_curs()
|
|
@@ -2,7 +2,7 @@ from asyncio import run
|
|
|
2
2
|
|
|
3
3
|
from pyro_client.client.file import FileClient
|
|
4
4
|
from x_model import init_db
|
|
5
|
-
from xync_client.loader import TORM,
|
|
5
|
+
from xync_client.loader import TORM, NET_TOKEN
|
|
6
6
|
from xync_schema import models
|
|
7
7
|
from xync_schema import xtype
|
|
8
8
|
|
|
@@ -80,7 +80,7 @@ class ExClient(BaseExClient):
|
|
|
80
80
|
async def main():
|
|
81
81
|
_ = await init_db(TORM, True)
|
|
82
82
|
bg = await models.Ex.get(name="KuCoin")
|
|
83
|
-
async with FileClient(
|
|
83
|
+
async with FileClient(NET_TOKEN) as b:
|
|
84
84
|
cl: ExClient = bg.client(b)
|
|
85
85
|
await cl.set_pms()
|
|
86
86
|
await cl.set_coins()
|
|
@@ -3,7 +3,7 @@ from asyncio import run
|
|
|
3
3
|
from pyro_client.client.file import FileClient
|
|
4
4
|
from x_model import init_db
|
|
5
5
|
import requests
|
|
6
|
-
from xync_client.loader import TORM,
|
|
6
|
+
from xync_client.loader import TORM, NET_TOKEN
|
|
7
7
|
|
|
8
8
|
from xync_client.Abc.Ex import BaseExClient
|
|
9
9
|
from xync_client.Abc.xtype import PmEx, MapOfIdsList
|
|
@@ -90,7 +90,7 @@ class ExClient(BaseExClient):
|
|
|
90
90
|
|
|
91
91
|
async def main():
|
|
92
92
|
_ = await init_db(TORM)
|
|
93
|
-
async with FileClient(
|
|
93
|
+
async with FileClient(NET_TOKEN) as b:
|
|
94
94
|
ex = await Ex.get(name="Mexc")
|
|
95
95
|
cl = ex.client(b)
|
|
96
96
|
# await ex.curexs.filter(cur__ticker="EUR")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from asyncio import run
|
|
2
2
|
|
|
3
3
|
from pyro_client.client.file import FileClient
|
|
4
|
-
from pyro_client.loader import
|
|
4
|
+
from pyro_client.loader import NET_TOKEN
|
|
5
5
|
from x_model import init_db
|
|
6
6
|
|
|
7
7
|
from xync_client.Abc.Exception import NoPairOnEx
|
|
@@ -102,7 +102,7 @@ class ExClient(BaseExClient):
|
|
|
102
102
|
async def main():
|
|
103
103
|
_ = await init_db(TORM)
|
|
104
104
|
bg = await models.Ex.get(name="Okx")
|
|
105
|
-
cl = ExClient(bg, FileClient(
|
|
105
|
+
cl = ExClient(bg, FileClient(NET_TOKEN))
|
|
106
106
|
await cl.ads("USDT", "EUR", True)
|
|
107
107
|
# curs = await cl.curs()
|
|
108
108
|
# coins = await cl.coins()
|
|
@@ -4,22 +4,20 @@ from asyncio import run, ensure_future
|
|
|
4
4
|
from decimal import Decimal
|
|
5
5
|
from enum import StrEnum
|
|
6
6
|
from hashlib import sha256
|
|
7
|
-
from typing import Literal
|
|
8
7
|
|
|
9
8
|
from playwright.async_api import async_playwright, Page, Locator, Position, Playwright # , FloatRect
|
|
10
9
|
from pyotp import TOTP
|
|
11
10
|
|
|
12
11
|
# noinspection PyProtectedMember
|
|
13
12
|
from playwright._impl._errors import TimeoutError
|
|
14
|
-
from pyro_client.client.bot import BotClient
|
|
15
13
|
from pyro_client.client.user import UserClient
|
|
14
|
+
from pyrogram.handlers import MessageHandler
|
|
16
15
|
from xync_schema.enums import UserStatus
|
|
17
16
|
from xync_schema.models import Cur, User, PmAgent, Cred, PmCur, Fiat, TopUp
|
|
18
17
|
|
|
19
18
|
from xync_client.Abc.PmAgent import PmAgentClient
|
|
20
19
|
from xync_client.Gmail import GmClient
|
|
21
20
|
from xync_client.Pms.Volet.api import APIClient
|
|
22
|
-
from xync_client.loader import TOKEN
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
class CaptchaException(Exception): ...
|
|
@@ -34,14 +32,6 @@ class NoCodeException(Exception): ...
|
|
|
34
32
|
class NoMailException(Exception): ...
|
|
35
33
|
|
|
36
34
|
|
|
37
|
-
class Pages(StrEnum):
|
|
38
|
-
base_url = "https://account.volet.com/"
|
|
39
|
-
LOGIN = base_url + "login"
|
|
40
|
-
OTP_LOGIN = base_url + "login/otp"
|
|
41
|
-
HOME = base_url + "pages/transaction"
|
|
42
|
-
SEND = base_url + "pages/transfer/wallet"
|
|
43
|
-
|
|
44
|
-
|
|
45
35
|
def parse_transaction_info(text: str) -> dict[str, str] | None:
|
|
46
36
|
# Поиск ID транзакции
|
|
47
37
|
transaction_id_match = re.search(r"Transaction ID:\s*([\w-]+)", text)
|
|
@@ -61,8 +51,12 @@ def parse_transaction_info(text: str) -> dict[str, str] | None:
|
|
|
61
51
|
|
|
62
52
|
|
|
63
53
|
class Client(PmAgentClient):
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
class Pages(StrEnum):
|
|
55
|
+
base = "https://account.volet.com/"
|
|
56
|
+
LOGIN = base + "login"
|
|
57
|
+
OTP_LOGIN = base + "login/otp"
|
|
58
|
+
# HOME = base + "pages/transaction"
|
|
59
|
+
SEND = base + "pages/transfer/wallet"
|
|
66
60
|
|
|
67
61
|
async def check_in(self, amount: int | Decimal | float, cur: str, tid: str | int = None) -> float | None:
|
|
68
62
|
pass
|
|
@@ -76,6 +70,8 @@ class Client(PmAgentClient):
|
|
|
76
70
|
api: APIClient
|
|
77
71
|
page: Page
|
|
78
72
|
gmail: GmClient
|
|
73
|
+
norm: str = "payeer"
|
|
74
|
+
pages: type(StrEnum) = Pages
|
|
79
75
|
|
|
80
76
|
def __init__(self, agent: PmAgent):
|
|
81
77
|
super().__init__(agent)
|
|
@@ -118,51 +114,37 @@ class Client(PmAgentClient):
|
|
|
118
114
|
}
|
|
119
115
|
|
|
120
116
|
async def start(self, pw: Playwright, headed: bool = False):
|
|
121
|
-
self.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
self.page = await context.new_page()
|
|
132
|
-
ensure_future(self.gmail.start(pw, headed))
|
|
133
|
-
await self.go(Pages.HOME)
|
|
134
|
-
if self.page.url == Pages.LOGIN:
|
|
135
|
-
await self.login()
|
|
136
|
-
# elif self.page.url == Pages.OTP_LOGIN:
|
|
137
|
-
# await self.login_otp()
|
|
138
|
-
if self.page.url != Pages.HOME:
|
|
139
|
-
await self.bot.receive("Not logged in!", photo=await self.page.screenshot())
|
|
140
|
-
raise Exception(f"User {self.agent.user_id} has not logged in")
|
|
141
|
-
|
|
142
|
-
async def wait_for_code(self, typ: Literal["login", "send"]) -> str:
|
|
143
|
-
code = await self.bot.wait_from(243630567, f"otp_{typ}")
|
|
144
|
-
return code[-6:]
|
|
145
|
-
|
|
146
|
-
async def login(self):
|
|
147
|
-
await self.page.locator("input#j_username").fill("mixartemev@gmail.com")
|
|
117
|
+
ensure_future(self.gmail.start(pw, False))
|
|
118
|
+
return await super().start(pw, False, True)
|
|
119
|
+
|
|
120
|
+
async def wait_for_code(self, uid: int, topic: str, hg: tuple[MessageHandler, int]) -> str:
|
|
121
|
+
code = await self.bot.wait_from(uid, topic, hg)
|
|
122
|
+
return code and code[-6:]
|
|
123
|
+
|
|
124
|
+
async def _login(self):
|
|
125
|
+
ll = self.page.locator("input#j_username")
|
|
126
|
+
await ll.fill("mixartemev@gmail.com")
|
|
148
127
|
await self.page.locator("input#j_password").fill("mixfixX98")
|
|
128
|
+
await self.page.wait_for_timeout(200)
|
|
129
|
+
await ll.click()
|
|
130
|
+
volet_bot_id, topic = 243630567, "otp_login"
|
|
149
131
|
await self.page.locator("input#loginToAdvcashButton", has_text="log in").hover()
|
|
132
|
+
hg = self.bot.subscribe_for(volet_bot_id, topic) # 243630567 - is volet bot
|
|
150
133
|
await self.page.locator("input#loginToAdvcashButton:not([disabled])", has_text="log in").click()
|
|
151
|
-
await self.page.wait_for_url(
|
|
152
|
-
await self.
|
|
153
|
-
|
|
154
|
-
async def login_otp(self):
|
|
155
|
-
if not (code := await self.wait_for_code("login")):
|
|
134
|
+
await self.page.wait_for_url(self.pages.OTP_LOGIN)
|
|
135
|
+
if not (code := await self.wait_for_code(volet_bot_id, topic, hg)):
|
|
156
136
|
await self.bot.receive("no login code", photo=await self.page.screenshot())
|
|
157
137
|
raise NoCodeException(self.agent.user_id)
|
|
158
138
|
await self.page.locator("input#otpId").fill(code)
|
|
159
139
|
await self.page.click("input#checkOtpButton")
|
|
160
|
-
await self.page.wait_for_url(
|
|
140
|
+
await self.page.wait_for_url(self.pages.SEND)
|
|
141
|
+
|
|
142
|
+
async def send(self, dest: str, amount: float, cur: str) -> tuple[int, bytes, float]:
|
|
143
|
+
curs_map = {"RUB": "Ruble"}
|
|
161
144
|
|
|
162
|
-
|
|
163
|
-
await self.go(Pages.SEND)
|
|
145
|
+
await self.go(self.pages.SEND)
|
|
164
146
|
await self.page.click("[class=combobox-account]")
|
|
165
|
-
await self.page.click('[class=rf-ulst-itm] b:has-text("
|
|
147
|
+
await self.page.click(f'[class=rf-ulst-itm] b:has-text("{curs_map[cur]}") ")')
|
|
166
148
|
await self.page.wait_for_timeout(200)
|
|
167
149
|
await self.page.fill("#srcAmount", str(amount))
|
|
168
150
|
await self.page.fill("#destWalletId", dest)
|
|
@@ -182,7 +164,7 @@ class Client(PmAgentClient):
|
|
|
182
164
|
raise OtpNotSetException(self.agent.user_id)
|
|
183
165
|
await self.page.fill("#securityValue", code)
|
|
184
166
|
await self.page.locator("input[type=submit]", has_text="confirm").click()
|
|
185
|
-
await self.page.wait_for_url(
|
|
167
|
+
await self.page.wait_for_url(self.pages.SEND)
|
|
186
168
|
await self.page.get_by_role("heading").click()
|
|
187
169
|
slip = await self.page.screenshot(clip={"x": 440, "y": 205, "width": 420, "height": 360})
|
|
188
170
|
await self.bot.receive(f"{amount} to {dest} sent", photo=slip)
|
|
@@ -16,7 +16,7 @@ from xync_client.TgWallet.pyd import (
|
|
|
16
16
|
_PmsTrait,
|
|
17
17
|
_BaseAd,
|
|
18
18
|
)
|
|
19
|
-
from xync_client.loader import
|
|
19
|
+
from xync_client.loader import NET_TOKEN, TORM
|
|
20
20
|
from xync_client.Abc.Ex import BaseExClient
|
|
21
21
|
from xync_client.Abc.xtype import MapOfIdsList
|
|
22
22
|
from xync_client.TgWallet.auth import AuthClient
|
|
@@ -156,7 +156,7 @@ class ExClient(BaseExClient, AuthClient):
|
|
|
156
156
|
async def _test():
|
|
157
157
|
await init_db(TORM)
|
|
158
158
|
tgex = await models.Ex.get(name="TgWallet")
|
|
159
|
-
async with FileClient(
|
|
159
|
+
async with FileClient(NET_TOKEN) as b:
|
|
160
160
|
cl: ExClient = tgex.client(b)
|
|
161
161
|
|
|
162
162
|
await cl.set_coins()
|
|
@@ -4,7 +4,7 @@ from xync_schema import models
|
|
|
4
4
|
|
|
5
5
|
load_dotenv()
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
NET_TOKEN = env("NET_TOKEN")
|
|
8
8
|
PG_DSN = f"postgres://{env('POSTGRES_USER')}:{env('POSTGRES_PASSWORD')}@{env('POSTGRES_HOST', 'xyncdbs')}:{env('POSTGRES_PORT', 5432)}/{env('POSTGRES_DB', env('POSTGRES_USER'))}"
|
|
9
9
|
TORM = {
|
|
10
10
|
"connections": {"default": PG_DSN},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|