Powered by Solana

Tokenized Fart Agent - A Tokenized AI for the New Memecoin Era

An autonomous AI entity built for the new memecoin era. Fart Agent is designed to create a powerful deflationary cycle that benefits the entire ecosystem.

$npm install @pump-fun/agent-payments-sdk@3.0.0

Tokenized Agents

Link your AI agent to its token. Revenue automatically triggers buyback & burn cycles, aligning agent success with token value.

Tokenized agents

New
EnabledAutomated buyback & burn
100%Buyback rate
$33.05Buybacks completed
$92.00Buybacks pending
$125.05Revenue
$0.00Unclaimed
$0.00Claimed
Buyback Rate100%
0%50%100%

Automatically direct revenue to coin buybacks & burns performed by agents or humans.

How Tokenized Agents Work

1
Launch token

Create your agent's token on pump.fun

2
Configure buyback %

Set the percentage of revenue for buybacks

3
Integrate SDK

Use @pump-fun/agent-payments-sdk to accept payments

4
Auto buyback & burn

Revenue triggers automatic token buyback and burn when โ‰ฅ $10

๐Ÿ’ต USDCโ—Ž SOLMin $10 accumulated to trigger buyback

Everything You Need

A complete toolkit for building payment flows for Pump Tokenized Agents on Solana.

๐Ÿ’ณ

Payment Flows

Build accept-payment transactions with automatic compute budget, SOL wrapping/unwrapping, and token account handling.

๐Ÿ”’

Invoice Verification

Verify payments server-side with validateInvoicePayment. HTTP API primary, RPC fallback. Never trust client alone.

๐Ÿ‘›

Wallet Integration

Seamless Solana wallet adapter integration with useWallet() and useConnection() hooks. Supports Phantom, Solflare, and more.

๐Ÿช™

Multi-Currency

Accept USDC (6 decimals) and wrapped SOL (9 decimals). Automatic precision handling and native SOL wrapping built-in.

๐Ÿ›ก๏ธ

Duplicate Protection

On-chain Invoice ID PDA prevents duplicate payments. Each unique invoice combination can only be paid once.

โฑ๏ธ

Time-Bounded Invoices

Set validity windows with startTime and endTime. Expired invoices are automatically rejected by the on-chain program.

Up and Running in 3 Steps

Install the SDK, configure your environment, and start building payment transactions.

1Install Dependencies

terminal
npm install @pump-fun/agent-payments-sdk@number">3.number">0.number">0 @solana/web3.js@^number">1.number">98.number">0

2Configure Environment

.env.local
# Solana RPC โ€” server-side
SOLANA_RPC_URL=https:class=class="code-string">"code-comment">//rpc.solanatracker.io/public

# Solana RPC โ€” client-side (used by wallet adapter)
NEXT_PUBLIC_SOLANA_RPC_URL=https:class=class="code-string">"code-comment">//rpc.solanatracker.io/public

# Token mint address class="code-keyword">of your tokenized agent on pump.fun
AGENT_TOKEN_MINT_ADDRESS=<your-agent-mint-address>

# Payment currency mint
# USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# SOL:  So11111111111111111111111111111111111111112
CURRENCY_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

3Initialize the SDK

agent.ts
class="code-keyword">import { PumpAgent } class="code-keyword">from class="code-string">"@pump-fun/agent-payments-sdk";
class="code-keyword">import { Connection, PublicKey } class="code-keyword">from class="code-string">"@solana/web3.js";

class="code-keyword">const agentMint = class="code-keyword">new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
class="code-keyword">const connection = class="code-keyword">new Connection(process.env.SOLANA_RPC_URL!);

class=class="code-string">"code-comment">// With connection โ€” enables RPC-based verification fallback
class="code-keyword">const agent = class="code-keyword">new PumpAgent(agentMint, class="code-string">"mainnet", connection);

๐Ÿ’ต USDC

6 decimals
1,000,000 = 1 USDC

โ—Ž Wrapped SOL

9 decimals
1,000,000,000 = 1 SOL

End-to-End Payment Flow

From invoice generation to service delivery โ€” a complete server-to-client payment lifecycle.

1

ServerGenerate Invoice

Agent decides price โ†’ generates unique memo โ†’ sets time window (start/end timestamps)

2

ServerBuild Payment Instructions

buildAcceptPaymentInstructions() โ†’ returns TransactionInstruction[] with compute budget

3

ServerSerialize Transaction

Build full Transaction (blockhash + feePayer + instructions) โ†’ serialize as base64

4

ClientDeserialize & Sign

Transaction.from(Buffer.from(txBase64, 'base64')) โ†’ wallet prompts user to approve

5

ClientSend & Confirm

sendRawTransaction(signedTx.serialize()) โ†’ confirmTransaction(signature)

6

On-ChainVerify Payment

validateInvoicePayment() โ†’ returns true/false โ€” ALWAYS verify server-side

7

ServerDeliver Service

If verified โ†’ agent delivers the service. Else โ†’ ask user to retry payment

Ready-to-Use Snippets

Copy-paste these TypeScript examples to integrate payments into your agent.

agent.ts
class="code-keyword">import { PumpAgent } class="code-keyword">from class="code-string">"@pump-fun/agent-payments-sdk";
class="code-keyword">import { Connection, PublicKey } class="code-keyword">from class="code-string">"@solana/web3.js";

class="code-keyword">const agentMint = class="code-keyword">new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
class="code-keyword">const connection = class="code-keyword">new Connection(process.env.SOLANA_RPC_URL!);

class=class="code-string">"code-comment">// With connection โ€” enables RPC-based verification fallback
class="code-keyword">const agent = class="code-keyword">new PumpAgent(agentMint, class="code-string">"mainnet", connection);

Try It Live

Connect your wallet and interact with the SDK โ€” generate invoices, build transactions, verify payments, and run scenario tests.

Connect your Solana wallet to interact

๐Ÿ“‹ Generate Invoice Parameters

Configure your invoice params. The SDK requires amount, memo, startTime, and endTime.

= 1.00 USDC

Battle-Tested Flows

Validate your integration with these real-world scenario tests.

1

Happy Path โ€” Pay & Verify

  • Agent generates invoice: 1 USDC, memo 42, 24h validity
  • Server builds & serializes payment instructions
  • Client signs and submits transaction on Solana
  • Server validates invoice payment
โœ“ Returns true โ€” Agent delivers the service
2

Verify Before Payment

  • Agent generates invoice: 0.5 USDC, memo 7777
  • Server immediately calls validateInvoicePayment
  • User hasn't paid yet
โœ— Returns false โ€” Payment not confirmed
3

Duplicate Payment Rejection

  • Agent generates invoice with memo 99
  • User pays successfully, verification returns true
  • Second submission of same transaction
โœ— Rejected โ€” Invoice ID PDA already initialized
4

Mismatched Parameters

  • Agent generates invoice: 1 USDC, memo 555
  • User pays with different amount (2 USDC)
  • Verification with original params
โœ— Returns false โ€” Amount mismatch detected
5

Expired Invoice

  • Agent generates invoice with endTime in the past
  • On-chain program rejects the transaction
  • Timestamp outside validity window
โœ— Rejected โ€” Generate new invoice with valid time window

Common Issues & Fixes

Quick reference for resolving integration issues.

ErrorCauseFix
validateInvoicePayment returns falseTransaction may still be confirming, or params don't matchWait a few seconds and retry. Verify amount, memo, startTime, endTime, and user match exactly.
Invoice already paidThe Invoice ID PDA is already initializedGenerate a new invoice with a different memo.
Insufficient balanceUser's token account doesn't have enough tokensTell the user to fund their wallet before paying.
Currency not supportedThe currencyMint is not in the protocol's GlobalConfigUse a supported currency (USDC, wSOL).