xync-schema 0.6.73.dev12__tar.gz → 0.6.73.dev15__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.
Files changed (19) hide show
  1. {xync_schema-0.6.73.dev12/xync_schema.egg-info → xync_schema-0.6.73.dev15}/PKG-INFO +2 -2
  2. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema/enums.py +15 -15
  3. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema/models.py +4 -11
  4. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema/types.py +0 -16
  5. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15/xync_schema.egg-info}/PKG-INFO +2 -2
  6. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/.env.sample +0 -0
  7. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/.gitignore +0 -0
  8. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/.pre-commit-config.yaml +0 -0
  9. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/README.md +0 -0
  10. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/makefile +0 -0
  11. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/pyproject.toml +0 -0
  12. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/setup.cfg +0 -0
  13. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/tests/__init__.py +0 -0
  14. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/tests/test_db.py +0 -0
  15. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema/__init__.py +0 -0
  16. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema.egg-info/SOURCES.txt +0 -0
  17. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema.egg-info/dependency_links.txt +0 -0
  18. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema.egg-info/requires.txt +0 -0
  19. {xync_schema-0.6.73.dev12 → xync_schema-0.6.73.dev15}/xync_schema.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.73.dev12
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
@@ -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
- "https://avatars.mds.yandex.net/i?id=130c32d9900d514d738ef89b9c61bcd3_l-4767909-images-thumbs&n=13",
201
+ "AgACAgIAAxkBAAIEaWferbY69OMAASKXObrcYYLciuWVswACPPAxGxf4-EqNHJqqRTQmMgEAAwIAA3kAAzYE",
202
202
  "bitpapa.com",
203
203
  "bitpapa.com",
204
204
  "bitpapa.com/log-in",
@@ -207,7 +207,7 @@ exs = {
207
207
  "Bitvalve ": (ExType.p2p, "", "", "", "", ExStatus.plan),
208
208
  "Bybit": (
209
209
  ExType.main,
210
- "https://assets.coingecko.com/markets/images/698/large/bybit_spot.png",
210
+ "AgACAgIAAxkBAAIENGfeY4AfRquwTL2LpDrzqvFMVNt_AAIG9DEbXX3wSq3oI7t_PqQGAQADAgADbQADNgQ",
211
211
  "bybit.com",
212
212
  "api2.bybit.com",
213
213
  "bybit.com/login",
@@ -218,7 +218,7 @@ exs = {
218
218
  "Garantex": (ExType.p2p, "", "", "", "", ExStatus.plan),
219
219
  "Gate": (
220
220
  ExType.p2p,
221
- "https://assets.coingecko.com/markets/images/403/large/gate_io_logo.jpg",
221
+ "AgACAgIAAxkBAAIEMmfeY2WPV9axwELiZp9JsG1qVVSDAAIF9DEbXX3wSmqKNrQMcr0GAQADAgADbQADNgQ",
222
222
  "gate.io",
223
223
  "gate.io",
224
224
  "www.gate.io/login",
@@ -227,7 +227,7 @@ exs = {
227
227
  "HodlHodl": (ExType.p2p, "", "", "", "", ExStatus.plan),
228
228
  "Htx": (
229
229
  ExType.main,
230
- "https://assets.coingecko.com/markets/images/25/large/logo_V_colour_black.png",
230
+ "CAACAgIAAxkBAAIEQWfeZKFue_EuEx4aCWQuUUiBUFUWAAJcbQACXX3wSgpUwu_LgrVCNgQ",
231
231
  "www.htx.com",
232
232
  "www.htx.com",
233
233
  "htx.com/login",
@@ -236,7 +236,7 @@ exs = {
236
236
  "Koshelek": (ExType.p2p, "", "", "", "", ExStatus.plan),
237
237
  "KuCoin": (
238
238
  ExType.main,
239
- "https://assets.coingecko.com/markets/images/61/large/kucoin.png",
239
+ "AgACAgIAAxkBAAIELWfeYuCy-IaY2x4WDEFV30eDAlrLAAIC9DEbXX3wSskAAdr5c_L0LQEAAwIAA20AAzYE",
240
240
  "kucoin.com",
241
241
  "kucoin.com",
242
242
  "www.kucoin.com/ucenter/signin",
@@ -246,7 +246,7 @@ exs = {
246
246
  "LocalMonero": (ExType.p2p, "", "", "", "", ExStatus.plan),
247
247
  "Mexc": (
248
248
  ExType.main,
249
- "https://assets.coingecko.com/markets/images/409/large/MEXC_logo_square.jpeg",
249
+ "AgACAgIAAxkBAAIEJ2feYl-98-SXYJQAARlswmCK7ihM-gAD9DEbXX3wSheqy--NeUvRAQADAgADbQADNgQ",
250
250
  "www.mexc.com",
251
251
  "www.mexc.com",
252
252
  "www.mexc.com/login",
@@ -255,7 +255,7 @@ exs = {
255
255
  "Noones ": (ExType.p2p, "", "", "", "", ExStatus.plan),
256
256
  "Okx": (
257
257
  ExType.main,
258
- "https://assets.coingecko.com/markets/images/379/large/WeChat_Image_20220117220452.png",
258
+ "AgACAgIAAxkBAAIEJWfeYkG29cU8Nt1oaiskDutGInGvAAL_8zEbXX3wSrPVVMfw6kI5AQADAgADeQADNgQ",
259
259
  "www.okx.cab",
260
260
  "www.okx.cab",
261
261
  "www.okx.cab/account/login",
@@ -270,7 +270,7 @@ exs = {
270
270
  "RoboSats": (ExType.p2p, "", "", "", "", ExStatus.plan),
271
271
  "Sigen": (
272
272
  ExType.p2p,
273
- "https://yastatic.net/naydex/yandex-search/neZ1W6346/a21f02dA/2SvJ6dTLJwRiz_lTFP-fhywHqi1fxPNRcIxuKzcpwJ0DGlJzbzdT8ARet86SrINoGNj87R9U-t8HLZcrrBASQf0_6OkAL7cgl6uc0gCrHxI9Y369emE2MJF5yotCyODdZ5iXljtkQJMXTMV9VXsEL68seaiqQF578wnB3V",
273
+ "AgACAgIAAxkBAAIEIWfeYbAYWyMCtPtZ6q233_7VoQ87AAL-8zEbXX3wSqgLi3m0_G7AAQADAgADbQADNgQ",
274
274
  "sigen.pro",
275
275
  "sigen.pro",
276
276
  "sigen.pro/p2p",
@@ -281,7 +281,7 @@ exs = {
281
281
  "Solid": (ExType.main, "", "", "", "", ExStatus.plan),
282
282
  "TgWallet": (
283
283
  ExType.tg,
284
- "https://telerock.ru/uploads/posts/2024-03/f658443d9e_c9d505bbf856e2360ba6812079ba02d0.webp",
284
+ "AgACAgIAAxkBAAIEEGfd3oDil7jFpVEZh_ek2RlmDSrpAALA6jEb7cjwSo3tCIf7UsVoAQADAgADbQADNgQ",
285
285
  "walletbot.me",
286
286
  "p2p.walletbot.me",
287
287
  "walletbot.me",
@@ -291,7 +291,7 @@ exs = {
291
291
  "WazirX": (ExType.p2p, "", "", "", "", ExStatus.plan),
292
292
  "WebMoney": (
293
293
  ExType.p2p,
294
- "https://vectorseek.com/wp-content/uploads/2023/08/Webmoney-Icon-Logo-Vector.svg-.png",
294
+ "AgACAgIAAxkBAAIEb2ferkkq2wWB-aJwIY6I2VZxSK4CAAJM8DEbF_j4SlHZDVKCzkUxAQADAgADeQADNgQ",
295
295
  "exchanger.money",
296
296
  "exchanger.money",
297
297
  "exchanger.money",
@@ -300,7 +300,7 @@ exs = {
300
300
  "WhiteBIT": (ExType.p2p, "", "", "", "", ExStatus.plan),
301
301
  "xRocket": (
302
302
  ExType.p2p,
303
- "https://cdn.allmylinks.com/prod/Upload/file/R/L/6/8G0TaGNtUV8C1V7VQsivDtJcpEz2z7Lc.jpg",
303
+ "AgACAgIAAxkBAAIEHWfeXy5a7fM9D5ys8ReQrDIRpwAB0wAC8_MxG1198Eo01GgWSVjQ3wEAAwIAA3gAAzYE",
304
304
  "",
305
305
  "",
306
306
  "",
@@ -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
 
@@ -84,7 +83,7 @@ class Ex(Model):
84
83
  pmexs: fields.ReverseRelation["Pmex"]
85
84
  pairexs: fields.ReverseRelation["PairEx"]
86
85
  # deps: fields.ReverseRelation["Dep"]
87
- # tests: fields.ReverseRelation["TestEx"]
86
+ tests: fields.ReverseRelation["TestEx"]
88
87
 
89
88
  class Meta:
90
89
  table_description = "Exchanges"
@@ -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)
@@ -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
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.73.dev12
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