xync-schema 0.6.47__py3-none-any.whl → 0.6.48__py3-none-any.whl

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/enums.py CHANGED
@@ -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
- curs = 21 # Список поддерживаемых валют тейкера
103
- cur_pms_map = 22 # Мэппинг валюта => платежные методы
104
- coins = 23 # Список торгуемых монет (с ограничениям по валютам, если есть)
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
- "bingx.com",
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.p2p,
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
  }
xync_schema/models.py CHANGED
@@ -7,7 +7,7 @@ from x_auth.models import Model
7
7
  from x_model.models import TsTrait, DatetimeSecField
8
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
- async def client(self):
84
+ def client(self):
84
85
  import sys
85
86
 
86
- client = sys.modules[f"xync_client.{self.name}.ex"].Client
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
 
@@ -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()
xync_schema/pydantic.py CHANGED
@@ -1,4 +1,7 @@
1
+ from datetime import datetime
2
+
1
3
  from pydantic import BaseModel
4
+ from xync_schema.models import Fiat, Msg
2
5
 
3
6
 
4
7
  class FiatUpd(BaseModel):
@@ -13,3 +16,18 @@ class FiatNew(FiatUpd):
13
16
  pm_id: int
14
17
  detail: str
15
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.47
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.12
9
+ Requires-Python: >=3.11
10
10
  Description-Content-Type: text/markdown
11
11
  Requires-Dist: xtg-auth
12
12
  Provides-Extra: dev
@@ -0,0 +1,8 @@
1
+ xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ xync_schema/enums.py,sha256=rKj_KFT6X11Z6RIs_BpW9oxEDWNILjxlw-VBp7BkDD8,11470
3
+ xync_schema/models.py,sha256=eFGX2kQ2hQfzuC0VEELWBbefgCEJWHtBVF5O0tmcXK4,21630
4
+ xync_schema/pydantic.py,sha256=xqCJdPomsUO2ZaFos4rW7v23wswVlhXhhiy9Hvb5Om8,686
5
+ xync_schema-0.6.48.dist-info/METADATA,sha256=urvwbAAD6jhVwHqYoRlFSA9SgxPlKqF7_JwCIEyGfkI,3985
6
+ xync_schema-0.6.48.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
7
+ xync_schema-0.6.48.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
+ xync_schema-0.6.48.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- xync_schema/enums.py,sha256=LzptfqpSNVr0u3byH36Y_rNjMqYEIPXmgXLrbTOFYh0,10343
3
- xync_schema/models.py,sha256=qtyoErKgO-N2kybfF76iY4HhWZcupjhWB3LXXhjt0aE,21076
4
- xync_schema/pydantic.py,sha256=cyviSX1P2Cj6fLFq_IsrYdWB6gBOYwR4adPXrAmlP7g,274
5
- xync_schema-0.6.47.dist-info/METADATA,sha256=ETzHWH-ii_9u9KjJrVIa5NOdcaMOQpirF2KIuId0l0A,3985
6
- xync_schema-0.6.47.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
7
- xync_schema-0.6.47.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
- xync_schema-0.6.47.dist-info/RECORD,,