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

wallets-connect

v1.2.4

Published

Wallets: - Metamask - WalletConnect

Readme

wallets-connect

Wallets:

  • Metamask
  • WalletConnect

Setup

yarn add wallets-connect

in plugin eth.js

import Web3Model from "wallets-connect";

export default {
    async install(Vue){
        Vue.prototype.$eth = Web3Model;
    }
}

in main.js

...

import WalletsConnect from './plugins/eth';
Vue.use(WalletsConnect);

...

Usage

After install in components will be available global object $eth

$eth.wallets    -  List of available wallets
$eth.connect()  -  Method for connect wallet. Return wallet address
$eth.request()  -  Provider methods
$eth.provider   -  Provider object

Connection

<!--in template-->
<div
    v-for="(wallet, i) of $eth.wallets" :key="i"
    @click="connect(wallet)"
>
  <img :src="wallet.icon" :alt="wallet.name">
  {{ wallet.name }}
</div>
/**
 connect method takes 2 arguments:
   - wallet name (Required)
   - rpc (Optional. Only for WalletConnect)
 */
async connect(wallet){
    const walletAddress = await this.$eth.connect(wallet.name)
    console.log(walletAddress, this.$eth)
}

RPC URL Mapping

The RPC URL mapping should indexed by chainId and it requires at least one value. Default value:

"rpc": {
    "1": "https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
    "3": "https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
    "4": "https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
    "5": "https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
    "42": "https://kovan.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161",
    "56": "https://bsc-dataseed.binance.org/",
    "97": "https://data-seed-prebsc-1-s1.binance.org:8545/"
}

Request methods

interface RequestArguments {
  method: string;
  params?: unknown[] | object;
}

// Send JSON RPC requests
const result = await this.$eth.request(payload: RequestArguments);

Send transaction

async sendTransaction(){
    const tx = {
        from: "0xbc28Ea04101F03aA7a94C1379bc3AB32E65e62d3", // Required
        to: "0x89D24A7b4cCB1b6fAA2625Fe562bDd9A23260359", // Required (for non contract deployments)
        data: "0x", // Required
        gasPrice: "0x02540be400", // Optional
        gasLimit: "0x9c40", // Optional
        value: "0x00", // Optional
        nonce: "0x0114", // Optional
    };
    
    const hash = await this.$eth.request({
        method: 'eth_sendTransaction',
        params: [tx],
    });
}

Events

// Subscribe to accounts change
$eth.provider.on("accountsChanged", (accounts: string[]) => {
  console.log(accounts);
});

// Subscribe to chainId change
$eth.provider.on("chainChanged", (chainId: number) => {
  console.log(chainId);
});

// Subscribe to session connection
$eth.provider.on("connect", () => {
  console.log("connect");
});

// Subscribe to session disconnection
$eth.provider.on("disconnect", (code: number, reason: string) => {
  console.log(code, reason);
});