@web3-onboard/vue
Version:
A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wa
27 lines (26 loc) • 1.1 kB
TypeScript
import type { ConnectOptions, DisconnectOptions, WalletState, ConnectedChain } from '@web3-onboard/core';
import type { Ref, ComputedRef } from 'vue-demi';
type ReadonlyRef<T> = Readonly<Ref<T>>;
type SetChainOptions = {
chainId: string;
chainNamespace?: string;
wallet: string;
rpcUrl?: string;
label?: string;
token?: string;
};
interface OnboardComposable {
alreadyConnectedWallets: ReadonlyRef<string[]>;
connectWallet: (options?: ConnectOptions) => Promise<void>;
connectedChain: ComputedRef<ConnectedChain | null>;
connectedWallet: ComputedRef<WalletState | null>;
connectingWallet: ReadonlyRef<boolean>;
disconnectWallet: (wallet: DisconnectOptions) => Promise<void>;
disconnectConnectedWallet: () => Promise<void>;
getChain: (walletLabel: string) => ConnectedChain | null;
lastConnectionTimestamp: ReadonlyRef<number>;
setChain: (options: SetChainOptions) => Promise<void>;
settingChain: ReadonlyRef<boolean>;
wallets: ReadonlyRef<WalletState[]>;
}
export { type ReadonlyRef, type SetChainOptions, type OnboardComposable };