[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GR865C0KKVNKF68AMWM67G":3,"skill-same:01M6GR865C0KKVNKF68AMWM67G":98},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6GR865C0KKVNKF68AMWM67G","tokenized-agents",null,"Use when the user wants to charge users for actions. Use @pump-fun\u002Fagent-payments-sdk, to build Solana payment transactions, verify on-chain invoice payments, or integrate Solana wallet adapters for agent payment flows.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"tokenized agents","chain","charge","when","for","agent-payments","on-chain","invoice","flows","Adapters","pump-fun","users","sdk","fun","solana","payment","build","Wallet","integrate","use","transactions","verify","payments","actions","2026-11-10 10:12:30",false,"---\nname: tokenized-agents\ndescription: >\n  Use when the user wants to charge users for actions. Use @pump-fun\u002Fagent-payments-sdk, to build Solana payment transactions, verify on-chain invoice payments, or integrate Solana wallet adapters for agent payment flows.\nmetadata:\n  author: pump-fun\n  version: \"1.1\"\n---\n\n## Before Starting Work\n\n**MANDATORY — Do NOT write or modify any code until every item below is answered by the user:**\n\n- [ ] Agent token mint address (from pump.fun)\n- [ ] Payment currency decided (USDC or SOL)\n- [ ] Price\u002Famount confirmed (in smallest unit)\n- [ ] RPC URL provided or a fallback agreed upon\n- [ ] Framework confirmed (Next.js, Express, other)\n\nYou 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.\n\n## Safety Rules\n\n- **NEVER** log, print, or return private keys or secret key material.\n- **NEVER** sign transactions on behalf of a user — you build the instruction, the user signs.\n- Always validate that `amount > 0` before creating an invoice.\n- Always ensure `endTime > startTime` and both are valid Unix timestamps.\n- Use the correct decimal precision for the currency (6 decimals for USDC, 9 for SOL).\n- **Always verify payments on the server** using `validateInvoicePayment` before delivering any service. Never trust the client alone — clients can be spoofed.\n- **Always verify your code against this skill before finalizing.** Before delivering generated code, re-read the relevant sections of this document and confirm:\n  - Parameter types match the documented signatures — `buildAcceptPaymentInstructions` accepts `number` for numeric fields, `validateInvoicePayment` accepts `number`, and `getInvoiceIdPDA` accepts `number`.\n  - Parameter ordering and names match exactly.\n  - Default values (e.g. `computeUnitLimit` defaults to `100_000`) are not contradicted.\n  - Import paths use `@pump-fun\u002Fagent-payments-sdk`, not internal module paths.\n\n## Supported Currencies\n\n| Currency    | Decimals | Smallest unit example |\n| ----------- | -------- | --------------------- |\n| USDC        | 6        | `1000000` = 1 USDC    |\n| Wrapped SOL | 9        | `1000000000` = 1 SOL  |\n\n## Environment Variables\n\nCreate a `.env` (or `.env.local` for Next.js) file with the following:\n\n```env\n# Solana RPC — server-side (used to build transactions and verify payments)\nSOLANA_RPC_URL=https:\u002F\u002Frpc.solanatracker.io\u002Fpublic\n\n# Solana RPC — client-side (used by wallet adapter in the browser)\nNEXT_PUBLIC_SOLANA_RPC_URL=https:\u002F\u002Frpc.solanatracker.io\u002Fpublic\n\n# The token mint address of your tokenized agent on pump.fun\nAGENT_TOKEN_MINT_ADDRESS=\u003Cyour-agent-mint-address>\n\n# Payment currency mint\n# USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\n# SOL (wrapped): So11111111111111111111111111111111111111112\nCURRENCY_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\n```\n\n**RPC for mainnet-beta:** The default Solana public RPC (`https:\u002F\u002Fapi.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:\n\n- **Solana Tracker** — `https:\u002F\u002Frpc.solanatracker.io\u002Fpublic`\n- **Ankr** — `https:\u002F\u002Frpc.ankr.com\u002Fsolana`\n\nDo NOT silently pick one — wait for the user to confirm before proceeding.\n\nRead these values from `process.env` at runtime. Never hard-code mint addresses or RPC URLs.\n\n## Install\n\n```bash\nnpm install @pump-fun\u002Fagent-payments-sdk@3.0.2 @solana\u002Fweb3.js@^1.98.0\n```\n\n### Dependency Compatibility — IMPORTANT\n\n`@pump-fun\u002Fagent-payments-sdk` depends on `@solana\u002Fweb3.js` and `@solana\u002Fspl-token`. When the app also installs these packages directly, mismatched versions can cause runtime errors.\n\n**Rules:**\n\n1. Before installing `@solana\u002Fweb3.js`, `@solana\u002Fspl-token`, or any `@solana\u002Fwallet-adapter-*` package, first check what versions `@pump-fun\u002Fagent-payments-sdk` declares in its own `package.json` (inspect it via `npm info @pump-fun\u002Fagent-payments-sdk dependencies`). Install the same ranges — or ranges that resolve to the same major.minor — so npm\u002Fpnpm hoists a single copy instead of two.\n2. Never blindly install \"latest\" for these shared packages. Always prefer the version that is most compatible with the latest `@pump-fun\u002Fagent-payments-sdk`.\n3. If the project already has these packages at different versions, align them to match the SDK and re-install.\n\n## SDK Setup\n\n`PumpAgent` is the main class. It can build payment instructions and verify invoices.\n\n```typescript\nimport { PumpAgent } from \"@pump-fun\u002Fagent-payments-sdk\";\nimport { PublicKey } from \"@solana\u002Fweb3.js\";\n\nconst agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\n```\n\n### Constructor\n\n```typescript\nnew PumpAgent(mint: PublicKey, environment?: \"mainnet\" | \"devnet\", connection?: Connection)\n```\n\n| Parameter     | Type                      | Default     | Description                                                   |\n| ------------- | ------------------------- | ----------- | ------------------------------------------------------------- |\n| `mint`        | `PublicKey`               | —           | The tokenized agent's token mint address                      |\n| `environment` | `\"mainnet\"` \\| `\"devnet\"` | `\"mainnet\"` | Network environment                                           |\n| `connection`  | `Connection` (optional)   | `undefined` | Solana RPC connection (enables RPC fallback for verification) |\n\n**Without connection** — enough for building instructions and HTTP-based payment verification:\n\n```typescript\nconst agent = new PumpAgent(agentMint);\n```\n\n**With connection** — also enables RPC-based verification fallback and balance queries:\n\n```typescript\nimport { Connection } from \"@solana\u002Fweb3.js\";\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL!);\nconst agent = new PumpAgent(agentMint, \"mainnet\", connection);\n```\n\n## Wallet Integration (Frontend)\n\nInstall `@solana\u002Fwallet-adapter-react`, `@solana\u002Fwallet-adapter-react-ui`, and `@solana\u002Fwallet-adapter-wallets`. Use `useWallet()` for `publicKey` and `signTransaction`, and `useConnection()` for the active RPC connection. MUST See [https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md](https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md) for the full WalletProvider setup, layout wrapping, and hook usage.\n\n## Building Payment Instructions\n\nUse `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\u002Funwrapping.\n\n### Parameters (`BuildAcceptPaymentParams`)\n\n| Parameter          | Type                         | Description                                                                                          |\n| ------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------- |\n| `user`             | `PublicKey`                  | The payer's wallet address                                                                           |\n| `currencyMint`     | `PublicKey`                  | Mint address of the payment currency (USDC, wSOL)                                                    |\n| `amount`           | `bigint \\| number \\| string` | Price in the currency's smallest unit                                                                |\n| `memo`             | `bigint \\| number \\| string` | Unique invoice identifier (random number)                                                            |\n| `startTime`        | `bigint \\| number \\| string` | Unix timestamp — when the invoice becomes valid                                                      |\n| `endTime`          | `bigint \\| number \\| string` | Unix timestamp — when the invoice expires                                                            |\n| `tokenProgram`     | `PublicKey` (optional)       | Token program for the currency (defaults to SPL Token)                                               |\n| `computeUnitLimit` | `number` (optional)          | Compute unit budget (default `100_000`). Increase if transactions fail with compute exceeded.        |\n| `computeUnitPrice` | `number` (optional)          | Priority fee in microlamports per CU. If provided, a `SetComputeUnitPrice` instruction is prepended. |\n\n### Example\n\n```typescript\nconst ixs = await agent.buildAcceptPaymentInstructions({\n  user: userPublicKey,\n  currencyMint,\n  amount: \"1000000\", \u002F\u002F 1 USDC\n  memo: \"123456789\", \u002F\u002F unique invoice identifier\n  startTime: \"1700000000\", \u002F\u002F valid from\n  endTime: \"1700086400\", \u002F\u002F expires at\n});\n```\n\n### What It Returns\n\nThe returned `TransactionInstruction[]` always starts with compute budget instructions, followed by the payment instructions:\n\n- **`SetComputeUnitLimit`** is always prepended (default `100_000` CU). Override via `computeUnitLimit` if your transactions fail with \"compute exceeded\".\n- **`SetComputeUnitPrice`** is prepended only when `computeUnitPrice` is provided. Use this to set a priority fee for faster landing during congestion.\n\nAfter the compute budget prefix:\n\n- **For SPL tokens (USDC):** The accept-payment instruction.\n- **For native SOL:** Instructions that handle wrapping\u002Funwrapping automatically:\n  1. Create the user's wrapped SOL token account (idempotent)\n  2. Transfer SOL lamports into that token account\n  3. Sync the native balance\n  4. The accept-payment instruction\n  5. Close the wrapped SOL account (returns rent back to user)\n\nYou do not need to handle SOL wrapping or compute budget yourself — `buildAcceptPaymentInstructions` does it for you.\n\n### Important\n\n- The `amount`, `memo`, `startTime`, and `endTime` must exactly match when verifying later.\n- Each unique combination of `(mint, currencyMint, amount, memo, startTime, endTime)` can only be paid once — the on-chain Invoice ID PDA prevents duplicate payments.\n- Generate a unique `memo` for each invoice (e.g. `Math.floor(Math.random() * 900000000000) + 100000`).\n\n## Deriving the Invoice ID\n\nThe 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.\n\n### Import\n\n```typescript\nimport { getInvoiceIdPDA } from \"@pump-fun\u002Fagent-payments-sdk\";\nimport { PublicKey } from \"@solana\u002Fweb3.js\";\n```\n\n### Usage\n\n`getInvoiceIdPDA` returns `[PublicKey, number]`. The first element is the Invoice ID; the second is the PDA bump seed.\n\n```typescript\nconst tokenMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\nconst currencyMint = new PublicKey(process.env.CURRENCY_MINT!);\n\nconst amount = 1000000;\nconst memo = 123456789;\nconst startTime = 1700000000;\nconst endTime = 1700086400;\n\nconst [invoiceId] = getInvoiceIdPDA(\n  tokenMint,\n  currencyMint,\n  amount,\n  memo,\n  startTime,\n  endTime,\n);\n\nconsole.log(\"Invoice ID:\", invoiceId.toBase58());\n```\n\nAll numeric parameters (`amount`, `memo`, `startTime`, `endTime`) are plain `number` values. BN conversion is handled internally.\n\n### PDA Seeds\n\nThe Invoice ID is derived with program `AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7` using these seeds:\n\n| Seed index | Value                                |\n| ---------- | ------------------------------------ |\n| 0          | `\"invoice-id\"` (UTF-8 bytes)         |\n| 1          | `tokenMint` (32 bytes)               |\n| 2          | `currencyMint` (32 bytes)            |\n| 3          | `amount` (8 bytes, little-endian)    |\n| 4          | `memo` (8 bytes, little-endian)      |\n| 5          | `startTime` (8 bytes, little-endian) |\n| 6          | `endTime` (8 bytes, little-endian)   |\n\nBecause 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.\n\n### When to Use\n\n- **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:\n\n```typescript\nconst [invoiceId] = getInvoiceIdPDA(\n  tokenMint,\n  currencyMint,\n  amount,\n  memo,\n  startTime,\n  endTime,\n);\nconst accountInfo = await connection.getAccountInfo(invoiceId);\nif (accountInfo !== null) {\n  \u002F\u002F This invoice was already paid — generate a new memo\n}\n```\n\n- **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.\n\n## Full Transaction Flow — Server to Client\n\nThis is the complete flow for building a transaction on the server, signing it on the client, and sending it on-chain.\n\n### Step 1: Generate Invoice Parameters (Server)\n\n```typescript\nfunction generateInvoiceParams() {\n  const memo = Math.floor(Math.random() * 900000000000) + 100000;\n  const now = Math.floor(Date.now() \u002F 1000);\n  const startTime = now;\n  const endTime = now + 86400; \u002F\u002F valid for 24 hours\n  const amount = Number(process.env.PRICE_AMOUNT) || 1000000; \u002F\u002F e.g. 1 USDC\n\n  return { amount, memo, startTime, endTime };\n}\n```\n\n### Step 2: Build Transaction and Serialize as Base64 (Server)\n\nBuild 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.\n\n```typescript\nimport { Connection, PublicKey, Transaction } from \"@solana\u002Fweb3.js\";\nimport { PumpAgent } from \"@pump-fun\u002Fagent-payments-sdk\";\n\nasync function buildPaymentTransaction(params: {\n  userWallet: string;\n  amount: string;\n  memo: string;\n  startTime: string;\n  endTime: string;\n}) {\n  const connection = new Connection(process.env.SOLANA_RPC_URL!);\n  const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\n  const currencyMint = new PublicKey(process.env.CURRENCY_MINT!);\n\n  const agent = new PumpAgent(agentMint, \"mainnet\", connection);\n  const userPublicKey = new PublicKey(params.userWallet);\n\n  const instructions = await agent.buildAcceptPaymentInstructions({\n    user: userPublicKey,\n    currencyMint,\n    amount: params.amount,\n    memo: params.memo,\n    startTime: params.startTime,\n    endTime: params.endTime,\n  });\n\n  const { blockhash } = await connection.getLatestBlockhash(\"confirmed\");\n\n  const tx = new Transaction();\n  tx.recentBlockhash = blockhash;\n  tx.feePayer = userPublicKey;\n  tx.add(...instructions);\n\n  const serializedTx = tx\n    .serialize({ requireAllSignatures: false })\n    .toString(\"base64\");\n\n  return { transaction: serializedTx };\n}\n```\n\nReturn the base64 transaction string (and the invoice params like `memo`, `startTime`, `endTime`) to the client as JSON.\n\n### Step 3: Deserialize, Sign, and Send the Transaction (Client)\n\nDeserialize 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.\n\n**Async helper** (e.g. in a utils file or alongside your component):\n\n```typescript\nimport { Connection, Transaction } from \"@solana\u002Fweb3.js\";\n\nasync function signAndSendPayment(\n  txBase64: string,\n  signTransaction: (tx: Transaction) => Promise\u003CTransaction>,\n  connection: Connection,\n): Promise\u003Cstring> {\n  if (!signTransaction) {\n    throw new Error(\"Wallet does not support signing\");\n  }\n\n  const tx = Transaction.from(Buffer.from(txBase64, \"base64\"));\n  const signedTx = await signTransaction(tx);\n\n  const signature = await connection.sendRawTransaction(signedTx.serialize(), {\n    skipPreflight: false,\n    preflightCommitment: \"confirmed\",\n  });\n\n  const latestBlockhash = await connection.getLatestBlockhash(\"confirmed\");\n  await connection.confirmTransaction(\n    { signature, ...latestBlockhash },\n    \"confirmed\",\n  );\n\n  return signature;\n}\n```\n\n**Component usage** — call the hooks at the top level, then pass them into the helper (e.g. from a payment button handler):\n\n```typescript\nimport { useWallet, useConnection } from \"@solana\u002Fwallet-adapter-react\";\n\nfunction PaymentButton({ txBase64 }: { txBase64: string }) {\n  const { signTransaction } = useWallet();\n  const { connection } = useConnection();\n\n  const handlePay = async () => {\n    if (!signTransaction) return;\n    await signAndSendPayment(txBase64, signTransaction, connection);\n  };\n\n  return \u003Cbutton onClick={handlePay}>Pay\u003C\u002Fbutton>;\n}\n```\n\nThe wallet prompts the user to approve. After signing, the serialized transaction is submitted via `sendRawTransaction` and you wait for on-chain confirmation.\n\n## Verify Payment\n\nUse `validateInvoicePayment` to confirm that a specific invoice was paid on-chain.\n\n### How It Works\n\n1. **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.\n2. **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:\n   - `data.user` === `user` (base58)\n   - `data.tokenized_agent_mint` === `mint` (base58)\n   - `data.currency_mint` === `currencyMint` (base58)\n   - `data.amount` === `amount` (BN equality)\n   - `data.memo` === `memo` (BN equality)\n   - `data.start_time` === `startTime` (BN equality)\n   - `data.end_time` === `endTime` (BN equality)\n\n   All seven checks must pass for the method to return `true`.\n\n3. **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`.\n4. Returns `true` if a matching payment event is found by either path, `false` otherwise.\n\n### Parameters\n\n| Parameter      | Type        | Description                         |\n| -------------- | ----------- | ----------------------------------- |\n| `user`         | `PublicKey` | The wallet that paid                |\n| `currencyMint` | `PublicKey` | Currency used for payment           |\n| `amount`       | `number`    | Amount paid (smallest unit)         |\n| `memo`         | `number`    | The invoice memo                    |\n| `startTime`    | `number`    | Invoice start time (Unix timestamp) |\n| `endTime`      | `number`    | Invoice end time (Unix timestamp)   |\n\n> **Type note:** `validateInvoicePayment` expects `amount`, `memo`, `startTime`,\n> and `endTime` as `number`, not strings. If you stored them as strings,\n> parse them first: `Number(memo)`.\n\n### Simple Backend Verification\n\n```typescript\nimport { PumpAgent } from \"@pump-fun\u002Fagent-payments-sdk\";\nimport { PublicKey } from \"@solana\u002Fweb3.js\";\n\nconst agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\nconst agent = new PumpAgent(agentMint);\n\nconst paid = await agent.validateInvoicePayment({\n  user: new PublicKey(userWalletAddress),\n  currencyMint: new PublicKey(process.env.CURRENCY_MINT!),\n  amount: 1000000,\n  memo: 123456789,\n  startTime: 1700000000,\n  endTime: 1700086400,\n});\n\nif (paid) {\n  \u002F\u002F Payment confirmed — deliver the service\n} else {\n  \u002F\u002F Payment not found\n}\n```\n\nNo `Connection` is needed for basic verification — it uses the HTTP API by default.\n\n### Verification with Retries\n\nTransactions may take a few seconds to confirm. Use a retry loop for reliability:\n\n```typescript\nasync function verifyPayment(params: {\n  user: string;\n  currencyMint: string;\n  amount: number;\n  memo: number;\n  startTime: number;\n  endTime: number;\n}): Promise\u003Cboolean> {\n  const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\n  const agent = new PumpAgent(agentMint);\n\n  const invoiceParams = {\n    user: new PublicKey(params.user),\n    currencyMint: new PublicKey(params.currencyMint),\n    amount: params.amount,\n    memo: params.memo,\n    startTime: params.startTime,\n    endTime: params.endTime,\n  };\n\n  for (let attempt = 0; attempt \u003C 10; attempt++) {\n    const verified = await agent.validateInvoicePayment(invoiceParams);\n    if (verified) return true;\n    await new Promise((r) => setTimeout(r, 2000));\n  }\n\n  return false;\n}\n```\n\n## End-to-End Flow\n\n```\n1. Agent decides on price → generates unique memo(number) → sets time window\n2. Server: buildAcceptPaymentInstructions({...}) → returns TransactionInstruction[]\n3. Server: builds full Transaction (blockhash + feePayer + instructions) → serializes as base64\n4. Client: deserializes base64 → Transaction.from(Buffer.from(txBase64, \"base64\"))\n5. Client: signTransaction(tx) — wallet prompts user to approve\n6. Client: connection.sendRawTransaction(signedTx.serialize()) → connection.confirmTransaction(signature)\n7. Server: with the exactly same parameters used for buildAcceptPaymentInstructions server  validateInvoicePayment({...}) → returns true\u002Ffalse (ALWAYS verify server-side)\n8. Agent delivers the service (or asks user to retry)\n```\n\n## Scenario Tests & Troubleshooting\n\nSee [https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FSCENARIOS.md](https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FSCENARIOS.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:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md](https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md).\n","## Before Starting Work\n\n**MANDATORY — Do NOT write or modify any code until every item below is answered by the user:**\n\n- [ ] Agent token mint address (from pump.fun)\n- [ ] Payment currency decided (USDC or SOL)\n- [ ] Price\u002Famount confirmed (in smallest unit)\n- [ ] RPC URL provided or a fallback agreed upon\n- [ ] Framework confirmed (Next.js, Express, other)\n\nYou 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.\n\n## Safety Rules\n\n- **NEVER** log, print, or return private keys or secret key material.\n- **NEVER** sign transactions on behalf of a user — you build the instruction, the user signs.\n- Always validate that `amount > 0` before creating an invoice.\n- Always ensure `endTime > startTime` and both are valid Unix timestamps.\n- Use the correct decimal precision for the currency (6 decimals for USDC, 9 for SOL).\n- **Always verify payments on the server** using `validateInvoicePayment` before delivering any service. Never trust the client alone — clients can be spoofed.\n- **Always verify your code against this skill before finalizing.** Before delivering generated code, re-read the relevant sections of this document and confirm:\n  - Parameter types match the documented signatures — `buildAcceptPaymentInstructions` accepts `number` for numeric fields, `validateInvoicePayment` accepts `number`, and `getInvoiceIdPDA` accepts `number`.\n  - Parameter ordering and names match exactly.\n  - Default values (e.g. `computeUnitLimit` defaults to `100_000`) are not contradicted.\n  - Import paths use `@pump-fun\u002Fagent-payments-sdk`, not internal module paths.\n\n## Supported Currencies\n\n| Currency    | Decimals | Smallest unit example |\n| ----------- | -------- | --------------------- |\n| USDC        | 6        | `1000000` = 1 USDC    |\n| Wrapped SOL | 9        | `1000000000` = 1 SOL  |\n\n## Environment Variables\n\nCreate a `.env` (or `.env.local` for Next.js) file with the following:\n\n```env\n# Solana RPC — server-side (used to build transactions and verify payments)\nSOLANA_RPC_URL=https:\u002F\u002Frpc.solanatracker.io\u002Fpublic\n\n# Solana RPC — client-side (used by wallet adapter in the browser)\nNEXT_PUBLIC_SOLANA_RPC_URL=https:\u002F\u002Frpc.solanatracker.io\u002Fpublic\n\n# The token mint address of your tokenized agent on pump.fun\nAGENT_TOKEN_MINT_ADDRESS=\u003Cyour-agent-mint-address>\n\n# Payment currency mint\n# USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\n# SOL (wrapped): So11111111111111111111111111111111111111112\nCURRENCY_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\n```\n\n**RPC for mainnet-beta:** The default Solana public RPC (`https:\u002F\u002Fapi.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:\n\n- **Solana Tracker** — `https:\u002F\u002Frpc.solanatracker.io\u002Fpublic`\n- **Ankr** — `https:\u002F\u002Frpc.ankr.com\u002Fsolana`\n\nDo NOT silently pick one — wait for the user to confirm before proceeding.\n\nRead these values from `process.env` at runtime. Never hard-code mint addresses or RPC URLs.\n\n## Install\n\n```bash\nnpm install @pump-fun\u002Fagent-payments-sdk@3.0.2 @solana\u002Fweb3.js@^1.98.0\n```\n\n### Dependency Compatibility — IMPORTANT\n\n`@pump-fun\u002Fagent-payments-sdk` depends on `@solana\u002Fweb3.js` and `@solana\u002Fspl-token`. When the app also installs these packages directly, mismatched versions can cause runtime errors.\n\n**Rules:**\n\n1. Before installing `@solana\u002Fweb3.js`, `@solana\u002Fspl-token`, or any `@solana\u002Fwallet-adapter-*` package, first check what versions `@pump-fun\u002Fagent-payments-sdk` declares in its own `package.json` (inspect it via `npm info @pump-fun\u002Fagent-payments-sdk dependencies`). Install the same ranges — or ranges that resolve to the same major.minor — so npm\u002Fpnpm hoists a single copy instead of two.\n2. Never blindly install \"latest\" for these shared packages. Always prefer the version that is most compatible with the latest `@pump-fun\u002Fagent-payments-sdk`.\n3. If the project already has these packages at different versions, align them to match the SDK and re-install.\n\n## SDK Setup\n\n`PumpAgent` is the main class. It can build payment instructions and verify invoices.\n\n```typescript\nimport { PumpAgent } from \"@pump-fun\u002Fagent-payments-sdk\";\nimport { PublicKey } from \"@solana\u002Fweb3.js\";\n\nconst agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\n```\n\n### Constructor\n\n```typescript\nnew PumpAgent(mint: PublicKey, environment?: \"mainnet\" | \"devnet\", connection?: Connection)\n```\n\n| Parameter     | Type                      | Default     | Description                                                   |\n| ------------- | ------------------------- | ----------- | ------------------------------------------------------------- |\n| `mint`        | `PublicKey`               | —           | The tokenized agent's token mint address                      |\n| `environment` | `\"mainnet\"` \\| `\"devnet\"` | `\"mainnet\"` | Network environment                                           |\n| `connection`  | `Connection` (optional)   | `undefined` | Solana RPC connection (enables RPC fallback for verification) |\n\n**Without connection** — enough for building instructions and HTTP-based payment verification:\n\n```typescript\nconst agent = new PumpAgent(agentMint);\n```\n\n**With connection** — also enables RPC-based verification fallback and balance queries:\n\n```typescript\nimport { Connection } from \"@solana\u002Fweb3.js\";\n\nconst connection = new Connection(process.env.SOLANA_RPC_URL!);\nconst agent = new PumpAgent(agentMint, \"mainnet\", connection);\n```\n\n## Wallet Integration (Frontend)\n\nInstall `@solana\u002Fwallet-adapter-react`, `@solana\u002Fwallet-adapter-react-ui`, and `@solana\u002Fwallet-adapter-wallets`. Use `useWallet()` for `publicKey` and `signTransaction`, and `useConnection()` for the active RPC connection. MUST See [https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md](https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md) for the full WalletProvider setup, layout wrapping, and hook usage.\n\n## Building Payment Instructions\n\nUse `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\u002Funwrapping.\n\n### Parameters (`BuildAcceptPaymentParams`)\n\n| Parameter          | Type                         | Description                                                                                          |\n| ------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------------- |\n| `user`             | `PublicKey`                  | The payer's wallet address                                                                           |\n| `currencyMint`     | `PublicKey`                  | Mint address of the payment currency (USDC, wSOL)                                                    |\n| `amount`           | `bigint \\| number \\| string` | Price in the currency's smallest unit                                                                |\n| `memo`             | `bigint \\| number \\| string` | Unique invoice identifier (random number)                                                            |\n| `startTime`        | `bigint \\| number \\| string` | Unix timestamp — when the invoice becomes valid                                                      |\n| `endTime`          | `bigint \\| number \\| string` | Unix timestamp — when the invoice expires                                                            |\n| `tokenProgram`     | `PublicKey` (optional)       | Token program for the currency (defaults to SPL Token)                                               |\n| `computeUnitLimit` | `number` (optional)          | Compute unit budget (default `100_000`). Increase if transactions fail with compute exceeded.        |\n| `computeUnitPrice` | `number` (optional)          | Priority fee in microlamports per CU. If provided, a `SetComputeUnitPrice` instruction is prepended. |\n\n### Example\n\n```typescript\nconst ixs = await agent.buildAcceptPaymentInstructions({\n  user: userPublicKey,\n  currencyMint,\n  amount: \"1000000\", \u002F\u002F 1 USDC\n  memo: \"123456789\", \u002F\u002F unique invoice identifier\n  startTime: \"1700000000\", \u002F\u002F valid from\n  endTime: \"1700086400\", \u002F\u002F expires at\n});\n```\n\n### What It Returns\n\nThe returned `TransactionInstruction[]` always starts with compute budget instructions, followed by the payment instructions:\n\n- **`SetComputeUnitLimit`** is always prepended (default `100_000` CU). Override via `computeUnitLimit` if your transactions fail with \"compute exceeded\".\n- **`SetComputeUnitPrice`** is prepended only when `computeUnitPrice` is provided. Use this to set a priority fee for faster landing during congestion.\n\nAfter the compute budget prefix:\n\n- **For SPL tokens (USDC):** The accept-payment instruction.\n- **For native SOL:** Instructions that handle wrapping\u002Funwrapping automatically:\n  1. Create the user's wrapped SOL token account (idempotent)\n  2. Transfer SOL lamports into that token account\n  3. Sync the native balance\n  4. The accept-payment instruction\n  5. Close the wrapped SOL account (returns rent back to user)\n\nYou do not need to handle SOL wrapping or compute budget yourself — `buildAcceptPaymentInstructions` does it for you.\n\n### Important\n\n- The `amount`, `memo`, `startTime`, and `endTime` must exactly match when verifying later.\n- Each unique combination of `(mint, currencyMint, amount, memo, startTime, endTime)` can only be paid once — the on-chain Invoice ID PDA prevents duplicate payments.\n- Generate a unique `memo` for each invoice (e.g. `Math.floor(Math.random() * 900000000000) + 100000`).\n\n## Deriving the Invoice ID\n\nThe 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.\n\n### Import\n\n```typescript\nimport { getInvoiceIdPDA } from \"@pump-fun\u002Fagent-payments-sdk\";\nimport { PublicKey } from \"@solana\u002Fweb3.js\";\n```\n\n### Usage\n\n`getInvoiceIdPDA` returns `[PublicKey, number]`. The first element is the Invoice ID; the second is the PDA bump seed.\n\n```typescript\nconst tokenMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\nconst currencyMint = new PublicKey(process.env.CURRENCY_MINT!);\n\nconst amount = 1000000;\nconst memo = 123456789;\nconst startTime = 1700000000;\nconst endTime = 1700086400;\n\nconst [invoiceId] = getInvoiceIdPDA(\n  tokenMint,\n  currencyMint,\n  amount,\n  memo,\n  startTime,\n  endTime,\n);\n\nconsole.log(\"Invoice ID:\", invoiceId.toBase58());\n```\n\nAll numeric parameters (`amount`, `memo`, `startTime`, `endTime`) are plain `number` values. BN conversion is handled internally.\n\n### PDA Seeds\n\nThe Invoice ID is derived with program `AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7` using these seeds:\n\n| Seed index | Value                                |\n| ---------- | ------------------------------------ |\n| 0          | `\"invoice-id\"` (UTF-8 bytes)         |\n| 1          | `tokenMint` (32 bytes)               |\n| 2          | `currencyMint` (32 bytes)            |\n| 3          | `amount` (8 bytes, little-endian)    |\n| 4          | `memo` (8 bytes, little-endian)      |\n| 5          | `startTime` (8 bytes, little-endian) |\n| 6          | `endTime` (8 bytes, little-endian)   |\n\nBecause 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.\n\n### When to Use\n\n- **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:\n\n```typescript\nconst [invoiceId] = getInvoiceIdPDA(\n  tokenMint,\n  currencyMint,\n  amount,\n  memo,\n  startTime,\n  endTime,\n);\nconst accountInfo = await connection.getAccountInfo(invoiceId);\nif (accountInfo !== null) {\n  \u002F\u002F This invoice was already paid — generate a new memo\n}\n```\n\n- **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.\n\n## Full Transaction Flow — Server to Client\n\nThis is the complete flow for building a transaction on the server, signing it on the client, and sending it on-chain.\n\n### Step 1: Generate Invoice Parameters (Server)\n\n```typescript\nfunction generateInvoiceParams() {\n  const memo = Math.floor(Math.random() * 900000000000) + 100000;\n  const now = Math.floor(Date.now() \u002F 1000);\n  const startTime = now;\n  const endTime = now + 86400; \u002F\u002F valid for 24 hours\n  const amount = Number(process.env.PRICE_AMOUNT) || 1000000; \u002F\u002F e.g. 1 USDC\n\n  return { amount, memo, startTime, endTime };\n}\n```\n\n### Step 2: Build Transaction and Serialize as Base64 (Server)\n\nBuild 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.\n\n```typescript\nimport { Connection, PublicKey, Transaction } from \"@solana\u002Fweb3.js\";\nimport { PumpAgent } from \"@pump-fun\u002Fagent-payments-sdk\";\n\nasync function buildPaymentTransaction(params: {\n  userWallet: string;\n  amount: string;\n  memo: string;\n  startTime: string;\n  endTime: string;\n}) {\n  const connection = new Connection(process.env.SOLANA_RPC_URL!);\n  const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\n  const currencyMint = new PublicKey(process.env.CURRENCY_MINT!);\n\n  const agent = new PumpAgent(agentMint, \"mainnet\", connection);\n  const userPublicKey = new PublicKey(params.userWallet);\n\n  const instructions = await agent.buildAcceptPaymentInstructions({\n    user: userPublicKey,\n    currencyMint,\n    amount: params.amount,\n    memo: params.memo,\n    startTime: params.startTime,\n    endTime: params.endTime,\n  });\n\n  const { blockhash } = await connection.getLatestBlockhash(\"confirmed\");\n\n  const tx = new Transaction();\n  tx.recentBlockhash = blockhash;\n  tx.feePayer = userPublicKey;\n  tx.add(...instructions);\n\n  const serializedTx = tx\n    .serialize({ requireAllSignatures: false })\n    .toString(\"base64\");\n\n  return { transaction: serializedTx };\n}\n```\n\nReturn the base64 transaction string (and the invoice params like `memo`, `startTime`, `endTime`) to the client as JSON.\n\n### Step 3: Deserialize, Sign, and Send the Transaction (Client)\n\nDeserialize 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.\n\n**Async helper** (e.g. in a utils file or alongside your component):\n\n```typescript\nimport { Connection, Transaction } from \"@solana\u002Fweb3.js\";\n\nasync function signAndSendPayment(\n  txBase64: string,\n  signTransaction: (tx: Transaction) => Promise\u003CTransaction>,\n  connection: Connection,\n): Promise\u003Cstring> {\n  if (!signTransaction) {\n    throw new Error(\"Wallet does not support signing\");\n  }\n\n  const tx = Transaction.from(Buffer.from(txBase64, \"base64\"));\n  const signedTx = await signTransaction(tx);\n\n  const signature = await connection.sendRawTransaction(signedTx.serialize(), {\n    skipPreflight: false,\n    preflightCommitment: \"confirmed\",\n  });\n\n  const latestBlockhash = await connection.getLatestBlockhash(\"confirmed\");\n  await connection.confirmTransaction(\n    { signature, ...latestBlockhash },\n    \"confirmed\",\n  );\n\n  return signature;\n}\n```\n\n**Component usage** — call the hooks at the top level, then pass them into the helper (e.g. from a payment button handler):\n\n```typescript\nimport { useWallet, useConnection } from \"@solana\u002Fwallet-adapter-react\";\n\nfunction PaymentButton({ txBase64 }: { txBase64: string }) {\n  const { signTransaction } = useWallet();\n  const { connection } = useConnection();\n\n  const handlePay = async () => {\n    if (!signTransaction) return;\n    await signAndSendPayment(txBase64, signTransaction, connection);\n  };\n\n  return \u003Cbutton onClick={handlePay}>Pay\u003C\u002Fbutton>;\n}\n```\n\nThe wallet prompts the user to approve. After signing, the serialized transaction is submitted via `sendRawTransaction` and you wait for on-chain confirmation.\n\n## Verify Payment\n\nUse `validateInvoicePayment` to confirm that a specific invoice was paid on-chain.\n\n### How It Works\n\n1. **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.\n2. **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:\n   - `data.user` === `user` (base58)\n   - `data.tokenized_agent_mint` === `mint` (base58)\n   - `data.currency_mint` === `currencyMint` (base58)\n   - `data.amount` === `amount` (BN equality)\n   - `data.memo` === `memo` (BN equality)\n   - `data.start_time` === `startTime` (BN equality)\n   - `data.end_time` === `endTime` (BN equality)\n\n   All seven checks must pass for the method to return `true`.\n\n3. **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`.\n4. Returns `true` if a matching payment event is found by either path, `false` otherwise.\n\n### Parameters\n\n| Parameter      | Type        | Description                         |\n| -------------- | ----------- | ----------------------------------- |\n| `user`         | `PublicKey` | The wallet that paid                |\n| `currencyMint` | `PublicKey` | Currency used for payment           |\n| `amount`       | `number`    | Amount paid (smallest unit)         |\n| `memo`         | `number`    | The invoice memo                    |\n| `startTime`    | `number`    | Invoice start time (Unix timestamp) |\n| `endTime`      | `number`    | Invoice end time (Unix timestamp)   |\n\n> **Type note:** `validateInvoicePayment` expects `amount`, `memo`, `startTime`,\n> and `endTime` as `number`, not strings. If you stored them as strings,\n> parse them first: `Number(memo)`.\n\n### Simple Backend Verification\n\n```typescript\nimport { PumpAgent } from \"@pump-fun\u002Fagent-payments-sdk\";\nimport { PublicKey } from \"@solana\u002Fweb3.js\";\n\nconst agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\nconst agent = new PumpAgent(agentMint);\n\nconst paid = await agent.validateInvoicePayment({\n  user: new PublicKey(userWalletAddress),\n  currencyMint: new PublicKey(process.env.CURRENCY_MINT!),\n  amount: 1000000,\n  memo: 123456789,\n  startTime: 1700000000,\n  endTime: 1700086400,\n});\n\nif (paid) {\n  \u002F\u002F Payment confirmed — deliver the service\n} else {\n  \u002F\u002F Payment not found\n}\n```\n\nNo `Connection` is needed for basic verification — it uses the HTTP API by default.\n\n### Verification with Retries\n\nTransactions may take a few seconds to confirm. Use a retry loop for reliability:\n\n```typescript\nasync function verifyPayment(params: {\n  user: string;\n  currencyMint: string;\n  amount: number;\n  memo: number;\n  startTime: number;\n  endTime: number;\n}): Promise\u003Cboolean> {\n  const agentMint = new PublicKey(process.env.AGENT_TOKEN_MINT_ADDRESS!);\n  const agent = new PumpAgent(agentMint);\n\n  const invoiceParams = {\n    user: new PublicKey(params.user),\n    currencyMint: new PublicKey(params.currencyMint),\n    amount: params.amount,\n    memo: params.memo,\n    startTime: params.startTime,\n    endTime: params.endTime,\n  };\n\n  for (let attempt = 0; attempt \u003C 10; attempt++) {\n    const verified = await agent.validateInvoicePayment(invoiceParams);\n    if (verified) return true;\n    await new Promise((r) => setTimeout(r, 2000));\n  }\n\n  return false;\n}\n```\n\n## End-to-End Flow\n\n```\n1. Agent decides on price → generates unique memo(number) → sets time window\n2. Server: buildAcceptPaymentInstructions({...}) → returns TransactionInstruction[]\n3. Server: builds full Transaction (blockhash + feePayer + instructions) → serializes as base64\n4. Client: deserializes base64 → Transaction.from(Buffer.from(txBase64, \"base64\"))\n5. Client: signTransaction(tx) — wallet prompts user to approve\n6. Client: connection.sendRawTransaction(signedTx.serialize()) → connection.confirmTransaction(signature)\n7. Server: with the exactly same parameters used for buildAcceptPaymentInstructions server  validateInvoicePayment({...}) → returns true\u002Ffalse (ALWAYS verify server-side)\n8. Agent delivers the service (or asks user to retry)\n```\n\n## Scenario Tests & Troubleshooting\n\nSee [https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FSCENARIOS.md](https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FSCENARIOS.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:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md](https:\u002F\u002Fraw.githubusercontent.com\u002Fpump-fun\u002Fpump-fun-skills\u002Frefs\u002Fheads\u002Fmain\u002Ftokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md).\n",{"name":5,"metadata":48,"description":50},{"author":29,"version":49},"1.1","Use when the user wants to charge users for actions. Use @pump-fun\u002Fagent-payments-sdk, to build Solana payment transactions, verify on-chain invoice payments, or integrate Solana wallet adapters for agent payment flows.\n","main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fdefi\u002Fpumpfun-official-tokenized-agents",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill tokenized-agents",{"tool":66,"command":67},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill tokenized-agents",{"tool":69,"command":70},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill tokenized-agents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002FSKILL.md",true,[74,80,84,87,91,95],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002FSCENARIOS.md","REFERENCE","参考文档",2287,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002Freferences\u002FSCENARIOS.md",{"path":81,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002FWALLET_INTEGRATION.md",2221,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002Freferences\u002FWALLET_INTEGRATION.md",{"path":85,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":86},"SCENARIOS.md","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002FSCENARIOS.md",{"path":88,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":89,"sourceHtmlUrl":90},"SOURCE.md",419,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002FSOURCE.md",{"path":92,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":93,"sourceHtmlUrl":94},"TRUST.auto.yaml",2254,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002FTRUST.auto.yaml",{"path":96,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":82,"sourceHtmlUrl":97},"WALLET_INTEGRATION.md","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fdefi\u002Fpumpfun-official-tokenized-agents\u002FWALLET_INTEGRATION.md",[99,109,117,125,133,141],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":108},"01M7DTKCERMV0RNX3HZJP4CZ26","troves","Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say \"Troves\" explicitly.","MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":113,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":108},"01M7DTK6CJSMGC8KCQHGNYFZBD","trade","Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say \"swap\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":121,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":108},"01M7DTJZ6A0X4PAW3Y8W4J9K64","staking","Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say \"stake\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":129,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":108},"01M7DTJSDZJKCDMW7GHRF4BRH5","send","Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say \"pay 10 STRK to 0x...\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FSKILL.md",[],[],{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":137,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":108},"01M7DTJG1E480D51ZQ7WKDQ26K","portfolio","View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks \"what do I have\", \"show me everything\", \"how much am I worth\", \"my positions\", \"my investments\", \"rebalance my portfolio\", \"I want 50% ETH\", \"optimize my holdings\", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say \"portfolio\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FSKILL.md",[],[],{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":103,"licenseFileUrl":145,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":108},"01M7DTJ7M8TE9R2N36HFBZDGVD","multi-swap","Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions \"two swaps\", \"three swaps\", \"swap X and Y at the same time\", or wants to convert multiple tokens in a single call.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FSKILL.md",[],[]]