xync-schema 0.6.76__py3-none-any.whl → 0.6.78__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
@@ -92,6 +92,7 @@ class FileType(IntEnum):
92
92
  gif = 7
93
93
  svg = 8
94
94
  tgs = 9
95
+ jpeg = 10
95
96
 
96
97
 
97
98
  class ExStatus(IntEnum):
xync_schema/models.py CHANGED
@@ -137,7 +137,7 @@ class Pair(Model):
137
137
 
138
138
  class Meta:
139
139
  table_description = "Coin/Currency pairs"
140
- unique_together = (("coin", "cur"),)
140
+ unique_together = (("coin_id", "cur_id"),)
141
141
 
142
142
 
143
143
  class PairEx(Model, TsTrait):
@@ -152,7 +152,7 @@ class PairEx(Model, TsTrait):
152
152
 
153
153
  class Meta:
154
154
  table_description = "Pairs on Exs"
155
- unique_together = (("pair", "ex"),)
155
+ unique_together = (("pair_id", "ex_id"),)
156
156
 
157
157
 
158
158
  class Direction(Model):
@@ -167,7 +167,7 @@ class Direction(Model):
167
167
 
168
168
  class Meta:
169
169
  table_description = "Trade directions"
170
- unique_together = (("pairex", "sell"),)
170
+ unique_together = (("pairex_id", "sell"),)
171
171
 
172
172
 
173
173
  class Person(Model, TsTrait):
@@ -251,7 +251,7 @@ class Actor(Model):
251
251
 
252
252
  class Meta:
253
253
  table_description = "Actors"
254
- unique_together = (("ex", "exid"), ("ex", "person"))
254
+ unique_together = (("ex_id", "exid"), ("ex_id", "person_id"))
255
255
 
256
256
 
257
257
  class Agent(Model, TsTrait):
@@ -270,7 +270,7 @@ class Agent(Model, TsTrait):
270
270
  module_name = f"xync_client.{self.actor.ex.name}.agent"
271
271
  __import__(module_name)
272
272
  client = sys.modules[module_name].AgentClient
273
- return client(self)
273
+ return client(self, headers=self.auth.get("headers"), cookies=self.auth.get("cookies"))
274
274
 
275
275
  # def in_client(self) -> "BaseInAgentClient":
276
276
  # import sys
@@ -359,7 +359,6 @@ class Pm(Model):
359
359
  bank: bool | None = fields.BooleanField(null=True)
360
360
 
361
361
  typ: PmType | None = fields.IntEnumField(PmType, null=True)
362
- logo: fields.ForeignKeyNullableRelation["File"] = fields.ForeignKeyField("models.File", "pm_logos", null=True)
363
362
 
364
363
  ads: fields.ManyToManyRelation[Ad]
365
364
  curs: fields.ManyToManyRelation[Cur]
@@ -394,7 +393,7 @@ class Pmcur(Model): # for fiat with no exs tie
394
393
 
395
394
  class Meta:
396
395
  table_description = "Payment methods - Currencies"
397
- # unique_together = ("pm", "cur"),
396
+ # unique_together = ("pm_id", "cur_id"),
398
397
 
399
398
  class PydanticMeta(Model.PydanticMeta):
400
399
  max_recursion: int = 2 # default: 3
@@ -406,17 +405,15 @@ class Pmex(BaseModel): # existence pm in ex with no cur tie
406
405
  ex_id: int
407
406
  pm: fields.ForeignKeyRelation[Pm] = fields.ForeignKeyField("models.Pm", "pmexs")
408
407
  pm_id: int
408
+ logo: fields.ForeignKeyNullableRelation["File"] = fields.ForeignKeyField("models.File", "pmex_logos", null=True)
409
+ logo_id: int
409
410
  exid: str = fields.CharField(63)
410
411
  name: str = fields.CharField(63)
411
- name_: str = fields.CharField(63, null=True)
412
412
 
413
413
  banks: fields.BackwardFKRelation["PmexBank"]
414
414
 
415
415
  class Meta:
416
- unique_together = (
417
- ("ex", "exid"),
418
- ("ex", "name_"),
419
- ) # , ("ex", "pm"), ("ex", "name") # todo: tmp removed for HTX duplicates
416
+ unique_together = (("ex_id", "exid"),) # , ("ex", "pm"), ("ex", "name") # todo: tmp removed for HTX duplicates
420
417
 
421
418
 
422
419
  class PmexBank(BaseModel): # banks for SBP
@@ -454,6 +451,7 @@ class Cred(Model):
454
451
 
455
452
  fiat: fields.BackwardOneToOneRelation["Fiat"]
456
453
  ads: fields.ManyToManyRelation[Ad]
454
+ credexs: fields.BackwardFKRelation["CredEx"]
457
455
  orders: fields.BackwardFKRelation["Order"]
458
456
 
459
457
  _name = {"detail"}
@@ -474,7 +472,7 @@ class CredEx(Model):
474
472
 
475
473
  class Meta:
476
474
  table_description = "Credential on Exchange"
477
- unique_together = (("ex", "exid"),)
475
+ unique_together = (("ex_id", "exid"),)
478
476
 
479
477
 
480
478
  class Fiat(Model):
@@ -531,7 +529,7 @@ class Asset(Model):
531
529
 
532
530
  class Meta:
533
531
  table_description = "Coin balance"
534
- unique_together = (("coin", "agent", "type_"),)
532
+ unique_together = (("coin_id", "agent_id", "type_"),)
535
533
 
536
534
  class PydanticMeta(Model.PydanticMeta):
537
535
  max_recursion: int = 2 # default: 3
@@ -639,7 +637,7 @@ class Msg(Model):
639
637
  #
640
638
  # class Meta:
641
639
  # table_description = "Investment products"
642
- # unique_together = (("pid", "type_", "ex"),)
640
+ # unique_together = (("pid", "type_", "ex_id"),)
643
641
 
644
642
 
645
643
  # class Investment(Model, TsTrait):
@@ -674,7 +672,7 @@ class TestEx(Model):
674
672
 
675
673
  class Meta:
676
674
  table_description = "Test Exs"
677
- unique_together = (("action", "ex"),)
675
+ unique_together = (("action", "ex_id"),)
678
676
 
679
677
  class PydanticMeta(Model.PydanticMeta):
680
678
  max_recursion: int = 2
@@ -698,13 +696,15 @@ class Vpn(Model):
698
696
 
699
697
 
700
698
  class File(Model):
701
- name: str = fields.CharField(51, null=True)
699
+ name: str = fields.CharField(178, null=True)
702
700
  typ: FileType = fields.IntEnumField(FileType, null=True)
703
701
  fid: str = fields.CharField(76, unique=True, null=True)
704
702
  ref: bytes = fields.BinaryField(null=True)
705
703
  size: bytes = fields.IntField()
706
704
  created_at: datetime | None = DatetimeSecField(auto_now_add=True)
707
705
 
706
+ pmex_logos: fields.BackwardFKRelation[Pmex]
707
+
708
708
  _icon = "file"
709
709
  _name = {"name"}
710
710
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.76
3
+ Version: 0.6.78
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=tE3xRj3hWOSJvFkYMv4X5bGfAkjR7OzNmVnqj1X47Go,12697
3
+ xync_schema/models.py,sha256=PgjTPzK8NNpe01KXRJTR0fzZ6Ui7Ira1TiSQgZkTJWU,27770
4
+ xync_schema/types.py,sha256=jubMlsGkaLpv1QZrInP0sEKW8SgWa6TyHENDz8OEvDM,1737
5
+ xync_schema-0.6.78.dist-info/METADATA,sha256=q31QayhpwlEnJA4FOLMCg_2fwbuCo2XDoYims4oN4fA,4055
6
+ xync_schema-0.6.78.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
+ xync_schema-0.6.78.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
+ xync_schema-0.6.78.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- xync_schema/enums.py,sha256=LJme_4FsisEjXX3sDsvfB8xi6Lt0xe27FNRHEYzOUmg,12683
3
- xync_schema/models.py,sha256=CTeBehdTZwKcP2ZVR6ko4Vk8lkC1kr8ZHgiAIXzc76Y,27636
4
- xync_schema/types.py,sha256=jubMlsGkaLpv1QZrInP0sEKW8SgWa6TyHENDz8OEvDM,1737
5
- xync_schema-0.6.76.dist-info/METADATA,sha256=EbkXfFx-uMvbfoU0IdEazCcQCe_ieo1AU8_wwcGIIMk,4055
6
- xync_schema-0.6.76.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
- xync_schema-0.6.76.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
- xync_schema-0.6.76.dist-info/RECORD,,