@@ -38,7 +38,7 @@ export type PasskeySignerContext = {
38
38
}
39
39
40
40
export type PasskeySignMetadata = {
41
- cantValidateBehavior : 'ignore' | 'eip6492' | 'throw' ,
41
+ cantValidateBehavior : 'ignore' | 'eip6492' | 'throw'
42
42
}
43
43
44
44
function bytesToBase64URL ( bytes : Uint8Array ) : string {
@@ -131,7 +131,9 @@ export class SequencePasskeySigner implements signers.SapientSigner {
131
131
return this . reader ( ) . isDeployed ( await this . getAddress ( ) )
132
132
}
133
133
134
- async buildDeployTransaction ( metadata ?: commons . WalletDeployMetadata ) : Promise < commons . transaction . TransactionBundle | undefined > {
134
+ async buildDeployTransaction (
135
+ metadata ?: commons . WalletDeployMetadata
136
+ ) : Promise < commons . transaction . TransactionBundle | undefined > {
135
137
if ( metadata ?. ignoreDeployed && ( await this . isDeployed ( ) ) ) {
136
138
return
137
139
}
@@ -204,11 +206,11 @@ export class SequencePasskeySigner implements signers.SapientSigner {
204
206
}
205
207
206
208
// Pack the flags as hex string for encoding
207
- const flags = `0x${
209
+ const flags = `0x${ (
208
210
( this . requireUserValidation ? 0x40 : 0 ) |
209
211
( BigInt ( this . chainId ) === 0n ? 0x20 : 0 ) |
210
212
( this . requireBackupSanityCheck ? 0x10 : 0 )
211
- } `
213
+ ) . toString ( 16 ) } `
212
214
213
215
// Build signature
214
216
const signatureBytes = ethers . solidityPacked (
@@ -228,16 +230,16 @@ export class SequencePasskeySigner implements signers.SapientSigner {
228
230
]
229
231
)
230
232
231
- if ( ! ! metadata && metadata . cantValidateBehavior !== " ignore" ) {
233
+ if ( ! ! metadata && metadata . cantValidateBehavior !== ' ignore' ) {
232
234
let isDeployed = false
233
235
try {
234
236
isDeployed = await this . isDeployed ( )
235
237
} catch ( e ) {
236
238
// Ignore. Handled below
237
239
}
238
- if ( ! isDeployed && metadata . cantValidateBehavior === " eip6492" ) {
240
+ if ( ! isDeployed && metadata . cantValidateBehavior === ' eip6492' ) {
239
241
return this . buildEIP6492Signature ( signatureBytes )
240
- } else if ( ! isDeployed && metadata . cantValidateBehavior === " throw" ) {
242
+ } else if ( ! isDeployed && metadata . cantValidateBehavior === ' throw' ) {
241
243
throw new Error ( 'Cannot sign with a non-deployed passkey signer' )
242
244
}
243
245
}
0 commit comments