From 382603d1b16bc92cd014656d6952536de442914d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomislav=20Hora=C4=8Dek?= Date: Wed, 4 Sep 2024 19:50:47 +0200 Subject: [PATCH] chore(hardware-trezor): handle and show trezor passphrase prompt --- packages/hardware-trezor/src/TrezorKeyAgent.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/hardware-trezor/src/TrezorKeyAgent.ts b/packages/hardware-trezor/src/TrezorKeyAgent.ts index 20ad6e01656..156b6c4abbc 100644 --- a/packages/hardware-trezor/src/TrezorKeyAgent.ts +++ b/packages/hardware-trezor/src/TrezorKeyAgent.ts @@ -116,6 +116,20 @@ export class TrezorKeyAgent extends KeyAgentBase { // Show Trezor Suite popup. Disabled for node based apps popup: communicationType !== CommunicationType.Node && !silentMode }); + + trezorConnect.on(Trezor.UI_EVENT, (event) => { + // React on ui-request_passphrase event + if (event.type === Trezor.UI.REQUEST_PASSPHRASE && event.payload.device) { + trezorConnect.uiResponse({ + payload: { + passphraseOnDevice: true, + save: true, + value: '' + }, + type: Trezor.UI.RECEIVE_PASSPHRASE + }); + } + }); return true; } catch (error: any) { if (error.code === 'Init_AlreadyInitialized') return true;