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

sonnet-protocol-sdk

v1.0.0

Published

Developer SDK for launching AI agents with built-in X402 micropayments on Sonnet Protocol

Downloads

2

Readme

Sonnet Protocol SDK

Launch AI agents with built-in X402 micropayments

Overview

Sonnet Protocol provides a developer SDK for launching custom AI agents with built-in payment infrastructure. Developers can brand their agents, add custom functionality, and earn 80% of payment revenue.

Features

Two Operating Modes

1. Test Mode - $0.025/prompt

  • Single whitelisted wallet for development/testing
  • Cheaper pricing for testing agents
  • Perfect for development and debugging
  • Limited to ONE wallet address per developer

2. Production Mode - $0.05/prompt

  • Unlimited wallets can use your agent
  • Standard production pricing
  • Full public deployment
  • Developer earns 80% of all payments

Revenue Split

All payments are automatically split:

  • 80% goes to developer (your revenue wallet)
  • 20% goes to Protocol Treasury

Customization

Developers can customize:

  • ✅ Agent name and description
  • ✅ System prompts and behavior
  • ✅ Custom tools and functionality
  • ✅ Branding (logo, colors)
  • ✅ Swap fee configuration (if agent includes swaps)

Quick Start

1. Register as Developer

// POST /api/sdk/register
const response = await fetch('https://your-app.run.app/api/sdk/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    walletAddress: '0xYourWallet...',
    agentName: 'My AI Agent',
    mode: 'test', // or 'production'
    testWalletAddress: '0xTestWallet...', // required for test mode
    revenueWalletAddress: '0xRevenueWallet...' // receives 80% of payments
  })
});

const { apiKey } = await response.json();
// Save your API key: sp_abc123...

2. Initialize SDK

import { createSonnetSDK } from '@sonnet-protocol/sdk';

const sdk = createSonnetSDK({
  mode: 'test', // or 'production'
  apiKey: 'sp_abc123...',
  testWalletAddress: '0xTestWallet...', // required for test mode
  revenueWalletAddress: '0xRevenueWallet...', // receives 80%
  agentConfig: {
    name: 'My AI Agent',
    description: 'Custom agent that helps with...',
    systemPrompt: 'You are a helpful AI agent that...',
    tools: [
      {
        name: 'custom-tool',
        description: 'Does something custom',
        parameters: { /* ... */ },
        handler: async (params) => {
          // Your custom logic
          return result;
        }
      }
    ],
    brandingConfig: {
      logoUrl: 'https://...',
      primaryColor: '#FF6B35',
      accentColor: '#F7931E'
    }
  }
});

3. Process Intents

const result = await sdk.processIntent(
  'swap 100 USDC to ETH',
  userWalletAddress
);

if (result.paymentRequired) {
  // Show X402 payment modal (built-in)
  // User pays $0.06 (test) or $0.30 (production)
  // 80% goes to your revenue wallet
  // 20% goes to Protocol Treasury
}

Pricing Examples

Test Mode

User pays: $0.025 per prompt
Developer receives: $0.020 (80%)
Protocol receives: $0.005 (20%)
Wallets allowed: 1 (whitelisted)

Production Mode

User pays: $0.05 per prompt
Developer receives: $0.04 (80%)
Protocol receives: $0.01 (20%)
Wallets allowed: Unlimited

Use Cases

1. DeFi Trading Agent

agentConfig: {
  name: 'DeFi Trader Pro',
  description: 'Advanced trading agent with custom strategies',
  tools: [
    { name: 'analyze-market', ... },
    { name: 'execute-strategy', ... },
    { name: 'risk-management', ... }
  ]
}

2. NFT Analytics Agent

agentConfig: {
  name: 'NFT Scout',
  description: 'Find undervalued NFTs and track collections',
  tools: [
    { name: 'scan-collections', ... },
    { name: 'price-analysis', ... },
    { name: 'rarity-check', ... }
  ]
}

3. Portfolio Manager Agent

agentConfig: {
  name: 'Portfolio AI',
  description: 'Automated portfolio rebalancing and tracking',
  tools: [
    { name: 'analyze-portfolio', ... },
    { name: 'rebalance-strategy', ... },
    { name: 'risk-report', ... }
  ]
}

API Endpoints

Register Developer

POST /api/sdk/register

Get Developer Info

GET /api/sdk/register Headers: X-Sonnet-API-Key: sp_...

Process Intent

POST /api/process-intent Headers:

  • X-Sonnet-API-Key: sp_...
  • X-Sonnet-Mode: test|production

Swap Fee Configuration

If your agent includes swap functionality, you can set custom swap fees:

swapFeeConfig: {
  feePercentage: 1.0, // 1% swap fee
  feeRecipientAddress: '0xYourFeeWallet...'
}

Note: Swap fees are separate from X402 payment fees. You control 100% of swap fees.

Test Mode Limitations

  • Single wallet only: Test mode only allows ONE whitelisted wallet
  • Purpose: For development and testing your agent
  • Restriction: Each test wallet can only be registered once
  • Switch to production: Deploy publicly with unlimited wallets

Revenue

Developer Earns 80%

  • All payments go through X402 protocol
  • 80% automatically sent to your revenue wallet
  • Real-time payments, no delays
  • Track earnings in your wallet

Protocol Earns 20%

  • 20% funds Protocol Treasury
  • Supports infrastructure and development
  • Transparent on-chain

Support

  • Documentation: https://docs.sonnetprotocol.com
  • Discord: https://discord.gg/sonnet
  • GitHub: https://github.com/sonnet-protocol/sdk
  • Twitter: @SonnetProtocol

License

MIT License - Build whatever you want!