Skip to main content

default_session_store

Function default_session_store 

Source
pub async fn default_session_store(
    backend: Arc<dyn StorageBackend>,
    network: Network,
    identity: Vec<u8>,
) -> Result<Arc<dyn SessionStore>, SdkError>
Expand description

The session store backend provides for identity on network (its own persistence: PostgreSQL/MySQL when the backend is DB-backed, else an in-memory store).

Returned so it can be wrapped in a decorating [SessionStore] and passed to SdkBuilder::with_session_store, keeping the backend’s persistence. A typical use is at-rest encryption (the SDK does not encrypt tokens itself): wrap it in a store that encrypts on write and decrypts on read. identity is the wallet identity public key bytes (the same value the SDK derives from the signer).