Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat: add pump-fun-skills (coin-fees, create-coin, swap, tokenized-agents)

nirholas58b05ce79987
diff --git a/pump-fun-skills/README.md b/pump-fun-skills/README.md
new file mode 100644
index 000000000..a05531528
--- /dev/null
+++ b/pump-fun-skills/README.md
@@ -0,0 +1,120 @@
+# pump-fun-skills
+
+A collection of [Agent Skills](https://agentskills.io) that teach AI agents how to interact with the [pump.fun](https://pump.fun) platform. Each skill follows the Agent Skills format and can be loaded by any compatible AI agent to perform specific tasks using pump.fun's on-chain programs and SDKs.
+
+## Overview
+
+This skill library provides AI agents with the tools to interact with pump.fun's on-chain ecosystem:
+
+- **Coin Creation** — Launch coins with optional initial buy, mayhem mode, cashback, tokenized agent support, and front-runner protection
+- **Token Swaps** — Buy and sell tokens on bonding curve or graduated AMM pools with slippage protection
+- **Creator Fee Management** — Inspect, collect, and distribute creator fees with configurable sharing among multiple shareholders
+- **Tokenized Agent Payments** — Accept payments and verify invoices on-chain using the Pump Agent Payments SDK
+
+## Available Skills
+
+| Skill | Description |
+| ----- | ----------- |
+| [**Create Coin**](create-coin/) | Create coins on pump.fun with an initial buy. Supports mayhem mode, cashback, tokenized agents with buyback %, and front-runner protection via Jito. Uses the `@pump-fun/pump-sdk` and pump.fun API. |
+| [**Swap**](swap/) | Buy and sell tokens on the bonding curve or AMM pool. Automatically detects coin state (bonding vs graduated) and builds the correct transaction. Supports slippage protection and Jito front-runner protection. |
+| [**Coin Fees**](coin-fees/) | Inspect creator fee destinations and vault balances, collect fees, distribute shared fees to shareholders, and create or update sharing configs with up to 10 shareholders. |
+| [**Tokenized Agent Payments**](tokenized-agents/) | Accept USDC or wrapped SOL payments and verify invoices on-chain for Pump Tokenized Agents using `@pump-fun/agent-payments-sdk`. Includes wallet integration guides for React/Next.js. |
+
+## Repo Structure
+
+```
+pump-fun-skills/
+├── README.md
+├── create-coin/
+│ ├── SKILL.md
+│ ├── package.json
+│ ├── references/
+│ │ └── METADATA.md
+│ └── scripts/
+│ ├── lib/
+│ └── *.mjs
+├── swap/
+│ ├── SKILL.md
+│ ├── package.json
+│ └── scripts/
+│ ├── lib/
+│ └── *.mjs
+├── coin-fees/
+│ ├── SKILL.md
+│ ├── package.json
+│ └── scripts/
+│ ├── lib/
+│ └── *.mjs
+└── tokenized-agents/
+ ├── SKILL.md
+ └── references/
+```
+
+## Getting Started
+
+**Install a skill** by prompting your AI agent with one of:
+
+- A local path (if the repo is cloned):
+
+ ```
+ Install the skill create-coin/SKILL.md
+ ```
+
+- A remote URL:
+
+ ```
+ Install the skill https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/create-coin/SKILL.md
+ ```
+
+| Skill | Install command |
+| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Create Coin | `Install the skill https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/create-coin/SKILL.md` |
+| Swap | `Install the skill https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/swap/SKILL.md` |
+| Coin Fees | `Install the skill https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/coin-fees/SKILL.md` |
+| Tokenized Agent Payments | `Install the skill https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/SKILL.md` |
+
+Once installed, you can follow the skill's instructions or run the documented CLI scripts.
+
+### Manual setup
+
+1. **Point your AI agent at a skill.** Load the skill directory (e.g. `create-coin/`, `swap/`, `coin-fees/`, or `tokenized-agents/`) into your agent's context.
+
+2. **Install dependencies.**
+ - **Create coin skill:** `cd create-coin && npm install` then run scripts under `create-coin/scripts/` (see `create-coin/SKILL.md`).
+ - **Swap skill:** `cd swap && npm install` then run scripts under `swap/scripts/` (see `swap/SKILL.md`).
+ - **Coin fees skill:** `cd coin-fees && npm install` then run scripts under `coin-fees/scripts/` (see `coin-fees/SKILL.md`).
+ - **Tokenized agents:** `npm install @pump-fun/agent-payments-sdk` in your app.
+
+3. **Configure.** Provide Solana RPC URL and any mints or wallet addresses the skill requires.
+
+4. **Invoke.** Ask your agent to follow the skill instructions or run the documented CLI scripts.
+
+## Skill Structure
+
+Each skill follows a consistent layout:
+
+```
+<skill>/
+├── SKILL.md # Main skill definition (required)
+├── package.json # Node.js dependencies
+├── references/ # Additional documentation
+│ └── *.md
+└── scripts/ # Runnable CLI scripts
+ ├── lib/ # Shared utilities (TX building, compute, args)
+ └── *.mjs
+```
+
+The main `SKILL.md` provides core guidance, and the agent reads the specialized reference files and scripts only when needed for specific tasks.
+
+## Example Prompts
+
+Once a skill is installed, you can ask your AI agent things like:
+
+```
+"Create a coin on pump.fun with 0.5 SOL initial buy"
+"Buy 0.1 SOL worth of token <coin address> on pump.fun"
+"Sell all my tokens for <coin address>"
+"Check my creator fee balance for <coin address>"
+"Set up fee sharing for my coin with 2 shareholders"
+"Verify if invoice #123 was paid on-chain"
+```
diff --git a/pump-fun-skills/coin-fees/.gitignore b/pump-fun-skills/coin-fees/.gitignore
new file mode 100644
index 000000000..c2658d7d1
--- /dev/null
+++ b/pump-fun-skills/coin-fees/.gitignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/pump-fun-skills/coin-fees/SKILL.md b/pump-fun-skills/coin-fees/SKILL.md
new file mode 100644
index 000000000..6ceeec356
--- /dev/null
+++ b/pump-fun-skills/coin-fees/SKILL.md
@@ -0,0 +1,457 @@
+---
+name: coin-fees
+description: >
+ Inspect and manage creator fees on pump.fun — determine fee destinations
+ (cashback, shared config, or direct creator), collect fees, distribute
+ shared fees to shareholders, and query vault balances. Prefer runnable
+ Node scripts in this skill folder; use @pump-fun/pump-sdk and
+ @pump-fun/pump-swap-sdk for custom integrations.
+metadata:
+ author: pump-fun
+ version: "1.0"
+---
+
+# Before Starting Work **Critical** - Ask these from user
+
+**MANDATORY — Do NOT write or modify any code until every item below is answered by the user:**
+
+- [ ] RPC URL provided or a fallback agreed upon (for any on-chain or tx-building step)
+- [ ] **Signer wallet** public key (fee payer / crank caller)
+- [ ] Framework confirmed (Next.js, Express, CLI scripts only, other)
+- [ ] Coin mint address provided
+- [ ] Operation type confirmed: inspect fee destination, collect (crank) fee, distribute shared fees, check distributable amount, or create/update sharing config
+
+You MUST ask the user for ALL unchecked items in your very first response. Do not assume defaults. Do not proceed until the user has explicitly answered each one.
+
+## API (preferred) — `https://fun-block.pump.fun`
+
+Use the API to build fee transactions instead of running scripts directly. The API handles account resolution, sharing config detection, and graduation status automatically.
+
+### `POST /agents/collect-fees`
+
+Builds a transaction to collect or distribute creator fees. Automatically detects whether the coin uses a sharing config and builds the appropriate transaction (collect for direct creator, distribute for sharing config).
+
+**Request body:**
+
+```json
+{
+ "mint": "<TOKEN_MINT>",
+ "user": "<PUBKEY>",
+ "frontRunningProtection": false,
+ "tipAmount": 0,
+ "encoding": "base64"
+}
+```
+
+Only `mint` and `user` are required.
+
+> **`tipAmount`** is a Jito tip in **SOL** (e.g. `0.0001` for 100,000 lamports). Only relevant when `frontRunningProtection` is `true`.
+
+> **Encoding:** The API defaults to `"base58"` encoding. **Always pass `"encoding": "base64"`** in the request body — scripts already output base64. When sending the signed transaction to an RPC or Jito endpoint, the encoding used to serialize the transaction must match the `encoding` parameter passed in the send call. Mismatched encodings will cause transaction failures. **Always** explicitly pass `encoding: "base64"` in `sendTransaction` / `simulateTransaction` RPC calls — never rely on the RPC's default.
+
+**Response:**
+
+```json
+{
+ "transaction": "<base64-encoded VersionedTransaction>",
+ "creator": "<base58 creator address>",
+ "isGraduated": true,
+ "usesSharingConfig": false
+}
+```
+
+### `POST /agents/sharing-config`
+
+Builds a transaction to create or update a fee sharing config for a coin. Auto-detects create vs update mode based on on-chain state.
+
+**Request body:**
+
+```json
+{
+ "mint": "<TOKEN_MINT>",
+ "user": "<PUBKEY>",
+ "shareholders": [
+ { "address": "<PUBKEY>", "bps": 5000 },
+ { "address": "<PUBKEY>", "bps": 5000 }
+ ],
+ "mode": "create",
+ "frontRunningProtection": false,
+ "tipAmount": 0,
+ "encoding": "base64"
+}
+```
+
+Only `mint`, `user`, and `shareholders` are required. `mode` is auto-detected if omitted. `bps` values must total exactly 10,000 (100%). Maximum 10 shareholders.
+
+> **`tipAmount`** is a Jito tip in **SOL** (e.g. `0.0001` for 100,000 lamports). Only relevant when `frontRunningProtection` is `true`.
+
+**Response:**
+
+```json
+{
+ "transaction": "<base64-encoded VersionedTransaction>",
+ "mode": "create",
+ "sharingConfigAddress": "<base58>",
+ "shareholderCount": 2,
+ "shareholders": [{ "address": "<base58>", "bps": 5000 }, { "address": "<base58>", "bps": 5000 }],
+ "isGraduated": true
+}
+```
+
+## Runnable examples (Node scripts — only when user explicitly requests)
+
+Use **`{baseDir}`** as the path to this skill folder (OpenClaw and Agent Skills clients often expose this placeholder).
+
+```bash
+cd {baseDir}
+npm install
+export SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+```
+
+| Operation | Script | Example |
+| --------- | ------ | ------- |
+| Fetch coin state (HTTP) | `scripts/fetch-coin.mjs` | `node scripts/fetch-coin.mjs --mint <MINT> --subset` |
+| Inspect fee destination & vault balances | `scripts/fetch-fee-info.mjs` | `node scripts/fetch-fee-info.mjs --mint <MINT>` |
+| Collect creator fee (direct, no sharing) | `scripts/build-collect-fee-tx.mjs` | `node scripts/build-collect-fee-tx.mjs --mint <MINT> --user <PUBKEY>` |
+| Distribute shared fees (sharing config) | `scripts/build-distribute-fees-tx.mjs` | `node scripts/build-distribute-fees-tx.mjs --mint <MINT> --user <PUBKEY>` |
+| Check distributable amounts (simulation) | `scripts/fetch-distributable-info.mjs` | `node scripts/fetch-distributable-info.mjs --mint <MINT>` |
+| Create or update sharing config | `scripts/build-sharing-config-tx.mjs` | `node scripts/build-sharing-config-tx.mjs --mint <MINT> --user <PUBKEY> --shareholders '<JSON>'` |
+
+- Run any script with `--help` for full flags (`--compute-units`, `--priority-micro-lamports`, `--front-runner-protection`, `--tip-sol`, etc.).
+- Tx builders print **one JSON object** on stdout with `transaction` (base64-encoded VersionedTransaction). **Never** pass end-user private keys into these scripts.
+- **OpenClaw:** If YAML `metadata` ever fails to parse, collapse `metadata` to a single-line JSON object per [OpenClaw skills](https://docs.openclaw.ai/skills/); optional `metadata.openclaw.requires.env: ["SOLANA_RPC_URL"]` can gate load-time eligibility.
+
+## Safety Rules
+
+- **NEVER** log, print, or return private keys or secret key material.
+- **NEVER** sign transactions on behalf of a user — scripts build txs; the user (or their wallet) co-signs and sends.
+- Always validate that addresses are valid base58 public keys before building instructions.
+- Use the correct decimal precision: **9 decimals for SOL** (1 SOL = 1,000,000,000 lamports), **6 decimals for pump tokens**.
+- **NEVER trust `token_program` from the HTTP API** (`coins-v2`). Always fetch the mint account on-chain via `connection.getAccountInfo(mint)` and use `.owner` to determine the correct token program (SPL Token or Token-2022).
+- **Verify imports:** use `@pump-fun/pump-sdk` / `@pump-fun/pump-swap-sdk` (not internal monorepo paths). In TypeScript apps, `BN` from `bn.js` matches what the SDKs expect (Anchor `BN` is the same type in practice).
+
+## Program IDs
+
+| Program | ID |
+| --------- | ---------------------------------------------- |
+| Pump | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` |
+| Pump AMM | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` |
+| Pump Fees | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` |
+
+## Environment Variables
+
+```env
+SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+NEXT_PUBLIC_SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+```
+
+The default public mainnet RPC (`https://api.mainnet-beta.solana.com`) often **cannot send** transactions. Confirm an HTTPS RPC with the user. Examples: Solana Tracker public RPC, Ankr `https://rpc.ankr.com/solana`.
+
+## Install
+
+**Inside this skill folder** (includes scripts):
+
+```bash
+cd {baseDir}
+npm install
+```
+
+**Inside another app** (from scratch):
+
+```bash
+npm install @pump-fun/pump-sdk @pump-fun/pump-swap-sdk @solana/web3.js@^1.98.0 @solana/spl-token bn.js
+```
+
+Check `npm info @pump-fun/pump-sdk dependencies` and align `@solana/web3.js` / `@solana/spl-token` versions to avoid duplicate incompatible copies.
+
+## SDK setup (minimal)
+
+```typescript
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ isCreatorUsingSharingConfig,
+ creatorVaultPda,
+ feeSharingConfigPda,
+ canonicalPumpPoolPda,
+ bondingCurvePda,
+} from "@pump-fun/pump-sdk";
+import {
+ OnlinePumpAmmSdk,
+ coinCreatorVaultAuthorityPda,
+ coinCreatorVaultAtaPda,
+ getPumpAmmProgram,
+} from "@pump-fun/pump-swap-sdk";
+import { Connection, PublicKey } from "@solana/web3.js";
+import { NATIVE_MINT, TOKEN_PROGRAM_ID } from "@solana/spl-token";
+
+const connection = new Connection(process.env.SOLANA_RPC_URL!);
+const onlinePump = new OnlinePumpSdk(connection);
+```
+
+Full transaction building (compute budget, blockhash, partial sign) is implemented in `scripts/lib/tx-build.mjs` and `scripts/lib/compute.mjs`.
+
+## Fee destination logic
+
+When an agent needs to understand where creator fees go for a coin, follow this decision tree:
+
+```text
+1. Fetch bonding curve + check for pool (graduated?)
+2. Read isCashbackCoin from pool (if graduated) or bonding curve (if not)
+ ├─ isCashbackCoin === true
+ │ → Fees go to TRADERS as cashback (via userVolumeAccumulator)
+ │ → No creator vault — fees are returned to traders as trading cashback
+ │ → Use `POST /agents/collect-fees` with the user's wallet to claim their cashback
+ │ → Claims from pump program; also claims from pump AMM (with WSOL unwrap) if graduated
+ │
+ └─ isCashbackCoin === false
+ 3. Check isCreatorUsingSharingConfig({ mint, creator })
+ ├─ true → Fees go to SHARING CONFIG SHAREHOLDERS
+ │ → Load feeSharingConfigPda(mint) → decodeSharingConfig
+ │ → Lists shareholders with address + BPS shares
+ │ → The pool/bonding curve creator == feeSharingConfigPda(mint) when migrated
+ │ → Use `POST /agents/collect-fees` to distribute; only use build-distribute-fees-tx.mjs if the user explicitly requests scripts
+ │
+ └─ false → Fees go to COIN CREATOR directly
+ → Creator = pool.coinCreator (graduated) or bondingCurve.creator
+ → Creator vault = creatorVaultPda(creator)
+ → Use `POST /agents/collect-fees` to collect; only use build-collect-fee-tx.mjs if the user explicitly requests scripts
+```
+
+Script: `fetch-fee-info.mjs` resolves this entire tree and outputs the destination.
+
+## PDAs and accounts
+
+| PDA | Seed | Program |
+| --- | ---- | ------- |
+| `creatorVaultPda(creator)` | `"creator-vault" + creator` | Pump |
+| `feeSharingConfigPda(mint)` | `"sharing-config" + mint` | Pump Fees |
+| `coinCreatorVaultAuthorityPda(creator)` | AMM-derived | Pump AMM |
+| `coinCreatorVaultAtaPda(authority, NATIVE_MINT)` | ATA | SPL Token |
+| `canonicalPumpPoolPda(mint)` | Pool PDA | Pump AMM |
+| `bondingCurvePda(mint)` | `"bonding-curve" + mint` | Pump |
+
+## Vault balance calculation
+
+Creator fee vault balance is the sum of two sources:
+
+1. **Pump creator vault** (native SOL): `creatorVaultPda(creator)` lamports minus rent exemption (890,880 lamports)
+2. **AMM creator vault** (WSOL token account): `coinCreatorVaultAtaPda(coinCreatorVaultAuthorityPda(creator), NATIVE_MINT)` token balance
+
+Total available = (1) + (2)
+
+When a sharing config exists, `creator` is `feeSharingConfigPda(mint)` (the sharing config PDA address).
+
+## Collecting fees (no sharing config)
+
+- **Script:** `scripts/build-collect-fee-tx.mjs`
+- Uses `OnlinePumpSdk.collectCoinCreatorFeeInstructions(creator, payer)`
+- This calls both:
+ 1. Pump program `collectCreatorFee` — moves SOL from `creatorVaultPda(creator)` to creator wallet
+ 2. Pump AMM `collectCoinCreatorFee` — moves WSOL from AMM vault to creator's WSOL ATA (creates ATA if needed)
+- **Permissionless** — anyone can call this to trigger fee collection to the creator
+
+### Parameters (`build-collect-fee-tx.mjs`)
+
+| Parameter | Type | Description |
+| --------- | ---- | ----------- |
+| `--mint` | `PUBKEY` | Coin mint address |
+| `--user` | `PUBKEY` | Transaction fee payer |
+| `--creator` | `PUBKEY` | (Optional) Creator to collect for; auto-derived from on-chain state if omitted |
+| `--compute-units` | `int` | Override compute unit limit |
+| `--priority-micro-lamports` | `int` | Override priority fee |
+| `--front-runner-protection` | flag | Add Jito tip; send ONLY to Jito endpoints |
+| `--tip-sol` | `float` | Jito tip in SOL (default 0.0001) |
+
+## Distributing fees (with sharing config)
+
+- **Script:** `scripts/build-distribute-fees-tx.mjs`
+- For **graduated** coins (pool exists):
+ 1. Create WSOL ATA for sharing config authority (idempotent)
+ 2. `transferCreatorFeesToPump()` — AMM program moves WSOL from AMM vault to pump creator vault
+ 3. `PUMP_SDK.distributeCreatorFees({ mint, sharingConfig, sharingConfigAddress })` — splits vault balance to shareholders
+- For **ungraduated** coins (bonding curve only):
+ 1. `PUMP_SDK.distributeCreatorFees(...)` only
+- **Permissionless** — anyone can trigger distribution
+
+### Parameters (`build-distribute-fees-tx.mjs`)
+
+| Parameter | Type | Description |
+| --------- | ---- | ----------- |
+| `--mint` | `PUBKEY` | Coin mint address |
+| `--user` | `PUBKEY` | Transaction fee payer |
+| `--compute-units` | `int` | Override compute unit limit |
+| `--priority-micro-lamports` | `int` | Override priority fee |
+| `--front-runner-protection` | flag | Add Jito tip; send ONLY to Jito endpoints |
+| `--tip-sol` | `float` | Jito tip in SOL (default 0.0001) |
+
+## Creating or updating a sharing config
+
+- **Script:** `scripts/build-sharing-config-tx.mjs`
+- **Create mode:** Sets up a new fee sharing config for a coin. The coin creator must sign.
+ 1. `PUMP_SDK.createFeeSharingConfig({ creator, mint, pool })` — initializes config
+ 2. `PUMP_SDK.updateFeeShares(...)` — sets the desired shareholder split
+- **Update mode:** Modifies shareholders on an existing config. The admin must sign.
+ 1. `PUMP_SDK.updateFeeShares({ authority, mint, currentShareholders, newShareholders })` — updates split
+- Auto-detects create vs update from on-chain state; use `--mode` to force.
+- **Important:** Reward split updates are effectively one-time. Once updated, the config may no longer be editable (depending on version and admin revocation status). Verify the final split before submitting.
+- Shareholders are passed as a JSON array: `[{"address":"<PUBKEY>","bps":5000},...]`
+- `bps` = basis points (1 bps = 0.01%). Total must equal exactly 10,000 (100%).
+- Maximum 10 shareholders. No duplicate addresses.
+
+### Parameters (`build-sharing-config-tx.mjs`)
+
+| Parameter | Type | Description |
+| --------- | ---- | ----------- |
+| `--mint` | `PUBKEY` | Coin mint address |
+| `--user` | `PUBKEY` | Fee payer (creator for create, admin for update) |
+| `--shareholders` | `JSON` | JSON array of `{"address":"<PUBKEY>","bps":<int>}` objects |
+| `--mode` | `create\|update` | (Optional) Force create or update; auto-detected if omitted |
+| `--compute-units` | `int` | Override compute unit limit |
+| `--priority-micro-lamports` | `int` | Override priority fee |
+| `--front-runner-protection` | flag | Add Jito tip; send ONLY to Jito endpoints |
+| `--tip-sol` | `float` | Jito tip in SOL (default 0.0001) |
+
+## Checking distributable amounts
+
+- **Script:** `scripts/fetch-distributable-info.mjs`
+- Simulation-only: does NOT send a transaction
+- Uses `PUMP_SDK.getMinimumDistributableFee` via `simulateTransaction`
+- Returns decoded result: `minimumRequired`, `distributableFees`, `canDistribute`
+- Also reads vault balances (pump + AMM sides) and graduation status
+
+## Compute units and priority fees
+
+Defaults match the pump.fun app constants (see `scripts/lib/constants.mjs` in this skill):
+
+| Operation | Default compute units |
+| --------- | --------------------- |
+| Collect fee (direct creator) | **200_000** |
+| Distribute fees (sharing config) | **200_000** |
+
+Scripts accept `--compute-units` to override.
+
+**Priority fee:** If `--priority-micro-lamports` is omitted, scripts call Solana JSON-RPC `getPriorityFeeEstimate` on a draft serialized transaction (with a 100k microlamport floor and an upper cap — see `scripts/lib/compute.mjs`). Many RPCs support this; if not, the floor is used.
+
+## Transaction assembly and send
+
+After the user wallet signs, choose the send path based on whether `frontRunnerProtection` is `true` in the script output JSON.
+
+### Default (no front-runner protection)
+
+```typescript
+const signature = await connection.sendRawTransaction(
+ signedTransaction.serialize(),
+ { skipPreflight: false, preflightCommitment: "confirmed" },
+);
+const latestBlockhash = await connection.getLatestBlockhash("confirmed");
+await connection.confirmTransaction(
+ { signature, ...latestBlockhash },
+ "confirmed",
+);
+```
+
+### With front-runner protection (Jito only)
+
+When the transaction was built with `--front-runner-protection`, it already contains a Jito tip instruction. Send it **only** to Jito block engine endpoints — do **not** send via `connection.sendRawTransaction` or any other RPC, as that would leak the transaction to the public mempool and defeat the protection.
+
+```typescript
+import { sendTransactionToJito } from "./lib/jito.mjs";
+
+const txBase64 = Buffer.from(signedTransaction.serialize()).toString("base64");
+const result = await sendTransactionToJito(txBase64);
+```
+
+Or manually via `fetch` (no dependency on the lib):
+
+```typescript
+const JITO_ENDPOINTS = [
+ "https://mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions",
+];
+
+const txBase64 = Buffer.from(signedTransaction.serialize()).toString("base64");
+const body = JSON.stringify({
+ jsonrpc: "2.0", id: 1, method: "sendTransaction",
+ params: [txBase64, { encoding: "base64" }],
+});
+
+await Promise.any(
+ JITO_ENDPOINTS.map((url) =>
+ fetch(url, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ }).then((r) => r.json()),
+ ),
+);
+```
+
+Then confirm as usual with `connection.confirmTransaction`.
+
+## Get coin data (HTTP)
+
+`GET https://frontend-api-v3.pump.fun/coins-v2/{mint}`
+
+> **CORS-protected:** `frontend-api-v3.pump.fun` does not allow browser-origin requests. When building a web application, always call this endpoint from your backend/server and proxy the result to the frontend. Do not call it directly from client-side JavaScript.
+
+```json
+{
+ "mint": "ABcDeFgHiJkLmNoPqRsTuVwXyZ123456789abcdefg",
+ "name": "MyToken",
+ "symbol": "MTK",
+ "description": "A sample token on pump.fun",
+ "image_uri": "https://ipfs.io/ipfs/Qm...",
+ "metadata_uri": "https://ipfs.io/ipfs/Qm...",
+ "creator": "CreatorWalletAddress...",
+ "created_timestamp": 1700000000,
+ "complete": false,
+ "bonding_curve": "BondingCurveAddress...",
+ "associated_bonding_curve": "AssociatedBondingCurveAddress...",
+ "pump_swap_pool": null,
+ "token_program": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
+ "market_cap": 25000000000,
+ "usd_market_cap": 50000,
+ "virtual_sol_reserves": "30000000000",
+ "virtual_token_reserves": "1073000000000000",
+ "total_supply": "1000000000000000",
+ "raydium_pool": "",
+ "program": "pump",
+ "reply_count": 42,
+ "last_trade_timestamp": 1700086400
+}
+```
+
+> **NEVER trust `token_program` from the HTTP API.** The `coins-v2` endpoint may return a stale or incorrect `token_program`. Always resolve it on-chain by fetching the mint account and reading its owner:
+>
+> ```typescript
+> const mintAccountInfo = await connection.getAccountInfo(mintPublicKey);
+> const tokenProgram = mintAccountInfo.owner; // TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID
+> ```
+>
+> The skill scripts already do this via `tokenProgramIdFromMint()` in `scripts/lib/coin-resolve.mjs`. Any custom integration **must** do the same.
+
+## Error handling and troubleshooting
+
+- **Cashback coin** — `isCashbackCoin === true`: no creator vault, but users can claim their trading cashback via `POST /agents/collect-fees`. The endpoint builds a transaction that claims from the pump program, and also from the pump AMM (with WSOL unwrapping) if the coin has graduated. `fetch-fee-info.mjs` returns `feeDestination: "cashback"`.
+- **Sharing config not active** — the account at `feeSharingConfigPda(mint)` may not exist or may be in a non-active state; `fetch-fee-info.mjs` will report `hasSharingConfig: false`.
+- **Vault below minimum distributable threshold** — `fetch-distributable-info.mjs` returns `canDistribute: false` and shows `minimumRequired` vs actual balance.
+- **Bonding curve account missing** — wrong mint, wrong network, or uninitialized coin.
+- **Pool not found (not graduated)** — coin is still on bonding curve; AMM-side fees do not exist yet.
+- **RPC errors** — rate limits, missing `getPriorityFeeEstimate`, or send blocked; try another RPC; pass `--priority-micro-lamports` explicitly.
+
+## End-to-end flow
+
+1. Confirm coin mint address, signer wallet, and operation type; set `SOLANA_RPC_URL`.
+2. Run `fetch-fee-info.mjs --mint <MINT>` to inspect fee destination (`cashback`, `sharing_config`, or `creator`), vault balances, and sharing config shareholders if applicable.
+3. Based on `feeDestination`:
+ - `"cashback"` → Use `POST /agents/collect-fees` with the user's wallet to claim their trading cashback (claims from pump program + pump AMM if graduated).
+ - `"creator"` → Use `POST /agents/collect-fees` to build a crank transaction. Only use `build-collect-fee-tx.mjs` if the user explicitly requests scripts.
+ - `"sharing_config"` → Use `POST /agents/collect-fees` to distribute. Only use `fetch-distributable-info.mjs` and `build-distribute-fees-tx.mjs` if the user explicitly requests scripts.
+ - To **create or update** a sharing config → Use `POST /agents/sharing-config`. Only use `build-sharing-config-tx.mjs` if the user explicitly requests scripts.
+4. Capture `transaction` from the script output.
+5. Deserialize with `@solana/web3.js` `VersionedTransaction.deserialize`, have user sign.
+6. **Send the transaction:** If `frontRunnerProtection` is `true` in the script output JSON, send **only** to Jito endpoints (see "Transaction assembly and send" above). Otherwise use `sendRawTransaction` + `confirmTransaction`.
diff --git a/pump-fun-skills/coin-fees/package-lock.json b/pump-fun-skills/coin-fees/package-lock.json
new file mode 100644
index 000000000..a0af2f405
--- /dev/null
+++ b/pump-fun-skills/coin-fees/package-lock.json
@@ -0,0 +1,1062 @@
+{
+ "name": "@pump-fun-skills/coin-fees",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@pump-fun-skills/coin-fees",
+ "version": "1.0.0",
+ "dependencies": {
+ "@pump-fun/pump-sdk": "^1.31.0",
+ "@pump-fun/pump-swap-sdk": "^1.14.1",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.29.2",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
+ "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@coral-xyz/anchor": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.31.1.tgz",
+ "integrity": "sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "node_modules/@coral-xyz/anchor-errors": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.31.1.tgz",
+ "integrity": "sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@coral-xyz/borsh": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.31.1.tgz",
+ "integrity": "sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.1.2",
+ "buffer-layout": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.69.0"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@pump-fun/pump-sdk": {
+ "version": "1.32.0",
+ "resolved": "https://registry.npmjs.org/@pump-fun/pump-sdk/-/pump-sdk-1.32.0.tgz",
+ "integrity": "sha512-ptqaz119m80w9ICjFFQLMO6WJw4DSZacj5Gzi4nSZEDlf7mLbgj5RbPzGZ3Eud+s+mTFVxJmztPjFVr/hpDI+Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@pump-fun/pump-swap-sdk": "^1.13.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2",
+ "undici-types": "^6.20.0"
+ }
+ },
+ "node_modules/@pump-fun/pump-swap-sdk": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/@pump-fun/pump-swap-sdk/-/pump-swap-sdk-1.14.1.tgz",
+ "integrity": "sha512-U3vFL1Plhl/sBYUAHQhrFkmzXLxJp/gmuqHDn+odgwC1cRj15DJLVlRxnksGBMnf8dlScX9I+DdVng6rGbUnzg==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@solana/spl-token": "^0.4.9",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2",
+ "bs58": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@pump-fun/pump-swap-sdk/node_modules/base-x": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz",
+ "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==",
+ "license": "MIT"
+ },
+ "node_modules/@pump-fun/pump-swap-sdk/node_modules/bs58": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz",
+ "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^5.0.0"
+ }
+ },
+ "node_modules/@solana/buffer-layout": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz",
+ "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer": "~6.0.3"
+ },
+ "engines": {
+ "node": ">=5.10"
+ }
+ },
+ "node_modules/@solana/buffer-layout-utils": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz",
+ "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/web3.js": "^1.32.0",
+ "bigint-buffer": "^1.1.5",
+ "bignumber.js": "^9.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@solana/codecs": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-rc.1.tgz",
+ "integrity": "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/options": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-core": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz",
+ "integrity": "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-data-structures": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz",
+ "integrity": "sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-numbers": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz",
+ "integrity": "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-strings": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz",
+ "integrity": "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "fastestsmallesttextencoderdecoder": "^1.0.22",
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/errors": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-rc.1.tgz",
+ "integrity": "sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "commander": "^12.1.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/options": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-rc.1.tgz",
+ "integrity": "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/spl-token": {
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.14.tgz",
+ "integrity": "sha512-u09zr96UBpX4U685MnvQsNzlvw9TiY005hk1vJmJr7gMJldoPG1eYU5/wNEyOA5lkMLiR/gOi9SFD4MefOYEsA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/buffer-layout-utils": "^0.2.0",
+ "@solana/spl-token-group": "^0.0.7",
+ "@solana/spl-token-metadata": "^0.1.6",
+ "buffer": "^6.0.3"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.5"
+ }
+ },
+ "node_modules/@solana/spl-token-group": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz",
+ "integrity": "sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/spl-token-metadata": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz",
+ "integrity": "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/web3.js": {
+ "version": "1.98.4",
+ "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.4.tgz",
+ "integrity": "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==",
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/runtime": "^7.25.0",
+ "@noble/curves": "^1.4.2",
+ "@noble/hashes": "^1.4.0",
+ "@solana/buffer-layout": "^4.0.1",
+ "@solana/codecs-numbers": "^2.1.0",
+ "agentkeepalive": "^4.5.0",
+ "bn.js": "^5.2.1",
+ "borsh": "^0.7.0",
+ "bs58": "^4.0.1",
+ "buffer": "6.0.3",
+ "fast-stable-stringify": "^1.0.0",
+ "jayson": "^4.1.1",
+ "node-fetch": "^2.7.0",
+ "rpc-websockets": "^9.0.2",
+ "superstruct": "^2.0.2"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-core": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.3.0.tgz",
+ "integrity": "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-numbers": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.3.0.tgz",
+ "integrity": "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.3.0",
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/errors": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.3.0.tgz",
+ "integrity": "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.4.1",
+ "commander": "^14.0.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/superstruct": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz",
+ "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@swc/helpers": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.21.tgz",
+ "integrity": "sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/@types/connect": {
+ "version": "3.4.38",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
+ "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "12.20.55",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
+ "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/uuid": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
+ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/ws": {
+ "version": "7.4.7",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
+ "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/agentkeepalive": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",
+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "humanize-ms": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/bigint-buffer": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz",
+ "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==",
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bindings": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/bignumber.js": {
+ "version": "9.3.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
+ "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
+ "node_modules/bn.js": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz",
+ "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==",
+ "license": "MIT"
+ },
+ "node_modules/borsh": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz",
+ "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.2.0",
+ "bs58": "^4.0.0",
+ "text-encoding-utf-8": "^1.0.2"
+ }
+ },
+ "node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
+ "node_modules/buffer-layout": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz",
+ "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.5"
+ }
+ },
+ "node_modules/bufferutil": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz",
+ "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/commander": {
+ "version": "12.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
+ "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/cross-fetch": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz",
+ "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==",
+ "license": "MIT",
+ "dependencies": {
+ "node-fetch": "^2.7.0"
+ }
+ },
+ "node_modules/delay": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
+ "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/es6-promise": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
+ "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
+ "license": "MIT"
+ },
+ "node_modules/es6-promisify": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
+ "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es6-promise": "^4.0.3"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "node_modules/eyes": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
+ "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==",
+ "engines": {
+ "node": "> 0.1.90"
+ }
+ },
+ "node_modules/fast-stable-stringify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz",
+ "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==",
+ "license": "MIT"
+ },
+ "node_modules/fastestsmallesttextencoderdecoder": {
+ "version": "1.0.22",
+ "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz",
+ "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==",
+ "license": "CC0-1.0",
+ "peer": true
+ },
+ "node_modules/file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "license": "MIT"
+ },
+ "node_modules/humanize-ms": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.0.0"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/isomorphic-ws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
+ "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
+ "node_modules/jayson": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.3.0.tgz",
+ "integrity": "sha512-AauzHcUcqs8OBnCHOkJY280VaTiCm57AbuO7lqzcw7JapGj50BisE3xhksye4zlTSR1+1tAz67wLTl8tEH1obQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/connect": "^3.4.33",
+ "@types/node": "^12.12.54",
+ "@types/ws": "^7.4.4",
+ "commander": "^2.20.3",
+ "delay": "^5.0.0",
+ "es6-promisify": "^5.0.0",
+ "eyes": "^0.1.8",
+ "isomorphic-ws": "^4.0.1",
+ "json-stringify-safe": "^5.0.1",
+ "stream-json": "^1.9.1",
+ "uuid": "^8.3.2",
+ "ws": "^7.5.10"
+ },
+ "bin": {
+ "jayson": "bin/jayson.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/jayson/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "license": "MIT"
+ },
+ "node_modules/json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
+ "license": "ISC"
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-gyp-build": {
+ "version": "4.8.4",
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
+ "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
+ "license": "MIT",
+ "optional": true,
+ "bin": {
+ "node-gyp-build": "bin.js",
+ "node-gyp-build-optional": "optional.js",
+ "node-gyp-build-test": "build-test.js"
+ }
+ },
+ "node_modules/pako": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
+ "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/rpc-websockets": {
+ "version": "9.3.7",
+ "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.7.tgz",
+ "integrity": "sha512-dQal1U0yKH2umW0DgqSecP4G1jNxyPUGY60uUMB8bLoXabC2aWT3Cag9hOhZXsH/52QJEcggxNNWhF+Fp48ykw==",
+ "license": "LGPL-3.0-only",
+ "dependencies": {
+ "@swc/helpers": "^0.5.11",
+ "@types/uuid": "^10.0.0",
+ "@types/ws": "^8.2.2",
+ "buffer": "^6.0.3",
+ "eventemitter3": "^5.0.1",
+ "uuid": "^11.0.0",
+ "ws": "^8.5.0"
+ },
+ "funding": {
+ "type": "paypal",
+ "url": "https://paypal.me/kozjak"
+ },
+ "optionalDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^6.0.0"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/@types/ws": {
+ "version": "8.18.1",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
+ "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/eventemitter3": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
+ "license": "MIT"
+ },
+ "node_modules/rpc-websockets/node_modules/utf-8-validate": {
+ "version": "6.0.6",
+ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.6.tgz",
+ "integrity": "sha512-q3l3P9UtEEiAHcsgsqTgf9PPjctrDWoIXW3NpOHFdRDbLvu4DLIcxHangJ4RLrWkBcKjmcs/6NkerI8T/rE4LA==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/uuid": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
+ "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/esm/bin/uuid"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/ws": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/stream-chain": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz",
+ "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/stream-json": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz",
+ "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "stream-chain": "^2.2.5"
+ }
+ },
+ "node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
+ "node_modules/text-encoding-utf-8": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz",
+ "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg=="
+ },
+ "node_modules/toml": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
+ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
+ "license": "MIT"
+ },
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
+ "license": "MIT"
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "license": "0BSD"
+ },
+ "node_modules/typescript": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz",
+ "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==",
+ "license": "Apache-2.0",
+ "peer": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.24.1",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.24.1.tgz",
+ "integrity": "sha512-JT8B3M7LYQCRZVfB1OZZIqzi1OMeDHcTpRJpHPNvHFmye4wT03uBM8vw73NqXKfihrpGzSsWlBfUcOglX3oBeA==",
+ "license": "MIT"
+ },
+ "node_modules/utf-8-validate": {
+ "version": "5.0.10",
+ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
+ "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "license": "MIT",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/ws": {
+ "version": "7.5.10",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
+ "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/pump-fun-skills/coin-fees/package.json b/pump-fun-skills/coin-fees/package.json
new file mode 100644
index 000000000..e02c7ecd9
--- /dev/null
+++ b/pump-fun-skills/coin-fees/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "@pump-fun-skills/coin-fees",
+ "private": true,
+ "version": "1.0.0",
+ "type": "module",
+ "description": "Runnable scripts for the pump-fun coin-fees Agent Skill",
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "fetch-coin": "node scripts/fetch-coin.mjs",
+ "fetch-fee-info": "node scripts/fetch-fee-info.mjs",
+ "build-collect-fee-tx": "node scripts/build-collect-fee-tx.mjs",
+ "build-distribute-fees-tx": "node scripts/build-distribute-fees-tx.mjs",
+ "fetch-distributable-info": "node scripts/fetch-distributable-info.mjs"
+ },
+ "dependencies": {
+ "@pump-fun/pump-sdk": "^1.33.0",
+ "@pump-fun/pump-swap-sdk": "^1.15.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2"
+ }
+}
diff --git a/pump-fun-skills/coin-fees/scripts/build-collect-fee-tx.mjs b/pump-fun-skills/coin-fees/scripts/build-collect-fee-tx.mjs
new file mode 100644
index 000000000..4f2bef61a
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/build-collect-fee-tx.mjs
@@ -0,0 +1,174 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/collect-fees
+ *
+ * Build a transaction to collect creator fees (crank) for a coin with no sharing config.
+ * Uses OnlinePumpSdk.collectCoinCreatorFeeInstructions — permissionless.
+ */
+import { parseArgs } from "node:util";
+import {
+ OnlinePumpSdk,
+ bondingCurvePda,
+ canonicalPumpPoolPda,
+ feeSharingConfigPda,
+ isCreatorUsingSharingConfig,
+} from "@pump-fun/pump-sdk";
+import { OnlinePumpAmmSdk } from "@pump-fun/pump-swap-sdk";
+import { PublicKey } from "@solana/web3.js";
+import { getConnection } from "./lib/env.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ printJson,
+ requirePublicKey,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const COLLECT_FEE_DEFAULT_UNITS = 200_000;
+
+const HELP = `Usage: node scripts/build-collect-fee-tx.mjs [options]
+
+Build a transaction to collect creator fees (direct creator, no sharing config).
+
+Required:
+ --mint <PUBKEY>
+ --user <PUBKEY> Fee payer / crank caller
+
+Optional:
+ --creator <PUBKEY> Creator to collect for (auto-derived if omitted)
+ --compute-units <int> Default ${COLLECT_FEE_DEFAULT_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ user: { type: "string" },
+ creator: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-collect-fee-tx.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const user = requirePublicKey("--user", values.user);
+
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], COLLECT_FEE_DEFAULT_UNITS)
+ : COLLECT_FEE_DEFAULT_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const connection = getConnection();
+ const onlineSdk = new OnlinePumpSdk(connection);
+
+ // Resolve creator from on-chain state if not provided
+ let creator;
+ if (values.creator) {
+ creator = requirePublicKey("--creator", values.creator);
+ } else {
+ const bondingCurve = await onlineSdk.fetchBondingCurve(mint);
+ let poolCoinCreator = null;
+
+ const poolPda = canonicalPumpPoolPda(mint);
+ const poolAccountInfo = await connection.getAccountInfo(poolPda);
+ if (poolAccountInfo) {
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ poolCoinCreator = pool.coinCreator;
+ } catch {
+ // Pool not fully initialized
+ }
+ }
+
+ creator = poolCoinCreator ?? new PublicKey(bondingCurve.creator);
+
+ // Check for cashback
+ const bcRaw = bondingCurve;
+ const poolRaw = poolAccountInfo ? poolCoinCreator : null;
+ let isCashbackCoin = false;
+ if (poolAccountInfo && poolCoinCreator) {
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ isCashbackCoin =
+ pool.isCashbackCoin === true ||
+ (typeof pool.is_cashback_coin === "object" &&
+ pool.is_cashback_coin !== null &&
+ pool.is_cashback_coin[0] === true);
+ } catch {
+ // fallback to bonding curve
+ }
+ }
+ if (!isCashbackCoin) {
+ isCashbackCoin =
+ bcRaw.isCashbackCoin === true ||
+ (typeof bcRaw.is_cashback_coin === "object" &&
+ bcRaw.is_cashback_coin !== null &&
+ bcRaw.is_cashback_coin[0] === true);
+ }
+
+ if (isCashbackCoin) {
+ throw new Error(
+ "This is a cashback coin — creator fees are returned to traders. " +
+ "There is no creator vault to collect from.",
+ );
+ }
+
+ // Check for sharing config
+ if (
+ isCreatorUsingSharingConfig({ mint, creator })
+ ) {
+ throw new Error(
+ "This coin uses a fee sharing config. Use build-distribute-fees-tx.mjs instead.",
+ );
+ }
+ }
+
+ const sdkInstructions = await onlineSdk.collectCoinCreatorFeeInstructions(
+ creator,
+ user,
+ );
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ creator: creator.toBase58(),
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/coin-fees/scripts/build-distribute-fees-tx.mjs b/pump-fun-skills/coin-fees/scripts/build-distribute-fees-tx.mjs
new file mode 100644
index 000000000..fb5f53ecd
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/build-distribute-fees-tx.mjs
@@ -0,0 +1,200 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/collect-fees
+ * (The API auto-detects sharing config vs direct collect.)
+ *
+ * Build a transaction to distribute creator fees when a sharing config exists.
+ * If graduated: transferCreatorFeesToPump + distributeCreatorFees.
+ * If not graduated: distributeCreatorFees only.
+ */
+import { parseArgs } from "node:util";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ bondingCurvePda,
+ canonicalPumpPoolPda,
+ feeSharingConfigPda,
+ isCreatorUsingSharingConfig,
+ getPumpAmmProgram,
+} from "@pump-fun/pump-sdk";
+import {
+ OnlinePumpAmmSdk,
+ coinCreatorVaultAuthorityPda,
+ coinCreatorVaultAtaPda,
+} from "@pump-fun/pump-swap-sdk";
+import {
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ createAssociatedTokenAccountIdempotentInstruction,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+} from "@solana/spl-token";
+import { PublicKey } from "@solana/web3.js";
+import { getConnection } from "./lib/env.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ printJson,
+ requirePublicKey,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const DISTRIBUTE_FEE_DEFAULT_UNITS = 200_000;
+
+const HELP = `Usage: node scripts/build-distribute-fees-tx.mjs [options]
+
+Build a transaction to distribute shared creator fees to shareholders.
+Requires the coin to have an active fee sharing config.
+
+Required:
+ --mint <PUBKEY>
+ --user <PUBKEY> Fee payer / crank caller
+
+Optional:
+ --compute-units <int> Default ${DISTRIBUTE_FEE_DEFAULT_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ user: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-distribute-fees-tx.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const user = requirePublicKey("--user", values.user);
+
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], DISTRIBUTE_FEE_DEFAULT_UNITS)
+ : DISTRIBUTE_FEE_DEFAULT_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const connection = getConnection();
+ const onlineSdk = new OnlinePumpSdk(connection);
+
+ // Fetch bonding curve to get creator
+ const bondingCurve = await onlineSdk.fetchBondingCurve(mint);
+
+ // Check pool (graduation status)
+ let poolCoinCreator = null;
+ let isGraduated = false;
+ const poolPda = canonicalPumpPoolPda(mint);
+ const poolAccountInfo = await connection.getAccountInfo(poolPda);
+ if (poolAccountInfo) {
+ isGraduated = true;
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ poolCoinCreator = pool.coinCreator;
+ } catch {
+ // Pool not fully initialized
+ }
+ }
+
+ const effectiveCreator = poolCoinCreator ?? new PublicKey(bondingCurve.creator);
+
+ // Verify sharing config exists
+ if (!isCreatorUsingSharingConfig({ mint, creator: effectiveCreator })) {
+ throw new Error(
+ "This coin does not use a fee sharing config. Use build-collect-fee-tx.mjs instead.",
+ );
+ }
+
+ const sharingConfigAddress = feeSharingConfigPda(mint);
+ const sharingConfigAccountInfo = await connection.getAccountInfo(sharingConfigAddress);
+ if (!sharingConfigAccountInfo) {
+ throw new Error("Sharing config account not found on-chain.");
+ }
+
+ const sharingConfig = PUMP_SDK.decodeSharingConfig(sharingConfigAccountInfo);
+
+ // Build instructions
+ const instructions = [];
+
+ if (isGraduated) {
+ const pumpAmmProgram = getPumpAmmProgram(connection);
+
+ const coinCreatorVaultAuthority = coinCreatorVaultAuthorityPda(sharingConfigAddress);
+ const coinCreatorVaultAta = coinCreatorVaultAtaPda(
+ coinCreatorVaultAuthority,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+ );
+
+ // Create WSOL ATA for sharing config authority if it doesn't exist
+ const createAtaIx = createAssociatedTokenAccountIdempotentInstruction(
+ user,
+ coinCreatorVaultAta,
+ coinCreatorVaultAuthority,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ );
+ instructions.push(createAtaIx);
+
+ // Transfer AMM fees to pump creator vault
+ const transferIx = await pumpAmmProgram.methods
+ .transferCreatorFeesToPump()
+ .accountsPartial({
+ wsolMint: NATIVE_MINT,
+ tokenProgram: TOKEN_PROGRAM_ID,
+ coinCreator: sharingConfigAddress,
+ })
+ .instruction();
+ instructions.push(transferIx);
+ }
+
+ // Distribute creator fees to shareholders
+ const distributeIx = await PUMP_SDK.distributeCreatorFees({
+ mint,
+ sharingConfig,
+ sharingConfigAddress,
+ });
+ instructions.push(distributeIx);
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions: instructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ sharingConfigAddress: sharingConfigAddress.toBase58(),
+ shareholderCount: sharingConfig.shareholders.length,
+ isGraduated,
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/coin-fees/scripts/build-sharing-config-tx.mjs b/pump-fun-skills/coin-fees/scripts/build-sharing-config-tx.mjs
new file mode 100644
index 000000000..c8166d3f1
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/build-sharing-config-tx.mjs
@@ -0,0 +1,319 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/sharing-config
+ *
+ * Build a transaction to create or update a fee sharing config.
+ *
+ * - CREATE: sets up a new sharing config for a coin (creator must sign).
+ * - UPDATE: changes shareholders on an existing config (admin must sign).
+ *
+ * Auto-detects mode based on whether a sharing config already exists on-chain.
+ * Use --mode create|update to force a specific mode.
+ */
+import { parseArgs } from "node:util";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ bondingCurvePda,
+ canonicalPumpPoolPda,
+ feeSharingConfigPda,
+ isCreatorUsingSharingConfig,
+ isSharingConfigEditable,
+} from "@pump-fun/pump-sdk";
+import { OnlinePumpAmmSdk } from "@pump-fun/pump-swap-sdk";
+import { PublicKey } from "@solana/web3.js";
+import { getConnection } from "./lib/env.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ printJson,
+ requirePublicKey,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const DEFAULT_COMPUTE_UNITS = 200_000;
+
+const HELP = `Usage: node scripts/build-sharing-config-tx.mjs [options]
+
+Build a transaction to create or update a fee sharing config for a coin.
+Auto-detects whether to create or update based on on-chain state.
+
+Required:
+ --mint <PUBKEY> Coin mint address
+ --user <PUBKEY> Transaction fee payer (creator for create, admin for update)
+ --shareholders <JSON> JSON array of shareholders:
+ [{"address":"<PUBKEY>","bps":5000},{"address":"<PUBKEY>","bps":5000}]
+ bps = basis points (1 bps = 0.01%, total must = 10000)
+
+Optional:
+ --mode <create|update> Force create or update (auto-detected if omitted)
+ --compute-units <int> Default ${DEFAULT_COMPUTE_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL
+
+Examples:
+ # Create a sharing config (50/50 split between two wallets):
+ node scripts/build-sharing-config-tx.mjs \\
+ --mint <MINT> --user <CREATOR_PUBKEY> \\
+ --shareholders '[{"address":"Wa11et1...","bps":5000},{"address":"Wa11et2...","bps":5000}]'
+
+ # Update shareholders on an existing config:
+ node scripts/build-sharing-config-tx.mjs \\
+ --mint <MINT> --user <ADMIN_PUBKEY> --mode update \\
+ --shareholders '[{"address":"Wa11et1...","bps":7000},{"address":"Wa11et3...","bps":3000}]'`;
+
+/**
+ * Parse and validate the --shareholders JSON argument.
+ * @param {string} raw
+ * @returns {{ address: PublicKey, shareBps: number }[]}
+ */
+function parseShareholders(raw) {
+ let arr;
+ try {
+ arr = JSON.parse(raw);
+ } catch {
+ throw new Error("--shareholders must be valid JSON");
+ }
+
+ if (!Array.isArray(arr) || arr.length === 0) {
+ throw new Error("--shareholders must be a non-empty JSON array");
+ }
+ if (arr.length > 10) {
+ throw new Error("Maximum 10 shareholders allowed");
+ }
+
+ let totalBps = 0;
+ const seen = new Set();
+ const shareholders = arr.map((item, i) => {
+ if (!item.address) {
+ throw new Error(`Shareholder ${i}: missing "address"`);
+ }
+ const bps = Number(item.bps);
+ if (!Number.isFinite(bps) || bps <= 0) {
+ throw new Error(`Shareholder ${i}: "bps" must be a positive number`);
+ }
+
+ let pubkey;
+ try {
+ pubkey = new PublicKey(item.address);
+ } catch {
+ throw new Error(`Shareholder ${i}: invalid public key "${item.address}"`);
+ }
+
+ const key = pubkey.toBase58();
+ if (seen.has(key)) {
+ throw new Error(`Shareholder ${i}: duplicate address "${key}"`);
+ }
+ seen.add(key);
+
+ totalBps += bps;
+ return { address: pubkey, shareBps: bps };
+ });
+
+ if (totalBps !== 10_000) {
+ throw new Error(
+ `Shareholder bps must total exactly 10000 (100%), got ${totalBps}`,
+ );
+ }
+
+ return shareholders;
+}
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ user: { type: "string" },
+ shareholders: { type: "string" },
+ mode: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-sharing-config-tx.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const user = requirePublicKey("--user", values.user);
+
+ if (!values.shareholders) {
+ throw new Error("--shareholders is required (JSON array)");
+ }
+ const newShareholders = parseShareholders(values.shareholders);
+
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], DEFAULT_COMPUTE_UNITS)
+ : DEFAULT_COMPUTE_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ if (values.mode && values.mode !== "create" && values.mode !== "update") {
+ throw new Error('--mode must be "create" or "update"');
+ }
+
+ const connection = getConnection();
+ const onlineSdk = new OnlinePumpSdk(connection);
+
+ // Fetch bonding curve
+ const bondingCurve = await onlineSdk.fetchBondingCurve(mint);
+
+ // Check pool (graduation status)
+ let poolCoinCreator = null;
+ let isGraduated = false;
+ const poolPda = canonicalPumpPoolPda(mint);
+ const poolAccountInfo = await connection.getAccountInfo(poolPda);
+ if (poolAccountInfo) {
+ isGraduated = true;
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ poolCoinCreator = pool.coinCreator;
+ } catch {
+ // Pool not fully initialized
+ }
+ }
+
+ const effectiveCreator = poolCoinCreator ?? new PublicKey(bondingCurve.creator);
+
+ // Check for cashback coin
+ let isCashbackCoin = false;
+ if (poolAccountInfo && poolCoinCreator) {
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ isCashbackCoin =
+ pool.isCashbackCoin === true ||
+ (typeof pool.is_cashback_coin === "object" &&
+ pool.is_cashback_coin !== null &&
+ pool.is_cashback_coin[0] === true);
+ } catch {
+ // fallback to bonding curve
+ }
+ }
+ if (!isCashbackCoin) {
+ const bcRaw = bondingCurve;
+ isCashbackCoin =
+ bcRaw.isCashbackCoin === true ||
+ (typeof bcRaw.is_cashback_coin === "object" &&
+ bcRaw.is_cashback_coin !== null &&
+ bcRaw.is_cashback_coin[0] === true);
+ }
+
+ if (isCashbackCoin) {
+ throw new Error(
+ "This is a cashback coin — creator fees are returned to traders. " +
+ "Fee sharing config cannot be created for cashback coins.",
+ );
+ }
+
+ // Detect mode
+ const configExists = isCreatorUsingSharingConfig({ mint, creator: effectiveCreator });
+ let mode = values.mode ?? (configExists ? "update" : "create");
+
+ if (mode === "create" && configExists) {
+ throw new Error(
+ "A sharing config already exists for this coin. Use --mode update to modify shareholders.",
+ );
+ }
+ if (mode === "update" && !configExists) {
+ throw new Error(
+ "No sharing config exists for this coin. Use --mode create (or omit --mode) to create one.",
+ );
+ }
+
+ const instructions = [];
+
+ if (mode === "create") {
+ // Create sharing config — creator must sign
+ const createIx = await PUMP_SDK.createFeeSharingConfig({
+ creator: effectiveCreator,
+ mint,
+ pool: isGraduated ? poolPda : null,
+ });
+ instructions.push(createIx);
+
+ // Immediately update fee shares to set shareholders
+ // After creation, the only shareholder is the creator with 100%.
+ // We need to update to the desired split.
+ const updateIx = await PUMP_SDK.updateFeeShares({
+ authority: effectiveCreator,
+ mint,
+ currentShareholders: [effectiveCreator],
+ newShareholders,
+ });
+ instructions.push(updateIx);
+ } else {
+ // Update existing config
+ const sharingConfigAddress = feeSharingConfigPda(mint);
+ const sharingConfigAccountInfo = await connection.getAccountInfo(sharingConfigAddress);
+ if (!sharingConfigAccountInfo) {
+ throw new Error("Sharing config account not found on-chain.");
+ }
+
+ const sharingConfig = PUMP_SDK.decodeSharingConfig(sharingConfigAccountInfo);
+
+ if (!isSharingConfigEditable({ sharingConfig })) {
+ throw new Error(
+ "This sharing config is no longer editable (admin revoked or already updated).",
+ );
+ }
+
+ const currentShareholders = sharingConfig.shareholders.map((s) => s.address);
+
+ const updateIx = await PUMP_SDK.updateFeeShares({
+ authority: user,
+ mint,
+ currentShareholders,
+ newShareholders,
+ });
+ instructions.push(updateIx);
+ }
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions: instructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ const sharingConfigAddress = feeSharingConfigPda(mint);
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ mode,
+ sharingConfigAddress: sharingConfigAddress.toBase58(),
+ shareholderCount: newShareholders.length,
+ shareholders: newShareholders.map((s) => ({
+ address: s.address.toBase58(),
+ bps: s.shareBps,
+ percent: `${(s.shareBps / 100).toFixed(2)}%`,
+ })),
+ isGraduated,
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/coin-fees/scripts/fetch-coin.mjs b/pump-fun-skills/coin-fees/scripts/fetch-coin.mjs
new file mode 100644
index 000000000..7576bd057
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/fetch-coin.mjs
@@ -0,0 +1,58 @@
+#!/usr/bin/env node
+/**
+ * Fetch coin metadata and state flags from pump.fun HTTP API (no RPC).
+ */
+import { parseArgs } from "node:util";
+import { fetchCoinV2 } from "./lib/coin-api.mjs";
+import {
+ exitWithHelp,
+ printJson,
+ requireString,
+} from "./lib/args.mjs";
+
+const HELP = `Usage: node scripts/fetch-coin.mjs --mint <MINT> [--subset]
+
+GET https://frontend-api-v3.pump.fun/coins-v2/{mint}
+
+Options:
+ --mint Coin mint (base58)
+ --subset Only print complete, pump_swap_pool, token_program, bonding_curve
+ -h, --help Show help
+
+Environment:
+ (none — uses public pump.fun API)`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ subset: { type: "boolean", default: false },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("fetch-coin.mjs", HELP);
+
+ const mint = requireString("--mint", values.mint);
+ const coin = await fetchCoinV2(mint);
+
+ if (values.subset) {
+ printJson({
+ complete: coin.complete,
+ pump_swap_pool: coin.pump_swap_pool ?? null,
+ token_program: coin.token_program ?? null,
+ bonding_curve: coin.bonding_curve ?? null,
+ });
+ return;
+ }
+
+ printJson(coin);
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/coin-fees/scripts/fetch-distributable-info.mjs b/pump-fun-skills/coin-fees/scripts/fetch-distributable-info.mjs
new file mode 100644
index 000000000..f7e0b0729
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/fetch-distributable-info.mjs
@@ -0,0 +1,234 @@
+#!/usr/bin/env node
+/**
+ * Simulate getMinimumDistributableFee for a coin with a sharing config.
+ * Returns vault balances, minimum required, distributable amount, and whether
+ * distribution can proceed. Does NOT send a transaction.
+ */
+import { parseArgs } from "node:util";
+import BN from "bn.js";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ bondingCurvePda,
+ canonicalPumpPoolPda,
+ creatorVaultPda,
+ feeSharingConfigPda,
+ isCreatorUsingSharingConfig,
+ getPumpAmmProgram,
+} from "@pump-fun/pump-sdk";
+import {
+ OnlinePumpAmmSdk,
+ coinCreatorVaultAuthorityPda,
+ coinCreatorVaultAtaPda,
+} from "@pump-fun/pump-swap-sdk";
+import {
+ AccountLayout,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ createAssociatedTokenAccountIdempotentInstruction,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+} from "@solana/spl-token";
+import {
+ PublicKey,
+ TransactionMessage,
+ VersionedTransaction,
+} from "@solana/web3.js";
+import { getConnection } from "./lib/env.mjs";
+import {
+ exitWithHelp,
+ printJson,
+ requirePublicKey,
+} from "./lib/args.mjs";
+
+const HELP = `Usage: node scripts/fetch-distributable-info.mjs --mint <MINT>
+
+Simulate fee distribution to check vault balances, minimum threshold, and
+whether distribution can proceed. Requires an active sharing config.
+
+Required:
+ --mint <PUBKEY> Coin mint address
+
+Optional:
+ -h, --help Show help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+// Funded signer for simulation (must exist on both devnet and mainnet)
+const SIMULATION_SIGNER = new PublicKey(
+ "Gygj9QQby4j2jryqyqBHvLP7ctv2SaANgh4sCb69BUpA",
+);
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("fetch-distributable-info.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const connection = getConnection();
+ const onlineSdk = new OnlinePumpSdk(connection);
+
+ // Fetch bonding curve
+ const bondingCurve = await onlineSdk.fetchBondingCurve(mint);
+
+ // Check pool
+ let poolCoinCreator = null;
+ const poolPda = canonicalPumpPoolPda(mint);
+ const poolAccountInfo = await connection.getAccountInfo(poolPda);
+ const isGraduated = poolAccountInfo !== null;
+ if (poolAccountInfo) {
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ poolCoinCreator = pool.coinCreator;
+ } catch {
+ // Pool not fully initialized
+ }
+ }
+
+ const effectiveCreator = poolCoinCreator ?? new PublicKey(bondingCurve.creator);
+
+ // Verify sharing config
+ if (!isCreatorUsingSharingConfig({ mint, creator: effectiveCreator })) {
+ throw new Error(
+ "This coin does not use a fee sharing config. " +
+ "Distributable info is only available for coins with sharing configs.",
+ );
+ }
+
+ const sharingConfigAddress = feeSharingConfigPda(mint);
+ const sharingConfigAccountInfo = await connection.getAccountInfo(sharingConfigAddress);
+ if (!sharingConfigAccountInfo) {
+ throw new Error("Sharing config account not found on-chain.");
+ }
+
+ const sharingConfig = PUMP_SDK.decodeSharingConfig(sharingConfigAccountInfo);
+
+ // Read pump creator vault balance
+ const pumpCreatorVault = creatorVaultPda(sharingConfigAddress);
+ const pumpCreatorVaultInfo = await connection.getAccountInfo(pumpCreatorVault);
+ const pumpCreatorVaultTotal = pumpCreatorVaultInfo?.lamports ?? 0;
+
+ const rentExemption = pumpCreatorVaultInfo
+ ? await connection.getMinimumBalanceForRentExemption(pumpCreatorVaultInfo.data.length)
+ : 0;
+ const pumpCreatorVaultBalance = new BN(Math.max(0, pumpCreatorVaultTotal - rentExemption));
+
+ // Read AMM creator vault balance (WSOL ATA)
+ let ammCreatorVaultBalance = new BN(0);
+ if (isGraduated) {
+ const coinCreatorVaultAuthority = coinCreatorVaultAuthorityPda(sharingConfigAddress);
+ const ammVaultAta = coinCreatorVaultAtaPda(
+ coinCreatorVaultAuthority,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+ );
+ const ammVaultAtaInfo = await connection.getAccountInfo(ammVaultAta);
+ if (ammVaultAtaInfo) {
+ const dataUint8Array = new Uint8Array(
+ ammVaultAtaInfo.data.buffer,
+ ammVaultAtaInfo.data.byteOffset,
+ ammVaultAtaInfo.data.byteLength,
+ );
+ const parsed = AccountLayout.decode(dataUint8Array);
+ ammCreatorVaultBalance = new BN(parsed.amount.toString());
+ }
+ }
+
+ // Build simulation transaction
+ const instructions = [];
+
+ if (isGraduated) {
+ const pumpAmmProgram = getPumpAmmProgram(connection);
+ const coinCreatorVaultAuthority = coinCreatorVaultAuthorityPda(sharingConfigAddress);
+ const ammVaultAta = coinCreatorVaultAtaPda(
+ coinCreatorVaultAuthority,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+ );
+
+ const createAtaIx = createAssociatedTokenAccountIdempotentInstruction(
+ SIMULATION_SIGNER,
+ ammVaultAta,
+ coinCreatorVaultAuthority,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ );
+ instructions.push(createAtaIx);
+
+ const transferIx = await pumpAmmProgram.methods
+ .transferCreatorFeesToPump()
+ .accountsPartial({
+ wsolMint: NATIVE_MINT,
+ tokenProgram: TOKEN_PROGRAM_ID,
+ coinCreator: sharingConfigAddress,
+ })
+ .instruction();
+ instructions.push(transferIx);
+ }
+
+ const getMinFeeIx = await PUMP_SDK.getMinimumDistributableFee({
+ mint,
+ sharingConfig,
+ sharingConfigAddress,
+ });
+ instructions.push(getMinFeeIx);
+
+ const { blockhash } = await connection.getLatestBlockhash();
+ const tx = new VersionedTransaction(
+ new TransactionMessage({
+ payerKey: SIMULATION_SIGNER,
+ recentBlockhash: blockhash,
+ instructions,
+ }).compileToV0Message(),
+ );
+
+ const result = await connection.simulateTransaction(tx);
+
+ let minimumRequired = new BN(0);
+ let distributableFees = new BN(0);
+ let canDistribute = false;
+
+ if (!result.value.err) {
+ const [data, encoding] = result.value.returnData?.data ?? [];
+ if (data) {
+ const buffer = Buffer.from(data, encoding);
+ const returnData = PUMP_SDK.decodeMinimumDistributableFee(buffer);
+ minimumRequired = returnData.minimumRequired;
+ distributableFees = returnData.distributableFees;
+ canDistribute = returnData.canDistribute;
+ }
+ } else {
+ process.stderr.write(
+ `Simulation failed: ${JSON.stringify(result.value.err)}\n`,
+ );
+ }
+
+ const totalAvailableBalance = pumpCreatorVaultBalance.add(ammCreatorVaultBalance);
+
+ printJson({
+ mint: mint.toBase58(),
+ sharingConfigAddress: sharingConfigAddress.toBase58(),
+ isGraduated,
+ pumpCreatorVaultBalance: pumpCreatorVaultBalance.toString(),
+ ammCreatorVaultBalance: ammCreatorVaultBalance.toString(),
+ totalAvailableBalance: totalAvailableBalance.toString(),
+ minimumRequired: minimumRequired.toString(),
+ distributableFees: distributableFees.toString(),
+ canDistribute,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/coin-fees/scripts/fetch-fee-info.mjs b/pump-fun-skills/coin-fees/scripts/fetch-fee-info.mjs
new file mode 100644
index 000000000..bd64b3d70
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/fetch-fee-info.mjs
@@ -0,0 +1,208 @@
+#!/usr/bin/env node
+/**
+ * Resolve fee destination for a coin: cashback, sharing_config, or creator.
+ * Reports vault balances, sharing config shareholders, and graduation status.
+ */
+import BN from "bn.js";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ bondingCurvePda,
+ canonicalPumpPoolPda,
+ creatorVaultPda,
+ feeSharingConfigPda,
+ isCreatorUsingSharingConfig,
+} from "@pump-fun/pump-sdk";
+import {
+ OnlinePumpAmmSdk,
+ coinCreatorVaultAuthorityPda,
+ coinCreatorVaultAtaPda,
+} from "@pump-fun/pump-swap-sdk";
+import {
+ AccountLayout,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+} from "@solana/spl-token";
+import { PublicKey } from "@solana/web3.js";
+import { getConnection } from "./lib/env.mjs";
+import {
+ exitWithHelp,
+ printJson,
+ requirePublicKey,
+} from "./lib/args.mjs";
+import { parseArgs } from "node:util";
+
+const HELP = `Usage: node scripts/fetch-fee-info.mjs --mint <MINT>
+
+Inspect fee destination, vault balances, and sharing config for a coin.
+
+Required:
+ --mint <PUBKEY> Coin mint address
+
+Optional:
+ -h, --help Show help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+const MIN_RENT_EXEMPTION_LAMPORTS = new BN(890_880);
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("fetch-fee-info.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const connection = getConnection();
+ const onlineSdk = new OnlinePumpSdk(connection);
+
+ const bondingCurveAddress = bondingCurvePda(mint);
+ const bondingCurve = await onlineSdk.fetchBondingCurve(mint);
+
+ let poolAddress = null;
+ let poolCoinCreator = null;
+ let isGraduated = false;
+ let isCashbackCoin = false;
+
+ const poolPda = canonicalPumpPoolPda(mint);
+ const poolAccountInfo = await connection.getAccountInfo(poolPda);
+
+ if (poolAccountInfo) {
+ isGraduated = true;
+ poolAddress = poolPda.toBase58();
+ try {
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const pool = await onlineAmmSdk.fetchPool(poolPda);
+ poolCoinCreator = pool.coinCreator;
+
+ const poolRaw = pool;
+ isCashbackCoin =
+ poolRaw.isCashbackCoin === true ||
+ (typeof poolRaw.is_cashback_coin === "object" &&
+ poolRaw.is_cashback_coin !== null &&
+ poolRaw.is_cashback_coin[0] === true);
+ } catch {
+ // Pool exists but may not be fully initialized
+ }
+ } else {
+ const bcRaw = bondingCurve;
+ isCashbackCoin =
+ bcRaw.isCashbackCoin === true ||
+ (typeof bcRaw.is_cashback_coin === "object" &&
+ bcRaw.is_cashback_coin !== null &&
+ bcRaw.is_cashback_coin[0] === true);
+ }
+
+ const effectiveCreator = poolCoinCreator ?? new PublicKey(bondingCurve.creator);
+
+ let hasSharingConfig = false;
+ let sharingConfigInfo = null;
+
+ if (!isCashbackCoin) {
+ hasSharingConfig = isCreatorUsingSharingConfig({
+ mint,
+ creator: effectiveCreator,
+ });
+
+ if (hasSharingConfig) {
+ const sharingConfigAddress = feeSharingConfigPda(mint);
+ const sharingConfigAccountInfo =
+ await connection.getAccountInfo(sharingConfigAddress);
+
+ if (sharingConfigAccountInfo) {
+ const sharingConfig = PUMP_SDK.decodeSharingConfig(sharingConfigAccountInfo);
+ sharingConfigInfo = {
+ address: sharingConfigAddress.toBase58(),
+ admin: sharingConfig.admin.toBase58(),
+ adminRevoked: sharingConfig.adminRevoked ?? false,
+ shareholders: sharingConfig.shareholders.map((s) => ({
+ address: s.address.toBase58(),
+ bps: s.share,
+ })),
+ };
+ } else {
+ hasSharingConfig = false;
+ }
+ }
+ }
+
+ // Determine fee destination
+ let feeDestination;
+ if (isCashbackCoin) {
+ feeDestination = "cashback";
+ } else if (hasSharingConfig) {
+ feeDestination = "sharing_config";
+ } else {
+ feeDestination = "creator";
+ }
+
+ // Fetch vault balances
+ let creatorVaultLamports = "0";
+ if (!isCashbackCoin) {
+ try {
+ const vaultCreator = hasSharingConfig
+ ? feeSharingConfigPda(mint)
+ : effectiveCreator;
+
+ const creatorVault = creatorVaultPda(vaultCreator);
+ const creatorVaultAccountInfo = await connection.getAccountInfo(creatorVault);
+
+ const coinCreatorVaultAuthority = coinCreatorVaultAuthorityPda(vaultCreator);
+ const coinCreatorVaultAta = coinCreatorVaultAtaPda(
+ coinCreatorVaultAuthority,
+ NATIVE_MINT,
+ TOKEN_PROGRAM_ID,
+ );
+ const coinCreatorVaultAtaAccountInfo =
+ await connection.getAccountInfo(coinCreatorVaultAta);
+
+ let totalLamports = new BN(0);
+
+ if (creatorVaultAccountInfo) {
+ const rawLamports = new BN(creatorVaultAccountInfo.lamports);
+ const adjusted = rawLamports.sub(MIN_RENT_EXEMPTION_LAMPORTS);
+ totalLamports = totalLamports.add(adjusted.lt(new BN(0)) ? new BN(0) : adjusted);
+ }
+
+ if (coinCreatorVaultAtaAccountInfo) {
+ const dataUint8Array = new Uint8Array(
+ coinCreatorVaultAtaAccountInfo.data.buffer,
+ coinCreatorVaultAtaAccountInfo.data.byteOffset,
+ coinCreatorVaultAtaAccountInfo.data.byteLength,
+ );
+ const parsed = AccountLayout.decode(dataUint8Array);
+ totalLamports = totalLamports.add(new BN(parsed.amount.toString()));
+ }
+
+ creatorVaultLamports = totalLamports.toString();
+ } catch (err) {
+ process.stderr.write(`Warning: failed to fetch vault balances: ${err?.message ?? err}\n`);
+ }
+ }
+
+ printJson({
+ mint: mint.toBase58(),
+ bondingCurve: bondingCurveAddress.toBase58(),
+ pool: poolAddress,
+ isGraduated,
+ isCashbackCoin,
+ hasSharingConfig,
+ creator: effectiveCreator.toBase58(),
+ creatorVaultLamports,
+ sharingConfig: sharingConfigInfo,
+ feeDestination,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/coin-fees/scripts/lib/args.mjs b/pump-fun-skills/coin-fees/scripts/lib/args.mjs
new file mode 100644
index 000000000..04263e3a8
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/args.mjs
@@ -0,0 +1,74 @@
+import { parseArgs } from "node:util";
+import { PublicKey } from "@solana/web3.js";
+
+/**
+ * @param {string} label
+ * @param {string | undefined} value
+ * @returns {string}
+ */
+export function requireString(label, value) {
+ if (value == null || String(value).trim() === "") {
+ throw new Error(`${label} is required`);
+ }
+ return String(value).trim();
+}
+
+/**
+ * @param {string} label
+ * @param {string | undefined} value
+ * @returns {import("@solana/web3.js").PublicKey}
+ */
+export function requirePublicKey(label, value) {
+ const s = requireString(label, value);
+ try {
+ return new PublicKey(s);
+ } catch {
+ throw new Error(`${label} is not a valid base58 public key: ${s}`);
+ }
+}
+
+/**
+ * @param {string | undefined} value
+ * @param {number} defaultValue
+ * @returns {number}
+ */
+export function parsePositiveInt(value, defaultValue) {
+ if (value == null || value === "") return defaultValue;
+ const n = Number.parseInt(value, 10);
+ if (!Number.isFinite(n) || n <= 0) {
+ throw new Error(`Expected positive integer, got: ${value}`);
+ }
+ return n;
+}
+
+/**
+ * @param {string | undefined} value
+ * @param {number} defaultValue
+ * @returns {number}
+ */
+export function parseSlippagePercent(value, defaultValue = 10) {
+ if (value == null || value === "") return defaultValue;
+ const n = Number.parseFloat(value);
+ if (!Number.isFinite(n) || n < 0 || n > 100) {
+ throw new Error(`Slippage must be 0–100 (percent), got: ${value}`);
+ }
+ return n;
+}
+
+/**
+ * @param {Record<string, unknown>} obj
+ */
+export function printJson(obj) {
+ process.stdout.write(`${JSON.stringify(obj, null, 0)}\n`);
+}
+
+/**
+ * @param {string} name
+ * @param {string} body
+ */
+export function exitWithHelp(name, body) {
+ process.stderr.write(`${name}\n\n${body}\n`);
+ process.exit(0);
+}
+
+export { parseArgs };
diff --git a/pump-fun-skills/coin-fees/scripts/lib/coin-api.mjs b/pump-fun-skills/coin-fees/scripts/lib/coin-api.mjs
new file mode 100644
index 000000000..ddee51037
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/coin-api.mjs
@@ -0,0 +1,38 @@
+/** Default coins-v2 prefix; override with PUMP_COINS_V2_BASE if using another backend. */
+const DEFAULT_COINS_V2_BASE = "https://frontend-api-v3.pump.fun/coins-v2";
+
+/** @returns {string} */
+function coinsV2BaseUrl() {
+ const raw = process.env.PUMP_COINS_V2_BASE?.trim();
+ const base = (raw && raw.length > 0 ? raw : DEFAULT_COINS_V2_BASE).replace(
+ /\/+$/,
+ "",
+ );
+ return base;
+}
+
+/**
+ * @param {string} mint
+ * @returns {Promise<Record<string, unknown>>}
+ */
+export async function fetchCoinV2(mint) {
+ const url = `${coinsV2BaseUrl()}/${mint}`;
+ const r = await fetch(url);
+ if (!r.ok) {
+ throw new Error(`coins-v2 request failed: HTTP ${r.status} for mint ${mint}`);
+ }
+ const text = await r.text();
+ if (!text || text.trim().length === 0) {
+ throw new Error(
+ `coins-v2 returned empty response for mint ${mint} (url: ${url}). ` +
+ "If using devnet, set PUMP_COINS_V2_BASE to the devnet coins API.",
+ );
+ }
+ try {
+ return JSON.parse(text);
+ } catch {
+ throw new Error(
+ `coins-v2 returned invalid JSON for mint ${mint}: ${text.slice(0, 200)}`,
+ );
+ }
+}
diff --git a/pump-fun-skills/coin-fees/scripts/lib/coin-resolve.mjs b/pump-fun-skills/coin-fees/scripts/lib/coin-resolve.mjs
new file mode 100644
index 000000000..e2ef0385e
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/coin-resolve.mjs
@@ -0,0 +1,46 @@
+import { PublicKey } from "@solana/web3.js";
+import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from "@solana/spl-token";
+
+const KNOWN_SPL_TOKEN_PROGRAMS = new Set([
+ TOKEN_PROGRAM_ID.toBase58(),
+ TOKEN_2022_PROGRAM_ID.toBase58(),
+]);
+
+/**
+ * SPL mint accounts are owned by Token or Token-2022 program.
+ * @param {import("@solana/web3.js").Connection} connection
+ * @param {import("@solana/web3.js").PublicKey} mint
+ * @param {import("@solana/web3.js").Commitment} [commitment="confirmed"]
+ * @returns {Promise<import("@solana/web3.js").PublicKey>}
+ */
+export async function tokenProgramIdFromMint(
+ connection,
+ mint,
+ commitment = "confirmed",
+) {
+ const info = await connection.getAccountInfo(mint, commitment);
+ if (!info) {
+ throw new Error(`Mint account not found: ${mint.toBase58()}`);
+ }
+ const owner = info.owner;
+ if (!KNOWN_SPL_TOKEN_PROGRAMS.has(owner.toBase58())) {
+ throw new Error(
+ `Mint owner is not SPL Token or Token-2022: ${owner.toBase58()}`,
+ );
+ }
+ return owner;
+}
+
+/**
+ * @param {Record<string, unknown>} coin
+ * @returns {import("@solana/web3.js").PublicKey}
+ */
+export function poolPublicKeyFromCoin(coin) {
+ const pool = coin?.pump_swap_pool;
+ if (typeof pool !== "string" || !pool.length) {
+ throw new Error(
+ "Coin has no pump_swap_pool — not graduated to AMM or still migrating.",
+ );
+ }
+ return new PublicKey(pool);
+}
diff --git a/pump-fun-skills/coin-fees/scripts/lib/compute.mjs b/pump-fun-skills/coin-fees/scripts/lib/compute.mjs
new file mode 100644
index 000000000..b0a74d0b0
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/compute.mjs
@@ -0,0 +1,82 @@
+import {
+ ComputeBudgetProgram,
+ TransactionMessage,
+ VersionedTransaction,
+} from "@solana/web3.js";
+
+/** Microlamports */
+export const DEFAULT_PRIORITY_FLOOR = 100_000;
+/** Microlamports — upper bound when RPC returns very high estimates */
+export const MAX_PRIORITY_FEE = 5_000_000;
+
+/**
+ * @param {import("@solana/web3.js").Connection} connection
+ * @param {import("@solana/web3.js").VersionedTransaction} tx
+ * @param {string} [priorityLevel]
+ * @returns {Promise<number>}
+ */
+export async function getPriorityFeeEstimate(
+ connection,
+ tx,
+ priorityLevel = "Medium",
+) {
+ try {
+ const res = await fetch(connection.rpcEndpoint, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ jsonrpc: "2.0",
+ id: "pump-skill-priority",
+ method: "getPriorityFeeEstimate",
+ params: [
+ {
+ transaction: Buffer.from(tx.serialize()).toString("base64"),
+ options: { priorityLevel, transactionEncoding: "base64" },
+ },
+ ],
+ }),
+ });
+ const data = await res.json();
+ if (data.error) throw new Error(data.error.message);
+ const est = data?.result?.priorityFeeEstimate ?? 0;
+ return Math.floor(
+ Math.min(
+ Math.max(Number(est) || 0, DEFAULT_PRIORITY_FLOOR),
+ MAX_PRIORITY_FEE,
+ ),
+ );
+ } catch {
+ return DEFAULT_PRIORITY_FLOOR;
+ }
+}
+
+/**
+ * @param {number} units
+ * @param {number} microLamports
+ * @returns {import("@solana/web3.js").TransactionInstruction[]}
+ */
+export function computeBudgetInstructions(units, microLamports) {
+ return [
+ ComputeBudgetProgram.setComputeUnitLimit({ units }),
+ ComputeBudgetProgram.setComputeUnitPrice({ microLamports }),
+ ];
+}
+
+/**
+ * Draft tx for priority fee RPC (matches pump-solana pattern: high CU + minimal price).
+ * @param {import("@solana/web3.js").PublicKey} payerKey
+ * @param {import("@solana/web3.js").TransactionInstruction[]} sdkInstructions
+ * @returns {import("@solana/web3.js").VersionedTransaction}
+ */
+export function buildDraftTxForFeeEstimate(payerKey, sdkInstructions) {
+ return new VersionedTransaction(
+ new TransactionMessage({
+ payerKey,
+ recentBlockhash: "11111111111111111111111111111111",
+ instructions: [
+ ...computeBudgetInstructions(1_400_000, 1),
+ ...sdkInstructions,
+ ],
+ }).compileToV0Message(),
+ );
+}
diff --git a/pump-fun-skills/coin-fees/scripts/lib/constants.mjs b/pump-fun-skills/coin-fees/scripts/lib/constants.mjs
new file mode 100644
index 000000000..ad805fc86
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/constants.mjs
@@ -0,0 +1,12 @@
+/** Align with frontend/apps/frontend/stores/blockchainStore/constants.ts */
+export const CREATE_DEFAULT_UNITS = 270_000;
+export const BUY_SELL_DEFAULT_UNITS = 120_000;
+export const AMM_BUY_SELL_DEFAULT_UNITS = 200_000;
+
+/** Create + initial buy on one tx */
+export const CREATE_AND_BUY_COMPUTE_UNITS =
+ CREATE_DEFAULT_UNITS + BUY_SELL_DEFAULT_UNITS;
+
+/** Default Address Lookup Tables per network */
+export const ALT_ADDRESS_MAINNET = "7mFD2mUtRS65XstiSAvCJuYmdesZoQwCwRJhq1p3eRMe";
+export const ALT_ADDRESS_DEVNET = "7y3623xaVQzsLxHRyp1wQD4Pmer5JjgbaagGFAEqCjua";
diff --git a/pump-fun-skills/coin-fees/scripts/lib/env.mjs b/pump-fun-skills/coin-fees/scripts/lib/env.mjs
new file mode 100644
index 000000000..c50d21ddf
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/env.mjs
@@ -0,0 +1,18 @@
+import { Connection } from "@solana/web3.js";
+
+/** @returns {string} */
+export function getRpcUrl() {
+ const url =
+ process.env.SOLANA_RPC_URL ?? process.env.NEXT_PUBLIC_SOLANA_RPC_URL;
+ if (!url?.trim()) {
+ throw new Error(
+ "SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL must be set (use an HTTPS JSON-RPC endpoint).",
+ );
+ }
+ return url.trim();
+}
+
+/** @returns {import("@solana/web3.js").Connection} */
+export function getConnection() {
+ return new Connection(getRpcUrl(), "confirmed");
+}
diff --git a/pump-fun-skills/coin-fees/scripts/lib/jito.mjs b/pump-fun-skills/coin-fees/scripts/lib/jito.mjs
new file mode 100644
index 000000000..136015e87
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/jito.mjs
@@ -0,0 +1,84 @@
+import { PublicKey, SystemProgram } from "@solana/web3.js";
+
+const DEFAULT_TIP_LAMPORTS = 100_000; // 0.0001 SOL
+
+const JITO_TIP_ACCOUNTS = [
+ "96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5",
+ "HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe",
+ "Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY",
+ "ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49",
+ "DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh",
+ "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
+ "DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL",
+ "3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT",
+].map((k) => new PublicKey(k));
+
+export const JITO_ENDPOINTS = [
+ "https://mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://london.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://slc.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://singapore.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions",
+];
+
+function randomJitoTipAccount() {
+ return JITO_TIP_ACCOUNTS[
+ Math.floor(Math.random() * JITO_TIP_ACCOUNTS.length)
+ ];
+}
+
+/**
+ * @param {import("@solana/web3.js").PublicKey} payer
+ * @param {number} [tipSol] — tip in SOL (default 0.0001)
+ * @returns {import("@solana/web3.js").TransactionInstruction}
+ */
+export function jitoTipInstruction(payer, tipSol) {
+ const lamports =
+ tipSol != null ? Math.floor(tipSol * 1_000_000_000) : DEFAULT_TIP_LAMPORTS;
+ return SystemProgram.transfer({
+ fromPubkey: payer,
+ toPubkey: randomJitoTipAccount(),
+ lamports,
+ });
+}
+
+/**
+ * Send a base64-encoded transaction to all Jito block engine endpoints.
+ * Resolves with the first successful JSON-RPC result or rejects if all fail.
+ *
+ * @param {string} txBase64
+ * @returns {Promise<string>} Jito response result (usually the signature)
+ */
+export async function sendTransactionToJito(txBase64) {
+ const body = JSON.stringify({
+ jsonrpc: "2.0",
+ id: 1,
+ method: "sendTransaction",
+ params: [txBase64, { encoding: "base64" }],
+ });
+
+ const results = await Promise.allSettled(
+ JITO_ENDPOINTS.map((endpoint) =>
+ fetch(endpoint, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ }).then(async (r) => {
+ const json = await r.json();
+ if (json.error) throw new Error(JSON.stringify(json.error));
+ return json.result;
+ }),
+ ),
+ );
+
+ const first = results.find((r) => r.status === "fulfilled");
+ if (first) return first.value;
+
+ const errors = results.map(
+ (r) => /** @type {PromiseRejectedResult} */ (r).reason?.message ?? r,
+ );
+ throw new Error(`All Jito endpoints failed: ${errors.join("; ")}`);
+}
diff --git a/pump-fun-skills/coin-fees/scripts/lib/tx-build.mjs b/pump-fun-skills/coin-fees/scripts/lib/tx-build.mjs
new file mode 100644
index 000000000..52f871a3f
--- /dev/null
+++ b/pump-fun-skills/coin-fees/scripts/lib/tx-build.mjs
@@ -0,0 +1,67 @@
+import { TransactionMessage, VersionedTransaction } from "@solana/web3.js";
+import {
+ buildDraftTxForFeeEstimate,
+ computeBudgetInstructions,
+ getPriorityFeeEstimate,
+} from "./compute.mjs";
+import { jitoTipInstruction } from "./jito.mjs";
+
+/**
+ * @param {object} opts
+ * @param {import("@solana/web3.js").Connection} opts.connection
+ * @param {import("@solana/web3.js").PublicKey} opts.payerKey
+ * @param {import("@solana/web3.js").TransactionInstruction[]} opts.sdkInstructions
+ * @param {number} opts.computeUnits
+ * @param {number | null | undefined} opts.priorityFeeMicroLamports — if null/undefined, estimate via RPC
+ * @param {import("@solana/web3.js").Keypair[]} [opts.extraSigners]
+ * @param {import("@solana/web3.js").AddressLookupTableAccount[]} [opts.addressLookupTableAccounts]
+ * @param {boolean} [opts.frontRunnerProtection] — when true, adds a Jito tip and the tx should only be sent to Jito
+ * @param {number} [opts.tipSol] — Jito tip in SOL (default 0.0001); only used when frontRunnerProtection is true
+ * @returns {Promise<import("@solana/web3.js").VersionedTransaction>}
+ */
+export async function buildAndPartialSignTx({
+ connection,
+ payerKey,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports,
+ extraSigners = [],
+ addressLookupTableAccounts = [],
+ frontRunnerProtection = false,
+ tipSol,
+}) {
+ let microLamports = priorityFeeMicroLamports;
+ if (microLamports == null) {
+ const draft = buildDraftTxForFeeEstimate(payerKey, sdkInstructions);
+ microLamports = await getPriorityFeeEstimate(connection, draft);
+ }
+
+ const allInstructions = [
+ ...computeBudgetInstructions(computeUnits, microLamports),
+ ...(frontRunnerProtection ? [jitoTipInstruction(payerKey, tipSol)] : []),
+ ...sdkInstructions,
+ ];
+
+ const { blockhash } = await connection.getLatestBlockhash("confirmed");
+ const tx = new VersionedTransaction(
+ new TransactionMessage({
+ payerKey,
+ recentBlockhash: blockhash,
+ instructions: allInstructions,
+ }).compileToV0Message(addressLookupTableAccounts),
+ );
+
+ if (extraSigners.length > 0) {
+ tx.sign(extraSigners);
+ }
+
+ return tx;
+}
+
+/**
+ * @param {import("@solana/web3.js").VersionedTransaction} tx
+ * @returns {string}
+ */
+export function transactionToBase64(tx) {
+ return Buffer.from(tx.serialize()).toString("base64");
+}
diff --git a/pump-fun-skills/create-coin/.gitignore b/pump-fun-skills/create-coin/.gitignore
new file mode 100644
index 000000000..c2658d7d1
--- /dev/null
+++ b/pump-fun-skills/create-coin/.gitignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/pump-fun-skills/create-coin/SKILL.md b/pump-fun-skills/create-coin/SKILL.md
new file mode 100644
index 000000000..675537b75
--- /dev/null
+++ b/pump-fun-skills/create-coin/SKILL.md
@@ -0,0 +1,308 @@
+---
+name: create-coin
+description: >
+ Create coins on pump.fun — standard create with initial buy. Prefer runnable
+ Node scripts in this skill folder; use @pump-fun/pump-sdk for custom
+ integrations.
+metadata:
+ author: pump-fun
+ version: "1.0"
+---
+
+# Before Starting Work **Critical** - Ask these from user
+
+**MANDATORY — Do NOT write or modify any code until every item below is answered by the user:**
+
+- [ ] RPC URL provided or a fallback agreed upon (for any on-chain or tx-building step)
+- [ ] **Signer wallet** public key (fee payer / creator)
+- [ ] Framework confirmed (Next.js, Express, CLI scripts only, other)
+- [ ] Coin name, symbol, and metadata URI (or plan to upload) confirmed — see [references/METADATA.md](references/METADATA.md)
+- [ ] Initial buy amount confirmed (SOL in lamports)
+- [ ] Cashback desired? (default off)
+- [ ] Mayhem mode desired? (default off)
+- [ ] Tokenized agent desired? (default off), If Yes then with what Buyback percentage.
+- [ ] Front-runner protection desired? If yes, confirm tip amount (default 0.0001 SOL). Transactions will be sent **only** to Jito block engine endpoints.
+
+You MUST ask the user for ALL unchecked items in your very first response. Do not assume defaults. Do not proceed until the user has explicitly answered each one.
+
+## API (preferred) — `https://fun-block.pump.fun`
+
+Use the API to build transactions instead of running scripts directly. The API handles account resolution, compute budget, and partial signing automatically.
+
+### `POST /agents/create-coin`
+
+Builds a create + initial buy transaction. The server generates a mint keypair and partial-signs with it. The client wallet co-signs and submits.
+
+**Request body:**
+
+```json
+{
+ "user": "<PUBKEY>",
+ "name": "MyCoin",
+ "symbol": "MC",
+ "uri": "https://ipfs.io/ipfs/Qm...",
+ "solLamports": "1000000",
+ "mayhemMode": false,
+ "cashback": false,
+ "tokenizedAgent": false,
+ "buybackBps": 5000,
+ "frontRunningProtection": false,
+ "tipAmount": 0,
+ "encoding": "base64",
+ "feePayer": "<PUBKEY>",
+ "creator": "<PUBKEY>"
+}
+```
+
+Only `user`, `name`, `symbol`, `uri`, and `solLamports` are required. All other fields are optional with sensible defaults.
+
+> **`tipAmount`** is a Jito tip in **SOL** (e.g. `0.0001` for 100,000 lamports). Only relevant when `frontRunningProtection` is `true`.
+
+> **Encoding:** The API defaults to `"base58"` encoding. **Always pass `"encoding": "base64"`** in the request body — scripts already output base64. When sending the signed transaction to an RPC or Jito endpoint, the encoding used to serialize the transaction must match the `encoding` parameter passed in the send call. Mismatched encodings will cause transaction failures. **Always** explicitly pass `encoding: "base64"` in `sendTransaction` / `simulateTransaction` RPC calls — never rely on the RPC's default.
+
+**Response:**
+
+```json
+{
+ "transaction": "<base64-encoded VersionedTransaction>",
+ "mintPublicKey": "<base58 mint address>",
+ "quoteTokenAmount": "123456789",
+ "solLamports": "1000000",
+ "mayhemMode": false,
+ "cashback": false,
+ "tokenizedAgent": false
+}
+```
+
+The returned `transaction` is already partial-signed with the mint keypair. Deserialize it, have the user wallet sign, and submit to chain.
+
+## Runnable examples (Node scripts — only when user explicitly requests)
+
+Use **`{baseDir}`** as the path to this skill folder (OpenClaw and Agent Skills clients often expose this placeholder).
+
+```bash
+cd {baseDir}
+npm install
+export SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+```
+
+| Operation | Script | Example |
+| ---------------------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Fetch coin state (HTTP) | `scripts/fetch-coin.mjs` | `node scripts/fetch-coin.mjs --mint <MINT> --subset` |
+| Create + initial buy (partial-sign mint) | `scripts/build-create-coin-tx.mjs` | `node scripts/build-create-coin-tx.mjs --user <PUBKEY> --name "Coin" --symbol "CN" --metadata-uri <URI> --sol-lamports 1000000 --mint-keypair-out ./mint.json [--mayhem-mode] [--cashback] [--tokenized-agent --buyback-bps 5000] [--alt-address <PUBKEY>]` |
+
+- Run any script with `--help` for full flags (`--mayhem-mode`, `--tokenized-agent`, `--buyback-bps`, `--compute-units`, `--priority-micro-lamports`, `--front-runner-protection`, `--tip-sol`, etc.).
+- Tx builders print **one JSON object** on stdout with `transaction` (base64-encoded VersionedTransaction, partially signed when the mint keypair is used on create). **Never** pass end-user private keys into these scripts.
+- **OpenClaw:** If YAML `metadata` ever fails to parse, collapse `metadata` to a single-line JSON object per [OpenClaw skills](https://docs.openclaw.ai/skills/); optional `metadata.openclaw.requires.env: ["SOLANA_RPC_URL"]` can gate load-time eligibility.
+
+**Published copy:** [METADATA.md (raw)](https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/create-coin/references/METADATA.md)
+
+## Safety Rules
+
+- **NEVER** log, print, or return private keys or secret key material.
+- **NEVER** sign transactions on behalf of a user — scripts build txs; the user (or their wallet) co-signs and sends.
+- Always validate that amounts are `> 0` before building instructions.
+- Use the correct decimal precision: **9 decimals for SOL** (1 SOL = 1,000,000,000 lamports), **6 decimals for pump tokens**.
+- **NEVER trust `token_program` from the HTTP API** (`coins-v2`). Always fetch the mint account on-chain via `connection.getAccountInfo(mint)` and use `.owner` to determine the correct token program (SPL Token or Token-2022).
+- **Verify imports:** use `@pump-fun/pump-sdk` (not internal monorepo paths). In TypeScript apps, `BN` from `bn.js` matches what the SDKs expect (Anchor `BN` is the same type in practice).
+
+## Program IDs
+
+| Program | ID |
+| ------- | --------------------------------------------- |
+| Pump | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` |
+
+## Environment Variables
+
+```env
+SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+NEXT_PUBLIC_SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+```
+
+The default public mainnet RPC (`https://api.mainnet-beta.solana.com`) often **cannot send** transactions. Confirm an HTTPS RPC with the user. Examples: Solana Tracker public RPC, Ankr `https://rpc.ankr.com/solana`.
+
+## Install
+
+**Inside this skill folder** (includes scripts):
+
+```bash
+cd {baseDir}
+npm install
+```
+
+**Inside another app** (from scratch):
+
+```bash
+npm install @pump-fun/pump-sdk @pump-fun/agent-payments-sdk @solana/web3.js@^1.98.0 @solana/spl-token bn.js
+```
+
+Check `npm info @pump-fun/pump-sdk dependencies` and align `@solana/web3.js` / `@solana/spl-token` versions to avoid duplicate incompatible copies.
+
+## SDK setup (minimal)
+
+```typescript
+import { PUMP_SDK, OnlinePumpSdk } from "@pump-fun/pump-sdk";
+import { Connection } from "@solana/web3.js";
+
+const connection = new Connection(process.env.SOLANA_RPC_URL!);
+const onlinePump = new OnlinePumpSdk(connection);
+```
+
+Full transaction building (compute budget, blockhash, partial sign) is implemented in `scripts/lib/tx-build.mjs` and `scripts/lib/compute.mjs`.
+
+## Create a coin
+
+- **Default:** `POST /agents/create-coin` (see API section above)
+- **Script (only when user explicitly requests):** `scripts/build-create-coin-tx.mjs`
+- **Metadata JSON:** [references/METADATA.md](references/METADATA.md)
+
+### Parameters (`createV2AndBuyInstructions`)
+
+| Parameter | Type | Description |
+| ------------ | ----------- | ---------------------------------------------------------------------- |
+| `global` | `Global` | From `OnlinePumpSdk.fetchGlobal()` |
+| `mint` | `PublicKey` | New mint (generated keypair) |
+| `name` | `string` | Coin name |
+| `symbol` | `string` | Ticker |
+| `uri` | `string` | Metadata JSON URL |
+| `creator` | `PublicKey` | Creator |
+| `user` | `PublicKey` | Payer (often same as creator) |
+| `amount` | `BN` | Token amount to buy (6 decimals) |
+| `solAmount` | `BN` | SOL for initial buy (lamports) |
+| `mayhemMode` | `boolean` | Configurable via `--mayhem-mode` flag (default: `false`) |
+| `cashback` | `boolean` | Enable cashback rewards; optional, default `false` |
+
+When `--tokenized-agent` is enabled, an additional `PumpAgentOffline.load(mint).create(...)` instruction (from `@pump-fun/agent-payments-sdk`) is appended after the create+buy instructions. The `--buyback-bps` flag controls the agent buyback percentage in basis points (default: 5000 = 50%). Tokenized agent coins **must** have an initial buy > 0 SOL.
+
+Token amount for the initial buy is derived with `getBuyTokenAmountFromSolAmount` (`mintSupply: null`, `bondingCurve: null`).
+
+## Compute units and priority fees
+
+Defaults match the pump.fun app constants (see `scripts/lib/constants.mjs` in this skill):
+
+| Operation | Default compute units |
+| ---------------------------------- | -------------------------------------------- |
+| Create + buy | 270_000 + 120_000 = **390_000** |
+| Create + buy + tokenized agent | 270_000 + 120_000 + 30_000 = **420_000** |
+
+Scripts accept `--compute-units` to override. When `--tokenized-agent` is enabled, 30,000 extra units are added automatically.
+
+**Priority fee:** If `--priority-micro-lamports` is omitted, scripts call Solana JSON-RPC `getPriorityFeeEstimate` on a draft serialized transaction (with a 100k microlamport floor and an upper cap — see `scripts/lib/compute.mjs`), matching the pattern in `useFrontendCreateCoin`. Many RPCs support this; if not, the floor is used.
+
+## Transaction assembly and send
+
+After the user wallet signs, choose the send path based on whether `frontRunnerProtection` is `true` in the script output JSON.
+
+### Default (no front-runner protection)
+
+```typescript
+const signature = await connection.sendRawTransaction(
+ signedTransaction.serialize(),
+ { skipPreflight: false, preflightCommitment: "confirmed" },
+);
+const latestBlockhash = await connection.getLatestBlockhash("confirmed");
+await connection.confirmTransaction(
+ { signature, ...latestBlockhash },
+ "confirmed",
+);
+```
+
+### With front-runner protection (Jito only)
+
+When the transaction was built with `--front-runner-protection`, it already contains a Jito tip instruction. Send it **only** to Jito block engine endpoints — do **not** send via `connection.sendRawTransaction` or any other RPC, as that would leak the transaction to the public mempool and defeat the protection.
+
+```typescript
+import { sendTransactionToJito } from "./lib/jito.mjs";
+
+const txBase64 = Buffer.from(signedTransaction.serialize()).toString("base64");
+const result = await sendTransactionToJito(txBase64);
+```
+
+Or manually via `fetch` (no dependency on the lib):
+
+```typescript
+const JITO_ENDPOINTS = [
+ "https://mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions",
+];
+
+const txBase64 = Buffer.from(signedTransaction.serialize()).toString("base64");
+const body = JSON.stringify({
+ jsonrpc: "2.0",
+ id: 1,
+ method: "sendTransaction",
+ params: [txBase64, { encoding: "base64" }],
+});
+
+await Promise.any(
+ JITO_ENDPOINTS.map((url) =>
+ fetch(url, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ }).then((r) => r.json()),
+ ),
+);
+```
+
+Then confirm as usual with `connection.confirmTransaction`.
+
+## Get coin data (HTTP)
+
+`GET https://frontend-api-v3.pump.fun/coins-v2/{mint}`
+
+> **CORS-protected:** `frontend-api-v3.pump.fun` does not allow browser-origin requests. When building a web application, always call this endpoint from your backend/server and proxy the result to the frontend. Do not call it directly from client-side JavaScript.
+
+```json
+{
+ "mint": "ABcDeFgHiJkLmNoPqRsTuVwXyZ123456789abcdefg",
+ "name": "MyToken",
+ "symbol": "MTK",
+ "description": "A sample token on pump.fun",
+ "image_uri": "https://ipfs.io/ipfs/Qm...",
+ "metadata_uri": "https://ipfs.io/ipfs/Qm...",
+ "creator": "CreatorWalletAddress...",
+ "created_timestamp": 1700000000,
+ "complete": false,
+ "bonding_curve": "BondingCurveAddress...",
+ "associated_bonding_curve": "AssociatedBondingCurveAddress...",
+ "pump_swap_pool": null,
+ "token_program": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
+ "market_cap": 25000000000,
+ "usd_market_cap": 50000,
+ "virtual_sol_reserves": "30000000000",
+ "virtual_token_reserves": "1073000000000000",
+ "total_supply": "1000000000000000",
+ "raydium_pool": "",
+ "program": "pump",
+ "reply_count": 42,
+ "last_trade_timestamp": 1700086400
+}
+```
+
+> **NEVER trust `token_program` from the HTTP API.** The `coins-v2` endpoint may return a stale or incorrect `token_program`. Always resolve it on-chain by fetching the mint account and reading its owner:
+>
+> ```typescript
+> const mintAccountInfo = await connection.getAccountInfo(mintPublicKey);
+> const tokenProgram = mintAccountInfo.owner; // TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID
+> ```
+>
+> The skill scripts already do this via `tokenProgramIdFromMint()` in `scripts/lib/coin-resolve.mjs`. Any custom integration **must** do the same.
+
+## Error handling and troubleshooting
+
+- **Bonding curve account missing** — wrong mint, wrong network, or coin not yet created on-chain.
+- **Insufficient SOL** — user cannot pay rent, buy amount, or fees; check balance before building.
+- **Slippage / simulation failures** — retry with fresh blockhash (re-run script).
+- **RPC errors** — rate limits, missing `getPriorityFeeEstimate`, or send blocked; try another RPC; pass `--priority-micro-lamports` explicitly.
+
+## End-to-end flow
+
+1. Confirm coin name, symbol, metadata URI, signer wallet, and initial buy amount; set `SOLANA_RPC_URL`. Ask about mayhem mode, tokenized agent (with buyback percentage), cashback, and front-runner protection preferences.
+2. Use `POST /agents/create-coin` to build the transaction. Only use `build-create-coin-tx.mjs` if the user explicitly requests scripts; capture `transaction`. Add `--mayhem-mode`, `--tokenized-agent --buyback-bps <BPS>`, `--cashback`, and/or `--front-runner-protection` (with optional `--tip-sol`) as needed.
+3. Deserialize with `@solana/web3.js` `VersionedTransaction.deserialize`, have user sign (and co-sign create tx).
+4. **Send the transaction:** If `frontRunnerProtection` is `true` in the script output JSON, send **only** to Jito endpoints (see "Transaction assembly and send" above). Otherwise use `sendRawTransaction` + `confirmTransaction`.
+5. Keep `mint-keypair-out` secure; it is required for any mint-authority operations later.
diff --git a/pump-fun-skills/create-coin/package-lock.json b/pump-fun-skills/create-coin/package-lock.json
new file mode 100644
index 000000000..a03bfcce4
--- /dev/null
+++ b/pump-fun-skills/create-coin/package-lock.json
@@ -0,0 +1,1045 @@
+{
+ "name": "@pump-fun-skills/create-coin",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@pump-fun-skills/create-coin",
+ "version": "1.0.0",
+ "dependencies": {
+ "@pump-fun/agent-payments-sdk": "^3.0.3",
+ "@pump-fun/pump-sdk": "^1.33.0",
+ "@pump-fun/pump-swap-sdk": "^1.15.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.29.2",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
+ "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@coral-xyz/anchor": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.31.1.tgz",
+ "integrity": "sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "node_modules/@coral-xyz/anchor-errors": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.31.1.tgz",
+ "integrity": "sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@coral-xyz/borsh": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.31.1.tgz",
+ "integrity": "sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.1.2",
+ "buffer-layout": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.69.0"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@pump-fun/agent-payments-sdk": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@pump-fun/agent-payments-sdk/-/agent-payments-sdk-3.0.3.tgz",
+ "integrity": "sha512-VUAGDs7EFJ+RI+nHxeBGjOAqbYQ1kWLJhyX2Wa+N7GCZM/ojL0ONGdc4HdvW+7j0m+vG8IfeeGWXCrK5ninA+A==",
+ "license": "ISC",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@solana/spl-token": "^0.4.9",
+ "@solana/web3.js": "^1.98.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-linux-x64-gnu": "*"
+ }
+ },
+ "node_modules/@pump-fun/pump-sdk": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/@pump-fun/pump-sdk/-/pump-sdk-1.33.0.tgz",
+ "integrity": "sha512-Efd0rcqL7P1w3R5RQUeMspWpuejKY/SovMfVZCzrllAB0PoMM8WNYJQinFMxV5f7NdeG6gis+P6ZsmJ+wtrpIg==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@pump-fun/pump-swap-sdk": "^1.13.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2",
+ "undici-types": "^6.20.0"
+ }
+ },
+ "node_modules/@pump-fun/pump-swap-sdk": {
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/@pump-fun/pump-swap-sdk/-/pump-swap-sdk-1.15.0.tgz",
+ "integrity": "sha512-1fuUE2iXjQSLBr/WGjxD7rdlQuTZ4vNYldKHdo5ArCrYt/yGuCw0DlyQJdGdpJbxBzE5tzvnIUoStFdVdHKS4A==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@solana/spl-token": "^0.4.9",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2",
+ "bs58": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@pump-fun/pump-swap-sdk/node_modules/base-x": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz",
+ "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==",
+ "license": "MIT"
+ },
+ "node_modules/@pump-fun/pump-swap-sdk/node_modules/bs58": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz",
+ "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^5.0.0"
+ }
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.60.2",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.2.tgz",
+ "integrity": "sha512-UQjrkIdWrKI626Du8lCQ6MJp/6V1LAo2bOK9OTu4mSn8GGXIkPXk/Vsp4bLHCd9Z9Iz2OTEaokUE90VweJgIYQ==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@solana/buffer-layout": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz",
+ "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer": "~6.0.3"
+ },
+ "engines": {
+ "node": ">=5.10"
+ }
+ },
+ "node_modules/@solana/buffer-layout-utils": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz",
+ "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/web3.js": "^1.32.0",
+ "bigint-buffer": "^1.1.5",
+ "bignumber.js": "^9.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@solana/codecs": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-rc.1.tgz",
+ "integrity": "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/options": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-core": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz",
+ "integrity": "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-data-structures": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz",
+ "integrity": "sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-numbers": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz",
+ "integrity": "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-strings": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz",
+ "integrity": "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "fastestsmallesttextencoderdecoder": "^1.0.22",
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/errors": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-rc.1.tgz",
+ "integrity": "sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "commander": "^12.1.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/options": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-rc.1.tgz",
+ "integrity": "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/spl-token": {
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.14.tgz",
+ "integrity": "sha512-u09zr96UBpX4U685MnvQsNzlvw9TiY005hk1vJmJr7gMJldoPG1eYU5/wNEyOA5lkMLiR/gOi9SFD4MefOYEsA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/buffer-layout-utils": "^0.2.0",
+ "@solana/spl-token-group": "^0.0.7",
+ "@solana/spl-token-metadata": "^0.1.6",
+ "buffer": "^6.0.3"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.5"
+ }
+ },
+ "node_modules/@solana/spl-token-group": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz",
+ "integrity": "sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/spl-token-metadata": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz",
+ "integrity": "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/web3.js": {
+ "version": "1.98.4",
+ "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.4.tgz",
+ "integrity": "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==",
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/runtime": "^7.25.0",
+ "@noble/curves": "^1.4.2",
+ "@noble/hashes": "^1.4.0",
+ "@solana/buffer-layout": "^4.0.1",
+ "@solana/codecs-numbers": "^2.1.0",
+ "agentkeepalive": "^4.5.0",
+ "bn.js": "^5.2.1",
+ "borsh": "^0.7.0",
+ "bs58": "^4.0.1",
+ "buffer": "6.0.3",
+ "fast-stable-stringify": "^1.0.0",
+ "jayson": "^4.1.1",
+ "node-fetch": "^2.7.0",
+ "rpc-websockets": "^9.0.2",
+ "superstruct": "^2.0.2"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-core": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.3.0.tgz",
+ "integrity": "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-numbers": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.3.0.tgz",
+ "integrity": "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.3.0",
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/errors": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.3.0.tgz",
+ "integrity": "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.4.1",
+ "commander": "^14.0.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/superstruct": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz",
+ "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@swc/helpers": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.21.tgz",
+ "integrity": "sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/@types/connect": {
+ "version": "3.4.38",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
+ "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "12.20.55",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
+ "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/uuid": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
+ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/ws": {
+ "version": "7.4.7",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
+ "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/agentkeepalive": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",
+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "humanize-ms": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/bigint-buffer": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz",
+ "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==",
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bindings": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/bignumber.js": {
+ "version": "9.3.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
+ "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
+ "node_modules/bn.js": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz",
+ "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==",
+ "license": "MIT"
+ },
+ "node_modules/borsh": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz",
+ "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.2.0",
+ "bs58": "^4.0.0",
+ "text-encoding-utf-8": "^1.0.2"
+ }
+ },
+ "node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
+ "node_modules/buffer-layout": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz",
+ "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.5"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/commander": {
+ "version": "12.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
+ "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/cross-fetch": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz",
+ "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==",
+ "license": "MIT",
+ "dependencies": {
+ "node-fetch": "^2.7.0"
+ }
+ },
+ "node_modules/delay": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
+ "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/es6-promise": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
+ "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
+ "license": "MIT"
+ },
+ "node_modules/es6-promisify": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
+ "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es6-promise": "^4.0.3"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "node_modules/eyes": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
+ "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==",
+ "engines": {
+ "node": "> 0.1.90"
+ }
+ },
+ "node_modules/fast-stable-stringify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz",
+ "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==",
+ "license": "MIT"
+ },
+ "node_modules/fastestsmallesttextencoderdecoder": {
+ "version": "1.0.22",
+ "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz",
+ "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==",
+ "license": "CC0-1.0",
+ "peer": true
+ },
+ "node_modules/file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "license": "MIT"
+ },
+ "node_modules/humanize-ms": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.0.0"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/isomorphic-ws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
+ "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
+ "node_modules/jayson": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.3.0.tgz",
+ "integrity": "sha512-AauzHcUcqs8OBnCHOkJY280VaTiCm57AbuO7lqzcw7JapGj50BisE3xhksye4zlTSR1+1tAz67wLTl8tEH1obQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/connect": "^3.4.33",
+ "@types/node": "^12.12.54",
+ "@types/ws": "^7.4.4",
+ "commander": "^2.20.3",
+ "delay": "^5.0.0",
+ "es6-promisify": "^5.0.0",
+ "eyes": "^0.1.8",
+ "isomorphic-ws": "^4.0.1",
+ "json-stringify-safe": "^5.0.1",
+ "stream-json": "^1.9.1",
+ "uuid": "^8.3.2",
+ "ws": "^7.5.10"
+ },
+ "bin": {
+ "jayson": "bin/jayson.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/jayson/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "license": "MIT"
+ },
+ "node_modules/json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
+ "license": "ISC"
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-gyp-build": {
+ "version": "4.8.4",
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
+ "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
+ "license": "MIT",
+ "optional": true,
+ "bin": {
+ "node-gyp-build": "bin.js",
+ "node-gyp-build-optional": "optional.js",
+ "node-gyp-build-test": "build-test.js"
+ }
+ },
+ "node_modules/pako": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
+ "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/rpc-websockets": {
+ "version": "9.3.8",
+ "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.8.tgz",
+ "integrity": "sha512-7r+fm4tSJmLf9GvZfL1DJ1SJwpagpp6AazqM0FUaeV7CA+7+NYINSk1syWa4tU/6OF2CyBicLtzENGmXRJH6wQ==",
+ "license": "LGPL-3.0-only",
+ "dependencies": {
+ "@swc/helpers": "^0.5.11",
+ "@types/uuid": "^10.0.0",
+ "@types/ws": "^8.2.2",
+ "buffer": "^6.0.3",
+ "eventemitter3": "^5.0.1",
+ "uuid": "^11.0.0",
+ "ws": "^8.5.0"
+ },
+ "funding": {
+ "type": "paypal",
+ "url": "https://paypal.me/kozjak"
+ },
+ "optionalDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^6.0.0"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/@types/ws": {
+ "version": "8.18.1",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
+ "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/eventemitter3": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
+ "license": "MIT"
+ },
+ "node_modules/rpc-websockets/node_modules/uuid": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
+ "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/esm/bin/uuid"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/ws": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/stream-chain": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz",
+ "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/stream-json": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz",
+ "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "stream-chain": "^2.2.5"
+ }
+ },
+ "node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
+ "node_modules/text-encoding-utf-8": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz",
+ "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg=="
+ },
+ "node_modules/toml": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
+ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
+ "license": "MIT"
+ },
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
+ "license": "MIT"
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "license": "0BSD"
+ },
+ "node_modules/typescript": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
+ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
+ "license": "Apache-2.0",
+ "peer": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.25.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.25.0.tgz",
+ "integrity": "sha512-vOw74RVVYFtnooUkZPxsY1GuuNNupSrCcANIAaDekpZ/Dp1sBuLLl5n2UCKpzxgmOwD66S4Jj24MrhmcDG+0vw==",
+ "license": "MIT"
+ },
+ "node_modules/uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "license": "MIT",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/ws": {
+ "version": "7.5.10",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
+ "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/pump-fun-skills/create-coin/package.json b/pump-fun-skills/create-coin/package.json
new file mode 100644
index 000000000..30e8ed23c
--- /dev/null
+++ b/pump-fun-skills/create-coin/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "@pump-fun-skills/create-coin",
+ "private": true,
+ "version": "1.0.0",
+ "type": "module",
+ "description": "Runnable scripts for the pump-fun create-coin Agent Skill",
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "fetch-coin": "node scripts/fetch-coin.mjs",
+ "build-create-coin-tx": "node scripts/build-create-coin-tx.mjs"
+ },
+ "dependencies": {
+ "@pump-fun/agent-payments-sdk": "^3.0.3",
+ "@pump-fun/pump-sdk": "^1.33.0",
+ "@pump-fun/pump-swap-sdk": "^1.15.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2"
+ }
+}
diff --git a/pump-fun-skills/create-coin/references/METADATA.md b/pump-fun-skills/create-coin/references/METADATA.md
new file mode 100644
index 000000000..f2fb6ca1b
--- /dev/null
+++ b/pump-fun-skills/create-coin/references/METADATA.md
@@ -0,0 +1,162 @@
+# Pump.fun coin metadata JSON
+
+`createV2AndBuyInstructions` expects a **`uri`** pointing at a JSON document (usually hosted on IPFS). The pump.fun web app builds that JSON after uploading the image and metadata.
+
+## Recommended JSON shape
+
+Align with the fields the frontend sends when pinning metadata (see pump.fun app `metadataBuilder` / `api/ipfs` route):
+
+| Field | Type | Notes |
+| ----- | ---- | ----- |
+| `name` | string | Display name |
+| `symbol` | string | Ticker |
+| `description` | string | |
+| `image` | string | HTTPS or `https://ipfs.io/ipfs/{cid}` |
+| `showName` | boolean | Whether to show name on pump.fun |
+| `createdOn` | string | e.g. `"https://pump.fun"` |
+| `twitter` | string | Optional |
+| `telegram` | string | Optional |
+| `website` | string | Optional |
+| `video` | string | Optional (app may use S3 URL for video) |
+
+Example (minimal):
+
+```json
+{
+ "name": "My Coin",
+ "symbol": "MYC",
+ "description": "Short description",
+ "image": "https://ipfs.io/ipfs/bafybeiexample",
+ "showName": true,
+ "createdOn": "https://pump.fun"
+}
+```
+
+## How to obtain `metadataUri`
+
+1. **Your product:** Implement or reuse an upload flow (image → IPFS / object storage, then JSON → IPFS) and pass the final JSON URL to `scripts/build-create-coin-tx.mjs` as `--metadata-uri`.
+2. **Pinata (recommended):** Use the Pinata SDK to upload image and metadata JSON to IPFS — this is the same approach pump.fun's frontend uses. See the full guide below.
+3. **Manual:** Host valid JSON at any HTTPS URL you control for testing (not recommended for production launches).
+
+Never commit private keys or Pinata/JWT secrets into the skill repo or agent logs.
+
+---
+
+## Uploading metadata via Pinata (IPFS)
+
+Pump.fun uses [Pinata](https://pinata.cloud) to pin coin images and metadata JSON to IPFS. You can replicate this flow with your own Pinata account.
+
+### Prerequisites
+
+```bash
+npm install pinata
+```
+
+You need a **Pinata JWT** from your own Pinata account (free tier works). Set it as an environment variable — never hard-code it.
+
+```env
+PINATA_JWT=<your-pinata-jwt>
+```
+
+### Overview
+
+The upload is a two-step process:
+
+1. Upload the **coin image** to IPFS → receive an image CID.
+2. Build the metadata JSON (with the image CID) and upload **that JSON** to IPFS → receive a metadata CID. The final `metadataUri` is `https://ipfs.io/ipfs/{metadataCid}`.
+
+### Full example (Node.js)
+
+```javascript
+import { PinataSDK } from "pinata";
+import fs from "fs";
+import path from "path";
+
+const pinata = new PinataSDK({
+ pinataJwt: process.env.PINATA_JWT,
+});
+
+async function uploadCoinMetadata({
+ imagePath,
+ name,
+ symbol,
+ description,
+ twitter,
+ telegram,
+ website,
+}) {
+ // --- Step 1: Create a presigned upload URL ---
+ // Presigned URLs let you upload from a client without exposing the JWT.
+ // In a server context you can also upload directly (see alternative below).
+ const presignedUrl = await pinata.upload.public.createSignedURL({
+ expires: 60,
+ mimeTypes: ["image/*", "application/json"],
+ maxFileSize: 5_000_000, // 5 MB
+ });
+
+ // --- Step 2: Upload the image ---
+ const imageFile = new File(
+ [fs.readFileSync(imagePath)],
+ path.basename(imagePath),
+ { type: "image/png" }, // adjust mime type as needed
+ );
+ const imageUpload = await pinata.upload.public.file(imageFile).url(presignedUrl);
+ const imageCid = imageUpload.cid;
+ const imageUri = `https://ipfs.io/ipfs/${imageCid}`;
+
+ // --- Step 3: Build the metadata JSON ---
+ const metadata = {
+ name,
+ symbol,
+ description,
+ image: imageUri,
+ showName: true,
+ createdOn: "https://pump.fun",
+ ...(twitter && { twitter }),
+ ...(telegram && { telegram }),
+ ...(website && { website }),
+ };
+
+ // --- Step 4: Upload metadata JSON to IPFS ---
+ // Need a fresh presigned URL for the second upload.
+ const jsonPresignedUrl = await pinata.upload.public.createSignedURL({
+ expires: 60,
+ mimeTypes: ["application/json"],
+ maxFileSize: 5_000_000,
+ });
+ const metadataUpload = await pinata.upload.public.json(metadata).url(jsonPresignedUrl);
+ const metadataUri = `https://ipfs.io/ipfs/${metadataUpload.cid}`;
+
+ console.log("Image URI:", imageUri);
+ console.log("Metadata URI:", metadataUri);
+ return { metadata, metadataUri };
+}
+```
+
+### Alternative: direct upload (no presigned URL)
+
+If you are running server-side and don't need presigned URLs, you can upload directly:
+
+```javascript
+const imageUpload = await pinata.upload.public.file(imageFile);
+const metadataUpload = await pinata.upload.public.json(metadata);
+```
+
+### Using the result
+
+Pass the `metadataUri` to the create scripts:
+
+```bash
+node scripts/build-create-coin-tx.mjs \
+ --user <PUBKEY> \
+ --name "My Coin" \
+ --symbol "MYC" \
+ --metadata-uri "https://ipfs.io/ipfs/<metadata-cid>" \
+ --sol-lamports 1000000
+```
+
+### Important notes
+
+- Each presigned URL is **single-use** and expires after the configured TTL (60 seconds recommended). Generate a fresh one for each upload.
+- The `PINATA_JWT` is a secret. Keep it server-side. In a web app, create a backend endpoint that issues presigned URLs to the client — never send the JWT to the browser.
+- Free Pinata accounts have upload limits. Check [pinata.cloud/pricing](https://pinata.cloud/pricing) for current quotas.
diff --git a/pump-fun-skills/create-coin/scripts/build-create-coin-tx.mjs b/pump-fun-skills/create-coin/scripts/build-create-coin-tx.mjs
new file mode 100644
index 000000000..86aa8db0a
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/build-create-coin-tx.mjs
@@ -0,0 +1,223 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/create-coin
+ *
+ * Build create + initial buy transaction; write mint keypair to disk; partial-sign with mint.
+ * User wallet must co-sign and send (never pass user secret key to this script).
+ */
+import { writeFileSync, mkdirSync } from "node:fs";
+import { dirname, resolve } from "node:path";
+import { parseArgs } from "node:util";
+import BN from "bn.js";
+import { Keypair, PublicKey } from "@solana/web3.js";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ getBuyTokenAmountFromSolAmount,
+} from "@pump-fun/pump-sdk";
+import { PumpAgentOffline } from "@pump-fun/agent-payments-sdk";
+import { getConnection } from "./lib/env.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ printJson,
+ requirePublicKey,
+ requireString,
+} from "./lib/args.mjs";
+import {
+ CREATE_AND_BUY_COMPUTE_UNITS,
+ ALT_ADDRESS_MAINNET,
+ ALT_ADDRESS_DEVNET,
+} from "./lib/constants.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const AGENT_INITIALIZE_DEFAULT_UNITS = 30_000;
+const DEFAULT_BUYBACK_BPS = 5000;
+
+const HELP = `Usage: node scripts/build-create-coin-tx.mjs [options]
+
+Builds createV2AndBuyInstructions, partial-signs with generated mint keypair.
+
+Required:
+ --user <PUBKEY> Creator / fee payer (wallet that will co-sign)
+ --name <string>
+ --symbol <string>
+ --metadata-uri <url> Token metadata JSON URI (see references/METADATA.md)
+ --sol-lamports <int> Initial buy size in lamports (> 0)
+ --mint-keypair-out <path> Write mint secret key here as JSON byte array (never commit)
+
+Optional:
+ --mayhem-mode Enable mayhem mode (default: off)
+ --cashback Enable cashback for this coin (default: off)
+ --tokenized-agent Enable tokenized agent (default: off; requires initial buy > 0)
+ --buyback-bps <int> Buyback basis points for tokenized agent (default: ${DEFAULT_BUYBACK_BPS} = 50%; requires --tokenized-agent)
+ --alt-address <PUBKEY> Address Lookup Table; defaults to mainnet/devnet built-in ALT if omitted
+ --compute-units <int> Default: ${CREATE_AND_BUY_COMPUTE_UNITS} (270k create + 120k buy per frontend constants)
+ --priority-micro-lamports <int> Fixed priority fee; omit to use getPriorityFeeEstimate RPC (floor 100k)
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001; requires --front-runner-protection)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ user: { type: "string" },
+ name: { type: "string" },
+ symbol: { type: "string" },
+ "metadata-uri": { type: "string" },
+ "sol-lamports": { type: "string" },
+ "mint-keypair-out": { type: "string" },
+ "mayhem-mode": { type: "boolean", default: false },
+ cashback: { type: "boolean", default: false },
+ "tokenized-agent": { type: "boolean", default: false },
+ "buyback-bps": { type: "string" },
+ "alt-address": { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-create-coin-tx.mjs", HELP);
+
+ const user = requirePublicKey("--user", values.user);
+ const name = requireString("--name", values.name);
+ const symbol = requireString("--symbol", values.symbol);
+ const metadataUri = requireString("--metadata-uri", values["metadata-uri"]);
+ const solLamportsStr = requireString("--sol-lamports", values["sol-lamports"]);
+ const solLamports = parsePositiveInt(solLamportsStr, 0);
+ if (solLamports <= 0) throw new Error("--sol-lamports must be > 0");
+
+ const outPath = requireString("--mint-keypair-out", values["mint-keypair-out"]);
+ const resolvedOut = resolve(process.cwd(), outPath);
+ const mayhemMode = Boolean(values["mayhem-mode"]);
+ const cashback = Boolean(values.cashback);
+ const tokenizedAgent = Boolean(values["tokenized-agent"]);
+ const buybackBps = values["buyback-bps"] != null
+ ? parsePositiveInt(values["buyback-bps"], DEFAULT_BUYBACK_BPS)
+ : DEFAULT_BUYBACK_BPS;
+
+ if (tokenizedAgent && solLamports <= 0) {
+ throw new Error("--tokenized-agent requires --sol-lamports > 0 (tokenized agent coins cannot be free)");
+ }
+
+ const defaultComputeUnits = CREATE_AND_BUY_COMPUTE_UNITS
+ + (tokenizedAgent ? AGENT_INITIALIZE_DEFAULT_UNITS : 0);
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], defaultComputeUnits)
+ : defaultComputeUnits;
+
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const connection = getConnection();
+
+ const rpcUrl = connection.rpcEndpoint;
+ const isDevnet = rpcUrl.includes("devnet");
+ const defaultAlt = isDevnet ? ALT_ADDRESS_DEVNET : ALT_ADDRESS_MAINNET;
+ const altAddressStr =
+ values["alt-address"]?.trim() ||
+ process.env.NEXT_PUBLIC_SOLANA_ALT_ADDRESS?.trim() ||
+ defaultAlt;
+
+ const onlineSdk = new OnlinePumpSdk(connection);
+ const [global, feeConfig] = await Promise.all([
+ onlineSdk.fetchGlobal(),
+ onlineSdk.fetchFeeConfig(),
+ ]);
+
+ let addressLookupTableAccounts = [];
+ if (altAddressStr) {
+ const altAccount = await connection.getAddressLookupTable(new PublicKey(altAddressStr));
+ if (altAccount.value) {
+ addressLookupTableAccounts = [altAccount.value];
+ }
+ }
+
+ const mintKeypair = Keypair.generate();
+ const mint = mintKeypair.publicKey;
+ const solAmount = new BN(solLamports);
+
+ const tokenAmount = getBuyTokenAmountFromSolAmount({
+ global,
+ feeConfig,
+ mintSupply: null,
+ bondingCurve: null,
+ amount: solAmount,
+ });
+
+ const sdkInstructions = await PUMP_SDK.createV2AndBuyInstructions({
+ global,
+ mint,
+ name,
+ symbol,
+ uri: metadataUri,
+ creator: user,
+ user,
+ amount: tokenAmount,
+ solAmount,
+ mayhemMode,
+ cashback,
+ });
+
+ if (tokenizedAgent) {
+ const agentInitializeIx = await PumpAgentOffline.load(mint).create({
+ authority: user,
+ mint,
+ agentAuthority: user,
+ buybackBps,
+ });
+ sdkInstructions.push(agentInitializeIx);
+ }
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ extraSigners: [mintKeypair],
+ addressLookupTableAccounts,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ mkdirSync(dirname(resolvedOut), { recursive: true });
+ writeFileSync(
+ resolvedOut,
+ `${JSON.stringify(Array.from(mintKeypair.secretKey))}\n`,
+ { mode: 0o600 },
+ );
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ mintPublicKey: mint.toBase58(),
+ mintKeypairPath: resolvedOut,
+ quoteTokenAmount: tokenAmount.toString(),
+ solLamports,
+ mayhemMode,
+ cashback,
+ tokenizedAgent,
+ ...(tokenizedAgent ? { buybackBps } : {}),
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/create-coin/scripts/fetch-coin.mjs b/pump-fun-skills/create-coin/scripts/fetch-coin.mjs
new file mode 100644
index 000000000..7576bd057
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/fetch-coin.mjs
@@ -0,0 +1,58 @@
+#!/usr/bin/env node
+/**
+ * Fetch coin metadata and state flags from pump.fun HTTP API (no RPC).
+ */
+import { parseArgs } from "node:util";
+import { fetchCoinV2 } from "./lib/coin-api.mjs";
+import {
+ exitWithHelp,
+ printJson,
+ requireString,
+} from "./lib/args.mjs";
+
+const HELP = `Usage: node scripts/fetch-coin.mjs --mint <MINT> [--subset]
+
+GET https://frontend-api-v3.pump.fun/coins-v2/{mint}
+
+Options:
+ --mint Coin mint (base58)
+ --subset Only print complete, pump_swap_pool, token_program, bonding_curve
+ -h, --help Show help
+
+Environment:
+ (none — uses public pump.fun API)`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ subset: { type: "boolean", default: false },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("fetch-coin.mjs", HELP);
+
+ const mint = requireString("--mint", values.mint);
+ const coin = await fetchCoinV2(mint);
+
+ if (values.subset) {
+ printJson({
+ complete: coin.complete,
+ pump_swap_pool: coin.pump_swap_pool ?? null,
+ token_program: coin.token_program ?? null,
+ bonding_curve: coin.bonding_curve ?? null,
+ });
+ return;
+ }
+
+ printJson(coin);
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/create-coin/scripts/lib/args.mjs b/pump-fun-skills/create-coin/scripts/lib/args.mjs
new file mode 100644
index 000000000..04263e3a8
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/args.mjs
@@ -0,0 +1,74 @@
+import { parseArgs } from "node:util";
+import { PublicKey } from "@solana/web3.js";
+
+/**
+ * @param {string} label
+ * @param {string | undefined} value
+ * @returns {string}
+ */
+export function requireString(label, value) {
+ if (value == null || String(value).trim() === "") {
+ throw new Error(`${label} is required`);
+ }
+ return String(value).trim();
+}
+
+/**
+ * @param {string} label
+ * @param {string | undefined} value
+ * @returns {import("@solana/web3.js").PublicKey}
+ */
+export function requirePublicKey(label, value) {
+ const s = requireString(label, value);
+ try {
+ return new PublicKey(s);
+ } catch {
+ throw new Error(`${label} is not a valid base58 public key: ${s}`);
+ }
+}
+
+/**
+ * @param {string | undefined} value
+ * @param {number} defaultValue
+ * @returns {number}
+ */
+export function parsePositiveInt(value, defaultValue) {
+ if (value == null || value === "") return defaultValue;
+ const n = Number.parseInt(value, 10);
+ if (!Number.isFinite(n) || n <= 0) {
+ throw new Error(`Expected positive integer, got: ${value}`);
+ }
+ return n;
+}
+
+/**
+ * @param {string | undefined} value
+ * @param {number} defaultValue
+ * @returns {number}
+ */
+export function parseSlippagePercent(value, defaultValue = 10) {
+ if (value == null || value === "") return defaultValue;
+ const n = Number.parseFloat(value);
+ if (!Number.isFinite(n) || n < 0 || n > 100) {
+ throw new Error(`Slippage must be 0–100 (percent), got: ${value}`);
+ }
+ return n;
+}
+
+/**
+ * @param {Record<string, unknown>} obj
+ */
+export function printJson(obj) {
+ process.stdout.write(`${JSON.stringify(obj, null, 0)}\n`);
+}
+
+/**
+ * @param {string} name
+ * @param {string} body
+ */
+export function exitWithHelp(name, body) {
+ process.stderr.write(`${name}\n\n${body}\n`);
+ process.exit(0);
+}
+
+export { parseArgs };
diff --git a/pump-fun-skills/create-coin/scripts/lib/coin-api.mjs b/pump-fun-skills/create-coin/scripts/lib/coin-api.mjs
new file mode 100644
index 000000000..ddee51037
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/coin-api.mjs
@@ -0,0 +1,38 @@
+/** Default coins-v2 prefix; override with PUMP_COINS_V2_BASE if using another backend. */
+const DEFAULT_COINS_V2_BASE = "https://frontend-api-v3.pump.fun/coins-v2";
+
+/** @returns {string} */
+function coinsV2BaseUrl() {
+ const raw = process.env.PUMP_COINS_V2_BASE?.trim();
+ const base = (raw && raw.length > 0 ? raw : DEFAULT_COINS_V2_BASE).replace(
+ /\/+$/,
+ "",
+ );
+ return base;
+}
+
+/**
+ * @param {string} mint
+ * @returns {Promise<Record<string, unknown>>}
+ */
+export async function fetchCoinV2(mint) {
+ const url = `${coinsV2BaseUrl()}/${mint}`;
+ const r = await fetch(url);
+ if (!r.ok) {
+ throw new Error(`coins-v2 request failed: HTTP ${r.status} for mint ${mint}`);
+ }
+ const text = await r.text();
+ if (!text || text.trim().length === 0) {
+ throw new Error(
+ `coins-v2 returned empty response for mint ${mint} (url: ${url}). ` +
+ "If using devnet, set PUMP_COINS_V2_BASE to the devnet coins API.",
+ );
+ }
+ try {
+ return JSON.parse(text);
+ } catch {
+ throw new Error(
+ `coins-v2 returned invalid JSON for mint ${mint}: ${text.slice(0, 200)}`,
+ );
+ }
+}
diff --git a/pump-fun-skills/create-coin/scripts/lib/coin-resolve.mjs b/pump-fun-skills/create-coin/scripts/lib/coin-resolve.mjs
new file mode 100644
index 000000000..e2ef0385e
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/coin-resolve.mjs
@@ -0,0 +1,46 @@
+import { PublicKey } from "@solana/web3.js";
+import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from "@solana/spl-token";
+
+const KNOWN_SPL_TOKEN_PROGRAMS = new Set([
+ TOKEN_PROGRAM_ID.toBase58(),
+ TOKEN_2022_PROGRAM_ID.toBase58(),
+]);
+
+/**
+ * SPL mint accounts are owned by Token or Token-2022 program.
+ * @param {import("@solana/web3.js").Connection} connection
+ * @param {import("@solana/web3.js").PublicKey} mint
+ * @param {import("@solana/web3.js").Commitment} [commitment="confirmed"]
+ * @returns {Promise<import("@solana/web3.js").PublicKey>}
+ */
+export async function tokenProgramIdFromMint(
+ connection,
+ mint,
+ commitment = "confirmed",
+) {
+ const info = await connection.getAccountInfo(mint, commitment);
+ if (!info) {
+ throw new Error(`Mint account not found: ${mint.toBase58()}`);
+ }
+ const owner = info.owner;
+ if (!KNOWN_SPL_TOKEN_PROGRAMS.has(owner.toBase58())) {
+ throw new Error(
+ `Mint owner is not SPL Token or Token-2022: ${owner.toBase58()}`,
+ );
+ }
+ return owner;
+}
+
+/**
+ * @param {Record<string, unknown>} coin
+ * @returns {import("@solana/web3.js").PublicKey}
+ */
+export function poolPublicKeyFromCoin(coin) {
+ const pool = coin?.pump_swap_pool;
+ if (typeof pool !== "string" || !pool.length) {
+ throw new Error(
+ "Coin has no pump_swap_pool — not graduated to AMM or still migrating.",
+ );
+ }
+ return new PublicKey(pool);
+}
diff --git a/pump-fun-skills/create-coin/scripts/lib/compute.mjs b/pump-fun-skills/create-coin/scripts/lib/compute.mjs
new file mode 100644
index 000000000..b0a74d0b0
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/compute.mjs
@@ -0,0 +1,82 @@
+import {
+ ComputeBudgetProgram,
+ TransactionMessage,
+ VersionedTransaction,
+} from "@solana/web3.js";
+
+/** Microlamports */
+export const DEFAULT_PRIORITY_FLOOR = 100_000;
+/** Microlamports — upper bound when RPC returns very high estimates */
+export const MAX_PRIORITY_FEE = 5_000_000;
+
+/**
+ * @param {import("@solana/web3.js").Connection} connection
+ * @param {import("@solana/web3.js").VersionedTransaction} tx
+ * @param {string} [priorityLevel]
+ * @returns {Promise<number>}
+ */
+export async function getPriorityFeeEstimate(
+ connection,
+ tx,
+ priorityLevel = "Medium",
+) {
+ try {
+ const res = await fetch(connection.rpcEndpoint, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ jsonrpc: "2.0",
+ id: "pump-skill-priority",
+ method: "getPriorityFeeEstimate",
+ params: [
+ {
+ transaction: Buffer.from(tx.serialize()).toString("base64"),
+ options: { priorityLevel, transactionEncoding: "base64" },
+ },
+ ],
+ }),
+ });
+ const data = await res.json();
+ if (data.error) throw new Error(data.error.message);
+ const est = data?.result?.priorityFeeEstimate ?? 0;
+ return Math.floor(
+ Math.min(
+ Math.max(Number(est) || 0, DEFAULT_PRIORITY_FLOOR),
+ MAX_PRIORITY_FEE,
+ ),
+ );
+ } catch {
+ return DEFAULT_PRIORITY_FLOOR;
+ }
+}
+
+/**
+ * @param {number} units
+ * @param {number} microLamports
+ * @returns {import("@solana/web3.js").TransactionInstruction[]}
+ */
+export function computeBudgetInstructions(units, microLamports) {
+ return [
+ ComputeBudgetProgram.setComputeUnitLimit({ units }),
+ ComputeBudgetProgram.setComputeUnitPrice({ microLamports }),
+ ];
+}
+
+/**
+ * Draft tx for priority fee RPC (matches pump-solana pattern: high CU + minimal price).
+ * @param {import("@solana/web3.js").PublicKey} payerKey
+ * @param {import("@solana/web3.js").TransactionInstruction[]} sdkInstructions
+ * @returns {import("@solana/web3.js").VersionedTransaction}
+ */
+export function buildDraftTxForFeeEstimate(payerKey, sdkInstructions) {
+ return new VersionedTransaction(
+ new TransactionMessage({
+ payerKey,
+ recentBlockhash: "11111111111111111111111111111111",
+ instructions: [
+ ...computeBudgetInstructions(1_400_000, 1),
+ ...sdkInstructions,
+ ],
+ }).compileToV0Message(),
+ );
+}
diff --git a/pump-fun-skills/create-coin/scripts/lib/constants.mjs b/pump-fun-skills/create-coin/scripts/lib/constants.mjs
new file mode 100644
index 000000000..ad805fc86
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/constants.mjs
@@ -0,0 +1,12 @@
+/** Align with frontend/apps/frontend/stores/blockchainStore/constants.ts */
+export const CREATE_DEFAULT_UNITS = 270_000;
+export const BUY_SELL_DEFAULT_UNITS = 120_000;
+export const AMM_BUY_SELL_DEFAULT_UNITS = 200_000;
+
+/** Create + initial buy on one tx */
+export const CREATE_AND_BUY_COMPUTE_UNITS =
+ CREATE_DEFAULT_UNITS + BUY_SELL_DEFAULT_UNITS;
+
+/** Default Address Lookup Tables per network */
+export const ALT_ADDRESS_MAINNET = "7mFD2mUtRS65XstiSAvCJuYmdesZoQwCwRJhq1p3eRMe";
+export const ALT_ADDRESS_DEVNET = "7y3623xaVQzsLxHRyp1wQD4Pmer5JjgbaagGFAEqCjua";
diff --git a/pump-fun-skills/create-coin/scripts/lib/env.mjs b/pump-fun-skills/create-coin/scripts/lib/env.mjs
new file mode 100644
index 000000000..c50d21ddf
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/env.mjs
@@ -0,0 +1,18 @@
+import { Connection } from "@solana/web3.js";
+
+/** @returns {string} */
+export function getRpcUrl() {
+ const url =
+ process.env.SOLANA_RPC_URL ?? process.env.NEXT_PUBLIC_SOLANA_RPC_URL;
+ if (!url?.trim()) {
+ throw new Error(
+ "SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL must be set (use an HTTPS JSON-RPC endpoint).",
+ );
+ }
+ return url.trim();
+}
+
+/** @returns {import("@solana/web3.js").Connection} */
+export function getConnection() {
+ return new Connection(getRpcUrl(), "confirmed");
+}
diff --git a/pump-fun-skills/create-coin/scripts/lib/jito.mjs b/pump-fun-skills/create-coin/scripts/lib/jito.mjs
new file mode 100644
index 000000000..136015e87
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/jito.mjs
@@ -0,0 +1,84 @@
+import { PublicKey, SystemProgram } from "@solana/web3.js";
+
+const DEFAULT_TIP_LAMPORTS = 100_000; // 0.0001 SOL
+
+const JITO_TIP_ACCOUNTS = [
+ "96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5",
+ "HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe",
+ "Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY",
+ "ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49",
+ "DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh",
+ "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
+ "DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL",
+ "3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT",
+].map((k) => new PublicKey(k));
+
+export const JITO_ENDPOINTS = [
+ "https://mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://london.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://slc.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://singapore.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions",
+];
+
+function randomJitoTipAccount() {
+ return JITO_TIP_ACCOUNTS[
+ Math.floor(Math.random() * JITO_TIP_ACCOUNTS.length)
+ ];
+}
+
+/**
+ * @param {import("@solana/web3.js").PublicKey} payer
+ * @param {number} [tipSol] — tip in SOL (default 0.0001)
+ * @returns {import("@solana/web3.js").TransactionInstruction}
+ */
+export function jitoTipInstruction(payer, tipSol) {
+ const lamports =
+ tipSol != null ? Math.floor(tipSol * 1_000_000_000) : DEFAULT_TIP_LAMPORTS;
+ return SystemProgram.transfer({
+ fromPubkey: payer,
+ toPubkey: randomJitoTipAccount(),
+ lamports,
+ });
+}
+
+/**
+ * Send a base64-encoded transaction to all Jito block engine endpoints.
+ * Resolves with the first successful JSON-RPC result or rejects if all fail.
+ *
+ * @param {string} txBase64
+ * @returns {Promise<string>} Jito response result (usually the signature)
+ */
+export async function sendTransactionToJito(txBase64) {
+ const body = JSON.stringify({
+ jsonrpc: "2.0",
+ id: 1,
+ method: "sendTransaction",
+ params: [txBase64, { encoding: "base64" }],
+ });
+
+ const results = await Promise.allSettled(
+ JITO_ENDPOINTS.map((endpoint) =>
+ fetch(endpoint, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ }).then(async (r) => {
+ const json = await r.json();
+ if (json.error) throw new Error(JSON.stringify(json.error));
+ return json.result;
+ }),
+ ),
+ );
+
+ const first = results.find((r) => r.status === "fulfilled");
+ if (first) return first.value;
+
+ const errors = results.map(
+ (r) => /** @type {PromiseRejectedResult} */ (r).reason?.message ?? r,
+ );
+ throw new Error(`All Jito endpoints failed: ${errors.join("; ")}`);
+}
diff --git a/pump-fun-skills/create-coin/scripts/lib/tx-build.mjs b/pump-fun-skills/create-coin/scripts/lib/tx-build.mjs
new file mode 100644
index 000000000..52f871a3f
--- /dev/null
+++ b/pump-fun-skills/create-coin/scripts/lib/tx-build.mjs
@@ -0,0 +1,67 @@
+import { TransactionMessage, VersionedTransaction } from "@solana/web3.js";
+import {
+ buildDraftTxForFeeEstimate,
+ computeBudgetInstructions,
+ getPriorityFeeEstimate,
+} from "./compute.mjs";
+import { jitoTipInstruction } from "./jito.mjs";
+
+/**
+ * @param {object} opts
+ * @param {import("@solana/web3.js").Connection} opts.connection
+ * @param {import("@solana/web3.js").PublicKey} opts.payerKey
+ * @param {import("@solana/web3.js").TransactionInstruction[]} opts.sdkInstructions
+ * @param {number} opts.computeUnits
+ * @param {number | null | undefined} opts.priorityFeeMicroLamports — if null/undefined, estimate via RPC
+ * @param {import("@solana/web3.js").Keypair[]} [opts.extraSigners]
+ * @param {import("@solana/web3.js").AddressLookupTableAccount[]} [opts.addressLookupTableAccounts]
+ * @param {boolean} [opts.frontRunnerProtection] — when true, adds a Jito tip and the tx should only be sent to Jito
+ * @param {number} [opts.tipSol] — Jito tip in SOL (default 0.0001); only used when frontRunnerProtection is true
+ * @returns {Promise<import("@solana/web3.js").VersionedTransaction>}
+ */
+export async function buildAndPartialSignTx({
+ connection,
+ payerKey,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports,
+ extraSigners = [],
+ addressLookupTableAccounts = [],
+ frontRunnerProtection = false,
+ tipSol,
+}) {
+ let microLamports = priorityFeeMicroLamports;
+ if (microLamports == null) {
+ const draft = buildDraftTxForFeeEstimate(payerKey, sdkInstructions);
+ microLamports = await getPriorityFeeEstimate(connection, draft);
+ }
+
+ const allInstructions = [
+ ...computeBudgetInstructions(computeUnits, microLamports),
+ ...(frontRunnerProtection ? [jitoTipInstruction(payerKey, tipSol)] : []),
+ ...sdkInstructions,
+ ];
+
+ const { blockhash } = await connection.getLatestBlockhash("confirmed");
+ const tx = new VersionedTransaction(
+ new TransactionMessage({
+ payerKey,
+ recentBlockhash: blockhash,
+ instructions: allInstructions,
+ }).compileToV0Message(addressLookupTableAccounts),
+ );
+
+ if (extraSigners.length > 0) {
+ tx.sign(extraSigners);
+ }
+
+ return tx;
+}
+
+/**
+ * @param {import("@solana/web3.js").VersionedTransaction} tx
+ * @returns {string}
+ */
+export function transactionToBase64(tx) {
+ return Buffer.from(tx.serialize()).toString("base64");
+}
diff --git a/pump-fun-skills/swap/.gitignore b/pump-fun-skills/swap/.gitignore
new file mode 100644
index 000000000..c2658d7d1
--- /dev/null
+++ b/pump-fun-skills/swap/.gitignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/pump-fun-skills/swap/SKILL.md b/pump-fun-skills/swap/SKILL.md
new file mode 100644
index 000000000..4bf8159df
--- /dev/null
+++ b/pump-fun-skills/swap/SKILL.md
@@ -0,0 +1,426 @@
+---
+name: swap
+description: >
+ Buy and sell tokens on pump.fun bonding curve and pump swap AMM pool, and
+ query SOL/token balances. Prefer runnable Node scripts in this skill folder;
+ use @pump-fun/pump-sdk and @pump-fun/pump-swap-sdk for custom integrations.
+metadata:
+ author: pump-fun
+ version: "1.0"
+---
+
+# Before Starting Work **Critical** - Ask these from user
+
+**MANDATORY — Do NOT write or modify any code until every item below is answered by the user:**
+
+- [ ] RPC URL provided or a fallback agreed upon (for any on-chain or tx-building step)
+- [ ] **Signer wallet** public key (fee payer / user)
+- [ ] Framework confirmed (Next.js, Express, CLI scripts only, other)
+- [ ] Operation type confirmed (buy or sell)
+- [ ] Coin mint address provided
+- [ ] Amount confirmed (SOL lamports for buy; token smallest units for sell)
+- [ ] Front-runner protection desired? If yes, confirm tip amount (default 0.0001 SOL). Transactions will be sent **only** to Jito block engine endpoints.
+
+You MUST ask the user for ALL unchecked items in your very first response. Do not assume defaults. Do not proceed until the user has explicitly answered each one.
+
+## API (preferred) — `https://fun-block.pump.fun`
+
+Use the API to build swap transactions instead of running scripts directly. The API automatically determines coin state (bonding curve vs AMM) and builds the correct transaction.
+
+### `POST /agents/swap`
+
+Builds a buy or sell transaction. Set `inputMint` to `So11111111111111111111111111111111111111112` (NATIVE_MINT) for buys, or set `outputMint` to NATIVE_MINT for sells.
+
+**Request body:**
+
+```json
+{
+ "inputMint": "So11111111111111111111111111111111111111112",
+ "outputMint": "<TOKEN_MINT>",
+ "amount": "1000000",
+ "user": "<PUBKEY>",
+ "slippagePct": 2,
+ "feePayer": "<PUBKEY>",
+ "frontRunningProtection": false,
+ "tipAmount": 0,
+ "encoding": "base64"
+}
+```
+
+Only `inputMint`, `outputMint`, `amount`, and `user` are required. All other fields have defaults.
+
+> **`tipAmount`** is a Jito tip in **SOL** (e.g. `0.0001` for 100,000 lamports). Only relevant when `frontRunningProtection` is `true`.
+
+> **Encoding:** The API defaults to `"base58"` encoding. **Always pass `"encoding": "base64"`** in the request body — scripts already output base64. When sending the signed transaction to an RPC or Jito endpoint, the encoding used to serialize the transaction must match the `encoding` parameter passed in the send call. Mismatched encodings will cause transaction failures. **Always** explicitly pass `encoding: "base64"` in `sendTransaction` / `simulateTransaction` RPC calls — never rely on the RPC's default.
+
+- **Buy:** `inputMint` = NATIVE_MINT, `outputMint` = token mint, `amount` = SOL in lamports
+- **Sell:** `inputMint` = token mint, `outputMint` = NATIVE_MINT, `amount` = token amount (6 decimals)
+
+**Response:**
+
+```json
+{
+ "transaction": "<base64-encoded VersionedTransaction>",
+ "pumpMintInfo": { "hasGraduated": false, "expectedOutAmount": "123456", "..." : "..." }
+}
+```
+
+Deserialize the `transaction`, have the user wallet sign, and submit to chain.
+
+## Runnable examples (Node scripts — only when user explicitly requests)
+
+Use **`{baseDir}`** as the path to this skill folder (OpenClaw and Agent Skills clients often expose this placeholder).
+
+```bash
+cd {baseDir}
+npm install
+export SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+```
+
+| Operation | Script | Example |
+| --------- | ------ | ------- |
+| Fetch coin state (HTTP) | `scripts/fetch-coin.mjs` | `node scripts/fetch-coin.mjs --mint <MINT> --subset` |
+| Buy (bonding curve) | `scripts/build-buy-bonding-tx.mjs` | `node scripts/build-buy-bonding-tx.mjs --mint <MINT> --user <PUBKEY> --amount 1000000` |
+| Sell (bonding curve) | `scripts/build-sell-bonding-tx.mjs` | `node scripts/build-sell-bonding-tx.mjs --mint <MINT> --user <PUBKEY> --amount 1000000` |
+| Buy (AMM) | `scripts/build-buy-amm-tx.mjs` | `node scripts/build-buy-amm-tx.mjs --mint <MINT> --user <PUBKEY> --amount 1000000` |
+| Sell (AMM) | `scripts/build-sell-amm-tx.mjs` | `node scripts/build-sell-amm-tx.mjs --mint <MINT> --user <PUBKEY> --amount 1000000` |
+| Balances | `scripts/print-balances.mjs` | `node scripts/print-balances.mjs --wallet <PUBKEY> --mint <MINT>` |
+
+- Run any script with `--help` for full flags (`--slippage`, `--compute-units`, `--priority-micro-lamports`, `--front-runner-protection`, `--tip-sol`, `--pool` vs `--mint` for AMM, etc.).
+- Tx builders print **one JSON object** on stdout with `transaction` (base64-encoded VersionedTransaction). **Never** pass end-user private keys into these scripts.
+- **OpenClaw:** If YAML `metadata` ever fails to parse, collapse `metadata` to a single-line JSON object per [OpenClaw skills](https://docs.openclaw.ai/skills/); optional `metadata.openclaw.requires.env: ["SOLANA_RPC_URL"]` can gate load-time eligibility.
+
+## Safety Rules
+
+- **NEVER** log, print, or return private keys or secret key material.
+- **NEVER** sign transactions on behalf of a user — scripts build txs; the user (or their wallet) co-signs and sends.
+- Always validate that amounts are `> 0` before building instructions.
+- Use the correct decimal precision: **9 decimals for SOL** (1 SOL = 1,000,000,000 lamports), **6 decimals for pump tokens**.
+- Always check the coin state (bonding curve vs AMM pool) before choosing the right path.
+- Always apply slippage protection on buy/sell transactions.
+- **NEVER trust `token_program` from the HTTP API** (`coins-v2`). Always fetch the mint account on-chain via `connection.getAccountInfo(mint)` and use `.owner` to determine the correct token program (SPL Token or Token-2022).
+- **Verify imports:** use `@pump-fun/pump-sdk` / `@pump-fun/pump-swap-sdk` (not internal monorepo paths). In TypeScript apps, `BN` from `bn.js` matches what the SDKs expect (Anchor `BN` is the same type in practice).
+
+## Program IDs
+
+| Program | ID |
+| -------- | ---------------------------------------------- |
+| Pump | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` |
+| Pump AMM | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` |
+
+## Environment Variables
+
+```env
+SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+NEXT_PUBLIC_SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+```
+
+The default public mainnet RPC (`https://api.mainnet-beta.solana.com`) often **cannot send** transactions. Confirm an HTTPS RPC with the user. Examples: Solana Tracker public RPC, Ankr `https://rpc.ankr.com/solana`.
+
+## Install
+
+**Inside this skill folder** (includes scripts):
+
+```bash
+cd {baseDir}
+npm install
+```
+
+**Inside another app** (from scratch):
+
+```bash
+npm install @pump-fun/pump-sdk @pump-fun/pump-swap-sdk @solana/web3.js@^1.98.0 @solana/spl-token bn.js
+```
+
+Check `npm info @pump-fun/pump-sdk dependencies` and align `@solana/web3.js` / `@solana/spl-token` versions to avoid duplicate incompatible copies.
+
+## SDK setup (minimal)
+
+```typescript
+import { PUMP_SDK, OnlinePumpSdk } from "@pump-fun/pump-sdk";
+import { PUMP_AMM_SDK, OnlinePumpAmmSdk } from "@pump-fun/pump-swap-sdk";
+import { Connection } from "@solana/web3.js";
+
+const connection = new Connection(process.env.SOLANA_RPC_URL!);
+const onlinePump = new OnlinePumpSdk(connection);
+const onlineAmm = new OnlinePumpAmmSdk(connection);
+```
+
+Full transaction building (compute budget, blockhash, partial sign) is implemented in `scripts/lib/tx-build.mjs` and `scripts/lib/compute.mjs`.
+
+## Determining coin state
+
+Use `node scripts/fetch-coin.mjs --mint <MINT> --subset` or `GET`:
+
+`https://frontend-api-v3.pump.fun/coins-v2/{mint}`
+
+> **CORS-protected:** `frontend-api-v3.pump.fun` does not allow browser-origin requests. When building a web application, always call this endpoint from your backend/server and proxy the result to the frontend. Do not call it directly from client-side JavaScript.
+
+```text
+if (!coin.complete) → bonding curve → PUMP_SDK buy/sell
+else if (coin.pump_swap_pool) → AMM → PUMP_AMM_SDK (pool = pump_swap_pool)
+else → migrating / wait and retry
+```
+
+## Buy tokens (bonding curve)
+
+**Default:** `POST /agents/swap` with `inputMint` = NATIVE_MINT (see API section above)
+**Script (only when user explicitly requests):** `scripts/build-buy-bonding-tx.mjs`
+Requires `complete === false`. Uses `OnlinePumpSdk`, `bondingCurvePda`, `getBuyTokenAmountFromSolAmount`, `getBuySolAmountFromTokenAmount`, `PUMP_SDK.buyInstructions`. `tokenProgram` is the mint account's owner from RPC (`getAccountInfo(mint).owner` — SPL Token or Token-2022).
+
+The buy script performs a two-step quote matching the frontend `blockchainStore.getSwapTx`:
+1. `getBuyTokenAmountFromSolAmount(solInput)` — expected token amount
+2. `getBuySolAmountFromTokenAmount(tokenAmount)` — precise SOL cost (accounts for rounding)
+
+### Parameters (`buyInstructions`)
+
+| Parameter | Type | Description |
+| --------------------------- | ----------------------------- | ------------------ |
+| `global` | `Global` | Global state |
+| `bondingCurveAccountInfo` | `AccountInfo<Buffer>` | Raw account |
+| `bondingCurve` | `BondingCurve` | Decoded |
+| `associatedUserAccountInfo` | `AccountInfo<Buffer> \| null` | User ATA |
+| `mint` / `user` | `PublicKey` | |
+| `amount` | `BN` | Token out (6 dp) |
+| `solAmount` | `BN` | SOL in (lamports) |
+| `slippage` | `number` | **Percent** (below)|
+| `tokenProgram` | `PublicKey` | e.g. Token-2022 |
+
+## Sell tokens (bonding curve)
+
+**Default:** `POST /agents/swap` with `outputMint` = NATIVE_MINT (see API section above)
+**Script (only when user explicitly requests):** `scripts/build-sell-bonding-tx.mjs`
+Uses `getSellSolAmountFromTokenAmount` and `PUMP_SDK.sellInstructions`. Same RPC-derived `tokenProgram` as the buy script.
+
+### Parameters (`sellInstructions`)
+
+| Parameter | Type | Description |
+| ------------------------- | --------------------- | ------------------------------------------------ |
+| `global` | `Global` | Global state |
+| `bondingCurveAccountInfo` | `AccountInfo<Buffer>` | Raw account |
+| `bondingCurve` | `BondingCurve` | Decoded |
+| `mint` / `user` | `PublicKey` | |
+| `amount` | `BN` | Token to sell (6 dp) |
+| `solAmount` | `BN` | Expected SOL out (lamports) |
+| `slippage` | `number` | **Percent** (below) |
+| `tokenProgram` | `PublicKey` | e.g. Token-2022 |
+| `mayhemMode` | `boolean` | Derived from `bondingCurve.isMayhemMode` |
+| `cashback` | `boolean` | Derived from `bondingCurve.isCashbackCoin` |
+
+The sell script reads `mayhemMode` and `cashback` from the decoded on-chain bonding curve account automatically, matching the frontend `blockchainStore.getSwapTx` behavior. No flags needed.
+
+## Buy / sell (AMM, post-graduation)
+
+**Default:** `POST /agents/swap` — the API automatically detects graduated coins and builds AMM transactions.
+**Script (only when user explicitly requests):** `scripts/build-buy-amm-tx.mjs`, `scripts/build-sell-amm-tx.mjs`
+Uses `OnlinePumpAmmSdk.swapSolanaState(pool, user)` and:
+
+- Buy: `PUMP_AMM_SDK.buyQuoteInput` (SOL in) or `PUMP_AMM_SDK.buyBaseInput` (token out)
+- Sell: `PUMP_AMM_SDK.sellBaseInput` (token in) or `PUMP_AMM_SDK.sellQuoteInput` (SOL out target)
+
+## Slippage
+
+The pump bonding SDK takes slippage as a **percentage number** (e.g. `10` = 10%), **not** basis points. Same convention is used in the frontend `getSwapTx` path. The SDK applies it internally (e.g. max SOL cost scales with `floor(slippage * 10) / 1000`).
+
+## Compute units and priority fees
+
+Defaults match the pump.fun app constants (see `scripts/lib/constants.mjs` in this skill):
+
+| Operation | Default compute units |
+| ---------------- | --------------------- |
+| Bonding buy/sell | **120_000** each |
+| AMM buy/sell | **200_000** |
+
+Scripts accept `--compute-units` to override.
+
+**Priority fee:** If `--priority-micro-lamports` is omitted, scripts call Solana JSON-RPC `getPriorityFeeEstimate` on a draft serialized transaction (with a 100k microlamport floor and an upper cap — see `scripts/lib/compute.mjs`). Many RPCs support this; if not, the floor is used.
+
+## Transaction assembly and send
+
+After the user wallet signs, choose the send path based on whether `frontRunnerProtection` is `true` in the script output JSON.
+
+### Default (no front-runner protection)
+
+```typescript
+const signature = await connection.sendRawTransaction(
+ signedTransaction.serialize(),
+ { skipPreflight: false, preflightCommitment: "confirmed" },
+);
+const latestBlockhash = await connection.getLatestBlockhash("confirmed");
+await connection.confirmTransaction(
+ { signature, ...latestBlockhash },
+ "confirmed",
+);
+```
+
+### With front-runner protection (Jito only)
+
+When the transaction was built with `--front-runner-protection`, it already contains a Jito tip instruction. Send it **only** to Jito block engine endpoints — do **not** send via `connection.sendRawTransaction` or any other RPC, as that would leak the transaction to the public mempool and defeat the protection.
+
+```typescript
+import { sendTransactionToJito } from "./lib/jito.mjs";
+
+const txBase64 = Buffer.from(signedTransaction.serialize()).toString("base64");
+const result = await sendTransactionToJito(txBase64);
+```
+
+Or manually via `fetch` (no dependency on the lib):
+
+```typescript
+const JITO_ENDPOINTS = [
+ "https://mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions",
+];
+
+const txBase64 = Buffer.from(signedTransaction.serialize()).toString("base64");
+const body = JSON.stringify({
+ jsonrpc: "2.0", id: 1, method: "sendTransaction",
+ params: [txBase64, { encoding: "base64" }],
+});
+
+await Promise.any(
+ JITO_ENDPOINTS.map((url) =>
+ fetch(url, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ }).then((r) => r.json()),
+ ),
+);
+```
+
+Then confirm as usual with `connection.confirmTransaction`.
+
+## Get balances
+
+**Script:** `scripts/print-balances.mjs` (RPC + optional `--use-profile-api`).
+
+### SOL / token (on-chain)
+
+Use `connection.getBalance` for lamports; `getAssociatedTokenAddressSync` + `getAccount` for the ATA (6 decimals for pump tokens).
+
+### Pump.fun HTTP APIs
+
+`GET https://profile-api.pump.fun/balance/summary/{wallet}`
+
+```json
+{
+ "success": true,
+ "data": {
+ "native_balance": 1.5,
+ "native_lamports": 1500000000,
+ "sol_price": 145.23,
+ "total_value": 217.85
+ }
+}
+```
+
+`GET https://profile-api.pump.fun/balance/tokens/{wallet}?page=1&size=50`
+
+```json
+{
+ "success": true,
+ "data": {
+ "tokens": [
+ {
+ "token_mint": "ABcDeFgHiJkLmNoPqRsTuVwXyZ123456789abcdefg",
+ "token_name": "MyToken",
+ "token_symbol": "MTK",
+ "token_image": "https://ipfs.io/ipfs/Qm...",
+ "token_price": 0.00123,
+ "balance": 5000000,
+ "value": 6.15,
+ "usd_market_cap": 50000
+ }
+ ]
+ },
+ "pagination": { "page": 1, "size": 50, "total": 3, "totalPages": 1 }
+}
+```
+
+`GET https://frontend-api-v3.pump.fun/sol-price`
+
+> **CORS-protected** — call from backend only (see note in "Determining coin state" above).
+
+```json
+{ "solPrice": 145.23 }
+```
+
+## Get coin data (HTTP)
+
+`GET https://frontend-api-v3.pump.fun/coins-v2/{mint}`
+
+> **CORS-protected** — call from backend only (see note in "Determining coin state" above).
+
+```json
+{
+ "mint": "ABcDeFgHiJkLmNoPqRsTuVwXyZ123456789abcdefg",
+ "name": "MyToken",
+ "symbol": "MTK",
+ "description": "A sample token on pump.fun",
+ "image_uri": "https://ipfs.io/ipfs/Qm...",
+ "metadata_uri": "https://ipfs.io/ipfs/Qm...",
+ "creator": "CreatorWalletAddress...",
+ "created_timestamp": 1700000000,
+ "complete": false,
+ "bonding_curve": "BondingCurveAddress...",
+ "associated_bonding_curve": "AssociatedBondingCurveAddress...",
+ "pump_swap_pool": null,
+ "token_program": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
+ "market_cap": 25000000000,
+ "usd_market_cap": 50000,
+ "virtual_sol_reserves": "30000000000",
+ "virtual_token_reserves": "1073000000000000",
+ "total_supply": "1000000000000000",
+ "raydium_pool": "",
+ "program": "pump",
+ "reply_count": 42,
+ "last_trade_timestamp": 1700086400
+}
+```
+
+| Field | Notes |
+| ------------------------ | ------------------------------------------ |
+| `complete` | `true` when graduated off bonding curve |
+| `pump_swap_pool` | AMM pool address when on pump swap |
+| `bonding_curve` | Bonding curve PDA address |
+| `token_program` | **Do NOT trust this value** — always verify on-chain (see below) |
+
+> **NEVER trust `token_program` from the HTTP API.** The `coins-v2` endpoint may return a stale or incorrect `token_program`. Always resolve it on-chain by fetching the mint account and reading its owner:
+>
+> ```typescript
+> const mintAccountInfo = await connection.getAccountInfo(mintPublicKey);
+> const tokenProgram = mintAccountInfo.owner; // TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID
+> ```
+>
+> The skill scripts already do this via `tokenProgramIdFromMint()` in `scripts/lib/coin-resolve.mjs`. Any custom integration **must** do the same.
+
+## Quote helpers (bonding curve)
+
+Pure functions from `@pump-fun/pump-sdk` (see script source for usage):
+
+- `getBuyTokenAmountFromSolAmount`
+- `getBuySolAmountFromTokenAmount`
+- `getSellSolAmountFromTokenAmount`
+
+All need `global`, `feeConfig` (`fetchFeeConfig()`), `mintSupply`, and `bondingCurve`.
+
+## Error handling and troubleshooting
+
+- **`complete === true` but `pump_swap_pool` is null** — migration window; retry later; do not use bonding instructions.
+- **Bonding curve account missing** — wrong mint, wrong network, or uninitialized coin.
+- **`Coin has graduated` / AMM script errors on bonding-only coin** — re-fetch `coins-v2` and switch script path.
+- **Insufficient SOL** — user cannot pay buy amount or fees; check `nativeLamports` before building.
+- **Slippage / simulation failures** — increase slippage cautiously, check pool reserves, retry with fresh blockhash (re-run script).
+- **ATA missing** — first buy may create ATA inside the same tx; if a custom flow fails, ensure ATA creation is included or pre-created.
+- **RPC errors** — rate limits, missing `getPriorityFeeEstimate`, or send blocked; try another RPC; pass `--priority-micro-lamports` explicitly.
+
+## End-to-end flow
+
+1. Confirm operation (buy or sell), mint address, and signer wallet; set `SOLANA_RPC_URL`. Ask if front-runner protection is desired.
+2. Use `POST /agents/swap` — the API automatically determines coin state and builds the correct transaction. Only use scripts if the user explicitly requests them: `fetch-coin` (or HTTP) → check coin state (see decision tree) → choose bonding or AMM script → run the appropriate `build-*` script; capture `transaction`. Add `--front-runner-protection` (and optionally `--tip-sol`) if the user wants Jito-only submission.
+3. Deserialize with `@solana/web3.js` `VersionedTransaction.deserialize`, have user sign.
+4. **Send the transaction:** If `frontRunnerProtection` is `true` in the script output JSON, send **only** to Jito endpoints (see "Transaction assembly and send" above). Otherwise use `sendRawTransaction` + `confirmTransaction`.
diff --git a/pump-fun-skills/swap/package-lock.json b/pump-fun-skills/swap/package-lock.json
new file mode 100644
index 000000000..ff85779a7
--- /dev/null
+++ b/pump-fun-skills/swap/package-lock.json
@@ -0,0 +1,1062 @@
+{
+ "name": "@pump-fun-skills/swap",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@pump-fun-skills/swap",
+ "version": "1.0.0",
+ "dependencies": {
+ "@pump-fun/pump-sdk": "^1.33.0",
+ "@pump-fun/pump-swap-sdk": "^1.15.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.29.2",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
+ "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@coral-xyz/anchor": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.31.1.tgz",
+ "integrity": "sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "node_modules/@coral-xyz/anchor-errors": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.31.1.tgz",
+ "integrity": "sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@coral-xyz/borsh": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.31.1.tgz",
+ "integrity": "sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.1.2",
+ "buffer-layout": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.69.0"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@pump-fun/pump-sdk": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/@pump-fun/pump-sdk/-/pump-sdk-1.33.0.tgz",
+ "integrity": "sha512-Efd0rcqL7P1w3R5RQUeMspWpuejKY/SovMfVZCzrllAB0PoMM8WNYJQinFMxV5f7NdeG6gis+P6ZsmJ+wtrpIg==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@pump-fun/pump-swap-sdk": "^1.13.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2",
+ "undici-types": "^6.20.0"
+ }
+ },
+ "node_modules/@pump-fun/pump-swap-sdk": {
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/@pump-fun/pump-swap-sdk/-/pump-swap-sdk-1.15.0.tgz",
+ "integrity": "sha512-1fuUE2iXjQSLBr/WGjxD7rdlQuTZ4vNYldKHdo5ArCrYt/yGuCw0DlyQJdGdpJbxBzE5tzvnIUoStFdVdHKS4A==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@solana/spl-token": "^0.4.9",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2",
+ "bs58": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@pump-fun/pump-swap-sdk/node_modules/base-x": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz",
+ "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==",
+ "license": "MIT"
+ },
+ "node_modules/@pump-fun/pump-swap-sdk/node_modules/bs58": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz",
+ "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^5.0.0"
+ }
+ },
+ "node_modules/@solana/buffer-layout": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz",
+ "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer": "~6.0.3"
+ },
+ "engines": {
+ "node": ">=5.10"
+ }
+ },
+ "node_modules/@solana/buffer-layout-utils": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz",
+ "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/web3.js": "^1.32.0",
+ "bigint-buffer": "^1.1.5",
+ "bignumber.js": "^9.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@solana/codecs": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-rc.1.tgz",
+ "integrity": "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/options": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-core": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz",
+ "integrity": "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-data-structures": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz",
+ "integrity": "sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-numbers": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz",
+ "integrity": "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-strings": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz",
+ "integrity": "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "fastestsmallesttextencoderdecoder": "^1.0.22",
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/errors": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-rc.1.tgz",
+ "integrity": "sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "commander": "^12.1.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/options": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-rc.1.tgz",
+ "integrity": "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/spl-token": {
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.14.tgz",
+ "integrity": "sha512-u09zr96UBpX4U685MnvQsNzlvw9TiY005hk1vJmJr7gMJldoPG1eYU5/wNEyOA5lkMLiR/gOi9SFD4MefOYEsA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/buffer-layout-utils": "^0.2.0",
+ "@solana/spl-token-group": "^0.0.7",
+ "@solana/spl-token-metadata": "^0.1.6",
+ "buffer": "^6.0.3"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.5"
+ }
+ },
+ "node_modules/@solana/spl-token-group": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz",
+ "integrity": "sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/spl-token-metadata": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz",
+ "integrity": "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/web3.js": {
+ "version": "1.98.4",
+ "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.4.tgz",
+ "integrity": "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==",
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/runtime": "^7.25.0",
+ "@noble/curves": "^1.4.2",
+ "@noble/hashes": "^1.4.0",
+ "@solana/buffer-layout": "^4.0.1",
+ "@solana/codecs-numbers": "^2.1.0",
+ "agentkeepalive": "^4.5.0",
+ "bn.js": "^5.2.1",
+ "borsh": "^0.7.0",
+ "bs58": "^4.0.1",
+ "buffer": "6.0.3",
+ "fast-stable-stringify": "^1.0.0",
+ "jayson": "^4.1.1",
+ "node-fetch": "^2.7.0",
+ "rpc-websockets": "^9.0.2",
+ "superstruct": "^2.0.2"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-core": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.3.0.tgz",
+ "integrity": "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-numbers": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.3.0.tgz",
+ "integrity": "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.3.0",
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/errors": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.3.0.tgz",
+ "integrity": "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.4.1",
+ "commander": "^14.0.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/superstruct": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz",
+ "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@swc/helpers": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.21.tgz",
+ "integrity": "sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/@types/connect": {
+ "version": "3.4.38",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
+ "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "12.20.55",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
+ "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/uuid": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
+ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/ws": {
+ "version": "7.4.7",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
+ "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/agentkeepalive": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",
+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "humanize-ms": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/bigint-buffer": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz",
+ "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==",
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bindings": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/bignumber.js": {
+ "version": "9.3.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
+ "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
+ "node_modules/bn.js": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz",
+ "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==",
+ "license": "MIT"
+ },
+ "node_modules/borsh": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz",
+ "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.2.0",
+ "bs58": "^4.0.0",
+ "text-encoding-utf-8": "^1.0.2"
+ }
+ },
+ "node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
+ "node_modules/buffer-layout": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz",
+ "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.5"
+ }
+ },
+ "node_modules/bufferutil": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz",
+ "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/commander": {
+ "version": "12.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
+ "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/cross-fetch": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz",
+ "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==",
+ "license": "MIT",
+ "dependencies": {
+ "node-fetch": "^2.7.0"
+ }
+ },
+ "node_modules/delay": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
+ "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/es6-promise": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
+ "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
+ "license": "MIT"
+ },
+ "node_modules/es6-promisify": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
+ "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es6-promise": "^4.0.3"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "node_modules/eyes": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
+ "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==",
+ "engines": {
+ "node": "> 0.1.90"
+ }
+ },
+ "node_modules/fast-stable-stringify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz",
+ "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==",
+ "license": "MIT"
+ },
+ "node_modules/fastestsmallesttextencoderdecoder": {
+ "version": "1.0.22",
+ "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz",
+ "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==",
+ "license": "CC0-1.0",
+ "peer": true
+ },
+ "node_modules/file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "license": "MIT"
+ },
+ "node_modules/humanize-ms": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.0.0"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/isomorphic-ws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
+ "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
+ "node_modules/jayson": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.3.0.tgz",
+ "integrity": "sha512-AauzHcUcqs8OBnCHOkJY280VaTiCm57AbuO7lqzcw7JapGj50BisE3xhksye4zlTSR1+1tAz67wLTl8tEH1obQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/connect": "^3.4.33",
+ "@types/node": "^12.12.54",
+ "@types/ws": "^7.4.4",
+ "commander": "^2.20.3",
+ "delay": "^5.0.0",
+ "es6-promisify": "^5.0.0",
+ "eyes": "^0.1.8",
+ "isomorphic-ws": "^4.0.1",
+ "json-stringify-safe": "^5.0.1",
+ "stream-json": "^1.9.1",
+ "uuid": "^8.3.2",
+ "ws": "^7.5.10"
+ },
+ "bin": {
+ "jayson": "bin/jayson.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/jayson/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "license": "MIT"
+ },
+ "node_modules/json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
+ "license": "ISC"
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-gyp-build": {
+ "version": "4.8.4",
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
+ "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
+ "license": "MIT",
+ "optional": true,
+ "bin": {
+ "node-gyp-build": "bin.js",
+ "node-gyp-build-optional": "optional.js",
+ "node-gyp-build-test": "build-test.js"
+ }
+ },
+ "node_modules/pako": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
+ "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/rpc-websockets": {
+ "version": "9.3.8",
+ "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.8.tgz",
+ "integrity": "sha512-7r+fm4tSJmLf9GvZfL1DJ1SJwpagpp6AazqM0FUaeV7CA+7+NYINSk1syWa4tU/6OF2CyBicLtzENGmXRJH6wQ==",
+ "license": "LGPL-3.0-only",
+ "dependencies": {
+ "@swc/helpers": "^0.5.11",
+ "@types/uuid": "^10.0.0",
+ "@types/ws": "^8.2.2",
+ "buffer": "^6.0.3",
+ "eventemitter3": "^5.0.1",
+ "uuid": "^11.0.0",
+ "ws": "^8.5.0"
+ },
+ "funding": {
+ "type": "paypal",
+ "url": "https://paypal.me/kozjak"
+ },
+ "optionalDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^6.0.0"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/@types/ws": {
+ "version": "8.18.1",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
+ "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/eventemitter3": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
+ "license": "MIT"
+ },
+ "node_modules/rpc-websockets/node_modules/utf-8-validate": {
+ "version": "6.0.6",
+ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.6.tgz",
+ "integrity": "sha512-q3l3P9UtEEiAHcsgsqTgf9PPjctrDWoIXW3NpOHFdRDbLvu4DLIcxHangJ4RLrWkBcKjmcs/6NkerI8T/rE4LA==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/uuid": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
+ "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/esm/bin/uuid"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/ws": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/stream-chain": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz",
+ "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/stream-json": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz",
+ "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "stream-chain": "^2.2.5"
+ }
+ },
+ "node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
+ "node_modules/text-encoding-utf-8": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz",
+ "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg=="
+ },
+ "node_modules/toml": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
+ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
+ "license": "MIT"
+ },
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
+ "license": "MIT"
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "license": "0BSD"
+ },
+ "node_modules/typescript": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
+ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
+ "license": "Apache-2.0",
+ "peer": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.25.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.25.0.tgz",
+ "integrity": "sha512-vOw74RVVYFtnooUkZPxsY1GuuNNupSrCcANIAaDekpZ/Dp1sBuLLl5n2UCKpzxgmOwD66S4Jj24MrhmcDG+0vw==",
+ "license": "MIT"
+ },
+ "node_modules/utf-8-validate": {
+ "version": "5.0.10",
+ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz",
+ "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "peer": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "license": "MIT",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/ws": {
+ "version": "7.5.10",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
+ "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/pump-fun-skills/swap/package.json b/pump-fun-skills/swap/package.json
new file mode 100644
index 000000000..271aae061
--- /dev/null
+++ b/pump-fun-skills/swap/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@pump-fun-skills/swap",
+ "private": true,
+ "version": "1.0.0",
+ "type": "module",
+ "description": "Runnable scripts for the pump-fun swap Agent Skill",
+ "engines": {
+ "node": ">=18"
+ },
+ "scripts": {
+ "fetch-coin": "node scripts/fetch-coin.mjs",
+ "build-buy-bonding-tx": "node scripts/build-buy-bonding-tx.mjs",
+ "build-sell-bonding-tx": "node scripts/build-sell-bonding-tx.mjs",
+ "build-buy-amm-tx": "node scripts/build-buy-amm-tx.mjs",
+ "build-sell-amm-tx": "node scripts/build-sell-amm-tx.mjs",
+ "print-balances": "node scripts/print-balances.mjs"
+ },
+ "dependencies": {
+ "@pump-fun/pump-sdk": "^1.33.0",
+ "@pump-fun/pump-swap-sdk": "^1.15.0",
+ "@solana/spl-token": "^0.4.13",
+ "@solana/web3.js": "^1.98.2",
+ "bn.js": "^5.2.2"
+ }
+}
diff --git a/pump-fun-skills/swap/scripts/build-buy-amm-tx.mjs b/pump-fun-skills/swap/scripts/build-buy-amm-tx.mjs
new file mode 100644
index 000000000..b90cedaf5
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/build-buy-amm-tx.mjs
@@ -0,0 +1,166 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/swap
+ * (inputMint = NATIVE_MINT for buy, outputMint = token mint)
+ */
+import { parseArgs } from "node:util";
+import BN from "bn.js";
+import {
+ OnlinePumpAmmSdk,
+ PUMP_AMM_SDK,
+ canonicalPumpPoolPda,
+} from "@pump-fun/pump-swap-sdk";
+import { PUMP_SDK, bondingCurvePda } from "@pump-fun/pump-sdk";
+import { getConnection } from "./lib/env.mjs";
+import { AMM_BUY_SELL_DEFAULT_UNITS } from "./lib/constants.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ parseSlippagePercent,
+ printJson,
+ requirePublicKey,
+ requireString,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const HELP = `Usage: node scripts/build-buy-amm-tx.mjs [options]
+
+Post-graduation AMM buy (coin must have complete === true).
+
+Provide either --pool or --mint (mint derives pool on-chain via bonding curve).
+
+Required:
+ --user <PUBKEY>
+ --amount <int> lamports if mode=quote, token smallest units if mode=base
+
+Optional:
+ --mode <quote|base> Default quote. quote = spend fixed lamports (buyQuoteInput); base = receive fixed token amount (buyBaseInput)
+ --pool <PUBKEY>
+ --mint <PUBKEY>
+ --slippage <percent> Default 5
+ --compute-units <int> Default ${AMM_BUY_SELL_DEFAULT_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001; requires --front-runner-protection)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ user: { type: "string" },
+ mode: { type: "string" },
+ amount: { type: "string" },
+ pool: { type: "string" },
+ mint: { type: "string" },
+ slippage: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-buy-amm-tx.mjs", HELP);
+
+ const user = requirePublicKey("--user", values.user);
+ const mode = (values.mode ?? "quote").toLowerCase();
+ if (mode !== "quote" && mode !== "base") {
+ throw new Error('--mode must be "quote" or "base"');
+ }
+
+ const amountRaw = requireString("--amount", values.amount);
+ const amountBn = new BN(amountRaw, 10);
+ if (amountBn.lte(new BN(0))) throw new Error("--amount must be > 0");
+
+ const poolStr = values.pool;
+ const mintStr = values.mint;
+ if (!poolStr && !mintStr) {
+ throw new Error("Provide --pool or --mint");
+ }
+ if (poolStr && mintStr) {
+ throw new Error("Use only one of --pool or --mint");
+ }
+
+ const connection = getConnection();
+
+ let poolKey;
+ if (poolStr) {
+ poolKey = requirePublicKey("--pool", poolStr);
+ } else {
+ const mintPk = requirePublicKey("--mint", mintStr);
+ const bcAddress = bondingCurvePda(mintPk);
+ const [bcAccountInfo] = await connection.getMultipleAccountsInfo([bcAddress]);
+ if (!bcAccountInfo) {
+ throw new Error("Bonding curve account not found for this mint.");
+ }
+ const bondingCurve = PUMP_SDK.decodeBondingCurve(bcAccountInfo);
+ if (!bondingCurve.complete) {
+ throw new Error(
+ "Coin is not graduated (bondingCurve.complete is false). Use build-buy-bonding-tx.mjs.",
+ );
+ }
+ poolKey = canonicalPumpPoolPda(mintPk);
+ }
+
+ const slippage = parseSlippagePercent(values.slippage, 5);
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], AMM_BUY_SELL_DEFAULT_UNITS)
+ : AMM_BUY_SELL_DEFAULT_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const swapState = await onlineAmmSdk.swapSolanaState(poolKey, user);
+
+ let sdkInstructions;
+ if (mode === "quote") {
+ sdkInstructions = await PUMP_AMM_SDK.buyQuoteInput(
+ swapState,
+ amountBn,
+ slippage,
+ );
+ } else {
+ sdkInstructions = await PUMP_AMM_SDK.buyBaseInput(
+ swapState,
+ amountBn,
+ slippage,
+ );
+ }
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ pool: poolKey.toBase58(),
+ mode,
+ amount: amountBn.toString(),
+ slippagePercent: slippage,
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/swap/scripts/build-buy-bonding-tx.mjs b/pump-fun-skills/swap/scripts/build-buy-bonding-tx.mjs
new file mode 100644
index 000000000..b67d5471d
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/build-buy-bonding-tx.mjs
@@ -0,0 +1,181 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/swap
+ * (inputMint = NATIVE_MINT for buy, outputMint = token mint)
+ */
+import { parseArgs } from "node:util";
+import BN from "bn.js";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ getBuyTokenAmountFromSolAmount,
+ getBuySolAmountFromTokenAmount,
+ bondingCurvePda,
+} from "@pump-fun/pump-sdk";
+import { getAssociatedTokenAddressSync } from "@solana/spl-token";
+import { getConnection } from "./lib/env.mjs";
+import { tokenProgramIdFromMint } from "./lib/coin-resolve.mjs";
+import { BUY_SELL_DEFAULT_UNITS } from "./lib/constants.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ parseSlippagePercent,
+ printJson,
+ requirePublicKey,
+ requireString,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const HELP = `Usage: node scripts/build-buy-bonding-tx.mjs [options]
+
+Bonding-curve buy (coin must have complete === false).
+
+Required:
+ --mint <PUBKEY>
+ --user <PUBKEY>
+ --amount <int> SOL to spend (lamports)
+
+Optional:
+ --slippage <percent> Default 5 (percent, NOT basis points — matches @pump-fun/pump-sdk)
+ --compute-units <int> Default ${BUY_SELL_DEFAULT_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001; requires --front-runner-protection)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ user: { type: "string" },
+ amount: { type: "string" },
+ slippage: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-buy-bonding-tx.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const user = requirePublicKey("--user", values.user);
+ const solLamports = parsePositiveInt(
+ requireString("--amount", values.amount),
+ 0,
+ );
+ if (solLamports <= 0) throw new Error("--amount must be > 0");
+
+ const slippage = parseSlippagePercent(values.slippage, 5);
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], BUY_SELL_DEFAULT_UNITS)
+ : BUY_SELL_DEFAULT_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const connection = getConnection();
+ const tokenProgram = await tokenProgramIdFromMint(connection, mint);
+ const onlineSdk = new OnlinePumpSdk(connection);
+ const [global, feeConfig] = await Promise.all([
+ onlineSdk.fetchGlobal(),
+ onlineSdk.fetchFeeConfig(),
+ ]);
+
+ const bondingCurveAddress = bondingCurvePda(mint);
+ const userAta = getAssociatedTokenAddressSync(
+ mint,
+ user,
+ true,
+ tokenProgram,
+ );
+
+ const [bondingCurveAccountInfo, associatedUserAccountInfo] =
+ await connection.getMultipleAccountsInfo([
+ bondingCurveAddress,
+ userAta,
+ ]);
+
+ if (!bondingCurveAccountInfo) {
+ throw new Error("Bonding curve account not found for this mint.");
+ }
+
+ const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
+ if (bondingCurve.complete) {
+ throw new Error(
+ "On-chain bonding curve is complete. Use AMM script instead.",
+ );
+ }
+
+ const inputSolAmount = new BN(solLamports);
+ const mintSupply = bondingCurve.tokenTotalSupply;
+
+ // Two-step calculation matching the frontend (blockchainStore getSwapTx):
+ // 1. SOL -> expected token amount
+ const tokenAmount = getBuyTokenAmountFromSolAmount({
+ global,
+ feeConfig,
+ mintSupply,
+ bondingCurve,
+ amount: inputSolAmount,
+ });
+
+ // 2. Token amount -> precise SOL cost (accounts for rounding in bonding curve math)
+ const solAmount = getBuySolAmountFromTokenAmount({
+ global,
+ feeConfig,
+ mintSupply,
+ bondingCurve,
+ amount: tokenAmount,
+ });
+
+ const sdkInstructions = await PUMP_SDK.buyInstructions({
+ global,
+ bondingCurveAccountInfo,
+ bondingCurve,
+ associatedUserAccountInfo,
+ mint,
+ user,
+ amount: tokenAmount,
+ solAmount,
+ slippage,
+ tokenProgram,
+ });
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ quoteTokenAmount: tokenAmount.toString(),
+ solLamports: solAmount.toString(),
+ inputSolLamports: solLamports,
+ slippagePercent: slippage,
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/swap/scripts/build-sell-amm-tx.mjs b/pump-fun-skills/swap/scripts/build-sell-amm-tx.mjs
new file mode 100644
index 000000000..56c678d82
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/build-sell-amm-tx.mjs
@@ -0,0 +1,166 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/swap
+ * (inputMint = token mint for sell, outputMint = NATIVE_MINT)
+ */
+import { parseArgs } from "node:util";
+import BN from "bn.js";
+import {
+ OnlinePumpAmmSdk,
+ PUMP_AMM_SDK,
+ canonicalPumpPoolPda,
+} from "@pump-fun/pump-swap-sdk";
+import { PUMP_SDK, bondingCurvePda } from "@pump-fun/pump-sdk";
+import { getConnection } from "./lib/env.mjs";
+import { AMM_BUY_SELL_DEFAULT_UNITS } from "./lib/constants.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ parseSlippagePercent,
+ printJson,
+ requirePublicKey,
+ requireString,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const HELP = `Usage: node scripts/build-sell-amm-tx.mjs [options]
+
+Post-graduation AMM sell.
+
+Provide either --pool or --mint (mint derives pool on-chain via bonding curve).
+
+Required:
+ --user <PUBKEY>
+ --amount <int> token smallest units if mode=base; lamports if mode=quote
+
+Optional:
+ --mode <base|quote> Default base. base = sell fixed token amount (sellBaseInput); quote = target SOL out in lamports (sellQuoteInput)
+ --pool <PUBKEY>
+ --mint <PUBKEY>
+ --slippage <percent> Default 5
+ --compute-units <int> Default ${AMM_BUY_SELL_DEFAULT_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001; requires --front-runner-protection)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ user: { type: "string" },
+ mode: { type: "string" },
+ amount: { type: "string" },
+ pool: { type: "string" },
+ mint: { type: "string" },
+ slippage: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-sell-amm-tx.mjs", HELP);
+
+ const user = requirePublicKey("--user", values.user);
+ const mode = (values.mode ?? "base").toLowerCase();
+ if (mode !== "base" && mode !== "quote") {
+ throw new Error('--mode must be "base" or "quote"');
+ }
+
+ const amountRaw = requireString("--amount", values.amount);
+ const amountBn = new BN(amountRaw, 10);
+ if (amountBn.lte(new BN(0))) throw new Error("--amount must be > 0");
+
+ const poolStr = values.pool;
+ const mintStr = values.mint;
+ if (!poolStr && !mintStr) {
+ throw new Error("Provide --pool or --mint");
+ }
+ if (poolStr && mintStr) {
+ throw new Error("Use only one of --pool or --mint");
+ }
+
+ const connection = getConnection();
+
+ let poolKey;
+ if (poolStr) {
+ poolKey = requirePublicKey("--pool", poolStr);
+ } else {
+ const mintPk = requirePublicKey("--mint", mintStr);
+ const bcAddress = bondingCurvePda(mintPk);
+ const [bcAccountInfo] = await connection.getMultipleAccountsInfo([bcAddress]);
+ if (!bcAccountInfo) {
+ throw new Error("Bonding curve account not found for this mint.");
+ }
+ const bondingCurve = PUMP_SDK.decodeBondingCurve(bcAccountInfo);
+ if (!bondingCurve.complete) {
+ throw new Error(
+ "Coin is not graduated (bondingCurve.complete is false). Use build-sell-bonding-tx.mjs.",
+ );
+ }
+ poolKey = canonicalPumpPoolPda(mintPk);
+ }
+
+ const slippage = parseSlippagePercent(values.slippage, 5);
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], AMM_BUY_SELL_DEFAULT_UNITS)
+ : AMM_BUY_SELL_DEFAULT_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const onlineAmmSdk = new OnlinePumpAmmSdk(connection);
+ const swapState = await onlineAmmSdk.swapSolanaState(poolKey, user);
+
+ let sdkInstructions;
+ if (mode === "base") {
+ sdkInstructions = await PUMP_AMM_SDK.sellBaseInput(
+ swapState,
+ amountBn,
+ slippage,
+ );
+ } else {
+ sdkInstructions = await PUMP_AMM_SDK.sellQuoteInput(
+ swapState,
+ amountBn,
+ slippage,
+ );
+ }
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ pool: poolKey.toBase58(),
+ mode,
+ amount: amountBn.toString(),
+ slippagePercent: slippage,
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/swap/scripts/build-sell-bonding-tx.mjs b/pump-fun-skills/swap/scripts/build-sell-bonding-tx.mjs
new file mode 100644
index 000000000..493000673
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/build-sell-bonding-tx.mjs
@@ -0,0 +1,155 @@
+#!/usr/bin/env node
+/**
+ * Only use this script when the user explicitly requests it. Default: POST https://fun-block.pump.fun/agents/swap
+ * (inputMint = token mint for sell, outputMint = NATIVE_MINT)
+ */
+import { parseArgs } from "node:util";
+import BN from "bn.js";
+import {
+ PUMP_SDK,
+ OnlinePumpSdk,
+ getSellSolAmountFromTokenAmount,
+ bondingCurvePda,
+} from "@pump-fun/pump-sdk";
+import { getConnection } from "./lib/env.mjs";
+import { tokenProgramIdFromMint } from "./lib/coin-resolve.mjs";
+import { BUY_SELL_DEFAULT_UNITS } from "./lib/constants.mjs";
+import {
+ exitWithHelp,
+ parsePositiveInt,
+ parseSlippagePercent,
+ printJson,
+ requirePublicKey,
+ requireString,
+} from "./lib/args.mjs";
+import { buildAndPartialSignTx, transactionToBase64 } from "./lib/tx-build.mjs";
+
+const HELP = `Usage: node scripts/build-sell-bonding-tx.mjs [options]
+
+Bonding-curve sell (coin must have complete === false).
+
+Required:
+ --mint <PUBKEY>
+ --user <PUBKEY>
+ --amount <int> Amount to sell in smallest units (6 decimals)
+
+Optional:
+ --slippage <percent> Default 5
+ --compute-units <int> Default ${BUY_SELL_DEFAULT_UNITS}
+ --priority-micro-lamports <int>
+ --front-runner-protection Add Jito tip; send ONLY to Jito endpoints
+ --tip-sol <float> Jito tip in SOL (default 0.0001; requires --front-runner-protection)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ user: { type: "string" },
+ amount: { type: "string" },
+ slippage: { type: "string" },
+ "compute-units": { type: "string" },
+ "priority-micro-lamports": { type: "string" },
+ "front-runner-protection": { type: "boolean", default: false },
+ "tip-sol": { type: "string" },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("build-sell-bonding-tx.mjs", HELP);
+
+ const mint = requirePublicKey("--mint", values.mint);
+ const user = requirePublicKey("--user", values.user);
+ const tokenAmt = requireString("--amount", values.amount);
+ const amount = new BN(tokenAmt, 10);
+ if (amount.lte(new BN(0))) throw new Error("--amount must be > 0");
+
+ const slippage = parseSlippagePercent(values.slippage, 5);
+ const computeUnits = values["compute-units"]
+ ? parsePositiveInt(values["compute-units"], BUY_SELL_DEFAULT_UNITS)
+ : BUY_SELL_DEFAULT_UNITS;
+ const priorityOverride =
+ values["priority-micro-lamports"] != null &&
+ values["priority-micro-lamports"] !== ""
+ ? parsePositiveInt(values["priority-micro-lamports"], 1)
+ : null;
+ const frontRunnerProtection = Boolean(values["front-runner-protection"]);
+ const tipSol = values["tip-sol"] != null ? Number.parseFloat(values["tip-sol"]) : undefined;
+ if (tipSol != null && (Number.isNaN(tipSol) || tipSol < 0)) throw new Error("--tip-sol must be a non-negative number");
+
+ const connection = getConnection();
+ const tokenProgram = await tokenProgramIdFromMint(connection, mint);
+ const onlineSdk = new OnlinePumpSdk(connection);
+ const [global, feeConfig] = await Promise.all([
+ onlineSdk.fetchGlobal(),
+ onlineSdk.fetchFeeConfig(),
+ ]);
+
+ const bondingCurveAddress = bondingCurvePda(mint);
+ const [bondingCurveAccountInfo] = await connection.getMultipleAccountsInfo([
+ bondingCurveAddress,
+ ]);
+
+ if (!bondingCurveAccountInfo) {
+ throw new Error("Bonding curve account not found for this mint.");
+ }
+
+ const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
+ if (bondingCurve.complete) {
+ throw new Error("On-chain bonding curve is complete. Use AMM script instead.");
+ }
+
+ const mintSupply = bondingCurve.tokenTotalSupply;
+ const solAmount = getSellSolAmountFromTokenAmount({
+ global,
+ feeConfig,
+ mintSupply,
+ bondingCurve,
+ amount,
+ });
+
+ const sdkInstructions = await PUMP_SDK.sellInstructions({
+ global,
+ bondingCurveAccountInfo,
+ bondingCurve,
+ mint,
+ user,
+ amount,
+ solAmount,
+ slippage,
+ tokenProgram,
+ mayhemMode: bondingCurve.isMayhemMode ?? false,
+ cashback: bondingCurve.isCashbackCoin ?? false,
+ });
+
+ const tx = await buildAndPartialSignTx({
+ connection,
+ payerKey: user,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports: priorityOverride,
+ frontRunnerProtection,
+ tipSol,
+ });
+
+ printJson({
+ transaction: transactionToBase64(tx),
+ quoteSolLamports: solAmount.toString(),
+ tokenAmount: amount.toString(),
+ slippagePercent: slippage,
+ mayhemMode: bondingCurve.isMayhemMode ?? false,
+ cashback: bondingCurve.isCashbackCoin ?? false,
+ frontRunnerProtection,
+ });
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/swap/scripts/fetch-coin.mjs b/pump-fun-skills/swap/scripts/fetch-coin.mjs
new file mode 100644
index 000000000..7576bd057
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/fetch-coin.mjs
@@ -0,0 +1,58 @@
+#!/usr/bin/env node
+/**
+ * Fetch coin metadata and state flags from pump.fun HTTP API (no RPC).
+ */
+import { parseArgs } from "node:util";
+import { fetchCoinV2 } from "./lib/coin-api.mjs";
+import {
+ exitWithHelp,
+ printJson,
+ requireString,
+} from "./lib/args.mjs";
+
+const HELP = `Usage: node scripts/fetch-coin.mjs --mint <MINT> [--subset]
+
+GET https://frontend-api-v3.pump.fun/coins-v2/{mint}
+
+Options:
+ --mint Coin mint (base58)
+ --subset Only print complete, pump_swap_pool, token_program, bonding_curve
+ -h, --help Show help
+
+Environment:
+ (none — uses public pump.fun API)`;
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ mint: { type: "string" },
+ subset: { type: "boolean", default: false },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("fetch-coin.mjs", HELP);
+
+ const mint = requireString("--mint", values.mint);
+ const coin = await fetchCoinV2(mint);
+
+ if (values.subset) {
+ printJson({
+ complete: coin.complete,
+ pump_swap_pool: coin.pump_swap_pool ?? null,
+ token_program: coin.token_program ?? null,
+ bonding_curve: coin.bonding_curve ?? null,
+ });
+ return;
+ }
+
+ printJson(coin);
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/swap/scripts/lib/args.mjs b/pump-fun-skills/swap/scripts/lib/args.mjs
new file mode 100644
index 000000000..04263e3a8
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/args.mjs
@@ -0,0 +1,74 @@
+import { parseArgs } from "node:util";
+import { PublicKey } from "@solana/web3.js";
+
+/**
+ * @param {string} label
+ * @param {string | undefined} value
+ * @returns {string}
+ */
+export function requireString(label, value) {
+ if (value == null || String(value).trim() === "") {
+ throw new Error(`${label} is required`);
+ }
+ return String(value).trim();
+}
+
+/**
+ * @param {string} label
+ * @param {string | undefined} value
+ * @returns {import("@solana/web3.js").PublicKey}
+ */
+export function requirePublicKey(label, value) {
+ const s = requireString(label, value);
+ try {
+ return new PublicKey(s);
+ } catch {
+ throw new Error(`${label} is not a valid base58 public key: ${s}`);
+ }
+}
+
+/**
+ * @param {string | undefined} value
+ * @param {number} defaultValue
+ * @returns {number}
+ */
+export function parsePositiveInt(value, defaultValue) {
+ if (value == null || value === "") return defaultValue;
+ const n = Number.parseInt(value, 10);
+ if (!Number.isFinite(n) || n <= 0) {
+ throw new Error(`Expected positive integer, got: ${value}`);
+ }
+ return n;
+}
+
+/**
+ * @param {string | undefined} value
+ * @param {number} defaultValue
+ * @returns {number}
+ */
+export function parseSlippagePercent(value, defaultValue = 10) {
+ if (value == null || value === "") return defaultValue;
+ const n = Number.parseFloat(value);
+ if (!Number.isFinite(n) || n < 0 || n > 100) {
+ throw new Error(`Slippage must be 0–100 (percent), got: ${value}`);
+ }
+ return n;
+}
+
+/**
+ * @param {Record<string, unknown>} obj
+ */
+export function printJson(obj) {
+ process.stdout.write(`${JSON.stringify(obj, null, 0)}\n`);
+}
+
+/**
+ * @param {string} name
+ * @param {string} body
+ */
+export function exitWithHelp(name, body) {
+ process.stderr.write(`${name}\n\n${body}\n`);
+ process.exit(0);
+}
+
+export { parseArgs };
diff --git a/pump-fun-skills/swap/scripts/lib/coin-api.mjs b/pump-fun-skills/swap/scripts/lib/coin-api.mjs
new file mode 100644
index 000000000..ddee51037
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/coin-api.mjs
@@ -0,0 +1,38 @@
+/** Default coins-v2 prefix; override with PUMP_COINS_V2_BASE if using another backend. */
+const DEFAULT_COINS_V2_BASE = "https://frontend-api-v3.pump.fun/coins-v2";
+
+/** @returns {string} */
+function coinsV2BaseUrl() {
+ const raw = process.env.PUMP_COINS_V2_BASE?.trim();
+ const base = (raw && raw.length > 0 ? raw : DEFAULT_COINS_V2_BASE).replace(
+ /\/+$/,
+ "",
+ );
+ return base;
+}
+
+/**
+ * @param {string} mint
+ * @returns {Promise<Record<string, unknown>>}
+ */
+export async function fetchCoinV2(mint) {
+ const url = `${coinsV2BaseUrl()}/${mint}`;
+ const r = await fetch(url);
+ if (!r.ok) {
+ throw new Error(`coins-v2 request failed: HTTP ${r.status} for mint ${mint}`);
+ }
+ const text = await r.text();
+ if (!text || text.trim().length === 0) {
+ throw new Error(
+ `coins-v2 returned empty response for mint ${mint} (url: ${url}). ` +
+ "If using devnet, set PUMP_COINS_V2_BASE to the devnet coins API.",
+ );
+ }
+ try {
+ return JSON.parse(text);
+ } catch {
+ throw new Error(
+ `coins-v2 returned invalid JSON for mint ${mint}: ${text.slice(0, 200)}`,
+ );
+ }
+}
diff --git a/pump-fun-skills/swap/scripts/lib/coin-resolve.mjs b/pump-fun-skills/swap/scripts/lib/coin-resolve.mjs
new file mode 100644
index 000000000..e2ef0385e
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/coin-resolve.mjs
@@ -0,0 +1,46 @@
+import { PublicKey } from "@solana/web3.js";
+import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from "@solana/spl-token";
+
+const KNOWN_SPL_TOKEN_PROGRAMS = new Set([
+ TOKEN_PROGRAM_ID.toBase58(),
+ TOKEN_2022_PROGRAM_ID.toBase58(),
+]);
+
+/**
+ * SPL mint accounts are owned by Token or Token-2022 program.
+ * @param {import("@solana/web3.js").Connection} connection
+ * @param {import("@solana/web3.js").PublicKey} mint
+ * @param {import("@solana/web3.js").Commitment} [commitment="confirmed"]
+ * @returns {Promise<import("@solana/web3.js").PublicKey>}
+ */
+export async function tokenProgramIdFromMint(
+ connection,
+ mint,
+ commitment = "confirmed",
+) {
+ const info = await connection.getAccountInfo(mint, commitment);
+ if (!info) {
+ throw new Error(`Mint account not found: ${mint.toBase58()}`);
+ }
+ const owner = info.owner;
+ if (!KNOWN_SPL_TOKEN_PROGRAMS.has(owner.toBase58())) {
+ throw new Error(
+ `Mint owner is not SPL Token or Token-2022: ${owner.toBase58()}`,
+ );
+ }
+ return owner;
+}
+
+/**
+ * @param {Record<string, unknown>} coin
+ * @returns {import("@solana/web3.js").PublicKey}
+ */
+export function poolPublicKeyFromCoin(coin) {
+ const pool = coin?.pump_swap_pool;
+ if (typeof pool !== "string" || !pool.length) {
+ throw new Error(
+ "Coin has no pump_swap_pool — not graduated to AMM or still migrating.",
+ );
+ }
+ return new PublicKey(pool);
+}
diff --git a/pump-fun-skills/swap/scripts/lib/compute.mjs b/pump-fun-skills/swap/scripts/lib/compute.mjs
new file mode 100644
index 000000000..b0a74d0b0
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/compute.mjs
@@ -0,0 +1,82 @@
+import {
+ ComputeBudgetProgram,
+ TransactionMessage,
+ VersionedTransaction,
+} from "@solana/web3.js";
+
+/** Microlamports */
+export const DEFAULT_PRIORITY_FLOOR = 100_000;
+/** Microlamports — upper bound when RPC returns very high estimates */
+export const MAX_PRIORITY_FEE = 5_000_000;
+
+/**
+ * @param {import("@solana/web3.js").Connection} connection
+ * @param {import("@solana/web3.js").VersionedTransaction} tx
+ * @param {string} [priorityLevel]
+ * @returns {Promise<number>}
+ */
+export async function getPriorityFeeEstimate(
+ connection,
+ tx,
+ priorityLevel = "Medium",
+) {
+ try {
+ const res = await fetch(connection.rpcEndpoint, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ jsonrpc: "2.0",
+ id: "pump-skill-priority",
+ method: "getPriorityFeeEstimate",
+ params: [
+ {
+ transaction: Buffer.from(tx.serialize()).toString("base64"),
+ options: { priorityLevel, transactionEncoding: "base64" },
+ },
+ ],
+ }),
+ });
+ const data = await res.json();
+ if (data.error) throw new Error(data.error.message);
+ const est = data?.result?.priorityFeeEstimate ?? 0;
+ return Math.floor(
+ Math.min(
+ Math.max(Number(est) || 0, DEFAULT_PRIORITY_FLOOR),
+ MAX_PRIORITY_FEE,
+ ),
+ );
+ } catch {
+ return DEFAULT_PRIORITY_FLOOR;
+ }
+}
+
+/**
+ * @param {number} units
+ * @param {number} microLamports
+ * @returns {import("@solana/web3.js").TransactionInstruction[]}
+ */
+export function computeBudgetInstructions(units, microLamports) {
+ return [
+ ComputeBudgetProgram.setComputeUnitLimit({ units }),
+ ComputeBudgetProgram.setComputeUnitPrice({ microLamports }),
+ ];
+}
+
+/**
+ * Draft tx for priority fee RPC (matches pump-solana pattern: high CU + minimal price).
+ * @param {import("@solana/web3.js").PublicKey} payerKey
+ * @param {import("@solana/web3.js").TransactionInstruction[]} sdkInstructions
+ * @returns {import("@solana/web3.js").VersionedTransaction}
+ */
+export function buildDraftTxForFeeEstimate(payerKey, sdkInstructions) {
+ return new VersionedTransaction(
+ new TransactionMessage({
+ payerKey,
+ recentBlockhash: "11111111111111111111111111111111",
+ instructions: [
+ ...computeBudgetInstructions(1_400_000, 1),
+ ...sdkInstructions,
+ ],
+ }).compileToV0Message(),
+ );
+}
diff --git a/pump-fun-skills/swap/scripts/lib/constants.mjs b/pump-fun-skills/swap/scripts/lib/constants.mjs
new file mode 100644
index 000000000..ad805fc86
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/constants.mjs
@@ -0,0 +1,12 @@
+/** Align with frontend/apps/frontend/stores/blockchainStore/constants.ts */
+export const CREATE_DEFAULT_UNITS = 270_000;
+export const BUY_SELL_DEFAULT_UNITS = 120_000;
+export const AMM_BUY_SELL_DEFAULT_UNITS = 200_000;
+
+/** Create + initial buy on one tx */
+export const CREATE_AND_BUY_COMPUTE_UNITS =
+ CREATE_DEFAULT_UNITS + BUY_SELL_DEFAULT_UNITS;
+
+/** Default Address Lookup Tables per network */
+export const ALT_ADDRESS_MAINNET = "7mFD2mUtRS65XstiSAvCJuYmdesZoQwCwRJhq1p3eRMe";
+export const ALT_ADDRESS_DEVNET = "7y3623xaVQzsLxHRyp1wQD4Pmer5JjgbaagGFAEqCjua";
diff --git a/pump-fun-skills/swap/scripts/lib/env.mjs b/pump-fun-skills/swap/scripts/lib/env.mjs
new file mode 100644
index 000000000..c50d21ddf
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/env.mjs
@@ -0,0 +1,18 @@
+import { Connection } from "@solana/web3.js";
+
+/** @returns {string} */
+export function getRpcUrl() {
+ const url =
+ process.env.SOLANA_RPC_URL ?? process.env.NEXT_PUBLIC_SOLANA_RPC_URL;
+ if (!url?.trim()) {
+ throw new Error(
+ "SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL must be set (use an HTTPS JSON-RPC endpoint).",
+ );
+ }
+ return url.trim();
+}
+
+/** @returns {import("@solana/web3.js").Connection} */
+export function getConnection() {
+ return new Connection(getRpcUrl(), "confirmed");
+}
diff --git a/pump-fun-skills/swap/scripts/lib/jito.mjs b/pump-fun-skills/swap/scripts/lib/jito.mjs
new file mode 100644
index 000000000..136015e87
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/jito.mjs
@@ -0,0 +1,84 @@
+import { PublicKey, SystemProgram } from "@solana/web3.js";
+
+const DEFAULT_TIP_LAMPORTS = 100_000; // 0.0001 SOL
+
+const JITO_TIP_ACCOUNTS = [
+ "96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5",
+ "HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe",
+ "Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY",
+ "ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49",
+ "DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh",
+ "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
+ "DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL",
+ "3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT",
+].map((k) => new PublicKey(k));
+
+export const JITO_ENDPOINTS = [
+ "https://mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://amsterdam.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://frankfurt.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://london.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://ny.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://slc.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://singapore.mainnet.block-engine.jito.wtf/api/v1/transactions",
+ "https://tokyo.mainnet.block-engine.jito.wtf/api/v1/transactions",
+];
+
+function randomJitoTipAccount() {
+ return JITO_TIP_ACCOUNTS[
+ Math.floor(Math.random() * JITO_TIP_ACCOUNTS.length)
+ ];
+}
+
+/**
+ * @param {import("@solana/web3.js").PublicKey} payer
+ * @param {number} [tipSol] — tip in SOL (default 0.0001)
+ * @returns {import("@solana/web3.js").TransactionInstruction}
+ */
+export function jitoTipInstruction(payer, tipSol) {
+ const lamports =
+ tipSol != null ? Math.floor(tipSol * 1_000_000_000) : DEFAULT_TIP_LAMPORTS;
+ return SystemProgram.transfer({
+ fromPubkey: payer,
+ toPubkey: randomJitoTipAccount(),
+ lamports,
+ });
+}
+
+/**
+ * Send a base64-encoded transaction to all Jito block engine endpoints.
+ * Resolves with the first successful JSON-RPC result or rejects if all fail.
+ *
+ * @param {string} txBase64
+ * @returns {Promise<string>} Jito response result (usually the signature)
+ */
+export async function sendTransactionToJito(txBase64) {
+ const body = JSON.stringify({
+ jsonrpc: "2.0",
+ id: 1,
+ method: "sendTransaction",
+ params: [txBase64, { encoding: "base64" }],
+ });
+
+ const results = await Promise.allSettled(
+ JITO_ENDPOINTS.map((endpoint) =>
+ fetch(endpoint, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body,
+ }).then(async (r) => {
+ const json = await r.json();
+ if (json.error) throw new Error(JSON.stringify(json.error));
+ return json.result;
+ }),
+ ),
+ );
+
+ const first = results.find((r) => r.status === "fulfilled");
+ if (first) return first.value;
+
+ const errors = results.map(
+ (r) => /** @type {PromiseRejectedResult} */ (r).reason?.message ?? r,
+ );
+ throw new Error(`All Jito endpoints failed: ${errors.join("; ")}`);
+}
diff --git a/pump-fun-skills/swap/scripts/lib/tx-build.mjs b/pump-fun-skills/swap/scripts/lib/tx-build.mjs
new file mode 100644
index 000000000..52f871a3f
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/lib/tx-build.mjs
@@ -0,0 +1,67 @@
+import { TransactionMessage, VersionedTransaction } from "@solana/web3.js";
+import {
+ buildDraftTxForFeeEstimate,
+ computeBudgetInstructions,
+ getPriorityFeeEstimate,
+} from "./compute.mjs";
+import { jitoTipInstruction } from "./jito.mjs";
+
+/**
+ * @param {object} opts
+ * @param {import("@solana/web3.js").Connection} opts.connection
+ * @param {import("@solana/web3.js").PublicKey} opts.payerKey
+ * @param {import("@solana/web3.js").TransactionInstruction[]} opts.sdkInstructions
+ * @param {number} opts.computeUnits
+ * @param {number | null | undefined} opts.priorityFeeMicroLamports — if null/undefined, estimate via RPC
+ * @param {import("@solana/web3.js").Keypair[]} [opts.extraSigners]
+ * @param {import("@solana/web3.js").AddressLookupTableAccount[]} [opts.addressLookupTableAccounts]
+ * @param {boolean} [opts.frontRunnerProtection] — when true, adds a Jito tip and the tx should only be sent to Jito
+ * @param {number} [opts.tipSol] — Jito tip in SOL (default 0.0001); only used when frontRunnerProtection is true
+ * @returns {Promise<import("@solana/web3.js").VersionedTransaction>}
+ */
+export async function buildAndPartialSignTx({
+ connection,
+ payerKey,
+ sdkInstructions,
+ computeUnits,
+ priorityFeeMicroLamports,
+ extraSigners = [],
+ addressLookupTableAccounts = [],
+ frontRunnerProtection = false,
+ tipSol,
+}) {
+ let microLamports = priorityFeeMicroLamports;
+ if (microLamports == null) {
+ const draft = buildDraftTxForFeeEstimate(payerKey, sdkInstructions);
+ microLamports = await getPriorityFeeEstimate(connection, draft);
+ }
+
+ const allInstructions = [
+ ...computeBudgetInstructions(computeUnits, microLamports),
+ ...(frontRunnerProtection ? [jitoTipInstruction(payerKey, tipSol)] : []),
+ ...sdkInstructions,
+ ];
+
+ const { blockhash } = await connection.getLatestBlockhash("confirmed");
+ const tx = new VersionedTransaction(
+ new TransactionMessage({
+ payerKey,
+ recentBlockhash: blockhash,
+ instructions: allInstructions,
+ }).compileToV0Message(addressLookupTableAccounts),
+ );
+
+ if (extraSigners.length > 0) {
+ tx.sign(extraSigners);
+ }
+
+ return tx;
+}
+
+/**
+ * @param {import("@solana/web3.js").VersionedTransaction} tx
+ * @returns {string}
+ */
+export function transactionToBase64(tx) {
+ return Buffer.from(tx.serialize()).toString("base64");
+}
diff --git a/pump-fun-skills/swap/scripts/print-balances.mjs b/pump-fun-skills/swap/scripts/print-balances.mjs
new file mode 100644
index 000000000..4c6564027
--- /dev/null
+++ b/pump-fun-skills/swap/scripts/print-balances.mjs
@@ -0,0 +1,119 @@
+#!/usr/bin/env node
+/**
+ * SOL balance via RPC; optional token ATA for a mint; optional pump profile HTTP API.
+ */
+import { parseArgs } from "node:util";
+import {
+ getAccount,
+ getAssociatedTokenAddressSync,
+} from "@solana/spl-token";
+import { getConnection } from "./lib/env.mjs";
+import { tokenProgramIdFromMint } from "./lib/coin-resolve.mjs";
+import {
+ exitWithHelp,
+ printJson,
+ requirePublicKey,
+} from "./lib/args.mjs";
+
+const HELP = `Usage: node scripts/print-balances.mjs [options]
+
+Options:
+ --wallet <PUBKEY> Required
+ --mint <PUBKEY> If set, include on-chain token balance (ATA for mint)
+ --use-profile-api Also fetch profile-api.pump.fun summary + token list (HTTP)
+ -h, --help
+
+Environment:
+ SOLANA_RPC_URL or NEXT_PUBLIC_SOLANA_RPC_URL (required for --mint and native balance)`;
+
+async function fetchProfileSummary(wallet) {
+ const r = await fetch(
+ `https://profile-api.pump.fun/balance/summary/${wallet}`,
+ );
+ if (!r.ok) throw new Error(`profile summary HTTP ${r.status}`);
+ return r.json();
+}
+
+async function fetchProfileTokens(wallet, page = 1, size = 50) {
+ const r = await fetch(
+ `https://profile-api.pump.fun/balance/tokens/${wallet}?page=${page}&size=${size}`,
+ );
+ if (!r.ok) throw new Error(`profile tokens HTTP ${r.status}`);
+ return r.json();
+}
+
+async function main() {
+ const { values } = parseArgs({
+ args: process.argv.slice(2),
+ options: {
+ wallet: { type: "string" },
+ mint: { type: "string" },
+ "use-profile-api": { type: "boolean", default: false },
+ help: { type: "boolean", short: "h" },
+ },
+ strict: true,
+ allowPositionals: false,
+ });
+
+ if (values.help) exitWithHelp("print-balances.mjs", HELP);
+
+ const wallet = requirePublicKey("--wallet", values.wallet);
+
+ const out = { wallet: wallet.toBase58() };
+
+ const needRpc = Boolean(values.mint) || !values["use-profile-api"];
+
+ let connection;
+ if (needRpc) {
+ connection = getConnection();
+ const lamports = await connection.getBalance(wallet);
+ out.nativeLamports = lamports;
+ out.nativeSol = lamports / 1e9;
+ }
+
+ if (values.mint) {
+ const mint = requirePublicKey("--mint", values.mint);
+ const tokenProgram = await tokenProgramIdFromMint(
+ /** @type {import("@solana/web3.js").Connection} */ (connection),
+ mint,
+ );
+ const ata = getAssociatedTokenAddressSync(
+ mint,
+ wallet,
+ true,
+ tokenProgram,
+ );
+ out.tokenMint = mint.toBase58();
+ out.associatedTokenAccount = ata.toBase58();
+ try {
+ const acc = await getAccount(
+ /** @type {import("@solana/web3.js").Connection} */ (connection),
+ ata,
+ "confirmed",
+ tokenProgram,
+ );
+ out.tokenRawAmount = acc.amount.toString();
+ out.tokenUiAmount = Number(acc.amount) / 1e6;
+ } catch {
+ out.tokenRawAmount = "0";
+ out.tokenUiAmount = 0;
+ out.tokenNote = "ATA missing or empty";
+ }
+ }
+
+ if (values["use-profile-api"]) {
+ const [summary, tokens] = await Promise.all([
+ fetchProfileSummary(wallet.toBase58()),
+ fetchProfileTokens(wallet.toBase58()),
+ ]);
+ out.profileSummary = summary;
+ out.profileTokens = tokens;
+ }
+
+ printJson(out);
+}
+
+main().catch((e) => {
+ process.stderr.write(`${e?.message ?? e}\n`);
+ process.exit(1);
+});
diff --git a/pump-fun-skills/tokenized-agents/SCENARIOS.md b/pump-fun-skills/tokenized-agents/SCENARIOS.md
new file mode 100644
index 000000000..d5dea0759
--- /dev/null
+++ b/pump-fun-skills/tokenized-agents/SCENARIOS.md
@@ -0,0 +1,45 @@
+# Scenario Tests
+
+## Scenario 1: Happy Path — Pay and Verify
+
+1. Agent generates invoice: amount `1000000` (1 USDC), memo `42`, startTime `1700000000`, endTime `1700086400`.
+2. Server calls `buildAcceptPaymentInstructions` and serializes the instructions as JSON.
+3. Client reconstructs instructions, signs, and submits the transaction on Solana via `sendTransaction`.
+4. Server calls `validateInvoicePayment` with the same params.
+5. Returns `true`. Agent delivers the service.
+
+## Scenario 2: Verify Before Payment
+
+1. Agent generates invoice: amount `500000`, memo `7777`, valid for 1 hour.
+2. Server immediately calls `validateInvoicePayment` (user hasn't paid yet).
+3. Returns `false`.
+4. Agent tells the user payment is not confirmed and to try again after paying.
+
+## Scenario 3: Duplicate Payment Rejection
+
+1. Agent generates invoice with memo `99`.
+2. User pays successfully. `validateInvoicePayment` returns `true`.
+3. A second attempt to submit the same `acceptPayment` transaction is rejected by the on-chain program because the Invoice ID PDA is already initialized.
+
+## Scenario 4: Mismatched Parameters
+
+1. Agent generates invoice: amount `1000000`, memo `555`.
+2. User pays with a different amount (`2000000`) but same memo.
+3. `validateInvoicePayment` with original params returns `false` — the on-chain event has a different amount.
+
+## Scenario 5: Expired Invoice
+
+1. Agent generates invoice with `endTime` in the past.
+2. The on-chain program rejects the transaction (timestamp outside validity window).
+3. Agent should generate a new invoice with a valid time window.
+
+---
+
+## Troubleshooting
+
+| Error | Cause | Fix |
+|---|---|---|
+| `validateInvoicePayment` returns `false` but user claims they paid | Transaction may still be confirming, or params don't match | Wait a few seconds and retry. Double-check that `amount`, `memo`, `startTime`, `endTime`, and `user` all match exactly. |
+| Invoice already paid | The Invoice ID PDA is already initialized | Generate a new invoice with a different `memo`. |
+| Insufficient balance | User's token account doesn't have enough tokens | Tell the user to fund their wallet before paying. |
+| Currency not supported | The `currencyMint` is not in the protocol's `GlobalConfig` | Use a supported currency (USDC, wSOL). |
diff --git a/pump-fun-skills/tokenized-agents/SKILL.md b/pump-fun-skills/tokenized-agents/SKILL.md
new file mode 100644
index 000000000..f0f26bffd
--- /dev/null
+++ b/pump-fun-skills/tokenized-agents/SKILL.md
@@ -0,0 +1,496 @@
+---
+name: tokenized-agents
+description: >
+ Use when the user wants to charge users for actions. Use @pump-fun/agent-payments-sdk, to build Solana payment transactions, verify on-chain invoice payments, or integrate Solana wallet adapters for agent payment flows.
+metadata:
+ author: pump-fun
+ version: "1.1"
+---
+
+## Before Starting Work
+
+**MANDATORY — Do NOT write or modify any code until every item below is answered by the user:**
+
+- [ ] Agent token mint address (from pump.fun)
+- [ ] Payment currency decided (USDC or SOL)
+- [ ] Price/amount confirmed (in smallest unit)
+- [ ] RPC URL provided or a fallback agreed upon
+- [ ] Framework confirmed (Next.js, Express, other)
+
+You MUST ask the user for ALL unchecked items in your very first response. Do not assume defaults. Do not proceed until the user has explicitly answered each one.
+
+## Safety Rules
+
+- **NEVER** log, print, or return private keys or secret key material.
+- **NEVER** sign transactions on behalf of a user — you build the instruction, the user signs.
+- Always validate that `amount > 0` before creating an invoice.
+- Always ensure `endTime > startTime` and both are valid Unix timestamps.
+- Use the correct decimal precision for the currency (6 decimals for USDC, 9 for SOL).
+- **Always verify payments on the server** using `validateInvoicePayment` before delivering any service. Never trust the client alone — clients can be spoofed.
+- **Always verify your code against this skill before finalizing.** Before delivering generated code, re-read the relevant sections of this document and confirm:
+ - Parameter types match the documented signatures — `buildAcceptPaymentInstructions` accepts `number` for numeric fields, `validateInvoicePayment` accepts `number`, and `getInvoiceIdPDA` accepts `number`.
+ - Parameter ordering and names match exactly.
+ - Default values (e.g. `computeUnitLimit` defaults to `100_000`) are not contradicted.
+ - Import paths use `@pump-fun/agent-payments-sdk`, not internal module paths.
+
+## Supported Currencies
+
+| Currency | Decimals | Smallest unit example |
+| ----------- | -------- | --------------------- |
+| USDC | 6 | `1000000` = 1 USDC |
+| Wrapped SOL | 9 | `1000000000` = 1 SOL |
+
+## Environment Variables
+
+Create a `.env` (or `.env.local` for Next.js) file with the following:
+
+```env
+# Solana RPC — server-side (used to build transactions and verify payments)
+SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+
+# Solana RPC — client-side (used by wallet adapter in the browser)
+NEXT_PUBLIC_SOLANA_RPC_URL=https://rpc.solanatracker.io/public
+
+# The token mint address of your tokenized agent on pump.fun
+AGENT_TOKEN_MINT_ADDRESS=<your-agent-mint-address>
+
+# Payment currency mint
+# USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
+# SOL (wrapped): So11111111111111111111111111111111111111112
+CURRENCY_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
+```
+
+**RPC for mainnet-beta:** The default Solana public RPC (`https://api.mainnet-beta.solana.com`) does **not** support sending transactions. You MUST ask the user which RPC endpoint to use. Present these free mainnet-beta options if the user does not have their own:
+
+- **Solana Tracker** — `https://rpc.solanatracker.io/public`
+- **Ankr** — `https://rpc.ankr.com/solana`
+
+Do NOT silently pick one — wait for the user to confirm before proceeding.
+
+Read these values from `process.env` at runtime. Never hard-code mint addresses or RPC URLs.
+
+## Install
+
+```bash
+npm install @pump-fun/[email protected] @solana/web3.js@^1.98.0
+```
+
+### Dependency Compatibility — IMPORTANT
+
+`@pump-fun/agent-payments-sdk` depends on `@solana/web3.js` and `@solana/spl-token`. When the app also installs these packages directly, mismatched versions can cause runtime errors.
+
+**Rules:**
+
+1. Before installing `@solana/web3.js`, `@solana/spl-token`, or any `@solana/wallet-adapter-*` package, first check what versions `@pump-fun/agent-payments-sdk` declares in its own `package.json` (inspect it via `npm info @pump-fun/agent-payments-sdk dependencies`). Install the same ranges — or ranges that resolve to the same major.minor — so npm/pnpm hoists a single copy instead of two.
+2. Never blindly install "latest" for these shared packages. Always prefer the version that is most compatible with the latest `@pump-fun/agent-payments-sdk`.
+3. If the project already has these packages at different versions, align them to match the SDK and re-install.
+
+## SDK Setup
+
+`PumpAgent` is the main class. It can build payment instructions and verify invoices.
+
+```typescript
+import { PumpAgent } from "@pump-fun/agent-payments-sdk";
+import { PublicKey } from "@solana/web3.js";
+
+const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
+```
+
+### Constructor
+
+```typescript
+new PumpAgent(mint: PublicKey, environment?: "mainnet" | "devnet", connection?: Connection)
+```
+
+| Parameter | Type | Default | Description |
+| ------------- | ------------------------- | ----------- | ------------------------------------------------------------- |
+| `mint` | `PublicKey` | — | The tokenized agent's token mint address |
+| `environment` | `"mainnet"` \| `"devnet"` | `"mainnet"` | Network environment |
+| `connection` | `Connection` (optional) | `undefined` | Solana RPC connection (enables RPC fallback for verification) |
+
+**Without connection** — enough for building instructions and HTTP-based payment verification:
+
+```typescript
+const agent = new PumpAgent(agentMint);
+```
+
+**With connection** — also enables RPC-based verification fallback and balance queries:
+
+```typescript
+import { Connection } from "@solana/web3.js";
+
+const connection = new Connection(process.env.SOLANA_RPC_URL!);
+const agent = new PumpAgent(agentMint, "mainnet", connection);
+```
+
+## Wallet Integration (Frontend)
+
+Install `@solana/wallet-adapter-react`, `@solana/wallet-adapter-react-ui`, and `@solana/wallet-adapter-wallets`. Use `useWallet()` for `publicKey` and `signTransaction`, and `useConnection()` for the active RPC connection. MUST See [https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/references/WALLET_INTEGRATION.md](https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/references/WALLET_INTEGRATION.md) for the full WalletProvider setup, layout wrapping, and hook usage.
+
+## Building Payment Instructions
+
+Use `buildAcceptPaymentInstructions` to get all the instructions needed for a payment. This is the recommended method — it automatically derives the user's token account and handles native SOL wrapping/unwrapping.
+
+### Parameters (`BuildAcceptPaymentParams`)
+
+| Parameter | Type | Description |
+| ------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------- |
+| `user` | `PublicKey` | The payer's wallet address |
+| `currencyMint` | `PublicKey` | Mint address of the payment currency (USDC, wSOL) |
+| `amount` | `bigint \| number \| string` | Price in the currency's smallest unit |
+| `memo` | `bigint \| number \| string` | Unique invoice identifier (random number) |
+| `startTime` | `bigint \| number \| string` | Unix timestamp — when the invoice becomes valid |
+| `endTime` | `bigint \| number \| string` | Unix timestamp — when the invoice expires |
+| `tokenProgram` | `PublicKey` (optional) | Token program for the currency (defaults to SPL Token) |
+| `computeUnitLimit` | `number` (optional) | Compute unit budget (default `100_000`). Increase if transactions fail with compute exceeded. |
+| `computeUnitPrice` | `number` (optional) | Priority fee in microlamports per CU. If provided, a `SetComputeUnitPrice` instruction is prepended. |
+
+### Example
+
+```typescript
+const ixs = await agent.buildAcceptPaymentInstructions({
+ user: userPublicKey,
+ currencyMint,
+ amount: "1000000", // 1 USDC
+ memo: "123456789", // unique invoice identifier
+ startTime: "1700000000", // valid from
+ endTime: "1700086400", // expires at
+});
+```
+
+### What It Returns
+
+The returned `TransactionInstruction[]` always starts with compute budget instructions, followed by the payment instructions:
+
+- **`SetComputeUnitLimit`** is always prepended (default `100_000` CU). Override via `computeUnitLimit` if your transactions fail with "compute exceeded".
+- **`SetComputeUnitPrice`** is prepended only when `computeUnitPrice` is provided. Use this to set a priority fee for faster landing during congestion.
+
+After the compute budget prefix:
+
+- **For SPL tokens (USDC):** The accept-payment instruction.
+- **For native SOL:** Instructions that handle wrapping/unwrapping automatically:
+ 1. Create the user's wrapped SOL token account (idempotent)
+ 2. Transfer SOL lamports into that token account
+ 3. Sync the native balance
+ 4. The accept-payment instruction
+ 5. Close the wrapped SOL account (returns rent back to user)
+
+You do not need to handle SOL wrapping or compute budget yourself — `buildAcceptPaymentInstructions` does it for you.
+
+### Important
+
+- The `amount`, `memo`, `startTime`, and `endTime` must exactly match when verifying later.
+- Each unique combination of `(mint, currencyMint, amount, memo, startTime, endTime)` can only be paid once — the on-chain Invoice ID PDA prevents duplicate payments.
+- Generate a unique `memo` for each invoice (e.g. `Math.floor(Math.random() * 900000000000) + 100000`).
+
+## Deriving the Invoice ID
+
+The Invoice ID is a PDA (`PublicKey`) that uniquely identifies an invoice on-chain. It is derived deterministically from the six invoice parameters. Both `buildAcceptPaymentInstructions` and `validateInvoicePayment` derive it internally, but you can also compute it yourself.
+
+### Import
+
+```typescript
+import { getInvoiceIdPDA } from "@pump-fun/agent-payments-sdk";
+import { PublicKey } from "@solana/web3.js";
+```
+
+### Usage
+
+`getInvoiceIdPDA` returns `[PublicKey, number]`. The first element is the Invoice ID; the second is the PDA bump seed.
+
+```typescript
+const tokenMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
+const currencyMint = new PublicKey(process.env.CURRENCY_MINT!);
+
+const amount = 1000000;
+const memo = 123456789;
+const startTime = 1700000000;
+const endTime = 1700086400;
+
+const [invoiceId] = getInvoiceIdPDA(
+ tokenMint,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+);
+
+console.log("Invoice ID:", invoiceId.toBase58());
+```
+
+All numeric parameters (`amount`, `memo`, `startTime`, `endTime`) are plain `number` values. BN conversion is handled internally.
+
+### PDA Seeds
+
+The Invoice ID is derived with program `AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7` using these seeds:
+
+| Seed index | Value |
+| ---------- | ------------------------------------ |
+| 0 | `"invoice-id"` (UTF-8 bytes) |
+| 1 | `tokenMint` (32 bytes) |
+| 2 | `currencyMint` (32 bytes) |
+| 3 | `amount` (8 bytes, little-endian) |
+| 4 | `memo` (8 bytes, little-endian) |
+| 5 | `startTime` (8 bytes, little-endian) |
+| 6 | `endTime` (8 bytes, little-endian) |
+
+Because the PDA is deterministic, the same six parameters always produce the same Invoice ID. The on-chain program uses this to reject duplicate payments — once an Invoice ID PDA is created, the same combination cannot be paid again.
+
+### When to Use
+
+- **Pre-check for duplicates** — before building a payment transaction, check if the Invoice ID account already exists on-chain to avoid submitting a transaction that will fail:
+
+```typescript
+const [invoiceId] = getInvoiceIdPDA(
+ tokenMint,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+);
+const accountInfo = await connection.getAccountInfo(invoiceId);
+if (accountInfo !== null) {
+ // This invoice was already paid — generate a new memo
+}
+```
+
+- **Debugging** — if a payment transaction fails or verification returns `false`, derive the Invoice ID and inspect it on a Solana explorer to see whether the account exists.
+
+## Full Transaction Flow — Server to Client
+
+This is the complete flow for building a transaction on the server, signing it on the client, and sending it on-chain.
+
+### Step 1: Generate Invoice Parameters (Server)
+
+```typescript
+function generateInvoiceParams() {
+ const memo = Math.floor(Math.random() * 900000000000) + 100000;
+ const now = Math.floor(Date.now() / 1000);
+ const startTime = now;
+ const endTime = now + 86400; // valid for 24 hours
+ const amount = Number(process.env.PRICE_AMOUNT) || 1000000; // e.g. 1 USDC
+
+ return { amount, memo, startTime, endTime };
+}
+```
+
+### Step 2: Build Transaction and Serialize as Base64 (Server)
+
+Build the payment instructions, assemble them into a full `Transaction` with a recent blockhash and fee payer, then serialize the unsigned transaction as a base64 string for the client.
+
+```typescript
+import { Connection, PublicKey, Transaction } from "@solana/web3.js";
+import { PumpAgent } from "@pump-fun/agent-payments-sdk";
+
+async function buildPaymentTransaction(params: {
+ userWallet: string;
+ amount: string;
+ memo: string;
+ startTime: string;
+ endTime: string;
+}) {
+ const connection = new Connection(process.env.SOLANA_RPC_URL!);
+ const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
+ const currencyMint = new PublicKey(process.env.CURRENCY_MINT!);
+
+ const agent = new PumpAgent(agentMint, "mainnet", connection);
+ const userPublicKey = new PublicKey(params.userWallet);
+
+ const instructions = await agent.buildAcceptPaymentInstructions({
+ user: userPublicKey,
+ currencyMint,
+ amount: params.amount,
+ memo: params.memo,
+ startTime: params.startTime,
+ endTime: params.endTime,
+ });
+
+ const { blockhash } = await connection.getLatestBlockhash("confirmed");
+
+ const tx = new Transaction();
+ tx.recentBlockhash = blockhash;
+ tx.feePayer = userPublicKey;
+ tx.add(...instructions);
+
+ const serializedTx = tx
+ .serialize({ requireAllSignatures: false })
+ .toString("base64");
+
+ return { transaction: serializedTx };
+}
+```
+
+Return the base64 transaction string (and the invoice params like `memo`, `startTime`, `endTime`) to the client as JSON.
+
+### Step 3: Deserialize, Sign, and Send the Transaction (Client)
+
+Deserialize the base64 transaction from the server, sign it with `signTransaction` from the wallet adapter, then send and confirm it. Call `useWallet()` and `useConnection()` only at the top level of your component; pass `signTransaction` and `connection` into the async helper so the async logic does not call hooks.
+
+**Async helper** (e.g. in a utils file or alongside your component):
+
+```typescript
+import { Connection, Transaction } from "@solana/web3.js";
+
+async function signAndSendPayment(
+ txBase64: string,
+ signTransaction: (tx: Transaction) => Promise<Transaction>,
+ connection: Connection,
+): Promise<string> {
+ if (!signTransaction) {
+ throw new Error("Wallet does not support signing");
+ }
+
+ const tx = Transaction.from(Buffer.from(txBase64, "base64"));
+ const signedTx = await signTransaction(tx);
+
+ const signature = await connection.sendRawTransaction(signedTx.serialize(), {
+ skipPreflight: false,
+ preflightCommitment: "confirmed",
+ });
+
+ const latestBlockhash = await connection.getLatestBlockhash("confirmed");
+ await connection.confirmTransaction(
+ { signature, ...latestBlockhash },
+ "confirmed",
+ );
+
+ return signature;
+}
+```
+
+**Component usage** — call the hooks at the top level, then pass them into the helper (e.g. from a payment button handler):
+
+```typescript
+import { useWallet, useConnection } from "@solana/wallet-adapter-react";
+
+function PaymentButton({ txBase64 }: { txBase64: string }) {
+ const { signTransaction } = useWallet();
+ const { connection } = useConnection();
+
+ const handlePay = async () => {
+ if (!signTransaction) return;
+ await signAndSendPayment(txBase64, signTransaction, connection);
+ };
+
+ return <button onClick={handlePay}>Pay</button>;
+}
+```
+
+The wallet prompts the user to approve. After signing, the serialized transaction is submitted via `sendRawTransaction` and you wait for on-chain confirmation.
+
+## Verify Payment
+
+Use `validateInvoicePayment` to confirm that a specific invoice was paid on-chain.
+
+### How It Works
+
+1. **Derives the Invoice ID PDA** from the six parameters `(mint, currencyMint, amount, memo, startTime, endTime)` using `getInvoiceIdPDA` internally. The resulting `PublicKey` uniquely identifies the invoice on-chain.
+2. **Queries the Pump HTTP API** — sends a GET request with `invoice-id` (base58) and `mint` as query parameters. If the endpoint returns a response, it validates **every field** individually:
+ - `data.user` === `user` (base58)
+ - `data.tokenized_agent_mint` === `mint` (base58)
+ - `data.currency_mint` === `currencyMint` (base58)
+ - `data.amount` === `amount` (BN equality)
+ - `data.memo` === `memo` (BN equality)
+ - `data.start_time` === `startTime` (BN equality)
+ - `data.end_time` === `endTime` (BN equality)
+
+ All seven checks must pass for the method to return `true`.
+
+3. **RPC fallback** — if the HTTP API is unavailable (network error or non-200 status) **and** a `Connection` was provided to the `PumpAgent` constructor, it falls back to scanning on-chain transaction logs. It fetches all signatures for the Invoice ID address, parses each transaction's logs for the `agentAcceptPaymentEvent` event, and performs the same field-by-field validation. Without a `Connection`, there is no fallback and the method returns `false`.
+4. Returns `true` if a matching payment event is found by either path, `false` otherwise.
+
+### Parameters
+
+| Parameter | Type | Description |
+| -------------- | ----------- | ----------------------------------- |
+| `user` | `PublicKey` | The wallet that paid |
+| `currencyMint` | `PublicKey` | Currency used for payment |
+| `amount` | `number` | Amount paid (smallest unit) |
+| `memo` | `number` | The invoice memo |
+| `startTime` | `number` | Invoice start time (Unix timestamp) |
+| `endTime` | `number` | Invoice end time (Unix timestamp) |
+
+> **Type note:** `validateInvoicePayment` expects `amount`, `memo`, `startTime`,
+> and `endTime` as `number`, not strings. If you stored them as strings,
+> parse them first: `Number(memo)`.
+
+### Simple Backend Verification
+
+```typescript
+import { PumpAgent } from "@pump-fun/agent-payments-sdk";
+import { PublicKey } from "@solana/web3.js";
+
+const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
+const agent = new PumpAgent(agentMint);
+
+const paid = await agent.validateInvoicePayment({
+ user: new PublicKey(userWalletAddress),
+ currencyMint: new PublicKey(process.env.CURRENCY_MINT!),
+ amount: 1000000,
+ memo: 123456789,
+ startTime: 1700000000,
+ endTime: 1700086400,
+});
+
+if (paid) {
+ // Payment confirmed — deliver the service
+} else {
+ // Payment not found
+}
+```
+
+No `Connection` is needed for basic verification — it uses the HTTP API by default.
+
+### Verification with Retries
+
+Transactions may take a few seconds to confirm. Use a retry loop for reliability:
+
+```typescript
+async function verifyPayment(params: {
+ user: string;
+ currencyMint: string;
+ amount: number;
+ memo: number;
+ startTime: number;
+ endTime: number;
+}): Promise<boolean> {
+ const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);
+ const agent = new PumpAgent(agentMint);
+
+ const invoiceParams = {
+ user: new PublicKey(params.user),
+ currencyMint: new PublicKey(params.currencyMint),
+ amount: params.amount,
+ memo: params.memo,
+ startTime: params.startTime,
+ endTime: params.endTime,
+ };
+
+ for (let attempt = 0; attempt < 10; attempt++) {
+ const verified = await agent.validateInvoicePayment(invoiceParams);
+ if (verified) return true;
+ await new Promise((r) => setTimeout(r, 2000));
+ }
+
+ return false;
+}
+```
+
+## End-to-End Flow
+
+```
+1. Agent decides on price → generates unique memo(number) → sets time window
+2. Server: buildAcceptPaymentInstructions({...}) → returns TransactionInstruction[]
+3. Server: builds full Transaction (blockhash + feePayer + instructions) → serializes as base64
+4. Client: deserializes base64 → Transaction.from(Buffer.from(txBase64, "base64"))
+5. Client: signTransaction(tx) — wallet prompts user to approve
+6. Client: connection.sendRawTransaction(signedTx.serialize()) → connection.confirmTransaction(signature)
+7. Server: with the exactly same parameters used for buildAcceptPaymentInstructions server validateInvoicePayment({...}) → returns true/false (ALWAYS verify server-side)
+8. Agent delivers the service (or asks user to retry)
+```
+
+## Scenario Tests & Troubleshooting
+
+See [https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/references/SCENARIOS.md](https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/references/SCENARIOS.md) for detailed test scenarios (happy path, duplicate rejection, expired invoices, etc.) and a troubleshooting table for common errors and for wallet Integration must follow [https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/references/WALLET_INTEGRATION.md](https://raw.githubusercontent.com/pump-fun/pump-fun-skills/refs/heads/main/tokenized-agents/references/WALLET_INTEGRATION.md).
diff --git a/pump-fun-skills/tokenized-agents/WALLET_INTEGRATION.md b/pump-fun-skills/tokenized-agents/WALLET_INTEGRATION.md
new file mode 100644
index 000000000..a2fc2b253
--- /dev/null
+++ b/pump-fun-skills/tokenized-agents/WALLET_INTEGRATION.md
@@ -0,0 +1,88 @@
+# Wallet Integration (Frontend)
+
+To let users sign transactions in the browser, install the Solana wallet adapter:
+
+```bash
+npm install @solana/wallet-adapter-react @solana/wallet-adapter-react-ui @solana/wallet-adapter-wallets
+```
+
+## WalletProvider Component
+
+Create a provider that wraps your app:
+
+```tsx
+"use client";
+
+import { useMemo } from "react";
+import {
+ ConnectionProvider,
+ WalletProvider as SolanaWalletProvider,
+} from "@solana/wallet-adapter-react";
+import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
+import {
+ PhantomWalletAdapter,
+ SolflareWalletAdapter,
+} from "@solana/wallet-adapter-wallets";
+
+import "@solana/wallet-adapter-react-ui/styles.css";
+
+export default function WalletProvider({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const endpoint =
+ process.env.NEXT_PUBLIC_SOLANA_RPC_URL ||
+ "https://api.mainnet-beta.solana.com";
+
+ const wallets = useMemo(
+ () => [new PhantomWalletAdapter(), new SolflareWalletAdapter()],
+ [],
+ );
+
+ return (
+ <ConnectionProvider endpoint={endpoint}>
+ <SolanaWalletProvider wallets={wallets} autoConnect>
+ <WalletModalProvider>{children}</WalletModalProvider>
+ </SolanaWalletProvider>
+ </ConnectionProvider>
+ );
+}
+```
+
+## Wrap Your App Layout
+
+```tsx
+import WalletProvider from "./components/WalletProvider";
+
+export default function RootLayout({ children }: { children: React.ReactNode }) {
+ return (
+ <html lang="en">
+ <body>
+ <WalletProvider>{children}</WalletProvider>
+ </body>
+ </html>
+ );
+}
+```
+
+## Use Wallet Hooks in Components
+
+```tsx
+import { useWallet, useConnection } from "@solana/wallet-adapter-react";
+import { WalletMultiButton } from "@solana/wallet-adapter-react-ui";
+
+function PaymentComponent() {
+ const { publicKey, signTransaction, connected } = useWallet();
+ const { connection } = useConnection();
+
+ return (
+ <div>
+ <WalletMultiButton />
+ {connected && <p>Connected: {publicKey?.toBase58()}</p>}
+ </div>
+ );
+}
+```
+
+`WalletMultiButton` renders a connect/disconnect button. `useWallet()` gives you the user's `publicKey` and `signTransaction`. `useConnection()` gives you the active `Connection` for sending transactions.
diff --git a/pump-fun-skills/tokenized-agents/references/SCENARIOS.md b/pump-fun-skills/tokenized-agents/references/SCENARIOS.md
new file mode 100644
index 000000000..d5dea0759
--- /dev/null
+++ b/pump-fun-skills/tokenized-agents/references/SCENARIOS.md
@@ -0,0 +1,45 @@
+# Scenario Tests
+
+## Scenario 1: Happy Path — Pay and Verify
+
+1. Agent generates invoice: amount `1000000` (1 USDC), memo `42`, startTime `1700000000`, endTime `1700086400`.
+2. Server calls `buildAcceptPaymentInstructions` and serializes the instructions as JSON.
+3. Client reconstructs instructions, signs, and submits the transaction on Solana via `sendTransaction`.
+4. Server calls `validateInvoicePayment` with the same params.
+5. Returns `true`. Agent delivers the service.
+
+## Scenario 2: Verify Before Payment
+
+1. Agent generates invoice: amount `500000`, memo `7777`, valid for 1 hour.
+2. Server immediately calls `validateInvoicePayment` (user hasn't paid yet).
+3. Returns `false`.
+4. Agent tells the user payment is not confirmed and to try again after paying.
+
+## Scenario 3: Duplicate Payment Rejection
+
+1. Agent generates invoice with memo `99`.
+2. User pays successfully. `validateInvoicePayment` returns `true`.
+3. A second attempt to submit the same `acceptPayment` transaction is rejected by the on-chain program because the Invoice ID PDA is already initialized.
+
+## Scenario 4: Mismatched Parameters
+
+1. Agent generates invoice: amount `1000000`, memo `555`.
+2. User pays with a different amount (`2000000`) but same memo.
+3. `validateInvoicePayment` with original params returns `false` — the on-chain event has a different amount.
+
+## Scenario 5: Expired Invoice
+
+1. Agent generates invoice with `endTime` in the past.
+2. The on-chain program rejects the transaction (timestamp outside validity window).
+3. Agent should generate a new invoice with a valid time window.
+
+---
+
+## Troubleshooting
+
+| Error | Cause | Fix |
+|---|---|---|
+| `validateInvoicePayment` returns `false` but user claims they paid | Transaction may still be confirming, or params don't match | Wait a few seconds and retry. Double-check that `amount`, `memo`, `startTime`, `endTime`, and `user` all match exactly. |
+| Invoice already paid | The Invoice ID PDA is already initialized | Generate a new invoice with a different `memo`. |
+| Insufficient balance | User's token account doesn't have enough tokens | Tell the user to fund their wallet before paying. |
+| Currency not supported | The `currencyMint` is not in the protocol's `GlobalConfig` | Use a supported currency (USDC, wSOL). |
diff --git a/pump-fun-skills/tokenized-agents/references/WALLET_INTEGRATION.md b/pump-fun-skills/tokenized-agents/references/WALLET_INTEGRATION.md
new file mode 100644
index 000000000..a2fc2b253
--- /dev/null
+++ b/pump-fun-skills/tokenized-agents/references/WALLET_INTEGRATION.md
@@ -0,0 +1,88 @@
+# Wallet Integration (Frontend)
+
+To let users sign transactions in the browser, install the Solana wallet adapter:
+
+```bash
+npm install @solana/wallet-adapter-react @solana/wallet-adapter-react-ui @solana/wallet-adapter-wallets
+```
+
+## WalletProvider Component
+
+Create a provider that wraps your app:
+
+```tsx
+"use client";
+
+import { useMemo } from "react";
+import {
+ ConnectionProvider,
+ WalletProvider as SolanaWalletProvider,
+} from "@solana/wallet-adapter-react";
+import { WalletModalProvider } from "@solana/wallet-adapter-react-ui";
+import {
+ PhantomWalletAdapter,
+ SolflareWalletAdapter,
+} from "@solana/wallet-adapter-wallets";
+
+import "@solana/wallet-adapter-react-ui/styles.css";
+
+export default function WalletProvider({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const endpoint =
+ process.env.NEXT_PUBLIC_SOLANA_RPC_URL ||
+ "https://api.mainnet-beta.solana.com";
+
+ const wallets = useMemo(
+ () => [new PhantomWalletAdapter(), new SolflareWalletAdapter()],
+ [],
+ );
+
+ return (
+ <ConnectionProvider endpoint={endpoint}>
+ <SolanaWalletProvider wallets={wallets} autoConnect>
+ <WalletModalProvider>{children}</WalletModalProvider>
+ </SolanaWalletProvider>
+ </ConnectionProvider>
+ );
+}
+```
+
+## Wrap Your App Layout
+
+```tsx
+import WalletProvider from "./components/WalletProvider";
+
+export default function RootLayout({ children }: { children: React.ReactNode }) {
+ return (
+ <html lang="en">
+ <body>
+ <WalletProvider>{children}</WalletProvider>
+ </body>
+ </html>
+ );
+}
+```
+
+## Use Wallet Hooks in Components
+
+```tsx
+import { useWallet, useConnection } from "@solana/wallet-adapter-react";
+import { WalletMultiButton } from "@solana/wallet-adapter-react-ui";
+
+function PaymentComponent() {
+ const { publicKey, signTransaction, connected } = useWallet();
+ const { connection } = useConnection();
+
+ return (
+ <div>
+ <WalletMultiButton />
+ {connected && <p>Connected: {publicKey?.toBase58()}</p>}
+ </div>
+ );
+}
+```
+
+`WalletMultiButton` renders a connect/disconnect button. `useWallet()` gives you the user's `publicKey` and `signTransaction`. `useConnection()` gives you the active `Connection` for sending transactions.