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

@asterpay-io/solana

v1.0.0

Published

AsterPay Solana integration - USDC payments on Solana for AI agents and DePIN

Readme

@asterpay/solana

Solana USDC payments for AI agents and DePIN infrastructure

npm TypeScript

Overview

@asterpay/solana provides USDC payment capabilities on Solana:

  • Fast transfers - Sub-second finality
  • Low fees - ~$0.00025 per transaction
  • DePIN support - Batch payouts for node operators
  • AI agent ready - Programmatic payments

Installation

npm install @asterpay/solana
# or
yarn add @asterpay/solana

Quick Start

Basic USDC Transfer

import { SolanaWallet, SolanaPaymentClient } from '@asterpay/solana';

// Create wallet
const wallet = new SolanaWallet({
  privateKey: process.env.SOLANA_PRIVATE_KEY!,
  network: 'mainnet-beta'
});

// Create payment client
const client = new SolanaPaymentClient(wallet);

// Send USDC
const result = await client.sendUSDC({
  recipient: 'RecipientPublicKey...',
  amount: 10.00,
  memo: 'Payment for API access'
});

console.log(`TX: ${result.signature}`);
console.log(`Explorer: ${result.explorerUrl}`);

DePIN Batch Payouts

import { SolanaWallet, DePINPayoutClient } from '@asterpay/solana';

const wallet = new SolanaWallet({
  privateKey: process.env.SOLANA_KEY!,
  network: 'mainnet-beta'
});

const payout = new DePINPayoutClient(wallet);

// Pay multiple node operators
const operators = [
  { address: 'operator1...', amount: 5.50, id: 'node-001' },
  { address: 'operator2...', amount: 3.25, id: 'node-002' },
  { address: 'operator3...', amount: 8.00, id: 'node-003' },
  // ... up to thousands of recipients
];

const result = await payout.batchPayout(operators, {
  concurrency: 10,      // Parallel transactions
  retryFailed: true,    // Retry failures
  maxRetries: 3         // Max retry attempts
});

console.log(`Paid: ${result.successful}/${result.total}`);
console.log(`Total: $${result.totalPaid}`);
console.log(payout.generatePayoutReport(result));

Check Balance

const wallet = new SolanaWallet({
  privateKey: process.env.SOLANA_KEY!,
  network: 'mainnet-beta'
});

const balance = await wallet.getBalance();
console.log(`SOL: ${balance.sol}`);
console.log(`USDC: ${balance.usdc}`);

Networks

| Network | Use Case | USDC Address | |---------|----------|--------------| | mainnet-beta | Production | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | | devnet | Development | 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU | | testnet | Testing | 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU |

DePIN Use Cases

Node Operator Rewards

// Daily rewards distribution
const rewards = await fetchDailyRewards(); // Your reward calculation
const payout = new DePINPayoutClient(wallet);

const result = await payout.batchPayout(rewards, {
  concurrency: 20,  // Higher concurrency for speed
});

// Generate report for records
const report = payout.generatePayoutReport(result);
await savePayoutReport(report);

Epoch-Based Payouts

// Pay rewards at end of epoch
async function processEpochRewards(epochNumber: number) {
  const operators = await getEpochRewards(epochNumber);
  
  // Validate before payout
  const { valid, invalid } = await payout.validateRecipients(operators);
  
  if (invalid.length > 0) {
    console.warn(`${invalid.length} invalid recipients skipped`);
  }
  
  // Process valid recipients
  const result = await payout.batchPayout(valid);
  
  return {
    epoch: epochNumber,
    ...result
  };
}

Fee Estimates

| Operation | Est. Fee (SOL) | Est. Fee (USD) | |-----------|----------------|----------------| | Single transfer | 0.000005 | $0.0005 | | With token account creation | 0.002 | $0.20 | | Batch (1000 recipients) | ~1.0 | ~$100 |

API Reference

SolanaWallet

new SolanaWallet({
  privateKey: string | Uint8Array,  // Base58 or byte array
  network?: 'mainnet-beta' | 'devnet' | 'testnet',
  rpcUrl?: string,  // Custom RPC endpoint
  name?: string     // Wallet identifier
})

SolanaPaymentClient

const client = new SolanaPaymentClient(wallet);

await client.sendUSDC({
  recipient: string,    // Recipient address
  amount: number,       // Amount in USD
  memo?: string,        // Optional memo
  priorityFee?: number  // Priority fee (micro-lamports)
});

DePINPayoutClient

const payout = new DePINPayoutClient(wallet);

await payout.batchPayout(recipients, {
  concurrency?: number,        // Parallel transactions (default: 5)
  retryFailed?: boolean,       // Retry failures (default: true)
  maxRetries?: number,         // Max retries (default: 3)
  retryDelay?: number,         // Delay between retries (ms)
  createTokenAccounts?: boolean // Create accounts if missing
});

Security

  1. Never expose private keys in code
  2. Use environment variables for keys
  3. Test on devnet before mainnet
  4. Set transaction limits for automated systems

Links

License

MIT License - see LICENSE