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[]
The wallets, in the order they registered; empty when none is installed.
Lists the installed wallets that can connect, sign messages and sign transactions on the SDK's
cluster, the ones openWalletConnection accepts.
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
A function that stops following; calling it again does nothing.
Follows the installed wallets, calling onChange with listWallets' answer whenever a
wallet registers or unregisters, as an extension may after the page has loaded.
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>
connected with the signer openNimbusSession takes and the transaction version the
wallet signs, 1 when it supports it, else 0; no-account when the wallet offered no
account on the SDK's cluster; declined when the user refused.
NimbusSdkError with reason "wallet-unsupported" when the wallet cannot connect,
sign messages and sign transactions on the SDK's cluster, or fails while connecting.
Asks a wallet to connect, and builds the signer for its first account on the SDK's cluster.
The wallet shows the user its connection prompt, unless the page is already connected. The signer hands the wallet its own account object with every request, and signs for the chain the flows name, which is the deployment's.
Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/wallets.ts.
Last updated