xync-client 0.0.155__tar.gz → 0.0.155.dev2__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.155/xync_client.egg-info → xync_client-0.0.155.dev2}/PKG-INFO +1 -1
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/agent.py +36 -37
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/agent.py +23 -36
- {xync_client-0.0.155 → xync_client-0.0.155.dev2/xync_client.egg-info}/PKG-INFO +1 -1
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/.env.sample +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/.gitignore +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/README.md +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/makefile +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/pyproject.toml +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/setup.cfg +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/TestAgent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/TestAsset.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/TestEx.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/TestOrder.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/AdLoader.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/Exception.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/HasAbotUid.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/PmAgent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Abc/xtype.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/etype/pm.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BitGet/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/BitPapa/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/InAgent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/etype/cred.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/etype/order.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/order.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Bybit/ws.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Gate/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Gmail/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/etype/test.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/KuCoin/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Mexc/agent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Mexc/api.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Mexc/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Mexc/etype/order.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Mexc/etype/pm.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Mexc/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/.gitignore +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Alfa/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Alfa/state.json +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/MTS/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Ozon/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Payeer/.gitignore +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Payeer/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Payeer/api.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Payeer/login.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Sber/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Sber/utils.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Tinkoff/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Volet/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Volet/_todo_req/req.mjs +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Volet/_todo_req/req.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Volet/api.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Volet/pl.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Xync/__main__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Xync/ed.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/Pms/Yandex/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/ex.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/__init__.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/details.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/loader.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client.egg-info/SOURCES.txt +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client.egg-info/requires.txt +0 -0
- {xync_client-0.0.155 → xync_client-0.0.155.dev2}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -97,7 +97,7 @@ class AgentClient(BaseAgentClient, InAgentClient): # Bybit client
|
|
|
97
97
|
def __init__(self, agent: Agent, ex_client: ExClient, fbot: FileClient, bbot: XyncBot, **kwargs):
|
|
98
98
|
super().__init__(agent, ex_client, fbot, bbot, **kwargs)
|
|
99
99
|
self.sec_hdrs = {
|
|
100
|
-
"accept-language": "ru,en;q=0.
|
|
100
|
+
"accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
|
|
101
101
|
"gdfp": agent.auth["Risktoken"],
|
|
102
102
|
"tx-id": agent.auth["Risktoken"],
|
|
103
103
|
}
|
|
@@ -1052,21 +1052,21 @@ class AgentClient(BaseAgentClient, InAgentClient): # Bybit client
|
|
|
1052
1052
|
i = 0
|
|
1053
1053
|
while True:
|
|
1054
1054
|
try:
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
if
|
|
1058
|
-
ad: Ad =
|
|
1055
|
+
bs = await self.ads(coinex, curex, False, None, None, 1000, False, post_pmexs)
|
|
1056
|
+
bs = [b for b in bs if float(b.price) < 89.56 or int(b.userId) in mcs.keys()]
|
|
1057
|
+
if bs:
|
|
1058
|
+
ad: Ad = bs[0]
|
|
1059
1059
|
await self.bbot.send(
|
|
1060
1060
|
193017646,
|
|
1061
1061
|
f"price: {ad.price}\nnick: {ad.nickName}\nprice: {ad.price}"
|
|
1062
1062
|
f"\nqty: {ad.quantity} [{ad.minAmount}-{ad.maxAmount}]",
|
|
1063
1063
|
)
|
|
1064
|
-
am = min(float(ad.maxAmount), max(
|
|
1064
|
+
am = min(float(ad.maxAmount), max(700 + i, float(ad.minAmount)))
|
|
1065
1065
|
req = TakeAdReq(
|
|
1066
1066
|
ad_id=ad.id,
|
|
1067
1067
|
amount=am,
|
|
1068
|
-
pm_id=
|
|
1069
|
-
is_sell=
|
|
1068
|
+
pm_id=40,
|
|
1069
|
+
is_sell=False,
|
|
1070
1070
|
coin_id=1,
|
|
1071
1071
|
cur_id=1,
|
|
1072
1072
|
)
|
|
@@ -1074,33 +1074,33 @@ class AgentClient(BaseAgentClient, InAgentClient): # Bybit client
|
|
|
1074
1074
|
# order: OrderFull = OrderFull(**self.api.get_order_details(orderId=ord_resp.orderId)["result"])
|
|
1075
1075
|
order: OrderFull = await self.get_order_info(ord_resp.orderId)
|
|
1076
1076
|
odb = await self.create_order(order)
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
# res = await self.pm_clients[366].
|
|
1077
|
+
t = await models.Transfer(order=odb, amount=odb.amount, updated_at=now())
|
|
1078
|
+
await t.fetch_related("order__cred__pmcur__cur")
|
|
1079
|
+
# res = await self.pm_clients[366].send(t)
|
|
1080
|
+
self.api.mark_as_paid(
|
|
1081
|
+
orderId=str(odb.exid),
|
|
1082
|
+
paymentType=ad.payments[0], # pmex.exid
|
|
1083
|
+
paymentId=order.paymentTermList[0].id, # credex.exid
|
|
1084
|
+
)
|
|
1080
1085
|
if int(ad.userId) in mcs:
|
|
1081
|
-
mcs[int(ad.userId)].api.
|
|
1082
|
-
|
|
1083
|
-
paymentType=ad.payments[0], # pmex.exid
|
|
1084
|
-
paymentId=order.paymentTermList[0].id, # credex.exid
|
|
1085
|
-
)
|
|
1086
|
-
self.api.release_assets(orderId=order.id)
|
|
1086
|
+
mcs[int(ad.userId)].api.release_assets(orderId=order.id)
|
|
1087
|
+
await sleep(1)
|
|
1087
1088
|
...
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
ad: Ad = bs[0]
|
|
1089
|
+
ss = await self.ads(coinex, curex, True, None, None, 1000, False, post_pmexs)
|
|
1090
|
+
ss = [s for s in ss if float(s.price) > 90.42 or int(s.userId) in mcs.keys()]
|
|
1091
|
+
if ss:
|
|
1092
|
+
ad: Ad = ss[0]
|
|
1093
1093
|
await self.bbot.send(
|
|
1094
1094
|
193017646,
|
|
1095
1095
|
f"price: {ad.price}\nnick: {ad.nickName}\nprice: {ad.price}"
|
|
1096
1096
|
f"\nqty: {ad.quantity} [{ad.minAmount}-{ad.maxAmount}]",
|
|
1097
1097
|
)
|
|
1098
|
-
am = min(float(ad.maxAmount), max(
|
|
1098
|
+
am = min(float(ad.maxAmount), max(3000 + i, float(ad.minAmount)))
|
|
1099
1099
|
req = TakeAdReq(
|
|
1100
1100
|
ad_id=ad.id,
|
|
1101
1101
|
amount=am,
|
|
1102
|
-
pm_id=
|
|
1103
|
-
is_sell=
|
|
1102
|
+
pm_id=40,
|
|
1103
|
+
is_sell=True,
|
|
1104
1104
|
coin_id=1,
|
|
1105
1105
|
cur_id=1,
|
|
1106
1106
|
)
|
|
@@ -1108,17 +1108,16 @@ class AgentClient(BaseAgentClient, InAgentClient): # Bybit client
|
|
|
1108
1108
|
# order: OrderFull = OrderFull(**self.api.get_order_details(orderId=ord_resp.orderId)["result"])
|
|
1109
1109
|
order: OrderFull = await self.get_order_info(ord_resp.orderId)
|
|
1110
1110
|
odb = await self.create_order(order)
|
|
1111
|
-
t = await models.Transfer(order=odb, amount=odb.amount, updated_at=now())
|
|
1112
|
-
await t.fetch_related("order__cred__pmcur__cur")
|
|
1113
|
-
# res = await self.pm_clients[366].
|
|
1114
|
-
self.api.mark_as_paid(
|
|
1115
|
-
orderId=str(odb.exid),
|
|
1116
|
-
paymentType=ad.payments[0], # pmex.exid
|
|
1117
|
-
paymentId=order.paymentTermList[0].id, # credex.exid
|
|
1118
|
-
)
|
|
1111
|
+
# t = await models.Transfer(order=odb, amount=odb.amount, updated_at=now())
|
|
1112
|
+
# await t.fetch_related("order__cred__pmcur__cur")
|
|
1113
|
+
# res = await self.pm_clients[366].check_in(t)
|
|
1119
1114
|
if int(ad.userId) in mcs:
|
|
1120
|
-
mcs[int(ad.userId)].api.
|
|
1121
|
-
|
|
1115
|
+
mcs[int(ad.userId)].api.mark_as_paid(
|
|
1116
|
+
orderId=str(odb.exid),
|
|
1117
|
+
paymentType=ad.payments[0], # pmex.exid
|
|
1118
|
+
paymentId=order.paymentTermList[0].id, # credex.exid
|
|
1119
|
+
)
|
|
1120
|
+
self.api.release_assets(orderId=order.id)
|
|
1122
1121
|
...
|
|
1123
1122
|
except Exception as e:
|
|
1124
1123
|
logging.exception(e)
|
|
@@ -1209,7 +1208,7 @@ async def main():
|
|
|
1209
1208
|
cn = await init_db(TORM)
|
|
1210
1209
|
|
|
1211
1210
|
agent = (
|
|
1212
|
-
await models.Agent.filter(actor__ex_id=4, auth__isnull=False, status__gt=AgentStatus.off,
|
|
1211
|
+
await models.Agent.filter(actor__ex_id=4, auth__isnull=False, status__gt=AgentStatus.off, actor__person_id=1)
|
|
1213
1212
|
.prefetch_related(
|
|
1214
1213
|
"actor__ex",
|
|
1215
1214
|
"actor__person__user__gmail",
|
|
@@ -1240,7 +1239,7 @@ async def main():
|
|
|
1240
1239
|
# await cl.export_my_ads()
|
|
1241
1240
|
|
|
1242
1241
|
ms = await models.Agent.filter(
|
|
1243
|
-
actor__ex_id=4, auth__isnull=False, status__gt=AgentStatus.off, actor__person__user__id__in=[
|
|
1242
|
+
actor__ex_id=4, auth__isnull=False, status__gt=AgentStatus.off, actor__person__user__id__in=[]
|
|
1244
1243
|
).prefetch_related(
|
|
1245
1244
|
"actor__ex",
|
|
1246
1245
|
"actor__person__user__gmail",
|
|
@@ -44,7 +44,6 @@ class AgentClient(BaseAgentClient):
|
|
|
44
44
|
if resp["success"]:
|
|
45
45
|
self.agent.auth["headers"]["Token"] = resp["data"]
|
|
46
46
|
await self.agent.save(update_fields=["auth"])
|
|
47
|
-
self.session.headers["Token"] = resp["data"]
|
|
48
47
|
|
|
49
48
|
async def creds(self) -> list[test.CredEpyd]:
|
|
50
49
|
resp = await self._get("/-/x/otc/v1/user/receipt-account")
|
|
@@ -300,45 +299,33 @@ async def _test():
|
|
|
300
299
|
# _ = await cl.cred_new(cred)
|
|
301
300
|
# _creds = await cl.creds()
|
|
302
301
|
# _ = await cl.cred_del(16984748)
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if sads[0].uid == cl.actor.exid:
|
|
326
|
-
if round(sads[1].price - sads[0].price, 2) > 0.01:
|
|
327
|
-
sreq_upd.price = sads[1].price - 0.01
|
|
328
|
-
await cl.ad_upd(sreq_upd)
|
|
329
|
-
print(end="!", flush=True)
|
|
330
|
-
elif sads[0].price > 91:
|
|
331
|
-
sreq_upd.price = sads[0].price - 0.01
|
|
332
|
-
await cl.ad_upd(sreq_upd)
|
|
333
|
-
print(end="!", flush=True)
|
|
334
|
-
|
|
335
|
-
print(end=".", flush=True)
|
|
336
|
-
await sleep(15)
|
|
302
|
+
breq = GetAds(coin_id=1, cur_id=1, is_sell=False, pm_ids=[366])
|
|
303
|
+
sreq = GetAds(coin_id=1, cur_id=1, is_sell=True, pm_ids=[366])
|
|
304
|
+
breq_upd = AdUpd(id=1185713, price=87.01, **{**breq.model_dump(), "amount": 80001})
|
|
305
|
+
sreq_upd = AdUpd(id=1188929, price=92.99, **{**sreq.model_dump(), "amount": 5001})
|
|
306
|
+
bads: list[ad.Resp] = await cl.ex_client.ads(breq)
|
|
307
|
+
sads: list[ad.Resp] = await cl.ex_client.ads(sreq)
|
|
308
|
+
|
|
309
|
+
if bads[0].uid == cl.actor.exid:
|
|
310
|
+
if round(bads[0].price - bads[1].price, 2) > 0.01:
|
|
311
|
+
breq_upd.price = bads[1].price + 0.01
|
|
312
|
+
await cl.ad_upd(breq_upd)
|
|
313
|
+
elif bads[0].price < 89:
|
|
314
|
+
breq_upd.price = bads[0].price + 0.01
|
|
315
|
+
await cl.ad_upd(breq_upd)
|
|
316
|
+
|
|
317
|
+
if sads[0].uid == cl.actor.exid:
|
|
318
|
+
if round(sads[1].price - sads[0].price, 2) > 0.01:
|
|
319
|
+
sreq_upd.price = sads[1].price - 0.01
|
|
320
|
+
await cl.ad_upd(sreq_upd)
|
|
321
|
+
elif sads[0].price > 91:
|
|
322
|
+
sreq_upd.price = sads[0].price - 0.01
|
|
323
|
+
await cl.ad_upd(sreq_upd)
|
|
337
324
|
|
|
338
325
|
await cl.stop()
|
|
339
326
|
|
|
340
327
|
|
|
341
328
|
if __name__ == "__main__":
|
|
342
|
-
from asyncio import run
|
|
329
|
+
from asyncio import run
|
|
343
330
|
|
|
344
331
|
run(_test())
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|