@layerswap/wallet-evm
v1.1.1
Published
EVM Wallet Provider for Layerswap Widget
Readme
@layerswap/wallet-evm
EVM (Ethereum Virtual Machine) wallet provider for the Layerswap Widget. Supports Ethereum and all EVM-compatible chains including L2s.
Installation
npm install @layerswap/wallet-evm wagmi viem @tanstack/react-query
# or
yarn add @layerswap/wallet-evm wagmi viem @tanstack/react-query
# or
pnpm add @layerswap/wallet-evm wagmi viem @tanstack/react-queryQuick Start
import { LayerswapProvider, Swap } from "@layerswap/widget";
import { createEVMProvider } from "@layerswap/wallet-evm";
export default function Page() {
const evmProvider = createEVMProvider({
walletConnectConfigs: {
projectId: "your-project-id",
name: "Your App",
description: "Your app description",
url: "https://your-app.com",
icons: ["https://your-app.com/icon.png"]
}
});
return (
<LayerswapProvider walletProviders={[evmProvider]}>
<Swap />
</LayerswapProvider>
);
}Usage
Use createEVMProvider() to create an EVM wallet provider:
import { createEVMProvider } from "@layerswap/wallet-evm";
const evmProvider = createEVMProvider({
walletConnectConfigs: {
projectId: "your-project-id",
name: "Your App",
description: "Your app description",
url: "https://your-app.com",
icons: ["https://your-app.com/icon.png"]
},
walletProviderModules: [
// Additional wallet modules
]
});Supported Wallets
- MetaMask
- WalletConnect
- Coinbase Wallet
- And other wagmi-compatible wallets
Supported Chains
All EVM-compatible chains including:
- Ethereum
- Polygon
- Arbitrum
- Optimism
- Base
- And many more L2s
Documentation
For detailed setup instructions, configuration options, and usage examples, see the EVM Wallet Provider documentation.
Features
- Multi-wallet support via wagmi
- WalletConnect integration
- Balance checking (including Hyperliquid support)
- Gas estimation
- Address validation and utilities
- Contract address utilities
- EVM transaction support
- Extensible via wallet provider modules
Exports
createEVMProvider()- Factory function for creating EVM providersuseChainConfigs- Hook for accessing chain configurations
TypeScript
This package includes TypeScript definitions. All types are exported from the main entry point.
License
MIT
