@@ -35,7 +35,7 @@ enum NetworkApiUrls {
3535export type AccountDetails = {
3636 index ?: number ;
3737 hdPath : string ;
38- passphraseState ?: string ;
38+ passphraseState ?: string | undefined ;
3939} ;
4040
4141export type AccountPageEntry = {
@@ -229,7 +229,7 @@ export class OneKeyKeyring extends EventEmitter {
229229 showOnOneKey : false ,
230230 chainId : 1 ,
231231 path : this . #getBasePath( ) ,
232- passphraseState : this . passphraseState ,
232+ passphraseState : this . passphraseState ?? '' ,
233233 } )
234234 . then ( async ( res ) => {
235235 if ( res . success ) {
@@ -418,14 +418,14 @@ export class OneKeyKeyring extends EventEmitter {
418418 ...tx . toJSON ( ) ,
419419 chainId,
420420 to : this . #normalize( Buffer . from ( tx . to ?. bytes ?? [ ] ) ) ,
421- } as EVMSignTransactionParams [ 'transaction' ] ;
421+ } as unknown as EVMSignTransactionParams [ 'transaction' ] ;
422422 }
423423
424424 try {
425425 const details = this . #accountDetailsFromAddress( address ) ;
426426 const response = await this . bridge . ethereumSignTransaction ( {
427427 path : details . hdPath ,
428- passphraseState : details . passphraseState ,
428+ passphraseState : details . passphraseState ?? '' ,
429429 useEmptyPassphrase : isEmptyPassphrase ( details . passphraseState ) ,
430430 transaction,
431431 } ) ;
@@ -464,7 +464,7 @@ export class OneKeyKeyring extends EventEmitter {
464464 this . bridge
465465 . ethereumSignMessage ( {
466466 path : details . hdPath ,
467- passphraseState : details . passphraseState ,
467+ passphraseState : details . passphraseState ?? '' ,
468468 useEmptyPassphrase : isEmptyPassphrase ( details . passphraseState ) ,
469469 messageHex : ethUtil . stripHexPrefix ( message ) ,
470470 } )
@@ -517,7 +517,7 @@ export class OneKeyKeyring extends EventEmitter {
517517 const details = this . #accountDetailsFromAddress( address ) ;
518518 const response = await this . bridge . ethereumSignTypedData ( {
519519 path : details . hdPath ,
520- passphraseState : details . passphraseState ,
520+ passphraseState : details . passphraseState ?? '' ,
521521 useEmptyPassphrase : isEmptyPassphrase ( details . passphraseState ) ,
522522 data : data as EthereumSignTypedDataMessage < EthereumSignTypedDataTypes > ,
523523 domainHash,
0 commit comments