xync-db 0.3.2__tar.gz → 0.4.0__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_db-0.3.2 → xync_db-0.4.0}/PKG-INFO +1 -1
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/models/__init__.py +14 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/.gitignore +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/README.md +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/pyproject.toml +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/__init__.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/config.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/enums.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/exceptions.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/graph.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/i18n.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/logo.png +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/CLAUDE.md +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/__init__.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/0001_initial.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/0002_triggers.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/0003_files_seed.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/0004_all_seed.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/0005_credex_del.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/0006_credex_orphan.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/__init__.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/seed/__init__.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/seed/a_actor_seed.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/seed/a_tg_seed.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/seed/b_htx_seed.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/migrations/models/seed/xync_files.sql +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/models/CLAUDE.md +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/py.typed +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/shared.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/__init__.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/__init__.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/actor.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/ad.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/common.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/cred.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/order.py +0 -0
- {xync_db-0.3.2 → xync_db-0.4.0}/src/xync_db/typs/db/pm.py +0 -0
|
@@ -1000,6 +1000,20 @@ class Agent(Model, TsTrait):
|
|
|
1000
1000
|
dct = {coin_id: round(amount * 10 ** -(s := scales[coin_id]), s) for coin_id, amount in dct.items()}
|
|
1001
1001
|
return dct[coin_id] if coin_id else dct
|
|
1002
1002
|
|
|
1003
|
+
@classmethod
|
|
1004
|
+
async def confirm_trade(cls, agent_id: int, confirm: bool) -> None:
|
|
1005
|
+
"""Ответ владельца на вопрос «включить торговлю?» (Notifier.trade_confirm, заданный при выходе
|
|
1006
|
+
агента в listen). Зовут из web-контроллера и бот-колбэка — единый эмиттер канала
|
|
1007
|
+
`agents_trade_confirm`, который резолвит ждущий 30с future в хендлере листенера api
|
|
1008
|
+
(handlers.agents.agents_trade_confirm). На `True` хендлер включает торговлю на бирже
|
|
1009
|
+
(acl.ads_switch(True)), иначе снимает listen-бит. Через pg_notify (как CredEx.orphan_del), чтобы
|
|
1010
|
+
и web-, и bot-зона не дублировали полезную нагрузку, а ответ попадал в единый листенер api —
|
|
1011
|
+
там живут и future, и agent-клиент."""
|
|
1012
|
+
await connections.get("default").execute_query(
|
|
1013
|
+
"SELECT pg_notify('agents_trade_confirm', jsonb_build_array($1::int, $2::bool)::varchar)",
|
|
1014
|
+
[agent_id, confirm],
|
|
1015
|
+
)
|
|
1016
|
+
|
|
1003
1017
|
@classmethod
|
|
1004
1018
|
async def upsert(
|
|
1005
1019
|
cls, exid: int, host: str, auth: dict, exp: int, rname: str, nick: str, email: str
|
|
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
|
|
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
|
|
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
|