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 🙏

© 2024 – Pkg Stats / Ryan Hefner

openverse-snap

v1.0.1

Published

Manage Openos-based tokens and NFTs, swap, stake, bridge etc.. , and connect to Openverse apps with MetaMask.

Downloads

122

Readme

Openverse Wallet Snap

The Openverse Wallet Snap is a MetaMask extension that has Openos capabilities such as public key derivation, transaction signing, message signing.

Starting the snap

Install the latest version of the Snaps CLI

npm install -g @metamask/snaps-cli

Install the dependencies

npm install

Build and start the local development server

npm start

Using the snap

The production snap is available as Snap ID npm:openverse-snap.

The locally started snap is available as Snap ID local:http://localhost:8080.

RPC Methods

getPublicKey

Returns the wallet's public key encoded as Base58.

Parameters

An object containing:

  • derivationPath - Derivation paths segments that will be appended to m/44'/501'
  • confirm - Whether to show a confirm dialog.

Returns

Base58 encoded public key.

Example:

ethereum.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:openverse-snap',
    request: {
      method: 'getPublicKey',
      params: {
        derivationPath: [`0'`, `0'`],
        confirm: true
      }
   }
  }
});

signTransaction

Sign a transaction and return the signature encoded as Base58.

Parameters

An object containing:

  • derivationPath - Derivation paths segments that will be appended to m/44'/501'
  • message - Transaction message encoded as Base58

Returns

An object containing:

  • publicKey - Base58 encoded public key
  • signature - Transaction signature encoded as Base58

Example:

ethereum.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:openverse-snap',
    request: {
      method: 'signTransaction',
      params: {
        derivationPath: [`0'`, `0'`],
        message: '...'
      }
   }
  }
});

signAllTransactions

Sign multiple transactions and return the signatures encoded as Base58.

Parameters

An object containing:

  • derivationPath - Derivation paths segments that will be appended to m/44'/501'
  • messages - An array of transaction messages encoded as Base58

Returns

An object containing:

  • publicKey - Base58 encoded public key
  • signatures - An array of transaction signatures encoded as Base58

Example:

ethereum.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:openverse-snap',
    request: {
      method: 'signAllTransactions',
      params: {
        derivationPath: [`0'`, `0'`],
        messages: ['...', '...']
      }
   }
  }
});

signMessage

Sign a message (can be either arbitrary bytes or a UTF-8 string) and return the signature encoded as Base58.

Parameters

An object containing:

  • derivationPath - Derivation paths segments that will be appended to m/44'/501'
  • message - Message encoded as Base58
  • display - How to decode and display the message, utf8 or hex

Returns

An object containing:

  • publicKey - Base58 encoded public key
  • signature - Message signature encoded as Base58

Example:

const bytes = new TextEncoder().encode('Lorem ipsum');
const base58Message = base58.encode(bytes);

ethereum.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:openverse-snap',
    request: {
      method: 'signMessage',
      params: {
        derivationPath: [`0'`, `0'`],
        message: base58Message,
        display: 'utf8'
      }
   }
  }
});