55 SignMessagePayload ,
66 SignTypedDataPayload ,
77 GuardConfig ,
8+ ETHAuthProof ,
89 SendWalletTransactionPayload ,
910 ModifyExplicitSessionPayload ,
1011 CreateNewSessionPayload ,
@@ -81,6 +82,10 @@ export interface SequenceStorage {
8182 getSessionlessConnection ( ) : Promise < SessionlessConnectionData | null >
8283 clearSessionlessConnection ( ) : Promise < void >
8384
85+ saveEthAuthProof ( proof : ETHAuthProof ) : Promise < void >
86+ getEthAuthProof ( ) : Promise < ETHAuthProof | null >
87+ clearEthAuthProof ( ) : Promise < void >
88+
8489 saveSessionlessConnectionSnapshot ?( sessionData : SessionlessConnectionData ) : Promise < void >
8590 getSessionlessConnectionSnapshot ?( ) : Promise < SessionlessConnectionData | null >
8691 clearSessionlessConnectionSnapshot ?( ) : Promise < void >
@@ -94,6 +99,7 @@ const STORE_NAME = 'userKeys'
9499const IMPLICIT_SESSIONS_IDB_KEY = 'SequenceImplicitSession'
95100const EXPLICIT_SESSIONS_IDB_KEY = 'SequenceExplicitSession'
96101const SESSIONLESS_CONNECTION_IDB_KEY = 'SequenceSessionlessConnection'
102+ const ETH_AUTH_PROOF_IDB_KEY = 'SequenceEthAuthProof'
97103const SESSIONLESS_CONNECTION_SNAPSHOT_IDB_KEY = 'SequenceSessionlessConnectionSnapshot'
98104
99105const PENDING_REDIRECT_REQUEST_KEY = 'SequencePendingRedirect'
@@ -305,6 +311,15 @@ export class WebStorage implements SequenceStorage {
305311 }
306312 }
307313
314+ async saveEthAuthProof ( proof : ETHAuthProof ) : Promise < void > {
315+ try {
316+ await this . setIDBItem ( ETH_AUTH_PROOF_IDB_KEY , proof )
317+ } catch ( error ) {
318+ console . error ( 'Failed to save ETHAuth proof:' , error )
319+ throw error
320+ }
321+ }
322+
308323 async getSessionlessConnection ( ) : Promise < SessionlessConnectionData | null > {
309324 try {
310325 return ( await this . getIDBItem < SessionlessConnectionData > ( SESSIONLESS_CONNECTION_IDB_KEY ) ) ?? null
@@ -314,6 +329,15 @@ export class WebStorage implements SequenceStorage {
314329 }
315330 }
316331
332+ async getEthAuthProof ( ) : Promise < ETHAuthProof | null > {
333+ try {
334+ return ( await this . getIDBItem < ETHAuthProof > ( ETH_AUTH_PROOF_IDB_KEY ) ) ?? null
335+ } catch ( error ) {
336+ console . error ( 'Failed to retrieve ETHAuth proof:' , error )
337+ return null
338+ }
339+ }
340+
317341 async clearSessionlessConnection ( ) : Promise < void > {
318342 try {
319343 await this . deleteIDBItem ( SESSIONLESS_CONNECTION_IDB_KEY )
@@ -323,6 +347,15 @@ export class WebStorage implements SequenceStorage {
323347 }
324348 }
325349
350+ async clearEthAuthProof ( ) : Promise < void > {
351+ try {
352+ await this . deleteIDBItem ( ETH_AUTH_PROOF_IDB_KEY )
353+ } catch ( error ) {
354+ console . error ( 'Failed to clear ETHAuth proof:' , error )
355+ throw error
356+ }
357+ }
358+
326359 async saveSessionlessConnectionSnapshot ( sessionData : SessionlessConnectionData ) : Promise < void > {
327360 try {
328361 await this . setIDBItem ( SESSIONLESS_CONNECTION_SNAPSHOT_IDB_KEY , sessionData )
@@ -363,6 +396,7 @@ export class WebStorage implements SequenceStorage {
363396 await this . clearExplicitSessions ( )
364397 await this . clearImplicitSession ( )
365398 await this . clearSessionlessConnection ( )
399+ await this . clearEthAuthProof ( )
366400 await this . clearSessionlessConnectionSnapshot ( )
367401 } catch ( error ) {
368402 console . error ( 'Failed to clear all data:' , error )
0 commit comments