dev@locazia: add "confirm tx" message
This commit is contained in:
1 parent
b80e070b4d
commit
836adaf7b2
6 files changed
+113
-29
No files matched your search
@@ -6,7 +6,7 @@ from sanic import response
|
||||
from tonsdk.boc import begin_cell, begin_dict
|
||||
from tonsdk.utils import Address
|
||||
|
||||
from app.core._blockchain.ton.connect import TonConnect
|
||||
from app.core._blockchain.ton.connect import TonConnect, TON_CONNECT_WALLETS_LIST
|
||||
from app.core._blockchain.ton.platform import platform
|
||||
from app.core._config import PROJECT_HOST
|
||||
from app.core.logger import make_log
|
||||
@@ -14,6 +14,8 @@ from app.core._utils.resolve_content import resolve_content
|
||||
from app.core.content.utils import create_metadata_for_item
|
||||
from app.core._crypto.content import create_encrypted_content
|
||||
from app.core.models.node_storage import StoredContent
|
||||
from app.core.models._telegram import Wrapped_CBotChat
|
||||
from app.core._keyboards import get_inline_keyboard
|
||||
|
||||
|
||||
def valid_royalty_params(royalty_params):
|
||||
@@ -137,6 +139,20 @@ async def s_api_v1_blockchain_send_new_content_message(request):
|
||||
]
|
||||
}))
|
||||
|
||||
await (Wrapped_CBotChat(request.app.memory._telegram_bot, chat_id=request.ctx.user.telegram_id)).send_message(
|
||||
request.ctx.user.translated('p_tonconnectTransactionRequested'),
|
||||
reply_markup=get_inline_keyboard([
|
||||
[{
|
||||
'text': request.ctx.user.translated('gotoWallet_button'),
|
||||
'url': next(x['universal_url'] for x in TON_CONNECT_WALLETS_LIST if x['app_name'] == ton_connection.wallet_key['app_name'])
|
||||
}],
|
||||
[{
|
||||
'text': request.ctx.user.translated('home_button'),
|
||||
'callback_data': 'home'
|
||||
}]
|
||||
])
|
||||
)
|
||||
|
||||
return response.json({"message": "Transaction requested"})
|
||||
except BaseException as e:
|
||||
make_log("Blockchain", f"Error while sending new content message: {e}" + '\n' + traceback.format_exc(), level='error')
|
||||
|
||||
Reference in new issue
Block a user