import { IWalletConnectSession } from "@walletconnect/legacy-types" ; import { isWalletConnectSession , getLocal , setLocal , removeLocal , } from "@walletconnect/legacy-utils" ; class SessionStorage { constructor ( public storageId = "walletconnect" ) { } public getSession ( ) { let session = null ; const json = getLocal ( this . storageId ) ; if ( json && isWalletConnectSession ( json ) ) { session = json ; } return session ; } public setSession ( session ) { setLocal ( this . storageId , session ) ; return session ; } public removeSession ( ) { removeLocal ( this . storageId ) ; } } export default SessionStorage ;