xync-schema 0.6.84.dev4__tar.gz → 0.6.86__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.84.dev4/xync_schema.egg-info → xync_schema-0.6.86}/PKG-INFO +1 -1
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema/enums.py +1 -1
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema/models.py +30 -16
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema/types.py +3 -2
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86/xync_schema.egg-info}/PKG-INFO +1 -1
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/.env.sample +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/.gitignore +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/.pre-commit-config.yaml +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/README.md +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/makefile +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/pyproject.toml +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/setup.cfg +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/tests/__init__.py +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/tests/test_db.py +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema/__init__.py +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema.egg-info/SOURCES.txt +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema.egg-info/dependency_links.txt +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema.egg-info/requires.txt +0 -0
- {xync_schema-0.6.84.dev4 → xync_schema-0.6.86}/xync_schema.egg-info/top_level.txt +0 -0
|
@@ -10,7 +10,6 @@ from x_model.models import TsTrait, DatetimeSecField
|
|
|
10
10
|
from xync_schema.enums import (
|
|
11
11
|
ExType,
|
|
12
12
|
AdStatus,
|
|
13
|
-
AssetType,
|
|
14
13
|
OrderStatus,
|
|
15
14
|
ExAction,
|
|
16
15
|
ExStatus,
|
|
@@ -18,6 +17,7 @@ from xync_schema.enums import (
|
|
|
18
17
|
UserStatus,
|
|
19
18
|
PmType,
|
|
20
19
|
FileType,
|
|
20
|
+
AddrExType,
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
|
|
@@ -327,8 +327,10 @@ class Ad(Model, TsTrait):
|
|
|
327
327
|
maker_id: int
|
|
328
328
|
pay_req: fields.ForeignKeyNullableRelation["PayReq"] = fields.ForeignKeyField("models.PayReq", "ads", null=True)
|
|
329
329
|
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
pmexs: fields.ManyToManyRelation["Pmex"] = fields.ManyToManyField("models.Pmex", "adpmex", related_name="ads")
|
|
331
|
+
credexs: fields.ManyToManyRelation["CredEx"] = fields.ManyToManyField(
|
|
332
|
+
"models.CredEx", through="adcredex", related_name="ads"
|
|
333
|
+
)
|
|
332
334
|
orders: fields.ReverseRelation["Order"]
|
|
333
335
|
|
|
334
336
|
_icon = "ad"
|
|
@@ -362,7 +364,6 @@ class Pm(Model):
|
|
|
362
364
|
|
|
363
365
|
typ: PmType | None = fields.IntEnumField(PmType, null=True)
|
|
364
366
|
|
|
365
|
-
ads: fields.ManyToManyRelation[Ad]
|
|
366
367
|
curs: fields.ManyToManyRelation[Cur]
|
|
367
368
|
exs: fields.ManyToManyRelation[Ex] = fields.ManyToManyField("models.Ex", "pmex") # no need. use pmexs[.exid]
|
|
368
369
|
orders: fields.ReverseRelation["Order"]
|
|
@@ -395,7 +396,7 @@ class Pmcur(Model): # for fiat with no exs tie
|
|
|
395
396
|
|
|
396
397
|
class Meta:
|
|
397
398
|
table_description = "Payment methods - Currencies"
|
|
398
|
-
|
|
399
|
+
unique_together = (("pm_id", "cur_id"),)
|
|
399
400
|
|
|
400
401
|
class PydanticMeta(Model.PydanticMeta):
|
|
401
402
|
max_recursion: int = 2 # default: 3
|
|
@@ -412,6 +413,7 @@ class Pmex(BaseModel): # existence pm in ex with no cur tie
|
|
|
412
413
|
exid: str = fields.CharField(63)
|
|
413
414
|
name: str = fields.CharField(63)
|
|
414
415
|
|
|
416
|
+
ads: fields.ManyToManyRelation[Ad]
|
|
415
417
|
banks: fields.BackwardFKRelation["PmexBank"]
|
|
416
418
|
|
|
417
419
|
class Meta:
|
|
@@ -452,7 +454,6 @@ class Cred(Model):
|
|
|
452
454
|
banks: fields.ManyToManyRelation[PmexBank] = fields.ManyToManyField("models.PmexBank", related_name="creds")
|
|
453
455
|
|
|
454
456
|
fiat: fields.BackwardOneToOneRelation["Fiat"]
|
|
455
|
-
ads: fields.ManyToManyRelation[Ad]
|
|
456
457
|
credexs: fields.BackwardFKRelation["CredEx"]
|
|
457
458
|
orders: fields.BackwardFKRelation["Order"]
|
|
458
459
|
|
|
@@ -470,6 +471,8 @@ class CredEx(Model):
|
|
|
470
471
|
ex: fields.ForeignKeyRelation[Ex] = fields.ForeignKeyField("models.Ex", "credexs")
|
|
471
472
|
ex_id: int
|
|
472
473
|
|
|
474
|
+
ads: fields.ManyToManyRelation[Ad]
|
|
475
|
+
|
|
473
476
|
_name = {"exid"}
|
|
474
477
|
|
|
475
478
|
class Meta:
|
|
@@ -518,27 +521,38 @@ class Limit(Model):
|
|
|
518
521
|
table_description = "Currency accounts balance"
|
|
519
522
|
|
|
520
523
|
|
|
521
|
-
class
|
|
522
|
-
coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="
|
|
524
|
+
class Addr(Model):
|
|
525
|
+
coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="addrs")
|
|
523
526
|
coin_id: int
|
|
527
|
+
actor: fields.ForeignKeyRelation[Actor] = fields.ForeignKeyField("models.Actor", "addrs")
|
|
528
|
+
actor_id: int
|
|
529
|
+
|
|
530
|
+
pay_reqs: fields.ReverseRelation["PayReq"]
|
|
531
|
+
|
|
532
|
+
_name = {"coin__ticker", "free"}
|
|
533
|
+
|
|
534
|
+
class Meta:
|
|
535
|
+
table_description = "Coin address on cex"
|
|
536
|
+
unique_together = (("coin_id", "actor_id"),)
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
class Asset(Model):
|
|
540
|
+
addr: fields.ForeignKeyRelation[Addr] = fields.ForeignKeyField("models.Addr", related_name="addrs")
|
|
541
|
+
addr_id: int
|
|
524
542
|
agent: fields.ForeignKeyRelation[Agent] = fields.ForeignKeyField("models.Agent", "assets")
|
|
525
543
|
agent_id: int
|
|
526
|
-
|
|
544
|
+
|
|
545
|
+
typ: AddrExType = fields.IntEnumField(AddrExType, default=AddrExType.found)
|
|
527
546
|
free: float = fields.FloatField()
|
|
528
547
|
freeze: float | None = fields.FloatField(default=0)
|
|
529
548
|
lock: float | None = fields.FloatField(default=0)
|
|
530
549
|
target: float | None = fields.FloatField(default=0, null=True)
|
|
531
550
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
_name = {"coin__ticker", "free"}
|
|
551
|
+
_name = {"asset__coin__ticker", "free"}
|
|
535
552
|
|
|
536
553
|
class Meta:
|
|
537
554
|
table_description = "Coin balance"
|
|
538
|
-
unique_together = (("
|
|
539
|
-
|
|
540
|
-
class PydanticMeta(Model.PydanticMeta):
|
|
541
|
-
max_recursion: int = 2 # default: 3
|
|
555
|
+
unique_together = (("addr_id", "agent_id", "typ"),)
|
|
542
556
|
|
|
543
557
|
def epyd(self):
|
|
544
558
|
module_name = f"xync_client.{self.agent.ex.name}.pyd"
|
|
@@ -41,6 +41,7 @@ class BaseAd(BaseModel):
|
|
|
41
41
|
|
|
42
42
|
class BaseAdIn(BaseAd):
|
|
43
43
|
min_fiat: float
|
|
44
|
+
amount: float
|
|
44
45
|
max_fiat: float
|
|
45
46
|
direction_id: int
|
|
46
47
|
detail: str | None = None
|
|
@@ -54,11 +55,11 @@ class BaseAdIn(BaseAd):
|
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
class AdBuyIn(BaseAdIn):
|
|
57
|
-
|
|
58
|
+
pmexs_: list[models.Pmex]
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
class AdSaleIn(BaseAdIn):
|
|
61
|
-
|
|
62
|
+
credexs_: list[models.CredEx]
|
|
62
63
|
|
|
63
64
|
|
|
64
65
|
class OrderIn(BaseModel):
|
|
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
|