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

toto-wallet-system

v1.0.2

Published

Stellar-based wallet management system for Toto platform

Readme

Toto Wallet System

A standalone, reusable Stellar wallet management system for the Toto platform. This non-custodial wallet module provides secure client-side wallet creation, management, fiat on-ramping via MoonPay, and donation capabilities.

Project Status

🎉 COMPLETE 🎉
All features have been implemented, and all tests are passing successfully. The project includes comprehensive test coverage with 46 passing tests across 9 test suites covering all components, hooks, context providers, and utility functions.

Features

  • ✅ Non-custodial Stellar wallet creation and management
  • ✅ XLM balance checking
  • ✅ Direct XLM donations with memo support
  • ✅ MoonPay integration for fiat on-ramping
  • ✅ Transaction history tracking
  • ✅ React hooks for easy integration

Installation

# With npm
npm install @toto/wallet-system

# With yarn
yarn add @toto/wallet-system

Publishing

For project maintainers, to publish a new version:

  1. Use the release scripts to bump the version and update the changelog:
# For a patch release (bugfixes)
npm run release:patch

# For a minor release (new features, backward compatible)
npm run release:minor

# For a major release (breaking changes)
npm run release:major
  1. Follow the prompts and instructions after running the release script

  2. Create a new release on GitHub to trigger the automatic publishing workflow

Quick Start

import { WalletProvider, CreateWalletButton, useAccountBalance } from '@toto/wallet-system';

// Wrap your app with the provider
function App() {
  return (
    <WalletProvider
      moonPayApiKey="your_moonpay_public_api_key"
      stellarNetwork="testnet" // or 'public' for production
    >
      <WalletPage />
    </WalletProvider>
  );
}

// Use the wallet system in your components
function WalletPage() {
  const { publicKey, createWallet } = useStellarWallet();
  const { balance, isLoading, refetch } = useAccountBalance();
  
  return (
    <div>
      <h1>Toto Wallet</h1>
      
      {!publicKey ? (
        <CreateWalletButton onWalletCreated={(pk, mnemonic) => {
          console.log("Save this mnemonic securely:", mnemonic);
        }}>
          Create New Wallet
        </CreateWalletButton>
      ) : (
        <div>
          <p>Public Key: {publicKey}</p>
          <p>Balance: {isLoading ? "Loading..." : `${balance?.xlm || 0} XLM`}</p>
          <button onClick={refetch}>Refresh Balance</button>
        </div>
      )}
    </div>
  );
}

Documentation

See the integration guide for detailed instructions on how to use each component and hook.

Core Components

  • WalletProvider - Context provider for wallet functionality
  • CreateWalletButton - Component for creating a new wallet
  • DonationModal - Modal for submitting XLM donations
  • MoonPayLoader - Component for loading the MoonPay widget

Hooks

  • useStellarWallet - Access the wallet context
  • useAccountBalance - Check account balance
  • useSubmitDonation - Submit donations
  • useTransactionHistory - Get transaction history

Example Apps

See the examples directory for complete usage examples.

Development

Prerequisites

  • Node.js 16+
  • npm or yarn

Setup

  1. Clone the repository
  2. Install dependencies:
npm install

Build

npm run build

Watch for changes during development

npm run dev

Testing

npm test

Roadmap

See the roadmap progress for detailed implementation status.

License

This project is licensed under the UNLICENSED license - see the LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin feature/my-new-feature
  5. Submit a pull request

Test Coverage

The project includes comprehensive test coverage for hooks and components:

Hooks

  • useAccountBalance: Tests for checking account existence, balance retrieval, and manual refresh functionality
  • useSubmitDonation: Tests for donation submission, error handling, and transaction confirmation
  • useTransactionHistory: Tests for automatic and manual transaction fetching, custom public key handling, and error states

Components

  • CreateWalletButton: Tests for rendering, custom styling, wallet creation, loading states, and error handling
  • DonationModal: Tests for form validation, submission handling, loading states, and error display
  • MoonPayLoader: Tests for URL construction, error states, development mode functionality, and transaction simulation

Running Tests

npm test

To run specific tests:

npm test -- ComponentName.test.tsx

Test Environment

Tests use Jest with React Testing Library and @testing-library/react-hooks for testing custom hooks.