xync-schema 0.6.46__py3-none-any.whl → 0.6.48.dev1__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,6 +68,12 @@ 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
 
@@ -145,7 +152,7 @@ exs = {
145
152
  ExType.p2p,
146
153
  "https://assets.coingecko.com/markets/images/812/large/YtFwQwJr_400x400.jpg",
147
154
  "bingx.com",
148
- "bingx.com",
155
+ "api-app.we-api.com",
149
156
  "bingx.com/login",
150
157
  ),
151
158
  "Bisq": (ExType.p2p, "", "", "", ""),
xync_schema/models.py CHANGED
@@ -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
- 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
 
@@ -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,13 @@ 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
+ order: fields.ForeignKeyRelation[Order] = fields.ForeignKeyField("models.Order", related_name="msgs")
442
+
443
+
432
444
  # class Dep(Model, TsTrait):
433
445
  # pid: str = fields.CharField(31) # product_id
434
446
  # apr: float = fields.FloatField()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xync-schema
3
- Version: 0.6.46
3
+ Version: 0.6.48.dev1
4
4
  Summary: XyncNet project database model schema
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: EULA
@@ -0,0 +1,8 @@
1
+ xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ xync_schema/enums.py,sha256=p0OtK5X8swXo80CsNce2NUWfenTUGERLL2Tm7T4KOJk,10431
3
+ xync_schema/models.py,sha256=QB1sPatAmyNgTOMWIlc2BSlmIgWsAm5GM96TH1j57Mk,21522
4
+ xync_schema/pydantic.py,sha256=cyviSX1P2Cj6fLFq_IsrYdWB6gBOYwR4adPXrAmlP7g,274
5
+ xync_schema-0.6.48.dev1.dist-info/METADATA,sha256=qwe5lXF2PFczU4b3RKTgxRB4yaxbOaXSM_UH9y508RE,3990
6
+ xync_schema-0.6.48.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
7
+ xync_schema-0.6.48.dev1.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
+ xync_schema-0.6.48.dev1.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=zOC_9SqbwhyG4c0ZpgO0I20vYyFAln5mCmiAa6Inpf8,21046
4
- xync_schema/pydantic.py,sha256=cyviSX1P2Cj6fLFq_IsrYdWB6gBOYwR4adPXrAmlP7g,274
5
- xync_schema-0.6.46.dist-info/METADATA,sha256=mXWHg3VMnc79l5qEohrpydRytAStwNJzpCC1T7OHLX8,3985
6
- xync_schema-0.6.46.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
7
- xync_schema-0.6.46.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
- xync_schema-0.6.46.dist-info/RECORD,,