@layerzerolabs/ui-wallet-evm
v0.1.27
Published
<p align="center"> <a href="https://layerzero.network"> <img alt="LayerZero" style="max-width: 500px" src="https://d3a2dpnnrypp5h.cloudfront.net/bridge-app/lz.png"/> </a> </p>
Downloads
173
Readme
Installation
yarn add @layerzerolabs/ui-wallet-evm
pnpm add @layerzerolabs/ui-wallet-evm
npm install @layerzerolabs/ui-wallet-evm
Usage
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
.