xync-schema 0.6.47__tar.gz → 0.6.48.dev2__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.47/xync_schema.egg-info → xync_schema-0.6.48.dev2}/PKG-INFO +1 -1
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema/enums.py +9 -2
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema/models.py +16 -3
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2/xync_schema.egg-info}/PKG-INFO +1 -1
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/.env.sample +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/.gitignore +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/.pre-commit-config.yaml +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/README.md +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/makefile +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/pyproject.toml +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/setup.cfg +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/tests/__init__.py +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/tests/test_db.py +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema/__init__.py +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema/pydantic.py +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema.egg-info/SOURCES.txt +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema.egg-info/dependency_links.txt +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema.egg-info/requires.txt +0 -0
- {xync_schema-0.6.47 → xync_schema-0.6.48.dev2}/xync_schema.egg-info/top_level.txt +0 -0
|
@@ -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
|
-
"
|
|
155
|
+
"api-app.we-api.com",
|
|
149
156
|
"bingx.com/login",
|
|
150
157
|
),
|
|
151
158
|
"Bisq": (ExType.p2p, "", "", "", ""),
|
|
@@ -169,7 +176,7 @@ exs = {
|
|
|
169
176
|
ExType.main,
|
|
170
177
|
"https://assets.coingecko.com/markets/images/698/large/bybit_spot.png",
|
|
171
178
|
"bybit.com",
|
|
172
|
-
"bybit.com",
|
|
179
|
+
"api2.bybit.com",
|
|
173
180
|
"bybit.com/login",
|
|
174
181
|
),
|
|
175
182
|
"CoinCola": (ExType.main, "", "", "", ""),
|
|
@@ -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
|
-
|
|
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
|
|
|
@@ -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()
|
|
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
|