mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-06 23:39:38 +01:00
chore(protocol): export ThpPairingMethod as enum
This commit is contained in:
committed by
Szymon Lesisz
parent
9408ea5e79
commit
e61610e32b
@@ -44,3 +44,4 @@ export type {
|
||||
} from '@trezor/blockchain-link';
|
||||
|
||||
export { FirmwareType, type VersionArray } from '@trezor/device-utils';
|
||||
export { ThpPairingMethod } from '@trezor/protocol/src/protocol-thp/messages';
|
||||
|
||||
@@ -15,5 +15,6 @@ export {
|
||||
} from './crypto/pairing';
|
||||
export { ThpState } from './ThpState';
|
||||
export { getCurve25519KeyPair } from './crypto/curve25519';
|
||||
export { getThpPairingMethod } from './utils';
|
||||
|
||||
export const name = 'thp';
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
THP_HANDSHAKE_INIT_RESPONSE,
|
||||
THP_READ_ACK_HEADER_BYTE,
|
||||
} from './constants';
|
||||
import type { ThpMessageSyncBit } from './messages';
|
||||
import { ThpMessageSyncBit, ThpPairingMethod } from './messages';
|
||||
|
||||
export const addAckBit = (magic: number, ackBit: number) => {
|
||||
const result = Buffer.alloc(1);
|
||||
@@ -154,3 +154,6 @@ export const isThpMessageName = (name: string) =>
|
||||
'ThpHandshakeCompletionRequest',
|
||||
'ThpReadAck',
|
||||
].includes(name);
|
||||
|
||||
export const getThpPairingMethod = (dm: ThpPairingMethod | keyof typeof ThpPairingMethod) =>
|
||||
typeof dm === 'string' ? ThpPairingMethod[dm] : dm;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export type {
|
||||
ThpDeviceProperties,
|
||||
export {
|
||||
ThpPairingMethod,
|
||||
ThpCredentials,
|
||||
type ThpDeviceProperties,
|
||||
type ThpCredentials,
|
||||
} from './protocol-thp/messages';
|
||||
export type { ThpState, ThpStateSerialized, ThpChannelState } from './protocol-thp/ThpState';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user