xync-client 0.0.145__py3-none-any.whl → 0.0.148__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.

Potentially problematic release.


This version of xync-client might be problematic. Click here for more details.

@@ -113,7 +113,7 @@ class Ad(BaseAd):
113
113
  recommend: bool = None # for initial actualize
114
114
  recommendTag: str = None # for initial actualize
115
115
  remark: str = Field(serialization_alias="auto_msg")
116
- side: Literal[0, 1] = None # for initial actualize # 0 - покупка, 1 - продажа (для мейкера, т.е КАКАЯ объява)
116
+ side: Literal[0, 1] = None # for initial actualize # 0 - покупка, 1 - продажа (для мейкера, т.е КАКАЯ объява)
117
117
  status: Literal[10, 20, 30] # 10: online; 20: offline; 30: completed
118
118
  symbolInfo: SymbolInfo = None # for initial actualize
119
119
  tokenId: str = None # for initial actualize
@@ -52,6 +52,7 @@ class CredEpyd(CredExOut):
52
52
  paymentExt5: str
53
53
  paymentExt6: str
54
54
  paymentTemplateVersion: int
55
+ securityRiskToken: str = ""
55
56
 
56
57
 
57
58
  class MyCredEpyd(CredEpyd): # todo: заменить везде где надо CredEpyd -> MyCredEpyd
@@ -1,4 +1,3 @@
1
- from datetime import datetime
2
1
  from enum import IntEnum
3
2
  from typing import Literal
4
3
 
@@ -45,6 +44,12 @@ class StatusApi(IntEnum):
45
44
  waiting_for_objection = 110
46
45
 
47
46
 
47
+ class TakeAdReq(BaseModel):
48
+ ad_id: int | str
49
+ amount: float
50
+ pm_id: int = None
51
+
52
+
48
53
  class OrderRequest(BaseModel):
49
54
  class Side(IntEnum):
50
55
  BUY = 0
@@ -60,33 +65,46 @@ class OrderRequest(BaseModel):
60
65
  flag: Literal["amount", "quantity"]
61
66
  version: str = "1.0"
62
67
  securityRiskToken: str = ""
68
+ isFromAi: bool = False
69
+
70
+
71
+ class OrderSellRequest(OrderRequest):
72
+ paymentId: str
73
+ paymentType: str
63
74
 
64
75
 
65
76
  class PreOrderResp(BaseModel):
66
- price: str # float
67
- curPrice: str
68
- totalAmount: float
69
- minAmount: float
70
- maxAmount: float
71
- minQuantity: float
72
- maxQuantity: float
77
+ id: str # bigint
78
+ price: str # float .cur.scale
79
+ lastQuantity: str # float .coin.scale
80
+ curPrice: str # hex 32
81
+ lastPrice: str # float .cur.scale # future
82
+ isOnline: bool
83
+ lastLogoutTime: str # timestamp(0)+0
73
84
  payments: list[str] # list[int]
74
85
  status: Literal[10, 20]
75
- paymentTerms: list
76
- paymentPeriod: Literal[15]
77
- lastQuantity: float
78
- lastPrice: float
79
- isOnline: bool
80
- lastLogoutTime: datetime
81
- itemPriceAvailableTime: datetime
82
- itemPriceValidTime: int # 45000
86
+ paymentTerms: list # empty
87
+ paymentPeriod: Literal[15, 30, 60]
88
+ totalAmount: str # float .cur.scale
89
+ minAmount: str # float .cur.scale
90
+ maxAmount: str # float .cur.scale
91
+ minQuantity: str # float .coin.scale
92
+ maxQuantity: str # float .coin.scale
93
+ itemPriceAvailableTime: str # timestamp(0)+0
94
+ itemPriceValidTime: Literal["45000"]
83
95
  itemType: Literal["ORIGIN"]
96
+ shareItem: bool # False
84
97
 
85
98
 
86
99
  class OrderResp(BaseModel):
87
100
  orderId: str
88
101
  isNeedConfirm: bool
102
+ confirmId: str = ""
89
103
  success: bool
104
+ securityRiskToken: str = ""
105
+ riskTokenType: Literal["challenge"] = None
106
+ riskVersion: Literal["1", "2"] = None
107
+ needSecurityRisk: bool
90
108
  isBulkOrder: bool
91
109
  confirmed: str = None
92
110
  delayTime: str
@@ -92,8 +92,8 @@ class GmClient(HasAbotUid):
92
92
 
93
93
  return {"id": message_id, "subject": subject, "from": from_email, "date": date, "body": body}
94
94
 
95
- async def mail_confirm(self, amount: float, dt: datetime):
96
- if email := self._get_last_email("Volet.com", "Please Confirm Withdrawal"):
95
+ async def volet_confirm(self, amount: float, dt: datetime):
96
+ if email := self._get_last_email("noreply@volet.com", "Please Confirm Withdrawal"): # "Volet.com"
97
97
  date = datetime.strptime(email["date"].split(",")[1].split(" +")[0], "%d %b %Y %H:%M:%S")
98
98
  if match := re.search(r"Amount: <b>([\d.]+) [A-Z]{3}</b>", email["body"]):
99
99
  amt = float(match.group(1))
@@ -107,6 +107,19 @@ class GmClient(HasAbotUid):
107
107
  await self.receive("А нет запросов от волета")
108
108
  return False
109
109
 
110
+ async def bybit_code(self, dt: datetime) -> str | None:
111
+ if email := self._get_last_email("Bybit", "[Bybit]Security Code for Your Bybit Account"):
112
+ date = datetime.strptime(email["date"].split(",")[1].split(" +")[0], "%d %b %Y %H:%M:%S")
113
+ if match := re.search(r'<span style="font-size:28pt;color:#ff9c2e">(\d{6})</span>', email["body"]):
114
+ code = match.group(1)
115
+
116
+ if email and date > dt and code:
117
+ get(f"https://account.volet.com/verify/{code}")
118
+ return code
119
+
120
+ await self.receive("А нет запросов от волета")
121
+ return None
122
+
110
123
 
111
124
  async def _test():
112
125
  from x_model import init_db
@@ -115,7 +128,7 @@ async def _test():
115
128
 
116
129
  gm = await Gmail.get(id=1).prefetch_related("user__username")
117
130
  gmc = GmClient(gm)
118
- await gmc.mail_confirm(amount=90, dt=datetime.now())
131
+ await gmc.volet_confirm(amount=90, dt=datetime.now())
119
132
 
120
133
 
121
134
  if __name__ == "__main__":
@@ -22,6 +22,7 @@ from playwright.async_api import async_playwright, Playwright, Error
22
22
 
23
23
  # noinspection PyProtectedMember
24
24
  from playwright._impl._errors import TimeoutError
25
+ from tortoise.timezone import now
25
26
  from xync_bot import XyncBot
26
27
  from xync_schema.models import TopUp, TopUpAble, PmAgent, Transfer
27
28
 
@@ -139,7 +140,7 @@ class Client(PmAgentClient):
139
140
  async def send(self, t: Transfer) -> tuple[str, bytes] | float:
140
141
  dest, cur = t.order.cred.detail, t.order.cred.pmcur.cur.ticker
141
142
  amount = round(t.order.amount * 10**-t.order.cred.pmcur.cur.scale, t.order.cred.pmcur.cur.scale)
142
- self.last_active = datetime.now()
143
+ self.last_active = now()
143
144
  page = self.page
144
145
  if not page.url.startswith(self.pages.SEND):
145
146
  try:
@@ -181,7 +182,7 @@ class Client(PmAgentClient):
181
182
  await page.click(f".history-id-{trans_num} a.link")
182
183
  sleep(1)
183
184
  receipt = await page.query_selector(".ui-dialog.ui-corner-all")
184
- return trans_num, await receipt.screenshot(path=f"tmp/{trans_num}.png")
185
+ return trans_num, receipt and await receipt.screenshot(path=f"tmp/{trans_num}.png")
185
186
  else:
186
187
  await self.receive("Payeer хз", photo=await self.page.screenshot())
187
188
  return -1
@@ -192,10 +193,10 @@ class Client(PmAgentClient):
192
193
  )
193
194
  return has_amount
194
195
 
195
- def check_in(
196
+ async def check_in(
196
197
  self, amount: Decimal | int | float, cur: str, dt: datetime = None, tid: str | int = None
197
198
  ) -> tuple[Decimal | None, int | None]:
198
- history = self.api.history(type="incoming", append=tid, count=3)
199
+ history = self.api.history(type="incoming", count=10)
199
200
  if tid:
200
201
  return (t := history.get(tid)) and Decimal(t["creditedAmount"])
201
202
  ts: list[dict] = [
@@ -204,7 +205,8 @@ class Client(PmAgentClient):
204
205
  if (
205
206
  amount <= Decimal(h["creditedAmount"]) <= ceil(amount)
206
207
  and h["creditedCurrency"] == cur
207
- and datetime.fromisoformat(h["date"]) > dt - timedelta(minutes=1)
208
+ # todo: wrong tz
209
+ and datetime.fromisoformat(h["date"]) > dt - timedelta(minutes=3) # +180(tz)-5
208
210
  )
209
211
  ]
210
212
  if not (t := ts and ts[0]):
@@ -174,7 +174,7 @@ class Client(PmAgentClient):
174
174
  elif self.agent.user.username.session:
175
175
  if not (code := await self.wait_for_code(volet_bot_id, topic, hg)):
176
176
  if 1: # todo: Is mail_confirm required?
177
- if _mcr := await self.gmail.mail_confirm(amount, t.updated_at):
177
+ if _mcr := await self.gmail.volet_confirm(amount, t.updated_at):
178
178
  ...
179
179
  # todo: click Continue
180
180
  if not (code := await self.wait_for_code(volet_bot_id, topic, hg)):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-client
3
- Version: 0.0.145
3
+ Version: 0.0.148
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
@@ -8,6 +8,9 @@ Requires-Python: >=3.11
8
8
  Requires-Dist: asynchuobi
9
9
  Requires-Dist: bs4
10
10
  Requires-Dist: bybit-p2p
11
+ Requires-Dist: google-api-python-client
12
+ Requires-Dist: google-auth-httplib2
13
+ Requires-Dist: google-auth-oauthlib
11
14
  Requires-Dist: requests-toolbelt
12
15
  Requires-Dist: msgspec
13
16
  Requires-Dist: python-binance
@@ -2,17 +2,18 @@ xync_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  xync_client/details.py,sha256=21itVPCgAtaYRR1H9J9oYudj95gafcFjExUN6QL17OI,1330
3
3
  xync_client/loader.py,sha256=hxf8ob50DO7r_qjr2qBoO7IyjkXeHHzVQ63YjXerjoU,600
4
4
  xync_client/pm_unifier.py,sha256=T2Xh-tvcu114P2YBI6RK_XDiaIhyq6ABMrXDuXPlx7A,6541
5
- xync_client/Abc/Agent.py,sha256=S2f8VEejC3LHT7oUJhilZCYuhcQVREX-3uzfc06ZyO4,5633
5
+ xync_client/Abc/AdLoader.py,sha256=-9UpLgFdIKcpQ2Z6PLCin7c0JmlUQ66WMouNUTWyEHg,13362
6
+ xync_client/Abc/Agent.py,sha256=FmKT4EefJn2oNc9icIgxDqoJoRe33FGgaNwBw5P5B4A,5727
6
7
  xync_client/Abc/Asset.py,sha256=hlgyFaU9byr2N2r8Heh-_ICx49SKuKxfRTUA4yQWmEw,454
7
8
  xync_client/Abc/Auth.py,sha256=OPQXN7_XYQZP9431ylFksd6JDusbKG8N_1g6CXTZ6yY,1495
8
9
  xync_client/Abc/BaseTest.py,sha256=vaAs5Z4HYV7k_C3zQz6JKO75s2hXtVbBI3-0Srkzv5Q,2388
9
- xync_client/Abc/Ex.py,sha256=n41-XCjoIV-KpC_lK3jO049tQKbFmE0eDU3SDlgZTws,12986
10
+ xync_client/Abc/Ex.py,sha256=6i78hduLVULyaTYlKbu7hsSrCIWVGrFB0HMll0TeSxM,13091
10
11
  xync_client/Abc/Exception.py,sha256=Sts7RpP370NBdjaH_cyXDdHtjge8zXNUGWCrKw49Zyk,482
11
12
  xync_client/Abc/HasAbotUid.py,sha256=LsTHHjMHBauCwJoqgDa9Lx4R6xsDOHfsN4jM539Bpqg,279
12
13
  xync_client/Abc/InAgent.py,sha256=XLf5czbxxEimsIIe653buoP7OsWZD6mc2w37q4TkNd0,703
13
14
  xync_client/Abc/Order.py,sha256=7-FGIJu5z9aYi0A_eJV4F-cp_6Mz_izNpefexDQZvHw,2428
14
- xync_client/Abc/PmAgent.py,sha256=5ihM_TY40SzHT4lZ_BDYtO1lqQoVAO3aXy_W8hRICHs,4359
15
- xync_client/Abc/xtype.py,sha256=o1JEzWmEXCPddtlqWZ6HRTZTKX6SAnvsztbASj21zOQ,2584
15
+ xync_client/Abc/PmAgent.py,sha256=8ozQDxriAwtU2cNsJleuWcZ2ZdNeZPhgwO6l6jvi0MY,4350
16
+ xync_client/Abc/xtype.py,sha256=FRvYm_VeQiCNOzjw2Ey1iwl9PC8hfjcAqKEEpU5_7Fc,2607
16
17
  xync_client/Binance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
18
  xync_client/Binance/binance_async.py,sha256=LP2DZaHwkfsp_4Tjvetb-1ntjQtJfODF0OgZpoPx4KU,2688
18
19
  xync_client/Binance/earn_api.py,sha256=hvk0MaVTLszIglQXVhbUjGcaHfbF9Ul7FFXmy94U2so,4411
@@ -35,20 +36,20 @@ xync_client/BitGet/agent.py,sha256=YVs3bDY0OcEJGU7m2A8chzO6PFhWDnQQrA-E6MVkBBg,3
35
36
  xync_client/BitGet/ex.py,sha256=uEvvXuLaJv8o8BFi0bMA3XyBuTfVDWagAjLOHZl-xlE,3765
36
37
  xync_client/BitGet/etype/ad.py,sha256=fysSW47wGYjSOPUqY864z857AJz4gjN-nOkI1Jxd27U,1838
37
38
  xync_client/BitPapa/ex.py,sha256=U-RRB_RSOtErfRgxOZYWegZ_td_uZO37YKo3Jxchf_w,912
38
- xync_client/Bybit/InAgent.py,sha256=50c9LGJuxe2T3qOL_2qNWIesJHmlmaj-oSx8dDnk9sY,26002
39
- xync_client/Bybit/agent.py,sha256=wGYzvHGuKomNfEvFmosXQVscx9VXlzexc1Ic8sm-wA4,61894
39
+ xync_client/Bybit/InAgent.py,sha256=1Y4ZyxqAY8xbAflku48fJjjlSs4pOz2mFFJSO9iWg8w,26405
40
+ xync_client/Bybit/agent.py,sha256=VftYukdo0nYysxUMFMwVpKH6xmeP4LVfnvoT3SIWCFo,51978
40
41
  xync_client/Bybit/ex.py,sha256=3oARvReBoDs90FzQY31-L-q_YU-TIRbvWB7z4lwESsA,4715
41
42
  xync_client/Bybit/order.py,sha256=H4UIb8hxFGnw1hZuSbr0yZ4qeaCOIZOMc6jEst0ycBs,1713
42
43
  xync_client/Bybit/web_earn.py,sha256=qjqS10xlFc8r40IhDdPZ0LxA2dFEGbvBGXdsrUUJCMo,3019
43
44
  xync_client/Bybit/web_p2p.py,sha256=sAXzK03t6jwDnz4rrvP2IzI0KxfKa7C_5GuzH1HwLuA,11768
44
45
  xync_client/Bybit/ws.py,sha256=OQjZHo_MiAH1dlOs3c-aUZBKyqToNTmH560udh6RYDE,1431
45
- xync_client/Bybit/etype/ad.py,sha256=HJOHi9KrbLQMpwEyd4oA8436QTNRqrd2HWFF-JNZGDo,8066
46
- xync_client/Bybit/etype/cred.py,sha256=dgFExLB4e5Wf6SqfU9SOdeooHQa84DRbTGm_OJhNw_o,1354
47
- xync_client/Bybit/etype/order.py,sha256=rPXw9eHJW3afVPQDRiooUkHfQhmqJ5fTdZ4vKdO6uHQ,8273
46
+ xync_client/Bybit/etype/ad.py,sha256=pCD0I9SL4Paaegs85fHGtvZ-7Cm917AQXYel0k1MbY0,8065
47
+ xync_client/Bybit/etype/cred.py,sha256=qDQUsMqLV4XtXKYWZV4f805kLDf7AdcPYscHRA-IMBo,1386
48
+ xync_client/Bybit/etype/order.py,sha256=668UJdCNEnvnalmbtTQ9Tw50arJtgpV_09GHu0iyaRU,8870
48
49
  xync_client/Gate/ex.py,sha256=QbhB3u7TWnvVGD-AknB2nay6KZjEXQ-1JT9UacX4sWI,3735
49
50
  xync_client/Gate/premarket.py,sha256=IW-CgkmNJePJR2j_NRfULNKTePMX35XlhldqdiO76zY,2138
50
51
  xync_client/Gate/etype/ad.py,sha256=-EwtFcOWWvtE6UjaOdsuXWDTCVjAIRK0kSEsqPP4Yls,1296
51
- xync_client/Gmail/__init__.py,sha256=wNEUA1L9lvLtYoIv2fHEsb6msO9oB9QTF2OkzuCPMcM,4778
52
+ xync_client/Gmail/__init__.py,sha256=9JGT8PyzJaOTVvaFV0Gki3Fdo6Bp6m6DnWOPGZJ-eAA,5436
52
53
  xync_client/Htx/agent.py,sha256=rOURgTeY9TsA-IzT78l5-Ze91i0x1PY683mrX38MSgs,7356
53
54
  xync_client/Htx/earn.py,sha256=jL6eRwytZEMRom_3bFm1DYthi_GFg-E1Mm3ZDXENHSg,2386
54
55
  xync_client/Htx/ex.py,sha256=GuWK5lA_MvtSd-0DhKf2MAstKvZMHhc3BIiZSgdwZv4,6074
@@ -73,13 +74,13 @@ xync_client/Pms/Alfa/state.json,sha256=MKE6vl-JsJO9PNCVqoQgBgYZTgYkHCas7USwl8QFt
73
74
  xync_client/Pms/MTS/__init__.py,sha256=P_E7W46IZEk8RsEgl7H1xV3JplMT5l9vYQYTYyNbyQ8,2101
74
75
  xync_client/Pms/Ozon/__init__.py,sha256=EvQZDSPv0fOT2hNCTP44nXHOIEQvP5bQf_7HVLiZc2I,4123
75
76
  xync_client/Pms/Payeer/.gitignore,sha256=sWORdRp8ROppV2CsMEDJ3M_SokrNWCf8b1hlaNs64hg,12
76
- xync_client/Pms/Payeer/__init__.py,sha256=fxYbRHq1x1pCKQuo-blydZBWrYMSebuYZjRrD6k-e-E,9905
77
+ xync_client/Pms/Payeer/__init__.py,sha256=0cE2NBaf_XA1j4XBFjd0FhhCVNaPxwDTAvUTsdmiQes,9984
77
78
  xync_client/Pms/Payeer/api.py,sha256=bb8qrlPYyWafel1VR-2nate6xBeRZAVciFJblHygfAs,549
78
79
  xync_client/Pms/Payeer/login.py,sha256=GyNwB-GKE_1nlkbZJ0KNI-EnCT0j_S9ogFdn-ufb-zU,3053
79
80
  xync_client/Pms/Sber/__init__.py,sha256=dxQfd9ZPhFTc_C4xrwaxrV6p0SijDCLNzBeUv3oQG38,4926
80
81
  xync_client/Pms/Sber/utils.py,sha256=gIeJspwvoBbOBt-fjxwW4WDHPoL2Evs8LVufsjrFOfo,1870
81
82
  xync_client/Pms/Tinkoff/__init__.py,sha256=ZyLvBEUn-vh-85oPUUDS586AHgvx3c-mkQE3yBQtbw8,5580
82
- xync_client/Pms/Volet/__init__.py,sha256=Zn15NJRZH9pwwVjiR1Ao77MN6mTaA45B42fr0NJweno,12047
83
+ xync_client/Pms/Volet/__init__.py,sha256=JGd1QDn_H-tqck932cbARGLSOCHmnHKIns05Ll8dowA,12048
83
84
  xync_client/Pms/Volet/api.py,sha256=6_dH2rzmyyvha3PeoiZdSltiAzKDWn8roSUJOAErX4M,3673
84
85
  xync_client/Pms/Volet/pl.py,sha256=l7lvUrpjFoObXPHaseOIAcSbkNqJdpy6OLDutxYJH3U,2451
85
86
  xync_client/Pms/Volet/_todo_req/req.mjs,sha256=ut3Jw37rL5lY7SskjZ9f1l0VE33tuP-PZEYUTcJMc2I,817
@@ -96,7 +97,7 @@ xync_client/TgWallet/order.py,sha256=BOmBx5WWfJv0-_-A8DcR-Xd8utqO_VTmSqSegm0cteQ
96
97
  xync_client/TgWallet/pyd.py,sha256=Ys3E8b3RLuyQ26frWT0F0BorkNxVpxnd18tY4Gp9dik,5636
97
98
  xync_client/TgWallet/pyro.py,sha256=2K7QWdo48k4MbbgQt90gdz_HiPck69Njm4xaMjIVgoo,1440
98
99
  xync_client/TgWallet/web.py,sha256=kDcv9SKKQPe91mw1qJBpbuyKYCAmZdfdHJylHumLBVU,1608
99
- xync_client-0.0.145.dist-info/METADATA,sha256=Czpg727G7V7cQcbZ7mDkx0Egv3bf3xtoSgH5K1Y8QgU,1037
100
- xync_client-0.0.145.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
101
- xync_client-0.0.145.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
102
- xync_client-0.0.145.dist-info/RECORD,,
100
+ xync_client-0.0.148.dist-info/METADATA,sha256=v2HPGq4q5LhjcUCezyrU7_37urzKs6je3wy5XSWmTKM,1149
101
+ xync_client-0.0.148.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
+ xync_client-0.0.148.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
103
+ xync_client-0.0.148.dist-info/RECORD,,