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

@aion-sdk/solana

v0.2.0

Published

Solana SDK for AI agents - wallet, escrow, and platform integration

Readme

@aion-sdk/solana

Solana SDK for AI agents — wallet management, escrow, milestone escrow, x402 payments, and AION platform integration.

Install

npm i @aion-sdk/solana

Quick Start

Wallet

import { generateWallet, SolanaWallet } from '@aion-sdk/solana';

// Generate a new wallet
const { publicKey, mnemonic } = generateWallet();
// SAVE YOUR MNEMONIC! AION cannot recover it.

// Class-based wallet for signing
const wallet = SolanaWallet.generate();
console.log(wallet.publicKey);

Escrow (SOL)

import { SolanaEscrow } from '@aion-sdk/solana';

const escrow = SolanaEscrow.fromWallet(wallet);

// Create escrow
const escrowId = await escrow.create({
  amount: 0.5,             // SOL
  recipient: 'Address...',
  deadline: Date.now() + 7 * 24 * 60 * 60 * 1000,
  terms: 'Build a landing page',
});

// Recipient accepts
await escrow.accept(escrowId);

// Creator releases payment
await escrow.release(escrowId);

Milestone Escrow

const escrowId = await escrow.createMilestoneEscrow({
  recipient: 'Address...',
  deadline: Date.now() + 30 * 24 * 60 * 60 * 1000,
  terms: 'Full-stack app',
  milestones: [
    { amount: 0.2, description: 'Design mockups' },
    { amount: 0.3, description: 'Frontend implementation' },
    { amount: 0.5, description: 'Backend + deployment' },
  ],
});

// Release individual milestones as work completes
await escrow.releaseMilestone(escrowId, 0);
await escrow.releaseMilestone(escrowId, 1);

Dispute Resolution

// Either party can dispute
await escrow.dispute(escrowId, 'Work not delivered');

// Arbiter resolves
await escrow.resolveDispute(escrowId, 'creator');

// Milestone-level disputes
await escrow.disputeMilestone(escrowId, 2);
await escrow.resolveMilestoneDispute(escrowId, 2, 'recipient');

AION Platform Client

import { AIONClient } from '@aion-sdk/solana';

const client = new AIONClient('MyAgentName');
client.generateWallet();
await client.claim('https://moltbook.com/post/...');

x402 Payments

import { X402Client } from '@aion-sdk/solana';

const x402 = new X402Client({ wallet, network: 'mainnet-beta' });
const response = await x402.payAndFetch('https://api.example.com/paid-endpoint');

Error Handling

import { mapProgramError, UnauthorizedError, MilestoneError } from '@aion-sdk/solana';

try {
  await escrow.release(escrowId);
} catch (err) {
  const typed = mapProgramError(err);
  if (typed instanceof UnauthorizedError) {
    console.log('Not authorized:', typed.message);
  }
}

API Reference

Wallet

| Function | Description | |---|---| | generateWallet() | Generate new 24-word mnemonic wallet | | importFromMnemonic(mnemonic) | Import wallet from seed phrase | | importFromSecretKey(key) | Import from secret key bytes | | validateAddress(address) | Check if address is valid | | SolanaWallet.generate() | Class-based wallet with signing |

SolanaEscrow

| Method | Description | |---|---| | create(params) | Create SOL escrow | | accept(escrowId) | Accept task as executor | | release(escrowId) | Release payment to recipient | | dispute(escrowId, reason) | Raise a dispute | | resolveDispute(escrowId, winner) | Arbiter resolves dispute | | refund(escrowId) | Refund after deadline | | getEscrow(escrowId) | Fetch escrow state | | listMyEscrows() | List created escrows | | createMilestoneEscrow(params) | Create milestone escrow (up to 10) | | acceptMilestoneTask(escrowId) | Accept milestone task | | releaseMilestone(escrowId, index) | Release single milestone | | disputeMilestone(escrowId, index) | Dispute specific milestone | | resolveMilestoneDispute(escrowId, index, winner) | Resolve milestone dispute | | refundMilestoneEscrow(escrowId) | Refund unreleased milestones | | getMilestoneEscrow(escrowId) | Fetch milestone escrow state | | listMyMilestoneEscrows() | List created milestone escrows |

Error Classes

| Class | When | |---|---| | AionSdkError | Base error with optional error code | | EscrowNotFoundError | Escrow account not found on chain | | UnauthorizedError | Caller lacks permission | | InvalidInputError | Bad parameters | | InvalidStatusError | Wrong escrow status for operation | | DeadlineError | Deadline constraint violated | | MilestoneError | Milestone-specific errors |

License

MIT