interface ISessionStorage {
    smartAccountAddress: `0x${string}`;
    addSessionData(_leaf: SessionLeafNode): Promise<void>;
    addSigner(_signer?: SignerData, chain?: Chain): Promise<SmartAccountSigner<any>>;
    clearPendingSessions(): Promise<void>;
    getAllSessionData(_param?: SessionSearchParam): Promise<SessionLeafNode[]>;
    getMerkleRoot(): Promise<string>;
    getSessionData(_param: SessionSearchParam): Promise<SessionLeafNode>;
    getSignerByKey(_signerPublicKey: string, chain: Chain): Promise<SmartAccountSigner<any>>;
    getSignerBySession(_param: SessionSearchParam, chain: Chain): Promise<SmartAccountSigner<any>>;
    revokeSessions(sessionIDs: string[]): Promise<any>;
    setMerkleRoot(_merkleRoot: string): Promise<void>;
    updateSessionStatus(_param: SessionSearchParam, _status: SessionStatus): Promise<void>;
}

Properties

smartAccountAddress: `0x${string}`

The address of the smartAccount

Methods

  • Adds a session leaf node to the session storage

    Parameters

    Returns Promise<void>

  • If a signer object is passed, it will be added to the session storage If no signer object is passed, it'll create a random signer and add it to the session storage

    Parameters

    Returns Promise<SmartAccountSigner<any>>

  • Clears all the pending sessions from the session storage

    Returns Promise<void>

  • Fetch all the session leaf nodes from the session storage based on the session search param. If no param is passed, it'll fetch all the session leaf nodes from the session storage

    Parameters

    Returns Promise<SessionLeafNode[]>

  • Fetch merkle root from the session storage

    Returns Promise<string>

  • Fetch a session leaf node from the session storage

    Parameters

    Returns Promise<SessionLeafNode>

  • Fetch a signer from the session storage

    Parameters

    • _signerPublicKey: string
    • chain: Chain

    Returns Promise<SmartAccountSigner<any>>

  • Fetch a signer from the session storage based on the session search param

    Parameters

    Returns Promise<SmartAccountSigner<any>>

  • Parameters

    • sessionIDs: string[]

    Returns Promise<any>

  • Set merkle root in the session storage

    Parameters

    • _merkleRoot: string

    Returns Promise<void>

  • Updates the session status of a session leaf node in the session storage

    Parameters

    Returns Promise<void>