connectWallet
Connect wallet.
Usage
- Connect with built-in wallets supported by Dataverse Wallet
import { WALLET } from '@dataverse/dataverse-connector';
const pkh = await dataverseConnector.connectWallet({
wallet: WALLET.METAMASK,
});
- 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
any
- providers conforming to EIP-1193: Ethereum Provider JavaScript API (opens in a new tab)
Returns
Promise<{
address: string;
chain: Chain;
wallet: WALLET;
}>
{
"address": "0x312eA852726E3A9f633A0377c0ea882086d66666",
"chain": {
"chainId": 80001,
"chainName": "mumbai"
},
"wallet": "MetaMask"
}