npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@phoenix-wallet/evm

v1.0.7

Published

EVM chain support for Phoenix Wallet - Ethereum, BSC, Polygon, and more

Readme

@phoenix-wallet/evm

EVM blockchain support for Phoenix Wallet - supporting Ethereum, BSC, Polygon, and all EVM-compatible chains.

Overview

This package provides comprehensive support for EVM-compatible blockchains, including wallet connectors for popular wallets like MetaMask, Coinbase Wallet, Rainbow, and more.

Features

  • 🦊 Multiple Wallet Support: MetaMask, Coinbase, Phantom, Rainbow, Trust Wallet, OKX, Rabby, Zerion, Binance, MagicEden
  • ⛓️ Multi-Chain: Support for Ethereum, BSC, Polygon, Arbitrum, Optimism, and any EVM chain
  • 🔄 Chain Switching: Easy chain switching within wallets
  • 📝 Contract Interactions: Built-in contract interaction utilities
  • 🔐 Signing: Message and transaction signing support
  • 💰 Balance Queries: Native and token balance queries

Installation

# Using pnpm (recommended)
pnpm add @phoenix-wallet/core @phoenix-wallet/evm ethers viem

# Using npm
npm install @phoenix-wallet/core @phoenix-wallet/evm ethers viem

# Using yarn
yarn add @phoenix-wallet/core @phoenix-wallet/evm ethers viem

Quick Start

Basic Setup

import { WalletProvider } from '@phoenix-wallet/core';
import { 
  MetamaskEvmConnector,
  CoinbaseEvmConnector,
  PhantomEvmConnector
} from '@phoenix-wallet/evm';

const evmChainConfigs = [
  {
    id: '1',
    name: 'Ethereum Mainnet',
    chainId: 1,
    rpcUrl: 'https://eth.llamarpc.com',
    nativeCurrency: {
      name: 'Ether',
      symbol: 'ETH',
      decimals: 18
    },
    blockExplorerUrl: 'https://etherscan.io'
  },
  {
    id: '56',
    name: 'BNB Smart Chain',
    chainId: 56,
    rpcUrl: 'https://bsc-dataseed.binance.org',
    nativeCurrency: {
      name: 'BNB',
      symbol: 'BNB',
      decimals: 18
    },
    blockExplorerUrl: 'https://bscscan.com'
  }
];

const connectors = [
  new MetamaskEvmConnector({
    id: 'metamask-evm',
    name: 'MetaMask',
    logo: 'https://metamask.io/images/metamask-logo.png',
    chains: evmChainConfigs,
    dappMetadata: {
      name: 'My DApp',
      url: 'https://mydapp.com',
      icon: 'https://mydapp.com/icon.png'
    }
  }),
  new CoinbaseEvmConnector({
    id: 'coinbase-evm',
    name: 'Coinbase Wallet',
    logo: 'https://coinbase.com/wallet-logo.png',
    chains: evmChainConfigs,
    dappMetadata: {
      name: 'My DApp',
      url: 'https://mydapp.com',
      icon: 'https://mydapp.com/icon.png'
    }
  })
];

function App() {
  return (
    <WalletProvider connectors={connectors} chainConfigs={evmChainConfigs}>
      <YourApp />
    </WalletProvider>
  );
}

Using the Wallet

import { useWallet } from '@/hooks/useWallet'; // Your universal wallet hook

function WalletComponent() {
  const { 
    wallet, 
    isConnected, 
    address, 
    connect, 
    disconnect,
    switchChain 
  } = useWallet('metamask-evm');

  const handleConnect = async () => {
    await connect();
  };

  const handleSwitchChain = async () => {
    await switchChain('56'); // Switch to BSC
  };

  const handleSignMessage = async () => {
    if (!wallet) return;
    const signature = await wallet.signMessage('Hello, Web3!');
    console.log('Signature:', signature);
  };

  const handleSendTransaction = async () => {
    if (!wallet) return;
    const txHash = await wallet.sendTransaction({
      to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
      value: '0.01', // in ETH
      data: '0x'
    });
    console.log('Transaction hash:', txHash);
  };

  return (
    <div>
      {!isConnected ? (
        <button onClick={handleConnect}>Connect MetaMask</button>
      ) : (
        <div>
          <p>Connected: {address}</p>
          <button onClick={handleSwitchChain}>Switch to BSC</button>
          <button onClick={handleSignMessage}>Sign Message</button>
          <button onClick={handleSendTransaction}>Send Transaction</button>
          <button onClick={disconnect}>Disconnect</button>
        </div>
      )}
    </div>
  );
}

Available Connectors

MetaMask

import { MetamaskEvmConnector } from '@phoenix-wallet/evm';

const metamask = new MetamaskEvmConnector({
  id: 'metamask-evm',
  name: 'MetaMask',
  logo: 'https://metamask.io/images/metamask-logo.png',
  chains: evmChainConfigs,
  dappMetadata: { /* ... */ }
});

Coinbase Wallet

import { CoinbaseEvmConnector } from '@phoenix-wallet/evm';

const coinbase = new CoinbaseEvmConnector({
  id: 'coinbase-evm',
  name: 'Coinbase Wallet',
  logo: 'https://coinbase.com/wallet-logo.png',
  chains: evmChainConfigs,
  dappMetadata: { /* ... */ }
});

Phantom

import { PhantomEvmConnector } from '@phoenix-wallet/evm';

const phantom = new PhantomEvmConnector({
  id: 'phantom-evm',
  name: 'Phantom',
  logo: 'https://phantom.app/logo.png',
  chains: evmChainConfigs,
  dappMetadata: { /* ... */ }
});

Other Supported Wallets

  • RainbowEvmConnector - Rainbow Wallet
  • TrustWalletEvmConnector - Trust Wallet
  • OkxEvmConnector - OKX Wallet
  • RabbyEvmConnector - Rabby Wallet
  • ZerionEvmConnector - Zerion Wallet
  • BinanceEvmConnector - Binance Wallet
  • MagicEdenEvmConnector - MagicEden Wallet
  • BitgetEvmConnector - Bitget Wallet

Contract Interactions

Using EvmContract

import { EvmContract } from '@phoenix-wallet/evm';

const contract = new EvmContract(
  '0x...', // Contract address
  abi,     // Contract ABI
  wallet   // Your wallet instance
);

// Read from contract
const balance = await contract.call('balanceOf', [address]);

// Write to contract
const txHash = await contract.send('transfer', [
  recipientAddress,
  amount
]);

ERC-20 Token Example

const erc20Abi = [
  'function balanceOf(address) view returns (uint256)',
  'function transfer(address to, uint256 amount) returns (bool)',
  'function approve(address spender, uint256 amount) returns (bool)'
];

const tokenContract = new EvmContract(
  '0x...', // Token address
  erc20Abi,
  wallet
);

// Get balance
const balance = await tokenContract.call('balanceOf', [userAddress]);

// Transfer tokens
const txHash = await tokenContract.send('transfer', [
  recipientAddress,
  ethers.parseUnits('100', 18) // 100 tokens with 18 decimals
]);

Chain Configuration

Popular EVM Chains

const chains = [
  // Ethereum Mainnet
  {
    id: '1',
    name: 'Ethereum',
    chainId: 1,
    rpcUrl: 'https://eth.llamarpc.com',
    nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
    blockExplorerUrl: 'https://etherscan.io'
  },
  // Polygon
  {
    id: '137',
    name: 'Polygon',
    chainId: 137,
    rpcUrl: 'https://polygon-rpc.com',
    nativeCurrency: { name: 'MATIC', symbol: 'MATIC', decimals: 18 },
    blockExplorerUrl: 'https://polygonscan.com'
  },
  // Arbitrum
  {
    id: '42161',
    name: 'Arbitrum One',
    chainId: 42161,
    rpcUrl: 'https://arb1.arbitrum.io/rpc',
    nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
    blockExplorerUrl: 'https://arbiscan.io'
  },
  // Optimism
  {
    id: '10',
    name: 'Optimism',
    chainId: 10,
    rpcUrl: 'https://mainnet.optimism.io',
    nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
    blockExplorerUrl: 'https://optimistic.etherscan.io'
  }
];

API Reference

EvmWallet

class EvmWallet {
  address: string;
  chain: EvmChain;
  connector: EvmConnector;
  walletClient: WalletClient;
  
  // Get native balance
  getBalance(): Promise<string>;
  
  // Sign message
  signMessage(message: string): Promise<string>;
  
  // Sign transaction
  signTransaction(transaction: EvmTransaction): Promise<string>;
  
  // Send transaction
  sendTransaction(transaction: EvmTransaction): Promise<string>;
  
  // Send raw transaction
  sendRawTransaction(signedTx: string): Promise<string>;
}

EvmTransaction

interface EvmTransaction {
  to: string;
  value?: string;      // in ETH
  data?: string;       // hex encoded
  gasLimit?: string;
  gasPrice?: string;
  nonce?: number;
}

TypeScript Support

Full TypeScript support with comprehensive type definitions:

import type { 
  EvmWallet, 
  EvmChain, 
  EvmConnector,
  EvmTransaction 
} from '@phoenix-wallet/evm';

Related Packages

License

MIT

Support

For issues and questions, please visit our GitHub repository.