Socket
Book a DemoInstallSign in
Socket

@xlabs-libs/wallet-aggregator-evm

Package Overview
Dependencies
Maintainers
5
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xlabs-libs/wallet-aggregator-evm

Implements the base abstractions for EVM-compatible blockchains, using [wagmi](https://github.com/wagmi-dev/wagmi) under the hood to handle connection implementations.

latest
Source
npmnpm
Version
0.0.2-alpha.8
Version published
Maintainers
5
Created
Source

Wallet Aggregator - EVM

Implements the base abstractions for EVM-compatible blockchains, using wagmi under the hood to handle connection implementations.

Wallets implemented so far:

WalletLink
Injected wallets (e.g: Brave)
Metamaskhttps://metamask.io
WalletConnecthttps://walletconnect.com
Bitget Wallethttps://web3.bitget.com
Coinbase Wallethttps://www.coinbase.com/wallet
Ledger Connecthttps://www.ledger.com

Usage

The base EVMWallet configuration allows for the following parameters:

  • chains: an array of chain information objects. While the information is the same as in the {@link https://eips.ethereum.org/EIPS/eip-3085 EIP-3085}, the structure is slightly different. Defaults to all chains.
  • preferredChain: an EVM chain id (e.g. 5 for Görli, 43113 for Avalanche Fuji Testnet, etc.). When connecting, the wallet will try to switch to this chain if the provider's network's chain id differs.
  • autoSwitch: indicates whether the wallet should attempt to switch the network back to the preferredChain upon detecting a chainChanged event (if set).
  • confirmations: Amount of confirmations/blocks to wait a transaction for

Additionally, each specific wallet has its own specific options.

import {
  MetamaskWallet,
  WalletConnectWallet,
  BitgetWallet,
  CoinbaseWallet,
  LedgerWallet,
  InjectedWallet,
} from "@xlabs-libs/wallet-aggregator-evm";

const injected = new InjectedWallet();
const metamask = new MetamaskWallet({
  preferredChain: 5,
  autoSwitch: true,
});
const walletConnect = new WalletConnectWallet({
  preferredChain: 43113,
});
const bitgetWallet = new BitgetWallet({
  options: {
    appName: "My App",
  },
});
const coinbase = new CoinbaseWallet({
  options: {
    reloadOnDisconnect: false,
    appName: "My App",
  },
});
const ledger = new LedgerWallet();

FAQs

Package last updated on 14 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts