Skip to content
API reference

Sessions

The functions that open and close a user's private account, and the stores that keep its unlock signature.

A session is the user's private account, opened on this device. Sessions walks through opening one, switching wallets and signing out.

openNimbusSession

Use it after the wallet connects, to unlock the user's private account.

function openNimbusSession(
  sdk: NimbusSdk,
  args: { readonly connectedWallet: WalletStandardSigner },
  options?: OpenNimbusSessionOptions,
): Promise<OpenNimbusSessionResult>;

Types used: NimbusSdk, WalletStandardSigner, OpenNimbusSessionOptions, OpenNimbusSessionResult

Example

import {  } from "@umbra/nimbus-solana-web";
import type { NimbusSdk, WalletStandardSigner } from "@umbra/nimbus-solana-web";

declare const : NimbusSdk;
declare const : WalletStandardSigner;
declare const : (: string) => <string>;
const  = await (
  ,
  {  },
  { : async () => (..) },
);
if (. === "opened" && ... === "unregistered") {
  // register before the first deposit
}

Parameters

Prop

Type

Returns

Promise<OpenNimbusSessionResult>

Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/session.ts.

closeNimbusSession

Use it when the user signs out, switches wallets, or the wallet disconnects.

function closeNimbusSession(session: NimbusSession): void;

Types used: NimbusSession

Example

import {  } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";

declare const : NimbusSession;
();

Parameters

Prop

Type

Returns

void

Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/session.ts.

createMemorySignatureSecretStore

Use it when no secret may touch the browser's storage, and a signature after every reload is acceptable.

function createMemorySignatureSecretStore(): SignatureSecretStore;

Types used: SignatureSecretStore

Example

import {  } from "@umbra/nimbus-solana-web";

const  = ();

Returns

SignatureSecretStore

Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts.

createTabSignatureSecretStore

Use it for the default: one signature per tab, kept until the tab closes.

function createTabSignatureSecretStore(
  options?: SignatureSecretStoreOptions,
): SignatureSecretStore;

Types used: SignatureSecretStoreOptions, SignatureSecretStore

Example

import {
  ,
  ,
} from "@umbra/nimbus-solana-web";
import type { NimbusSdk, WalletStandardSigner } from "@umbra/nimbus-solana-web";

declare const : NimbusSdk;
declare const : WalletStandardSigner;
const  = await (
  ,
  {  },
  { : ({ : "my-app/" }) },
);

Parameters

Returns

SignatureSecretStore

Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts.

createPersistentSignatureSecretStore

Use it when users should sign once per device, and you accept the secret staying in localStorage.

function createPersistentSignatureSecretStore(
  options?: SignatureSecretStoreOptions,
): SignatureSecretStore;

Types used: SignatureSecretStoreOptions, SignatureSecretStore

Example

import {  } from "@umbra/nimbus-solana-web";

const  = ();

Parameters

Returns

SignatureSecretStore

Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts.

Last updated

On this page