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

@dropfi/xrpl-react

v0.1.11

Published

React provider and hook for XRPL dApps using DropFi wallet

Readme

@dropfi/xrpl-react

React context + hook to access DropFi Wallet via window.xrpl

🚀 Features

  • ✅ Auto-initializes the injected window.xrpl provider (extension or mobile)
  • ✅ Provides connect, disconnect, sendTransaction, and signMessage
  • ✅ React hook with address, network, connectedAccounts, and more
  • ✅ Compatible with both browser extension and mobile webview injection

📦 Installation

pnpm add @dropfi/xrpl-react

Requires the DropFi wallet to be injected as window.xrpl — via Chrome extension or React Native WebView.


🧪 Usage

import { XrplProvider, useXrplReact } from '@dropfi/xrpl-react';

export default function App() {
  return (
    <XrplProvider>
      <SomeComponent />
    </XrplProvider>
  );
}

function SomeComponent() {
  const { address, connect, disconnect } = useXrplReact();

  return (
    <div>
      <p>Address: {address ?? 'Not connected'}</p>
      <button onClick={connect}>Connect Wallet</button>
      <button onClick={disconnect}>Disconnect</button>
    </div>
  );
}

🔌 API

useXrplReact()

Returns:

{
  address: string | undefined;
  wallet: string | undefined;
  isConnected: boolean;
  connect: () => Promise<string>;
  disconnect: () => Promise<void>;
  sendTransaction: (tx: any) => Promise<any>;
  signMessage: (message: string) => Promise<{ signature: string }>;
  changeNetwork: (network: string) => Promise<any>;
  connectedAccounts: string[];
  network: string;
  isConnecting: boolean;
  error: string | null;
  initialized: boolean;
}

🎧 Events

These are internally emitted and listened to:

  • xrpl_selectedAddress
  • xrpl_connectedAccounts
  • xrpl_selectedNetwork
  • xrpl_disconnect

🔒 Requirements

Make sure your app runs in an environment where window.xrpl is available. This is injected by the DropFi wallet:

  • Chrome extension
  • React Native mobile app via WebView


title: XRPL Transactions description: How to use sendTransaction and supported XRPL transaction types in @dropfi/xrpl-react.


import { Highlight } from '@theme-ui/components'

📤 Sending XRPL Transactions

The useXrpl hook provided by @dropfi/xrpl-react includes a powerful sendTransaction function that allows you to send XRPL transactions directly from your React app using the connected wallet.

const { sendTransaction } = useXrpl();

⚙️ Supported Transaction Types

You can send any valid XRPL transaction using sendTransaction. Common supported types include:

  • Payment
  • TrustSet
  • AccountSet
  • OfferCreate
  • OfferCancel
  • NFTokenMint
  • NFTokenBurn
  • NFTokenCreateOffer
  • NFTokenCancelOffer
  • NFTokenAcceptOffer
  • SetRegularKey
  • SignerListSet
  • EscrowCreate
  • EscrowCancel
  • EscrowFinish
  • DepositPreauth
  • CheckCreate
  • CheckCash
  • CheckCancel
  • TicketCreate
  • AccountDelete
  • PaymentChannelCreate
  • PaymentChannelFund
  • PaymentChannelClaim
  • AMMCreate
  • AMMDeposit
  • AMMWithdraw
  • AMMVote

For full documentation, see the XRPL Transaction Types.


💸 Example: Sending a Payment

const tx: Payment = {
  TransactionType: 'Payment',
  Account: wallet.address,
  Destination: 'rDestinationAddressHere',
  Amount: '1000000', // 1 XRP in drops
};

await sendTransaction(tx);

🧾 Example: NFTokenCreateOffer

const tx: NFTokenCreateOffer = {
  TransactionType: 'NFTokenCreateOffer',
  Account: nft.owner,
  NFTokenID: nft.NftId,
  Destination: 'rBrokerAccountHere',
  Flags: 0x00000001, // 1 = sell offer
};

await sendTransaction(tx);

🛠 Notes

  • Every transaction must include the TransactionType and Account fields.
  • Amounts must be specified in drops for XRP or as { currency, issuer, value } for tokens.
  • You must be connected with a valid XRPL-compatible wallet like DropFi to sign and submit.

Need more examples? Check the xrpl.org transaction explorer or open an issue.

📄 License

MIT © Travis Delly