Skip to content
Wallet APIs
connectWallet

connectWallet

Connect wallet.

Usage

  1. Connect with built-in wallets supported by Dataverse Wallet
import { WALLET } from '@dataverse/dataverse-connector';
 
const pkh = await dataverseConnector.connectWallet({
  wallet: WALLET.METAMASK,
});
  1. Pass in any Ethereum Provider (opens in a new tab) to use
import { WALLET } from '@dataverse/dataverse-connector';
 
const pkh = await dataverseConnector.connectWallet({
  provider: window.ethereum,
});

Parameters

  • enum WALLET - which wallet to connect with
enum WALLET {
  METAMASK = "MetaMask",
  WALLETCONNECT = "WalletConnect",
  COINBASE = "Coinbase",
  PARTICLE = "Particle",
  EXTERNAL_WALLET = "ExternalWallet",
}

or

Returns

Promise<{
    address: string;
    chain: Chain;
    wallet: WALLET;
}>
{
  "address": "0x312eA852726E3A9f633A0377c0ea882086d66666",
  "chain": {
    "chainId": 80001,
    "chainName": "mumbai"
  },
  "wallet": "MetaMask"
}