yarn add @layerzerolabs/ui-wallet-evm
pnpm add @layerzerolabs/ui-wallet-evm
npm install @layerzerolabs/ui-wallet-evm
In this package you'll find abstract classes for generic EvmWallet
's, generic InjectedWallet
's, and implementations of a variety of those InjectedWallet
's - MetaMask, CoinbaseWallet, etc. - and WalletConnect
. These implementations are ready to use as is in your LayerZero dApp, simply import the wallets you'd like to support and assign them to your walletStore
.
import {CoinbaseWallet, MetaMaskWallet, WalletConnect} from '@layerzerolabs/ui-wallet-evm';
const wallets = {
metamaskWallet: new MetaMaskWallet(),
coinbaseWallet: new coinbaseWallet(),
walletConnect: new WalletConnect({
projectId: '10b5df65476df304efbb9a6b0c42f8b0',
chains: chains,
showQrModal: true,
}),
};
walletStore.addWallets(wallets);
To add your own EvmWallet
, extend the abstract class and include a provider
, implementation for autoConnect
, and the type
.