xync-client 0.0.134__tar.gz → 0.0.136__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.134/xync_client.egg-info → xync_client-0.0.136}/PKG-INFO +1 -1
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/InAgent.py +32 -18
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/agent.py +6 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/etype/order.py +1 -1
- {xync_client-0.0.134 → xync_client-0.0.136/xync_client.egg-info}/PKG-INFO +1 -1
- {xync_client-0.0.134 → xync_client-0.0.136}/.env.sample +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/.gitignore +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/README.md +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/makefile +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/pyproject.toml +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/setup.cfg +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/TestAgent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/TestAsset.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/TestEx.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/TestOrder.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/Exception.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/PmAgent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Abc/xtype.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/BitPapa/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/order.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Gmail/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/KuCoin/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Mexc/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/MTS/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Ozon/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Payeer/.gitignore +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Payeer/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Payeer/api.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Payeer/login.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Sber/utils.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Volet/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Xync/__main__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Xync/ed.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/Pms/Yandex/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/ex.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/__init__.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/details.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/loader.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client.egg-info/SOURCES.txt +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client.egg-info/requires.txt +0 -0
- {xync_client-0.0.134 → xync_client-0.0.136}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
import re
|
|
4
|
-
from datetime import datetime, timezone
|
|
4
|
+
from datetime import datetime, timezone, timedelta
|
|
5
5
|
from uuid import uuid4
|
|
6
6
|
|
|
7
7
|
import websockets
|
|
@@ -11,6 +11,8 @@ 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
|
|
15
|
+
from tortoise.timezone import now
|
|
14
16
|
from tortoise.transactions import in_transaction
|
|
15
17
|
|
|
16
18
|
from xync_client.Abc.PmAgent import PmAgentClient
|
|
@@ -115,30 +117,46 @@ class InAgentClient(BaseInAgentClient):
|
|
|
115
117
|
f"Order {order.id} created at {order.createDate}, not paid yet"
|
|
116
118
|
)
|
|
117
119
|
continue
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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)
|
|
127
132
|
|
|
128
133
|
if not is_new: # если по этому платежу уже отпущен другая продажа
|
|
129
134
|
continue
|
|
130
135
|
|
|
131
136
|
# если висят незавершенные продажи с такой же суммой
|
|
132
137
|
pos = (await self.agent_client.get_orders_active(1))["result"]
|
|
133
|
-
|
|
138
|
+
pos = [
|
|
134
139
|
o
|
|
135
140
|
for o in pos.get("items", [])
|
|
136
141
|
if (
|
|
137
142
|
o["amount"] == order.amount
|
|
138
143
|
and o["id"] != upd.id
|
|
144
|
+
and o.paymentTermList[0].accountNo
|
|
145
|
+
== order.paymentTermList[0].accountNo
|
|
139
146
|
and int(order.createDate) < int(o["createDate"]) + 3600 * 000
|
|
140
147
|
)
|
|
141
|
-
]
|
|
148
|
+
]
|
|
149
|
+
curex = await models.CurEx.get(
|
|
150
|
+
cur__ticker=order.currencyId, ex=self.agent_client.ex_client.ex
|
|
151
|
+
)
|
|
152
|
+
pos_db = await models.Order.filter(
|
|
153
|
+
exid__not=order.id,
|
|
154
|
+
cred_id=order_db.cred_id,
|
|
155
|
+
amount=int(float(order.amount) * 10**curex.scale),
|
|
156
|
+
status__not_in=[OrderStatus.completed, OrderStatus.canceled],
|
|
157
|
+
created_at__gt=now() - timedelta(hours=1),
|
|
158
|
+
)
|
|
159
|
+
if pos or pos_db:
|
|
142
160
|
await self.agent_client.ex_client.bot.send(
|
|
143
161
|
f"[Duplicate amount!]"
|
|
144
162
|
f"(https://www.bybit.com/ru-RU/p2p/orderList/{order.id})",
|
|
@@ -267,7 +285,7 @@ class InAgentClient(BaseInAgentClient):
|
|
|
267
285
|
|
|
268
286
|
async def money_upd(self, order_db: models.Order):
|
|
269
287
|
# обновляем остаток монеты
|
|
270
|
-
await order_db.fetch_related("ad__pair_side__pair", "cred")
|
|
288
|
+
await order_db.fetch_related("ad__pair_side__pair", "cred", "transfer")
|
|
271
289
|
ass = await models.Asset.get(
|
|
272
290
|
addr__coin_id=order_db.ad.pair_side.pair.coin_id, addr__actor=self.agent_client.actor
|
|
273
291
|
)
|
|
@@ -330,11 +348,7 @@ class InAgentClient(BaseInAgentClient):
|
|
|
330
348
|
# отправляем деньги
|
|
331
349
|
tid, img, rest_amount = await pma.send(dest=dest, amount=fmt_am, cur=cur)
|
|
332
350
|
# создаем перевод в бд
|
|
333
|
-
t, _ = await models.Transfer.update_or_create(
|
|
334
|
-
{"amount": order_db.amount},
|
|
335
|
-
order=order_db,
|
|
336
|
-
pmid=tid,
|
|
337
|
-
)
|
|
351
|
+
t, _ = await models.Transfer.update_or_create({"order": order_db, "amount": order_db.amount}, pmid=tid)
|
|
338
352
|
await self.send_receipt(str(order_db.exid), tid) # отправляем продавцу чек
|
|
339
353
|
logging.info(f"Order {order_db.exid} PAID at {datetime.now()}: {fmt_am}!")
|
|
340
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
|
):
|
|
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
|
|
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
|