xync-client 0.0.110__py3-none-any.whl → 0.0.112__py3-none-any.whl

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.
@@ -111,7 +111,7 @@ class InAgentClient(BaseInAgentClient):
111
111
  continue
112
112
  t, is_new = await models.Transfer.update_or_create(
113
113
  dict(
114
- amount=int(float(order.amount)) * 100,
114
+ amount=int(float(order.amount) * 100),
115
115
  accepted_at=datetime.now(timezone.utc),
116
116
  ),
117
117
  order=order_db,
@@ -282,7 +282,7 @@ class InAgentClient(BaseInAgentClient):
282
282
  pmid=tid,
283
283
  )
284
284
  # обновляем остаток валюты
285
- await models.Fiat.update_or_create({"amount": rest_amount}, cred_id=order_db.cred_id)
285
+ await models.Fiat.update_or_create({"amount": rest_amount * 100}, cred_id=order_db.cred_id)
286
286
  # отправляем продавцу чек
287
287
  if res := self.agent_client.api.upload_chat_file(upload_file=f"tmp/{dest}.png").get("result"):
288
288
  self.agent_client.api.send_chat_message(
@@ -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, Locator
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,16 +38,16 @@ 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, float]:
43
- self.last_active = datetime.now()
41
+ async def send(self, dest: str, amount: int, cur: str) -> tuple[int, bytes, int] | int:
44
42
  page = self.page
45
- try:
46
- await page.goto(self.pages.SEND)
47
- except TimeoutError:
48
- await login(self.agent)
49
- for cookie in self.agent.state["cookies"]:
50
- await page.context.add_cookies([cookie])
51
- await page.goto("https://payeer.com/en/account/send/")
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()
@@ -56,33 +55,38 @@ class Client(PmAgentClient):
56
55
  if float(amount) <= has_amount:
57
56
  await page.locator('input[name="param_ACCOUNT_NUMBER"]').fill(dest)
58
57
  await page.locator("select[name=curr_receive]").select_option(value=cur)
58
+ sleep(0.9)
59
+ await page.locator('input[name="sum_receive"]').fill(str(amount))
60
+ sleep(0.1)
61
+ # await page.locator("div.n-form--title").first.click()
62
+ # sleep(0.1)
63
+ await page.click(".btn.n-form--btn.n-form--btn-mod")
59
64
  sleep(0.5)
60
- await fill_amount(page.locator('input[name="sum_receive"]'), str(amount))
61
- await page.wait_for_selector(".btn.n-form--btn.n-form--btn-mod", state="visible", timeout=3000)
62
- sleep(1.5)
63
- await click_send(page.locator(".btn.n-form--btn.n-form--btn-mod:not(.repeat)"))
64
- await page.locator(".note_txt").wait_for(state="visible", timeout=6000)
65
+ await page.click(".btn.n-form--btn.n-form--btn-mod")
66
+ sleep(1.2)
67
+ if await page.locator(".input4").count():
68
+ await page.locator(".input4").fill(self.agent.auth.get("master_key"))
69
+ await page.click(".ok.button_green2")
70
+ sleep(0.4)
71
+ await page.locator(".note_txt").wait_for(state="visible")
65
72
  if await page.locator('.note_txt:has-text("successfully completed")').count():
66
73
  transaction = await page.locator(".note_txt").all_text_contents()
67
74
  trans_num = int(transaction[0].replace("Transaction #", "").split()[0])
68
75
  await page.goto("https://payeer.com/ru/account/history/")
69
- sleep(1.5)
70
76
  await page.click(f".history-id-{trans_num} a.link")
71
- await page.wait_for_selector(".ui-dialog.ui-corner-all", state="visible", timeout=5000)
72
77
  sleep(1)
73
78
  receipt = await page.query_selector(".ui-dialog.ui-corner-all")
74
- return trans_num, await receipt.screenshot(path=f"tmp/{dest}.png"), has_amount
79
+ return trans_num, await receipt.screenshot(path=f"tmp/{dest}.png"), has_amount - amount
75
80
  else:
76
81
  await self.bot.send("Payeer хз", self.uid, photo=await self.page.screenshot())
77
- raise Exception(dest, amount, cur)
82
+ return -1
78
83
  else:
79
- have_amount = float(fiat_accounts[0].strip())
80
84
  await self.bot.send(
81
- f"Payeer no have {amount}, only {have_amount}{cur} to {dest}",
85
+ f"Payeer no have {amount}, only {has_amount}{cur} to {dest}",
82
86
  self.uid,
83
87
  photo=await self.page.screenshot(),
84
88
  )
85
- raise Exception(f"Need {amount}{cur}, but has only {has_amount}")
89
+ return has_amount
86
90
 
87
91
  def check_in(
88
92
  self, amount: Decimal | int | float, cur: str, tme: datetime = None, tid: str | int = None
@@ -108,31 +112,6 @@ class Client(PmAgentClient):
108
112
  async def proof(self) -> bytes: ...
109
113
 
110
114
 
111
- async def fill_amount(loc: Locator, amount: str):
112
- await loc.wait_for(state="visible")
113
- await loc.fill(amount)
114
- sleep(2)
115
- if await loc.input_value() != amount or await loc.input_value() != amount:
116
- logging.warning("Fill amount repeated!")
117
- await fill_amount(loc, amount)
118
- else:
119
- ...
120
-
121
-
122
- async def click_send(loc1: Locator, count: int = 1):
123
- if await loc1.is_visible():
124
- await loc1.click(delay=90)
125
- sleep(2)
126
- try:
127
- await loc1.wait_for(state="hidden", timeout=2000 * count)
128
- except TimeoutError:
129
- if count < 4:
130
- logging.warning("Click repeated!")
131
- await click_send(loc1, count + 1)
132
- else:
133
- raise TimeoutError
134
-
135
-
136
115
  async def main(uid: int):
137
116
  from x_model import init_db
138
117
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-client
3
- Version: 0.0.110
3
+ Version: 0.0.112
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
@@ -33,7 +33,7 @@ xync_client/BitGet/agent.py,sha256=YVs3bDY0OcEJGU7m2A8chzO6PFhWDnQQrA-E6MVkBBg,3
33
33
  xync_client/BitGet/ex.py,sha256=nAexKRkguIhq4fYP1tkIaou6oBFjjV2xwlajlJ-9DAE,3757
34
34
  xync_client/BitGet/etype/ad.py,sha256=fysSW47wGYjSOPUqY864z857AJz4gjN-nOkI1Jxd27U,1838
35
35
  xync_client/BitPapa/ex.py,sha256=U-RRB_RSOtErfRgxOZYWegZ_td_uZO37YKo3Jxchf_w,912
36
- xync_client/Bybit/InAgent.py,sha256=B8lyQaJyI9iZbpYOm-GGNOynvIHEwOgyXCUrz7o_BMs,20849
36
+ xync_client/Bybit/InAgent.py,sha256=OgzDZTwKh0uHsSdRNKZnX4LnA6kHcxLn6fRsS8WRVqE,20855
37
37
  xync_client/Bybit/agent.py,sha256=ypo2MXLP5IAjJto1r0WXu1bLYgyON7mXE0XBL95LeDg,58801
38
38
  xync_client/Bybit/ex.py,sha256=DgPOmnjphcSCSsO4ZQjnIlWICNzdtKhNIpVsU93s99k,4707
39
39
  xync_client/Bybit/order.py,sha256=H4UIb8hxFGnw1hZuSbr0yZ4qeaCOIZOMc6jEst0ycBs,1713
@@ -71,7 +71,7 @@ xync_client/Pms/Alfa/state.json,sha256=MKE6vl-JsJO9PNCVqoQgBgYZTgYkHCas7USwl8QFt
71
71
  xync_client/Pms/MTS/__init__.py,sha256=P_E7W46IZEk8RsEgl7H1xV3JplMT5l9vYQYTYyNbyQ8,2101
72
72
  xync_client/Pms/Ozon/__init__.py,sha256=EvQZDSPv0fOT2hNCTP44nXHOIEQvP5bQf_7HVLiZc2I,4123
73
73
  xync_client/Pms/Payeer/.gitignore,sha256=sWORdRp8ROppV2CsMEDJ3M_SokrNWCf8b1hlaNs64hg,12
74
- xync_client/Pms/Payeer/__init__.py,sha256=V9I1qCpdSc3TafUN8JW8xK3qsovU6CB_7cGx2hRuWVs,6642
74
+ xync_client/Pms/Payeer/__init__.py,sha256=UfhsgZC1jKjTgggZZquQwC672ibQaW1_WNhi4xkBxPY,5919
75
75
  xync_client/Pms/Payeer/api.py,sha256=bb8qrlPYyWafel1VR-2nate6xBeRZAVciFJblHygfAs,549
76
76
  xync_client/Pms/Payeer/login.py,sha256=5PQ87zzk-0AXNNNy12jKUyp1Ub-eanqZVjrjsiIYcgg,1796
77
77
  xync_client/Pms/Sber/__init__.py,sha256=dxQfd9ZPhFTc_C4xrwaxrV6p0SijDCLNzBeUv3oQG38,4926
@@ -94,7 +94,7 @@ xync_client/TgWallet/order.py,sha256=BOmBx5WWfJv0-_-A8DcR-Xd8utqO_VTmSqSegm0cteQ
94
94
  xync_client/TgWallet/pyd.py,sha256=Ys3E8b3RLuyQ26frWT0F0BorkNxVpxnd18tY4Gp9dik,5636
95
95
  xync_client/TgWallet/pyro.py,sha256=2K7QWdo48k4MbbgQt90gdz_HiPck69Njm4xaMjIVgoo,1440
96
96
  xync_client/TgWallet/web.py,sha256=kDcv9SKKQPe91mw1qJBpbuyKYCAmZdfdHJylHumLBVU,1608
97
- xync_client-0.0.110.dist-info/METADATA,sha256=LH2TmZzXb8CAwblXRMNac30y4j4h4A9ynDkqVkhqVsA,990
98
- xync_client-0.0.110.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- xync_client-0.0.110.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
100
- xync_client-0.0.110.dist-info/RECORD,,
97
+ xync_client-0.0.112.dist-info/METADATA,sha256=LBt0MQTmdDZSQqq8-Tq6vVzFWa7gsP-Z2Ueuguc0hn4,990
98
+ xync_client-0.0.112.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ xync_client-0.0.112.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
100
+ xync_client-0.0.112.dist-info/RECORD,,