On this page
Respond to UI Events
Use HardwareSDK.uiResponse() to answer a pending SDK input request. It returns void; await the original address, signing, or device-operation Promise for the operation result.
Register the UI event handler before a protected call. Respond only to the current request, and preserve payload.responseCorrelation when the request includes it. The interactionId and deviceId correlation fields belong at the top level of the response; they are not a replacement for the positional wallet deviceId in signing calls.
PIN input
This fragment belongs inside the UI_REQUEST.REQUEST_PIN handler. message is that request, and pinValue is the completed blind-PIN position sequence collected by your UI.
HardwareSDK.uiResponse({
...message.payload.responseCorrelation,
type: UI_RESPONSE.RECEIVE_PIN,
payload: pinValue,
});For a host-input request that offers on-device entry, the response value is @@ONEKEY_INPUT_PIN_IN_DEVICE. A request marked deviceOnly, ButtonRequest_PinEntry, or ButtonRequest_AttachPin is an on-device notification: display instructions and wait without replying.
See PIN for the blind keypad mapping and model constraints.
Passphrase input
This fragment belongs inside UI_REQUEST.REQUEST_PASSPHRASE. passphraseValue is supplied by the user’s current input, never by a hard-coded or logged value.
HardwareSDK.uiResponse({
...message.payload.responseCorrelation,
type: UI_RESPONSE.RECEIVE_PASSPHRASE,
payload: {
value: passphraseValue,
passphraseOnDevice: false,
save: false,
},
});To choose device entry, use { value: '', passphraseOnDevice: true, save: false } instead. Honor deviceOnly by selecting device entry. REQUEST_PASSPHRASE_ON_DEVICE is a subsequent notification and needs no response.
Keep host-entered secrets out of logs, analytics, persistent storage, and error reports. Use save: false unless the user explicitly opts into a supported session-caching flow.
Cancel and close
Cancel the operation on the selected connection with HardwareSDK.cancel(connectId) when the user cancels input. Invalidate the pending modal submission when the operation finishes or the SDK closes its UI, so a late response cannot answer another request.
REQUEST_BUTTON, firmware progress, and device-only PIN prompts do not accept an “OK” response. A host button must never stand in for device confirmation.
Other input requests
WebUSB bootloader-selection requests use their matching UI_RESPONSE.SELECT_DEVICE_* response and a selected device ID in payload. The public union UiResponseEvent defines the accepted shapes. Lifecycle APIs such as uiResponse do not take the general Common Params object.