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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blockbima/xrpl-integration

v0.1.2

Published

A lightweight wrapper for the XRP Ledger using xrpl.js

Readme

XRPL Integration

A lightweight TypeScript wrapper for the XRP Ledger using xrpl.js. Implements a singleton pattern for easy integration into any application.

Features

  • Singleton client pattern for connection management
  • XRP and IOU token balance queries
  • XRP and IOU token transfers
  • Trustline verification
  • Full TypeScript support with exported types
  • Works with Mainnet, Testnet, and Devnet

Installation

npm install @blockbima/xrpl-integration

Quick Start

import { XRPLClient, NETWORKS } from "xrpl-integration";
import { Wallet } from "xrpl";

// Get singleton instance (defaults to testnet)
const client = XRPLClient.getInstance(NETWORKS.TESTNET);

// Connect to the network
await client.connect();

// Check XRP balance
const balance = await client.getXRPBalance("rAddress...");
console.log(`Balance: ${balance.balance} XRP`);

// Disconnect when done
await client.disconnect();

API Reference

Connection

// Get client instance
const client = XRPLClient.getInstance(networkUrl?: string);

// Connect/disconnect
await client.connect();
await client.disconnect();

// Check connection status
client.isConnected; // boolean

// Reset instance (for switching networks)
await XRPLClient.resetInstance();

Balance Queries

// XRP balance
const xrpBalance = await client.getXRPBalance(address);
// Returns: { address, balance, balanceDrops }

// IOU token balance
const iouBalance = await client.getIOUBalance(address, currency, issuer);
// Returns: { address, currency, issuer, balance }

Transfers

// Send XRP
const result = await client.sendXRP({
  wallet,           // xrpl Wallet instance
  destination,      // recipient address
  amount,           // amount in XRP (not drops)
  destinationTag?,  // optional
  memo?,            // optional
});

// Send IOU tokens
const result = await client.sendIOU({
  wallet,
  destination,
  currency,         // e.g., "USD"
  issuer,           // token issuer address
  amount,
  destinationTag?,
  memo?,
});

// Returns: { success, hash, ledgerIndex, response }

Trustlines

// Check specific trustline
const trustline = await client.checkTrustline(address, currency, issuer);
// Returns: { exists, currency, issuer, balance, limit, ... }

// Get all trustlines for an account
const trustlines = await client.getAllTrustlines(address);

Testnet Utilities

// Fund a wallet on testnet/devnet
const wallet = await client.fundWallet();
// Or fund an existing wallet
const funded = await client.fundWallet(existingWallet);

Network Constants

import { NETWORKS } from "xrpl-integration";

NETWORKS.MAINNET       // wss://xrplcluster.com/
NETWORKS.MAINNET_RIPPLE // wss://s1.ripple.com/
NETWORKS.TESTNET       // wss://s.altnet.rippletest.net:51233/
NETWORKS.DEVNET        // wss://s.devnet.rippletest.net:51233/

Error Handling

All methods throw XRPLClientError with specific error types:

import { XRPLClientError, XRPLClientErrorType } from "xrpl-integration";

try {
  await client.getXRPBalance("invalid");
} catch (error) {
  if (error instanceof XRPLClientError) {
    switch (error.type) {
      case XRPLClientErrorType.NOT_CONNECTED:
      case XRPLClientErrorType.INVALID_ADDRESS:
      case XRPLClientErrorType.ACCOUNT_NOT_FOUND:
      case XRPLClientErrorType.TRANSACTION_FAILED:
        // Handle specific error
    }
  }
}

License

MIT