Skip to content
API reference

Wallets

The three functions that find the user's wallets and connect one.

These functions find Wallet Standard wallets and connect one. Wallets walks through a wallet picker and a signer of your own.

listWallets

Use it to fill a wallet picker when your page loads.

function listWallets(
  sdk: NimbusSdk,
  _args?: Readonly<Record<string, never>>,
  options?: WalletDiscoveryOptions,
): readonly Wallet[];

Types used: NimbusSdk, WalletDiscoveryOptions

Example

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

declare const : NimbusSdk;
for (const  of ()) {
  .(.);
}

Parameters

Prop

Type

Returns

readonly Wallet[]

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

followWallets

Use it to keep the picker current while the page is open, as extensions load.

function followWallets(
  sdk: NimbusSdk,
  args: { readonly onChange: (wallets: readonly Wallet[]) => void },
  options?: WalletDiscoveryOptions,
): () => void;

Types used: NimbusSdk, WalletDiscoveryOptions

Example

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

declare const : NimbusSdk;
const  = (, {
  : () => {
    .(.(() => .));
  },
});
();

Parameters

Prop

Type

Returns

() => void

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

openWalletConnection

Use it when the user picks a wallet. It gives you the signer a session takes.

function openWalletConnection(
  sdk: NimbusSdk,
  args: { readonly wallet: Wallet },
): Promise<WalletConnectionResult>;

Types used: NimbusSdk, WalletConnectionResult

Example

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

declare const : NimbusSdk;
const [] = ();
if ( !== ) {
  const  = await (, {  });
  if (. === "connected") {
    await (, { : .. });
  }
}

Parameters

Prop

Type

Returns

Promise<WalletConnectionResult>

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

Last updated

On this page