xync-schema 0.6.29__tar.gz → 0.6.31__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.29/xync_schema.egg-info → xync_schema-0.6.31}/PKG-INFO +2 -2
- {xync_schema-0.6.29 → xync_schema-0.6.31}/pyproject.toml +10 -9
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema/models.py +120 -120
- {xync_schema-0.6.29 → xync_schema-0.6.31/xync_schema.egg-info}/PKG-INFO +2 -2
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema.egg-info/requires.txt +1 -1
- {xync_schema-0.6.29 → xync_schema-0.6.31}/.env.sample +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/.gitignore +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/.pre-commit-config.yaml +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/README.md +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/makefile +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/setup.cfg +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/tests/__init__.py +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/tests/test_db.py +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema/__init__.py +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema/pydantic.py +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema.egg-info/SOURCES.txt +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema.egg-info/dependency_links.txt +0 -0
- {xync_schema-0.6.29 → xync_schema-0.6.31}/xync_schema.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xync-schema
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.31
|
|
4
4
|
Summary: XyncNet project database model schema
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: EULA
|
|
@@ -10,8 +10,8 @@ Requires-Python: >=3.12
|
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
Requires-Dist: xtg-auth
|
|
12
12
|
Provides-Extra: dev
|
|
13
|
-
Requires-Dist: pytest; extra == "dev"
|
|
14
13
|
Requires-Dist: build; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
15
15
|
Requires-Dist: twine; extra == "dev"
|
|
16
16
|
|
|
17
17
|
## INSTALL
|
|
@@ -4,14 +4,19 @@ requires-python = ">=3.12"
|
|
|
4
4
|
authors = [
|
|
5
5
|
{name = "Mike Artemiev", email = "mixartemev@gmail.com"},
|
|
6
6
|
]
|
|
7
|
-
dependencies = [
|
|
8
|
-
"xtg-auth"
|
|
9
|
-
]
|
|
10
7
|
description = "XyncNet project database model schema"
|
|
11
8
|
readme = "README.md"
|
|
12
9
|
license = {text = "EULA"}
|
|
13
10
|
dynamic = ["version"]
|
|
14
11
|
|
|
12
|
+
dependencies = ["xtg-auth"]
|
|
13
|
+
|
|
14
|
+
[project.optional-dependencies]
|
|
15
|
+
dev = [
|
|
16
|
+
"build",
|
|
17
|
+
"pytest-asyncio",
|
|
18
|
+
"twine",
|
|
19
|
+
]
|
|
15
20
|
[project.urls]
|
|
16
21
|
Homepage = "https://gitlab.com/xync/back/schema"
|
|
17
22
|
Repository = "https://gitlab.com/xync/back/schema"
|
|
@@ -23,12 +28,8 @@ build-backend = "setuptools.build_meta"
|
|
|
23
28
|
version_scheme = "python-simplified-semver" # if "feature" in `branch_name` SEMVER_MINOR++ else SEMVER_PATCH++
|
|
24
29
|
local_scheme = "no-local-version"
|
|
25
30
|
|
|
26
|
-
[
|
|
27
|
-
|
|
28
|
-
"pytest",
|
|
29
|
-
"build",
|
|
30
|
-
"twine",
|
|
31
|
-
]
|
|
31
|
+
[tool.setuptools]
|
|
32
|
+
packages = ["xync_schema"]
|
|
32
33
|
|
|
33
34
|
[tool.pytest.ini_options]
|
|
34
35
|
asyncio_mode = "auto"
|
|
@@ -146,9 +146,9 @@ class Coin(Model):
|
|
|
146
146
|
|
|
147
147
|
assets: fields.ReverseRelation["Asset"]
|
|
148
148
|
pairs: fields.ReverseRelation["Pair"]
|
|
149
|
-
deps: fields.ReverseRelation["Dep"]
|
|
150
|
-
deps_reward: fields.ReverseRelation["Dep"]
|
|
151
|
-
deps_bonus: fields.ReverseRelation["Dep"]
|
|
149
|
+
# deps: fields.ReverseRelation["Dep"]
|
|
150
|
+
# deps_reward: fields.ReverseRelation["Dep"]
|
|
151
|
+
# deps_bonus: fields.ReverseRelation["Dep"]
|
|
152
152
|
|
|
153
153
|
_name = {"ticker"}
|
|
154
154
|
_icon = "coin"
|
|
@@ -166,7 +166,7 @@ class Ex(Model):
|
|
|
166
166
|
host: str | None = fields.CharField(63, null=True, description="With no protocol 'https://'")
|
|
167
167
|
host_p2p: str | None = fields.CharField(63, null=True, description="With no protocol 'https://'")
|
|
168
168
|
url_login: str | None = fields.CharField(63, null=True, description="With no protocol 'https://'")
|
|
169
|
-
|
|
169
|
+
type_: ExType = fields.IntEnumField(ExType)
|
|
170
170
|
logo: str = fields.CharField(511, default="")
|
|
171
171
|
|
|
172
172
|
pms: fields.ManyToManyRelation["Pm"]
|
|
@@ -178,14 +178,14 @@ class Ex(Model):
|
|
|
178
178
|
pmcurexs: fields.ReverseRelation["Pmcurex"]
|
|
179
179
|
pmexs: fields.ReverseRelation["Pmex"]
|
|
180
180
|
pairs: fields.ReverseRelation["Pair"]
|
|
181
|
-
deps: fields.ReverseRelation["Dep"]
|
|
181
|
+
# deps: fields.ReverseRelation["Dep"]
|
|
182
182
|
tests: fields.ReverseRelation["TestEx"]
|
|
183
183
|
|
|
184
184
|
_icon = "exchange"
|
|
185
185
|
|
|
186
186
|
class Meta:
|
|
187
187
|
table_description = "Exchanges"
|
|
188
|
-
unique_together = (("name", "
|
|
188
|
+
unique_together = (("name", "type_"),)
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
class Curex(Model):
|
|
@@ -240,19 +240,19 @@ class Direction(Model):
|
|
|
240
240
|
|
|
241
241
|
|
|
242
242
|
class User(BaseUser, UserRefTrait, UserInfoTrait): # tg user
|
|
243
|
-
chat_status: UserStatus = fields.IntEnumField(UserStatus, default=UserStatus.
|
|
243
|
+
chat_status: UserStatus = fields.IntEnumField(UserStatus, default=UserStatus.RESTRICTED)
|
|
244
244
|
in_channel: bool | None = fields.BooleanField(default=False, null=True)
|
|
245
245
|
|
|
246
246
|
agents: fields.BackwardFKRelation["Agent"]
|
|
247
247
|
fiats: fields.BackwardFKRelation["Fiat"]
|
|
248
248
|
limits: fields.BackwardFKRelation["Limit"]
|
|
249
249
|
proteges: fields.BackwardFKRelation["User"]
|
|
250
|
-
vpn: fields.BackwardOneToOneRelation["Vpn"]
|
|
251
|
-
invite_requests: fields.BackwardFKRelation["Invite"]
|
|
252
|
-
invite_approvals: fields.BackwardFKRelation["Invite"]
|
|
253
|
-
lends: fields.BackwardFKRelation["Credit"]
|
|
254
|
-
borrows: fields.BackwardFKRelation["Credit"]
|
|
255
|
-
investments: fields.BackwardFKRelation["Investment"]
|
|
250
|
+
# vpn: fields.BackwardOneToOneRelation["Vpn"]
|
|
251
|
+
# invite_requests: fields.BackwardFKRelation["Invite"]
|
|
252
|
+
# invite_approvals: fields.BackwardFKRelation["Invite"]
|
|
253
|
+
# lends: fields.BackwardFKRelation["Credit"]
|
|
254
|
+
# borrows: fields.BackwardFKRelation["Credit"]
|
|
255
|
+
# investments: fields.BackwardFKRelation["Investment"]
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
class Agent(Model, TsTrait):
|
|
@@ -337,7 +337,7 @@ class Pm(Model):
|
|
|
337
337
|
name: str = fields.CharField(63, unique=True)
|
|
338
338
|
identifier: str | None = fields.CharField(63, unique=True, null=True)
|
|
339
339
|
rank: int | None = fields.SmallIntField(default=0)
|
|
340
|
-
|
|
340
|
+
type_: PmType | None = fields.IntEnumField(PmType, null=True)
|
|
341
341
|
template: int | None = fields.SmallIntField(null=True)
|
|
342
342
|
logo: str | None = fields.CharField(127, null=True)
|
|
343
343
|
color: str | None = fields.CharField(7, null=True)
|
|
@@ -429,7 +429,7 @@ class Pmcurex(Model): # existence pm in ex for exact cur, with "blocked" flag
|
|
|
429
429
|
|
|
430
430
|
_name = {"pmcur__pm__name", "pmcur__cur__ticker", "ex__name"}
|
|
431
431
|
|
|
432
|
-
def repr(self,
|
|
432
|
+
def repr(self, *args):
|
|
433
433
|
return ("[X] " if self.blocked else "") + super().repr()
|
|
434
434
|
|
|
435
435
|
class Meta:
|
|
@@ -511,7 +511,7 @@ class Asset(Model):
|
|
|
511
511
|
coin_id: int
|
|
512
512
|
agent: fields.ForeignKeyRelation[Agent] = fields.ForeignKeyField("models.Agent", "assets")
|
|
513
513
|
agent_id: int
|
|
514
|
-
|
|
514
|
+
type_: AssetType = fields.IntEnumField(AssetType)
|
|
515
515
|
free: float = fields.FloatField()
|
|
516
516
|
freeze: float | None = fields.FloatField(default=0)
|
|
517
517
|
lock: float | None = fields.FloatField(default=0)
|
|
@@ -525,7 +525,7 @@ class Asset(Model):
|
|
|
525
525
|
|
|
526
526
|
class Meta:
|
|
527
527
|
table_description = "Coin balance"
|
|
528
|
-
unique_together = (("coin", "agent", "
|
|
528
|
+
unique_together = (("coin", "agent", "type_"),)
|
|
529
529
|
|
|
530
530
|
class PydanticMeta:
|
|
531
531
|
exclude_raw_fields: bool = False
|
|
@@ -556,59 +556,59 @@ class Order(Model, TsTrait):
|
|
|
556
556
|
table_description = "P2P Orders"
|
|
557
557
|
|
|
558
558
|
|
|
559
|
-
class Dep(Model, TsTrait):
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
class Investment(Model, TsTrait):
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
559
|
+
# class Dep(Model, TsTrait):
|
|
560
|
+
# pid: str = fields.CharField(31) # product_id
|
|
561
|
+
# apr: float = fields.FloatField()
|
|
562
|
+
# fee: float | None = fields.FloatField(null=True)
|
|
563
|
+
# apr_is_fixed: bool = fields.BooleanField(default=False)
|
|
564
|
+
# duration: int | None = fields.SmallIntField(null=True)
|
|
565
|
+
# early_redeem: bool | None = fields.BooleanField(null=True)
|
|
566
|
+
# type_: DepType = fields.IntEnumField(DepType)
|
|
567
|
+
# # mb: renewable?
|
|
568
|
+
# min_limit: float = fields.FloatField()
|
|
569
|
+
# max_limit: float | None = fields.FloatField(null=True)
|
|
570
|
+
# is_active: bool = fields.BooleanField(default=True)
|
|
571
|
+
#
|
|
572
|
+
# coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField("models.Coin", related_name="deps")
|
|
573
|
+
# coin_id: int
|
|
574
|
+
# reward_coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField(
|
|
575
|
+
# "models.Coin", related_name="deps_reward", null=True
|
|
576
|
+
# )
|
|
577
|
+
# reward_coin_id: int | None = None
|
|
578
|
+
# bonus_coin: fields.ForeignKeyRelation[Coin] = fields.ForeignKeyField(
|
|
579
|
+
# "models.Coin", related_name="deps_bonus", null=True
|
|
580
|
+
# )
|
|
581
|
+
# bonus_coin_id: int | None = None
|
|
582
|
+
# ex: fields.ForeignKeyRelation[Ex] = fields.ForeignKeyField("models.Ex", related_name="deps")
|
|
583
|
+
# ex_id: int
|
|
584
|
+
# investments: fields.ReverseRelation["Investment"]
|
|
585
|
+
#
|
|
586
|
+
# _icon = "seeding"
|
|
587
|
+
# _name = {"pid"}
|
|
588
|
+
#
|
|
589
|
+
# def repr(self, *args):
|
|
590
|
+
# return f'{self.coin.ticker}:{self.apr * 100:.3g}% {f"{self.duration}d" if self.duration and self.duration > 0 else "flex"}'
|
|
591
|
+
#
|
|
592
|
+
# class Meta:
|
|
593
|
+
# table_description = "Investment products"
|
|
594
|
+
# unique_together = (("pid", "type_", "ex"),)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
# class Investment(Model, TsTrait):
|
|
598
|
+
# dep: fields.ForeignKeyRelation[Dep] = fields.ForeignKeyField("models.Dep", related_name="investments")
|
|
599
|
+
# # dep_id: int
|
|
600
|
+
# amount: float = fields.FloatField()
|
|
601
|
+
# is_active: bool = fields.BooleanField(default=True)
|
|
602
|
+
# user: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="investments")
|
|
603
|
+
#
|
|
604
|
+
# _icon = "trending-up"
|
|
605
|
+
# _name = {"dep__pid", "amount"}
|
|
606
|
+
#
|
|
607
|
+
# def repr(self, *args):
|
|
608
|
+
# return f"{self.amount:.3g} {self.dep.repr()}"
|
|
609
|
+
#
|
|
610
|
+
# class Meta:
|
|
611
|
+
# table_description = "Investments"
|
|
612
612
|
|
|
613
613
|
|
|
614
614
|
class TestEx(Model):
|
|
@@ -629,53 +629,53 @@ class TestEx(Model):
|
|
|
629
629
|
unique_together = (("action", "ex"),)
|
|
630
630
|
|
|
631
631
|
|
|
632
|
-
class Vpn(Model):
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
class Invite(Model, TsTrait):
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
class Credit(Model, TsTrait):
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
632
|
+
# class Vpn(Model):
|
|
633
|
+
# user: fields.OneToOneRelation[User] = fields.OneToOneField("models.User", related_name="vpn")
|
|
634
|
+
# user_id: int
|
|
635
|
+
# priv: str = fields.CharField(63, unique=True)
|
|
636
|
+
# pub: str = fields.CharField(63, unique=True)
|
|
637
|
+
# created_at: datetime | None = DatetimeSecField(auto_now_add=True)
|
|
638
|
+
#
|
|
639
|
+
# _icon = "vpn"
|
|
640
|
+
# _name = {"pub"}
|
|
641
|
+
#
|
|
642
|
+
# def repr(self, *args):
|
|
643
|
+
# return self.user.username
|
|
644
|
+
#
|
|
645
|
+
# class Meta:
|
|
646
|
+
# table_description = "VPNs"
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
# class Invite(Model, TsTrait):
|
|
650
|
+
# ref: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="invite_approvals")
|
|
651
|
+
# ref_id: int
|
|
652
|
+
# protege: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="invite_requests")
|
|
653
|
+
# protege_id: int
|
|
654
|
+
# approved: str = fields.BooleanField(default=False) # status
|
|
655
|
+
#
|
|
656
|
+
# _icon = "invite"
|
|
657
|
+
# _name = {"ref__username", "protege__username", "approved"}
|
|
658
|
+
#
|
|
659
|
+
# def repr(self, *args):
|
|
660
|
+
# return self.protege.name
|
|
661
|
+
#
|
|
662
|
+
# class Meta:
|
|
663
|
+
# table_description = "Invites"
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
# class Credit(Model, TsTrait):
|
|
667
|
+
# lender: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="lends")
|
|
668
|
+
# lender_id: int
|
|
669
|
+
# borrower: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="borrows")
|
|
670
|
+
# borrower_id: int
|
|
671
|
+
# borrower_priority: bool = fields.BooleanField(default=True)
|
|
672
|
+
# amount: int = fields.IntField(default=None) # 0 - is all remain borrower balance
|
|
673
|
+
#
|
|
674
|
+
# _icon = "credit"
|
|
675
|
+
# _name = {"lender__username", "borrower__username", "amount"}
|
|
676
|
+
#
|
|
677
|
+
# def repr(self, *args):
|
|
678
|
+
# return self.borrower.name
|
|
679
|
+
#
|
|
680
|
+
# class Meta:
|
|
681
|
+
# table_description = "Credits"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xync-schema
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.31
|
|
4
4
|
Summary: XyncNet project database model schema
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: EULA
|
|
@@ -10,8 +10,8 @@ Requires-Python: >=3.12
|
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
Requires-Dist: xtg-auth
|
|
12
12
|
Provides-Extra: dev
|
|
13
|
-
Requires-Dist: pytest; extra == "dev"
|
|
14
13
|
Requires-Dist: build; extra == "dev"
|
|
14
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
15
15
|
Requires-Dist: twine; extra == "dev"
|
|
16
16
|
|
|
17
17
|
## INSTALL
|
|
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
|