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

xrpl-snap

v1.0.2

Published

XRP Ledger MetaMask Snap

Downloads

2,322

Readme

Overview

The XRP Ledger for MetaMask is an extension that allows users to interact with the XRP Ledger (XRPL) directly from their MetaMask wallet. This Snap introduces support for XRPL, enabling users to manage XRP and other tokens on the XRPL, perform transactions, and interact with XRPL-based decentralized applications (DApps).

Features

  • XRPL Integration: Manage XRP and XRPL tokens within MetaMask.
  • Transaction Support: Send and receive XRP and other XRPL tokens.
  • DApp Interaction: Use XRPL-based DApps seamlessly.
  • Account Management: View account balances, transaction history, and other details.
  • Secure and User-Controlled: Full control over your XRPL keys and permissions.

Usage

To use the XRP Ledger, first install it by following these steps:

  1. Open MetaMask: Ensure you have the latest version of the MetaMask extension installed in your browser.
  2. Navigate to Settings: Click on the MetaMask icon, go to settings, and look for the Snaps section.
  3. Add XRP Ledger: In the Snaps section, add the XRP Ledger by providing its URL or selecting it from the Snap store.
  4. Install Snap: Click on the XRP Ledger and follow the prompts to add it to your MetaMask wallet.
  5. Enable Snap: Once installed, enable the Snap and grant necessary permissions.

Development

Here’s a basic guide to get started:

Prerequisites

Installation

yarn

Running

yarn start
  • To only start the UI, navigate to packages/site and start from there. The same applies to the snap in packages/snap.
  • If you make changes to the snap, first remove the previously installed version to see the changes.
  • Enable the MetaMask Flask in your extensions.

API

Installation

Use the following request to install the Snap:

provider.request({
  method: 'wallet_requestSnaps',
  params: {
    ['npm:xrpl-snap']: {},
  },
});

For developing the snap, change the request to:

params: {
    ["local:http://localhost:8080"]: {},
},

Interact with the Snap

To make requests using the RPC, use the following code:

provider.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:xrpl-snap',
    request: {
      method: 'xrpl_request',
      params: { command: 'account_info', account: 'rBg...' },
    },
  },
});

Network

  • Get supported networks:
provider.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:xrpl-snap',
    request: {
      method: 'xrpl_getSupportedNetworks',
    },
  },
});
  • Get current network:
provider.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:xrpl-snap',
    request: {
      method: 'xrpl_getActiveNetwork',
    },
  },
});
  • Change the selected network:
provider.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:xrpl-snap',
    request: {
      method: 'xrpl_changeNetwork',
      params: { chainId: 1 }, // Example chainId
    },
  },
});

Signing and submitting transactions

To sign and submit transactions

provider.request({
  method: 'wallet_invokeSnap',
  params: {
    snapId: 'npm:xrpl-snap',
    request: {
      method: 'xrpl_signAndSubmit',
      params: {
        TransactionType: 'Payment',
        Account: 'rBg...',
        Destination: 'rPT...',
        Amount: '1000000', // Amount in drops
      },
    },
  },
});
  • If you only want to sing the transaction use xrpl_sign.

Support

For support and further information, refer to the following resources:

  • XRPL Documentation: XRPL.org
  • MetaMask Snaps Documentation: MetaMask Snaps
  • Community Forums: Join discussions on MetaMask and XRPL community forums.

Contributing

We welcome contributions to the XRP Ledger project. To contribute, please follow these steps:

  1. Fork the Repository: Fork the XRP Ledger repository on GitHub.
  2. Create a Branch: Create a new branch for your feature or bugfix.
  3. Submit a Pull Request: Submit a pull request with a detailed description of your changes.

Stay in Touch

License

This project is licensed under the MIT License. See the LICENSE file for details.