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

zeta-snap

v0.1.6-alpha

Published

A Sovereign SDK Metamask Snap

Downloads

23

Readme

Sovereign SDK MetaMask Snap

The Sovereign SDK MetaMask Snap enables transaction signing for users.

This Snap is configured to use the designated coin type 1551, allocated for the SDK-Sovereign SDK. In accordance with Metamask's Snap permissions design, the coin type is hardcoded. If you require a different coin type, you can fork this repository and modify the authorized path in the Snap manifest.

Methods

getAddress

Returns the address of the wallet for the configured Sovereign SDK chain. The address is derived from a ed25519 public key as a bech32m encoded hexadecimal string, prefixed with an identifier specific for the configured chain.

Params
  • keyId: The key id used in the BIP-32 derivation path of the wallet. For example, a key id 0 (as a number) results in a derivation path of string['m', "44'", "1551'", "0'"].
Example
const response = await request({
    method: 'getAddress',
    params: {
        keyId: 0,
    },
});
if (
    !response ===
    'sov1dpvv2cvyv3cfsflx4hz67gyqcm3xlrj5v2ldyagep2uf8fwt7drsv936j0'
) {
    throw new Error('Invalid public key');
}

signTransaction

Returns the signature of the message as hexadecimal string.

Will emit a confirmation dialog for the user.

Params
  • keyId: The key id used in the BIP-32 derivation path of the wallet. For example, a key id 0 (as a number) results in a derivation path of string['m', "44'", "1551'", "0'"].
  • transaction: A transaction to be serialized according to the configured Sovereign SDK rollup. The signature will be performed over the serialized transaction.
Example
const response = request({
    method: 'signTransaction',
    params: {
        keyId: 0,
        transaction: {
            "call": '{"bank":{"CreateToken":{"salt":11,"token_name":"sov-test-token","initial_balance":1000000,"minter_address":"sov15vspj48hpttzyvxu8kzq5klhvaczcpyxn6z6k0hwpwtzs4a6wkvqwr57gc","authorized_minters":["sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94","sov15vspj48hpttzyvxu8kzq5klhvaczcpyxn6z6k0hwpwtzs4a6wkvqwr57gc"]}}}',
            "nonce": 0,
            "chain_id": 4321,
            "max_priority_fee_bips": 0,
            "max_fee": 10000,
            "gas_limit": []
        },
    },
});

if (
    !response ===
    '0xfd2e4b23a3e3f498664af355b341e833324276270a13f9647dd1f043248f92fccaa037d4cfc9d23f13a295f7d505ee13afb2b10cea548890678f9002947cbb0a'
) {
    throw new Error('Invalid signature');
}

Testing

To test the snap, run yarn test in this directory. This will use @metamask/snaps-jest to run the tests in src/index.test.ts.

If a change to the snap code was performed, you will need to run yarn build before the tests.