Docs

Wallet

Wallet interface

type Wallet<TWalletId extends WalletId = WalletId> = {
getConfig: () => CreateWalletArgs<TWalletId>[1];
id: TWalletId;
subscribe: WalletEmitter<TWalletId>["subscribe"];
autoConnect: (
options: WalletAutoConnectionOption<TWalletId>,
) => Promise<Account>;
connect: (
options: WalletConnectionOption<TWalletId>,
) => Promise<Account>;
disconnect: () => Promise<void>;
getAccount: () => undefined | Account;
getChain: () =>
| undefined
| {
readonly blockExplorers?: Array<{
apiUrl?: string;
name: string;
url: string;
}>;
readonly experimental?: { increaseZeroByteCount?: boolean };
readonly id: number;
readonly name?: string;
readonly nativeCurrency?: {
decimals?: number;
name?: string;
symbol?: string;
};
readonly rpc: string;
readonly testnet?: true;
};
switchChain: (chain: {
readonly blockExplorers?: Array<{
apiUrl?: string;
name: string;
url: string;
}>;
readonly experimental?: { increaseZeroByteCount?: boolean };
readonly id: number;
readonly name?: string;
readonly nativeCurrency?: {
decimals?: number;
name?: string;
symbol?: string;
};
readonly rpc: string;
readonly testnet?: true;
}) => Promise<void>;
};