xync-client 0.0.50.dev2__tar.gz → 0.0.51.dev1__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.
- {xync_client-0.0.50.dev2/xync_client.egg-info → xync_client-0.0.51.dev1}/PKG-INFO +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/TestEx.py +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/BaseTest.py +2 -4
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/Ex.py +13 -11
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/ex.py +1 -2
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BitPapa/ex.py +0 -3
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/agent.py +3 -3
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Gate/ex.py +1 -2
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/ex.py +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/KuCoin/ex.py +1 -2
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Mexc/ex.py +1 -2
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Okx/ex.py +1 -2
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Ozon/__init__.py +17 -17
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/auth.py +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/ex.py +42 -40
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/pyro.py +5 -5
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/loader.py +9 -6
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/pm_unifier.py +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1/xync_client.egg-info}/PKG-INFO +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/.env.sample +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/.gitignore +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/README.md +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/makefile +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/pyproject.toml +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/setup.cfg +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/TestAgent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/TestAsset.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/TestOrder.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Htx/test_htx_p2p.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Abc/types.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/InAgent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/etype/order.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/ex.py +1 -1
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Gmail/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Tinkoff/state.json +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Volet/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client/__init__.py +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client.egg-info/SOURCES.txt +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client.egg-info/requires.txt +0 -0
- {xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -21,7 +21,7 @@ class TestEx(BaseTest):
|
|
|
21
21
|
async def clients(self) -> list[HttpClient]:
|
|
22
22
|
exs = await Ex.filter(status__gt=ExStatus.plan)
|
|
23
23
|
[await ex for ex in exs if ex.type_ == ExType.tg]
|
|
24
|
-
async with
|
|
24
|
+
async with FileClient(TOKEN) as b:
|
|
25
25
|
b: FileClient
|
|
26
26
|
clients: list[BaseExClient] = [ex.client(b) for ex in exs]
|
|
27
27
|
yield clients
|
|
@@ -7,9 +7,7 @@ from tortoise.backends.asyncpg import AsyncpgDBClient
|
|
|
7
7
|
from x_client.aiohttp import Client as HttpClient
|
|
8
8
|
from x_model import init_db
|
|
9
9
|
from xync_client.Abc.types import DictOfDicts, ListOfDicts, FlatDict, MapOfIdsList
|
|
10
|
-
from
|
|
11
|
-
|
|
12
|
-
from xync_client.loader import PG_DSN
|
|
10
|
+
from xync_client.loader import TORM
|
|
13
11
|
|
|
14
12
|
|
|
15
13
|
class BaseTest:
|
|
@@ -19,7 +17,7 @@ class BaseTest:
|
|
|
19
17
|
# return uvloop.EventLoopPolicy()
|
|
20
18
|
@pytest.fixture(scope="session", autouse=True)
|
|
21
19
|
async def cn(self) -> AsyncpgDBClient:
|
|
22
|
-
cn: AsyncpgDBClient = await init_db(
|
|
20
|
+
cn: AsyncpgDBClient = await init_db(TORM, True)
|
|
23
21
|
yield cn
|
|
24
22
|
await cn.close()
|
|
25
23
|
|
|
@@ -3,7 +3,7 @@ from abc import abstractmethod
|
|
|
3
3
|
from asyncio import sleep
|
|
4
4
|
|
|
5
5
|
import msgspec
|
|
6
|
-
from aiohttp import ClientSession
|
|
6
|
+
from aiohttp import ClientSession
|
|
7
7
|
from msgspec import Struct
|
|
8
8
|
from pyro_client.client.file import FileClient
|
|
9
9
|
from tortoise.exceptions import MultipleObjectsReturned, IntegrityError
|
|
@@ -247,8 +247,9 @@ class BaseExClient(HttpClient):
|
|
|
247
247
|
async def set_coinexs(self):
|
|
248
248
|
coins: dict[str, CoinEx] = await self.coins()
|
|
249
249
|
coins_db: dict[int, models.Coin] = {
|
|
250
|
-
c.exid: (await models.Coin.update_or_create(
|
|
251
|
-
|
|
250
|
+
c.exid: (await models.Coin.update_or_create(
|
|
251
|
+
{"scale": c.scale} if c.scale is not None else {}, ticker=c.ticker)
|
|
252
|
+
)[0] for c in coins.values()
|
|
252
253
|
}
|
|
253
254
|
coinexs: list[models.Coinex] = [
|
|
254
255
|
models.Coinex(coin=coins_db[c.exid], ex=self.ex, exid=c.exid, minimum=c.minimum) for c in coins.values()
|
|
@@ -283,11 +284,12 @@ class BaseExClient(HttpClient):
|
|
|
283
284
|
await ad_db.pmexs.add(*getattr(ad_pydin, "pmexs_", []))
|
|
284
285
|
return ad_db
|
|
285
286
|
|
|
286
|
-
async def _proc(self, resp: ClientResponse, data_key: str = None, body: dict | str = None) -> dict | str:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
287
|
+
# async def _proc(self, resp: ClientResponse, data_key: str = None, body: dict | str = None) -> dict | str:
|
|
288
|
+
# if resp.status in (401, 403):
|
|
289
|
+
# # proxy = await models.Proxy.filter(valid=True, country__short__not="US").order_by("-updated_at").first()
|
|
290
|
+
# cookies = self.session.cookie_jar.filter_cookies(self.session._base_url)
|
|
291
|
+
# self.session = ClientSession(
|
|
292
|
+
# self.session._base_url, headers=self.session.headers, cookies=cookies or None # , proxy=proxy
|
|
293
|
+
# )
|
|
294
|
+
# return await self.METHS[resp.method](self, resp.url.path, body, data_key=data_key)
|
|
295
|
+
# return await super()._proc(resp, data_key)
|
|
@@ -4,8 +4,7 @@ from x_model import init_db
|
|
|
4
4
|
|
|
5
5
|
from xync_client.Abc.Ex import BaseExClient
|
|
6
6
|
from xync_client.Binance.etype import pm, ad
|
|
7
|
-
from xync_client.Abc.types import PmEx
|
|
8
|
-
from xync_client.Abc.Base import MapOfIdsList
|
|
7
|
+
from xync_client.Abc.types import PmEx, MapOfIdsList
|
|
9
8
|
from xync_client.loader import PG_DSN
|
|
10
9
|
from xync_client.pm_unifier import PmUnifier
|
|
11
10
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
from asyncio import run
|
|
2
|
-
import json
|
|
3
2
|
from x_model import init_db
|
|
4
3
|
|
|
5
4
|
from bs4 import BeautifulSoup
|
|
6
5
|
from xync_client.loader import PG_DSN
|
|
7
6
|
from xync_client.Abc.Ex import BaseExClient
|
|
8
|
-
from xync_client.Abc.Base import MapOfIdsList
|
|
9
|
-
from xync_client.Abc.types import PmEx
|
|
10
7
|
# from xync_client.Mexc.etype import pm, ad
|
|
11
8
|
|
|
12
9
|
from xync_schema import types
|
|
@@ -22,7 +22,7 @@ from xync_client.Abc.types import BaseOrderReq, FlatDict
|
|
|
22
22
|
from xync_client.Bybit.etype.ad import AdPostRequest, AdUpdateRequest, AdDeleteRequest, Ad
|
|
23
23
|
from xync_client.Bybit.etype.cred import CredEpyd
|
|
24
24
|
from xync_client.Bybit.etype.order import OrderRequest, PreOrderResp, OrderResp, CancelOrderReq
|
|
25
|
-
from xync_client.loader import
|
|
25
|
+
from xync_client.loader import TORM
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class NoMakerException(Exception):
|
|
@@ -649,8 +649,8 @@ class ExcCode(IntEnum):
|
|
|
649
649
|
|
|
650
650
|
|
|
651
651
|
async def main():
|
|
652
|
-
_ = await init_db(PG_DSN, models, True)
|
|
653
652
|
logging.basicConfig(level=logging.INFO)
|
|
653
|
+
_ = await init_db(TORM)
|
|
654
654
|
actor = (
|
|
655
655
|
await models.Actor.filter(ex_id=9, agent__isnull=False).prefetch_related("ex", "agent", "person__user").first()
|
|
656
656
|
)
|
|
@@ -669,7 +669,7 @@ async def main():
|
|
|
669
669
|
# await actual_cond()
|
|
670
670
|
await gather(
|
|
671
671
|
cl.battle(usdt, rub, False, ["volet"], 79.97), # гонка в стакане покупки - мы продаем
|
|
672
|
-
cl.battle(usdt, rub, True, ["volet"], 79.
|
|
672
|
+
cl.battle(usdt, rub, True, ["volet"], 79.51), # гонка в стакане продажи - мы покупаем
|
|
673
673
|
cl.battle(eth, rub, False, ["volet"], 206_000),
|
|
674
674
|
cl.battle(eth, rub, True, ["volet"], 200_000),
|
|
675
675
|
cl.battle(btc, rub, False, ["volet"], 8_500_000),
|
|
@@ -10,10 +10,9 @@ from xync_schema import models
|
|
|
10
10
|
from xync_schema.models import Ex
|
|
11
11
|
from xync_schema import types
|
|
12
12
|
|
|
13
|
-
from xync_client.Abc.Base import MapOfIdsList
|
|
14
13
|
from xync_client.Abc.Ex import BaseExClient
|
|
15
14
|
from xync_client.loader import PG_DSN
|
|
16
|
-
from xync_client.Abc.types import PmEx
|
|
15
|
+
from xync_client.Abc.types import PmEx, MapOfIdsList
|
|
17
16
|
from xync_client.Gate.etype import ad
|
|
18
17
|
from xync_client.pm_unifier import PmUnifier
|
|
19
18
|
|
|
@@ -158,7 +158,7 @@ class ExClient(BaseExClient):
|
|
|
158
158
|
async def main():
|
|
159
159
|
_ = await init_db(PG_DSN, models, True)
|
|
160
160
|
ex = await Ex.get(name="Htx")
|
|
161
|
-
async with
|
|
161
|
+
async with FileClient(TOKEN) as b:
|
|
162
162
|
b: FileClient
|
|
163
163
|
cl = ExClient(ex, b)
|
|
164
164
|
await cl.set_pmcurexs()
|
|
@@ -4,11 +4,10 @@ from x_model import init_db
|
|
|
4
4
|
from xync_schema import models
|
|
5
5
|
from xync_schema import types
|
|
6
6
|
|
|
7
|
-
from xync_client.Abc.Base import MapOfIdsList
|
|
8
7
|
from xync_client.Abc.Ex import BaseExClient
|
|
9
8
|
from xync_client.loader import PG_DSN
|
|
10
9
|
from xync_client.KuCoin.etype import pm, ad
|
|
11
|
-
from xync_client.Abc.types import PmEx
|
|
10
|
+
from xync_client.Abc.types import PmEx, MapOfIdsList
|
|
12
11
|
from xync_client.pm_unifier import PmUnifier
|
|
13
12
|
|
|
14
13
|
|
|
@@ -4,8 +4,7 @@ import requests
|
|
|
4
4
|
|
|
5
5
|
from xync_client.loader import PG_DSN
|
|
6
6
|
from xync_client.Abc.Ex import BaseExClient
|
|
7
|
-
from xync_client.Abc.
|
|
8
|
-
from xync_client.Abc.types import PmEx
|
|
7
|
+
from xync_client.Abc.types import PmEx, MapOfIdsList
|
|
9
8
|
from xync_client.Mexc.etype import pm, ad
|
|
10
9
|
from xync_client.pm_unifier import PmUnifier
|
|
11
10
|
|
|
@@ -4,11 +4,10 @@ from x_model import init_db
|
|
|
4
4
|
from xync_schema import models
|
|
5
5
|
from xync_schema import types
|
|
6
6
|
|
|
7
|
-
from xync_client.Abc.Base import MapOfIdsList
|
|
8
7
|
from xync_client.Abc.Ex import BaseExClient
|
|
9
8
|
from xync_client.loader import PG_DSN
|
|
10
9
|
from xync_client.Okx.etype import ad, pm
|
|
11
|
-
from xync_client.Abc.types import PmEx
|
|
10
|
+
from xync_client.Abc.types import PmEx, MapOfIdsList
|
|
12
11
|
from xync_client.pm_unifier import PmUnifier
|
|
13
12
|
|
|
14
13
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
from asyncio import run
|
|
1
|
+
from asyncio import run, sleep
|
|
2
2
|
from x_model import init_db
|
|
3
3
|
from xync_schema import models
|
|
4
4
|
from xync_client.loader import PG_DSN
|
|
5
5
|
import undetected_chromedriver as uc
|
|
6
6
|
from selenium.webdriver.common.by import By
|
|
7
7
|
from selenium.webdriver.common.action_chains import ActionChains
|
|
8
|
-
import time
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
def login(driver, agent) -> None:
|
|
12
11
|
driver.get("https://finance.ozon.ru")
|
|
13
12
|
for cookie in agent.state:
|
|
14
13
|
driver.add_cookie(cookie)
|
|
15
14
|
driver.get("https://finance.ozon.ru/lk")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
if 1: # todo: только если просит ввести пин-код
|
|
16
|
+
pin = agent.auth.get("code")
|
|
17
|
+
actions = ActionChains(driver)
|
|
18
|
+
for char in pin:
|
|
19
|
+
actions.send_keys(char)
|
|
20
|
+
actions.perform()
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
async def send_cred(driver, amount, payment, cred):
|
|
@@ -31,24 +31,24 @@ async def main():
|
|
|
31
31
|
chrome_options.add_argument("--disable-gpu")
|
|
32
32
|
chrome_options.add_argument("--no-sandbox")
|
|
33
33
|
driver = uc.Chrome(options=chrome_options)
|
|
34
|
+
driver.implicitly_wait(15)
|
|
34
35
|
|
|
35
36
|
try:
|
|
36
|
-
if agent.state:
|
|
37
|
-
await loggin(driver, agent)
|
|
38
|
-
time.sleep(1000)
|
|
39
|
-
else:
|
|
37
|
+
if not agent.state:
|
|
40
38
|
driver.get("https://ozon.ru/ozonid-lite")
|
|
41
|
-
driver.implicitly_wait(3)
|
|
42
39
|
driver.find_element(By.NAME, "autocomplete").send_keys(agent.auth.get("phone"))
|
|
43
40
|
driver.find_element(By.CLASS_NAME, "b201-a").click()
|
|
41
|
+
# todo: здесь не всегда просит код, иногда вход по QR или подтверждению из почты
|
|
44
42
|
sms_code = input("Введите 6-ти значный код: ")
|
|
45
|
-
driver.implicitly_wait(3)
|
|
46
43
|
driver.find_element(By.CLASS_NAME, "d01-a.d01-a5").send_keys(sms_code)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
# elif 0: # todo: проверка на залогиненность
|
|
45
|
+
login(driver, agent)
|
|
46
|
+
# todo: здесь дальше отправка исходящего платежа и проверка входящего
|
|
47
|
+
await sleep(5)
|
|
50
48
|
|
|
51
49
|
finally:
|
|
50
|
+
agent.state = driver.get_cookies() # Получаем все куки
|
|
51
|
+
await agent.save()
|
|
52
52
|
driver.quit()
|
|
53
53
|
|
|
54
54
|
|
|
@@ -12,7 +12,7 @@ class AuthClient(BaseAuthClient):
|
|
|
12
12
|
async def _get_auth_hdrs(self) -> dict[str, str]:
|
|
13
13
|
if not self.tg_session:
|
|
14
14
|
self.tg_session = await Session.filter(user__user__person__actors__ex=self.ex).order_by("-date").first()
|
|
15
|
-
pyro = WalletAuthClient(
|
|
15
|
+
pyro = WalletAuthClient(self.tg_session.user_id)
|
|
16
16
|
init_data = await pyro.get_init_data()
|
|
17
17
|
tokens = HttpClient("walletbot.me")._post("/api/v1/users/auth/", init_data)
|
|
18
18
|
# todo: refact actor.exid actualize
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from asyncio import run, sleep
|
|
2
2
|
|
|
3
|
+
from pyro_client.client.file import FileClient
|
|
3
4
|
from x_model import init_db
|
|
4
5
|
from xync_schema import types
|
|
5
6
|
from xync_schema import models
|
|
@@ -15,7 +16,7 @@ from xync_client.TgWallet.pyd import (
|
|
|
15
16
|
_PmsTrait,
|
|
16
17
|
_BaseAd,
|
|
17
18
|
)
|
|
18
|
-
from xync_client.loader import PG_DSN
|
|
19
|
+
from xync_client.loader import PG_DSN, TOKEN
|
|
19
20
|
from xync_client.Abc.Ex import BaseExClient
|
|
20
21
|
from xync_client.Abc.types import MapOfIdsList
|
|
21
22
|
from xync_client.TgWallet.auth import AuthClient
|
|
@@ -28,10 +29,10 @@ class ExClient(BaseExClient, AuthClient):
|
|
|
28
29
|
|
|
29
30
|
unifier_class = TgWalletUnifier
|
|
30
31
|
|
|
31
|
-
def __init__(self, ex: models.Ex, actor: models.Actor = None):
|
|
32
|
+
def __init__(self, ex: models.Ex, bot: FileClient, actor: models.Actor = None):
|
|
32
33
|
if actor:
|
|
33
34
|
self.actor = actor
|
|
34
|
-
super().__init__(ex) # BaseExClient
|
|
35
|
+
super().__init__(ex, bot) # BaseExClient
|
|
35
36
|
|
|
36
37
|
def pm_type_map(self, pm: models.Pm) -> str:
|
|
37
38
|
# todo: no pm.name
|
|
@@ -153,43 +154,44 @@ class ExClient(BaseExClient, AuthClient):
|
|
|
153
154
|
async def _test():
|
|
154
155
|
await init_db(PG_DSN, models, True)
|
|
155
156
|
tgex = await models.Ex.get(name="TgWallet")
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
157
|
+
async with FileClient(TOKEN) as b:
|
|
158
|
+
cl: ExClient = tgex.client(b)
|
|
159
|
+
await cl.pms()
|
|
160
|
+
await cl.pairs()
|
|
161
|
+
await cl.set_pmcurexs()
|
|
162
|
+
await cl.set_coinexs()
|
|
163
|
+
|
|
164
|
+
# # # SALE # # #
|
|
165
|
+
# get ads list
|
|
166
|
+
ads: list[AdTakerSaleBuy] = await cl.ads("TON", "RUB", True)
|
|
167
|
+
# prepare ad list items for saving
|
|
168
|
+
ads_pydin: list[types.BaseAdIn] = [await cl.ad_taker_epyd2pydin(adp) for adp in ads]
|
|
169
|
+
# list items save
|
|
170
|
+
_ads_db = [await cl.ad_pydin2db(adi) for adi in ads_pydin]
|
|
171
|
+
|
|
172
|
+
# get ad fulls
|
|
173
|
+
ads_pyd: list[_TakerOne] = [await cl.ad(ad.exid) for ad in ads]
|
|
174
|
+
# prepare ad fulls for saving
|
|
175
|
+
ads_pydin: list[AdBuyIn] = [await cl.ad_taker_epyd2pydin(adp) for adp in ads_pyd]
|
|
176
|
+
# full ones save
|
|
177
|
+
_ads_db = [await sleep(0.1, await cl.ad_pydin2db(adi)) for adi in ads_pydin]
|
|
178
|
+
|
|
179
|
+
# # # BUY # # #
|
|
180
|
+
# get ads list
|
|
181
|
+
ads: list[AdTakerSaleBuy] = await cl.ads("TON", "RUB", False)
|
|
182
|
+
# prepare ad list items for saving
|
|
183
|
+
ads_pydin: list[types.BaseAdIn] = [await cl.ad_taker_epyd2pydin(adp) for adp in ads]
|
|
184
|
+
# list items save
|
|
185
|
+
_ads_db = [await cl.ad_pydin2db(adi) for adi in ads_pydin]
|
|
186
|
+
|
|
187
|
+
# get ad fulls
|
|
188
|
+
ads_pyd = [await cl.ad(ad.exid) for ad in ads]
|
|
189
|
+
# prepare ad fulls for saving
|
|
190
|
+
ads_pydin: list[AdBuyIn] = [await cl.ad_taker_epyd2pydin(adp) for adp in ads_pyd]
|
|
191
|
+
# full ones save
|
|
192
|
+
_ads_db = [await cl.ad_pydin2db(adi) for adi in ads_pydin]
|
|
193
|
+
|
|
194
|
+
await cl.close()
|
|
193
195
|
|
|
194
196
|
|
|
195
197
|
if __name__ == "__main__":
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from asyncio import run
|
|
2
2
|
from urllib.parse import parse_qs
|
|
3
3
|
|
|
4
|
-
from pyro_client.client.
|
|
4
|
+
from pyro_client.client.user import UserClient
|
|
5
5
|
from pyrogram.raw import functions
|
|
6
6
|
from pyrogram.raw.types import InputPeerSelf
|
|
7
7
|
from x_model import init_db
|
|
@@ -11,11 +11,11 @@ from xync_schema import models
|
|
|
11
11
|
from xync_schema.models import Actor
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
class WalletAuthClient(
|
|
14
|
+
class WalletAuthClient(UserClient):
|
|
15
15
|
async def get_init_data(self) -> dict:
|
|
16
|
-
async with self
|
|
17
|
-
bot = await
|
|
18
|
-
res = await
|
|
16
|
+
async with self:
|
|
17
|
+
bot = await self.resolve_peer("wallet")
|
|
18
|
+
res = await self.invoke(functions.messages.RequestWebView(peer=InputPeerSelf(), bot=bot, platform="ios"))
|
|
19
19
|
raw = parse_qs(res.url)["tgWebAppUserId"][0].split("#tgWebAppData=")[1]
|
|
20
20
|
j = parse_qs(raw)
|
|
21
21
|
return {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
from dotenv import load_dotenv
|
|
2
2
|
from os import getenv as env
|
|
3
|
+
from aerich import models as amodels
|
|
4
|
+
from xync_schema import models as xmodels
|
|
3
5
|
|
|
4
6
|
load_dotenv()
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
import logging
|
|
8
|
-
|
|
9
|
-
load_dotenv("/api/.env")
|
|
10
|
-
logging.info(TOKEN := env("TOKEN"))
|
|
11
|
-
|
|
8
|
+
TOKEN = env("TOKEN")
|
|
12
9
|
PG_DSN = f"postgres://{env('POSTGRES_USER')}:{env('POSTGRES_PASSWORD')}@{env('POSTGRES_HOST', 'xyncdbs')}:{env('POSTGRES_PORT', 5432)}/{env('POSTGRES_DB', env('POSTGRES_USER'))}"
|
|
10
|
+
TORM = {
|
|
11
|
+
"connections": {"default": PG_DSN},
|
|
12
|
+
"apps": {"models": {"models": [xmodels, amodels]}},
|
|
13
|
+
"use_tz": False,
|
|
14
|
+
"timezone": "UTC",
|
|
15
|
+
}
|
|
13
16
|
TG_API_ID = env("TG_API_ID")
|
|
14
17
|
TG_API_HASH = env("TG_API_HASH")
|
|
15
18
|
WSToken = env("WST")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Binance/test_binance.py
RENAMED
|
File without changes
|
|
File without changes
|
{xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/tests/_todo_refact/Bybit/test_bybit_p2p.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -113,8 +113,8 @@ async def main():
|
|
|
113
113
|
await bot.start()
|
|
114
114
|
cl = ExClient(ex, bot)
|
|
115
115
|
_ads = await cl.ads("USDT", "GEL", False)
|
|
116
|
-
await cl.set_pmcurexs()
|
|
117
116
|
await cl.set_coinexs()
|
|
117
|
+
await cl.set_pmcurexs()
|
|
118
118
|
# _cr = await cl.curs()
|
|
119
119
|
# _cn = await cl.coins()
|
|
120
120
|
await cl.set_pairs()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xync_client-0.0.50.dev2 → xync_client-0.0.51.dev1}/xync_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|