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

@metahubwallet/sdk

v1.0.0

Published

Typed browser SDK for the Metahub wallet browser extension.

Readme

@metahubwallet/sdk

Typed browser SDK for the Metahub wallet extension.

Install

npm install @metahubwallet/sdk

Usage

import {MetahubClient} from '@metahubwallet/sdk'

const client = new MetahubClient({
    appName: 'my-dapp',
    chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',
})

// connect() is optional — login() / requestSignature() / etc. auto-discover
// the extension provider on first use. Call it up-front only when you want to
// handle "wallet not installed" errors separately from the first signing
// prompt (e.g. to show a custom install CTA).
const identity = await client.login()
console.log(identity.accounts)

client.on('identity', (id) => {
    console.log('identity changed', id)
})

Optional eager connect

import {MetahubErrorCode} from '@metahubwallet/sdk'

const res = await client.connect()
if (!res.ok && res.reason === MetahubErrorCode.NotInstalled) {
    // Prompt user to install Metahub
    return
}

Signing transactions

Pass actions or a partial Transaction; the wallet fills in TAPOS, serializes using its own ABI cache (or the ABIs you supply), and prompts the user. Returns the TAPOS-filled transaction plus the final signed bytes.

const action = {
    account: 'eosio.token',
    name: 'transfer',
    authorization: [{actor: identity.name, permission: 'active'}],
    data: {
        from: identity.name,
        to: 'bob',
        quantity: '1.0000 EOS',
        memo: '',
    },
}

// `args` accepts a single Action, an Action[], or a full Transaction.
const {signatures, transaction, serializedTransaction} =
    await client.requestSignature(action, {
        // Optional — defaults to the client's configured chainId
        chainId: customChainId,
        // Optional — pre-supplied ABIs skip the wallet's RPC lookup
        abis: {'eosio.token': tokenAbiJson},
        // Optional TAPOS hints (used only when TAPOS is missing on the transaction)
        expireSeconds: 60,
        blocksBehind: 3,
    })

Arbitrary-string signatures

const sig = await client.getArbitrarySignature({
    publicKey: identity.publicKey,
    data: 'hello world',
})

API

  • new MetahubClient(options?) — construct a client. Options: appName, chainId, timeoutMs, connectTimeoutMs, provider (inject for tests).
  • connect({signal?}): Promise<{ok, version?, reason?}> — wait for the injected provider.
  • disconnect() — reset state + clear event listeners.
  • login({appName?, chainId?})Identity — per-call options override constructor options.
  • logout(account?: string | string[])Identity | null — log out one or multiple accounts.
  • restore()Identity | null — restore identity from prior-session permissions (no user prompt).
  • suggestNetwork(network)void
  • getArbitrarySignature({publicKey, data, chainId?})string
  • requestSignature(args: Transaction | Action[] | Action, options?){signatures, transaction, serializedTransaction} — transactArgs-based signing (requires extension v3.0.0+).
  • getVersion()string
  • on('identity' | 'logout' | 'unload', cb) → unsubscribe fn

Read-only getters:

  • client.identityIdentity | null — the current identity, or null before login / after logout.
  • client.connectedboolean — whether a provider has been bound.
  • client.versionstring | null — cached extension version (populated on first provider resolution).

Also exported from the package root: discoverProvider, MetahubError, MetahubErrorCode, Emitter, VERSION, and the MetahubProvider / DiscoverOptions / EventMap / MetahubClientOptions / ConnectResult types.

Errors thrown from any RPC method are instances of MetahubError with a typed code: MetahubErrorCode. Includes BadArgs, AbiUnavailable, UserRejected, Locked, NotInstalled, Timeout, InvalidRequest.

License

MIT