xync-client 0.0.11.dev26__tar.gz → 0.0.11.dev29__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.11.dev26/xync_client.egg-info → xync_client-0.0.11.dev29}/PKG-INFO +2 -2
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/README.md +4 -3
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/pyproject.toml +1 -1
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/TestEx.py +12 -10
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Abc/Ex.py +10 -6
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Bybit/ex.py +10 -28
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/TgWallet/ex.py +3 -1
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29/xync_client.egg-info}/PKG-INFO +2 -2
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/.env.sample +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/.gitignore +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/.pre-commit-config.yaml +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/makefile +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/setup.cfg +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/AgentTest.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/OrderTest.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Binance/test_binance.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Bybit/test_bybit.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Bybit/test_bybit_p2p.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Gate/test_gate.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Htx/test_htx_p2p.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Wallet/test_agent.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Wallet/test_ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/__init__.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/_test_ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Abc/Agent.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Abc/Auth.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Abc/Base.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Abc/BaseTest.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Abc/Order.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/__init__.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/binance_async.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/earn_api.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/exceptions.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/sapi.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Binance/web_c2c.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BingX/__init__.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BingX/base.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BingX/ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BingX/req.mjs +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BingX/sign.js +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BingX/test/main.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BitGet/__init__.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BitGet/agent.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BitGet/ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/BitGet/req.mjs +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Bybit/agent.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Bybit/web_earn.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Bybit/web_p2p.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Gate/ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Gate/premarket.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Htx/agent.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Htx/earn.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Htx/ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/KuCoin/pub.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/KuCoin/web.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/Okx/ex.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/TgWallet/agent.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/TgWallet/auth.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/TgWallet/order.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/TgWallet/pyro.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/TgWallet/web.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/__init__.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client/loader.py +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client.egg-info/SOURCES.txt +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client.egg-info/dependency_links.txt +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client.egg-info/requires.txt +0 -0
- {xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client.egg-info/top_level.txt +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xync-client
|
|
3
|
-
Version: 0.0.11.
|
|
3
|
+
Version: 0.0.11.dev29
|
|
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
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
8
|
Requires-Dist: asynchuobi
|
|
9
9
|
Requires-Dist: bs4
|
|
10
10
|
Requires-Dist: python-binance
|
|
@@ -130,10 +130,11 @@ classDef red stroke:#f00
|
|
|
130
130
|
*T suffix (4T, 8T, ..)*: Only Tests with idle waithing time.
|
|
131
131
|
|
|
132
132
|
### Ex (Public)
|
|
133
|
+
- 19: Список поддерживаемых валют тейкера `curs() => [Cur]`
|
|
133
134
|
- 20: Список платежных методов `pms() => [Pm]`
|
|
134
|
-
- 21: Список
|
|
135
|
-
- 22:
|
|
136
|
-
- 23: Список
|
|
135
|
+
- 21: Список платежных методов по каждой валюте `cur_pms_map() => {Cur: [Pm]}`
|
|
136
|
+
- 22: Список торгуемых монет (с ограничениям по валютам, если есть) `coins() => [Coin]`
|
|
137
|
+
- 23: Список пар валюта/монет `pairs() => [Pair]`
|
|
137
138
|
- 24: Список объяв по (buy/sell, cur, coin, pm) `ads(coin: Coin, cur: Cur, is_sell: bool, pms:list[Pm]=None)`
|
|
138
139
|
|
|
139
140
|
### Fiat
|
|
@@ -19,6 +19,15 @@ class TestEx(BaseTest):
|
|
|
19
19
|
yield clients
|
|
20
20
|
[await cl.close() for cl in clients]
|
|
21
21
|
|
|
22
|
+
# 19
|
|
23
|
+
async def test_curs(self, clients: list[BaseExClient]):
|
|
24
|
+
for client in clients:
|
|
25
|
+
curs: FlatDict = await client.curs()
|
|
26
|
+
ok = self.is_flat_dict(curs)
|
|
27
|
+
t, _ = await ExTest.update_or_create({"ok": ok}, ex=client.ex, action=ExAction.curs)
|
|
28
|
+
assert t.ok, "No curs"
|
|
29
|
+
logging.info(f"{client.ex.name}:{ExAction.curs.name} - ok")
|
|
30
|
+
|
|
22
31
|
# 20
|
|
23
32
|
async def test_pms(self, clients: list[BaseExClient]):
|
|
24
33
|
for client in clients:
|
|
@@ -28,15 +37,6 @@ class TestEx(BaseTest):
|
|
|
28
37
|
logging.info(f"{client.ex.name}:{ExAction.pms.name} - ok")
|
|
29
38
|
|
|
30
39
|
# 21
|
|
31
|
-
async def test_curs(self, clients: list[BaseExClient]):
|
|
32
|
-
for client in clients:
|
|
33
|
-
curs: FlatDict = await client.curs()
|
|
34
|
-
ok = self.is_flat_dict(curs)
|
|
35
|
-
t, _ = await ExTest.update_or_create({"ok": ok}, ex=client.ex, action=ExAction.curs)
|
|
36
|
-
assert t.ok, "No curs"
|
|
37
|
-
logging.info(f"{client.ex.name}:{ExAction.curs.name} - ok")
|
|
38
|
-
|
|
39
|
-
# 22
|
|
40
40
|
async def test_cur_pms_map(self, clients: list[BaseExClient]):
|
|
41
41
|
for client in clients:
|
|
42
42
|
cur_pms: MapOfIdsList = await client.cur_pms_map()
|
|
@@ -45,7 +45,7 @@ class TestEx(BaseTest):
|
|
|
45
45
|
assert t.ok, "No pms for cur"
|
|
46
46
|
logging.info(f"{client.ex.name}:{ExAction.cur_pms_map.name} - ok")
|
|
47
47
|
|
|
48
|
-
#
|
|
48
|
+
# 22
|
|
49
49
|
async def test_coins(self, clients: list[BaseExClient]):
|
|
50
50
|
for client in clients:
|
|
51
51
|
coins: FlatDict = await client.coins()
|
|
@@ -54,6 +54,8 @@ class TestEx(BaseTest):
|
|
|
54
54
|
assert t.ok, "No coins"
|
|
55
55
|
logging.info(f"{client.ex.name}:{ExAction.coins.name} - ok")
|
|
56
56
|
|
|
57
|
+
# 23
|
|
58
|
+
|
|
57
59
|
# 24
|
|
58
60
|
async def test_ads(self, clients: list[BaseExClient]):
|
|
59
61
|
for client in clients:
|
|
@@ -25,26 +25,30 @@ class BaseExClient(BaseClient):
|
|
|
25
25
|
self.acronyms: dict[str, str] = {} # for pm norm
|
|
26
26
|
super().__init__(ex)
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# 19: Список поддерживаемых валют тейкера
|
|
29
29
|
@abstractmethod
|
|
30
|
-
async def
|
|
30
|
+
async def curs(self) -> FlatDict: # {cur.exid: cur.ticker}
|
|
31
31
|
...
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# 20: Список платежных методов
|
|
34
34
|
@abstractmethod
|
|
35
|
-
async def
|
|
35
|
+
async def pms(self, cur: Cur = None) -> DictOfDicts: # {pm.exid: pm}
|
|
36
36
|
...
|
|
37
37
|
|
|
38
|
-
#
|
|
38
|
+
# 21: Список платежных методов по каждой валюте
|
|
39
39
|
@abstractmethod
|
|
40
40
|
async def cur_pms_map(self) -> MapOfIdsList: # {cur.exid: [pm.exid]}
|
|
41
41
|
...
|
|
42
42
|
|
|
43
|
-
#
|
|
43
|
+
# 22: Список торгуемых монет (с ограничениям по валютам, если есть)
|
|
44
44
|
@abstractmethod
|
|
45
45
|
async def coins(self) -> FlatDict: # {coin.exid: coin.ticker}
|
|
46
46
|
...
|
|
47
47
|
|
|
48
|
+
# 23: Список пар валюта/монет
|
|
49
|
+
@abstractmethod
|
|
50
|
+
async def pairs(self) -> FlatDict: ...
|
|
51
|
+
|
|
48
52
|
# 24: Список объяв по (buy/sell, cur, coin, pm)
|
|
49
53
|
@abstractmethod
|
|
50
54
|
async def ads(
|
|
@@ -24,7 +24,12 @@ class ExClient(BaseExClient): # Bybit client
|
|
|
24
24
|
resp = await self._get("/fiat/p2p/config/initial")
|
|
25
25
|
return resp["result"] # todo: tokens, pairs, ...
|
|
26
26
|
|
|
27
|
-
#
|
|
27
|
+
# 19: Список поддерживаемых валют тейкера
|
|
28
|
+
async def curs(self) -> FlatDict:
|
|
29
|
+
config = await self._get_config()
|
|
30
|
+
return {c["currencyId"]: c["currencyId"] for c in config["currencies"]}
|
|
31
|
+
|
|
32
|
+
# 20: Список платежных методов
|
|
28
33
|
async def pms(self) -> DictOfDicts:
|
|
29
34
|
pms = await self._post("/fiat/otc/configuration/queryAllPaymentList/")
|
|
30
35
|
pms = pms["result"]["paymentConfigVo"]
|
|
@@ -35,17 +40,12 @@ class ExClient(BaseExClient): # Bybit client
|
|
|
35
40
|
for pm in pms
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
# 21: Список
|
|
39
|
-
async def curs(self) -> FlatDict:
|
|
40
|
-
config = await self._get_config()
|
|
41
|
-
return {c["currencyId"]: c["currencyId"] for c in config["currencies"]}
|
|
42
|
-
|
|
43
|
-
# 22: Список платежных методов по каждой валюте
|
|
43
|
+
# 21: Список платежных методов по каждой валюте
|
|
44
44
|
async def cur_pms_map(self) -> MapOfIdsList:
|
|
45
45
|
pms = await self._post("/fiat/otc/configuration/queryAllPaymentList/")
|
|
46
46
|
return json.loads(pms["result"]["currencyPaymentIdMap"])
|
|
47
47
|
|
|
48
|
-
#
|
|
48
|
+
# 22: Список торгуемых монет (с ограничениям по валютам, если есть)
|
|
49
49
|
async def coins(self) -> FlatDict:
|
|
50
50
|
config = await self._get_config()
|
|
51
51
|
cc: set[str] = set()
|
|
@@ -53,7 +53,7 @@ class ExClient(BaseExClient): # Bybit client
|
|
|
53
53
|
cc.add(c["tokenId"])
|
|
54
54
|
return {c: c for c in cc}
|
|
55
55
|
|
|
56
|
-
#
|
|
56
|
+
# 23: Список пар валюта/монет
|
|
57
57
|
async def pairs(self) -> FlatDict:
|
|
58
58
|
config = await self._get_config()
|
|
59
59
|
cc: dict[str, set[str]] = {}
|
|
@@ -61,7 +61,7 @@ class ExClient(BaseExClient): # Bybit client
|
|
|
61
61
|
cc[c["currencyId"]] = cc.get(c["currencyId"], set()) | {c["tokenId"]}
|
|
62
62
|
return cc
|
|
63
63
|
|
|
64
|
-
#
|
|
64
|
+
# 24: Список объяв по (buy/sell, cur, coin, pm)
|
|
65
65
|
async def ads(
|
|
66
66
|
self, coin_exid: str, cur_exid: str, is_sell: bool, pm_exids: list[str | int] = None, amount: int = None
|
|
67
67
|
) -> ListOfDicts:
|
|
@@ -79,21 +79,3 @@ class ExClient(BaseExClient): # Bybit client
|
|
|
79
79
|
}
|
|
80
80
|
ads = await self._post("/fiat/otc/item/online/", data)
|
|
81
81
|
return ads["result"]["items"]
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
async def main():
|
|
85
|
-
_ = await init_db(PG_DSN, models, True)
|
|
86
|
-
bg = await Ex.get(name="Bybit")
|
|
87
|
-
cl = ExClient(bg)
|
|
88
|
-
# await cl.curs()
|
|
89
|
-
await cl.coins()
|
|
90
|
-
# await cl.ads("BTC", "RUB", True, [1, 289, 375])
|
|
91
|
-
# await cl.pms()
|
|
92
|
-
# await cl.cur_pms_map()
|
|
93
|
-
# await cl.set_pmcurexs()
|
|
94
|
-
# await cl.set_coinexs()
|
|
95
|
-
await cl.close()
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if __name__ == "__main__":
|
|
99
|
-
run(main())
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from xync_client.Abc.Base import FlatDict
|
|
1
2
|
from xync_client.TgWallet.auth import AuthClient
|
|
2
3
|
|
|
3
4
|
from xync_schema.models import Pm
|
|
@@ -10,7 +11,8 @@ class ExClient(BaseExClient, AuthClient):
|
|
|
10
11
|
coins_curs = await self._post("/p2p/public-api/v2/currency/all-supported")
|
|
11
12
|
return {c["code"]: c["code"] for c in coins_curs["data"]["fiat"]}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
# 23: Список торгуемых монет (с ограничениям по валютам, если есть)
|
|
15
|
+
async def coins(self) -> FlatDict:
|
|
14
16
|
coins_curs = await self._post("/p2p/public-api/v2/currency/all-supported")
|
|
15
17
|
return {c["code"]: c["code"] for c in coins_curs["data"]["crypto"]}
|
|
16
18
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xync-client
|
|
3
|
-
Version: 0.0.11.
|
|
3
|
+
Version: 0.0.11.dev29
|
|
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
|
|
7
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
8
|
Requires-Dist: asynchuobi
|
|
9
9
|
Requires-Dist: bs4
|
|
10
10
|
Requires-Dist: python-binance
|
|
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.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Binance/test_binance.py
RENAMED
|
File without changes
|
{xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Bybit/test_bybit.py
RENAMED
|
File without changes
|
{xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Bybit/test_bybit_p2p.py
RENAMED
|
File without changes
|
|
File without changes
|
{xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/tests/_todo_refact/Htx/test_htx_p2p.py
RENAMED
|
File without changes
|
{xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/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
|
{xync_client-0.0.11.dev26 → xync_client-0.0.11.dev29}/xync_client.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|