mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-07 07:47:59 +01:00
fix(protobuf): add patch for ThpDeviceProperties.pairing_methods
This commit is contained in:
committed by
Szymon Lesisz
parent
a183f81662
commit
161406226b
@@ -129,6 +129,20 @@ export const events = (api: TrezorConnect) => {
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
if (event.type === 'ui-request_thp_pairing') {
|
||||
if (event.payload.device.thp?.properties?.pairing_methods[0] === 'CodeEntry') {
|
||||
api.uiResponse({
|
||||
type: 'ui-receive_thp_pairing_tag',
|
||||
payload: { selectedMethod: 1 },
|
||||
});
|
||||
|
||||
api.uiResponse({
|
||||
type: 'ui-receive_thp_pairing_tag',
|
||||
payload: { source: 'code-entry', tag: '0000' },
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
api.off(UI_EVENT, () => {});
|
||||
|
||||
|
||||
@@ -272,6 +272,7 @@ export const TYPE_PATCH = {
|
||||
'MoneroTransferDetails.out_key': 'Uint8Array',
|
||||
'MoneroTransferDetails.tx_pub_key': 'Uint8Array',
|
||||
'MoneroTransferDetails.additional_tx_pub_keys': 'Uint8Array',
|
||||
'ThpDeviceProperties.pairing_methods': '(keyof typeof ThpPairingMethod)',
|
||||
};
|
||||
|
||||
export const readPatch = (file: string) =>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type {
|
||||
ThpCredentialResponse,
|
||||
ThpDeviceProperties,
|
||||
ThpPairingMethod,
|
||||
ThpProtobufMessageType,
|
||||
} from './protobufTypes';
|
||||
|
||||
@@ -66,7 +67,7 @@ export type ThpMessageType = ThpProtobufMessageType & {
|
||||
};
|
||||
|
||||
export type ThpHandshakeCredentials = {
|
||||
pairingMethods: ThpDeviceProperties['pairing_methods'];
|
||||
pairingMethods: ThpPairingMethod[];
|
||||
handshakeHash: Buffer;
|
||||
handshakeCommitment: Buffer;
|
||||
codeEntryChallenge: Buffer;
|
||||
|
||||
@@ -12,7 +12,7 @@ export type ThpDeviceProperties = {
|
||||
model_variant: number;
|
||||
protocol_version_major: number;
|
||||
protocol_version_minor: number;
|
||||
pairing_methods: ThpPairingMethod[];
|
||||
pairing_methods: (keyof typeof ThpPairingMethod)[];
|
||||
};
|
||||
|
||||
export type ThpHandshakeCompletionReqNoisePayload = {
|
||||
|
||||
Reference in New Issue
Block a user