xync-schema 0.6.73.dev12__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 +15 -15
- xync_schema/models.py +4 -11
- xync_schema/types.py +0 -16
- {xync_schema-0.6.73.dev12.dist-info → xync_schema-0.6.73.dev15.dist-info}/METADATA +2 -2
- xync_schema-0.6.73.dev15.dist-info/RECORD +8 -0
- {xync_schema-0.6.73.dev12.dist-info → xync_schema-0.6.73.dev15.dist-info}/WHEEL +1 -1
- xync_schema-0.6.73.dev12.dist-info/RECORD +0 -8
- {xync_schema-0.6.73.dev12.dist-info → xync_schema-0.6.73.dev15.dist-info}/top_level.txt +0 -0
xync_schema/enums.py
CHANGED
|
@@ -164,7 +164,7 @@ class ExAction(IntEnum):
|
|
|
164
164
|
exs = {
|
|
165
165
|
"Beribit": (
|
|
166
166
|
ExType.p2p,
|
|
167
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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",
|
|
@@ -207,7 +207,7 @@ exs = {
|
|
|
207
207
|
"Bitvalve ": (ExType.p2p, "", "", "", "", ExStatus.plan),
|
|
208
208
|
"Bybit": (
|
|
209
209
|
ExType.main,
|
|
210
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
303
|
+
"AgACAgIAAxkBAAIEHWfeXy5a7fM9D5ys8ReQrDIRpwAB0wAC8_MxG1198Eo01GgWSVjQ3wEAAwIAA3gAAzYE",
|
|
304
304
|
"",
|
|
305
305
|
"",
|
|
306
306
|
"",
|
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
|
|
|
@@ -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
|
-
|
|
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(
|
|
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(
|
|
212
|
-
return sum(fiat["amount"] * fiat["
|
|
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
|
|
@@ -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,8 +0,0 @@
|
|
|
1
|
-
xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
xync_schema/enums.py,sha256=oFio3N8hgKe1Fhw_-vm-kJE61hi4kRMX1fmWHlYuwqw,12696
|
|
3
|
-
xync_schema/models.py,sha256=Q_PNe8OQ4q52ttB9QALZw_V1j3BNr-JPcpV3M5hmvmk,27004
|
|
4
|
-
xync_schema/types.py,sha256=e55yfU8Z5iXgUFa50ZqNhIgM9mxmPsWK0vshB_mZoU0,2673
|
|
5
|
-
xync_schema-0.6.73.dev12.dist-info/METADATA,sha256=DsXpV14fakzp2AAkrlxoYB_42XwOdKRo_YKDjfLoG1c,3991
|
|
6
|
-
xync_schema-0.6.73.dev12.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
|
7
|
-
xync_schema-0.6.73.dev12.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
-
xync_schema-0.6.73.dev12.dist-info/RECORD,,
|
|
File without changes
|