dev@locazia: fix Tonhub tonhub
This commit is contained in:
1 parent
1a167a7090
commit
b8251a456b
3 files changed
+11
-3
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, TON_CONNECT_WALLETS_LIST
|
||||
from app.core._blockchain.ton.connect import TonConnect, wallet_obj_by_name
|
||||
from app.core._blockchain.ton.platform import platform
|
||||
from app.core._config import PROJECT_HOST
|
||||
from app.core.logger import make_log
|
||||
@@ -144,7 +144,7 @@ async def s_api_v1_blockchain_send_new_content_message(request):
|
||||
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.split('==')[0])
|
||||
'url': wallet_obj_by_name(ton_connection.wallet_key.split('==')[0])['universal_url']
|
||||
}],
|
||||
[{
|
||||
'text': request.ctx.user.translated('home_button'),
|
||||
|
||||
@@ -48,6 +48,14 @@ TON_CONNECT_WALLETS_LIST = [
|
||||
]
|
||||
|
||||
|
||||
def wallet_obj_by_name(wallet_name: str) -> dict:
|
||||
wallet_name = wallet_name.lower()
|
||||
for wallet in TON_CONNECT_WALLETS_LIST:
|
||||
if wallet["app_name"].lower() == wallet_name:
|
||||
return wallet
|
||||
raise StopIteration(f"Wallet {wallet_name} not found")
|
||||
|
||||
|
||||
def unpack_wallet_info(wallet_info) -> dict:
|
||||
return {
|
||||
'provider': wallet_info.provider,
|
||||
|
||||
Reference in new issue
Block a user