Skip to content

PumpBot11/PumpBot

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Solana Paywall Random Number Generator (Next.js)

A simple proof-of-concept crypto paywall app built with Next.js + Solana wallets + Pump tokenized-agents payments.

Users connect their Solana wallet, pay a small fee (e.g. 0.1 SOL), and once the payment is verified server-side they can generate a random number between 0 and 1000.

This project demonstrates how to build action-gated features powered by on-chain payments.

✨ Features

βœ… Solana wallet connection (Phantom / Solflare / Backpack etc.)

βœ… On-chain payment required to unlock functionality

βœ… Server-side invoice verification

βœ… HTTP-only cookie access control

βœ… Random number generator (protected endpoint)

βœ… Built with Next.js App Router

βœ… Uses Pump tokenized-agents payment skill

🧠 Concept

This app shows a core Web3 pattern:

Pay β†’ Verify β†’ Unlock Feature

Instead of traditional authentication or subscriptions:

Wallet = identity

Transaction = payment

Backend verification = access control

This architecture can be used to build:

paid APIs

premium AI tools

crypto SaaS

content paywalls

games

agent-to-agent commerce

token-gated utilities

πŸ—οΈ Architecture

  1. Create Invoice

The backend generates payment parameters and builds an unsigned Solana transaction using the Pump payment skill.

  1. Wallet Signs Transaction

The frontend asks the connected wallet to sign and send the transaction.

  1. Backend Verifies Payment

After submission, the backend verifies:

correct wallet

correct mint / recipient

correct payment amount

valid invoice reference

If valid β†’ grants access via secure cookie.

  1. Feature Unlock

User can now call protected endpoints such as:

GET /api/random

Returns a random number between 0–1000.

πŸ“ Project Structure app/ page.tsx β†’ UI (wallet connect + payment + RNG) api/ invoice/route.ts β†’ create invoice + transaction verify/route.ts β†’ verify payment + grant access random/route.ts β†’ protected random number endpoint

lib/ payment.ts β†’ PumpAgent helpers

.env.example β†’ configuration template βš™οΈ Setup

  1. Install dependencies npm install
  2. Configure environment

Copy:

.env.example β†’ .env.local

Then set:

PAYMENT_ACCESS_SECRET=your_long_random_secret NEXT_PUBLIC_RPC_URL=your_rpc_url 3. Run the app npm run dev

Open:

http://localhost:3000 πŸ’° Payment Configuration

Default settings:

Payment: 0.1 SOL

Currency: Wrapped SOL

Agent mint:

You can change:

payment amount

token mint

RPC provider

access duration logic

πŸ” Security Notes

This project demonstrates basic paywall logic.

For production you should also consider:

replay protection

access expiry / session duration

rate limiting

signature verification hardening

transaction confirmation depth

database storage of invoices

πŸš€ Ideas to Extend

Token-gated AI generation

Paid API marketplace

NFT mint access

Web3 SaaS subscriptions

Agent-to-agent micro-payments

Premium trading signals

Crypto games

πŸ“œ License

MIT

About

Forked the original to configure new Pump Agent

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.8%
  • JavaScript 0.2%