File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/hardware-trezor/src Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
1616 errors ,
1717 util
1818} from '@cardano-sdk/key-management' ;
19+ import { WhitelistedDeviceModel } from './utils' ;
1920import { areStringsEqualInConstantTime } from '@cardano-sdk/util' ;
2021import { txToTrezor } from './transformers/tx' ;
2122import _TrezorConnectWeb from '@trezor/connect-web' ;
@@ -129,7 +130,7 @@ export class TrezorKeyAgent extends KeyAgentBase {
129130 if ( ! deviceFeatures . success ) {
130131 throw new errors . TransportError ( 'Failed to get device' , deviceFeatures . payload ) ;
131132 }
132- if ( deviceFeatures . payload . model !== 'T' ) {
133+ if ( ! ( Object . values ( WhitelistedDeviceModel ) as string [ ] ) . includes ( deviceFeatures . payload . model ) ) {
133134 throw new errors . TransportError ( `Trezor device model "${ deviceFeatures . payload . model } " is not supported.` ) ;
134135 }
135136 return deviceFeatures . payload ;
Original file line number Diff line number Diff line change 1+ export enum WhitelistedDeviceModel {
2+ ModelT = 'T' ,
3+ Safe3 = 'Safe 3'
4+ }
You can’t perform that action at this time.
0 commit comments