File tree 2 files changed +6
-1
lines changed
packages/hardware-trezor/src
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
16
16
errors ,
17
17
util
18
18
} from '@cardano-sdk/key-management' ;
19
+ import { WhitelistedDeviceModel } from './utils' ;
19
20
import { areStringsEqualInConstantTime } from '@cardano-sdk/util' ;
20
21
import { txToTrezor } from './transformers/tx' ;
21
22
import _TrezorConnectWeb from '@trezor/connect-web' ;
@@ -129,7 +130,7 @@ export class TrezorKeyAgent extends KeyAgentBase {
129
130
if ( ! deviceFeatures . success ) {
130
131
throw new errors . TransportError ( 'Failed to get device' , deviceFeatures . payload ) ;
131
132
}
132
- if ( deviceFeatures . payload . model !== 'T' ) {
133
+ if ( ! ( Object . values ( WhitelistedDeviceModel ) as string [ ] ) . includes ( deviceFeatures . payload . model ) ) {
133
134
throw new errors . TransportError ( `Trezor device model "${ deviceFeatures . payload . model } " is not supported.` ) ;
134
135
}
135
136
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