Skip to content
/ xnap Public

MetaMask integration for Nano: send, receive and sign messages directly from MM

License

Apache-2.0, MIT-0 licenses found

Licenses found

Apache-2.0
LICENSE.APACHE2
MIT-0
LICENSE.MIT0
Notifications You must be signed in to change notification settings

ObsidiaHQ/xnap

Repository files navigation

XNAP: MetaMask Snap for Nano

PRs Welcome

MetaMask Snaps is a system that allows anyone to safely expand the capabilities of MetaMask. A snap is a program that runs in an isolated environment that can customize the wallet experience. Learn more about Snaps here.

Integrating Xnap in your website

Refer to Xnap's documentation.

Project structure

packages/
├── snap/     # Xnap source code
├── site/     # Example dapp using the Xnap RPC methods
├── snap.xyz/ # snap.xyz website

Where's the seed?

Xnap automatically uses your MetaMask seed to securely generate private/public keys for you, which can be exported anytime.

Getting started locally

To interact with (your) Snaps, you will need to install MetaMask Flask, a canary distribution for developers that provides access to upcoming features.

Clone the repository and set up the development environment:

yarn install && yarn start

This serves the snap at http://localhost:8088.

Connecting to Xnap:

const snapId = 'local:http://localhost:8088';
const result: any = await window.ethereum.request({
  method: 'wallet_requestSnaps',
  params: {
    [snapId]: {
      version: '1.0.0', // Version is optional, use it to specify the version range of the snap or leave as empty object
    },
  },
});

Refer to the documentation or MetaMask's guide for more information.

Testing and Linting

Run yarn test to run the tests once.

Run yarn lint to run the linter, or run yarn lint:fix to run the linter and fix any automatically fixable issues.

License

This project is dual-licensed under the MIT and Apache 2.0 licenses.

About

MetaMask integration for Nano: send, receive and sign messages directly from MM

Topics

Resources

License

Apache-2.0, MIT-0 licenses found

Licenses found

Apache-2.0
LICENSE.APACHE2
MIT-0
LICENSE.MIT0

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published