xync-schema 0.6.85__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.85
3
+ Version: 0.6.86
4
4
  Summary: XyncNet project database model schema
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: EULA
@@ -56,7 +56,7 @@ class DepType(IntEnum):
56
56
  lend = 4
57
57
 
58
58
 
59
- class AssetType(IntEnum):
59
+ class AddrExType(IntEnum):
60
60
  spot = 1
61
61
  earn = 2
62
62
  found = 3
@@ -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.Pm", "adpmex", related_name="ads")
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
- # unique_together = ("pm_id", "cur_id"),
399
+ unique_together = (("pm_id", "cur_id"),)
400
400
 
401
401
  class PydanticMeta(Model.PydanticMeta):
402
402
  max_recursion: int = 2 # default: 3
@@ -521,27 +521,38 @@ class Limit(Model):
521
521
  table_description = "Currency accounts balance"
522
522
 
523
523
 
524
- class Asset(Model):
525
- coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="assets")
524
+ class Addr(Model):
525
+ coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="addrs")
526
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
527
542
  agent: fields.ForeignKeyRelation[Agent] = fields.ForeignKeyField("models.Agent", "assets")
528
543
  agent_id: int
529
- type_: AssetType = fields.IntEnumField(AssetType, default=AssetType.found)
544
+
545
+ typ: AddrExType = fields.IntEnumField(AddrExType, default=AddrExType.found)
530
546
  free: float = fields.FloatField()
531
547
  freeze: float | None = fields.FloatField(default=0)
532
548
  lock: float | None = fields.FloatField(default=0)
533
549
  target: float | None = fields.FloatField(default=0, null=True)
534
550
 
535
- pay_reqs: fields.ReverseRelation["PayReq"]
536
-
537
- _name = {"coin__ticker", "free"}
551
+ _name = {"asset__coin__ticker", "free"}
538
552
 
539
553
  class Meta:
540
554
  table_description = "Coin balance"
541
- unique_together = (("coin_id", "agent_id", "type_"),)
542
-
543
- class PydanticMeta(Model.PydanticMeta):
544
- max_recursion: int = 2 # default: 3
555
+ unique_together = (("addr_id", "agent_id", "typ"),)
545
556
 
546
557
  def epyd(self):
547
558
  module_name = f"xync_client.{self.agent.ex.name}.pyd"
@@ -55,11 +55,11 @@ class BaseAdIn(BaseAd):
55
55
 
56
56
 
57
57
  class AdBuyIn(BaseAdIn):
58
- pms_: list[models.Pm]
58
+ pmexs_: list[models.Pmex]
59
59
 
60
60
 
61
61
  class AdSaleIn(BaseAdIn):
62
- creds_: list[models.Cred]
62
+ credexs_: list[models.CredEx]
63
63
 
64
64
 
65
65
  class OrderIn(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.85
3
+ Version: 0.6.86
4
4
  Summary: XyncNet project database model schema
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: EULA
File without changes
File without changes
File without changes
File without changes
File without changes