Use the getSessionHash function to compute the hash of a session key configuration, useful for identifying a session, tracking its status, or preparing for session revocation.

Usage

import {
  getSessionHash,
  SessionConfig,
} from "@abstract-foundation/agw-client/sessions";

const sessionConfig: SessionConfig = {
  // ... See createSession for more information on the SessionConfig object
};

// Get the hash of the session configuration
const sessionHash = getSessionHash(sessionConfig);

Parameters

sessionConfig
SessionConfig
required
The session configuration object to hash.See createSession for more information on the SessionConfig object structure.

Returns

Hash
string
The keccak256 hash of the encoded session configuration.