@wharfkit/session - v4.0.1
    Preparing search index...

    Class Session

    A representation of a session to interact with a specific blockchain account.

    Index
    abis: TransactABIDef[] = []
    allowModify: boolean = true
    appName?: string
    awaitIrreversible: boolean = false
    broadcast: boolean = true
    broadcastOptions?: BroadcastOptions
    expireSeconds: number = 120
    fetch: Fetch
    onPersist?: (session: Session) => Promise<void>
    permissionLevel: PermissionLevel
    sessionKeyManager?: SessionKeyManager
    storage?: SessionStorage
    transactPlugins: TransactPlugin[]
    transactPluginsOptions: TransactPluginsOptions = {}
    • Remove the session key from this session, reverting to the primary wallet. Removes the key from the blockchain permission and persists the session.

      Returns Promise<void>

      Error if session keys are not configured or if the session does not have a session key

    • Rewrite action authorizations to use the session key permission instead of the primary permission. Only rewrites actions that match the session permission and are whitelisted.

      Parameters

      Returns TransactArgs

      Modified TransactArgs with session key permissions, or original args if not applicable

    • Set up a session key for this session, creating a new permission with a generated key. Shows consent UI if configured, handles conflicts with existing keys, and persists the session.

      Returns Promise<SessionKeySetupResult>

      SessionKeySetupResult containing the public key and permission name

      Error if session keys are not configured or if setup is cancelled by user

    • Update the on-chain permission links to match the configured whitelist. Adds missing links and removes extra links, then persists the session.

      Returns Promise<void>

      Error if session keys are not configured or if the session does not have a session key

    • Validate the session key whitelist against the on-chain permission links. Returns any mismatches between configured whitelist and actual blockchain state.

      Returns Promise<SessionKeyMismatch | undefined>

      SessionKeyMismatch if there are differences, undefined if in sync or no session key

    • Determine if the given transaction will be signed using the session key. Checks if session has a session key and all relevant actions are whitelisted.

      Parameters

      Returns boolean

      True if the session key will be used for signing