xync-schema 0.6.85__py3-none-any.whl → 0.6.87__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 +1 -1
- xync_schema/models.py +30 -20
- xync_schema/types.py +2 -2
- {xync_schema-0.6.85.dist-info → xync_schema-0.6.87.dist-info}/METADATA +1 -1
- xync_schema-0.6.87.dist-info/RECORD +8 -0
- xync_schema-0.6.85.dist-info/RECORD +0 -8
- {xync_schema-0.6.85.dist-info → xync_schema-0.6.87.dist-info}/WHEEL +0 -0
- {xync_schema-0.6.85.dist-info → xync_schema-0.6.87.dist-info}/top_level.txt +0 -0
xync_schema/enums.py
CHANGED
xync_schema/models.py
CHANGED
|
@@ -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,7 +327,7 @@ 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
|
-
pmexs: fields.ManyToManyRelation["Pmex"] = fields.ManyToManyField("models.
|
|
330
|
+
pmexs: fields.ManyToManyRelation["Pmex"] = fields.ManyToManyField("models.Pmex", "adpmex", related_name="ads")
|
|
331
331
|
credexs: fields.ManyToManyRelation["CredEx"] = fields.ManyToManyField(
|
|
332
332
|
"models.CredEx", through="adcredex", related_name="ads"
|
|
333
333
|
)
|
|
@@ -396,7 +396,7 @@ class Pmcur(Model): # for fiat with no exs tie
|
|
|
396
396
|
|
|
397
397
|
class Meta:
|
|
398
398
|
table_description = "Payment methods - Currencies"
|
|
399
|
-
|
|
399
|
+
unique_together = (("pm_id", "cur_id"),)
|
|
400
400
|
|
|
401
401
|
class PydanticMeta(Model.PydanticMeta):
|
|
402
402
|
max_recursion: int = 2 # default: 3
|
|
@@ -456,6 +456,7 @@ class Cred(Model):
|
|
|
456
456
|
fiat: fields.BackwardOneToOneRelation["Fiat"]
|
|
457
457
|
credexs: fields.BackwardFKRelation["CredEx"]
|
|
458
458
|
orders: fields.BackwardFKRelation["Order"]
|
|
459
|
+
pay_reqs: fields.ReverseRelation["PayReq"]
|
|
459
460
|
|
|
460
461
|
_name = {"detail"}
|
|
461
462
|
|
|
@@ -486,8 +487,6 @@ class Fiat(Model):
|
|
|
486
487
|
amount: float | None = fields.FloatField(default=0)
|
|
487
488
|
target: float = fields.FloatField(default=0)
|
|
488
489
|
|
|
489
|
-
pay_reqs: fields.ReverseRelation["PayReq"]
|
|
490
|
-
|
|
491
490
|
class Meta:
|
|
492
491
|
table_description = "Currency balances"
|
|
493
492
|
|
|
@@ -521,27 +520,38 @@ class Limit(Model):
|
|
|
521
520
|
table_description = "Currency accounts balance"
|
|
522
521
|
|
|
523
522
|
|
|
524
|
-
class
|
|
525
|
-
coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="
|
|
523
|
+
class Addr(Model):
|
|
524
|
+
coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="addrs")
|
|
526
525
|
coin_id: int
|
|
526
|
+
actor: fields.ForeignKeyRelation[Actor] = fields.ForeignKeyField("models.Actor", "addrs")
|
|
527
|
+
actor_id: int
|
|
528
|
+
|
|
529
|
+
pay_reqs: fields.ReverseRelation["PayReq"]
|
|
530
|
+
|
|
531
|
+
_name = {"coin__ticker", "free"}
|
|
532
|
+
|
|
533
|
+
class Meta:
|
|
534
|
+
table_description = "Coin address on cex"
|
|
535
|
+
unique_together = (("coin_id", "actor_id"),)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
class Asset(Model):
|
|
539
|
+
addr: fields.ForeignKeyRelation[Addr] = fields.ForeignKeyField("models.Addr", related_name="addrs")
|
|
540
|
+
addr_id: int
|
|
527
541
|
agent: fields.ForeignKeyRelation[Agent] = fields.ForeignKeyField("models.Agent", "assets")
|
|
528
542
|
agent_id: int
|
|
529
|
-
|
|
543
|
+
|
|
544
|
+
typ: AddrExType = fields.IntEnumField(AddrExType, default=AddrExType.found)
|
|
530
545
|
free: float = fields.FloatField()
|
|
531
546
|
freeze: float | None = fields.FloatField(default=0)
|
|
532
547
|
lock: float | None = fields.FloatField(default=0)
|
|
533
548
|
target: float | None = fields.FloatField(default=0, null=True)
|
|
534
549
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
_name = {"coin__ticker", "free"}
|
|
550
|
+
_name = {"asset__coin__ticker", "free"}
|
|
538
551
|
|
|
539
552
|
class Meta:
|
|
540
553
|
table_description = "Coin balance"
|
|
541
|
-
unique_together = (("
|
|
542
|
-
|
|
543
|
-
class PydanticMeta(Model.PydanticMeta):
|
|
544
|
-
max_recursion: int = 2 # default: 3
|
|
554
|
+
unique_together = (("addr_id", "agent_id", "typ"),)
|
|
545
555
|
|
|
546
556
|
def epyd(self):
|
|
547
557
|
module_name = f"xync_client.{self.agent.ex.name}.pyd"
|
|
@@ -551,13 +561,13 @@ class Asset(Model):
|
|
|
551
561
|
|
|
552
562
|
class PayReq(Model, TsTrait):
|
|
553
563
|
pay_until: datetime = DatetimeSecField()
|
|
554
|
-
|
|
555
|
-
|
|
564
|
+
addr: fields.ForeignKeyNullableRelation[Addr] = fields.ForeignKeyField("models.Addr", "pay_reqs", null=True)
|
|
565
|
+
cred: fields.ForeignKeyNullableRelation[Cred] = fields.ForeignKeyField("models.Cred", "pay_reqs", null=True)
|
|
556
566
|
user: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", "pay_reqs")
|
|
557
567
|
user_id: int
|
|
558
568
|
amount: float = fields.FloatField()
|
|
559
|
-
|
|
560
|
-
|
|
569
|
+
min_amount: int = fields.IntField()
|
|
570
|
+
payed_at: datetime | None = DatetimeSecField(default=None)
|
|
561
571
|
|
|
562
572
|
ads: fields.ReverseRelation["Ad"]
|
|
563
573
|
|
|
@@ -566,7 +576,7 @@ class PayReq(Model, TsTrait):
|
|
|
566
576
|
|
|
567
577
|
class Meta:
|
|
568
578
|
table_description = "Payment request"
|
|
569
|
-
unique_together = (("user_id", "
|
|
579
|
+
unique_together = (("user_id", "cred_id", "addr_id"),)
|
|
570
580
|
|
|
571
581
|
|
|
572
582
|
class Order(Model):
|
xync_schema/types.py
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
xync_schema/enums.py,sha256=MM5s20GpI8gsPlPS9nYFtkyrPheTvlcDYESwjnZ4Hmg,12698
|
|
3
|
+
xync_schema/models.py,sha256=_Ljjjp01gxLltcmCkmf3_Qt3NQx2aNnGRyBVSSpQ7s0,29170
|
|
4
|
+
xync_schema/types.py,sha256=sYWjJMcwv7mjm38FnWyxWhT6Z4bGpt92BTVZrqyZ0Ic,1675
|
|
5
|
+
xync_schema-0.6.87.dist-info/METADATA,sha256=pa2oAtfp_OMV2jF0jg5N3-mYHT5-iOzzldYLvdnRvzA,4055
|
|
6
|
+
xync_schema-0.6.87.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
7
|
+
xync_schema-0.6.87.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
+
xync_schema-0.6.87.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
xync_schema/enums.py,sha256=4ZNpPKY54SY34nz1APsg7wKzCIvpYWhG4sKsZ1uEmVU,12697
|
|
3
|
-
xync_schema/models.py,sha256=cShM5-olJMPJam6PvbUA5am_zv7QsdTN4QiJ6CoM1hQ,28822
|
|
4
|
-
xync_schema/types.py,sha256=_dfmLE_01l1tC7NxMDPnhyZ5aDEYznbhld2k7gZcNAQ,1667
|
|
5
|
-
xync_schema-0.6.85.dist-info/METADATA,sha256=j9w3UKQ_MvJBUf6Lnp_pHLto7UFaVItMOlqtj9vSPUA,4055
|
|
6
|
-
xync_schema-0.6.85.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
7
|
-
xync_schema-0.6.85.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
-
xync_schema-0.6.85.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|