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

@@ -11,6 +11,7 @@ from decimal import Decimal
11
11
  from playwright.async_api import async_playwright
12
12
  from pydantic import ValidationError
13
13
  from pyro_client.client.file import FileClient
14
+ from tortoise.exceptions import IntegrityError
14
15
  from tortoise.timezone import now
15
16
  from tortoise.transactions import in_transaction
16
17
 
@@ -116,15 +117,18 @@ class InAgentClient(BaseInAgentClient):
116
117
  f"Order {order.id} created at {order.createDate}, not paid yet"
117
118
  )
118
119
  continue
119
- t, is_new = await models.Transfer.update_or_create(
120
- dict(
121
- amount=int(float(order.amount) * 100),
122
- accepted_at=datetime.now(timezone.utc),
123
- order=order_db,
124
- ),
125
- # pm_id=order_db.cred.pmcur.pm_id,
126
- pmid=tid,
127
- )
120
+ try:
121
+ t, is_new = await models.Transfer.update_or_create(
122
+ dict(
123
+ amount=int(float(order.amount) * 100),
124
+ order=order_db,
125
+ ),
126
+ pmid=tid,
127
+ )
128
+ except IntegrityError as e:
129
+ logging.error(tid)
130
+ logging.error(order)
131
+ logging.exception(e)
128
132
 
129
133
  if not is_new: # если по этому платежу уже отпущен другая продажа
130
134
  continue
@@ -137,6 +141,8 @@ class InAgentClient(BaseInAgentClient):
137
141
  if (
138
142
  o["amount"] == order.amount
139
143
  and o["id"] != upd.id
144
+ and o.paymentTermList[0].accountNo
145
+ == order.paymentTermList[0].accountNo
140
146
  and int(order.createDate) < int(o["createDate"]) + 3600 * 000
141
147
  )
142
148
  ]
@@ -145,6 +151,7 @@ class InAgentClient(BaseInAgentClient):
145
151
  )
146
152
  pos_db = await models.Order.filter(
147
153
  exid__not=order.id,
154
+ cred_id=order_db.cred_id,
148
155
  amount=int(float(order.amount) * 10**curex.scale),
149
156
  status__not_in=[OrderStatus.completed, OrderStatus.canceled],
150
157
  created_at__gt=now() - timedelta(hours=1),
@@ -278,7 +285,7 @@ class InAgentClient(BaseInAgentClient):
278
285
 
279
286
  async def money_upd(self, order_db: models.Order):
280
287
  # обновляем остаток монеты
281
- await order_db.fetch_related("ad__pair_side__pair", "cred")
288
+ await order_db.fetch_related("ad__pair_side__pair", "cred", "transfer")
282
289
  ass = await models.Asset.get(
283
290
  addr__coin_id=order_db.ad.pair_side.pair.coin_id, addr__actor=self.agent_client.actor
284
291
  )
@@ -341,11 +348,7 @@ class InAgentClient(BaseInAgentClient):
341
348
  # отправляем деньги
342
349
  tid, img, rest_amount = await pma.send(dest=dest, amount=fmt_am, cur=cur)
343
350
  # создаем перевод в бд
344
- t, _ = await models.Transfer.update_or_create(
345
- {"amount": order_db.amount},
346
- order=order_db,
347
- pmid=tid,
348
- )
351
+ t, _ = await models.Transfer.update_or_create({"order": order_db, "amount": order_db.amount}, pmid=tid)
349
352
  await self.send_receipt(str(order_db.exid), tid) # отправляем продавцу чек
350
353
  logging.info(f"Order {order_db.exid} PAID at {datetime.now()}: {fmt_am}!")
351
354
 
@@ -393,6 +393,12 @@ class AgentClient(BaseAgentClient): # Bybit client
393
393
  },
394
394
  )
395
395
 
396
+ def my_reviews(self):
397
+ return self._post(
398
+ "/x-api/fiat/otc/order/appraiseList",
399
+ {"makerUserId": self.actor.exid, "page": "1", "size": "10", "appraiseType": "1"}, # "0" - bad
400
+ )
401
+
396
402
  async def get_orders_active(
397
403
  self, side: int = None, status: int = None, begin_time: int = None, end_time: int = None, token_id: str = None
398
404
  ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-client
3
- Version: 0.0.135
3
+ Version: 0.0.136
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
@@ -34,8 +34,8 @@ xync_client/BitGet/agent.py,sha256=YVs3bDY0OcEJGU7m2A8chzO6PFhWDnQQrA-E6MVkBBg,3
34
34
  xync_client/BitGet/ex.py,sha256=nAexKRkguIhq4fYP1tkIaou6oBFjjV2xwlajlJ-9DAE,3757
35
35
  xync_client/BitGet/etype/ad.py,sha256=fysSW47wGYjSOPUqY864z857AJz4gjN-nOkI1Jxd27U,1838
36
36
  xync_client/BitPapa/ex.py,sha256=U-RRB_RSOtErfRgxOZYWegZ_td_uZO37YKo3Jxchf_w,912
37
- xync_client/Bybit/InAgent.py,sha256=sbJSgqtVTuATUsEx_4vK4Du62LvodDNS8kGrLJUZBBs,24837
38
- xync_client/Bybit/agent.py,sha256=5nAKd3yiIq1NJ6gI8CDacrk0CIeaWCxu0oWu5Lbx4nM,57384
37
+ xync_client/Bybit/InAgent.py,sha256=qinC4f5Zk2FsL-EluRkEOSyEU22r4AIMjw93QxUFOjo,25290
38
+ xync_client/Bybit/agent.py,sha256=VGPW7ibNMbO6OLyl68uYw6MJmRFr-FZdkB-GizQwUg8,57605
39
39
  xync_client/Bybit/ex.py,sha256=DgPOmnjphcSCSsO4ZQjnIlWICNzdtKhNIpVsU93s99k,4707
40
40
  xync_client/Bybit/order.py,sha256=H4UIb8hxFGnw1hZuSbr0yZ4qeaCOIZOMc6jEst0ycBs,1713
41
41
  xync_client/Bybit/web_earn.py,sha256=qjqS10xlFc8r40IhDdPZ0LxA2dFEGbvBGXdsrUUJCMo,3019
@@ -95,7 +95,7 @@ xync_client/TgWallet/order.py,sha256=BOmBx5WWfJv0-_-A8DcR-Xd8utqO_VTmSqSegm0cteQ
95
95
  xync_client/TgWallet/pyd.py,sha256=Ys3E8b3RLuyQ26frWT0F0BorkNxVpxnd18tY4Gp9dik,5636
96
96
  xync_client/TgWallet/pyro.py,sha256=2K7QWdo48k4MbbgQt90gdz_HiPck69Njm4xaMjIVgoo,1440
97
97
  xync_client/TgWallet/web.py,sha256=kDcv9SKKQPe91mw1qJBpbuyKYCAmZdfdHJylHumLBVU,1608
98
- xync_client-0.0.135.dist-info/METADATA,sha256=JXBmzFXZmopOYvy9hpXKuIfFTo-jOXrx-_ZquCH36nU,1037
99
- xync_client-0.0.135.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- xync_client-0.0.135.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
101
- xync_client-0.0.135.dist-info/RECORD,,
98
+ xync_client-0.0.136.dist-info/METADATA,sha256=FZV6NGtgHsCVK3K-wDDJS2xkRGIaLzGTlrRqNPfpRm0,1037
99
+ xync_client-0.0.136.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ xync_client-0.0.136.dist-info/top_level.txt,sha256=bmYEVIIrD3v7yFwH-X15pEfRvzhuAdfsAZ2igvNI4O8,12
101
+ xync_client-0.0.136.dist-info/RECORD,,