File tree Expand file tree Collapse file tree
packages/wdk/src/sequence Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,15 +25,16 @@ export class DevicesHandler implements Handler {
2525 ) : Promise < SignerUnavailable | SignerReady > {
2626 const signer = await this . devices . get ( address )
2727 if ( ! signer ) {
28- return {
28+ const status : SignerUnavailable = {
2929 address,
3030 handler : this ,
3131 reason : 'not-local-key' ,
3232 status : 'unavailable' ,
33- } as SignerUnavailable
33+ }
34+ return status
3435 }
3536
36- return {
37+ const status : SignerReady = {
3738 address,
3839 handler : this ,
3940 status : 'ready' ,
@@ -47,6 +48,7 @@ export class DevicesHandler implements Handler {
4748
4849 return true
4950 } ,
50- } as SignerReady
51+ }
52+ return status
5153 }
5254}
Original file line number Diff line number Diff line change @@ -41,27 +41,30 @@ export class PasskeysHandler implements Handler {
4141 address ,
4242 this . extensions . passkeys ,
4343 )
44- return {
44+ const status : SignerUnavailable = {
4545 ...base ,
4646 status : 'unavailable' ,
4747 reason : 'unknown-error' ,
48- } as SignerUnavailable
48+ }
49+ return status
4950 }
5051
5152 const passkey = imageHash && ( await this . loadPasskey ( request . envelope . wallet , imageHash ) )
5253 if ( ! passkey ) {
5354 console . warn ( 'PasskeySigner: status failed to load passkey' , address , imageHash )
54- return {
55+ const status : SignerUnavailable = {
5556 ...base ,
5657 status : 'unavailable' ,
5758 reason : 'unknown-error' ,
58- } as SignerUnavailable
59+ }
60+ return status
5961 }
6062
61- return {
63+ const status : SignerActionable = {
6264 ...base ,
6365 status : 'actionable' ,
6466 message : 'request-interaction-with-passkey' ,
67+ imageHash : imageHash ,
6568 handle : async ( ) => {
6669 const signature = await passkey . signSapient (
6770 request . envelope . wallet ,
@@ -76,6 +79,7 @@ export class PasskeysHandler implements Handler {
7679 } )
7780 return true
7881 } ,
79- } as SignerActionable
82+ }
83+ return status
8084 }
8185}
Original file line number Diff line number Diff line change 11import { Envelope } from '@0xsequence/sequence-core'
22import { Payload } from '@0xsequence/sequence-primitives'
3- import { Address , Bytes } from 'ox'
3+ import { Address , Hex } from 'ox'
44import { Handler } from '../handlers'
55
66export type ActionToPayload = {
@@ -29,7 +29,7 @@ export type BaseSignatureRequest<A extends Action = Action> = {
2929
3030export type SignerBase = {
3131 address : Address . Address
32- imageHash ?: Bytes . Bytes
32+ imageHash ?: Hex . Hex
3333}
3434
3535export type SignerSigned = SignerBase & {
You can’t perform that action at this time.
0 commit comments