xync-schema 0.6.73.dev13__py3-none-any.whl → 0.6.73.dev15__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
@@ -164,7 +164,7 @@ class ExAction(IntEnum):
164
164
  exs = {
165
165
  "Beribit": (
166
166
  ExType.p2p,
167
- "https://sun9-41.userapi.com/impg/cZCGFTXH5-11_HjiWw9aWr3__SlbmMIiXSc-ig/YtOHJpjuVW0.jpg?size=604x604&quality=95&sign=def93bbe4283c563eb2d75a5968350f2",
167
+ "AgACAgIAAxkBAAIEY2ferEZ38wZbpG9kmfFPjsSGC3CmAAIo8DEbF_j4StC_ac-XA5fbAQADAgADeAADNgQ",
168
168
  "beribit.app",
169
169
  "beribit.app",
170
170
  "beribit.app/login",
@@ -172,7 +172,7 @@ exs = {
172
172
  ),
173
173
  "Binance": (
174
174
  ExType.main,
175
- "https://assets.coingecko.com/markets/images/52/large/binance.jpg",
175
+ "AgACAgIAAxkBAAIEYGfeq1hpcgu2el0ROqFvWtWNHrtWAAIQ8DEbF_j4Sq7oecXCtoONAQADAgADbQADNgQ",
176
176
  "binance.com",
177
177
  "p2p.binance.com",
178
178
  "accounts.binance.com/login",
@@ -180,7 +180,7 @@ exs = {
180
180
  ),
181
181
  "BingX": (
182
182
  ExType.p2p,
183
- "https://assets.coingecko.com/markets/images/812/large/YtFwQwJr_400x400.jpg",
183
+ "AgACAgIAAxkBAAIEZWferWiY5ZCV2SAWgSnUan76cl-TAAIy8DEbF_j4Sq1aMXmyATzQAQADAgADbQADNgQ",
184
184
  "bingx.com",
185
185
  "api-app.we-api.com",
186
186
  "bingx.com/login",
@@ -190,7 +190,7 @@ exs = {
190
190
  "BitcoinGlobal": (ExType.p2p, "", "", "", "", ExStatus.plan),
191
191
  "BitGet": (
192
192
  ExType.p2p,
193
- "https://assets.coingecko.com/markets/images/591/large/2023-07-25_21.47.43.jpg",
193
+ "AgACAgIAAxkBAAIEZ2ferYwPfGrx1PX-C7SBToZG-h-iAAI08DEbF_j4StxKwJlnBT3XAQADAgADbQADNgQ",
194
194
  "www.bitget.com",
195
195
  "www.bitget.com",
196
196
  "www.bitget.com/login",
@@ -198,7 +198,7 @@ exs = {
198
198
  ),
199
199
  "BitPapa": (
200
200
  ExType.p2p,
201
- "",
201
+ "AgACAgIAAxkBAAIEaWferbY69OMAASKXObrcYYLciuWVswACPPAxGxf4-EqNHJqqRTQmMgEAAwIAA3kAAzYE",
202
202
  "bitpapa.com",
203
203
  "bitpapa.com",
204
204
  "bitpapa.com/log-in",
@@ -291,7 +291,7 @@ exs = {
291
291
  "WazirX": (ExType.p2p, "", "", "", "", ExStatus.plan),
292
292
  "WebMoney": (
293
293
  ExType.p2p,
294
- "",
294
+ "AgACAgIAAxkBAAIEb2ferkkq2wWB-aJwIY6I2VZxSK4CAAJM8DEbF_j4SlHZDVKCzkUxAQADAgADeQADNgQ",
295
295
  "exchanger.money",
296
296
  "exchanger.money",
297
297
  "exchanger.money",
xync_schema/models.py CHANGED
@@ -4,7 +4,6 @@ from datetime import datetime
4
4
  from tortoise import fields
5
5
  from tortoise.queryset import QuerySet
6
6
  from tortoise import Model as BaseModel
7
- from tortoise.signals import pre_save
8
7
  from x_auth.models import Model, UserTg
9
8
  from x_model.models import TsTrait, DatetimeSecField
10
9
 
@@ -204,12 +203,12 @@ class User(UserTg, TsTrait):
204
203
  # investments: fields.BackwardFKRelation["Investment"]
205
204
 
206
205
  async def free_assets(self):
207
- assets = await Asset.filter(agent__user_id=self.id).values("free", "coin__rate")
206
+ assets = await Asset.filter(agent__actor__person__user__id=self.id).values("free", "coin__rate")
208
207
  return sum(asset["free"] * asset["coin__rate"] for asset in assets)
209
208
 
210
209
  async def fiats_sum(self):
211
- fiats = await Fiat.filter(user=self).values("amount", "pmcur__cur__rate")
212
- return sum(fiat["amount"] * fiat["pmcur__cur__rate"] for fiat in fiats)
210
+ fiats = await Fiat.filter(cred__person__user__id=self.id).values("amount", "cred__pmcur__cur__rate")
211
+ return sum(fiat["amount"] * fiat["cred__pmcur__cur__rate"] for fiat in fiats)
213
212
 
214
213
  async def balance(self) -> float:
215
214
  return await self.free_assets() + await self.fiats_sum()
@@ -223,12 +222,6 @@ class User(UserTg, TsTrait):
223
222
  # computed = ["balance"]
224
223
 
225
224
 
226
- @pre_save(User)
227
- async def person(_meta, user: User, _db, _updated: dict) -> None:
228
- if not user.person_id:
229
- user.person = await Person.create(name=f"{user.first_name} {user.last_name}".strip())
230
-
231
-
232
225
  class Forum(Model, TsTrait):
233
226
  id: int = fields.BigIntField(True)
234
227
  joined: bool = fields.BooleanField(default=False)
xync_schema/types.py CHANGED
@@ -91,22 +91,6 @@ class BaseOrder(BaseModel):
91
91
  id: int | None = None
92
92
 
93
93
 
94
- class Order(BaseModel):
95
- id: int
96
- amount: float
97
- status: str
98
- cred: models.Cred.out_type()
99
- is_sell: bool
100
- created_at: datetime
101
- topic: int
102
- actions: dict | None = {}
103
- actor: int | None = None
104
- payed_at: datetime | None = None
105
- appealed_at: datetime | None = None
106
- confirmed_at: datetime | None = None
107
- msgs: int = 0
108
-
109
-
110
94
  class OrderIn(BaseModel):
111
95
  exid: int
112
96
  amount: float
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.73.dev13
3
+ Version: 0.6.73.dev15
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=yNXG1ZMWKSrjS7kFMVUHpbruws5c_xO_UxswmQJPNOE,12547
3
+ xync_schema/models.py,sha256=WTdf1L_bdWbtNMsbRLxM0OoPSjYAwfpdYjJdvfGTmdc,26808
4
+ xync_schema/types.py,sha256=WKyePy4OW_JK3wMRdFHweugHMgDOzZCj_65gvt1jAoI,2315
5
+ xync_schema-0.6.73.dev15.dist-info/METADATA,sha256=abj9FAVST3g4cQFVotd_xLTV6xOrWfjhkQPGoFQf1mU,3991
6
+ xync_schema-0.6.73.dev15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
+ xync_schema-0.6.73.dev15.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
+ xync_schema-0.6.73.dev15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (77.0.3)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- xync_schema/enums.py,sha256=EkPJ5BhSSLVAO1BHsKHK7qo495Q9j-KOJ9vu4Cbmf-Q,12412
3
- xync_schema/models.py,sha256=lqxKUZE8yMD70596ORTvmtRX2DDjPpONTGwedWmYu3c,27002
4
- xync_schema/types.py,sha256=e55yfU8Z5iXgUFa50ZqNhIgM9mxmPsWK0vshB_mZoU0,2673
5
- xync_schema-0.6.73.dev13.dist-info/METADATA,sha256=iUo2_9CiRym9jTBrUtx0V3m0rfhenJlMXkWcEE1ADQA,3991
6
- xync_schema-0.6.73.dev13.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
7
- xync_schema-0.6.73.dev13.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
- xync_schema-0.6.73.dev13.dist-info/RECORD,,