xync-schema 0.6.46__tar.gz → 0.6.48__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_schema-0.6.46/xync_schema.egg-info → xync_schema-0.6.48}/PKG-INFO +2 -2
- {xync_schema-0.6.46 → xync_schema-0.6.48}/pyproject.toml +1 -1
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema/enums.py +54 -30
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema/models.py +18 -5
- xync_schema-0.6.48/xync_schema/pydantic.py +33 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48/xync_schema.egg-info}/PKG-INFO +2 -2
- xync_schema-0.6.46/xync_schema/pydantic.py +0 -15
- {xync_schema-0.6.46 → xync_schema-0.6.48}/.env.sample +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/.gitignore +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/.pre-commit-config.yaml +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/README.md +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/makefile +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/setup.cfg +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/tests/__init__.py +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/tests/test_db.py +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema/__init__.py +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema.egg-info/SOURCES.txt +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema.egg-info/dependency_links.txt +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema.egg-info/requires.txt +0 -0
- {xync_schema-0.6.46 → xync_schema-0.6.48}/xync_schema.egg-info/top_level.txt +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xync-schema
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.48
|
|
4
4
|
Summary: XyncNet project database model schema
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: EULA
|
|
7
7
|
Project-URL: Homepage, https://gitlab.com/xync/back/schema
|
|
8
8
|
Project-URL: Repository, https://gitlab.com/xync/back/schema
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
Requires-Dist: xtg-auth
|
|
12
12
|
Provides-Extra: dev
|
|
@@ -33,6 +33,7 @@ class ExType(IntEnum):
|
|
|
33
33
|
cex = 2
|
|
34
34
|
main = 3 # p2p+cex
|
|
35
35
|
dex = 4
|
|
36
|
+
tg = 5
|
|
36
37
|
futures = 8
|
|
37
38
|
|
|
38
39
|
|
|
@@ -67,9 +68,16 @@ class TaskType(IntEnum):
|
|
|
67
68
|
invite_approve = 1
|
|
68
69
|
|
|
69
70
|
|
|
71
|
+
class ExStatus(IntEnum):
|
|
72
|
+
plan = 0
|
|
73
|
+
parted = 1
|
|
74
|
+
full = 2
|
|
75
|
+
|
|
76
|
+
|
|
70
77
|
class ExAction(IntEnum):
|
|
71
78
|
"""Order"""
|
|
72
79
|
|
|
80
|
+
get_orders = 0 # Получшение заявок за заданное время, в статусе, по валюте, монете, направлению: `get_orders(stauts=OrderStatus.active, coin='USDT', cur='RUB', is_sell=False) => [order]`
|
|
73
81
|
order_request = 1 # [T] Запрос на старт сделки
|
|
74
82
|
order_request_ask = -1 # [M] - Запрос мейкеру на сделку
|
|
75
83
|
cancel_request = 2 # [T] Отмена запроса на сделку
|
|
@@ -98,10 +106,11 @@ class ExAction(IntEnum):
|
|
|
98
106
|
send_appeal_msg = 17 # Отправка сообщения по апелляции
|
|
99
107
|
get_appeal_msg = -17 # Получение сообщения по апелляции
|
|
100
108
|
""" Ex: Public """
|
|
109
|
+
curs = 19 # Список поддерживаемых валют тейкера
|
|
101
110
|
pms = 20 # Список платежных методов по каждой валюте
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
cur_pms_map = 21 # Мэппинг валюта => платежные методы
|
|
112
|
+
coins = 22 # Список торгуемых монет (с ограничениям по валютам, если есть)
|
|
113
|
+
pairs = 23 # Список пар валюта/монет
|
|
105
114
|
ads = 24 # Список объяв по (buy/sell, cur, coin, pm)
|
|
106
115
|
""" Agent: Fiat """
|
|
107
116
|
my_fiats = 25 # Список реквизитов моих платежных методов
|
|
@@ -133,6 +142,7 @@ exs = {
|
|
|
133
142
|
"beribit.app",
|
|
134
143
|
"beribit.app",
|
|
135
144
|
"beribit.app/login",
|
|
145
|
+
ExStatus.plan,
|
|
136
146
|
),
|
|
137
147
|
"Binance": (
|
|
138
148
|
ExType.main,
|
|
@@ -140,22 +150,25 @@ exs = {
|
|
|
140
150
|
"binance.com",
|
|
141
151
|
"p2p.binance.com",
|
|
142
152
|
"accounts.binance.com/login",
|
|
153
|
+
ExStatus.plan,
|
|
143
154
|
),
|
|
144
155
|
"BingX": (
|
|
145
156
|
ExType.p2p,
|
|
146
157
|
"https://assets.coingecko.com/markets/images/812/large/YtFwQwJr_400x400.jpg",
|
|
147
158
|
"bingx.com",
|
|
148
|
-
"
|
|
159
|
+
"api-app.we-api.com",
|
|
149
160
|
"bingx.com/login",
|
|
161
|
+
ExStatus.parted,
|
|
150
162
|
),
|
|
151
|
-
"Bisq": (ExType.p2p, "", "", "", ""),
|
|
152
|
-
"BitcoinGlobal": (ExType.p2p, "", "", "", ""),
|
|
163
|
+
"Bisq": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
164
|
+
"BitcoinGlobal": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
153
165
|
"BitGet": (
|
|
154
166
|
ExType.p2p,
|
|
155
167
|
"https://assets.coingecko.com/markets/images/591/large/2023-07-25_21.47.43.jpg",
|
|
156
168
|
"www.bitget.com",
|
|
157
169
|
"www.bitget.com",
|
|
158
170
|
"www.bitget.com/login",
|
|
171
|
+
ExStatus.parted,
|
|
159
172
|
),
|
|
160
173
|
"BitPapa": (
|
|
161
174
|
ExType.p2p,
|
|
@@ -163,98 +176,109 @@ exs = {
|
|
|
163
176
|
"bitpapa.com",
|
|
164
177
|
"bitpapa.com",
|
|
165
178
|
"bitpapa.com/log-in",
|
|
179
|
+
ExStatus.plan,
|
|
166
180
|
),
|
|
167
|
-
"Bitvalve ": (ExType.p2p, "", "", "", ""),
|
|
181
|
+
"Bitvalve ": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
168
182
|
"Bybit": (
|
|
169
183
|
ExType.main,
|
|
170
184
|
"https://assets.coingecko.com/markets/images/698/large/bybit_spot.png",
|
|
171
185
|
"bybit.com",
|
|
172
|
-
"bybit.com",
|
|
186
|
+
"api2.bybit.com",
|
|
173
187
|
"bybit.com/login",
|
|
188
|
+
ExStatus.parted,
|
|
174
189
|
),
|
|
175
|
-
"CoinCola": (ExType.main, "", "", "", ""),
|
|
176
|
-
"CRYPTED": (ExType.p2p, "", "", "", ""),
|
|
177
|
-
"Garantex": (ExType.p2p, "", "", "", ""),
|
|
190
|
+
"CoinCola": (ExType.main, "", "", "", "", ExStatus.plan),
|
|
191
|
+
"CRYPTED": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
192
|
+
"Garantex": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
178
193
|
"Gate": (
|
|
179
194
|
ExType.p2p,
|
|
180
195
|
"https://assets.coingecko.com/markets/images/403/large/gate_io_logo.jpg",
|
|
181
196
|
"gate.io",
|
|
182
197
|
"gate.io",
|
|
183
198
|
"www.gate.io/login",
|
|
199
|
+
ExStatus.parted,
|
|
184
200
|
),
|
|
185
|
-
"HodlHodl": (ExType.p2p, "", "", "", ""),
|
|
201
|
+
"HodlHodl": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
186
202
|
"Htx": (
|
|
187
203
|
ExType.main,
|
|
188
204
|
"https://assets.coingecko.com/markets/images/25/large/logo_V_colour_black.png",
|
|
189
205
|
"www.htx.com",
|
|
190
206
|
"www.htx.com",
|
|
191
207
|
"htx.com/login",
|
|
208
|
+
ExStatus.parted,
|
|
192
209
|
),
|
|
193
|
-
"Koshelek": (ExType.p2p, "", "", "", ""),
|
|
210
|
+
"Koshelek": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
194
211
|
"KuCoin": (
|
|
195
212
|
ExType.main,
|
|
196
213
|
"https://assets.coingecko.com/markets/images/61/large/kucoin.png",
|
|
197
214
|
"kucoin.com",
|
|
198
215
|
"kucoin.com",
|
|
199
216
|
"www.kucoin.com/ucenter/signin",
|
|
217
|
+
ExStatus.plan,
|
|
200
218
|
),
|
|
201
|
-
"LocalCoinSwap": (ExType.p2p, "", "", "", ""),
|
|
202
|
-
"LocalMonero": (ExType.p2p, "", "", "", ""),
|
|
219
|
+
"LocalCoinSwap": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
220
|
+
"LocalMonero": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
203
221
|
"Mexc": (
|
|
204
222
|
ExType.main,
|
|
205
223
|
"https://assets.coingecko.com/markets/images/409/large/MEXC_logo_square.jpeg",
|
|
206
224
|
"www.mexc.com",
|
|
207
225
|
"www.mexc.com",
|
|
208
226
|
"www.mexc.com/login",
|
|
227
|
+
ExStatus.plan,
|
|
209
228
|
),
|
|
210
|
-
"Noones ": (ExType.p2p, "", "", "", ""),
|
|
229
|
+
"Noones ": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
211
230
|
"Okx": (
|
|
212
231
|
ExType.main,
|
|
213
232
|
"https://assets.coingecko.com/markets/images/379/large/WeChat_Image_20220117220452.png",
|
|
214
233
|
"www.okx.cab",
|
|
215
234
|
"www.okx.cab",
|
|
216
235
|
"www.okx.cab/account/login",
|
|
236
|
+
ExStatus.plan,
|
|
217
237
|
),
|
|
218
|
-
"Paxful": (ExType.p2p, "", "", "", ""),
|
|
219
|
-
"PeachBitcoin": (ExType.p2p, "", "", "", ""),
|
|
220
|
-
"Phemex": (ExType.p2p, "", "", "", ""),
|
|
221
|
-
"Poloniex": (ExType.main, "", "", "", ""),
|
|
222
|
-
"Remitano": (ExType.p2p, "", "", "", ""),
|
|
223
|
-
"RiseX": (ExType.p2p, "", "", "", ""),
|
|
224
|
-
"RoboSats": (ExType.p2p, "", "", "", ""),
|
|
238
|
+
"Paxful": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
239
|
+
"PeachBitcoin": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
240
|
+
"Phemex": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
241
|
+
"Poloniex": (ExType.main, "", "", "", "", ExStatus.plan),
|
|
242
|
+
"Remitano": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
243
|
+
"RiseX": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
244
|
+
"RoboSats": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
225
245
|
"Sigen": (
|
|
226
246
|
ExType.p2p,
|
|
227
247
|
"https://yastatic.net/naydex/yandex-search/neZ1W6346/a21f02dA/2SvJ6dTLJwRiz_lTFP-fhywHqi1fxPNRcIxuKzcpwJ0DGlJzbzdT8ARet86SrINoGNj87R9U-t8HLZcrrBASQf0_6OkAL7cgl6uc0gCrHxI9Y369emE2MJF5yotCyODdZ5iXljtkQJMXTMV9VXsEL68seaiqQF578wnB3V",
|
|
228
248
|
"sigen.pro",
|
|
229
249
|
"sigen.pro",
|
|
230
250
|
"sigen.pro/p2p",
|
|
251
|
+
ExStatus.plan,
|
|
231
252
|
),
|
|
232
|
-
"SkyCrypto": (ExType.p2p, "", "", "", ""),
|
|
233
|
-
"SmartSwap": (ExType.p2p, "", "", "", ""),
|
|
234
|
-
"Solid": (ExType.main, "", "", "", ""),
|
|
253
|
+
"SkyCrypto": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
254
|
+
"SmartSwap": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
255
|
+
"Solid": (ExType.main, "", "", "", "", ExStatus.plan),
|
|
235
256
|
"TgWallet": (
|
|
236
|
-
ExType.
|
|
257
|
+
ExType.tg,
|
|
237
258
|
"https://telerock.ru/uploads/posts/2024-03/f658443d9e_c9d505bbf856e2360ba6812079ba02d0.webp",
|
|
238
259
|
"walletbot.me",
|
|
239
260
|
"p2p.walletbot.me",
|
|
240
261
|
"walletbot.me",
|
|
262
|
+
ExStatus.parted,
|
|
241
263
|
),
|
|
242
|
-
"TotalCoin": (ExType.p2p, "", "", "", ""),
|
|
243
|
-
"WazirX": (ExType.p2p, "", "", "", ""),
|
|
264
|
+
"TotalCoin": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
265
|
+
"WazirX": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
244
266
|
"WebMoney": (
|
|
245
267
|
ExType.p2p,
|
|
246
268
|
"https://vectorseek.com/wp-content/uploads/2023/08/Webmoney-Icon-Logo-Vector.svg-.png",
|
|
247
269
|
"exchanger.money",
|
|
248
270
|
"exchanger.money",
|
|
249
271
|
"exchanger.money",
|
|
272
|
+
ExStatus.plan,
|
|
250
273
|
),
|
|
251
|
-
"WhiteBIT": (ExType.p2p, "", "", "", ""),
|
|
274
|
+
"WhiteBIT": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
252
275
|
"xRocket": (
|
|
253
276
|
ExType.p2p,
|
|
254
277
|
"https://cdn.allmylinks.com/prod/Upload/file/R/L/6/8G0TaGNtUV8C1V7VQsivDtJcpEz2z7Lc.jpg",
|
|
255
278
|
"",
|
|
256
279
|
"",
|
|
257
280
|
"",
|
|
281
|
+
ExStatus.plan,
|
|
258
282
|
),
|
|
259
283
|
# "catalogop2p(.com": ExType.p2p, ''), todo: discover brazilian p2p platforms
|
|
260
284
|
}
|
|
@@ -5,9 +5,9 @@ from tortoise import Model as BaseModel
|
|
|
5
5
|
from x_auth.enums import Role
|
|
6
6
|
from x_auth.models import Model
|
|
7
7
|
from x_model.models import TsTrait, DatetimeSecField
|
|
8
|
-
from tg_auth.models import UserStatus, AuthUser
|
|
8
|
+
from tg_auth.models import UserStatus, AuthUser, UserInfoTrait
|
|
9
9
|
|
|
10
|
-
from xync_schema.enums import ExType, AdStatus, AssetType, OrderStatus, ExAction
|
|
10
|
+
from xync_schema.enums import ExType, AdStatus, AssetType, OrderStatus, ExAction, ExStatus
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
# class Country(Model):
|
|
@@ -60,6 +60,7 @@ class Ex(Model):
|
|
|
60
60
|
host_p2p: str | None = fields.CharField(63, null=True, description="With no protocol 'https://'")
|
|
61
61
|
url_login: str | None = fields.CharField(63, null=True, description="With no protocol 'https://'")
|
|
62
62
|
type_: ExType = fields.IntEnumField(ExType)
|
|
63
|
+
status: ExStatus = fields.IntEnumField(ExStatus, default=ExStatus.plan)
|
|
63
64
|
logo: str = fields.CharField(511, default="")
|
|
64
65
|
|
|
65
66
|
pms: fields.ManyToManyRelation["Pm"]
|
|
@@ -80,10 +81,12 @@ class Ex(Model):
|
|
|
80
81
|
class PydanticMeta(Model.PydanticMeta):
|
|
81
82
|
include = "name", "logo"
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
def client(self):
|
|
84
85
|
import sys
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
module_name = f"xync_client.{self.name}.ex"
|
|
88
|
+
__import__(module_name)
|
|
89
|
+
client = sys.modules[module_name].ExClient
|
|
87
90
|
return client(self)
|
|
88
91
|
|
|
89
92
|
|
|
@@ -141,7 +144,7 @@ class Direction(Model):
|
|
|
141
144
|
unique_together = (("pair", "sell"),)
|
|
142
145
|
|
|
143
146
|
|
|
144
|
-
class User(Model, TsTrait):
|
|
147
|
+
class User(Model, TsTrait, UserInfoTrait):
|
|
145
148
|
id: int = fields.BigIntField(True)
|
|
146
149
|
role: Role = fields.IntEnumField(Role, default=Role.READER)
|
|
147
150
|
status: UserStatus = fields.IntEnumField(UserStatus, default=UserStatus.RESTRICTED)
|
|
@@ -402,6 +405,8 @@ class Order(Model):
|
|
|
402
405
|
confirmed_at: datetime | None = DatetimeSecField(null=True)
|
|
403
406
|
appealed_at: datetime | None = DatetimeSecField(null=True)
|
|
404
407
|
|
|
408
|
+
msgs: fields.BackwardFKRelation["Msg"]
|
|
409
|
+
|
|
405
410
|
_name = {"fiat__pmcur__pm__name"}
|
|
406
411
|
|
|
407
412
|
def repr(self):
|
|
@@ -429,6 +434,14 @@ class Order(Model):
|
|
|
429
434
|
exclude = ("taker",)
|
|
430
435
|
|
|
431
436
|
|
|
437
|
+
class Msg(Model):
|
|
438
|
+
tgid: int = fields.IntField()
|
|
439
|
+
txt: str = fields.CharField(255)
|
|
440
|
+
media: str | None = fields.CharField(255, null=True)
|
|
441
|
+
receiver: fields.ForeignKeyRelation[Agent] = fields.ForeignKeyField("models.User", related_name="msgs")
|
|
442
|
+
order: fields.ForeignKeyRelation[Order] = fields.ForeignKeyField("models.Order", related_name="msgs")
|
|
443
|
+
|
|
444
|
+
|
|
432
445
|
# class Dep(Model, TsTrait):
|
|
433
446
|
# pid: str = fields.CharField(31) # product_id
|
|
434
447
|
# apr: float = fields.FloatField()
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from xync_schema.models import Fiat, Msg
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class FiatUpd(BaseModel):
|
|
8
|
+
detail: str | None = None
|
|
9
|
+
name: str | None = None
|
|
10
|
+
amount: float | None = None
|
|
11
|
+
target: int | None = None
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FiatNew(FiatUpd):
|
|
15
|
+
cur_id: int
|
|
16
|
+
pm_id: int
|
|
17
|
+
detail: str
|
|
18
|
+
amount: float = 0
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class OrderPyd(BaseModel):
|
|
22
|
+
id: int
|
|
23
|
+
amount: float
|
|
24
|
+
status: str
|
|
25
|
+
actions: dict | None = None
|
|
26
|
+
fiat: Fiat.pyd()
|
|
27
|
+
is_sell: bool
|
|
28
|
+
contragent: int
|
|
29
|
+
created_at: datetime
|
|
30
|
+
payed_at: datetime | None = None
|
|
31
|
+
appealed_at: datetime | None = None
|
|
32
|
+
confirmed_at: datetime | None = None
|
|
33
|
+
msgs: list[Msg.pyd()] = []
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xync-schema
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.48
|
|
4
4
|
Summary: XyncNet project database model schema
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: EULA
|
|
7
7
|
Project-URL: Homepage, https://gitlab.com/xync/back/schema
|
|
8
8
|
Project-URL: Repository, https://gitlab.com/xync/back/schema
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
Requires-Dist: xtg-auth
|
|
12
12
|
Provides-Extra: dev
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from pydantic import BaseModel
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class FiatUpd(BaseModel):
|
|
5
|
-
detail: str | None = None
|
|
6
|
-
name: str | None = None
|
|
7
|
-
amount: float | None = None
|
|
8
|
-
target: int | None = None
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class FiatNew(FiatUpd):
|
|
12
|
-
cur_id: int
|
|
13
|
-
pm_id: int
|
|
14
|
-
detail: str
|
|
15
|
-
amount: float = 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|