Skip to content

logout

Remove an account and re-point (or clear) the active account. Defaults to the active account id.

Stops the JWT refresh timer, clears the bearer token, deletes the account's keyring entry (and its metadata + keystore entry), then activates the next remaining REGISTERED account (re-authenticating it) — preferring a full account over a partial (unauthenticated, handle-less) one. If only partials remain, activeAccountId is cleared.

Import

ts
import { logout } from "@0xcurvy/curvy-sdk/actions";

Usage

ts
await logout();             // active account
await logout({ accountId }); // explicit account

Signature

ts
function logout(parameters?: LogoutParameters): Promise<void>

Returns

Promise<void>

The action resolves or returns the value shown in the signature.

Parameters

accountId

  • Type: string
  • Required: no

The account whose authenticated session should be ended. Defaults to the active account.

ts
await logout({
  accountId, 
});

config

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
await logout({
  config, 
});

Errors

Errors from config resolution and the underlying SDK operation are propagated to the caller.

Source

packages/@0xcurvy/sdk/src/actions/auth/logout.ts