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

@montech-io/mox-ripple

v1.0.8

Published

This open-source package is built on top of XRP (Ripple) and provides various functions for interacting with the XRP network. It is designed to simplify the integration of XRP functionality into your projects.

Downloads

1

Readme

XRP Open-Source Package

This open-source package is built on top of XRP (Ripple) and provides various functions for interacting with the XRP network. It is designed to simplify the integration of XRP functionality into your projects.

Installation

To use this package, you need to have Node.js and npm (Node Package Manager) installed on your machine. You can install the package by running the following command:

npm install @montech-io/mox-ripple

Usage

To use this package, you need to import it into your project:

import RippleService from '@montech-io/mox-ripple';

Creating an Instance

To create an instance of the RippleService class, you need to provide the network, environment, and issuer address:

const rippleService = new RippleService(network, environment, issuerAddress);
  • network (string): The XRP network to connect to. Example: mainnet: wss://s1.ripple.com, testnet: wss://s.altnet.rippletest.net:51233.
  • environment (string): The environment to use for generating an account. Example: "production", "development".
  • issuerAddress (string): The address of the issuer.

Generating an Account

To generate a new XRP account, you can use the generateAccount function:

const wallet = await rippleService.generateAccount();

This function returns a new XRPL Wallet object.

For more information, refer to the XRPL Wallet Documentation.

Checking Trustline

To check if a trustline exists between two accounts, you can use the hasTrustline function:

const hasTrustline = await rippleService.hasTrustline(account1, account2, currency);
  • account1 (string): The address of the first account.
  • account2 (string): The address of the second account.
  • currency (string): The currency code of the trustline.

For more information, refer to the XRPL Trustline Documentation.

Transferring XRP

To transfer XRP from one account to another, you can use the transferXRP function:

const tx = await rippleService.transferXRP(senderSecret, amount, recipient);
  • senderSecret (string): The secret key of the sender's XRP account.
  • amount (string): The amount of XRP to transfer.
  • recipient (string): The address of the recipient's XRP account.

For more information, refer to the XRPL Payment Documentation.

Transfer Offers

To get the sell offers for a specific NFT token, you can use the transferOffers function:

const sellOffers = await rippleService.transferOffers(tokenId);
  • tokenId (string): The ID of the NFT token.

For more information, refer to the XRPL NFT Sell Offers Documentation.

More Functions

This package provides additional functions for various XRP operations, such as:

  • GetWalletNFTs(account: string): Retrieves the NFTs associated with a specific account.
  • NFTokenTransferRequest(Secret: string, tokenOfferIndex: string): Performs an NFToken transfer request.
  • resolveAccountFromSecret(secret: string): Resolves an account from a secret key.
  • getAccountBalance(address: string): Retrieves the XRP balance