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

fluid-fadp

v1.3.0

Published

Fluid Agentic DeFi Protocol — HTTP payment protocol for AI agents. Gate any API endpoint and let agents pay automatically with crypto.

Downloads

281

Readme

FADP — Fluid Agentic DeFi Protocol

The open HTTP payment protocol for AI agents.

Gate any API endpoint behind a crypto micropayment. AI agents pay automatically — no wallets to manage, no API keys to share, no invoices.

npm version License: MIT


What is FADP?

FADP (Fluid Agentic DeFi Protocol) is an open HTTP payment protocol built on top of the standard 402 Payment Required status code. Any server can gate any endpoint. Any AI agent with a Fluid Wallet agent key pays automatically and gets access.

Agent hits gated endpoint
        ↓
Server returns 402 + X-FADP-Required: { amount, token, chain, payTo, nonce }
        ↓
Agent pays on-chain via Fluid Wallet (fwag_ key)
        ↓
Agent retries with X-FADP-Proof: { txHash, nonce, timestamp }
        ↓
Server verifies payment → unlocks resource ✅

vs x402

| Feature | x402 (Coinbase) | FADP (Fluid) | |---|---|---| | Tokens | USDC only | ETH, USDC, USDT, any ERC-20 | | Chains | Base only | Base, Ethereum, Solana, Injective | | Agent identity | Raw wallet address | Email + scoped agent key | | Spend limits | None | Per-tx + daily cap built in | | Approval flow | None | Owner email approval for large amounts | | Agent setup | Wallet + funds required | Just a fwag_ key | | Replay protection | Signature-based | Nonce-based | | Open spec | Yes | Yes |


Installation

npm install fluid-fadp

Server — Gate Any Endpoint

import express from 'express';
import { fadpGate } from 'fadp';

const app = express();

// Gate a premium endpoint — agents pay 0.01 USDC per request
app.use('/api/premium-data', fadpGate({
  amount: '0.01',
  token: 'USDC',
  chain: 'base',
  payTo: process.env.MY_WALLET_ADDRESS!,   // your Fluid Wallet address
  description: 'Premium market data API',
}));

app.get('/api/premium-data', (req, res) => {
  res.json({ data: 'secret alpha', paidBy: req.fadpPayment });
});

What the agent sees when not paying

HTTP 402
X-FADP-Required: {
  "version": "1.0",
  "amount": "0.01",
  "token": "USDC",
  "chain": "base",
  "payTo": "0xYourWalletAddress",
  "description": "Premium market data API",
  "nonce": "a3f8c2d1e4b5...",
  "expires": 1745000300,
  "verifyUrl": "https://fluidnative.com/v1/fadp/verify"
}

Client — Auto-Pay in Agents

import { fadpFetch } from 'fadp';

// Replace your normal fetch with fadpFetch
const fetch = fadpFetch({
  agentKey: process.env.FLUID_AGENT_KEY!,   // fwag_...
  maxAutoPayUsd: 5,                           // safety limit
});

// This automatically pays if the endpoint returns 402 FADP
const res = await fetch('https://anyserver.com/api/premium-data');
const data = await res.json();
// data = { data: 'secret alpha', ... }

With OpenAI Agents / LangChain

import { fadpFetch } from 'fadp';
import { FluidAgent } from 'fluid-wallet-agentkit';

const agent = new FluidAgent({ apiKey: process.env.FLUID_AGENT_KEY! });
const fetch = fadpFetch({ agentKey: process.env.FLUID_AGENT_KEY! });

// Now your agent can access any FADP-gated API on the internet
const res = await fetch('https://some-paid-api.com/data');

Next.js Middleware

// middleware.ts
import { fadpGate } from 'fadp';
import { NextRequest, NextResponse } from 'next/server';

export function middleware(req: NextRequest) {
  if (req.nextUrl.pathname.startsWith('/api/premium')) {
    // Manual FADP check for Next.js edge
    const proof = req.headers.get('x-fadp-proof');
    if (!proof) {
      return NextResponse.json(
        { error: 'Payment required', protocol: 'FADP/1.0' },
        {
          status: 402,
          headers: {
            'X-FADP-Required': JSON.stringify({
              version: '1.0',
              amount: '0.01',
              token: 'USDC',
              chain: 'base',
              payTo: process.env.MY_WALLET_ADDRESS!,
              nonce: crypto.randomUUID(),
              expires: Math.floor(Date.now() / 1000) + 300,
              verifyUrl: 'https://fluidnative.com/v1/fadp/verify',
            }),
          },
        }
      );
    }
  }
  return NextResponse.next();
}

Protocol Specification

Request Headers

| Header | Direction | Description | |---|---|---| | X-FADP-Required | Server → Agent | JSON payment challenge | | X-FADP-Proof | Agent → Server | JSON payment proof |

X-FADP-Required Schema

{
  version: "1.0";
  amount: string;       // e.g. "0.01"
  token: string;        // "USDC" | "ETH" | "USDT"
  chain: string;        // "base" | "ethereum" | "solana"
  payTo: string;        // wallet address
  description?: string; // shown to agent
  nonce: string;        // one-time use, prevents replay
  expires: number;      // unix timestamp
  verifyUrl?: string;   // payment verifier endpoint
}

X-FADP-Proof Schema

{
  txHash: string;          // on-chain transaction hash
  nonce: string;           // must match the challenge nonce
  timestamp: number;       // unix timestamp of payment
  agentKeyPrefix?: string; // first 12 chars of fwag_ key (for identification)
}

Verification Endpoint

POST https://fluidnative.com/v1/fadp/verify

{
  "txHash": "0xabc...",
  "payTo": "0xServerWallet",
  "amount": "0.01",
  "token": "USDC",
  "chain": "base",
  "nonce": "a3f8c2d1..."
}

Response:

{
  "verified": true,
  "txHash": "0xabc...",
  "amount": "0.01",
  "token": "USDC",
  "chain": "base",
  "from": "0xAgentWallet",
  "to": "0xServerWallet"
}

How to Get an Agent Key

  1. Register at fluidnative.com
  2. Go to fluidnative.com/agentic-keys
  3. Create a key with pay scope
  4. Set FLUID_AGENT_KEY=fwag_... in your agent's environment

Use Cases

  • Data APIs — charge per query (market data, analytics, ML inference)
  • Compute APIs — pay per inference, rendering, or processing job
  • Agent-to-agent payments — agents paying other agents for services
  • Metered APIs — rate limiting by payment instead of API keys
  • Content paywalls — premium content unlocked by micropayment

Links


License

MIT © Fluid Wallet