xync-client 0.0.25.dev69__tar.gz → 0.0.25.dev73__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.25.dev69/xync_client.egg-info → xync_client-0.0.25.dev73}/PKG-INFO +1 -1
- xync_client-0.0.25.dev73/xync_client/BitGet/etype/ad.py +79 -0
- xync_client-0.0.25.dev73/xync_client/BitGet/ex.py +115 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73/xync_client.egg-info}/PKG-INFO +1 -1
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client.egg-info/SOURCES.txt +1 -0
- xync_client-0.0.25.dev69/xync_client/BitGet/ex.py +0 -105
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/.env.sample +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/.gitignore +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/README.md +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/makefile +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/pyproject.toml +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/setup.cfg +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/TestAgent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/TestAsset.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/TestEx.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/TestOrder.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Htx/test_htx_p2p.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/Asset.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/AuthTrait.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/Base.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/Ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/InAgent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Abc/types.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/etype/ad.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/etype/pm.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/BitGet/req.mjs +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Bybit/agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Bybit/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/etype/__init__.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/etype/ad.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/etype/cred.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/etype/pm.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/KuCoin/etype/ad.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/KuCoin/etype/pm.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/KuCoin/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Okx/etype/ad.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Okx/etype/pm.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/asset.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/ex.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/inAgent.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/pyd.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/__init__.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/loader.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/pm_unifier.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client/pyro.py +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client.egg-info/requires.txt +0 -0
- {xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from typing import List, Optional
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from xync_schema.types import BaseAd
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PaymethodDetail(BaseModel):
|
|
7
|
+
name: str
|
|
8
|
+
required: int
|
|
9
|
+
type: str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PaymethodInfo(BaseModel):
|
|
13
|
+
colorValue: str
|
|
14
|
+
iconUrl: str
|
|
15
|
+
isModifyKyc: int
|
|
16
|
+
paymethodId: str
|
|
17
|
+
paymethodInfo: List[PaymethodDetail]
|
|
18
|
+
paymethodName: str
|
|
19
|
+
paymethodNameHandle: bool
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Ad(BaseAd):
|
|
23
|
+
exid: int | str | None = Field(alias="id")
|
|
24
|
+
adEditorTime: str
|
|
25
|
+
adNo: str
|
|
26
|
+
adType: int
|
|
27
|
+
advImages: List[str]
|
|
28
|
+
advertiseIsEvent: int
|
|
29
|
+
allowMerchantPlace: int
|
|
30
|
+
allowPlace: int
|
|
31
|
+
amount: str
|
|
32
|
+
avgTime: int
|
|
33
|
+
businessCertifiedList: List
|
|
34
|
+
businessCertifiedResp: Optional[None]
|
|
35
|
+
cancellPlaceOrderTime: int
|
|
36
|
+
certifiedMerchant: int
|
|
37
|
+
coinCode: str
|
|
38
|
+
coinPrecision: int
|
|
39
|
+
countryList: List
|
|
40
|
+
createTime: str
|
|
41
|
+
customizeState: int
|
|
42
|
+
delAdv: int
|
|
43
|
+
editAmount: str
|
|
44
|
+
encryptUserId: str
|
|
45
|
+
fiatCode: str
|
|
46
|
+
fiatPrecision: int
|
|
47
|
+
fiatSymbol: str
|
|
48
|
+
floatValue: str
|
|
49
|
+
fundState: bool
|
|
50
|
+
goodEvaluationRate: str
|
|
51
|
+
headColor: str
|
|
52
|
+
hideFlag: int
|
|
53
|
+
iconUrl: str
|
|
54
|
+
lastAmount: str
|
|
55
|
+
limitPrice: str
|
|
56
|
+
maxAmount: str
|
|
57
|
+
maxCompleteDefault: int
|
|
58
|
+
minAmount: str
|
|
59
|
+
minCompleteDefault: int
|
|
60
|
+
nickName: str
|
|
61
|
+
orderMode: str
|
|
62
|
+
payDuration: int
|
|
63
|
+
paymethodInfo: List[PaymethodInfo]
|
|
64
|
+
positionNum: str
|
|
65
|
+
price: str
|
|
66
|
+
priceType: int
|
|
67
|
+
priceValue: float
|
|
68
|
+
recentOnlineText: str
|
|
69
|
+
showOnline: bool
|
|
70
|
+
soldAmount: str
|
|
71
|
+
state: int
|
|
72
|
+
taxAmount: str
|
|
73
|
+
thirtyCompletionRate: str
|
|
74
|
+
thirtyTunoverNum: str
|
|
75
|
+
transactionTermsRespList: List
|
|
76
|
+
turnoverNum: str
|
|
77
|
+
turnoverRate: str
|
|
78
|
+
turnoverRateNum: float # Changed from int to float
|
|
79
|
+
userId: str
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import subprocess
|
|
3
|
+
from asyncio import run, sleep
|
|
4
|
+
from os.path import dirname
|
|
5
|
+
|
|
6
|
+
from x_model import init_db
|
|
7
|
+
from xync_schema import models
|
|
8
|
+
from xync_schema.models import Ex
|
|
9
|
+
from xync_schema import types
|
|
10
|
+
|
|
11
|
+
from xync_client.Abc.Ex import BaseExClient
|
|
12
|
+
from xync_client.loader import PG_DSN
|
|
13
|
+
from xync_client.Abc.Base import MapOfIdsList
|
|
14
|
+
from xync_client.Abc.types import PmEx
|
|
15
|
+
from xync_client.BitGet.etype import ad
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ExClient(BaseExClient):
|
|
19
|
+
headers = {
|
|
20
|
+
"accept-language": "ru,en;q=0.9",
|
|
21
|
+
"content-type": "application/json;charset=UTF-8",
|
|
22
|
+
"deviceid": "883e1394d8a2278418b6f02804df16c4",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async def _coin_cur_pms(self) -> dict:
|
|
26
|
+
# curs = (await self._post("/v1/p2p/pub/currency/queryAllCoinAndFiat"))["data"]["fiatInfoRespList"]
|
|
27
|
+
p = subprocess.Popen(
|
|
28
|
+
[
|
|
29
|
+
"node",
|
|
30
|
+
dirname(__file__) + "/req.mjs",
|
|
31
|
+
"pub/currency/queryAllCoinAndFiat",
|
|
32
|
+
"{}",
|
|
33
|
+
json.dumps(self.headers, separators=(",", ":")),
|
|
34
|
+
],
|
|
35
|
+
stdout=subprocess.PIPE,
|
|
36
|
+
)
|
|
37
|
+
out = p.stdout.read().decode()
|
|
38
|
+
if not out:
|
|
39
|
+
await sleep(1.6)
|
|
40
|
+
return await self.curs()
|
|
41
|
+
return json.loads(out)
|
|
42
|
+
|
|
43
|
+
async def curs(self) -> dict[str, types.CurEx]:
|
|
44
|
+
curs: list[dict] = (await self._coin_cur_pms())["fiatInfoRespList"]
|
|
45
|
+
return {cur["fiatCode"]: types.CurEx(exid=cur["fiatCode"], ticker=cur["fiatCode"]) for cur in curs}
|
|
46
|
+
|
|
47
|
+
async def coins(self) -> dict[str, types.CoinEx]:
|
|
48
|
+
coins: list[dict] = (await self._coin_cur_pms())["coinInfoRespList"]
|
|
49
|
+
return {
|
|
50
|
+
coin["coinCode"]: types.CoinEx(exid=coin["coinCode"], ticker=coin["coinCode"], scale=coin["coinPrecision"])
|
|
51
|
+
for coin in coins
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async def pairs(self) -> MapOfIdsList:
|
|
55
|
+
coins = (await self.coins()).keys()
|
|
56
|
+
curs = (await self.curs()).keys()
|
|
57
|
+
p = {cur: {c for c in coins} for cur in curs}
|
|
58
|
+
return p, p
|
|
59
|
+
|
|
60
|
+
async def pms(self, cur: str = None) -> dict[int | str, PmEx]: # {pm.exid: pm}
|
|
61
|
+
pp = {}
|
|
62
|
+
pms: list[dict] = (await self._coin_cur_pms())["fiatInfoRespList"]
|
|
63
|
+
for pm in pms:
|
|
64
|
+
for p in pm["paymethodInfo"]:
|
|
65
|
+
pp[p["paymethodId"]] = PmEx(exid=p["paymethodId"], name=p["paymethodName"])
|
|
66
|
+
return pp
|
|
67
|
+
|
|
68
|
+
async def ads(
|
|
69
|
+
self, coin_exid: str, cur_exid: str, is_sell: bool, pm_exids: list[str | int] = None, amount: int = None
|
|
70
|
+
) -> list[ad.Ad]:
|
|
71
|
+
request_data = {
|
|
72
|
+
"side": 1 if is_sell else 2,
|
|
73
|
+
"pageNo": 1,
|
|
74
|
+
"pageSize": 10,
|
|
75
|
+
"coinCode": coin_exid,
|
|
76
|
+
"fiatCode": cur_exid,
|
|
77
|
+
"paymethodId": pm_exids or "",
|
|
78
|
+
"languageType": 6,
|
|
79
|
+
}
|
|
80
|
+
request_json = json.dumps(request_data, separators=(",", ":"))
|
|
81
|
+
p = subprocess.Popen(
|
|
82
|
+
[
|
|
83
|
+
"node",
|
|
84
|
+
dirname(__file__) + "/req.mjs",
|
|
85
|
+
"pub/adv/queryAdvList",
|
|
86
|
+
request_json,
|
|
87
|
+
json.dumps(self.headers, separators=(",", ":")),
|
|
88
|
+
],
|
|
89
|
+
stdout=subprocess.PIPE,
|
|
90
|
+
)
|
|
91
|
+
out = p.stdout.read().decode()
|
|
92
|
+
ads = json.loads(out)
|
|
93
|
+
return [ad.Ad(id=_ad["encryptUserId"], **_ad) for _ad in ads["dataList"]]
|
|
94
|
+
|
|
95
|
+
async def cur_pms_map(self) -> dict[str, list[int]]:
|
|
96
|
+
cur_pms_map: list[dict] = (await self._coin_cur_pms())["fiatInfoRespList"]
|
|
97
|
+
return {item["fiatCode"]: [pms["paymethodId"] for pms in item["paymethodInfo"]] for item in cur_pms_map}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
async def main():
|
|
101
|
+
_ = await init_db(PG_DSN, models, True)
|
|
102
|
+
bg = await Ex.get(name="BitGet")
|
|
103
|
+
cl = ExClient(bg)
|
|
104
|
+
await cl.curs()
|
|
105
|
+
# await cl.coins()
|
|
106
|
+
_ads = await cl.ads("BTC", "RUB", True, [1, 289, 375])
|
|
107
|
+
# await cl.pms()
|
|
108
|
+
await cl.cur_pms_map()
|
|
109
|
+
await cl.set_pmcurexs()
|
|
110
|
+
await cl.set_coinexs()
|
|
111
|
+
await cl.close()
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
if __name__ == "__main__":
|
|
115
|
+
run(main())
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import subprocess
|
|
3
|
-
from asyncio import run, sleep
|
|
4
|
-
from os.path import dirname
|
|
5
|
-
|
|
6
|
-
from x_model import init_db
|
|
7
|
-
from xync_client.Abc.Base import DictOfDicts
|
|
8
|
-
from xync_schema import models
|
|
9
|
-
from xync_schema.models import Cur, Ex
|
|
10
|
-
|
|
11
|
-
from xync_client.Abc.Ex import BaseExClient
|
|
12
|
-
from xync_client.loader import PG_DSN
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ExClient(BaseExClient):
|
|
16
|
-
headers = {
|
|
17
|
-
"accept-language": "ru,en;q=0.9",
|
|
18
|
-
"content-type": "application/json;charset=UTF-8",
|
|
19
|
-
"deviceid": "883e1394d8a2278418b6f02804df16c4",
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async def _coin_cur_pms(self) -> dict:
|
|
23
|
-
# curs = (await self._post("/v1/p2p/pub/currency/queryAllCoinAndFiat"))["data"]["fiatInfoRespList"]
|
|
24
|
-
p = subprocess.Popen(
|
|
25
|
-
[
|
|
26
|
-
"node",
|
|
27
|
-
dirname(__file__) + "/req.mjs",
|
|
28
|
-
"pub/currency/queryAllCoinAndFiat",
|
|
29
|
-
"{}",
|
|
30
|
-
json.dumps(self.headers, separators=(",", ":")),
|
|
31
|
-
],
|
|
32
|
-
stdout=subprocess.PIPE,
|
|
33
|
-
)
|
|
34
|
-
out = p.stdout.read().decode()
|
|
35
|
-
if not out:
|
|
36
|
-
await sleep(1.6)
|
|
37
|
-
return await self.curs()
|
|
38
|
-
return json.loads(out)
|
|
39
|
-
|
|
40
|
-
async def curs(self) -> dict[str, dict]:
|
|
41
|
-
curs: list[dict] = (await self._coin_cur_pms())["fiatInfoRespList"]
|
|
42
|
-
return {cur["fiatCode"]: cur for cur in curs}
|
|
43
|
-
|
|
44
|
-
async def coins(self, cur: Cur = None) -> dict[str, str]:
|
|
45
|
-
coins: list[dict] = (await self._coin_cur_pms())["coinInfoRespList"]
|
|
46
|
-
return {coin["coinCode"]: coin["coinCode"] for coin in coins}
|
|
47
|
-
|
|
48
|
-
async def pms(self) -> DictOfDicts: # {pm.exid: pm}
|
|
49
|
-
pp = {}
|
|
50
|
-
for id_, cur in (await self.curs()).items():
|
|
51
|
-
[
|
|
52
|
-
pp.update({int(p["paymethodId"]): {"name": p["paymethodName"], "logo": p.get("iconUrl")}})
|
|
53
|
-
for p in cur["paymethodInfo"]
|
|
54
|
-
]
|
|
55
|
-
return pp
|
|
56
|
-
|
|
57
|
-
async def ads(self, coin_exid: str, cur_exid: str, is_sell: bool, pm_exids: list[int] = None) -> list[dict]:
|
|
58
|
-
slots = (
|
|
59
|
-
await self._post(
|
|
60
|
-
"/v1/p2p/pub/adv/queryAdvList",
|
|
61
|
-
data={
|
|
62
|
-
"side": 2 if is_sell else 1,
|
|
63
|
-
"pageNo": 1,
|
|
64
|
-
"pageSize": 3,
|
|
65
|
-
"coinCode": coin_exid,
|
|
66
|
-
"fiatCode": cur_exid,
|
|
67
|
-
"languageType": 6,
|
|
68
|
-
"paymethodId": pm_exids[0] if pm_exids else None,
|
|
69
|
-
},
|
|
70
|
-
)
|
|
71
|
-
)["data"]["dataList"]
|
|
72
|
-
result = []
|
|
73
|
-
for slot in slots:
|
|
74
|
-
result.append(
|
|
75
|
-
{
|
|
76
|
-
"price": float(slot["priceValue"]),
|
|
77
|
-
"min_fiat": float(slot["minAmount"]),
|
|
78
|
-
"max_fiat": float(min(slot["maxAmount"], slot["amount"])),
|
|
79
|
-
"user": int(slot["userId"]) if slot["userId"] else None,
|
|
80
|
-
"pms": [int(pay_method["paymethodId"]) for pay_method in slot["paymethodInfo"]],
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
return result
|
|
84
|
-
|
|
85
|
-
async def cur_pms_map(self) -> dict[str, list[int]]:
|
|
86
|
-
curs = await self.curs()
|
|
87
|
-
return {k: [int(pay_method["paymethodId"]) for pay_method in cur["paymethodInfo"]] for k, cur in curs.items()}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
async def main():
|
|
91
|
-
_ = await init_db(PG_DSN, models, True)
|
|
92
|
-
bg = await Ex.get(name="BitGet")
|
|
93
|
-
cl = ExClient(bg)
|
|
94
|
-
await cl.curs()
|
|
95
|
-
# await cl.coins()
|
|
96
|
-
# await cl.ads("BTC", "RUB", True, [1, 289, 375])
|
|
97
|
-
# await cl.pms()
|
|
98
|
-
await cl.cur_pms_map()
|
|
99
|
-
await cl.set_pmcurexs()
|
|
100
|
-
await cl.set_coinexs()
|
|
101
|
-
await cl.close()
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if __name__ == "__main__":
|
|
105
|
-
run(main())
|
|
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
|
{xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Binance/test_binance.py
RENAMED
|
File without changes
|
{xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Bybit/test_bybit.py
RENAMED
|
File without changes
|
{xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Bybit/test_bybit_p2p.py
RENAMED
|
File without changes
|
|
File without changes
|
{xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Htx/test_htx_p2p.py
RENAMED
|
File without changes
|
{xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/tests/_todo_refact/Wallet/test_agent.py
RENAMED
|
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
|
{xync_client-0.0.25.dev69 → xync_client-0.0.25.dev73}/xync_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|