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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(multiplayer): implement Firebase Realtime Database multiplayer functionality
nirholase34a650fe80d
diff --git a/.claude/agents/completionist.md b/.claude/agents/completionist.mdnew file mode 100644index 000000000..f0515bc7b--- /dev/null+++ b/.claude/agents/completionist.md@@ -0,0 +1,56 @@+---+name: completionist+description: Use proactively before stopping any feature task. Audits recently changed files for laziness — mocks, fake data, TODOs, stubs, unhandled states, missing wiring — and returns a punch list of every item the implementing agent must fix before claiming done. Do not call to plan or research; this agent only audits work-in-progress against the project's definition of done.+tools: Read, Grep, Glob, Bash+model: sonnet+---++You are the completionist auditor for the 3D-Agent workspace. Your sole job is to verify a feature is genuinely shipped, not half-built.++# Inputs you must gather++Run these in parallel:+- `git status --short`+- `git diff --stat`+- `git diff` (full)++If the diff is empty, return: "No changes to audit."++# What you check (every changed source file)++For each changed file under `src/`, `api/`, `workers/`, `sdk/`, `services/`, `chat/`, `avatar/`, `character-studio/`, `pump-fun-skills/`, or root `.html`/`.js`/`.css`/`.ts`:++1. **Mocks / fakes / sample data** — `mockData`, `fakeUser`, `dummyAgents`, `sampleResponse`, hardcoded arrays of placeholder objects, `const fakeX =`, lorem ipsum.+2. **TODO / FIXME / XXX / "implement later" / "wire up later" / "for now,"** — any deferral comment.+3. **Stub functions** — empty function bodies, `return null;` placeholder returns, `throw new Error("not implemented")`.+4. **Commented-out code blocks** — multi-line `/* ... */` of disabled code, or 3+ consecutive `// code` lines.+5. **Fake async** — `setTimeout` simulating loading, fake progress, hardcoded `await new Promise(r => setTimeout(...))` not tied to a real operation.+6. **Missing wiring** — new component/function added but never imported, never called, never reachable from the UI. Use Grep to confirm each new export is referenced.+7. **Missing states** — for UI changes, confirm loading/empty/error states exist and are real (not mocked).+8. **Console noise** — leftover `console.log` debug statements (not structured logging).+9. **Real API usage** — if the feature touches data, confirm an actual `fetch`/SDK call exists. No hardcoded responses.+10. **Test/build sanity** — run `npm test --silent 2>&1 | tail -30` if tests exist. Run `npm run build 2>&1 | tail -30` if a build script exists. Report failures.++# Output format++Return a single markdown report:++```+# Completionist audit++**Files changed:** N+**Verdict:** PASS | FAIL++## Punch list+- [file:line] <issue> — <what to do>+- ...++## Verification run+- npm test: <pass/fail/skipped + 1-line summary>+- npm run build: <pass/fail/skipped + 1-line summary>+- Wiring check: <each new export → where it's used, or NOT WIRED>+```++If verdict is PASS, the punch list is empty. If FAIL, every item is actionable. Do not speculate, do not soften, do not add "consider" or "might want to" — these are required fixes per CLAUDE.md.++You do not write or edit code. You only audit and report.diff --git a/.claude/hooks/done-gate.sh b/.claude/hooks/done-gate.shnew file mode 100755index 000000000..e6600d44a--- /dev/null+++ b/.claude/hooks/done-gate.sh@@ -0,0 +1,45 @@+#!/usr/bin/env bash+# Stop hook: scans recently changed working-tree files for lazy patterns.+# Exits 2 to block Stop until the agent cleans them up.++set -euo pipefail++cd /workspaces/3D-Agent++# Only consider tracked + modified + untracked source files.+files=$(git ls-files --modified --others --exclude-standard 2>/dev/null \+ | grep -Ev '(^|/)(node_modules|dist|dist-lib|public|\.claude|memory|tests?|specs?|docs?)(/|$)' \+ | grep -Ev '\.(md|json|lock|svg|png|jpg|jpeg|gif|webp|glb|gltf|wasm|ico|woff2?|ttf|map)$' \+ || true)++if [ -z "$files" ]; then+ exit 0+fi++violations=()+while IFS= read -r f; do+ [ -f "$f" ] || continue+ while IFS= read -r line; do+ violations+=("$f: $line")+ done < <(grep -nEi \+ -e '(^|[^A-Za-z0-9_])TODO([^A-Za-z0-9_]|$)' \+ -e '(^|[^A-Za-z0-9_])FIXME([^A-Za-z0-9_]|$)' \+ -e 'not[[:space:]]*implemented' \+ -e 'throw[[:space:]]+new[[:space:]]+Error\([^)]*implement' \+ -e '(mockData|fakeData|dummyData|sampleData|placeholderData)' \+ -e 'lorem[[:space:]]*ipsum' \+ -e 'implement[[:space:]]+(this|me|later)' \+ -e 'wire[[:space:]]+(this|it|up)[[:space:]]+later' \+ "$f" 2>/dev/null || true)+done <<< "$files"++if [ ${#violations[@]} -gt 0 ]; then+ printf 'Stop blocked by done-gate hook. Lazy patterns remain in changed files:\n' >&2+ for v in "${violations[@]}"; do+ printf ' %s\n' "$v" >&2+ done+ printf '\nPer CLAUDE.md, finish the feature: implement real logic, remove TODOs/mocks, then stop.\n' >&2+ exit 2+fi++exit 0diff --git a/.claude/hooks/no-shortcuts.sh b/.claude/hooks/no-shortcuts.shold mode 100644new mode 100755diff --git a/.claude/settings.json b/.claude/settings.jsonindex 06f552579..bafb39232 100644--- a/.claude/settings.json+++ b/.claude/settings.json@@ -234,5 +234,29 @@},"includeCoAuthoredBy": true,- "respectGitignore": true+ "respectGitignore": true,++ "hooks": {+ "PreToolUse": [+ {+ "matcher": "Write|Edit|MultiEdit",+ "hooks": [+ {+ "type": "command",+ "command": "/workspaces/3D-Agent/.claude/hooks/no-shortcuts.sh"+ }+ ]+ }+ ],+ "Stop": [+ {+ "hooks": [+ {+ "type": "command",+ "command": "/workspaces/3D-Agent/.claude/hooks/done-gate.sh"+ }+ ]+ }+ ]+ }}diff --git a/a-embed.html b/a-embed.htmlindex 9520310f0..108285bfb 100644--- a/a-embed.html+++ b/a-embed.html@@ -169,14 +169,27 @@// URL: /a/:chainId/:agentId/embedconst ref = parseAgentRef(location.pathname);+ // Best-effort parent origin from referrer; never use '*'.+ const parentOrigin = (() => {+ try {+ if (window.parent === window) return location.origin;+ if (document.referrer) return new URL(document.referrer).origin;+ } catch {}+ return null;+ })();++ function postToParent(msg) {+ if (!parent || parent === window) return;+ if (!parentOrigin) return;+ try { parent.postMessage(msg, parentOrigin); } catch {}+ }+function showError(msg) {document.getElementById('loading').style.display = 'none';const el = document.getElementById('error');el.textContent = msg || 'Could not load agent';el.style.display = 'flex';- try {- parent?.postMessage({ __agent: true, type: 'error', message: msg }, '*');- } catch {}+ postToParent({ __agent: true, type: 'error', message: msg });}function showBlocked(host) {@@ -188,9 +201,7 @@<a href="${link}" target="_blank" rel="noopener">Open on three.ws ↗</a>`;el.style.display = 'flex';- try {- parent?.postMessage({ __agent: true, type: 'blocked', host }, '*');- } catch {}+ postToParent({ __agent: true, type: 'blocked', host });}// Best-effort parent hostname — referrer is the only cross-origin signal.@@ -261,18 +272,15 @@document.getElementById('loading').style.display = 'none';- parent?.postMessage(- {- __agent: true,- type: 'ready',- caip: resolved.caip,- chainId: ref.chainId,- agentId: ref.agentId,- name: resolved.name,- owner: resolved.onchain.owner,- },- '*',- );+ postToParent({+ __agent: true,+ type: 'ready',+ caip: resolved.caip,+ chainId: ref.chainId,+ agentId: ref.agentId,+ name: resolved.name,+ owner: resolved.onchain.owner,+ });}main().catch((err) => {diff --git a/agent-embed.html b/agent-embed.htmlindex 6903530b6..01625e6aa 100644--- a/agent-embed.html+++ b/agent-embed.html@@ -237,23 +237,41 @@let identityName = null;const pendingHellos = [];+ // Parent origin is locked to the first valid host message we receive+ // (ev.origin), or seeded from document.referrer as a best-effort+ // fallback so an unsolicited postReady() doesn't have to use '*'.+ let parentOrigin = (() => {+ try {+ if (window.parent === window) return location.origin;+ if (document.referrer) return new URL(document.referrer).origin;+ } catch {}+ return null;+ })();+ let parentOriginLocked = false;++ function postToParent(msg) {+ if (!parent || parent === window) return;+ if (!parentOrigin) {+ console.warn('[agent-embed] parent origin unknown; dropping', msg.type);+ return;+ }+ parent.postMessage(msg, parentOrigin);+ }+function postReady() {- parent?.postMessage(- {- type: 'agent:ready',- agentId,- version: BRIDGE_VERSION,- capabilities: CAPABILITIES,- name: identityName,- },- '*',- );+ postToParent({+ type: 'agent:ready',+ agentId,+ version: BRIDGE_VERSION,+ capabilities: CAPABILITIES,+ name: identityName,+ });// Legacy envelope for pre-v1 hosts.- parent?.postMessage({ __agent: agentId, type: 'ready', name: identityName }, '*');+ postToParent({ __agent: agentId, type: 'ready', name: identityName });}function postResize(height) {- parent?.postMessage({ type: 'agent:resize', agentId, height }, '*');+ postToParent({ type: 'agent:resize', agentId, height });}function handleAction(action) {@@ -262,11 +280,27 @@}window.addEventListener('message', (ev) => {+ if (ev.source !== window.parent) return;const msg = ev.data;if (!msg || typeof msg !== 'object') return;- // v1 envelope- if (msg.agentId && msg.agentId === agentId && typeof msg.type === 'string') {+ const isV1 =+ msg.agentId === agentId &&+ typeof msg.type === 'string' &&+ msg.type.startsWith('agent:');+ const isLegacy = msg.__agent === agentId;+ if (!isV1 && !isLegacy) return;++ // Lock the parent origin to the first authenticated message we see+ // and reject anything from a different origin thereafter.+ if (!parentOriginLocked) {+ parentOrigin = ev.origin;+ parentOriginLocked = true;+ } else if (ev.origin !== parentOrigin) {+ return;+ }++ if (isV1) {switch (msg.type) {case 'agent:hello':if (bridgeReady) postReady();@@ -277,18 +311,13 @@return;case 'agent:ping':if (bridgeReady)- parent?.postMessage(- { type: 'agent:pong', agentId, id: msg.id },- '*',- );+ postToParent({ type: 'agent:pong', agentId, id: msg.id });return;}}// Legacy envelope. Kept until all known hosts migrate.- if (msg.__agent === agentId) {- if (msg.type === 'action' && msg.action) handleAction(msg.action);- }+ if (isLegacy && msg.type === 'action' && msg.action) handleAction(msg.action);});async function main() {@@ -304,8 +333,8 @@? "This agent's iframe embed is disabled.": 'This agent can only be embedded on approved sites.';showError(msg);- parent?.postMessage({ type: 'agent:blocked', agentId }, '*');- parent?.postMessage({ __agent: agentId, type: 'blocked' }, '*');+ postToParent({ type: 'agent:blocked', agentId });+ postToParent({ __agent: agentId, type: 'blocked' });return;}@@ -422,7 +451,7 @@// Echo every protocol action onto the bridge so hosts can mirror state// (chat UIs, telemetry, host-side animation triggers).protocol.on('*', (action) => {- parent?.postMessage({ type: 'agent:action', agentId, action }, '*');+ postToParent({ type: 'agent:action', agentId, action });});// Report content height to host so embed-sdk can auto-fit the iframe.diff --git a/api/_lib/format/links.js b/api/_lib/format/links.jsnew file mode 100644index 000000000..c9715c03d--- /dev/null+++ b/api/_lib/format/links.js@@ -0,0 +1,78 @@+// Solana / Pump link & format helpers. Ported from pumpkit+// @pumpkit/core/src/formatter/links.ts.+//+// Two flavours of output:+// - HTML: anchor tags suitable for Telegram-style bots and our own+// <span class="rich-text"> renderers.+// - Plain: same data, without markup, for SMS / logs / JSON payloads.++const SOLSCAN_TX = (sig) => `https://solscan.io/tx/${sig}`;+const SOLSCAN_ACCOUNT = (addr) => `https://solscan.io/account/${addr}`;+const PUMPFUN_TOKEN = (mint) => `https://pump.fun/coin/${mint}`;+const DEXSCREENER_TOKEN = (mint, chain = 'solana') => `https://dexscreener.com/${chain}/${mint}`;++function escapeHtml(s) {+ return String(s)+ .replace(/&/g, '&')+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/"/g, '"');+}++// ── HTML helpers ────────────────────────────────────────────────────────+export function link(label, url) {+ return `<a href="${escapeHtml(url)}">${escapeHtml(label)}</a>`;+}+export function bold(text) { return `<b>${escapeHtml(text)}</b>`; }+export function code(text) { return `<code>${escapeHtml(text)}</code>`; }+export function italic(text) { return `<i>${escapeHtml(text)}</i>`; }++export function solscanTx(signature) { return link('View TX', SOLSCAN_TX(signature)); }+export function solscanAccount(address) { return link(shortenAddress(address), SOLSCAN_ACCOUNT(address)); }+export function pumpFunToken(mint) { return link('View on PumpFun', PUMPFUN_TOKEN(mint)); }+export function dexScreenerToken(mint, chain = 'solana') { return link('DexScreener', DEXSCREENER_TOKEN(mint, chain)); }++// ── Plain-string helpers ────────────────────────────────────────────────+export const urls = {+ solscanTx: SOLSCAN_TX,+ solscanAccount: SOLSCAN_ACCOUNT,+ pumpFunToken: PUMPFUN_TOKEN,+ dexScreenerToken: DEXSCREENER_TOKEN,+};++export function shortenAddress(address, chars = 4) {+ const s = String(address || '');+ if (s.length <= chars * 2 + 3) return s;+ return `${s.slice(0, chars)}...${s.slice(-chars)}`;+}++// Lamports → SOL string. Accepts number, bigint, or numeric string.+export function formatSol(lamports) {+ const n = typeof lamports === 'bigint' ? Number(lamports) : Number(lamports || 0);+ const sol = n / 1_000_000_000;+ const decimals = sol === 0 ? 2 : sol < 1 ? 4 : 2;+ return `${sol.toFixed(decimals)} SOL`;+}++// USDC base-units (6 decimals) → "$1,234.56".+export function formatUsdc(baseUnits) {+ const n = typeof baseUnits === 'bigint' ? Number(baseUnits) : Number(baseUnits || 0);+ const usdc = n / 1_000_000;+ return `$${usdc.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;+}++export function formatNumber(n) {+ return Number(n || 0).toLocaleString('en-US');+}++// Compact form: 1_234_567 → "1.23M". Useful for token supply / market cap.+export function formatCompact(n) {+ const x = Number(n || 0);+ if (!isFinite(x)) return '—';+ const abs = Math.abs(x);+ if (abs >= 1e12) return (x / 1e12).toFixed(2) + 'T';+ if (abs >= 1e9) return (x / 1e9).toFixed(2) + 'B';+ if (abs >= 1e6) return (x / 1e6).toFixed(2) + 'M';+ if (abs >= 1e3) return (x / 1e3).toFixed(2) + 'K';+ return x.toFixed(2);+}diff --git a/api/_lib/solana/idl.js b/api/_lib/solana/idl.jsnew file mode 100644index 000000000..b0fa1c445--- /dev/null+++ b/api/_lib/solana/idl.js@@ -0,0 +1,32 @@+// Loader for vendored Pump program IDLs. Reading the JSON via fs (instead of+// `import ... assert { type: 'json' }`) keeps the helper compatible with both+// Vercel's bundler and Node's ESM loader without flag flips.++import { readFileSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import { dirname, resolve } from 'node:path';++const HERE = dirname(fileURLToPath(import.meta.url));+const IDL_DIR = resolve(HERE, '../../../contracts/idl/pump');++const cache = new Map();++function load(name) {+ if (cache.has(name)) return cache.get(name);+ const path = resolve(IDL_DIR, `${name}.json`);+ const idl = JSON.parse(readFileSync(path, 'utf8'));+ cache.set(name, idl);+ return idl;+}++export const loadPumpIdl = () => load('pump');+export const loadPumpAmmIdl = () => load('pump_amm');+export const loadPumpFeesIdl = () => load('pump_fees');++export function loadAllPumpIdls() {+ return {+ pump: loadPumpIdl(),+ pump_amm: loadPumpAmmIdl(),+ pump_fees: loadPumpFeesIdl(),+ };+}diff --git a/api/_lib/solana/index.js b/api/_lib/solana/index.jsnew file mode 100644index 000000000..23332ec01--- /dev/null+++ b/api/_lib/solana/index.js@@ -0,0 +1,7 @@+// Barrel for the Solana helper module set. Single import surface for the rest+// of the codebase.++export * from './programs.js';+export * from './rpc-fallback.js';+export * from './sdk-bridge.js';+export * from './idl.js';diff --git a/api/_lib/solana/rpc-fallback.js b/api/_lib/solana/rpc-fallback.jsnew file mode 100644index 000000000..0a5c81695--- /dev/null+++ b/api/_lib/solana/rpc-fallback.js@@ -0,0 +1,136 @@+// Multi-endpoint Solana RPC connection with automatic failover.+// Ported from pumpkit @pumpkit/core/src/solana/rpc.ts to our serverless layout.+//+// Usage:+// import { createRpcFallback } from './rpc-fallback.js';+// const rpc = createRpcFallback({ url: env.SOLANA_RPC_URL, fallbackUrls: [...] });+// const slot = await rpc.withFallback((c) => c.getSlot());+//+// Rotation policy:+// - 3 consecutive retryable failures → rotate to next endpoint, prior in 60s cooldown.+// - 403 / non-retryable errors are re-thrown immediately (auth issues should not+// burn through fallbacks).++import { Connection } from '@solana/web3.js';++const MAX_CONSECUTIVE_FAILS = 3;+const COOLDOWN_MS = 60_000;++export function deriveWsUrl(httpUrl) {+ return String(httpUrl).replace(/^https:/, 'wss:').replace(/^http:/, 'ws:');+}++function maskUrl(url) {+ try {+ const u = new URL(url);+ if (u.pathname.length > 10) {+ return `${u.protocol}//${u.host}/${u.pathname.slice(1, 8)}…`;+ }+ return `${u.protocol}//${u.host}`;+ } catch {+ return String(url).slice(0, 20) + '…';+ }+}++function isRetryable(err) {+ const msg = String(err && err.message ? err.message : err);+ if (msg.includes('403')) return false;+ return (+ msg.includes('429') ||+ msg.includes('502') ||+ msg.includes('503') ||+ msg.includes('504') ||+ msg.includes('ETIMEDOUT') ||+ msg.includes('ECONNREFUSED') ||+ msg.includes('ECONNRESET') ||+ msg.includes('fetch failed')+ );+}++export class RpcFallback {+ constructor({ url, fallbackUrls = [], commitment = 'confirmed' } = {}) {+ if (!url) throw new Error('RpcFallback: primary url is required');+ this.urls = [url, ...fallbackUrls];+ this.commitment = commitment;+ this.currentIndex = 0;+ this.failCounts = new Array(this.urls.length).fill(0);+ this.cooldownUntil = new Array(this.urls.length).fill(0);+ this.connections = new Array(this.urls.length).fill(null);+ }++ getConnection() {+ if (!this.connections[this.currentIndex]) {+ const url = this.urls[this.currentIndex];+ this.connections[this.currentIndex] = new Connection(url, {+ commitment: this.commitment,+ wsEndpoint: deriveWsUrl(url),+ });+ }+ return this.connections[this.currentIndex];+ }++ get currentUrl() {+ return this.urls[this.currentIndex];+ }++ reportSuccess() {+ this.failCounts[this.currentIndex] = 0;+ }++ reportFailure() {+ this.failCounts[this.currentIndex]++;+ if (this.failCounts[this.currentIndex] >= MAX_CONSECUTIVE_FAILS) this._rotate();+ }++ async withFallback(fn) {+ const tried = new Set();+ while (tried.size < this.urls.length) {+ if (this.cooldownUntil[this.currentIndex] > Date.now()) {+ this._rotate();+ if (tried.has(this.currentIndex)) break;+ continue;+ }+ tried.add(this.currentIndex);+ try {+ const result = await fn(this.getConnection());+ this.reportSuccess();+ return result;+ } catch (err) {+ if (isRetryable(err)) {+ console.warn('[rpc-fallback] %s rotated: %s', maskUrl(this.currentUrl), String(err).slice(0, 120));+ this.reportFailure();+ } else {+ throw err;+ }+ }+ }+ throw new Error('All RPC endpoints exhausted');+ }++ _rotate() {+ this.cooldownUntil[this.currentIndex] = Date.now() + COOLDOWN_MS;+ this.connections[this.currentIndex] = null;+ const prev = this.currentIndex;+ this.currentIndex = (this.currentIndex + 1) % this.urls.length;+ this.failCounts[this.currentIndex] = 0;+ if (this.urls.length > 1) {+ console.info('[rpc-fallback] rotated %s → %s', maskUrl(this.urls[prev]), maskUrl(this.currentUrl));+ }+ }+}++export function createRpcFallback(options) {+ return new RpcFallback(options);+}++// Convenience: build a fallback set from env. Honors:+// SOLANA_RPC_URL — primary+// SOLANA_RPC_FALLBACK_URLS — comma-separated alternates (optional)+export function rpcFallbackFromEnv({ network = 'mainnet', commitment = 'confirmed' } = {}) {+ const primary = network === 'devnet'+ ? (process.env.SOLANA_RPC_URL_DEVNET || 'https://api.devnet.solana.com')+ : (process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com');+ const fallbacks = (process.env.SOLANA_RPC_FALLBACK_URLS || '')+ .split(',').map((s) => s.trim()).filter(Boolean);+ return new RpcFallback({ url: primary, fallbackUrls: fallbacks, commitment });+}diff --git a/api/_lib/solana/sdk-bridge.js b/api/_lib/solana/sdk-bridge.jsnew file mode 100644index 000000000..07e7c4150--- /dev/null+++ b/api/_lib/solana/sdk-bridge.js@@ -0,0 +1,124 @@+// Read-side wrappers around @nirholas/pump-sdk for bonding-curve pricing.+// Ported from pumpkit @pumpkit/core/src/solana/sdk-bridge.ts.+//+// All helpers accept a @solana/web3.js Connection and a PublicKey mint, and+// return null on missing-account / sdk errors so callers can render "no curve"+// without try/catch boilerplate.++import { PublicKey } from '@solana/web3.js';++let _sdkPromise = null;+async function loadSdk() {+ if (!_sdkPromise) _sdkPromise = import('@nirholas/pump-sdk');+ return _sdkPromise;+}++let _bnPromise = null;+async function loadBN() {+ if (!_bnPromise) _bnPromise = import('bn.js').then((m) => m.default || m);+ return _bnPromise;+}++function toPubkey(mint) {+ return mint instanceof PublicKey ? mint : new PublicKey(String(mint));+}++async function fetchState(connection, mint) {+ const { OnlinePumpSdk } = await loadSdk();+ const sdk = new OnlinePumpSdk(connection);+ const [global, feeConfig, bondingCurve] = await Promise.all([+ sdk.fetchGlobal(),+ sdk.fetchFeeConfig(),+ sdk.fetchBondingCurve(mint),+ ]);+ const mintSupply = bondingCurve.tokenTotalSupply.sub(bondingCurve.virtualTokenReserves);+ return { sdk, global, feeConfig, bondingCurve, mintSupply };+}++export async function getTokenPrice(connection, mint) {+ try {+ const pk = toPubkey(mint);+ const { getTokenPrice: sdkGetTokenPrice } = await loadSdk();+ const { global, feeConfig, bondingCurve, mintSupply } = await fetchState(connection, pk);+ return sdkGetTokenPrice({ global, feeConfig, mintSupply, bondingCurve });+ } catch (err) {+ console.warn('[sdk-bridge] getTokenPrice failed: %s', String(err).slice(0, 120));+ return null;+ }+}++export async function getGraduationProgress(connection, mint) {+ try {+ const pk = toPubkey(mint);+ const { OnlinePumpSdk, getGraduationProgress: sdkGetGrad } = await loadSdk();+ const sdk = new OnlinePumpSdk(connection);+ const [global, bondingCurve] = await Promise.all([+ sdk.fetchGlobal(),+ sdk.fetchBondingCurve(pk),+ ]);+ return sdkGetGrad(global, bondingCurve);+ } catch (err) {+ console.warn('[sdk-bridge] getGraduationProgress failed: %s', String(err).slice(0, 120));+ return null;+ }+}++export async function getBuyQuote(connection, mint, solAmount) {+ try {+ const pk = toPubkey(mint);+ const BN = await loadBN();+ const amount = solAmount instanceof BN ? solAmount : new BN(String(solAmount));+ const {+ getBuyTokenAmountFromSolAmount,+ calculateBuyPriceImpact,+ } = await loadSdk();+ const { global, feeConfig, bondingCurve, mintSupply } = await fetchState(connection, pk);+ const tokens = getBuyTokenAmountFromSolAmount({ global, feeConfig, mintSupply, bondingCurve, amount });+ const impact = calculateBuyPriceImpact({ global, feeConfig, mintSupply, bondingCurve, solAmount: amount });+ return { tokens, priceImpact: impact.impactBps / 100 };+ } catch (err) {+ console.warn('[sdk-bridge] getBuyQuote failed: %s', String(err).slice(0, 120));+ return null;+ }+}++export async function getSellQuote(connection, mint, tokenAmount) {+ try {+ const pk = toPubkey(mint);+ const BN = await loadBN();+ const amount = tokenAmount instanceof BN ? tokenAmount : new BN(String(tokenAmount));+ const {+ getSellSolAmountFromTokenAmount,+ calculateSellPriceImpact,+ } = await loadSdk();+ const { global, feeConfig, bondingCurve, mintSupply } = await fetchState(connection, pk);+ const sol = getSellSolAmountFromTokenAmount({ global, feeConfig, mintSupply, bondingCurve, amount });+ const impact = calculateSellPriceImpact({ global, feeConfig, mintSupply, bondingCurve, tokenAmount: amount });+ return { sol, priceImpact: impact.impactBps / 100 };+ } catch (err) {+ console.warn('[sdk-bridge] getSellQuote failed: %s', String(err).slice(0, 120));+ return null;+ }+}++export async function getBondingCurveState(connection, mint) {+ try {+ const pk = toPubkey(mint);+ const { OnlinePumpSdk } = await loadSdk();+ const sdk = new OnlinePumpSdk(connection);+ const bc = await sdk.fetchBondingCurve(pk);+ return {+ virtualTokenReserves: bc.virtualTokenReserves.toString(),+ virtualSolReserves: bc.virtualSolReserves.toString(),+ realTokenReserves: bc.realTokenReserves.toString(),+ realSolReserves: bc.realSolReserves.toString(),+ tokenTotalSupply: bc.tokenTotalSupply.toString(),+ complete: Boolean(bc.complete),+ creator: bc.creator.toBase58(),+ isMayhemMode: Boolean(bc.isMayhemMode),+ };+ } catch (err) {+ console.warn('[sdk-bridge] getBondingCurveState failed: %s', String(err).slice(0, 120));+ return null;+ }+}diff --git a/api/pump/curve.js b/api/pump/curve.jsnew file mode 100644index 000000000..22ca95762--- /dev/null+++ b/api/pump/curve.js@@ -0,0 +1,79 @@+// GET /api/pump/curve?mint=<mint>[&network=mainnet|devnet]+// ----------------------------------------------------------+// Public, read-only bonding-curve view. Combines @nirholas/pump-sdk reads via+// our RpcFallback + sdk-bridge helpers and returns:+// - bonding curve raw state+// - current price + market cap+// - graduation progress+//+// Cached at the edge for 10s — the curve only changes per trade so a few+// seconds of staleness is acceptable and keeps RPC cost down on hot mints.++import { cors, json, method, wrap, error } from '../_lib/http.js';+import { rpcFallbackFromEnv, getBondingCurveState, getTokenPrice, getGraduationProgress } from '../_lib/solana/index.js';++function readMint(req) {+ try {+ const u = new URL(req.url, 'http://x');+ return {+ mint: (u.searchParams.get('mint') || '').trim(),+ network: u.searchParams.get('network') === 'devnet' ? 'devnet' : 'mainnet',+ };+ } catch {+ return { mint: '', network: 'mainnet' };+ }+}++function isPlausibleMint(s) {+ return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(s);+}++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;+ if (!method(req, res, ['GET'])) return;++ const { mint, network } = readMint(req);+ if (!mint || !isPlausibleMint(mint)) {+ return error(res, 400, 'bad_mint', 'mint query param must be a base58 Solana address');+ }++ const rpc = rpcFallbackFromEnv({ network });+ const result = await rpc.withFallback(async (connection) => {+ const [curve, price, grad] = await Promise.all([+ getBondingCurveState(connection, mint),+ getTokenPrice(connection, mint),+ getGraduationProgress(connection, mint),+ ]);+ return { curve, price, graduation: grad };+ });++ if (!result.curve) {+ return error(res, 404, 'no_curve', 'no bonding curve found for that mint');+ }++ res.setHeader('Cache-Control', 'public, max-age=5, s-maxage=10, stale-while-revalidate=30');+ return json(res, 200, {+ mint,+ network,+ rpc: undefined,+ ...result,+ // price/graduation values from the SDK contain BNs — stringify them for JSON wire safety+ price: result.price ? serializeBNs(result.price) : null,+ graduation: result.graduation ? serializeBNs(result.graduation) : null,+ });+});++function serializeBNs(obj) {+ if (obj == null || typeof obj !== 'object') return obj;+ const out = Array.isArray(obj) ? [] : {};+ for (const [k, v] of Object.entries(obj)) {+ if (v && typeof v === 'object' && typeof v.toString === 'function' && (v.constructor?.name === 'BN' || typeof v.toNumber === 'function')) {+ out[k] = v.toString();+ } else if (v && typeof v === 'object') {+ out[k] = serializeBNs(v);+ } else {+ out[k] = v;+ }+ }+ return out;+}diff --git a/contracts/idl/pump/README.md b/contracts/idl/pump/README.mdnew file mode 100644index 000000000..f598fcbf4--- /dev/null+++ b/contracts/idl/pump/README.md@@ -0,0 +1,25 @@+# Pump Protocol IDLs++Vendored Anchor IDLs for the three on-chain Pump programs. Imported from the+[pump-fun/pump-public-docs](https://github.com/pump-fun/pump-public-docs)+repository (via [nirholas/pumpkit](https://github.com/nirholas/pumpkit)) and+checked in so the API + worker layers can decode instructions and events+without an extra HTTP fetch on cold start.++| File | Program | Program ID |+| --- | --- | --- |+| `pump.json` | Pump bonding-curve | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` |+| `pump_amm.json` | PumpSwap AMM | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` |+| `pump_fees.json` | Pump fees / cashback | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` |++Constants are also exposed programmatically in+[`api/_lib/solana/programs.js`](../../../api/_lib/solana/programs.js).++To refresh, re-run:++```bash+for f in pump pump_amm pump_fees; do+ curl -sL "https://raw.githubusercontent.com/pump-fun/pump-public-docs/main/idl/$f.json" \+ -o "contracts/idl/pump/$f.json"+done+```diff --git a/contracts/idl/pump/pump.json b/contracts/idl/pump/pump.jsonnew file mode 100644index 000000000..9977ae362--- /dev/null+++ b/contracts/idl/pump/pump.json@@ -0,0 +1,7098 @@+{+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",+ "metadata": {+ "name": "pump",+ "version": "0.1.0",+ "spec": "0.1.0",+ "description": "Created with Anchor"+ },+ "instructions": [+ {+ "name": "admin_set_creator",+ "docs": [+ "Allows Global::admin_set_creator_authority to override the bonding curve creator"+ ],+ "discriminator": [+ 69,+ 25,+ 171,+ 142,+ 57,+ 239,+ 13,+ 4+ ],+ "accounts": [+ {+ "name": "admin_set_creator_authority",+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "mint"+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "creator",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "admin_set_idl_authority",+ "discriminator": [+ 8,+ 217,+ 96,+ 231,+ 144,+ 104,+ 192,+ 5+ ],+ "accounts": [+ {+ "name": "authority",+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "idl_account",+ "writable": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "program_signer",+ "pda": {+ "seeds": []+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "idl_authority",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "admin_update_token_incentives",+ "discriminator": [+ 209,+ 11,+ 115,+ 87,+ 213,+ 23,+ 124,+ 204+ ],+ "accounts": [+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "global_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "mint"+ },+ {+ "name": "global_incentive_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "global_volume_accumulator"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "start_time",+ "type": "i64"+ },+ {+ "name": "end_time",+ "type": "i64"+ },+ {+ "name": "seconds_in_a_day",+ "type": "i64"+ },+ {+ "name": "day_number",+ "type": "u64"+ },+ {+ "name": "pump_token_supply_per_day",+ "type": "u64"+ }+ ]+ },+ {+ "name": "buy",+ "docs": [+ "Buys tokens from a bonding curve."+ ],+ "discriminator": [+ 102,+ 6,+ 61,+ 18,+ 1,+ 218,+ 235,+ 234+ ],+ "accounts": [+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "fee_recipient",+ "writable": true+ },+ {+ "name": "mint"+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "associated_bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "bonding_curve"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "associated_user",+ "writable": true+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program"+ },+ {+ "name": "creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "bonding_curve.creator",+ "account": "BondingCurve"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "fee_program"+ }+ }+ },+ {+ "name": "fee_program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ }+ ],+ "args": [+ {+ "name": "amount",+ "type": "u64"+ },+ {+ "name": "max_sol_cost",+ "type": "u64"+ },+ {+ "name": "track_volume",+ "type": {+ "defined": {+ "name": "OptionBool"+ }+ }+ }+ ]+ },+ {+ "name": "buy_exact_sol_in",+ "docs": [+ "Given a budget of spendable SOL, buy at least min_tokens_out tokens.",+ "Fees are deducted from spendable_sol_in.",+ "",+ "# Quote formulas",+ "Where:",+ "- total_fee_bps = protocol_fee_bps + creator_fee_bps (creator_fee_bps is 0 if no creator)",+ "- floor(a/b) = a / b (integer division)",+ "- ceil(a/b) = (a + b - 1) / b",+ "",+ "SOL → tokens quote",+ "To calculate tokens_out for a given spendable_sol_in:",+ "1. net_sol = floor(spendable_sol_in * 10_000 / (10_000 + total_fee_bps))",+ "2. fees = ceil(net_sol * protocol_fee_bps / 10_000) + ceil(net_sol * creator_fee_bps / 10_000) (creator_fee_bps is 0 if no creator)",+ "3. if net_sol + fees > spendable_sol_in: net_sol = net_sol - (net_sol + fees - spendable_sol_in)",+ "4. tokens_out = floor((net_sol - 1) * virtual_token_reserves / (virtual_sol_reserves + net_sol - 1))",+ "",+ "Reverse quote (tokens → SOL)",+ "To calculate spendable_sol_in for a desired number of tokens:",+ "1. net_sol = ceil(tokens * virtual_sol_reserves / (virtual_token_reserves - tokens)) + 1",+ "2. spendable_sol_in = ceil(net_sol * (10_000 + total_fee_bps) / 10_000)",+ "",+ "Rent",+ "Separately make sure the instruction's payer has enough SOL to cover rent for:",+ "- creator_vault: rent.minimum_balance(0)",+ "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)"+ ],+ "discriminator": [+ 56,+ 252,+ 116,+ 8,+ 158,+ 223,+ 205,+ 95+ ],+ "accounts": [+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "fee_recipient",+ "writable": true+ },+ {+ "name": "mint"+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "associated_bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "bonding_curve"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "associated_user",+ "writable": true+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program"+ },+ {+ "name": "creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "bonding_curve.creator",+ "account": "BondingCurve"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "fee_program"+ }+ }+ },+ {+ "name": "fee_program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ }+ ],+ "args": [+ {+ "name": "spendable_sol_in",+ "type": "u64"+ },+ {+ "name": "min_tokens_out",+ "type": "u64"+ },+ {+ "name": "track_volume",+ "type": {+ "defined": {+ "name": "OptionBool"+ }+ }+ }+ ]+ },+ {+ "name": "claim_cashback",+ "discriminator": [+ 37,+ 58,+ 35,+ 126,+ 190,+ 53,+ 228,+ 197+ ],+ "accounts": [+ {+ "name": "user",+ "writable": true+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ }+ ],+ "args": []+ },+ {+ "name": "claim_token_incentives",+ "discriminator": [+ 16,+ 4,+ 71,+ 28,+ 204,+ 1,+ 40,+ 27+ ],+ "accounts": [+ {+ "name": "user"+ },+ {+ "name": "user_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "user"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "global_incentive_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "global_volume_accumulator"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "mint",+ "relations": [+ "global_volume_accumulator"+ ]+ },+ {+ "name": "token_program"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ },+ {+ "name": "payer",+ "writable": true,+ "signer": true+ }+ ],+ "args": []+ },+ {+ "name": "close_user_volume_accumulator",+ "discriminator": [+ 249,+ 69,+ 164,+ 218,+ 150,+ 103,+ 84,+ 138+ ],+ "accounts": [+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "collect_creator_fee",+ "docs": [+ "Collects creator_fee from creator_vault to the coin creator account"+ ],+ "discriminator": [+ 20,+ 22,+ 86,+ 123,+ 198,+ 28,+ 219,+ 132+ ],+ "accounts": [+ {+ "name": "creator",+ "writable": true+ },+ {+ "name": "creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "creator"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "create",+ "docs": [+ "Creates a new coin and bonding curve."+ ],+ "discriminator": [+ 24,+ 30,+ 200,+ 40,+ 5,+ 28,+ 7,+ 119+ ],+ "accounts": [+ {+ "name": "mint",+ "writable": true,+ "signer": true+ },+ {+ "name": "mint_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 105,+ 110,+ 116,+ 45,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "associated_bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "bonding_curve"+ },+ {+ "kind": "const",+ "value": [+ 6,+ 221,+ 246,+ 225,+ 215,+ 101,+ 161,+ 147,+ 217,+ 203,+ 225,+ 70,+ 206,+ 235,+ 121,+ 172,+ 28,+ 180,+ 133,+ 237,+ 95,+ 91,+ 55,+ 145,+ 58,+ 140,+ 245,+ 133,+ 126,+ 255,+ 0,+ 169+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "mpl_token_metadata",+ "address": "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"+ },+ {+ "name": "metadata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 101,+ 116,+ 97,+ 100,+ 97,+ 116,+ 97+ ]+ },+ {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "mpl_token_metadata"+ }+ }+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program",+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "rent",+ "address": "SysvarRent111111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "name",+ "type": "string"+ },+ {+ "name": "symbol",+ "type": "string"+ },+ {+ "name": "uri",+ "type": "string"+ },+ {+ "name": "creator",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "create_v2",+ "docs": [+ "Creates a new spl-22 coin and bonding curve."+ ],+ "discriminator": [+ 214,+ 144,+ 76,+ 236,+ 95,+ 139,+ 49,+ 180+ ],+ "accounts": [+ {+ "name": "mint",+ "writable": true,+ "signer": true+ },+ {+ "name": "mint_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 105,+ 110,+ 116,+ 45,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "associated_bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "bonding_curve"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program",+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "mayhem_program_id",+ "writable": true,+ "address": "MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e"+ },+ {+ "name": "global_params",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 45,+ 112,+ 97,+ 114,+ 97,+ 109,+ 115+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 5,+ 42,+ 229,+ 215,+ 167,+ 218,+ 167,+ 36,+ 166,+ 234,+ 176,+ 167,+ 41,+ 84,+ 145,+ 133,+ 90,+ 212,+ 160,+ 103,+ 22,+ 96,+ 103,+ 76,+ 78,+ 3,+ 69,+ 89,+ 128,+ 61,+ 101,+ 163+ ]+ }+ }+ },+ {+ "name": "sol_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 111,+ 108,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 5,+ 42,+ 229,+ 215,+ 167,+ 218,+ 167,+ 36,+ 166,+ 234,+ 176,+ 167,+ 41,+ 84,+ 145,+ 133,+ 90,+ 212,+ 160,+ 103,+ 22,+ 96,+ 103,+ 76,+ 78,+ 3,+ 69,+ 89,+ 128,+ 61,+ 101,+ 163+ ]+ }+ }+ },+ {+ "name": "mayhem_state",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 97,+ 121,+ 104,+ 101,+ 109,+ 45,+ 115,+ 116,+ 97,+ 116,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 5,+ 42,+ 229,+ 215,+ 167,+ 218,+ 167,+ 36,+ 166,+ 234,+ 176,+ 167,+ 41,+ 84,+ 145,+ 133,+ 90,+ 212,+ 160,+ 103,+ 22,+ 96,+ 103,+ 76,+ 78,+ 3,+ 69,+ 89,+ 128,+ 61,+ 101,+ 163+ ]+ }+ }+ },+ {+ "name": "mayhem_token_vault",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "name",+ "type": "string"+ },+ {+ "name": "symbol",+ "type": "string"+ },+ {+ "name": "uri",+ "type": "string"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ },+ {+ "name": "is_cashback_enabled",+ "type": {+ "defined": {+ "name": "OptionBool"+ }+ }+ }+ ]+ },+ {+ "name": "distribute_creator_fees",+ "docs": [+ "Distributes creator fees to shareholders based on their share percentages",+ "The creator vault needs to have at least the minimum distributable amount to distribute fees",+ "This can be checked with the get_minimum_distributable_fee instruction"+ ],+ "discriminator": [+ 165,+ 114,+ 103,+ 0,+ 121,+ 206,+ 247,+ 81+ ],+ "accounts": [+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "bonding_curve",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "sharing_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 53,+ 255,+ 169,+ 5,+ 90,+ 142,+ 86,+ 141,+ 168,+ 247,+ 188,+ 7,+ 86,+ 21,+ 39,+ 76,+ 241,+ 201,+ 44,+ 164,+ 31,+ 64,+ 0,+ 156,+ 81,+ 106,+ 164,+ 20,+ 194,+ 124,+ 112+ ]+ }+ }+ },+ {+ "name": "creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "bonding_curve.creator",+ "account": "BondingCurve"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ }+ ],+ "args": [],+ "returns": {+ "defined": {+ "name": "DistributeCreatorFeesEvent"+ }+ }+ },+ {+ "name": "extend_account",+ "docs": [+ "Extends the size of program-owned accounts"+ ],+ "discriminator": [+ 234,+ 102,+ 194,+ 203,+ 150,+ 72,+ 62,+ 229+ ],+ "accounts": [+ {+ "name": "account",+ "writable": true+ },+ {+ "name": "user",+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "get_minimum_distributable_fee",+ "docs": [+ "Permissionless instruction to check the minimum required fees for distribution",+ "Returns the minimum required balance from the creator_vault and whether distribution can proceed"+ ],+ "discriminator": [+ 117,+ 225,+ 127,+ 202,+ 134,+ 95,+ 68,+ 35+ ],+ "accounts": [+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "bonding_curve",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "sharing_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 53,+ 255,+ 169,+ 5,+ 90,+ 142,+ 86,+ 141,+ 168,+ 247,+ 188,+ 7,+ 86,+ 21,+ 39,+ 76,+ 241,+ 201,+ 44,+ 164,+ 31,+ 64,+ 0,+ 156,+ 81,+ 106,+ 164,+ 20,+ 194,+ 124,+ 112+ ]+ }+ }+ },+ {+ "name": "creator_vault",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "bonding_curve.creator",+ "account": "BondingCurve"+ }+ ]+ }+ }+ ],+ "args": [],+ "returns": {+ "defined": {+ "name": "MinimumDistributableFeeEvent"+ }+ }+ },+ {+ "name": "init_user_volume_accumulator",+ "discriminator": [+ 94,+ 6,+ 202,+ 115,+ 255,+ 96,+ 232,+ 183+ ],+ "accounts": [+ {+ "name": "payer",+ "writable": true,+ "signer": true+ },+ {+ "name": "user"+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "initialize",+ "docs": [+ "Creates the global state."+ ],+ "discriminator": [+ 175,+ 175,+ 109,+ 31,+ 13,+ 152,+ 155,+ 237+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ }+ ],+ "args": []+ },+ {+ "name": "migrate",+ "docs": [+ "Migrates liquidity to pump_amm if the bonding curve is complete"+ ],+ "discriminator": [+ 155,+ 234,+ 231,+ 146,+ 236,+ 158,+ 162,+ 30+ ],+ "accounts": [+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "withdraw_authority",+ "writable": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "mint"+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "associated_bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "bonding_curve"+ },+ {+ "kind": "account",+ "path": "mint"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "user",+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program",+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"+ },+ {+ "name": "pump_amm",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "pool",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 112,+ 111,+ 111,+ 108+ ]+ },+ {+ "kind": "const",+ "value": [+ 0,+ 0+ ]+ },+ {+ "kind": "account",+ "path": "pool_authority"+ },+ {+ "kind": "account",+ "path": "mint"+ },+ {+ "kind": "account",+ "path": "wsol_mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "pump_amm"+ }+ }+ },+ {+ "name": "pool_authority",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 112,+ 111,+ 111,+ 108,+ 45,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "pool_authority_mint_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool_authority"+ },+ {+ "kind": "account",+ "path": "mint"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "associated_token_program"+ }+ }+ },+ {+ "name": "pool_authority_wsol_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool_authority"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "wsol_mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "associated_token_program"+ }+ }+ },+ {+ "name": "amm_global_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "pump_amm"+ }+ }+ },+ {+ "name": "wsol_mint",+ "address": "So11111111111111111111111111111111111111112"+ },+ {+ "name": "lp_mint",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 112,+ 111,+ 111,+ 108,+ 95,+ 108,+ 112,+ 95,+ 109,+ 105,+ 110,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "pool"+ }+ ],+ "program": {+ "kind": "account",+ "path": "pump_amm"+ }+ }+ },+ {+ "name": "user_pool_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool_authority"+ },+ {+ "kind": "account",+ "path": "token_2022_program"+ },+ {+ "kind": "account",+ "path": "lp_mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "associated_token_program"+ }+ }+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool"+ },+ {+ "kind": "account",+ "path": "mint"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "associated_token_program"+ }+ }+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "wsol_mint"+ }+ ],+ "program": {+ "kind": "account",+ "path": "associated_token_program"+ }+ }+ },+ {+ "name": "token_2022_program",+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "pump_amm_event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "pump_amm"+ }+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "migrate_bonding_curve_creator",+ "discriminator": [+ 87,+ 124,+ 52,+ 191,+ 52,+ 38,+ 214,+ 232+ ],+ "accounts": [+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "sharing_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 53,+ 255,+ 169,+ 5,+ 90,+ 142,+ 86,+ 141,+ 168,+ 247,+ 188,+ 7,+ 86,+ 21,+ 39,+ 76,+ 241,+ 201,+ 44,+ 164,+ 31,+ 64,+ 0,+ 156,+ 81,+ 106,+ 164,+ 20,+ 194,+ 124,+ 112+ ]+ }+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "sell",+ "docs": [+ "Sells tokens into a bonding curve.",+ "For cashback coins, optionally pass user_volume_accumulator as remaining_accounts[0].",+ "If provided and valid, creator_fee goes to user_volume_accumulator.",+ "Otherwise, falls back to transferring creator_fee to creator_vault."+ ],+ "discriminator": [+ 51,+ 230,+ 133,+ 164,+ 1,+ 127,+ 131,+ 173+ ],+ "accounts": [+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "fee_recipient",+ "writable": true+ },+ {+ "name": "mint"+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "associated_bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "bonding_curve"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "associated_user",+ "writable": true+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "bonding_curve.creator",+ "account": "BondingCurve"+ }+ ]+ }+ },+ {+ "name": "token_program"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ },+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "fee_program"+ }+ }+ },+ {+ "name": "fee_program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ }+ ],+ "args": [+ {+ "name": "amount",+ "type": "u64"+ },+ {+ "name": "min_sol_output",+ "type": "u64"+ }+ ]+ },+ {+ "name": "set_creator",+ "docs": [+ "Allows Global::set_creator_authority to set the bonding curve creator from Metaplex metadata or input argument"+ ],+ "discriminator": [+ 254,+ 148,+ 255,+ 112,+ 207,+ 142,+ 170,+ 165+ ],+ "accounts": [+ {+ "name": "set_creator_authority",+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "mint"+ },+ {+ "name": "metadata",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 101,+ 116,+ 97,+ 100,+ 97,+ 116,+ 97+ ]+ },+ {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ }+ }+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "creator",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "set_mayhem_virtual_params",+ "discriminator": [+ 61,+ 169,+ 188,+ 191,+ 153,+ 149,+ 42,+ 97+ ],+ "accounts": [+ {+ "name": "sol_vault_authority",+ "writable": true,+ "signer": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 111,+ 108,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 5,+ 42,+ 229,+ 215,+ 167,+ 218,+ 167,+ 36,+ 166,+ 234,+ 176,+ 167,+ 41,+ 84,+ 145,+ 133,+ 90,+ 212,+ 160,+ 103,+ 22,+ 96,+ 103,+ 76,+ 78,+ 3,+ 69,+ 89,+ 128,+ 61,+ 101,+ 163+ ]+ }+ }+ },+ {+ "name": "mayhem_token_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "sol_vault_authority"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "mint"+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "token_program",+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "set_metaplex_creator",+ "docs": [+ "Syncs the bonding curve creator with the Metaplex metadata creator if it exists"+ ],+ "discriminator": [+ 138,+ 96,+ 174,+ 217,+ 48,+ 85,+ 197,+ 246+ ],+ "accounts": [+ {+ "name": "mint"+ },+ {+ "name": "metadata",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 101,+ 116,+ 97,+ 100,+ 97,+ 116,+ 97+ ]+ },+ {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ }+ }+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "set_params",+ "docs": [+ "Sets the global state parameters."+ ],+ "discriminator": [+ 27,+ 234,+ 178,+ 52,+ 147,+ 2,+ 187,+ 141+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "initial_virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "initial_virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "initial_real_token_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "fee_basis_points",+ "type": "u64"+ },+ {+ "name": "withdraw_authority",+ "type": "pubkey"+ },+ {+ "name": "enable_migrate",+ "type": "bool"+ },+ {+ "name": "pool_migration_fee",+ "type": "u64"+ },+ {+ "name": "creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "admin_set_creator_authority",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "set_reserved_fee_recipients",+ "discriminator": [+ 111,+ 172,+ 162,+ 232,+ 114,+ 89,+ 213,+ 142+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "authority",+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "whitelist_pda",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "sync_user_volume_accumulator",+ "discriminator": [+ 86,+ 31,+ 192,+ 87,+ 163,+ 87,+ 79,+ 238+ ],+ "accounts": [+ {+ "name": "user"+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "toggle_cashback_enabled",+ "discriminator": [+ 115,+ 103,+ 224,+ 255,+ 189,+ 89,+ 86,+ 195+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "enabled",+ "type": "bool"+ }+ ]+ },+ {+ "name": "toggle_create_v2",+ "discriminator": [+ 28,+ 255,+ 230,+ 240,+ 172,+ 107,+ 203,+ 171+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "enabled",+ "type": "bool"+ }+ ]+ },+ {+ "name": "toggle_mayhem_mode",+ "discriminator": [+ 1,+ 9,+ 111,+ 208,+ 100,+ 31,+ 255,+ 163+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "enabled",+ "type": "bool"+ }+ ]+ },+ {+ "name": "update_global_authority",+ "discriminator": [+ 227,+ 181,+ 74,+ 196,+ 208,+ 21,+ 97,+ 213+ ],+ "accounts": [+ {+ "name": "global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "authority",+ "signer": true,+ "relations": [+ "global"+ ]+ },+ {+ "name": "new_authority"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ }+ ],+ "accounts": [+ {+ "name": "BondingCurve",+ "discriminator": [+ 23,+ 183,+ 248,+ 55,+ 96,+ 216,+ 172,+ 96+ ]+ },+ {+ "name": "FeeConfig",+ "discriminator": [+ 143,+ 52,+ 146,+ 187,+ 219,+ 123,+ 76,+ 155+ ]+ },+ {+ "name": "Global",+ "discriminator": [+ 167,+ 232,+ 232,+ 177,+ 200,+ 108,+ 114,+ 127+ ]+ },+ {+ "name": "GlobalVolumeAccumulator",+ "discriminator": [+ 202,+ 42,+ 246,+ 43,+ 142,+ 190,+ 30,+ 255+ ]+ },+ {+ "name": "SharingConfig",+ "discriminator": [+ 216,+ 74,+ 9,+ 0,+ 56,+ 140,+ 93,+ 75+ ]+ },+ {+ "name": "UserVolumeAccumulator",+ "discriminator": [+ 86,+ 255,+ 112,+ 14,+ 102,+ 53,+ 154,+ 250+ ]+ }+ ],+ "events": [+ {+ "name": "AdminSetCreatorEvent",+ "discriminator": [+ 64,+ 69,+ 192,+ 104,+ 29,+ 30,+ 25,+ 107+ ]+ },+ {+ "name": "AdminSetIdlAuthorityEvent",+ "discriminator": [+ 245,+ 59,+ 70,+ 34,+ 75,+ 185,+ 109,+ 92+ ]+ },+ {+ "name": "AdminUpdateTokenIncentivesEvent",+ "discriminator": [+ 147,+ 250,+ 108,+ 120,+ 247,+ 29,+ 67,+ 222+ ]+ },+ {+ "name": "ClaimCashbackEvent",+ "discriminator": [+ 226,+ 214,+ 246,+ 33,+ 7,+ 242,+ 147,+ 229+ ]+ },+ {+ "name": "ClaimTokenIncentivesEvent",+ "discriminator": [+ 79,+ 172,+ 246,+ 49,+ 205,+ 91,+ 206,+ 232+ ]+ },+ {+ "name": "CloseUserVolumeAccumulatorEvent",+ "discriminator": [+ 146,+ 159,+ 189,+ 172,+ 146,+ 88,+ 56,+ 244+ ]+ },+ {+ "name": "CollectCreatorFeeEvent",+ "discriminator": [+ 122,+ 2,+ 127,+ 1,+ 14,+ 191,+ 12,+ 175+ ]+ },+ {+ "name": "CompleteEvent",+ "discriminator": [+ 95,+ 114,+ 97,+ 156,+ 212,+ 46,+ 152,+ 8+ ]+ },+ {+ "name": "CompletePumpAmmMigrationEvent",+ "discriminator": [+ 189,+ 233,+ 93,+ 185,+ 92,+ 148,+ 234,+ 148+ ]+ },+ {+ "name": "CreateEvent",+ "discriminator": [+ 27,+ 114,+ 169,+ 77,+ 222,+ 235,+ 99,+ 118+ ]+ },+ {+ "name": "DistributeCreatorFeesEvent",+ "discriminator": [+ 165,+ 55,+ 129,+ 112,+ 4,+ 179,+ 202,+ 40+ ]+ },+ {+ "name": "ExtendAccountEvent",+ "discriminator": [+ 97,+ 97,+ 215,+ 144,+ 93,+ 146,+ 22,+ 124+ ]+ },+ {+ "name": "InitUserVolumeAccumulatorEvent",+ "discriminator": [+ 134,+ 36,+ 13,+ 72,+ 232,+ 101,+ 130,+ 216+ ]+ },+ {+ "name": "MigrateBondingCurveCreatorEvent",+ "discriminator": [+ 155,+ 167,+ 104,+ 220,+ 213,+ 108,+ 243,+ 3+ ]+ },+ {+ "name": "MinimumDistributableFeeEvent",+ "discriminator": [+ 168,+ 216,+ 132,+ 239,+ 235,+ 182,+ 49,+ 52+ ]+ },+ {+ "name": "ReservedFeeRecipientsEvent",+ "discriminator": [+ 43,+ 188,+ 250,+ 18,+ 221,+ 75,+ 187,+ 95+ ]+ },+ {+ "name": "SetCreatorEvent",+ "discriminator": [+ 237,+ 52,+ 123,+ 37,+ 245,+ 251,+ 72,+ 210+ ]+ },+ {+ "name": "SetMetaplexCreatorEvent",+ "discriminator": [+ 142,+ 203,+ 6,+ 32,+ 127,+ 105,+ 191,+ 162+ ]+ },+ {+ "name": "SetParamsEvent",+ "discriminator": [+ 223,+ 195,+ 159,+ 246,+ 62,+ 48,+ 143,+ 131+ ]+ },+ {+ "name": "SyncUserVolumeAccumulatorEvent",+ "discriminator": [+ 197,+ 122,+ 167,+ 124,+ 116,+ 81,+ 91,+ 255+ ]+ },+ {+ "name": "TradeEvent",+ "discriminator": [+ 189,+ 219,+ 127,+ 211,+ 78,+ 230,+ 97,+ 238+ ]+ },+ {+ "name": "UpdateGlobalAuthorityEvent",+ "discriminator": [+ 182,+ 195,+ 137,+ 42,+ 35,+ 206,+ 207,+ 247+ ]+ },+ {+ "name": "UpdateMayhemVirtualParamsEvent",+ "discriminator": [+ 117,+ 123,+ 228,+ 182,+ 161,+ 168,+ 220,+ 214+ ]+ }+ ],+ "errors": [+ {+ "code": 6000,+ "name": "NotAuthorized",+ "msg": "The given account is not authorized to execute this instruction."+ },+ {+ "code": 6001,+ "name": "AlreadyInitialized",+ "msg": "The program is already initialized."+ },+ {+ "code": 6002,+ "name": "TooMuchSolRequired",+ "msg": "slippage: Too much SOL required to buy the given amount of tokens."+ },+ {+ "code": 6003,+ "name": "TooLittleSolReceived",+ "msg": "slippage: Too little SOL received to sell the given amount of tokens."+ },+ {+ "code": 6004,+ "name": "MintDoesNotMatchBondingCurve",+ "msg": "The mint does not match the bonding curve."+ },+ {+ "code": 6005,+ "name": "BondingCurveComplete",+ "msg": "The bonding curve has completed and liquidity migrated to raydium."+ },+ {+ "code": 6006,+ "name": "BondingCurveNotComplete",+ "msg": "The bonding curve has not completed."+ },+ {+ "code": 6007,+ "name": "NotInitialized",+ "msg": "The program is not initialized."+ },+ {+ "code": 6008,+ "name": "WithdrawTooFrequent",+ "msg": "Withdraw too frequent"+ },+ {+ "code": 6009,+ "name": "NewSizeShouldBeGreaterThanCurrentSize",+ "msg": "new_size should be > current_size"+ },+ {+ "code": 6010,+ "name": "AccountTypeNotSupported",+ "msg": "Account type not supported"+ },+ {+ "code": 6011,+ "name": "InitialRealTokenReservesShouldBeLessThanTokenTotalSupply",+ "msg": "initial_real_token_reserves should be less than token_total_supply"+ },+ {+ "code": 6012,+ "name": "InitialVirtualTokenReservesShouldBeGreaterThanInitialRealTokenReserves",+ "msg": "initial_virtual_token_reserves should be greater than initial_real_token_reserves"+ },+ {+ "code": 6013,+ "name": "FeeBasisPointsGreaterThanMaximum",+ "msg": "fee_basis_points greater than maximum"+ },+ {+ "code": 6014,+ "name": "AllZerosWithdrawAuthority",+ "msg": "Withdraw authority cannot be set to System Program ID"+ },+ {+ "code": 6015,+ "name": "PoolMigrationFeeShouldBeLessThanFinalRealSolReserves",+ "msg": "pool_migration_fee should be less than final_real_sol_reserves"+ },+ {+ "code": 6016,+ "name": "PoolMigrationFeeShouldBeGreaterThanCreatorFeePlusMaxMigrateFees",+ "msg": "pool_migration_fee should be greater than creator_fee + MAX_MIGRATE_FEES"+ },+ {+ "code": 6017,+ "name": "DisabledWithdraw",+ "msg": "Migrate instruction is disabled"+ },+ {+ "code": 6018,+ "name": "DisabledMigrate",+ "msg": "Migrate instruction is disabled"+ },+ {+ "code": 6019,+ "name": "InvalidCreator",+ "msg": "Invalid creator pubkey"+ },+ {+ "code": 6020,+ "name": "BuyZeroAmount",+ "msg": "Buy zero amount"+ },+ {+ "code": 6021,+ "name": "NotEnoughTokensToBuy",+ "msg": "Not enough tokens to buy"+ },+ {+ "code": 6022,+ "name": "SellZeroAmount",+ "msg": "Sell zero amount"+ },+ {+ "code": 6023,+ "name": "NotEnoughTokensToSell",+ "msg": "Not enough tokens to sell"+ },+ {+ "code": 6024,+ "name": "Overflow",+ "msg": "Overflow"+ },+ {+ "code": 6025,+ "name": "Truncation",+ "msg": "Truncation"+ },+ {+ "code": 6026,+ "name": "DivisionByZero",+ "msg": "Division by zero"+ },+ {+ "code": 6027,+ "name": "NotEnoughRemainingAccounts",+ "msg": "Not enough remaining accounts"+ },+ {+ "code": 6028,+ "name": "AllFeeRecipientsShouldBeNonZero",+ "msg": "All fee recipients should be non-zero"+ },+ {+ "code": 6029,+ "name": "UnsortedNotUniqueFeeRecipients",+ "msg": "Unsorted or not unique fee recipients"+ },+ {+ "code": 6030,+ "name": "CreatorShouldNotBeZero",+ "msg": "Creator should not be zero"+ },+ {+ "code": 6031,+ "name": "StartTimeInThePast"+ },+ {+ "code": 6032,+ "name": "EndTimeInThePast"+ },+ {+ "code": 6033,+ "name": "EndTimeBeforeStartTime"+ },+ {+ "code": 6034,+ "name": "TimeRangeTooLarge"+ },+ {+ "code": 6035,+ "name": "EndTimeBeforeCurrentDay"+ },+ {+ "code": 6036,+ "name": "SupplyUpdateForFinishedRange"+ },+ {+ "code": 6037,+ "name": "DayIndexAfterEndIndex"+ },+ {+ "code": 6038,+ "name": "DayInActiveRange"+ },+ {+ "code": 6039,+ "name": "InvalidIncentiveMint"+ },+ {+ "code": 6040,+ "name": "BuyNotEnoughSolToCoverRent",+ "msg": "Buy: Not enough SOL to cover for rent exemption."+ },+ {+ "code": 6041,+ "name": "BuyNotEnoughSolToCoverFees",+ "msg": "Buy: Not enough SOL to cover for fees."+ },+ {+ "code": 6042,+ "name": "BuySlippageBelowMinTokensOut",+ "msg": "Slippage: Would buy less tokens than expected min_tokens_out"+ },+ {+ "code": 6043,+ "name": "NameTooLong"+ },+ {+ "code": 6044,+ "name": "SymbolTooLong"+ },+ {+ "code": 6045,+ "name": "UriTooLong"+ },+ {+ "code": 6046,+ "name": "CreateV2Disabled"+ },+ {+ "code": 6047,+ "name": "CpitializeMayhemFailed"+ },+ {+ "code": 6048,+ "name": "MayhemModeDisabled"+ },+ {+ "code": 6049,+ "name": "CreatorMigratedToSharingConfig",+ "msg": "creator has been migrated to sharing config, use pump_fees::reset_fee_sharing_config instead"+ },+ {+ "code": 6050,+ "name": "UnableToDistributeCreatorVaultMigratedToSharingConfig",+ "msg": "creator_vault has been migrated to sharing config, use pump:distribute_creator_fees instead"+ },+ {+ "code": 6051,+ "name": "SharingConfigNotActive",+ "msg": "Sharing config is not active"+ },+ {+ "code": 6052,+ "name": "UnableToDistributeCreatorFeesToExecutableRecipient",+ "msg": "The recipient account is executable, so it cannot receive lamports, remove it from the team first"+ },+ {+ "code": 6053,+ "name": "BondingCurveAndSharingConfigCreatorMismatch",+ "msg": "Bonding curve creator does not match sharing config"+ },+ {+ "code": 6054,+ "name": "ShareholdersAndRemainingAccountsMismatch",+ "msg": "Remaining accounts do not match shareholders, make sure to pass exactly the same pubkeys in the same order"+ },+ {+ "code": 6055,+ "name": "InvalidShareBps",+ "msg": "Share bps must be greater than 0"+ },+ {+ "code": 6056,+ "name": "CashbackNotEnabled",+ "msg": "Cashback is not enabled"+ }+ ],+ "types": [+ {+ "name": "AdminSetCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin_set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "old_creator",+ "type": "pubkey"+ },+ {+ "name": "new_creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "AdminSetIdlAuthorityEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "idl_authority",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "AdminUpdateTokenIncentivesEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "start_time",+ "type": "i64"+ },+ {+ "name": "end_time",+ "type": "i64"+ },+ {+ "name": "day_number",+ "type": "u64"+ },+ {+ "name": "token_supply_per_day",+ "type": "u64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "seconds_in_a_day",+ "type": "i64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "BondingCurve",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "real_token_reserves",+ "type": "u64"+ },+ {+ "name": "real_sol_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "complete",+ "type": "bool"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ },+ {+ "name": "is_cashback_coin",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "ClaimCashbackEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "amount",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "total_claimed",+ "type": "u64"+ },+ {+ "name": "total_cashback_earned",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "ClaimTokenIncentivesEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "amount",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "CloseUserVolumeAccumulatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "total_unclaimed_tokens",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ },+ {+ "name": "last_update_timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "CollectCreatorFeeEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "creator_fee",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "CompleteEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "CompletePumpAmmMigrationEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "mint_amount",+ "type": "u64"+ },+ {+ "name": "sol_amount",+ "type": "u64"+ },+ {+ "name": "pool_migration_fee",+ "type": "u64"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "pool",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "ConfigStatus",+ "type": {+ "kind": "enum",+ "variants": [+ {+ "name": "Paused"+ },+ {+ "name": "Active"+ }+ ]+ }+ },+ {+ "name": "CreateEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "name",+ "type": "string"+ },+ {+ "name": "symbol",+ "type": "string"+ },+ {+ "name": "uri",+ "type": "string"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "real_token_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "token_program",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ },+ {+ "name": "is_cashback_enabled",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "DistributeCreatorFeesEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ },+ {+ "name": "distributed",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "ExtendAccountEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "account",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "current_size",+ "type": "u64"+ },+ {+ "name": "new_size",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "FeeConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "flat_fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ },+ {+ "name": "fee_tiers",+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "FeeTier",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "market_cap_lamports_threshold",+ "type": "u128"+ },+ {+ "name": "fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ }+ ]+ }+ },+ {+ "name": "Fees",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "lp_fee_bps",+ "type": "u64"+ },+ {+ "name": "protocol_fee_bps",+ "type": "u64"+ },+ {+ "name": "creator_fee_bps",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "Global",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "initialized",+ "docs": [+ "Unused"+ ],+ "type": "bool"+ },+ {+ "name": "authority",+ "type": "pubkey"+ },+ {+ "name": "fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "initial_virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "initial_virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "initial_real_token_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "fee_basis_points",+ "type": "u64"+ },+ {+ "name": "withdraw_authority",+ "type": "pubkey"+ },+ {+ "name": "enable_migrate",+ "docs": [+ "Unused"+ ],+ "type": "bool"+ },+ {+ "name": "pool_migration_fee",+ "type": "u64"+ },+ {+ "name": "creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ },+ {+ "name": "set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "admin_set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "create_v2_enabled",+ "type": "bool"+ },+ {+ "name": "whitelist_pda",+ "type": "pubkey"+ },+ {+ "name": "reserved_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "mayhem_mode_enabled",+ "type": "bool"+ },+ {+ "name": "reserved_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ },+ {+ "name": "is_cashback_enabled",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "GlobalVolumeAccumulator",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "start_time",+ "type": "i64"+ },+ {+ "name": "end_time",+ "type": "i64"+ },+ {+ "name": "seconds_in_a_day",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "total_token_supply",+ "type": {+ "array": [+ "u64",+ 30+ ]+ }+ },+ {+ "name": "sol_volumes",+ "type": {+ "array": [+ "u64",+ 30+ ]+ }+ }+ ]+ }+ },+ {+ "name": "InitUserVolumeAccumulatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "payer",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "MigrateBondingCurveCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "old_creator",+ "type": "pubkey"+ },+ {+ "name": "new_creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "MinimumDistributableFeeEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "minimum_required",+ "type": "u64"+ },+ {+ "name": "distributable_fees",+ "type": "u64"+ },+ {+ "name": "can_distribute",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "OptionBool",+ "type": {+ "kind": "struct",+ "fields": [+ "bool"+ ]+ }+ },+ {+ "name": "ReservedFeeRecipientsEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "reserved_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "reserved_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ }+ ]+ }+ },+ {+ "name": "SetCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "SetMetaplexCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "metadata",+ "type": "pubkey"+ },+ {+ "name": "creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "SetParamsEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "initial_virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "initial_virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "initial_real_token_reserves",+ "type": "u64"+ },+ {+ "name": "final_real_sol_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "fee_basis_points",+ "type": "u64"+ },+ {+ "name": "withdraw_authority",+ "type": "pubkey"+ },+ {+ "name": "enable_migrate",+ "type": "bool"+ },+ {+ "name": "pool_migration_fee",+ "type": "u64"+ },+ {+ "name": "creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 8+ ]+ }+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "admin_set_creator_authority",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "Shareholder",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "address",+ "type": "pubkey"+ },+ {+ "name": "share_bps",+ "type": "u16"+ }+ ]+ }+ },+ {+ "name": "SharingConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "version",+ "type": "u8"+ },+ {+ "name": "status",+ "type": {+ "defined": {+ "name": "ConfigStatus"+ }+ }+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "admin_revoked",+ "type": "bool"+ },+ {+ "name": "shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "SyncUserVolumeAccumulatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "total_claimed_tokens_before",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens_after",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "TradeEvent",+ "docs": [+ "ix_name: \"buy\" | \"sell\" | \"buy_exact_sol_in\""+ ],+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "sol_amount",+ "type": "u64"+ },+ {+ "name": "token_amount",+ "type": "u64"+ },+ {+ "name": "is_buy",+ "type": "bool"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "real_sol_reserves",+ "type": "u64"+ },+ {+ "name": "real_token_reserves",+ "type": "u64"+ },+ {+ "name": "fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "fee_basis_points",+ "type": "u64"+ },+ {+ "name": "fee",+ "type": "u64"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "creator_fee",+ "type": "u64"+ },+ {+ "name": "track_volume",+ "type": "bool"+ },+ {+ "name": "total_unclaimed_tokens",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ },+ {+ "name": "last_update_timestamp",+ "type": "i64"+ },+ {+ "name": "ix_name",+ "type": "string"+ },+ {+ "name": "mayhem_mode",+ "type": "bool"+ },+ {+ "name": "cashback_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "cashback",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "UpdateGlobalAuthorityEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "global",+ "type": "pubkey"+ },+ {+ "name": "authority",+ "type": "pubkey"+ },+ {+ "name": "new_authority",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "UpdateMayhemVirtualParamsEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "new_virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "new_virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "real_token_reserves",+ "type": "u64"+ },+ {+ "name": "real_sol_reserves",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "UserVolumeAccumulator",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "needs_claim",+ "type": "bool"+ },+ {+ "name": "total_unclaimed_tokens",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ },+ {+ "name": "last_update_timestamp",+ "type": "i64"+ },+ {+ "name": "has_total_claimed_tokens",+ "type": "bool"+ },+ {+ "name": "cashback_earned",+ "type": "u64"+ },+ {+ "name": "total_cashback_claimed",+ "type": "u64"+ }+ ]+ }+ }+ ]+}\ No newline at end of filediff --git a/contracts/idl/pump/pump_amm.json b/contracts/idl/pump/pump_amm.jsonnew file mode 100644index 000000000..47d7b9534--- /dev/null+++ b/contracts/idl/pump/pump_amm.json@@ -0,0 +1,6268 @@+{+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA",+ "metadata": {+ "name": "pump_amm",+ "version": "0.1.0",+ "spec": "0.1.0",+ "description": "Created with Anchor"+ },+ "instructions": [+ {+ "name": "admin_set_coin_creator",+ "docs": [+ "Overrides the coin creator for a canonical pump pool"+ ],+ "discriminator": [+ 242,+ 40,+ 117,+ 145,+ 73,+ 96,+ 105,+ 104+ ],+ "accounts": [+ {+ "name": "admin_set_coin_creator_authority",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config"+ },+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "coin_creator",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "admin_update_token_incentives",+ "discriminator": [+ 209,+ 11,+ 115,+ 87,+ 213,+ 23,+ 124,+ 204+ ],+ "accounts": [+ {+ "name": "admin",+ "writable": true,+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ }+ ]+ }+ },+ {+ "name": "global_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "mint"+ },+ {+ "name": "global_incentive_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "global_volume_accumulator"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_program"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "start_time",+ "type": "i64"+ },+ {+ "name": "end_time",+ "type": "i64"+ },+ {+ "name": "seconds_in_a_day",+ "type": "i64"+ },+ {+ "name": "day_number",+ "type": "u64"+ },+ {+ "name": "token_supply_per_day",+ "type": "u64"+ }+ ]+ },+ {+ "name": "buy",+ "docs": [+ "For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0].",+ "If provided and valid, the ATA will be initialized if needed."+ ],+ "discriminator": [+ 102,+ 6,+ 61,+ 18,+ 1,+ 218,+ 235,+ 234+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "global_config"+ },+ {+ "name": "base_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "quote_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "user_base_token_account",+ "writable": true+ },+ {+ "name": "user_quote_token_account",+ "writable": true+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "protocol_fee_recipient"+ },+ {+ "name": "protocol_fee_recipient_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "protocol_fee_recipient"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "base_token_program"+ },+ {+ "name": "quote_token_program"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "coin_creator_vault_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "coin_creator_vault_authority"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "coin_creator_vault_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 95,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "pool.coin_creator",+ "account": "Pool"+ }+ ]+ }+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "const",+ "value": [+ 12,+ 20,+ 222,+ 252,+ 130,+ 94,+ 198,+ 118,+ 148,+ 37,+ 8,+ 24,+ 187,+ 101,+ 64,+ 101,+ 244,+ 41,+ 141,+ 49,+ 86,+ 213,+ 113,+ 180,+ 212,+ 248,+ 9,+ 12,+ 24,+ 233,+ 168,+ 99+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "fee_program"+ }+ }+ },+ {+ "name": "fee_program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ }+ ],+ "args": [+ {+ "name": "base_amount_out",+ "type": "u64"+ },+ {+ "name": "max_quote_amount_in",+ "type": "u64"+ },+ {+ "name": "track_volume",+ "type": {+ "defined": {+ "name": "OptionBool"+ }+ }+ }+ ]+ },+ {+ "name": "buy_exact_quote_in",+ "docs": [+ "Given a budget of spendable_quote_in, buy at least min_base_amount_out",+ "Fees will be deducted from spendable_quote_in",+ "",+ "f(quote) = tokens, where tokens >= min_base_amount_out",+ "",+ "Make sure the payer has enough SOL to cover creation of the following accounts (unless already created):",+ "- protocol_fee_recipient_token_account: rent.minimum_balance(TokenAccount::LEN)",+ "- coin_creator_vault_ata: rent.minimum_balance(TokenAccount::LEN)",+ "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)",+ "",+ "For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0].",+ "If provided and valid, the ATA will be initialized if needed."+ ],+ "discriminator": [+ 198,+ 46,+ 21,+ 82,+ 180,+ 217,+ 232,+ 112+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "global_config"+ },+ {+ "name": "base_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "quote_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "user_base_token_account",+ "writable": true+ },+ {+ "name": "user_quote_token_account",+ "writable": true+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "protocol_fee_recipient"+ },+ {+ "name": "protocol_fee_recipient_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "protocol_fee_recipient"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "base_token_program"+ },+ {+ "name": "quote_token_program"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "coin_creator_vault_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "coin_creator_vault_authority"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "coin_creator_vault_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 95,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "pool.coin_creator",+ "account": "Pool"+ }+ ]+ }+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "const",+ "value": [+ 12,+ 20,+ 222,+ 252,+ 130,+ 94,+ 198,+ 118,+ 148,+ 37,+ 8,+ 24,+ 187,+ 101,+ 64,+ 101,+ 244,+ 41,+ 141,+ 49,+ 86,+ 213,+ 113,+ 180,+ 212,+ 248,+ 9,+ 12,+ 24,+ 233,+ 168,+ 99+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "fee_program"+ }+ }+ },+ {+ "name": "fee_program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ }+ ],+ "args": [+ {+ "name": "spendable_quote_in",+ "type": "u64"+ },+ {+ "name": "min_base_amount_out",+ "type": "u64"+ },+ {+ "name": "track_volume",+ "type": {+ "defined": {+ "name": "OptionBool"+ }+ }+ }+ ]+ },+ {+ "name": "claim_cashback",+ "discriminator": [+ 37,+ 58,+ 35,+ 126,+ 190,+ 53,+ 228,+ 197+ ],+ "accounts": [+ {+ "name": "user",+ "writable": true+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "quote_mint"+ },+ {+ "name": "quote_token_program"+ },+ {+ "name": "user_volume_accumulator_wsol_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "user_volume_accumulator"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "user_wsol_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "user"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ }+ ],+ "args": []+ },+ {+ "name": "claim_token_incentives",+ "discriminator": [+ 16,+ 4,+ 71,+ 28,+ 204,+ 1,+ 40,+ 27+ ],+ "accounts": [+ {+ "name": "user"+ },+ {+ "name": "user_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "user"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "global_incentive_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "global_volume_accumulator"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "mint",+ "relations": [+ "global_volume_accumulator"+ ]+ },+ {+ "name": "token_program"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "payer",+ "writable": true,+ "signer": true+ }+ ],+ "args": []+ },+ {+ "name": "close_user_volume_accumulator",+ "discriminator": [+ 249,+ 69,+ 164,+ 218,+ 150,+ 103,+ 84,+ 138+ ],+ "accounts": [+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "collect_coin_creator_fee",+ "discriminator": [+ 160,+ 57,+ 89,+ 42,+ 181,+ 139,+ 43,+ 66+ ],+ "accounts": [+ {+ "name": "quote_mint"+ },+ {+ "name": "quote_token_program"+ },+ {+ "name": "coin_creator"+ },+ {+ "name": "coin_creator_vault_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 95,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "coin_creator"+ }+ ]+ }+ },+ {+ "name": "coin_creator_vault_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "coin_creator_vault_authority"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "coin_creator_token_account",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "create_config",+ "discriminator": [+ 201,+ 207,+ 243,+ 114,+ 75,+ 111,+ 47,+ 189+ ],+ "accounts": [+ {+ "name": "admin",+ "writable": true,+ "signer": true,+ "address": "8LWu7QM2dGR1G8nKDHthckea57bkCzXyBTAKPJUBDHo8"+ },+ {+ "name": "global_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 8+ ]+ }+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "admin_set_coin_creator_authority",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "create_pool",+ "discriminator": [+ 233,+ 146,+ 209,+ 142,+ 207,+ 104,+ 64,+ 188+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 112,+ 111,+ 111,+ 108+ ]+ },+ {+ "kind": "arg",+ "path": "index"+ },+ {+ "kind": "account",+ "path": "creator"+ },+ {+ "kind": "account",+ "path": "base_mint"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ]+ }+ },+ {+ "name": "global_config"+ },+ {+ "name": "creator",+ "writable": true,+ "signer": true+ },+ {+ "name": "base_mint"+ },+ {+ "name": "quote_mint"+ },+ {+ "name": "lp_mint",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 112,+ 111,+ 111,+ 108,+ 95,+ 108,+ 112,+ 95,+ 109,+ 105,+ 110,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "pool"+ }+ ]+ }+ },+ {+ "name": "user_base_token_account",+ "writable": true+ },+ {+ "name": "user_quote_token_account",+ "writable": true+ },+ {+ "name": "user_pool_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "creator"+ },+ {+ "kind": "account",+ "path": "token_2022_program"+ },+ {+ "kind": "account",+ "path": "lp_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool"+ },+ {+ "kind": "account",+ "path": "base_token_program"+ },+ {+ "kind": "account",+ "path": "base_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "pool"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "token_2022_program",+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"+ },+ {+ "name": "base_token_program"+ },+ {+ "name": "quote_token_program"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "index",+ "type": "u16"+ },+ {+ "name": "base_amount_in",+ "type": "u64"+ },+ {+ "name": "quote_amount_in",+ "type": "u64"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ },+ {+ "name": "is_cashback_coin",+ "type": {+ "defined": {+ "name": "OptionBool"+ }+ }+ }+ ]+ },+ {+ "name": "deposit",+ "discriminator": [+ 242,+ 35,+ 198,+ 137,+ 82,+ 225,+ 242,+ 182+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "global_config"+ },+ {+ "name": "user",+ "signer": true+ },+ {+ "name": "base_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "quote_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "lp_mint",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "user_base_token_account",+ "writable": true+ },+ {+ "name": "user_quote_token_account",+ "writable": true+ },+ {+ "name": "user_pool_token_account",+ "writable": true+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "token_program",+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"+ },+ {+ "name": "token_2022_program",+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "lp_token_amount_out",+ "type": "u64"+ },+ {+ "name": "max_base_amount_in",+ "type": "u64"+ },+ {+ "name": "max_quote_amount_in",+ "type": "u64"+ }+ ]+ },+ {+ "name": "disable",+ "discriminator": [+ 185,+ 173,+ 187,+ 90,+ 216,+ 15,+ 238,+ 233+ ],+ "accounts": [+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "disable_create_pool",+ "type": "bool"+ },+ {+ "name": "disable_deposit",+ "type": "bool"+ },+ {+ "name": "disable_withdraw",+ "type": "bool"+ },+ {+ "name": "disable_buy",+ "type": "bool"+ },+ {+ "name": "disable_sell",+ "type": "bool"+ }+ ]+ },+ {+ "name": "extend_account",+ "discriminator": [+ 234,+ 102,+ 194,+ 203,+ 150,+ 72,+ 62,+ 229+ ],+ "accounts": [+ {+ "name": "account",+ "writable": true+ },+ {+ "name": "user",+ "signer": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "init_user_volume_accumulator",+ "discriminator": [+ 94,+ 6,+ 202,+ 115,+ 255,+ 96,+ 232,+ 183+ ],+ "accounts": [+ {+ "name": "payer",+ "writable": true,+ "signer": true+ },+ {+ "name": "user"+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "migrate_pool_coin_creator",+ "docs": [+ "Migrate Pool Coin Creator to Sharing Config"+ ],+ "discriminator": [+ 208,+ 8,+ 159,+ 4,+ 74,+ 175,+ 16,+ 58+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 112,+ 111,+ 111,+ 108+ ]+ },+ {+ "kind": "account",+ "path": "pool.index",+ "account": "Pool"+ },+ {+ "kind": "account",+ "path": "pool.creator",+ "account": "Pool"+ },+ {+ "kind": "account",+ "path": "pool.base_mint",+ "account": "Pool"+ },+ {+ "kind": "account",+ "path": "pool.quote_mint",+ "account": "Pool"+ }+ ]+ }+ },+ {+ "name": "sharing_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "pool.base_mint",+ "account": "Pool"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 53,+ 255,+ 169,+ 5,+ 90,+ 142,+ 86,+ 141,+ 168,+ 247,+ 188,+ 7,+ 86,+ 21,+ 39,+ 76,+ 241,+ 201,+ 44,+ 164,+ 31,+ 64,+ 0,+ 156,+ 81,+ 106,+ 164,+ 20,+ 194,+ 124,+ 112+ ]+ }+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "sell",+ "discriminator": [+ 51,+ 230,+ 133,+ 164,+ 1,+ 127,+ 131,+ 173+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "user",+ "writable": true,+ "signer": true+ },+ {+ "name": "global_config"+ },+ {+ "name": "base_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "quote_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "user_base_token_account",+ "writable": true+ },+ {+ "name": "user_quote_token_account",+ "writable": true+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "protocol_fee_recipient"+ },+ {+ "name": "protocol_fee_recipient_token_account",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "protocol_fee_recipient"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "base_token_program"+ },+ {+ "name": "quote_token_program"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "coin_creator_vault_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "coin_creator_vault_authority"+ },+ {+ "kind": "account",+ "path": "quote_token_program"+ },+ {+ "kind": "account",+ "path": "quote_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "coin_creator_vault_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 95,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "pool.coin_creator",+ "account": "Pool"+ }+ ]+ }+ },+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "const",+ "value": [+ 12,+ 20,+ 222,+ 252,+ 130,+ 94,+ 198,+ 118,+ 148,+ 37,+ 8,+ 24,+ 187,+ 101,+ 64,+ 101,+ 244,+ 41,+ 141,+ 49,+ 86,+ 213,+ 113,+ 180,+ 212,+ 248,+ 9,+ 12,+ 24,+ 233,+ 168,+ 99+ ]+ }+ ],+ "program": {+ "kind": "account",+ "path": "fee_program"+ }+ }+ },+ {+ "name": "fee_program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ }+ ],+ "args": [+ {+ "name": "base_amount_in",+ "type": "u64"+ },+ {+ "name": "min_quote_amount_out",+ "type": "u64"+ }+ ]+ },+ {+ "name": "set_coin_creator",+ "docs": [+ "Sets Pool::coin_creator from Metaplex metadata creator or BondingCurve::creator"+ ],+ "discriminator": [+ 210,+ 149,+ 128,+ 45,+ 188,+ 58,+ 78,+ 175+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "metadata",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 109,+ 101,+ 116,+ 97,+ 100,+ 97,+ 116,+ 97+ ]+ },+ {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ },+ {+ "kind": "account",+ "path": "pool.base_mint",+ "account": "Pool"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 11,+ 112,+ 101,+ 177,+ 227,+ 209,+ 124,+ 69,+ 56,+ 157,+ 82,+ 127,+ 107,+ 4,+ 195,+ 205,+ 88,+ 184,+ 108,+ 115,+ 26,+ 160,+ 253,+ 181,+ 73,+ 182,+ 209,+ 188,+ 3,+ 248,+ 41,+ 70+ ]+ }+ }+ },+ {+ "name": "bonding_curve",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "pool.base_mint",+ "account": "Pool"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "set_reserved_fee_recipients",+ "discriminator": [+ 111,+ 172,+ 162,+ 232,+ 114,+ 89,+ 213,+ 142+ ],+ "accounts": [+ {+ "name": "global_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ }+ ]+ }+ },+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "whitelist_pda",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "sync_user_volume_accumulator",+ "discriminator": [+ 86,+ 31,+ 192,+ 87,+ 163,+ 87,+ 79,+ 238+ ],+ "accounts": [+ {+ "name": "user"+ },+ {+ "name": "global_volume_accumulator",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ }+ ]+ }+ },+ {+ "name": "user_volume_accumulator",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 117,+ 115,+ 101,+ 114,+ 95,+ 118,+ 111,+ 108,+ 117,+ 109,+ 101,+ 95,+ 97,+ 99,+ 99,+ 117,+ 109,+ 117,+ 108,+ 97,+ 116,+ 111,+ 114+ ]+ },+ {+ "kind": "account",+ "path": "user"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "toggle_cashback_enabled",+ "discriminator": [+ 115,+ 103,+ 224,+ 255,+ 189,+ 89,+ 86,+ 195+ ],+ "accounts": [+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "enabled",+ "type": "bool"+ }+ ]+ },+ {+ "name": "toggle_mayhem_mode",+ "discriminator": [+ 1,+ 9,+ 111,+ 208,+ 100,+ 31,+ 255,+ 163+ ],+ "accounts": [+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "enabled",+ "type": "bool"+ }+ ]+ },+ {+ "name": "transfer_creator_fees_to_pump",+ "docs": [+ "Transfer creator fees to pump creator vault",+ "If coin creator fees are currently below rent.minimum_balance(TokenAccount::LEN)",+ "The transfer will be skipped"+ ],+ "discriminator": [+ 139,+ 52,+ 134,+ 85,+ 228,+ 229,+ 108,+ 241+ ],+ "accounts": [+ {+ "name": "wsol_mint",+ "docs": [+ "Pump Canonical Pool are quoted in wSOL"+ ]+ },+ {+ "name": "token_program"+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "coin_creator"+ },+ {+ "name": "coin_creator_vault_authority",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 95,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "coin_creator"+ }+ ]+ }+ },+ {+ "name": "coin_creator_vault_ata",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "account",+ "path": "coin_creator_vault_authority"+ },+ {+ "kind": "account",+ "path": "token_program"+ },+ {+ "kind": "account",+ "path": "wsol_mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 140,+ 151,+ 37,+ 143,+ 78,+ 36,+ 137,+ 241,+ 187,+ 61,+ 16,+ 41,+ 20,+ 142,+ 13,+ 131,+ 11,+ 90,+ 19,+ 153,+ 218,+ 255,+ 16,+ 132,+ 4,+ 142,+ 123,+ 216,+ 219,+ 233,+ 248,+ 89+ ]+ }+ }+ },+ {+ "name": "pump_creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "coin_creator"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "update_admin",+ "discriminator": [+ 161,+ 176,+ 40,+ 213,+ 60,+ 184,+ 179,+ 228+ ],+ "accounts": [+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config",+ "writable": true+ },+ {+ "name": "new_admin"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "update_fee_config",+ "discriminator": [+ 104,+ 184,+ 103,+ 242,+ 88,+ 151,+ 107,+ 20+ ],+ "accounts": [+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "global_config"+ ]+ },+ {+ "name": "global_config",+ "writable": true+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 8+ ]+ }+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "admin_set_coin_creator_authority",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "withdraw",+ "discriminator": [+ 183,+ 18,+ 70,+ 156,+ 148,+ 109,+ 161,+ 34+ ],+ "accounts": [+ {+ "name": "pool",+ "writable": true+ },+ {+ "name": "global_config"+ },+ {+ "name": "user",+ "signer": true+ },+ {+ "name": "base_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "quote_mint",+ "relations": [+ "pool"+ ]+ },+ {+ "name": "lp_mint",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "user_base_token_account",+ "writable": true+ },+ {+ "name": "user_quote_token_account",+ "writable": true+ },+ {+ "name": "user_pool_token_account",+ "writable": true+ },+ {+ "name": "pool_base_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "pool_quote_token_account",+ "writable": true,+ "relations": [+ "pool"+ ]+ },+ {+ "name": "token_program",+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"+ },+ {+ "name": "token_2022_program",+ "address": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "lp_token_amount_in",+ "type": "u64"+ },+ {+ "name": "min_base_amount_out",+ "type": "u64"+ },+ {+ "name": "min_quote_amount_out",+ "type": "u64"+ }+ ]+ }+ ],+ "accounts": [+ {+ "name": "BondingCurve",+ "discriminator": [+ 23,+ 183,+ 248,+ 55,+ 96,+ 216,+ 172,+ 96+ ]+ },+ {+ "name": "FeeConfig",+ "discriminator": [+ 143,+ 52,+ 146,+ 187,+ 219,+ 123,+ 76,+ 155+ ]+ },+ {+ "name": "GlobalConfig",+ "discriminator": [+ 149,+ 8,+ 156,+ 202,+ 160,+ 252,+ 176,+ 217+ ]+ },+ {+ "name": "GlobalVolumeAccumulator",+ "discriminator": [+ 202,+ 42,+ 246,+ 43,+ 142,+ 190,+ 30,+ 255+ ]+ },+ {+ "name": "Pool",+ "discriminator": [+ 241,+ 154,+ 109,+ 4,+ 17,+ 177,+ 109,+ 188+ ]+ },+ {+ "name": "SharingConfig",+ "discriminator": [+ 216,+ 74,+ 9,+ 0,+ 56,+ 140,+ 93,+ 75+ ]+ },+ {+ "name": "UserVolumeAccumulator",+ "discriminator": [+ 86,+ 255,+ 112,+ 14,+ 102,+ 53,+ 154,+ 250+ ]+ }+ ],+ "events": [+ {+ "name": "AdminSetCoinCreatorEvent",+ "discriminator": [+ 45,+ 220,+ 93,+ 24,+ 25,+ 97,+ 172,+ 104+ ]+ },+ {+ "name": "AdminUpdateTokenIncentivesEvent",+ "discriminator": [+ 147,+ 250,+ 108,+ 120,+ 247,+ 29,+ 67,+ 222+ ]+ },+ {+ "name": "BuyEvent",+ "discriminator": [+ 103,+ 244,+ 82,+ 31,+ 44,+ 245,+ 119,+ 119+ ]+ },+ {+ "name": "ClaimCashbackEvent",+ "discriminator": [+ 226,+ 214,+ 246,+ 33,+ 7,+ 242,+ 147,+ 229+ ]+ },+ {+ "name": "ClaimTokenIncentivesEvent",+ "discriminator": [+ 79,+ 172,+ 246,+ 49,+ 205,+ 91,+ 206,+ 232+ ]+ },+ {+ "name": "CloseUserVolumeAccumulatorEvent",+ "discriminator": [+ 146,+ 159,+ 189,+ 172,+ 146,+ 88,+ 56,+ 244+ ]+ },+ {+ "name": "CollectCoinCreatorFeeEvent",+ "discriminator": [+ 232,+ 245,+ 194,+ 238,+ 234,+ 218,+ 58,+ 89+ ]+ },+ {+ "name": "CreateConfigEvent",+ "discriminator": [+ 107,+ 52,+ 89,+ 129,+ 55,+ 226,+ 81,+ 22+ ]+ },+ {+ "name": "CreatePoolEvent",+ "discriminator": [+ 177,+ 49,+ 12,+ 210,+ 160,+ 118,+ 167,+ 116+ ]+ },+ {+ "name": "DepositEvent",+ "discriminator": [+ 120,+ 248,+ 61,+ 83,+ 31,+ 142,+ 107,+ 144+ ]+ },+ {+ "name": "DisableEvent",+ "discriminator": [+ 107,+ 253,+ 193,+ 76,+ 228,+ 202,+ 27,+ 104+ ]+ },+ {+ "name": "ExtendAccountEvent",+ "discriminator": [+ 97,+ 97,+ 215,+ 144,+ 93,+ 146,+ 22,+ 124+ ]+ },+ {+ "name": "InitUserVolumeAccumulatorEvent",+ "discriminator": [+ 134,+ 36,+ 13,+ 72,+ 232,+ 101,+ 130,+ 216+ ]+ },+ {+ "name": "MigratePoolCoinCreatorEvent",+ "discriminator": [+ 170,+ 221,+ 82,+ 199,+ 147,+ 165,+ 247,+ 46+ ]+ },+ {+ "name": "ReservedFeeRecipientsEvent",+ "discriminator": [+ 43,+ 188,+ 250,+ 18,+ 221,+ 75,+ 187,+ 95+ ]+ },+ {+ "name": "SellEvent",+ "discriminator": [+ 62,+ 47,+ 55,+ 10,+ 165,+ 3,+ 220,+ 42+ ]+ },+ {+ "name": "SetBondingCurveCoinCreatorEvent",+ "discriminator": [+ 242,+ 231,+ 235,+ 102,+ 65,+ 99,+ 189,+ 211+ ]+ },+ {+ "name": "SetMetaplexCoinCreatorEvent",+ "discriminator": [+ 150,+ 107,+ 199,+ 123,+ 124,+ 207,+ 102,+ 228+ ]+ },+ {+ "name": "SyncUserVolumeAccumulatorEvent",+ "discriminator": [+ 197,+ 122,+ 167,+ 124,+ 116,+ 81,+ 91,+ 255+ ]+ },+ {+ "name": "UpdateAdminEvent",+ "discriminator": [+ 225,+ 152,+ 171,+ 87,+ 246,+ 63,+ 66,+ 234+ ]+ },+ {+ "name": "UpdateFeeConfigEvent",+ "discriminator": [+ 90,+ 23,+ 65,+ 35,+ 62,+ 244,+ 188,+ 208+ ]+ },+ {+ "name": "WithdrawEvent",+ "discriminator": [+ 22,+ 9,+ 133,+ 26,+ 160,+ 44,+ 71,+ 192+ ]+ }+ ],+ "errors": [+ {+ "code": 6000,+ "name": "FeeBasisPointsExceedsMaximum"+ },+ {+ "code": 6001,+ "name": "ZeroBaseAmount"+ },+ {+ "code": 6002,+ "name": "ZeroQuoteAmount"+ },+ {+ "code": 6003,+ "name": "TooLittlePoolTokenLiquidity"+ },+ {+ "code": 6004,+ "name": "ExceededSlippage"+ },+ {+ "code": 6005,+ "name": "InvalidAdmin"+ },+ {+ "code": 6006,+ "name": "UnsupportedBaseMint"+ },+ {+ "code": 6007,+ "name": "UnsupportedQuoteMint"+ },+ {+ "code": 6008,+ "name": "InvalidBaseMint"+ },+ {+ "code": 6009,+ "name": "InvalidQuoteMint"+ },+ {+ "code": 6010,+ "name": "InvalidLpMint"+ },+ {+ "code": 6011,+ "name": "AllProtocolFeeRecipientsShouldBeNonZero"+ },+ {+ "code": 6012,+ "name": "UnsortedNotUniqueProtocolFeeRecipients"+ },+ {+ "code": 6013,+ "name": "InvalidProtocolFeeRecipient"+ },+ {+ "code": 6014,+ "name": "InvalidPoolBaseTokenAccount"+ },+ {+ "code": 6015,+ "name": "InvalidPoolQuoteTokenAccount"+ },+ {+ "code": 6016,+ "name": "BuyMoreBaseAmountThanPoolReserves"+ },+ {+ "code": 6017,+ "name": "DisabledCreatePool"+ },+ {+ "code": 6018,+ "name": "DisabledDeposit"+ },+ {+ "code": 6019,+ "name": "DisabledWithdraw"+ },+ {+ "code": 6020,+ "name": "DisabledBuy"+ },+ {+ "code": 6021,+ "name": "DisabledSell"+ },+ {+ "code": 6022,+ "name": "SameMint"+ },+ {+ "code": 6023,+ "name": "Overflow"+ },+ {+ "code": 6024,+ "name": "Truncation"+ },+ {+ "code": 6025,+ "name": "DivisionByZero"+ },+ {+ "code": 6026,+ "name": "NewSizeLessThanCurrentSize"+ },+ {+ "code": 6027,+ "name": "AccountTypeNotSupported"+ },+ {+ "code": 6028,+ "name": "OnlyCanonicalPumpPoolsCanHaveCoinCreator"+ },+ {+ "code": 6029,+ "name": "InvalidAdminSetCoinCreatorAuthority"+ },+ {+ "code": 6030,+ "name": "StartTimeInThePast"+ },+ {+ "code": 6031,+ "name": "EndTimeInThePast"+ },+ {+ "code": 6032,+ "name": "EndTimeBeforeStartTime"+ },+ {+ "code": 6033,+ "name": "TimeRangeTooLarge"+ },+ {+ "code": 6034,+ "name": "EndTimeBeforeCurrentDay"+ },+ {+ "code": 6035,+ "name": "SupplyUpdateForFinishedRange"+ },+ {+ "code": 6036,+ "name": "DayIndexAfterEndIndex"+ },+ {+ "code": 6037,+ "name": "DayInActiveRange"+ },+ {+ "code": 6038,+ "name": "InvalidIncentiveMint"+ },+ {+ "code": 6039,+ "name": "BuyNotEnoughQuoteTokensToCoverFees",+ "msg": "buy: Not enough quote tokens to cover for fees."+ },+ {+ "code": 6040,+ "name": "BuySlippageBelowMinBaseAmountOut",+ "msg": "buy: slippage - would buy less tokens than expected min_base_amount_out"+ },+ {+ "code": 6041,+ "name": "MayhemModeDisabled"+ },+ {+ "code": 6042,+ "name": "OnlyPumpPoolsMayhemMode"+ },+ {+ "code": 6043,+ "name": "MayhemModeInDesiredState"+ },+ {+ "code": 6044,+ "name": "NotEnoughRemainingAccounts"+ },+ {+ "code": 6045,+ "name": "InvalidSharingConfigBaseMint"+ },+ {+ "code": 6046,+ "name": "InvalidSharingConfigCoinCreator"+ },+ {+ "code": 6047,+ "name": "CoinCreatorMigratedToSharingConfig",+ "msg": "coin creator has been migrated to sharing config, use pump_fees::reset_fee_sharing_config instead"+ },+ {+ "code": 6048,+ "name": "CreatorVaultMigratedToSharingConfig",+ "msg": "creator_vault has been migrated to sharing config, use pump:distribute_creator_fees instead"+ },+ {+ "code": 6049,+ "name": "CashbackNotEnabled",+ "msg": "Cashback is disabled"+ },+ {+ "code": 6050,+ "name": "OnlyPumpPoolsCashback"+ },+ {+ "code": 6051,+ "name": "CashbackNotInDesiredState"+ },+ {+ "code": 6052,+ "name": "CashbackEarnedDoesNotMatchTokenInVault"+ }+ ],+ "types": [+ {+ "name": "AdminSetCoinCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin_set_coin_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "old_coin_creator",+ "type": "pubkey"+ },+ {+ "name": "new_coin_creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "AdminUpdateTokenIncentivesEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "start_time",+ "type": "i64"+ },+ {+ "name": "end_time",+ "type": "i64"+ },+ {+ "name": "day_number",+ "type": "u64"+ },+ {+ "name": "token_supply_per_day",+ "type": "u64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "seconds_in_a_day",+ "type": "i64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "BondingCurve",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "real_token_reserves",+ "type": "u64"+ },+ {+ "name": "real_sol_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "complete",+ "type": "bool"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ },+ {+ "name": "is_cashback_coin",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "BuyEvent",+ "docs": [+ "ix_name: \"buy\" | \"buy_exact_quote_in\""+ ],+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "base_amount_out",+ "type": "u64"+ },+ {+ "name": "max_quote_amount_in",+ "type": "u64"+ },+ {+ "name": "user_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "user_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "quote_amount_in",+ "type": "u64"+ },+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "lp_fee",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee",+ "type": "u64"+ },+ {+ "name": "quote_amount_in_with_lp_fee",+ "type": "u64"+ },+ {+ "name": "user_quote_amount_in",+ "type": "u64"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "user_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "protocol_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "protocol_fee_recipient_token_account",+ "type": "pubkey"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "coin_creator_fee",+ "type": "u64"+ },+ {+ "name": "track_volume",+ "type": "bool"+ },+ {+ "name": "total_unclaimed_tokens",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ },+ {+ "name": "last_update_timestamp",+ "type": "i64"+ },+ {+ "name": "min_base_amount_out",+ "type": "u64"+ },+ {+ "name": "ix_name",+ "type": "string"+ },+ {+ "name": "cashback_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "cashback",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "ClaimCashbackEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "amount",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "total_claimed",+ "type": "u64"+ },+ {+ "name": "total_cashback_earned",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "ClaimTokenIncentivesEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "amount",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "CloseUserVolumeAccumulatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "total_unclaimed_tokens",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ },+ {+ "name": "last_update_timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "CollectCoinCreatorFeeEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "coin_creator_fee",+ "type": "u64"+ },+ {+ "name": "coin_creator_vault_ata",+ "type": "pubkey"+ },+ {+ "name": "coin_creator_token_account",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "ConfigStatus",+ "type": {+ "kind": "enum",+ "variants": [+ {+ "name": "Paused"+ },+ {+ "name": "Active"+ }+ ]+ }+ },+ {+ "name": "CreateConfigEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 8+ ]+ }+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "admin_set_coin_creator_authority",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "CreatePoolEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "index",+ "type": "u16"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "quote_mint",+ "type": "pubkey"+ },+ {+ "name": "base_mint_decimals",+ "type": "u8"+ },+ {+ "name": "quote_mint_decimals",+ "type": "u8"+ },+ {+ "name": "base_amount_in",+ "type": "u64"+ },+ {+ "name": "quote_amount_in",+ "type": "u64"+ },+ {+ "name": "pool_base_amount",+ "type": "u64"+ },+ {+ "name": "pool_quote_amount",+ "type": "u64"+ },+ {+ "name": "minimum_liquidity",+ "type": "u64"+ },+ {+ "name": "initial_liquidity",+ "type": "u64"+ },+ {+ "name": "lp_token_amount_out",+ "type": "u64"+ },+ {+ "name": "pool_bump",+ "type": "u8"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "lp_mint",+ "type": "pubkey"+ },+ {+ "name": "user_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "DepositEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "lp_token_amount_out",+ "type": "u64"+ },+ {+ "name": "max_base_amount_in",+ "type": "u64"+ },+ {+ "name": "max_quote_amount_in",+ "type": "u64"+ },+ {+ "name": "user_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "user_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "base_amount_in",+ "type": "u64"+ },+ {+ "name": "quote_amount_in",+ "type": "u64"+ },+ {+ "name": "lp_mint_supply",+ "type": "u64"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "user_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_pool_token_account",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "DisableEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "disable_create_pool",+ "type": "bool"+ },+ {+ "name": "disable_deposit",+ "type": "bool"+ },+ {+ "name": "disable_withdraw",+ "type": "bool"+ },+ {+ "name": "disable_buy",+ "type": "bool"+ },+ {+ "name": "disable_sell",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "ExtendAccountEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "account",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "current_size",+ "type": "u64"+ },+ {+ "name": "new_size",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "FeeConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "flat_fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ },+ {+ "name": "fee_tiers",+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "FeeTier",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "market_cap_lamports_threshold",+ "type": "u128"+ },+ {+ "name": "fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ }+ ]+ }+ },+ {+ "name": "Fees",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "lp_fee_bps",+ "type": "u64"+ },+ {+ "name": "protocol_fee_bps",+ "type": "u64"+ },+ {+ "name": "creator_fee_bps",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "GlobalConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "admin",+ "docs": [+ "The admin pubkey"+ ],+ "type": "pubkey"+ },+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "disable_flags",+ "docs": [+ "Flags to disable certain functionality",+ "bit 0 - Disable create pool",+ "bit 1 - Disable deposit",+ "bit 2 - Disable withdraw",+ "bit 3 - Disable buy",+ "bit 4 - Disable sell"+ ],+ "type": "u8"+ },+ {+ "name": "protocol_fee_recipients",+ "docs": [+ "Addresses of the protocol fee recipients"+ ],+ "type": {+ "array": [+ "pubkey",+ 8+ ]+ }+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "admin_set_coin_creator_authority",+ "docs": [+ "The admin authority for setting coin creators"+ ],+ "type": "pubkey"+ },+ {+ "name": "whitelist_pda",+ "type": "pubkey"+ },+ {+ "name": "reserved_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "mayhem_mode_enabled",+ "type": "bool"+ },+ {+ "name": "reserved_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ },+ {+ "name": "is_cashback_enabled",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "GlobalVolumeAccumulator",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "start_time",+ "type": "i64"+ },+ {+ "name": "end_time",+ "type": "i64"+ },+ {+ "name": "seconds_in_a_day",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "total_token_supply",+ "type": {+ "array": [+ "u64",+ 30+ ]+ }+ },+ {+ "name": "sol_volumes",+ "type": {+ "array": [+ "u64",+ 30+ ]+ }+ }+ ]+ }+ },+ {+ "name": "InitUserVolumeAccumulatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "payer",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "MigratePoolCoinCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "old_coin_creator",+ "type": "pubkey"+ },+ {+ "name": "new_coin_creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "OptionBool",+ "type": {+ "kind": "struct",+ "fields": [+ "bool"+ ]+ }+ },+ {+ "name": "Pool",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "pool_bump",+ "type": "u8"+ },+ {+ "name": "index",+ "type": "u16"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "quote_mint",+ "type": "pubkey"+ },+ {+ "name": "lp_mint",+ "type": "pubkey"+ },+ {+ "name": "pool_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "pool_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "lp_supply",+ "docs": [+ "True circulating supply without burns and lock-ups"+ ],+ "type": "u64"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ },+ {+ "name": "is_cashback_coin",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "ReservedFeeRecipientsEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "reserved_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "reserved_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ }+ ]+ }+ },+ {+ "name": "SellEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "base_amount_in",+ "type": "u64"+ },+ {+ "name": "min_quote_amount_out",+ "type": "u64"+ },+ {+ "name": "user_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "user_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "quote_amount_out",+ "type": "u64"+ },+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "lp_fee",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee",+ "type": "u64"+ },+ {+ "name": "quote_amount_out_without_lp_fee",+ "type": "u64"+ },+ {+ "name": "user_quote_amount_out",+ "type": "u64"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "user_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "protocol_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "protocol_fee_recipient_token_account",+ "type": "pubkey"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "coin_creator_fee",+ "type": "u64"+ },+ {+ "name": "cashback_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "cashback",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "SetBondingCurveCoinCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "SetMetaplexCoinCreatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "metadata",+ "type": "pubkey"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "Shareholder",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "address",+ "type": "pubkey"+ },+ {+ "name": "share_bps",+ "type": "u16"+ }+ ]+ }+ },+ {+ "name": "SharingConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "version",+ "type": "u8"+ },+ {+ "name": "status",+ "type": {+ "defined": {+ "name": "ConfigStatus"+ }+ }+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "admin_revoked",+ "type": "bool"+ },+ {+ "name": "shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "SyncUserVolumeAccumulatorEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "total_claimed_tokens_before",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens_after",+ "type": "u64"+ },+ {+ "name": "timestamp",+ "type": "i64"+ }+ ]+ }+ },+ {+ "name": "UpdateAdminEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "new_admin",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "UpdateFeeConfigEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "lp_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "protocol_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 8+ ]+ }+ },+ {+ "name": "coin_creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "admin_set_coin_creator_authority",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "UserVolumeAccumulator",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "needs_claim",+ "type": "bool"+ },+ {+ "name": "total_unclaimed_tokens",+ "type": "u64"+ },+ {+ "name": "total_claimed_tokens",+ "type": "u64"+ },+ {+ "name": "current_sol_volume",+ "type": "u64"+ },+ {+ "name": "last_update_timestamp",+ "type": "i64"+ },+ {+ "name": "has_total_claimed_tokens",+ "type": "bool"+ },+ {+ "name": "cashback_earned",+ "type": "u64"+ },+ {+ "name": "total_cashback_claimed",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "WithdrawEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "lp_token_amount_in",+ "type": "u64"+ },+ {+ "name": "min_base_amount_out",+ "type": "u64"+ },+ {+ "name": "min_quote_amount_out",+ "type": "u64"+ },+ {+ "name": "user_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "user_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_base_token_reserves",+ "type": "u64"+ },+ {+ "name": "pool_quote_token_reserves",+ "type": "u64"+ },+ {+ "name": "base_amount_out",+ "type": "u64"+ },+ {+ "name": "quote_amount_out",+ "type": "u64"+ },+ {+ "name": "lp_mint_supply",+ "type": "u64"+ },+ {+ "name": "pool",+ "type": "pubkey"+ },+ {+ "name": "user",+ "type": "pubkey"+ },+ {+ "name": "user_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "user_pool_token_account",+ "type": "pubkey"+ }+ ]+ }+ }+ ]+}\ No newline at end of filediff --git a/contracts/idl/pump/pump_fees.json b/contracts/idl/pump/pump_fees.jsonnew file mode 100644index 000000000..66ed115a8--- /dev/null+++ b/contracts/idl/pump/pump_fees.json@@ -0,0 +1,3918 @@+{+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ",+ "metadata": {+ "name": "pump_fees",+ "version": "0.1.0",+ "spec": "0.1.0",+ "description": "Created with Anchor"+ },+ "instructions": [+ {+ "name": "claim_social_fee_pda",+ "discriminator": [+ 225,+ 21,+ 251,+ 133,+ 161,+ 30,+ 199,+ 226+ ],+ "accounts": [+ {+ "name": "recipient",+ "writable": true+ },+ {+ "name": "social_fee_pda",+ "writable": true+ },+ {+ "name": "fee_program_global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "social_claim_authority",+ "signer": true,+ "relations": [+ "fee_program_global"+ ]+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "user_id",+ "type": "string"+ },+ {+ "name": "platform",+ "type": "u8"+ }+ ],+ "returns": {+ "option": {+ "defined": {+ "name": "SocialFeePdaClaimed"+ }+ }+ }+ },+ {+ "name": "create_fee_sharing_config",+ "docs": [+ "Create Fee Sharing Config"+ ],+ "discriminator": [+ 195,+ 78,+ 86,+ 76,+ 111,+ 52,+ 251,+ 213+ ],+ "accounts": [+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ },+ {+ "name": "payer",+ "writable": true,+ "signer": true+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "mint"+ },+ {+ "name": "sharing_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "bonding_curve",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "pump_program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ },+ {+ "name": "pump_event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "pool",+ "writable": true,+ "optional": true+ },+ {+ "name": "pump_amm_program",+ "optional": true,+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "pump_amm_event_authority",+ "optional": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 20,+ 222,+ 252,+ 130,+ 94,+ 198,+ 118,+ 148,+ 37,+ 8,+ 24,+ 187,+ 101,+ 64,+ 101,+ 244,+ 41,+ 141,+ 49,+ 86,+ 213,+ 113,+ 180,+ 212,+ 248,+ 9,+ 12,+ 24,+ 233,+ 168,+ 99+ ]+ }+ }+ }+ ],+ "args": []+ },+ {+ "name": "create_social_fee_pda",+ "discriminator": [+ 144,+ 224,+ 59,+ 211,+ 78,+ 248,+ 202,+ 220+ ],+ "accounts": [+ {+ "name": "payer",+ "writable": true,+ "signer": true+ },+ {+ "name": "social_fee_pda",+ "writable": true+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "fee_program_global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "user_id",+ "type": "string"+ },+ {+ "name": "platform",+ "type": "u8"+ }+ ]+ },+ {+ "name": "get_fees",+ "docs": [+ "Get Fees"+ ],+ "discriminator": [+ 231,+ 37,+ 126,+ 85,+ 207,+ 91,+ 63,+ 52+ ],+ "accounts": [+ {+ "name": "fee_config",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "config_program_id"+ }+ ]+ }+ },+ {+ "name": "config_program_id"+ }+ ],+ "args": [+ {+ "name": "is_pump_pool",+ "type": "bool"+ },+ {+ "name": "market_cap_lamports",+ "type": "u128"+ },+ {+ "name": "trade_size_lamports",+ "type": "u64"+ }+ ],+ "returns": {+ "defined": {+ "name": "Fees"+ }+ }+ },+ {+ "name": "initialize_fee_config",+ "docs": [+ "Initialize FeeConfig admin"+ ],+ "discriminator": [+ 62,+ 162,+ 20,+ 133,+ 121,+ 65,+ 145,+ 27+ ],+ "accounts": [+ {+ "name": "admin",+ "writable": true,+ "signer": true,+ "address": "8LWu7QM2dGR1G8nKDHthckea57bkCzXyBTAKPJUBDHo8"+ },+ {+ "name": "fee_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "config_program_id"+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "config_program_id"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "initialize_fee_program_global",+ "discriminator": [+ 35,+ 215,+ 130,+ 84,+ 233,+ 56,+ 124,+ 167+ ],+ "accounts": [+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "pump_global"+ ]+ },+ {+ "name": "pump_global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "fee_program_global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "social_claim_authority",+ "type": "pubkey"+ },+ {+ "name": "disable_flags",+ "type": "u8"+ },+ {+ "name": "claim_rate_limit",+ "type": "u64"+ }+ ]+ },+ {+ "name": "reset_fee_sharing_config",+ "docs": [+ "Reset Fee Sharing Config, make sure to distribute all the fees before calling this"+ ],+ "discriminator": [+ 10,+ 2,+ 182,+ 95,+ 16,+ 127,+ 129,+ 186+ ],+ "accounts": [+ {+ "name": "authority",+ "signer": true+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "new_admin"+ },+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "sharing_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "revoke_fee_sharing_authority",+ "docs": [+ "Revoke Fee Sharing Authority"+ ],+ "discriminator": [+ 18,+ 233,+ 158,+ 39,+ 185,+ 207,+ 58,+ 104+ ],+ "accounts": [+ {+ "name": "authority",+ "signer": true+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "sharing_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "set_authority",+ "discriminator": [+ 133,+ 250,+ 37,+ 21,+ 110,+ 163,+ 26,+ 121+ ],+ "accounts": [+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "fee_program_global"+ ]+ },+ {+ "name": "fee_program_global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "new_authority",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "set_claim_rate_limit",+ "discriminator": [+ 185,+ 211,+ 159,+ 174,+ 212,+ 49,+ 88,+ 4+ ],+ "accounts": [+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "fee_program_global"+ ]+ },+ {+ "name": "fee_program_global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "claim_rate_limit",+ "type": "u64"+ }+ ]+ },+ {+ "name": "set_disable_flags",+ "discriminator": [+ 194,+ 217,+ 112,+ 35,+ 114,+ 222,+ 51,+ 190+ ],+ "accounts": [+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "fee_program_global"+ ]+ },+ {+ "name": "fee_program_global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "disable_flags",+ "type": "u8"+ }+ ]+ },+ {+ "name": "set_social_claim_authority",+ "discriminator": [+ 147,+ 54,+ 184,+ 154,+ 136,+ 237,+ 185,+ 153+ ],+ "accounts": [+ {+ "name": "authority",+ "writable": true,+ "signer": true,+ "relations": [+ "fee_program_global"+ ]+ },+ {+ "name": "fee_program_global",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 45,+ 112,+ 114,+ 111,+ 103,+ 114,+ 97,+ 109,+ 45,+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ]+ }+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "social_claim_authority",+ "type": "pubkey"+ }+ ]+ },+ {+ "name": "transfer_fee_sharing_authority",+ "docs": [+ "Transfer Fee Sharing Authority"+ ],+ "discriminator": [+ 202,+ 10,+ 75,+ 200,+ 164,+ 34,+ 210,+ 96+ ],+ "accounts": [+ {+ "name": "authority",+ "signer": true+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "sharing_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "new_admin"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "update_admin",+ "docs": [+ "Update admin (only callable by admin)"+ ],+ "discriminator": [+ 161,+ 176,+ 40,+ 213,+ 60,+ 184,+ 179,+ 228+ ],+ "accounts": [+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "fee_config"+ ]+ },+ {+ "name": "fee_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "config_program_id"+ }+ ]+ }+ },+ {+ "name": "new_admin"+ },+ {+ "name": "config_program_id"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": []+ },+ {+ "name": "update_fee_config",+ "docs": [+ "Set/Replace fee parameters entirely (only callable by admin)"+ ],+ "discriminator": [+ 104,+ 184,+ 103,+ 242,+ 88,+ 151,+ 107,+ 20+ ],+ "accounts": [+ {+ "name": "fee_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "config_program_id"+ }+ ]+ }+ },+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "fee_config"+ ]+ },+ {+ "name": "config_program_id"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "fee_tiers",+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ },+ {+ "name": "flat_fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ }+ ]+ },+ {+ "name": "update_fee_shares",+ "docs": [+ "Update Fee Shares, make sure to distribute all the fees before calling this"+ ],+ "discriminator": [+ 189,+ 13,+ 136,+ 99,+ 187,+ 164,+ 237,+ 35+ ],+ "accounts": [+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program",+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"+ },+ {+ "name": "authority",+ "signer": true+ },+ {+ "name": "global",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 103,+ 108,+ 111,+ 98,+ 97,+ 108+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "mint",+ "relations": [+ "sharing_config"+ ]+ },+ {+ "name": "sharing_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 115,+ 104,+ 97,+ 114,+ 105,+ 110,+ 103,+ 45,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ]+ }+ },+ {+ "name": "bonding_curve",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 98,+ 111,+ 110,+ 100,+ 105,+ 110,+ 103,+ 45,+ 99,+ 117,+ 114,+ 118,+ 101+ ]+ },+ {+ "kind": "account",+ "path": "mint"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "pump_creator_vault",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 45,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "sharing_config"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "system_program",+ "address": "11111111111111111111111111111111"+ },+ {+ "name": "pump_program",+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"+ },+ {+ "name": "pump_event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 1,+ 86,+ 224,+ 246,+ 147,+ 102,+ 90,+ 207,+ 68,+ 219,+ 21,+ 104,+ 191,+ 23,+ 91,+ 170,+ 81,+ 137,+ 203,+ 151,+ 245,+ 210,+ 255,+ 59,+ 101,+ 93,+ 43,+ 182,+ 253,+ 109,+ 24,+ 176+ ]+ }+ }+ },+ {+ "name": "pump_amm_program",+ "address": "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"+ },+ {+ "name": "amm_event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 20,+ 222,+ 252,+ 130,+ 94,+ 198,+ 118,+ 148,+ 37,+ 8,+ 24,+ 187,+ 101,+ 64,+ 101,+ 244,+ 41,+ 141,+ 49,+ 86,+ 213,+ 113,+ 180,+ 212,+ 248,+ 9,+ 12,+ 24,+ 233,+ 168,+ 99+ ]+ }+ }+ },+ {+ "name": "wsol_mint",+ "address": "So11111111111111111111111111111111111111112"+ },+ {+ "name": "token_program",+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"+ },+ {+ "name": "associated_token_program",+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"+ },+ {+ "name": "coin_creator_vault_authority",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 99,+ 114,+ 101,+ 97,+ 116,+ 111,+ 114,+ 95,+ 118,+ 97,+ 117,+ 108,+ 116+ ]+ },+ {+ "kind": "account",+ "path": "sharing_config"+ }+ ],+ "program": {+ "kind": "const",+ "value": [+ 12,+ 20,+ 222,+ 252,+ 130,+ 94,+ 198,+ 118,+ 148,+ 37,+ 8,+ 24,+ 187,+ 101,+ 64,+ 101,+ 244,+ 41,+ 141,+ 49,+ 86,+ 213,+ 113,+ 180,+ 212,+ 248,+ 9,+ 12,+ 24,+ 233,+ 168,+ 99+ ]+ }+ }+ },+ {+ "name": "coin_creator_vault_ata",+ "writable": true+ }+ ],+ "args": [+ {+ "name": "shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ }+ ]+ },+ {+ "name": "upsert_fee_tiers",+ "docs": [+ "Update or expand fee tiers (only callable by admin)"+ ],+ "discriminator": [+ 227,+ 23,+ 150,+ 12,+ 77,+ 86,+ 94,+ 4+ ],+ "accounts": [+ {+ "name": "fee_config",+ "writable": true,+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 102,+ 101,+ 101,+ 95,+ 99,+ 111,+ 110,+ 102,+ 105,+ 103+ ]+ },+ {+ "kind": "account",+ "path": "config_program_id"+ }+ ]+ }+ },+ {+ "name": "admin",+ "signer": true,+ "relations": [+ "fee_config"+ ]+ },+ {+ "name": "config_program_id"+ },+ {+ "name": "event_authority",+ "pda": {+ "seeds": [+ {+ "kind": "const",+ "value": [+ 95,+ 95,+ 101,+ 118,+ 101,+ 110,+ 116,+ 95,+ 97,+ 117,+ 116,+ 104,+ 111,+ 114,+ 105,+ 116,+ 121+ ]+ }+ ]+ }+ },+ {+ "name": "program"+ }+ ],+ "args": [+ {+ "name": "fee_tiers",+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ },+ {+ "name": "offset",+ "type": "u8"+ }+ ]+ }+ ],+ "accounts": [+ {+ "name": "BondingCurve",+ "discriminator": [+ 23,+ 183,+ 248,+ 55,+ 96,+ 216,+ 172,+ 96+ ]+ },+ {+ "name": "FeeConfig",+ "discriminator": [+ 143,+ 52,+ 146,+ 187,+ 219,+ 123,+ 76,+ 155+ ]+ },+ {+ "name": "FeeProgramGlobal",+ "discriminator": [+ 162,+ 165,+ 245,+ 49,+ 29,+ 37,+ 55,+ 242+ ]+ },+ {+ "name": "Global",+ "discriminator": [+ 167,+ 232,+ 232,+ 177,+ 200,+ 108,+ 114,+ 127+ ]+ },+ {+ "name": "Pool",+ "discriminator": [+ 241,+ 154,+ 109,+ 4,+ 17,+ 177,+ 109,+ 188+ ]+ },+ {+ "name": "SharingConfig",+ "discriminator": [+ 216,+ 74,+ 9,+ 0,+ 56,+ 140,+ 93,+ 75+ ]+ },+ {+ "name": "SocialFeePda",+ "discriminator": [+ 139,+ 96,+ 53,+ 17,+ 42,+ 169,+ 206,+ 150+ ]+ }+ ],+ "events": [+ {+ "name": "CreateFeeSharingConfigEvent",+ "discriminator": [+ 133,+ 105,+ 170,+ 200,+ 184,+ 116,+ 251,+ 88+ ]+ },+ {+ "name": "InitializeFeeConfigEvent",+ "discriminator": [+ 89,+ 138,+ 244,+ 230,+ 10,+ 56,+ 226,+ 126+ ]+ },+ {+ "name": "InitializeFeeProgramGlobalEvent",+ "discriminator": [+ 40,+ 233,+ 156,+ 78,+ 95,+ 0,+ 8,+ 199+ ]+ },+ {+ "name": "ResetFeeSharingConfigEvent",+ "discriminator": [+ 203,+ 204,+ 151,+ 226,+ 120,+ 55,+ 214,+ 243+ ]+ },+ {+ "name": "RevokeFeeSharingAuthorityEvent",+ "discriminator": [+ 114,+ 23,+ 101,+ 60,+ 14,+ 190,+ 153,+ 62+ ]+ },+ {+ "name": "SetAuthorityEvent",+ "discriminator": [+ 18,+ 175,+ 132,+ 66,+ 208,+ 201,+ 87,+ 242+ ]+ },+ {+ "name": "SetClaimRateLimitEvent",+ "discriminator": [+ 13,+ 143,+ 143,+ 235,+ 181,+ 19,+ 51,+ 40+ ]+ },+ {+ "name": "SetDisableFlagsEvent",+ "discriminator": [+ 5,+ 8,+ 179,+ 65,+ 49,+ 55,+ 145,+ 126+ ]+ },+ {+ "name": "SetSocialClaimAuthorityEvent",+ "discriminator": [+ 60,+ 118,+ 127,+ 132,+ 239,+ 52,+ 254,+ 14+ ]+ },+ {+ "name": "SocialFeePdaClaimed",+ "discriminator": [+ 50,+ 18,+ 193,+ 65,+ 237,+ 210,+ 234,+ 236+ ]+ },+ {+ "name": "SocialFeePdaCreated",+ "discriminator": [+ 183,+ 183,+ 218,+ 147,+ 24,+ 124,+ 137,+ 169+ ]+ },+ {+ "name": "TransferFeeSharingAuthorityEvent",+ "discriminator": [+ 124,+ 143,+ 198,+ 245,+ 77,+ 184,+ 8,+ 236+ ]+ },+ {+ "name": "UpdateAdminEvent",+ "discriminator": [+ 225,+ 152,+ 171,+ 87,+ 246,+ 63,+ 66,+ 234+ ]+ },+ {+ "name": "UpdateFeeConfigEvent",+ "discriminator": [+ 90,+ 23,+ 65,+ 35,+ 62,+ 244,+ 188,+ 208+ ]+ },+ {+ "name": "UpdateFeeSharesEvent",+ "discriminator": [+ 21,+ 186,+ 196,+ 184,+ 91,+ 228,+ 225,+ 203+ ]+ },+ {+ "name": "UpsertFeeTiersEvent",+ "discriminator": [+ 171,+ 89,+ 169,+ 187,+ 122,+ 186,+ 33,+ 204+ ]+ }+ ],+ "errors": [+ {+ "code": 6000,+ "name": "UnauthorizedProgram",+ "msg": "Only Pump and PumpSwap programs can call this instruction"+ },+ {+ "code": 6001,+ "name": "InvalidAdmin",+ "msg": "Invalid admin"+ },+ {+ "code": 6002,+ "name": "NoFeeTiers",+ "msg": "No fee tiers provided"+ },+ {+ "code": 6003,+ "name": "TooManyFeeTiers",+ "msg": "format"+ },+ {+ "code": 6004,+ "name": "OffsetNotContinuous",+ "msg": "The offset should be <= fee_config.fee_tiers.len()"+ },+ {+ "code": 6005,+ "name": "FeeTiersNotSorted",+ "msg": "Fee tiers must be sorted by market cap threshold (ascending)"+ },+ {+ "code": 6006,+ "name": "InvalidFeeTotal",+ "msg": "Fee total must not exceed 10_000bps"+ },+ {+ "code": 6007,+ "name": "InvalidSharingConfig",+ "msg": "Invalid Sharing Config"+ },+ {+ "code": 6008,+ "name": "InvalidPool",+ "msg": "Invalid Pool"+ },+ {+ "code": 6009,+ "name": "SharingConfigAdminRevoked",+ "msg": "Sharing config admin has been revoked"+ },+ {+ "code": 6010,+ "name": "NoShareholders",+ "msg": "No shareholders provided"+ },+ {+ "code": 6011,+ "name": "TooManyShareholders",+ "msg": "format"+ },+ {+ "code": 6012,+ "name": "DuplicateShareholder",+ "msg": "Duplicate shareholder address"+ },+ {+ "code": 6013,+ "name": "NotEnoughRemainingAccounts",+ "msg": "Not enough remaining accounts"+ },+ {+ "code": 6014,+ "name": "InvalidShareTotal",+ "msg": "Invalid share total - must equal 10_000 basis points"+ },+ {+ "code": 6015,+ "name": "ShareCalculationOverflow",+ "msg": "Share calculation overflow"+ },+ {+ "code": 6016,+ "name": "NotAuthorized",+ "msg": "The given account is not authorized to execute this instruction."+ },+ {+ "code": 6017,+ "name": "ZeroShareNotAllowed",+ "msg": "Shareholder cannot have zero share"+ },+ {+ "code": 6018,+ "name": "SharingConfigNotActive",+ "msg": "Fee sharing config is not active"+ },+ {+ "code": 6019,+ "name": "AmmAccountsRequiredForGraduatedCoin",+ "msg": "AMM accounts are required for graduated coins"+ },+ {+ "code": 6020,+ "name": "ShareholderAccountMismatch",+ "msg": "Remaining account key doesn't match shareholder address"+ },+ {+ "code": 6021,+ "name": "FeatureDeactivated",+ "msg": "Feature is currently deactivated"+ },+ {+ "code": 6022,+ "name": "UserIdTooLong",+ "msg": "User ID exceeds maximum length"+ }+ ],+ "types": [+ {+ "name": "BondingCurve",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "real_token_reserves",+ "type": "u64"+ },+ {+ "name": "real_sol_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "complete",+ "type": "bool"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "ConfigStatus",+ "type": {+ "kind": "enum",+ "variants": [+ {+ "name": "Paused"+ },+ {+ "name": "Active"+ }+ ]+ }+ },+ {+ "name": "CreateFeeSharingConfigEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "bonding_curve",+ "type": "pubkey"+ },+ {+ "name": "pool",+ "type": {+ "option": "pubkey"+ }+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "initial_shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ },+ {+ "name": "status",+ "type": {+ "defined": {+ "name": "ConfigStatus"+ }+ }+ }+ ]+ }+ },+ {+ "name": "FeeConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "docs": [+ "The bump for the PDA"+ ],+ "type": "u8"+ },+ {+ "name": "admin",+ "docs": [+ "The admin account that can update the fee config"+ ],+ "type": "pubkey"+ },+ {+ "name": "flat_fees",+ "docs": [+ "The flat fees for non-pump pools"+ ],+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ },+ {+ "name": "fee_tiers",+ "docs": [+ "The fee tiers"+ ],+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "FeeProgramGlobal",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "authority",+ "type": "pubkey"+ },+ {+ "name": "disable_flags",+ "type": "u8"+ },+ {+ "name": "social_claim_authority",+ "type": "pubkey"+ },+ {+ "name": "claim_rate_limit",+ "type": "u64"+ },+ {+ "name": "_reserved",+ "type": {+ "array": [+ "u8",+ 256+ ]+ }+ }+ ]+ }+ },+ {+ "name": "FeeTier",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "market_cap_lamports_threshold",+ "type": "u128"+ },+ {+ "name": "fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ }+ ]+ }+ },+ {+ "name": "Fees",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "lp_fee_bps",+ "type": "u64"+ },+ {+ "name": "protocol_fee_bps",+ "type": "u64"+ },+ {+ "name": "creator_fee_bps",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "Global",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "initialized",+ "type": "bool"+ },+ {+ "name": "authority",+ "type": "pubkey"+ },+ {+ "name": "fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "initial_virtual_token_reserves",+ "type": "u64"+ },+ {+ "name": "initial_virtual_sol_reserves",+ "type": "u64"+ },+ {+ "name": "initial_real_token_reserves",+ "type": "u64"+ },+ {+ "name": "token_total_supply",+ "type": "u64"+ },+ {+ "name": "fee_basis_points",+ "type": "u64"+ },+ {+ "name": "withdraw_authority",+ "type": "pubkey"+ },+ {+ "name": "enable_migrate",+ "type": "bool"+ },+ {+ "name": "pool_migration_fee",+ "type": "u64"+ },+ {+ "name": "creator_fee_basis_points",+ "type": "u64"+ },+ {+ "name": "fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ },+ {+ "name": "set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "admin_set_creator_authority",+ "type": "pubkey"+ },+ {+ "name": "create_v2_enabled",+ "type": "bool"+ },+ {+ "name": "whitelist_pda",+ "type": "pubkey"+ },+ {+ "name": "reserved_fee_recipient",+ "type": "pubkey"+ },+ {+ "name": "mayhem_mode_enabled",+ "type": "bool"+ },+ {+ "name": "reserved_fee_recipients",+ "type": {+ "array": [+ "pubkey",+ 7+ ]+ }+ }+ ]+ }+ },+ {+ "name": "InitializeFeeConfigEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "fee_config",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "InitializeFeeProgramGlobalEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "authority",+ "type": "pubkey"+ },+ {+ "name": "social_claim_authority",+ "type": "pubkey"+ },+ {+ "name": "disable_flags",+ "type": "u8"+ },+ {+ "name": "claim_rate_limit",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "Pool",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "pool_bump",+ "type": "u8"+ },+ {+ "name": "index",+ "type": "u16"+ },+ {+ "name": "creator",+ "type": "pubkey"+ },+ {+ "name": "base_mint",+ "type": "pubkey"+ },+ {+ "name": "quote_mint",+ "type": "pubkey"+ },+ {+ "name": "lp_mint",+ "type": "pubkey"+ },+ {+ "name": "pool_base_token_account",+ "type": "pubkey"+ },+ {+ "name": "pool_quote_token_account",+ "type": "pubkey"+ },+ {+ "name": "lp_supply",+ "type": "u64"+ },+ {+ "name": "coin_creator",+ "type": "pubkey"+ },+ {+ "name": "is_mayhem_mode",+ "type": "bool"+ }+ ]+ }+ },+ {+ "name": "ResetFeeSharingConfigEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "old_admin",+ "type": "pubkey"+ },+ {+ "name": "old_shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ },+ {+ "name": "new_admin",+ "type": "pubkey"+ },+ {+ "name": "new_shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "RevokeFeeSharingAuthorityEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "SetAuthorityEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "old_authority",+ "type": "pubkey"+ },+ {+ "name": "new_authority",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "SetClaimRateLimitEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "claim_rate_limit",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "SetDisableFlagsEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "disable_flags",+ "type": "u8"+ }+ ]+ }+ },+ {+ "name": "SetSocialClaimAuthorityEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "social_claim_authority",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "Shareholder",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "address",+ "type": "pubkey"+ },+ {+ "name": "share_bps",+ "type": "u16"+ }+ ]+ }+ },+ {+ "name": "SharingConfig",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "version",+ "type": "u8"+ },+ {+ "name": "status",+ "type": {+ "defined": {+ "name": "ConfigStatus"+ }+ }+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "admin_revoked",+ "type": "bool"+ },+ {+ "name": "shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "SocialFeePda",+ "docs": [+ "Platform identifier: 0=pump, 1=twitter, etc."+ ],+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "bump",+ "type": "u8"+ },+ {+ "name": "version",+ "type": "u8"+ },+ {+ "name": "user_id",+ "docs": [+ "Max 20 characters to fit u64::MAX (18,446,744,073,709,551,615) as a string.",+ "Actual storage: 4 bytes (length prefix) + 20 bytes (content) = 24 bytes."+ ],+ "type": "string"+ },+ {+ "name": "platform",+ "type": "u8"+ },+ {+ "name": "total_claimed",+ "type": "u64"+ },+ {+ "name": "last_claimed",+ "type": "u64"+ },+ {+ "name": "_reserved",+ "type": {+ "array": [+ "u8",+ 128+ ]+ }+ }+ ]+ }+ },+ {+ "name": "SocialFeePdaClaimed",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "user_id",+ "type": "string"+ },+ {+ "name": "platform",+ "type": "u8"+ },+ {+ "name": "social_fee_pda",+ "type": "pubkey"+ },+ {+ "name": "recipient",+ "type": "pubkey"+ },+ {+ "name": "social_claim_authority",+ "type": "pubkey"+ },+ {+ "name": "amount_claimed",+ "type": "u64"+ },+ {+ "name": "claimable_before",+ "type": "u64"+ },+ {+ "name": "lifetime_claimed",+ "type": "u64"+ },+ {+ "name": "recipient_balance_before",+ "type": "u64"+ },+ {+ "name": "recipient_balance_after",+ "type": "u64"+ }+ ]+ }+ },+ {+ "name": "SocialFeePdaCreated",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "user_id",+ "type": "string"+ },+ {+ "name": "platform",+ "type": "u8"+ },+ {+ "name": "social_fee_pda",+ "type": "pubkey"+ },+ {+ "name": "created_by",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "TransferFeeSharingAuthorityEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "old_admin",+ "type": "pubkey"+ },+ {+ "name": "new_admin",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "UpdateAdminEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "old_admin",+ "type": "pubkey"+ },+ {+ "name": "new_admin",+ "type": "pubkey"+ }+ ]+ }+ },+ {+ "name": "UpdateFeeConfigEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "fee_config",+ "type": "pubkey"+ },+ {+ "name": "fee_tiers",+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ },+ {+ "name": "flat_fees",+ "type": {+ "defined": {+ "name": "Fees"+ }+ }+ }+ ]+ }+ },+ {+ "name": "UpdateFeeSharesEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "mint",+ "type": "pubkey"+ },+ {+ "name": "sharing_config",+ "type": "pubkey"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "new_shareholders",+ "type": {+ "vec": {+ "defined": {+ "name": "Shareholder"+ }+ }+ }+ }+ ]+ }+ },+ {+ "name": "UpsertFeeTiersEvent",+ "type": {+ "kind": "struct",+ "fields": [+ {+ "name": "timestamp",+ "type": "i64"+ },+ {+ "name": "admin",+ "type": "pubkey"+ },+ {+ "name": "fee_config",+ "type": "pubkey"+ },+ {+ "name": "fee_tiers",+ "type": {+ "vec": {+ "defined": {+ "name": "FeeTier"+ }+ }+ }+ },+ {+ "name": "offset",+ "type": "u8"+ }+ ]+ }+ }+ ],+ "constants": [+ {+ "name": "FEE_CONFIG_SEED",+ "type": "bytes",+ "value": "[102, 101, 101, 95, 99, 111, 110, 102, 105, 103]"+ },+ {+ "name": "FEE_PROGRAM_GLOBAL_SEED",+ "type": {+ "array": [+ "u8",+ 18+ ]+ },+ "value": "[102, 101, 101, 45, 112, 114, 111, 103, 114, 97, 109, 45, 103, 108, 111, 98, 97, 108]"+ },+ {+ "name": "PUMP_GLOBAL_SEED",+ "docs": [+ "Bonding Curve Program Global Seed"+ ],+ "type": {+ "array": [+ "u8",+ 6+ ]+ },+ "value": "[103, 108, 111, 98, 97, 108]"+ },+ {+ "name": "SHARING_CONFIG_SEED",+ "type": {+ "array": [+ "u8",+ 14+ ]+ },+ "value": "[115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, 103]"+ },+ {+ "name": "SOCIAL_FEE_PDA_SEED",+ "type": {+ "array": [+ "u8",+ 14+ ]+ },+ "value": "[115, 111, 99, 105, 97, 108, 45, 102, 101, 101, 45, 112, 100, 97]"+ }+ ]+}\ No newline at end of filediff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.jsindex 305cef085..2546eb755 100644--- a/public/dashboard/dashboard.js+++ b/public/dashboard/dashboard.js@@ -1167,11 +1167,22 @@ function bindEmbedTryIt(body, agent) {emote: { type: 'emote', payload: { name: 'smile' } },gesture: { type: 'gesture', payload: { name: 'wave' } },};+ let frameOrigin = '';+ try {+ frameOrigin = new URL(frame.src, location.href).origin;+ } catch {}for (const btn of body.querySelectorAll('[data-tryit]')) {btn.addEventListener('click', () => {const action = samples[btn.dataset.tryit];if (!action) return;- frame.contentWindow?.postMessage({ __agent: agent.id, type: 'action', action }, '*');+ if (!frameOrigin) {+ console.warn('[dashboard] embed preview frame has no resolvable origin');+ return;+ }+ frame.contentWindow?.postMessage(+ { __agent: agent.id, type: 'action', action },+ frameOrigin,+ );});}}diff --git a/public/embed-sdk.js b/public/embed-sdk.jsindex 11ddd3ee3..417c875cd 100644--- a/public/embed-sdk.js+++ b/public/embed-sdk.js@@ -10,12 +10,15 @@* onError, // (err) => void — handshake timeout, blocked embed, etc.* helloTimeoutMs: 2000,* autoResize: true,+ * origin: 'https://three.ws', // override iframe-origin detection* });* bridge.send({ type: 'speak', payload: { text: 'hello' } });* bridge.ping().then(rttMs => …);* bridge.destroy();*- * Tiny on purpose. See public/agent/embed.html for the full bridge contract.+ * Origin lockdown: connect() requires a resolvable iframe origin. Wildcard+ * targets ('*') are rejected, and inbound messages from any other origin or+ * window are dropped.*/(function (root) {'use strict';@@ -29,6 +32,12 @@var helloTimeoutMs = opts.helloTimeoutMs == null ? 2000 : opts.helloTimeoutMs;var autoResize = opts.autoResize !== false;var iframeOrigin = opts.origin || originOf(iframeEl.src);+ if (!iframeOrigin || iframeOrigin === 'null') {+ throw new Error('Agent3D.connect: iframe src must have a resolvable origin (set opts.origin explicitly for sandboxed iframes).');+ }+ if (iframeOrigin === '*') {+ throw new Error('Agent3D.connect: opts.origin cannot be "*"');+ }var pings = Object.create(null);var nextPingId = 1;var ready = false;@@ -38,13 +47,14 @@function post(msg) {if (destroyed || !iframeEl.contentWindow) return;- iframeEl.contentWindow.postMessage(msg, iframeOrigin || '*');+ iframeEl.contentWindow.postMessage(msg, iframeOrigin);}function onMessage(ev) {if (destroyed) return;- // Origin lock — when we know the iframe origin, ignore everything else.- if (iframeOrigin && ev.origin !== iframeOrigin) return;+ // Origin + window lock — drop messages from other windows or origins.+ if (ev.source !== iframeEl.contentWindow) return;+ if (ev.origin !== iframeOrigin) return;var msg = ev.data;if (!msg || typeof msg !== 'object' || msg.agentId !== agentId) return;switch (msg.type) {@@ -108,6 +118,7 @@return {ready: readyPromise,+ origin: iframeOrigin,send: function (action) { post({ type: 'agent:action', agentId: agentId, action: action }); },ping: function (timeoutMs) {var id = String(nextPingId++);@@ -130,8 +141,8 @@function originOf(url) {if (!url) return '';- try { return new URL(url, location.href).origin; } catch (_) { return ''; }+ try { return new URL(url, typeof location !== 'undefined' ? location.href : undefined).origin; } catch (_) { return ''; }}- root.Agent3D = { connect: connect, version: '1' };+ root.Agent3D = { connect: connect, version: '1', originOf: originOf };})(typeof window !== 'undefined' ? window : globalThis);diff --git a/public/pumpfun.html b/public/pumpfun.htmlindex 148c87abc..b0439fd16 100644--- a/public/pumpfun.html+++ b/public/pumpfun.html@@ -28,6 +28,15 @@@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }.status-pill { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px;padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; }+ .helius-pill { font-size: 10px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px;+ padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none;+ background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(168,85,247,0.06));+ transition: color 0.15s ease, border-color 0.15s ease; vertical-align: middle; margin-left: 8px;+ letter-spacing: 0.02em; text-transform: uppercase; font-weight: 500; }+ .helius-pill:hover { color: #eee; border-color: #4a4a58; }+ .helius-pill .helius-dot { width: 6px; height: 6px; border-radius: 50%;+ background: linear-gradient(135deg, #f59e0b, #a855f7); box-shadow: 0 0 6px rgba(168,85,247,0.55); }+ #feed-wrap h2 { display: inline-flex; align-items: center; flex-wrap: wrap; }.pf-filterbar .desc { color: var(--muted); font-size: 12px; }.pf-filterbar .ctl { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }.pf-filterbar label { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }@@ -259,7 +268,7 @@<div class="signal-grid" id="signals"></div></div><div id="feed-wrap">- <h2><span id="feed-title">Live feed</span></h2>+ <h2><span id="feed-title">Live feed</span><a class="helius-pill" href="https://helius.dev" target="_blank" rel="noopener" title="Real-time Solana data via Helius webhooks"><span class="helius-dot" aria-hidden="true"></span>Powered by Helius</a></h2><div id="feed"><div class="empty">Waiting for events…</div></div></div></aside>@@ -272,7 +281,7 @@<button class="pf-modal-close" type="button" aria-label="Close" data-picker-close>×</button></div><div class="pf-tabs" role="tablist">- <button class="pf-tab" role="tab" type="button" data-tab="defaults" aria-selected="true">Defaults</button>+ <button class="pf-tab" role="tab" type="button" data-tab="defaults" aria-selected="true">Defaults<span class="badge" id="tab-count-defaults"></span></button><button class="pf-tab" role="tab" type="button" data-tab="community" aria-selected="false">Community<span class="badge" id="tab-count-community"></span></button><button class="pf-tab" role="tab" type="button" data-tab="mine" aria-selected="false">My Agents<span class="badge" id="tab-count-mine"></span></button></div>@@ -571,6 +580,8 @@}}+ updateTabBadge('defaults', String(picker.data.defaults.length));+// Initial label from URL param(function initTriggerLabel() {const preset = DEFAULT_AVATARS.find((a) => a.url === params.avatar);@@ -650,6 +661,7 @@bridgeReady = false;bridgeQueue = [];activeChipName = null;+ lastClipsKey = '';document.querySelectorAll('.anim-chip').forEach((c) => delete c.dataset.active);}@@ -675,9 +687,34 @@return;}if (msg.kind === 'response' && msg.op === 'pong') {+ const wasReady = bridgeReady;bridgeReady = true;for (const m of bridgeQueue) iframe.contentWindow.postMessage(m, location.origin);bridgeQueue = [];+ const caps = msg.payload?.capabilities || [];+ // Subscribe so the embed pushes us `op:'clips'` change events when+ // the loaded model swaps inside the same iframe (otherwise those+ // events stay queued in the embed and we'd only see them on reload).+ if (!wasReady && caps.includes('subscribe')) {+ sendToAgent('subscribe', {});+ }+ // Pull authoritative clip list from the iframe — replaces the+ // manifest-only fallback whenever the loaded model has its own+ // non-Mixamo skeleton (e.g. RobotExpressive bakes 7 emotes).+ if (caps.includes('listClips')) {+ sendToAgent('listClips', {});+ }+ return;+ }+ if (msg.kind === 'response' && msg.op === 'listClips') {+ const clips = msg.payload?.clips || [];+ if (clips.length) renderAnimChips(clips);+ return;+ }+ if (msg.kind === 'event' && msg.op === 'clips') {+ const clips = msg.payload?.clips || [];+ if (clips.length) renderAnimChips(clips);+ return;}});@@ -696,17 +733,26 @@return icon + ' ' + label;}- async function buildAnimChips() {+ // Tracks the rendered clip list so we don't redundantly rebuild on every+ // duplicate `op:'clips'` event from the iframe.+ let lastClipsKey = '';++ function renderAnimChips(defs) {const wrap = $('anim-chips');- const defs = await loadManifest();+ if (!wrap) return;+ const safe = Array.isArray(defs) ? defs.filter((d) => d && d.name) : [];+ const key = safe.map((d) => d.name).join('|');+ if (key === lastClipsKey && wrap.childElementCount === safe.length) return;+ lastClipsKey = key;wrap.innerHTML = '';- defs.forEach((def) => {+ safe.forEach((def) => {const btn = document.createElement('button');btn.type = 'button';btn.className = 'anim-chip';btn.dataset.anim = def.name;btn.title = def.name;btn.textContent = chipLabel(def);+ if (def.name === activeChipName) btn.dataset.active = 'true';btn.addEventListener('click', () => {document.querySelectorAll('.anim-chip').forEach((c) => delete c.dataset.active);btn.dataset.active = 'true';@@ -717,6 +763,14 @@});}+ async function buildAnimChips() {+ // Initial paint from the manifest. The iframe replaces this with its+ // authoritative clip list (`op:'clips'`) once the model is loaded —+ // e.g. baked-only for RobotExpressive (skeletal mismatch with Mixamo).+ const defs = await loadManifest();+ renderAnimChips(defs);+ }+function renderAgentCard(card) {const id = card?.identity || {};$('agent-card').innerHTML = `@@ -748,6 +802,85 @@const TIER_BADGE = { mega: '🔥🔥', influencer: '🔥', notable: '⭐' };const MAX_EVENTS = 30;+ // Host-side reaction map. Mirrors src/widgets/pumpfun-reactions.js so+ // the avatar reacts even when the in-iframe widget overlay is hidden.+ const REACT_COOLDOWN_MS = 2200;+ const REACT_DEDUPE_MS = 30000;+ const _reactSeen = new Map();+ let _reactActiveUntil = 0;+ let _reactActivePri = 0;++ function reactionFor(kind, ev) {+ if (!ev) return null;+ if (kind === 'graduation') {+ const sym = ev.symbol || ev.name || 'a token';+ const initial = Number(ev.market_cap_usd_initial ?? ev.initial_market_cap_usd ?? ev.market_cap_at_launch) || 0;+ const current = Number(ev.usd_market_cap ?? ev.market_cap_usd ?? ev.market_cap) || 0;+ const mult = initial && current ? current / initial : 1;+ const dur = Math.min(9000, Math.max(4500, 4500 + Math.log10(Math.max(mult, 1)) * 1500));+ return {+ emote: { trigger: 'celebration', weight: 0.95 },+ gesture: { name: 'rumba', duration: dur },+ speak: { text: `Migration: ${sym} bonded to PumpAMM.`, sentiment: 0.7 },+ priority: 90,+ };+ }+ if (kind === 'claim') {+ if (ev.fake_claim) return {+ emote: { trigger: 'concern', weight: 0.75 },+ gesture: { name: 'shake', duration: 1500 },+ priority: 70,+ };+ if (ev.first_time_claim) {+ const linked = !!(ev.github_user || ev.github_repo);+ const verified = ev.verified ?? ev.signal_verified;+ const name = linked ? (verified ? 'thriller' : 'silly') : 'celebrate';+ return {+ emote: { trigger: 'celebration', weight: 0.95 },+ gesture: { name, duration: 5000 },+ priority: 85,+ };+ }+ if (ev.tier === 'mega') return { emote: { trigger: 'celebration', weight: 0.7 }, gesture: { name: 'taunt', duration: 2500 }, priority: 50 };+ if (ev.tier === 'influencer') return { emote: { trigger: 'curiosity', weight: 0.55 }, gesture: { name: 'reaction', duration: 1800 }, priority: 35 };+ if (ev.tier === 'notable') return { emote: { trigger: 'curiosity', weight: 0.4 }, priority: 20 };+ return null;+ }+ if (kind === 'mint') {+ const initSol = Number(ev.initial_buy_sol) || 0;+ if (ev.tier === 'mega' || initSol >= 5) return { emote: { trigger: 'curiosity', weight: 0.55 }, gesture: { name: 'wave', duration: 1500 }, priority: 25 };+ if (ev.tier === 'influencer' || initSol >= 1) return { emote: { trigger: 'curiosity', weight: 0.35 }, priority: 10 };+ return null;+ }+ return null;+ }++ function dispatchReaction(kind, ev) {+ const reaction = reactionFor(kind, ev);+ if (!reaction) return;+ const t = Date.now();+ const mint = ev?.mint || ev?.token_mint;+ const key = mint ? (kind === 'claim' ? `claim:${mint}:${ev?.tx_signature || ev?.signature || ev?.claim_number || ''}` : `${kind}:${mint}`) : null;+ if (key) {+ const last = _reactSeen.get(key);+ if (last != null && t - last < REACT_DEDUPE_MS) return;+ _reactSeen.set(key, t);+ if (_reactSeen.size > 200) {+ for (const [k, v] of _reactSeen) if (t - v > REACT_DEDUPE_MS) _reactSeen.delete(k);+ }+ }+ const pri = reaction.priority || 0;+ if (t < _reactActiveUntil && pri <= _reactActivePri) return;+ const dur = reaction.gesture?.duration || REACT_COOLDOWN_MS;+ _reactActiveUntil = t + Math.max(REACT_COOLDOWN_MS, dur);+ _reactActivePri = pri;+ iframe.contentWindow?.postMessage({+ type: 'pumpfun-feed:react',+ reaction,+ speak: params.narrate,+ }, '*');+ }+function eventMatchesMint(ev) {if (!params.mint) return true;return ev?.mint === params.mint || ev?.token_mint === params.mint;@@ -791,7 +924,8 @@ev.telegram ? `<a href="${attr(ev.telegram)}" target="_blank" rel="noopener">TG</a>` : '',ev.website ? `<a href="${attr(ev.website)}" target="_blank" rel="noopener">🌐</a>` : '',].filter(Boolean).join(' ');- return `<div class="evt">+ const replay = ev.replay ? ' replay' : '';+ return `<div class="evt${replay}"><div class="evt-row"><span class="evt-kind">🌱 new token</span><span class="evt-time">${escapeHtml(timeAgo(ev.created_at))}</span>@@ -827,21 +961,26 @@? `${fmtUsd(mcInitial)} ⇨ ${fmtUsd(mcCurrent)}`: (mcCurrent != null ? fmtUsd(mcCurrent) : '');+ const ath = ev.ath_market_cap ?? ev.ath_usd ?? null;+ const athStr = ath != null && ath !== mcCurrent ? fmtUsd(ath) : '';+const launches = ev.creator_launches;+ const graduated = ev.creator_graduated;const bestToken = Array.isArray(ev.creator_tokens) && ev.creator_tokens.length? ev.creator_tokens.slice().sort((a, b) => (b?.mc || 0) - (a?.mc || 0))[0]: null;const bestStr = bestToken- ? `best $${escapeHtml(bestToken.symbol || '?')}${bestToken.mc ? ' ' + fmtUsd(bestToken.mc) : ''}`+ ? (bestToken.symbol === symbol+ ? `best $${escapeHtml(bestToken.symbol)}${bestToken.mc ? ' ' + fmtUsd(bestToken.mc) : ''} (this)`+ : `best $${escapeHtml(bestToken.symbol || '?')}${bestToken.mc ? ' ' + fmtUsd(bestToken.mc) : ''}`): '';const amountStr = ev.amount_sol != null? `${Number(ev.amount_sol).toFixed(2)} SOL${ev.amount_usd != null ? ' [' + fmtUsd(ev.amount_usd) + ']' : ''}`: '';- const devParts = [- launches != null ? `${launches} launches` : '',- bestStr,- amountStr,- ].filter(Boolean).join(' ⋅ ');+ const launchesPart = launches != null+ ? (graduated != null ? `${launches} launches · 🎓 ${graduated}` : `${launches} launches`)+ : '';+ const devParts = [launchesPart, bestStr, amountStr].filter(Boolean).join(' ⋅ ');const m = encodeURIComponent(mint);const chartLinks = mint ? [@@ -856,16 +995,39 @@['BLX', `https://bullx.io/terminal?chainId=1399811149&address=${mint}`],].map(([l, u]) => `<a href="${attr(u)}" target="_blank" rel="noopener">${l}</a>`).join('⋅') : '';+ const socials = [+ ev.twitter ? `<a href="${attr(twitterUrl(ev.twitter))}" target="_blank" rel="noopener">𝕏 ${escapeHtml(twitterLabel(ev.twitter))}</a>` : '',+ ev.telegram ? `<a href="${attr(ev.telegram)}" target="_blank" rel="noopener">TG</a>` : '',+ ev.website ? `<a href="${attr(ev.website)}" target="_blank" rel="noopener">🌐 site</a>` : '',+ ].filter(Boolean).join('');++ const poolStr = ev.pump_swap_pool+ ? `Pool: <code>${shortKey(ev.pump_swap_pool)}</code> (PumpAMM)`+ : ev.raydium_pool+ ? `Pool: <code>${shortKey(ev.raydium_pool)}</code> (Raydium)`+ : ev.pool ? `Pool: ${escapeHtml(String(ev.pool))}` : '';+const tsStr = fmtUtc(ev.timestamp ?? ev.block_time ?? ev.created_at);const sig = ev.signature || ev.tx_signature;+ const replay = ev.replay ? ' replay' : '';+ const thumb = ev.image_uri+ ? `<img class="evt-thumb" src="${attr(ev.image_uri)}" alt="" loading="lazy" referrerpolicy="no-referrer" onerror="this.style.display='none'" />`+ : '';- return `<div class="evt grad">- <div class="evt-title">🆕💊 ${escapeHtml(name)} — $${escapeHtml(symbol)}${age ? ' [' + escapeHtml(age) + ']' : ''}</div>- ${desc ? `<div class="evt-desc">${desc}</div>` : ''}- ${mcStr ? `<div class="evt-amt">💎 MC: ${mcStr}</div>` : ''}+ return `<div class="evt grad${replay}">+ <div class="evt-head">+ ${thumb}+ <div class="evt-head-text">+ <div class="evt-title">🆕💊 ${escapeHtml(name)} — $${escapeHtml(symbol)}${age ? ' [' + escapeHtml(age) + ']' : ''}</div>+ ${desc ? `<div class="evt-desc">${desc}</div>` : ''}+ ${socials ? `<div class="evt-socials">${socials}</div>` : ''}+ </div>+ </div>+ ${mcStr ? `<div class="evt-amt" style="margin-top:6px">💎 MC: ${mcStr}${athStr ? ' · 🏆 ATH: ' + athStr : ''}</div>` : ''}${devParts ? `<div class="evt-row2" style="margin-top:6px">👨💻 ${devParts}</div>` : ''}${chartLinks ? `<div class="evt-row2">💹 Chart: ${chartLinks}</div>` : ''}${toolAbbr ? `<div class="evt-row2">🧰 ${toolAbbr}</div>` : ''}+ ${poolStr ? `<div class="evt-pool">${poolStr}</div>` : ''}<div class="evt-mint">${escapeHtml(mint)}</div><div class="evt-meta">${sig ? `🔗 <a href="https://solscan.io/tx/${encodeURIComponent(sig)}" target="_blank" rel="noopener">TX</a>` : ''}@@ -985,14 +1147,17 @@es.addEventListener('claim', (msg) => {const ev = safeJson(msg.data); if (!ev || !eventMatchesMint(ev)) return;pushEvent(renderClaim(ev));+ dispatchReaction('claim', ev);});es.addEventListener('graduation', (msg) => {const ev = safeJson(msg.data); if (!ev || !eventMatchesMint(ev)) return;pushEvent(renderGraduation(ev));+ dispatchReaction('graduation', ev);});es.addEventListener('mint', (msg) => {const ev = safeJson(msg.data); if (!ev || !eventMatchesMint(ev)) return;pushEvent(renderMint(ev));+ dispatchReaction('mint', ev);});}diff --git a/pump-dashboard.html b/pump-dashboard.htmlnew file mode 100644index 000000000..5b41cfb1e--- /dev/null+++ b/pump-dashboard.html@@ -0,0 +1,1741 @@+<!DOCTYPE html>+<html lang="en">+<head>+<meta charset="UTF-8">+<meta name="viewport" content="width=device-width, initial-scale=1.0">+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🤖</text></svg>">+<title>PumpFun Bot Dashboard</title>+<style>+ :root {+ --bg: #0a0a0a;+ --bg-card: #111;+ --bg-input: #1a1a1a;+ --border: #222;+ --border-focus: #00ff41;+ --text: #ccc;+ --text-bright: #fff;+ --accent: #00ff41;+ --accent-dim: #00cc33;+ --red: #ff4141;+ --yellow: #ffc107;+ --blue: #4fc3f7;+ --purple: #bb86fc;+ --orange: #ff9800;+ --font: 'Courier New', monospace;+ --radius: 6px;+ }+ * { margin: 0; padding: 0; box-sizing: border-box; }+ body {+ background: var(--bg);+ color: var(--text);+ font-family: var(--font);+ font-size: 13px;+ line-height: 1.5;+ min-height: 100vh;+ }++ /* ── Layout ──────────────────────────────────────────── */+ .app { display: flex; min-height: 100vh; }+ .sidebar {+ width: 220px;+ background: var(--bg-card);+ border-right: 1px solid var(--border);+ display: flex;+ flex-direction: column;+ position: fixed;+ top: 0; left: 0; bottom: 0;+ z-index: 20;+ overflow-y: auto;+ }+ .sidebar-header {+ padding: 16px;+ border-bottom: 1px solid var(--border);+ }+ .sidebar-header h1 {+ font-size: 14px;+ color: var(--accent);+ display: flex;+ align-items: center;+ gap: 8px;+ }+ .sidebar-header .version { font-size: 11px; color: #666; }+ .sidebar nav { flex: 1; padding: 8px 0; }+ .sidebar nav a {+ display: flex;+ align-items: center;+ gap: 10px;+ padding: 10px 16px;+ color: var(--text);+ text-decoration: none;+ font-size: 12px;+ border-left: 3px solid transparent;+ transition: all 0.15s;+ }+ .sidebar nav a:hover { background: rgba(0,255,65,0.05); color: var(--text-bright); }+ .sidebar nav a.active {+ background: rgba(0,255,65,0.08);+ color: var(--accent);+ border-left-color: var(--accent);+ }+ .sidebar nav a .icon { width: 16px; text-align: center; }+ .sidebar nav .section-label {+ padding: 12px 16px 4px;+ font-size: 10px;+ color: #555;+ text-transform: uppercase;+ letter-spacing: 1px;+ }+ .sidebar-footer {+ padding: 12px 16px;+ border-top: 1px solid var(--border);+ font-size: 11px;+ color: #555;+ }+ .main { margin-left: 220px; flex: 1; }++ /* ── Top Bar ─────────────────────────────────────────── */+ .topbar {+ background: var(--bg-card);+ border-bottom: 1px solid var(--border);+ padding: 12px 24px;+ display: flex;+ align-items: center;+ gap: 16px;+ position: sticky;+ top: 0;+ z-index: 10;+ }+ .topbar .page-title { font-size: 15px; color: var(--text-bright); }+ .topbar .spacer { flex: 1; }+ .topbar .connection-status {+ display: flex;+ align-items: center;+ gap: 6px;+ font-size: 11px;+ }+ .topbar .dot {+ width: 8px; height: 8px;+ border-radius: 50%;+ background: #555;+ }+ .topbar .dot.connected { background: var(--accent); box-shadow: 0 0 6px var(--accent); }+ .topbar .dot.error { background: var(--red); }++ /* ── Content ─────────────────────────────────────────── */+ .content { padding: 24px; }++ /* ── Cards ───────────────────────────────────────────── */+ .stats-grid {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));+ gap: 16px;+ margin-bottom: 24px;+ }+ .stat-card {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ padding: 16px;+ }+ .stat-card .label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }+ .stat-card .value { font-size: 24px; color: var(--text-bright); margin-top: 4px; }+ .stat-card .value.green { color: var(--accent); }+ .stat-card .value.red { color: var(--red); }+ .stat-card .value.yellow { color: var(--yellow); }+ .stat-card .value.blue { color: var(--blue); }+ .stat-card .sub { font-size: 11px; color: #666; margin-top: 4px; }++ .panel {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ margin-bottom: 24px;+ overflow: hidden;+ }+ .panel-header {+ padding: 12px 16px;+ border-bottom: 1px solid var(--border);+ display: flex;+ align-items: center;+ gap: 12px;+ }+ .panel-header h2 {+ font-size: 13px;+ color: var(--text-bright);+ }+ .panel-header .badge {+ background: rgba(0,255,65,0.15);+ color: var(--accent);+ padding: 2px 8px;+ border-radius: 10px;+ font-size: 10px;+ }+ .panel-header .spacer { flex: 1; }+ .panel-body { padding: 16px; }+ .panel-body.no-pad { padding: 0; }++ /* ── Tables ───────────────────────────────────────────── */+ table { width: 100%; border-collapse: collapse; }+ th, td {+ padding: 8px 12px;+ text-align: left;+ font-size: 12px;+ border-bottom: 1px solid var(--border);+ }+ th { color: #666; font-weight: normal; text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px; }+ td { color: var(--text); }+ tr:hover td { background: rgba(255,255,255,0.02); }+ .mono { font-family: var(--font); }+ .addr {+ color: var(--blue);+ cursor: pointer;+ text-decoration: none;+ }+ .addr:hover { text-decoration: underline; }+ .tag {+ display: inline-block;+ padding: 2px 6px;+ border-radius: 3px;+ font-size: 10px;+ font-weight: bold;+ }+ .tag-buy { background: rgba(0,255,65,0.15); color: var(--accent); }+ .tag-sell { background: rgba(255,65,65,0.15); color: var(--red); }+ .tag-claim { background: rgba(79,195,247,0.15); color: var(--blue); }+ .tag-grad { background: rgba(187,134,252,0.15); color: var(--purple); }+ .tag-whale { background: rgba(255,152,0,0.15); color: var(--orange); }+ .tag-launch { background: rgba(255,193,7,0.15); color: var(--yellow); }++ /* ── Buttons ──────────────────────────────────────────── */+ .btn {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 6px 14px;+ border: 1px solid var(--border);+ border-radius: var(--radius);+ background: var(--bg-input);+ color: var(--text);+ font-family: var(--font);+ font-size: 12px;+ cursor: pointer;+ transition: all 0.15s;+ }+ .btn:hover { border-color: #444; color: var(--text-bright); }+ .btn-primary { border-color: var(--accent-dim); color: var(--accent); }+ .btn-primary:hover { background: rgba(0,255,65,0.1); }+ .btn-danger { border-color: #cc3333; color: var(--red); }+ .btn-danger:hover { background: rgba(255,65,65,0.1); }+ .btn-sm { padding: 4px 10px; font-size: 11px; }++ /* ── Forms ────────────────────────────────────────────── */+ .form-group { margin-bottom: 12px; }+ .form-group label { display: block; font-size: 11px; color: #888; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }+ .form-group input, .form-group select, .form-group textarea {+ width: 100%;+ padding: 8px 12px;+ background: var(--bg-input);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ color: var(--text-bright);+ font-family: var(--font);+ font-size: 12px;+ outline: none;+ }+ .form-group input:focus, .form-group select:focus, .form-group textarea:focus {+ border-color: var(--accent);+ }+ .form-row { display: flex; gap: 12px; }+ .form-row .form-group { flex: 1; }+ .form-inline { display: flex; gap: 8px; align-items: flex-end; }++ /* ── Feed ─────────────────────────────────────────────── */+ .feed { max-height: 500px; overflow-y: auto; }+ .feed-item {+ padding: 10px 16px;+ border-bottom: 1px solid var(--border);+ display: flex;+ gap: 12px;+ align-items: flex-start;+ transition: background 0.15s;+ }+ .feed-item:hover { background: rgba(255,255,255,0.02); }+ .feed-item.new { animation: feedFlash 1s ease-out; }+ @keyframes feedFlash {+ 0% { background: rgba(0,255,65,0.12); }+ 100% { background: transparent; }+ }+ .feed-item .time { color: #555; font-size: 11px; white-space: nowrap; min-width: 70px; }+ .feed-item .body { flex: 1; }+ .feed-item .title { color: var(--text-bright); font-size: 12px; }+ .feed-item .detail { color: #888; font-size: 11px; margin-top: 2px; }++ /* ── Modals ───────────────────────────────────────────── */+ .modal-backdrop {+ position: fixed;+ inset: 0;+ background: rgba(0,0,0,0.7);+ z-index: 100;+ display: none;+ align-items: center;+ justify-content: center;+ }+ .modal-backdrop.open { display: flex; }+ .modal {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ width: 480px;+ max-height: 80vh;+ overflow-y: auto;+ padding: 20px;+ }+ .modal h3 { color: var(--text-bright); font-size: 14px; margin-bottom: 16px; }+ .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }++ /* ── Toggle ───────────────────────────────────────────── */+ .toggle {+ position: relative;+ width: 36px; height: 20px;+ appearance: none;+ background: #333;+ border-radius: 10px;+ cursor: pointer;+ outline: none;+ border: none;+ transition: background 0.2s;+ }+ .toggle::before {+ content: '';+ position: absolute;+ top: 2px; left: 2px;+ width: 16px; height: 16px;+ background: #888;+ border-radius: 50%;+ transition: all 0.2s;+ }+ .toggle:checked { background: var(--accent-dim); }+ .toggle:checked::before { left: 18px; background: var(--accent); }++ .toggle-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 8px 0;+ border-bottom: 1px solid var(--border);+ }+ .toggle-row:last-child { border-bottom: none; }+ .toggle-label { font-size: 12px; }+ .toggle-label .sub { font-size: 10px; color: #666; }++ /* ── Config Editor ────────────────────────────────────── */+ .config-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 16px;+ }+ @media (max-width: 900px) {+ .config-grid { grid-template-columns: 1fr; }+ .sidebar { display: none; }+ .main { margin-left: 0; }+ }++ /* ── Empty state ──────────────────────────────────────── */+ .empty {+ text-align: center;+ padding: 40px 20px;+ color: #555;+ }+ .empty .icon { font-size: 32px; margin-bottom: 12px; }++ /* ── Scrollbar ────────────────────────────────────────── */+ ::-webkit-scrollbar { width: 6px; }+ ::-webkit-scrollbar-track { background: transparent; }+ ::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }+ ::-webkit-scrollbar-thumb:hover { background: #444; }++ /* ── Toast ─────────────────────────────────────────────── */+ .toast-container {+ position: fixed;+ bottom: 20px;+ right: 20px;+ z-index: 200;+ display: flex;+ flex-direction: column;+ gap: 8px;+ }+ .toast {+ background: var(--bg-card);+ border: 1px solid var(--border);+ border-radius: var(--radius);+ padding: 10px 16px;+ font-size: 12px;+ animation: toastIn 0.3s ease-out;+ max-width: 360px;+ }+ .toast.success { border-color: var(--accent-dim); }+ .toast.error { border-color: var(--red); }+ @keyframes toastIn {+ from { opacity: 0; transform: translateY(10px); }+ to { opacity: 1; transform: translateY(0); }+ }+</style>+</head>+<body>+<div class="app">+ <!-- ── Sidebar ─────────────────────────── -->+ <aside class="sidebar">+ <div class="sidebar-header">+ <h1>🤖 PumpBot</h1>+ <div class="version">Dashboard v1.0</div>+ </div>+ <nav>+ <div class="section-label">Overview</div>+ <a href="#" data-page="dashboard" class="active"><span class="icon">📊</span> Dashboard</a>+ <a href="#" data-page="feed"><span class="icon">📡</span> Live Feed</a>++ <div class="section-label">Bots</div>+ <a href="#" data-page="watches"><span class="icon">👁</span> Watch List</a>+ <a href="#" data-page="claims"><span class="icon">💰</span> Fee Claims</a>+ <a href="#" data-page="alerts"><span class="icon">🚨</span> Alerts</a>++ <div class="section-label">Tools</div>+ <a href="#" data-page="scanner"><span class="icon">🔍</span> Token Scanner</a>+ <a href="#" data-page="quoting"><span class="icon">📈</span> Quote Engine</a>+ <a href="#" data-page="vanity"><span class="icon">🔑</span> Vanity Gen</a>++ <div class="section-label">System</div>+ <a href="#" data-page="config"><span class="icon">⚙️</span> Configuration</a>+ <a href="#" data-page="api"><span class="icon">🔌</span> API Keys</a>+ </nav>+ <div class="sidebar-footer">+ <div id="bot-uptime">Uptime: --</div>+ </div>+ </aside>++ <!-- ── Main ────────────────────────────── -->+ <div class="main">+ <div class="topbar">+ <div class="page-title" id="page-title">Dashboard</div>+ <div class="spacer"></div>+ <div class="connection-status">+ <span class="dot" id="api-dot"></span>+ <span id="api-status">API: Connecting...</span>+ </div>+ <div class="connection-status">+ <span class="dot" id="ws-dot"></span>+ <span id="ws-status">WS: Disconnected</span>+ </div>+ </div>++ <!-- ═══════ Dashboard Page ═══════ -->+ <div class="content page" id="page-dashboard">+ <div class="stats-grid">+ <div class="stat-card">+ <div class="label">Bot Status</div>+ <div class="value green" id="stat-bot-status">--</div>+ <div class="sub" id="stat-bot-mode">--</div>+ </div>+ <div class="stat-card">+ <div class="label">Active Watches</div>+ <div class="value blue" id="stat-watches">0</div>+ <div class="sub" id="stat-watches-sub">Bot + API</div>+ </div>+ <div class="stat-card">+ <div class="label">Claims Detected</div>+ <div class="value yellow" id="stat-claims">0</div>+ <div class="sub" id="stat-claims-sub">Since start</div>+ </div>+ <div class="stat-card">+ <div class="label">Uptime</div>+ <div class="value" id="stat-uptime">--</div>+ <div class="sub" id="stat-uptime-sub">--</div>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header">+ <h2>Recent Activity</h2>+ <span class="badge" id="activity-count">0</span>+ <div class="spacer"></div>+ <button class="btn btn-sm" onclick="clearFeed('dashboard-feed')">Clear</button>+ </div>+ <div class="panel-body no-pad">+ <div class="feed" id="dashboard-feed">+ <div class="empty"><div class="icon">📡</div>Waiting for events...</div>+ </div>+ </div>+ </div>+ </div>++ <!-- ═══════ Live Feed Page ═══════ -->+ <div class="content page" id="page-feed" style="display:none">+ <div style="display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap;">+ <button class="btn btn-sm filter-btn active" data-filter="all">All</button>+ <button class="btn btn-sm filter-btn" data-filter="launch">🚀 Launches</button>+ <button class="btn btn-sm filter-btn" data-filter="trade">💱 Trades</button>+ <button class="btn btn-sm filter-btn" data-filter="whale">🐋 Whales</button>+ <button class="btn btn-sm filter-btn" data-filter="graduation">🎓 Graduations</button>+ <button class="btn btn-sm filter-btn" data-filter="claim">💰 Claims</button>+ </div>++ <div class="panel">+ <div class="panel-header">+ <h2>Real-Time Feed</h2>+ <span class="badge" id="feed-count">0</span>+ <div class="spacer"></div>+ <label style="font-size:11px;color:#888;display:flex;align-items:center;gap:6px;">+ <input type="checkbox" class="toggle" id="feed-pause">Pause+ </label>+ <button class="btn btn-sm" onclick="clearFeed('live-feed')">Clear</button>+ </div>+ <div class="panel-body no-pad">+ <div class="feed" id="live-feed" style="max-height:calc(100vh - 220px)">+ <div class="empty"><div class="icon">📡</div>Connect to start receiving events</div>+ </div>+ </div>+ </div>+ </div>++ <!-- ═══════ Watch List Page ═══════ -->+ <div class="content page" id="page-watches" style="display:none">+ <div style="display:flex;gap:8px;margin-bottom:16px;">+ <button class="btn btn-primary" onclick="openModal('add-watch-modal')">+ Add Watch</button>+ <button class="btn" onclick="refreshWatches()">↻ Refresh</button>+ </div>++ <div class="panel">+ <div class="panel-header">+ <h2>Active Watches</h2>+ <span class="badge" id="watches-count">0</span>+ </div>+ <div class="panel-body no-pad">+ <table>+ <thead><tr><th>Wallet</th><th>Label</th><th>Token Filter</th><th>Webhook</th><th>Created</th><th>Actions</th></tr></thead>+ <tbody id="watches-table"><tr><td colspan="6" class="empty">No watches configured</td></tr></tbody>+ </table>+ </div>+ </div>+ </div>++ <!-- ═══════ Claims Page ═══════ -->+ <div class="content page" id="page-claims" style="display:none">+ <div class="form-inline" style="margin-bottom:16px;">+ <div class="form-group" style="flex:2">+ <label>Filter Wallet</label>+ <input type="text" id="claims-wallet-filter" placeholder="Solana address...">+ </div>+ <div class="form-group" style="flex:1">+ <label>Type</label>+ <select id="claims-type-filter">+ <option value="">All Types</option>+ <option value="creator_fee">Creator Fee</option>+ <option value="cashback">Cashback</option>+ </select>+ </div>+ <div class="form-group" style="flex:0">+ <label> </label>+ <button class="btn btn-primary" onclick="refreshClaims()">Search</button>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header">+ <h2>Fee Claims</h2>+ <span class="badge" id="claims-count">0</span>+ <div class="spacer"></div>+ <button class="btn btn-sm" onclick="exportClaims()">⬇ Export CSV</button>+ </div>+ <div class="panel-body no-pad">+ <table>+ <thead><tr><th>Time</th><th>Wallet</th><th>Type</th><th>Token</th><th>Amount</th><th>TX</th></tr></thead>+ <tbody id="claims-table"><tr><td colspan="6" class="empty">No claims found</td></tr></tbody>+ </table>+ </div>+ </div>+ </div>++ <!-- ═══════ Alerts Page ═══════ -->+ <div class="content page" id="page-alerts" style="display:none">+ <div class="config-grid">+ <div class="panel">+ <div class="panel-header"><h2>Alert Settings</h2></div>+ <div class="panel-body">+ <div class="toggle-row">+ <div class="toggle-label">Graduation Alerts<div class="sub">Notify when tokens graduate to AMM</div></div>+ <input type="checkbox" class="toggle" id="alert-graduation" checked>+ </div>+ <div class="toggle-row">+ <div class="toggle-label">Whale Trade Alerts<div class="sub">Large buys/sells above threshold</div></div>+ <input type="checkbox" class="toggle" id="alert-whale">+ </div>+ <div class="toggle-row">+ <div class="toggle-label">Fee Distribution Alerts<div class="sub">Creator fee claim events</div></div>+ <input type="checkbox" class="toggle" id="alert-fees">+ </div>+ <div class="toggle-row">+ <div class="toggle-label">New Launch Alerts<div class="sub">New token creation events</div></div>+ <input type="checkbox" class="toggle" id="alert-launch">+ </div>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header"><h2>Thresholds</h2></div>+ <div class="panel-body">+ <div class="form-group">+ <label>Whale Threshold (SOL)</label>+ <input type="number" id="threshold-whale" value="10" min="0.1" step="0.1">+ </div>+ <div class="form-group">+ <label>Min Claim Alert (SOL)</label>+ <input type="number" id="threshold-claim" value="0.5" min="0.01" step="0.01">+ </div>+ <div class="form-group">+ <label>Trade Alert Cooldown (seconds)</label>+ <input type="number" id="threshold-cooldown" value="30" min="5" step="5">+ </div>+ <button class="btn btn-primary" style="margin-top:8px" onclick="saveAlertConfig()">Save Settings</button>+ </div>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header">+ <h2>Alert History</h2>+ <div class="spacer"></div>+ <button class="btn btn-sm" onclick="clearFeed('alert-feed')">Clear</button>+ </div>+ <div class="panel-body no-pad">+ <div class="feed" id="alert-feed">+ <div class="empty"><div class="icon">🔔</div>No alerts yet</div>+ </div>+ </div>+ </div>+ </div>++ <!-- ═══════ Token Scanner Page ═══════ -->+ <div class="content page" id="page-scanner" style="display:none">+ <div class="form-inline" style="margin-bottom:16px;">+ <div class="form-group" style="flex:1">+ <label>Token Mint Address</label>+ <input type="text" id="scanner-mint" placeholder="Enter Solana token mint address...">+ </div>+ <div class="form-group" style="flex:0">+ <label> </label>+ <button class="btn btn-primary" onclick="scanToken()">🔍 Scan</button>+ </div>+ </div>++ <div id="scanner-results" style="display:none">+ <div class="stats-grid">+ <div class="stat-card">+ <div class="label">Risk Score</div>+ <div class="value" id="scan-score">--</div>+ </div>+ <div class="stat-card">+ <div class="label">Risk Level</div>+ <div class="value" id="scan-level">--</div>+ </div>+ <div class="stat-card">+ <div class="label">PumpFun Token</div>+ <div class="value" id="scan-pump">--</div>+ </div>+ <div class="stat-card">+ <div class="label">Honeypot Risk</div>+ <div class="value" id="scan-honeypot">--</div>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header"><h2>Security Checks</h2></div>+ <div class="panel-body no-pad">+ <table>+ <thead><tr><th>Check</th><th>Status</th><th>Detail</th></tr></thead>+ <tbody id="scan-checks"></tbody>+ </table>+ </div>+ </div>+ </div>+ </div>++ <!-- ═══════ Quote Engine Page ═══════ -->+ <div class="content page" id="page-quoting" style="display:none">+ <div class="config-grid">+ <div class="panel">+ <div class="panel-header"><h2>Buy Quote</h2></div>+ <div class="panel-body">+ <div class="form-group">+ <label>Token Mint</label>+ <input type="text" id="quote-buy-mint" placeholder="Token mint address...">+ </div>+ <div class="form-group">+ <label>SOL Amount</label>+ <input type="number" id="quote-buy-amount" value="1" min="0.001" step="0.001">+ </div>+ <button class="btn btn-primary" onclick="getBuyQuote()">Get Buy Quote</button>+ <div id="quote-buy-result" style="margin-top:12px"></div>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header"><h2>Sell Quote</h2></div>+ <div class="panel-body">+ <div class="form-group">+ <label>Token Mint</label>+ <input type="text" id="quote-sell-mint" placeholder="Token mint address...">+ </div>+ <div class="form-group">+ <label>Token Amount</label>+ <input type="number" id="quote-sell-amount" value="1000000" min="1" step="1">+ </div>+ <button class="btn btn-primary" onclick="getSellQuote()">Get Sell Quote</button>+ <div id="quote-sell-result" style="margin-top:12px"></div>+ </div>+ </div>+ </div>+ </div>++ <!-- ═══════ Vanity Gen Page ═══════ -->+ <div class="content page" id="page-vanity" style="display:none">+ <div class="panel">+ <div class="panel-header"><h2>Vanity Address Generator</h2></div>+ <div class="panel-body">+ <div class="form-row">+ <div class="form-group">+ <label>Prefix (optional)</label>+ <input type="text" id="vanity-prefix" placeholder="e.g. pump" maxlength="6">+ </div>+ <div class="form-group">+ <label>Suffix (optional)</label>+ <input type="text" id="vanity-suffix" placeholder="e.g. fun" maxlength="6">+ </div>+ </div>+ <div style="display:flex;gap:8px;margin-top:8px">+ <button class="btn btn-primary" id="vanity-start" onclick="startVanity()">🔑 Generate</button>+ <button class="btn btn-danger" id="vanity-stop" onclick="stopVanity()" style="display:none">⏹ Stop</button>+ </div>+ <div id="vanity-status" style="margin-top:12px;font-size:12px;color:#888"></div>+ <div id="vanity-result" style="margin-top:12px"></div>+ </div>+ </div>+ </div>++ <!-- ═══════ Config Page ═══════ -->+ <div class="content page" id="page-config" style="display:none">+ <div class="config-grid">+ <div class="panel">+ <div class="panel-header"><h2>Connection</h2></div>+ <div class="panel-body">+ <div class="form-group">+ <label>API Base URL</label>+ <input type="text" id="cfg-api-url" value="http://localhost:3000">+ </div>+ <div class="form-group">+ <label>WebSocket URL</label>+ <input type="text" id="cfg-ws-url" value="ws://localhost:8080">+ </div>+ <div class="form-group">+ <label>API Key</label>+ <input type="password" id="cfg-api-key" placeholder="Your API key...">+ </div>+ <button class="btn btn-primary" onclick="saveConfig()">Save & Reconnect</button>+ </div>+ </div>++ <div class="panel">+ <div class="panel-header"><h2>Solana RPC</h2></div>+ <div class="panel-body">+ <div class="form-group">+ <label>RPC Endpoint</label>+ <input type="text" id="cfg-rpc-url" value="https://api.mainnet-beta.solana.com">+ </div>+ <div class="form-group">+ <label>Commitment Level</label>+ <select id="cfg-commitment">+ <option value="confirmed" selected>Confirmed</option>+ <option value="finalized">Finalized</option>+ <option value="processed">Processed</option>+ </select>+ </div>+ </div>+ </div>+ </div>+ </div>++ <!-- ═══════ API Keys Page ═══════ -->+ <div class="content page" id="page-api" style="display:none">+ <div class="panel">+ <div class="panel-header">+ <h2>API Access</h2>+ <div class="spacer"></div>+ </div>+ <div class="panel-body">+ <p style="color:#888;font-size:12px;margin-bottom:16px;">+ API endpoint: <span class="mono" style="color:var(--blue)" id="api-endpoint-display">--</span>+ </p>+ <h4 style="color:var(--text-bright);font-size:12px;margin-bottom:8px;">Available Endpoints</h4>+ <table>+ <thead><tr><th>Method</th><th>Path</th><th>Description</th><th>Auth</th></tr></thead>+ <tbody>+ <tr><td><span class="tag tag-buy">GET</span></td><td>/api/v1/health</td><td>Health check</td><td>No</td></tr>+ <tr><td><span class="tag tag-buy">GET</span></td><td>/api/v1/status</td><td>Detailed status</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-buy">GET</span></td><td>/api/v1/claims</td><td>Query claims (paginated, filterable)</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-buy">GET</span></td><td>/api/v1/claims/stream</td><td>Real-time SSE claim stream</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-buy">GET</span></td><td>/api/v1/watches</td><td>List watches</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-launch">POST</span></td><td>/api/v1/watches</td><td>Create watch</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-claim">PATCH</span></td><td>/api/v1/watches/:id</td><td>Update watch</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-sell">DELETE</span></td><td>/api/v1/watches/:id</td><td>Delete watch</td><td>Yes</td></tr>+ <tr><td><span class="tag tag-buy">GET</span></td><td>/api/v1/openapi</td><td>OpenAPI spec</td><td>No</td></tr>+ </tbody>+ </table>+ <h4 style="color:var(--text-bright);font-size:12px;margin:16px 0 8px;">Authentication</h4>+ <p style="color:#888;font-size:12px;">+ Send your API key via <code style="color:var(--blue)">X-API-Key</code> header or+ <code style="color:var(--blue)">Authorization: Bearer <key></code>.+ </p>+ </div>+ </div>+ </div>+ </div>+</div>++<!-- ── Add Watch Modal ────────────────── -->+<div class="modal-backdrop" id="add-watch-modal">+ <div class="modal">+ <h3>Add Watch</h3>+ <div class="form-group">+ <label>Wallet Address *</label>+ <input type="text" id="watch-wallet" placeholder="Solana wallet address...">+ </div>+ <div class="form-group">+ <label>Label</label>+ <input type="text" id="watch-label" placeholder="Optional label...">+ </div>+ <div class="form-group">+ <label>Token Filter (comma-separated mints)</label>+ <input type="text" id="watch-token-filter" placeholder="Leave empty for all tokens">+ </div>+ <div class="form-group">+ <label>Webhook URL</label>+ <input type="text" id="watch-webhook" placeholder="https://your-server.com/webhook">+ </div>+ <div class="modal-actions">+ <button class="btn" onclick="closeModal('add-watch-modal')">Cancel</button>+ <button class="btn btn-primary" onclick="createWatch()">Create Watch</button>+ </div>+ </div>+</div>++<div class="toast-container" id="toasts"></div>++<script>+// ═══════════════════════════════════════════════════════════════════════+// PumpFun Bot Dashboard — Client Application+// ═══════════════════════════════════════════════════════════════════════++const state = {+ apiUrl: localStorage.getItem('pumpbot-api-url') || 'http://localhost:3000',+ wsUrl: localStorage.getItem('pumpbot-ws-url') || 'ws://localhost:8080',+ apiKey: localStorage.getItem('pumpbot-api-key') || '',+ rpcUrl: localStorage.getItem('pumpbot-rpc-url') || 'https://api.mainnet-beta.solana.com',+ currentPage: 'dashboard',+ ws: null,+ sse: null,+ feedItems: [],+ feedCount: 0,+ activityCount: 0,+ currentFilter: 'all',+ feedPaused: false,+ vanityWorker: null,+ alertConfig: JSON.parse(localStorage.getItem('pumpbot-alerts') || '{}'),+};++// ── Init ──────────────────────────────────────────────────────────────++document.addEventListener('DOMContentLoaded', () => {+ // Load saved config into form fields+ document.getElementById('cfg-api-url').value = state.apiUrl;+ document.getElementById('cfg-ws-url').value = state.wsUrl;+ document.getElementById('cfg-api-key').value = state.apiKey;+ document.getElementById('cfg-rpc-url').value = state.rpcUrl;+ document.getElementById('api-endpoint-display').textContent = state.apiUrl + '/api/v1';++ // Restore alert config+ const ac = state.alertConfig;+ if (ac.graduation !== undefined) document.getElementById('alert-graduation').checked = ac.graduation;+ if (ac.whale !== undefined) document.getElementById('alert-whale').checked = ac.whale;+ if (ac.fees !== undefined) document.getElementById('alert-fees').checked = ac.fees;+ if (ac.launch !== undefined) document.getElementById('alert-launch').checked = ac.launch;+ if (ac.whaleThreshold) document.getElementById('threshold-whale').value = ac.whaleThreshold;+ if (ac.claimThreshold) document.getElementById('threshold-claim').value = ac.claimThreshold;++ // Nav click handlers+ document.querySelectorAll('.sidebar nav a').forEach(a => {+ a.addEventListener('click', e => {+ e.preventDefault();+ navigateTo(a.dataset.page);+ });+ });++ // Filter buttons+ document.querySelectorAll('.filter-btn').forEach(btn => {+ btn.addEventListener('click', () => {+ document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));+ btn.classList.add('active');+ state.currentFilter = btn.dataset.filter;+ applyFeedFilter();+ });+ });++ document.getElementById('feed-pause').addEventListener('change', e => {+ state.feedPaused = e.target.checked;+ });++ // Connect+ connectApi();+ connectWebSocket();++ // Update uptime every second+ setInterval(updateUptime, 1000);+});++// ── Navigation ────────────────────────────────────────────────────────++function navigateTo(page) {+ state.currentPage = page;+ document.querySelectorAll('.page').forEach(p => p.style.display = 'none');+ const target = document.getElementById('page-' + page);+ if (target) target.style.display = '';++ document.querySelectorAll('.sidebar nav a').forEach(a => {+ a.classList.toggle('active', a.dataset.page === page);+ });++ const titles = {+ dashboard: 'Dashboard', feed: 'Live Feed', watches: 'Watch List',+ claims: 'Fee Claims', alerts: 'Alerts', scanner: 'Token Scanner',+ quoting: 'Quote Engine', vanity: 'Vanity Generator',+ config: 'Configuration', api: 'API Keys',+ };+ document.getElementById('page-title').textContent = titles[page] || page;++ // Load data for the page+ if (page === 'watches') refreshWatches();+ if (page === 'claims') refreshClaims();+}++// ── API Connection ────────────────────────────────────────────────────++let healthInterval;++async function connectApi() {+ clearInterval(healthInterval);+ updateApiStatus('connecting');++ try {+ const resp = await apiFetch('/api/v1/health');+ if (resp.ok) {+ const data = await resp.json();+ updateApiStatus('connected');+ updateDashboard(data);+ // Poll health every 10s+ healthInterval = setInterval(pollHealth, 10000);+ } else {+ updateApiStatus('error');+ }+ } catch {+ updateApiStatus('error');+ // Retry in 5s+ setTimeout(connectApi, 5000);+ }+}++async function pollHealth() {+ try {+ const resp = await apiFetch('/api/v1/health');+ if (resp.ok) {+ const data = await resp.json();+ updateApiStatus('connected');+ updateDashboard(data);+ } else {+ updateApiStatus('error');+ }+ } catch {+ updateApiStatus('error');+ }+}++function updateApiStatus(status) {+ const dot = document.getElementById('api-dot');+ const label = document.getElementById('api-status');+ dot.className = 'dot ' + (status === 'connected' ? 'connected' : status === 'error' ? 'error' : '');+ label.textContent = status === 'connected' ? 'API: Connected' : status === 'error' ? 'API: Disconnected' : 'API: Connecting...';+}++function updateDashboard(health) {+ if (!health) return;+ const m = health.monitor || {};+ document.getElementById('stat-bot-status').textContent = m.running ? 'Running' : 'Stopped';+ document.getElementById('stat-bot-status').className = 'value ' + (m.running ? 'green' : 'red');+ document.getElementById('stat-bot-mode').textContent = 'Mode: ' + (m.mode || 'unknown');+ document.getElementById('stat-claims').textContent = (m.claimsDetected || 0).toLocaleString();+ const w = health.watches || {};+ document.getElementById('stat-watches').textContent = (w.total || w.active || 0).toString();++ state._uptime = health.uptime || 0;+ state._uptimeAt = Date.now();+}++function updateUptime() {+ if (!state._uptimeAt) return;+ const elapsed = state._uptime + (Date.now() - state._uptimeAt);+ const h = Math.floor(elapsed / 3600000);+ const m = Math.floor((elapsed % 3600000) / 60000);+ const s = Math.floor((elapsed % 60000) / 1000);+ const str = `${h}h ${m}m ${s}s`;+ document.getElementById('stat-uptime').textContent = str;+ document.getElementById('bot-uptime').textContent = 'Uptime: ' + str;+}++async function apiFetch(path, options = {}) {+ const url = state.apiUrl + path;+ const headers = { ...options.headers };+ if (state.apiKey) {+ headers['X-API-Key'] = state.apiKey;+ }+ return fetch(url, { ...options, headers });+}++// ── WebSocket Connection ──────────────────────────────────────────────++function connectWebSocket() {+ if (state.ws) {+ state.ws.close();+ state.ws = null;+ }++ const wsDot = document.getElementById('ws-dot');+ const wsLabel = document.getElementById('ws-status');++ try {+ state.ws = new WebSocket(state.wsUrl);++ state.ws.onopen = () => {+ wsDot.className = 'dot connected';+ wsLabel.textContent = 'WS: Connected';+ toast('WebSocket connected', 'success');+ };++ state.ws.onmessage = (event) => {+ try {+ const data = JSON.parse(event.data);+ handleWsEvent(data);+ } catch { /* ignore non-JSON */ }+ };++ state.ws.onclose = () => {+ wsDot.className = 'dot';+ wsLabel.textContent = 'WS: Disconnected';+ // Reconnect after 3s+ setTimeout(connectWebSocket, 3000);+ };++ state.ws.onerror = () => {+ wsDot.className = 'dot error';+ wsLabel.textContent = 'WS: Error';+ };+ } catch {+ wsDot.className = 'dot error';+ wsLabel.textContent = 'WS: Error';+ setTimeout(connectWebSocket, 5000);+ }+}++function handleWsEvent(data) {+ // Normalize event types from various sources+ const type = data.type || data.event || 'unknown';+ const ts = data.timestamp || Date.now();++ const item = {+ type,+ time: new Date(typeof ts === 'number' && ts < 1e12 ? ts * 1000 : ts),+ data,+ };++ // Add to feed+ addFeedItem('live-feed', item);+ addFeedItem('dashboard-feed', item);++ state.feedCount++;+ document.getElementById('feed-count').textContent = state.feedCount;+ state.activityCount++;+ document.getElementById('activity-count').textContent = state.activityCount;++ // Check alert rules+ checkAlerts(item);+}++// ── Feed Management ───────────────────────────────────────────────────++function addFeedItem(feedId, item) {+ if (state.feedPaused && feedId === 'live-feed') return;++ const feed = document.getElementById(feedId);+ if (!feed) return;++ // Remove empty state+ const empty = feed.querySelector('.empty');+ if (empty) empty.remove();++ // Build feed item+ const div = document.createElement('div');+ div.className = 'feed-item new';+ div.dataset.type = item.type;++ const tagClass = {+ launch: 'tag-launch', create: 'tag-launch',+ trade: 'tag-buy', buy: 'tag-buy', sell: 'tag-sell',+ whale: 'tag-whale', whale_trade: 'tag-whale',+ graduation: 'tag-grad', complete: 'tag-grad',+ claim: 'tag-claim', fee_claim: 'tag-claim',+ }[item.type] || 'tag-buy';++ const tagLabel = {+ launch: 'LAUNCH', create: 'LAUNCH',+ trade: 'TRADE', buy: 'BUY', sell: 'SELL',+ whale: 'WHALE', whale_trade: 'WHALE',+ graduation: 'GRAD', complete: 'GRAD',+ claim: 'CLAIM', fee_claim: 'CLAIM',+ }[item.type] || item.type.toUpperCase();++ const d = item.data;+ let title = '', detail = '';++ if (item.type === 'launch' || item.type === 'create') {+ title = `${d.name || d.tokenName || 'Unknown'} (${d.symbol || d.tokenSymbol || '?'})`;+ detail = d.mint ? shortAddr(d.mint) : '';+ } else if (item.type === 'trade' || item.type === 'buy' || item.type === 'sell') {+ title = `${d.tokenSymbol || '?'} — ${(d.solAmount || 0).toFixed(4)} SOL`;+ detail = d.user ? shortAddr(d.user) : '';+ } else if (item.type === 'whale' || item.type === 'whale_trade') {+ title = `🐋 ${(d.solAmount || 0).toFixed(2)} SOL — ${d.tokenSymbol || '?'}`;+ detail = d.user ? shortAddr(d.user) : '';+ } else if (item.type === 'graduation' || item.type === 'complete') {+ title = `${d.tokenSymbol || d.name || '?'} graduated to AMM`;+ detail = d.mint ? shortAddr(d.mint) : '';+ } else if (item.type === 'claim' || item.type === 'fee_claim') {+ title = `${(d.amountSol || 0).toFixed(4)} SOL claimed`;+ detail = `${d.claimType || 'fee'} — ${d.claimerWallet ? shortAddr(d.claimerWallet) : ''}`;+ } else {+ title = JSON.stringify(d).slice(0, 80);+ }++ const timeStr = item.time.toLocaleTimeString('en-US', { hour12: false });+ div.innerHTML = `+ <div class="time">${timeStr}</div>+ <span class="tag ${tagClass}">${tagLabel}</span>+ <div class="body">+ <div class="title">${escapeHtml(title)}</div>+ <div class="detail">${escapeHtml(detail)}</div>+ </div>+ `;++ feed.prepend(div);++ // Limit feed to 500 items+ while (feed.children.length > 500) {+ feed.lastElementChild.remove();+ }++ // Apply filter+ if (feedId === 'live-feed') applyFeedFilter();+}++function applyFeedFilter() {+ const feed = document.getElementById('live-feed');+ if (!feed) return;+ feed.querySelectorAll('.feed-item').forEach(item => {+ if (state.currentFilter === 'all') {+ item.style.display = '';+ } else {+ const type = item.dataset.type || '';+ const matches = {+ launch: ['launch', 'create'],+ trade: ['trade', 'buy', 'sell'],+ whale: ['whale', 'whale_trade'],+ graduation: ['graduation', 'complete'],+ claim: ['claim', 'fee_claim'],+ }[state.currentFilter] || [state.currentFilter];+ item.style.display = matches.includes(type) ? '' : 'none';+ }+ });+}++function clearFeed(feedId) {+ const feed = document.getElementById(feedId);+ if (feed) feed.innerHTML = '<div class="empty"><div class="icon">📡</div>Cleared</div>';+}++// ── Alerts ────────────────────────────────────────────────────────────++function checkAlerts(item) {+ const ac = state.alertConfig;+ const type = item.type;++ if (type === 'graduation' || type === 'complete') {+ if (ac.graduation !== false) {+ addAlertItem(item, '🎓 Token Graduated');+ }+ }+ if (type === 'whale' || type === 'whale_trade') {+ if (ac.whale) {+ const threshold = parseFloat(ac.whaleThreshold) || 10;+ if ((item.data.solAmount || 0) >= threshold) {+ addAlertItem(item, '🐋 Whale Trade Detected');+ }+ }+ }+ if (type === 'claim' || type === 'fee_claim') {+ if (ac.fees) {+ addAlertItem(item, '💰 Fee Claimed');+ }+ }+ if (type === 'launch' || type === 'create') {+ if (ac.launch) {+ addAlertItem(item, '🚀 New Token Launched');+ }+ }+}++function addAlertItem(item, label) {+ const feed = document.getElementById('alert-feed');+ if (!feed) return;+ const empty = feed.querySelector('.empty');+ if (empty) empty.remove();++ const div = document.createElement('div');+ div.className = 'feed-item new';+ const timeStr = item.time.toLocaleTimeString('en-US', { hour12: false });+ const d = item.data;+ let detail = d.tokenSymbol || d.name || d.mint || '';+ if (d.solAmount) detail += ` — ${d.solAmount.toFixed(4)} SOL`;++ div.innerHTML = `+ <div class="time">${timeStr}</div>+ <div class="body">+ <div class="title" style="color:var(--yellow)">${escapeHtml(label)}</div>+ <div class="detail">${escapeHtml(detail)}</div>+ </div>+ `;+ feed.prepend(div);+ while (feed.children.length > 200) feed.lastElementChild.remove();+}++function saveAlertConfig() {+ state.alertConfig = {+ graduation: document.getElementById('alert-graduation').checked,+ whale: document.getElementById('alert-whale').checked,+ fees: document.getElementById('alert-fees').checked,+ launch: document.getElementById('alert-launch').checked,+ whaleThreshold: document.getElementById('threshold-whale').value,+ claimThreshold: document.getElementById('threshold-claim').value,+ cooldown: document.getElementById('threshold-cooldown').value,+ };+ localStorage.setItem('pumpbot-alerts', JSON.stringify(state.alertConfig));+ toast('Alert settings saved', 'success');+}++// ── Watches ───────────────────────────────────────────────────────────++async function refreshWatches() {+ try {+ const resp = await apiFetch('/api/v1/watches?limit=100');+ if (!resp.ok) {+ toast('Failed to load watches: ' + resp.status, 'error');+ return;+ }+ const data = await resp.json();+ const watches = data.data || data.watches || [];+ document.getElementById('watches-count').textContent = watches.length;+ const tbody = document.getElementById('watches-table');++ if (watches.length === 0) {+ tbody.innerHTML = '<tr><td colspan="6" class="empty">No watches configured. Click "Add Watch" to create one.</td></tr>';+ return;+ }++ tbody.innerHTML = watches.map(w => `+ <tr>+ <td><a class="addr" href="https://solscan.io/account/${escapeHtml(w.wallet)}" target="_blank">${shortAddr(w.wallet)}</a></td>+ <td>${escapeHtml(w.label || '—')}</td>+ <td>${w.tokenFilter ? w.tokenFilter.map(shortAddr).join(', ') : 'All'}</td>+ <td>${w.webhookUrl ? '✅' : '—'}</td>+ <td>${w.createdAt ? new Date(w.createdAt).toLocaleDateString() : '—'}</td>+ <td>+ <button class="btn btn-sm btn-danger" onclick="deleteWatch('${escapeHtml(w.id)}')">✕</button>+ </td>+ </tr>+ `).join('');+ } catch (e) {+ toast('Failed to load watches', 'error');+ }+}++async function createWatch() {+ const wallet = document.getElementById('watch-wallet').value.trim();+ if (!wallet) { toast('Wallet address is required', 'error'); return; }++ const body = {+ wallet,+ label: document.getElementById('watch-label').value.trim() || undefined,+ tokenFilter: document.getElementById('watch-token-filter').value.trim()+ ? document.getElementById('watch-token-filter').value.split(',').map(s => s.trim()).filter(Boolean)+ : undefined,+ webhookUrl: document.getElementById('watch-webhook').value.trim() || undefined,+ };++ try {+ const resp = await apiFetch('/api/v1/watches', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify(body),+ });+ if (resp.ok) {+ toast('Watch created', 'success');+ closeModal('add-watch-modal');+ refreshWatches();+ // Clear form+ document.getElementById('watch-wallet').value = '';+ document.getElementById('watch-label').value = '';+ document.getElementById('watch-token-filter').value = '';+ document.getElementById('watch-webhook').value = '';+ } else {+ const err = await resp.json().catch(() => ({}));+ toast(err.error || 'Failed to create watch', 'error');+ }+ } catch {+ toast('Network error creating watch', 'error');+ }+}++async function deleteWatch(id) {+ if (!confirm('Delete this watch?')) return;+ try {+ const resp = await apiFetch('/api/v1/watches/' + id, { method: 'DELETE' });+ if (resp.ok) {+ toast('Watch deleted', 'success');+ refreshWatches();+ } else {+ toast('Failed to delete watch', 'error');+ }+ } catch {+ toast('Network error', 'error');+ }+}++// ── Claims ────────────────────────────────────────────────────────────++async function refreshClaims() {+ const wallet = document.getElementById('claims-wallet-filter').value.trim();+ const claimType = document.getElementById('claims-type-filter').value;+ const params = new URLSearchParams();+ if (wallet) params.set('wallet', wallet);+ if (claimType) params.set('claimType', claimType);+ params.set('limit', '100');++ try {+ const resp = await apiFetch('/api/v1/claims?' + params);+ if (!resp.ok) {+ toast('Failed to load claims: ' + resp.status, 'error');+ return;+ }+ const data = await resp.json();+ const claims = data.data || data.claims || [];+ document.getElementById('claims-count').textContent = (data.pagination?.total || claims.length).toString();+ const tbody = document.getElementById('claims-table');++ if (claims.length === 0) {+ tbody.innerHTML = '<tr><td colspan="6" class="empty">No claims found for this filter</td></tr>';+ return;+ }++ tbody.innerHTML = claims.map(c => {+ const typeClass = c.isCashback ? 'tag-claim' : 'tag-buy';+ const typeLabel = c.isCashback ? 'Cashback' : c.claimType || 'Creator Fee';+ return `+ <tr>+ <td>${new Date(c.timestamp).toLocaleString()}</td>+ <td><a class="addr" href="https://solscan.io/account/${escapeHtml(c.claimerWallet)}" target="_blank">${shortAddr(c.claimerWallet)}</a></td>+ <td><span class="tag ${typeClass}">${escapeHtml(typeLabel)}</span></td>+ <td>${escapeHtml(c.tokenSymbol || c.tokenName || shortAddr(c.tokenMint || ''))}</td>+ <td style="color:var(--accent)">${(c.amountSol || 0).toFixed(4)} SOL</td>+ <td><a class="addr" href="https://solscan.io/tx/${escapeHtml(c.txSignature)}" target="_blank">${shortAddr(c.txSignature || '')}</a></td>+ </tr>`;+ }).join('');+ } catch {+ toast('Failed to load claims', 'error');+ }+}++function exportClaims() {+ // Grab current table data and export as CSV+ const rows = document.querySelectorAll('#claims-table tr');+ if (rows.length === 0) return;+ let csv = 'Time,Wallet,Type,Token,Amount SOL,TX\n';+ rows.forEach(tr => {+ const cells = tr.querySelectorAll('td');+ if (cells.length >= 6) {+ csv += Array.from(cells).map(c => '"' + c.textContent.trim().replace(/"/g, '""') + '"').join(',') + '\n';+ }+ });+ const blob = new Blob([csv], { type: 'text/csv' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = 'pumpfun-claims-' + new Date().toISOString().slice(0,10) + '.csv';+ a.click();+ URL.revokeObjectURL(url);+ toast('Claims exported', 'success');+}++// ── Token Scanner ─────────────────────────────────────────────────────++async function scanToken() {+ const mint = document.getElementById('scanner-mint').value.trim();+ if (!mint) { toast('Enter a token mint address', 'error'); return; }++ document.getElementById('scanner-results').style.display = 'none';++ try {+ // Call scan-token and check-honeypot APIs in parallel+ const [scanResp, honeypotResp] = await Promise.all([+ fetch(state.rpcUrl, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'getAccountInfo', params: [mint, { encoding: 'jsonParsed' }] }),+ }),+ fetch(state.rpcUrl, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'getTokenLargestAccounts', params: [mint] }),+ }),+ ]);++ const scanData = await scanResp.json();+ const holdersData = await honeypotResp.json();++ const account = scanData.result?.value;+ if (!account) {+ toast('Token not found on-chain', 'error');+ return;+ }++ const info = account.data?.parsed?.info || {};+ const holders = holdersData.result?.value || [];++ // Compute checks+ const checks = {};+ let score = 100;+ const flags = [];++ // Program check+ const owner = account.owner;+ checks.program = { status: 'info', detail: owner === 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ? 'SPL Token' : owner === 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' ? 'Token-2022' : owner };++ // Mint authority+ if (info.mintAuthority) {+ checks.mintAuth = { status: 'warn', detail: 'Active: ' + shortAddr(info.mintAuthority) };+ score -= 15; flags.push('mint_authority');+ } else {+ checks.mintAuth = { status: 'pass', detail: 'Revoked' };+ }++ // Freeze authority+ if (info.freezeAuthority) {+ checks.freezeAuth = { status: 'fail', detail: 'Active: ' + shortAddr(info.freezeAuthority) };+ score -= 25; flags.push('freeze_authority');+ } else {+ checks.freezeAuth = { status: 'pass', detail: 'None' };+ }++ // Top holder concentration+ const totalSupply = Number(info.supply || 0);+ let topConc = 0;+ if (holders.length > 0 && totalSupply > 0) {+ topConc = parseFloat(((Number(holders[0].amount || 0) / totalSupply) * 100).toFixed(2));+ }+ if (topConc > 50) {+ checks.concentration = { status: 'warn', detail: `Top holder: ${topConc}%` };+ score -= 10; flags.push('high_concentration');+ } else {+ checks.concentration = { status: 'pass', detail: `Top holder: ${topConc}%` };+ }++ // Supply+ const decimals = info.decimals || 0;+ const displaySupply = (Number(info.supply || 0) / Math.pow(10, decimals)).toLocaleString();+ checks.supply = { status: 'info', detail: `${displaySupply} (${decimals} decimals)` };++ // Check PumpFun bonding curve+ let isPump = false;+ try {+ const bcResp = await fetch(state.rpcUrl, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 3, method: 'getProgramAccounts', params: [+ '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P',+ { filters: [{ memcmp: { offset: 30, bytes: mint } }], dataSlice: { offset: 0, length: 1 } },+ ] }),+ });+ const bcData = await bcResp.json();+ isPump = bcData.result && bcData.result.length > 0;+ } catch { /* skip */ }++ if (isPump) {+ checks.pumpfun = { status: 'pass', detail: 'Bonding curve active — sells guaranteed by AMM' };+ score = Math.min(score + 10, 100);+ } else {+ checks.pumpfun = { status: 'info', detail: 'Not a PumpFun token' };+ }++ const riskLevel = score >= 80 ? 'low' : score >= 50 ? 'medium' : 'high';+ const riskColor = score >= 80 ? 'green' : score >= 50 ? 'yellow' : 'red';++ // Display results+ document.getElementById('scan-score').textContent = score + '/100';+ document.getElementById('scan-score').className = 'value ' + riskColor;+ document.getElementById('scan-level').textContent = riskLevel.toUpperCase();+ document.getElementById('scan-level').className = 'value ' + riskColor;+ document.getElementById('scan-pump').textContent = isPump ? 'Yes ✅' : 'No';+ document.getElementById('scan-pump').className = 'value ' + (isPump ? 'green' : '');+ document.getElementById('scan-honeypot').textContent = (info.freezeAuthority ? 'Risk ⚠️' : 'Safe') + (isPump ? ' (AMM backed)' : '');+ document.getElementById('scan-honeypot').className = 'value ' + (info.freezeAuthority ? 'red' : 'green');++ const statusIcons = { pass: '✅', warn: '⚠️', fail: '❌', info: 'ℹ️' };+ const tbody = document.getElementById('scan-checks');+ tbody.innerHTML = Object.entries(checks).map(([name, c]) => `+ <tr>+ <td>${escapeHtml(name)}</td>+ <td>${statusIcons[c.status] || '?'} ${c.status.toUpperCase()}</td>+ <td>${escapeHtml(c.detail)}</td>+ </tr>+ `).join('');++ document.getElementById('scanner-results').style.display = '';+ toast('Scan complete: ' + riskLevel + ' risk', riskLevel === 'high' ? 'error' : 'success');+ } catch (e) {+ toast('Scan failed: ' + (e.message || 'Network error'), 'error');+ }+}++// ── Quote Engine ──────────────────────────────────────────────────────++async function getBuyQuote() {+ const mint = document.getElementById('quote-buy-mint').value.trim();+ const solAmount = parseFloat(document.getElementById('quote-buy-amount').value);+ if (!mint) { toast('Enter token mint', 'error'); return; }++ const resultDiv = document.getElementById('quote-buy-result');+ resultDiv.innerHTML = '<span style="color:#888">Calculating...</span>';++ try {+ // Fetch bonding curve state from RPC+ const bcResp = await fetch(state.rpcUrl, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'getProgramAccounts', params: [+ '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P',+ { filters: [{ memcmp: { offset: 30, bytes: mint } }], encoding: 'base64' },+ ] }),+ });+ const bcData = await bcResp.json();++ if (!bcData.result || bcData.result.length === 0) {+ resultDiv.innerHTML = '<span style="color:var(--red)">No bonding curve found — token may be graduated or invalid</span>';+ return;+ }++ const lamports = Math.floor(solAmount * 1e9);+ resultDiv.innerHTML = `+ <div style="padding:12px;background:var(--bg);border-radius:var(--radius);border:1px solid var(--border);">+ <div style="color:#888;font-size:11px">Estimated Output</div>+ <div style="color:var(--accent);font-size:18px;margin:4px 0">Bonding curve found ✅</div>+ <div style="color:#888;font-size:11px">Input: ${solAmount} SOL (${lamports.toLocaleString()} lamports)</div>+ <div style="color:#888;font-size:11px">Use the SDK for precise quote calculation</div>+ </div>+ `;+ } catch (e) {+ resultDiv.innerHTML = `<span style="color:var(--red)">Error: ${escapeHtml(e.message || 'RPC failed')}</span>`;+ }+}++async function getSellQuote() {+ const mint = document.getElementById('quote-sell-mint').value.trim();+ const tokenAmount = parseInt(document.getElementById('quote-sell-amount').value);+ if (!mint) { toast('Enter token mint', 'error'); return; }++ const resultDiv = document.getElementById('quote-sell-result');+ resultDiv.innerHTML = '<span style="color:#888">Calculating...</span>';++ try {+ const bcResp = await fetch(state.rpcUrl, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'getProgramAccounts', params: [+ '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P',+ { filters: [{ memcmp: { offset: 30, bytes: mint } }], encoding: 'base64' },+ ] }),+ });+ const bcData = await bcResp.json();++ if (!bcData.result || bcData.result.length === 0) {+ resultDiv.innerHTML = '<span style="color:var(--red)">No bonding curve found</span>';+ return;+ }++ resultDiv.innerHTML = `+ <div style="padding:12px;background:var(--bg);border-radius:var(--radius);border:1px solid var(--border);">+ <div style="color:#888;font-size:11px">Estimated Output</div>+ <div style="color:var(--accent);font-size:18px;margin:4px 0">Bonding curve found ✅</div>+ <div style="color:#888;font-size:11px">Input: ${tokenAmount.toLocaleString()} tokens</div>+ <div style="color:#888;font-size:11px">Use the SDK for precise quote calculation</div>+ </div>+ `;+ } catch (e) {+ resultDiv.innerHTML = `<span style="color:var(--red)">Error: ${escapeHtml(e.message || 'RPC failed')}</span>`;+ }+}++// ── Vanity Generator ──────────────────────────────────────────────────++let vanityRunning = false;++function startVanity() {+ const prefix = document.getElementById('vanity-prefix').value.trim();+ const suffix = document.getElementById('vanity-suffix').value.trim();++ if (!prefix && !suffix) {+ toast('Enter a prefix or suffix', 'error');+ return;+ }++ vanityRunning = true;+ document.getElementById('vanity-start').style.display = 'none';+ document.getElementById('vanity-stop').style.display = '';+ document.getElementById('vanity-status').textContent = 'Generating... (this runs in the browser, ~1K keys/sec)';+ document.getElementById('vanity-result').innerHTML = '';++ // Use Web Worker-style approach (inline for simplicity)+ let attempts = 0;+ const base58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';++ function generateBatch() {+ if (!vanityRunning) return;++ // Generate random base58 addresses (simulation — real generation needs tweetnacl)+ for (let i = 0; i < 100; i++) {+ attempts++;+ let addr = '';+ for (let j = 0; j < 44; j++) {+ addr += base58chars[Math.floor(Math.random() * base58chars.length)];+ }++ const matchPrefix = !prefix || addr.toLowerCase().startsWith(prefix.toLowerCase());+ const matchSuffix = !suffix || addr.toLowerCase().endsWith(suffix.toLowerCase());++ if (matchPrefix && matchSuffix) {+ vanityRunning = false;+ document.getElementById('vanity-start').style.display = '';+ document.getElementById('vanity-stop').style.display = 'none';+ document.getElementById('vanity-status').textContent = `Found after ${attempts.toLocaleString()} attempts`;+ document.getElementById('vanity-result').innerHTML = `+ <div style="padding:12px;background:var(--bg);border-radius:var(--radius);border:1px solid var(--accent-dim);">+ <div style="color:#888;font-size:11px">Generated Address (demo)</div>+ <div style="color:var(--accent);font-size:14px;margin:4px 0;word-break:break-all">${addr}</div>+ <div style="color:var(--red);font-size:10px;margin-top:8px">⚠ This is a demo. Use the Rust vanity generator for production keypairs.</div>+ </div>+ `;+ toast('Vanity address found!', 'success');+ return;+ }+ }++ document.getElementById('vanity-status').textContent = `Searching... ${attempts.toLocaleString()} attempts`;+ if (vanityRunning) requestAnimationFrame(generateBatch);+ }++ requestAnimationFrame(generateBatch);+}++function stopVanity() {+ vanityRunning = false;+ document.getElementById('vanity-start').style.display = '';+ document.getElementById('vanity-stop').style.display = 'none';+ document.getElementById('vanity-status').textContent = 'Stopped';+}++// ── Config ────────────────────────────────────────────────────────────++function saveConfig() {+ state.apiUrl = document.getElementById('cfg-api-url').value.trim();+ state.wsUrl = document.getElementById('cfg-ws-url').value.trim();+ state.apiKey = document.getElementById('cfg-api-key').value.trim();+ state.rpcUrl = document.getElementById('cfg-rpc-url').value.trim();++ localStorage.setItem('pumpbot-api-url', state.apiUrl);+ localStorage.setItem('pumpbot-ws-url', state.wsUrl);+ localStorage.setItem('pumpbot-api-key', state.apiKey);+ localStorage.setItem('pumpbot-rpc-url', state.rpcUrl);++ document.getElementById('api-endpoint-display').textContent = state.apiUrl + '/api/v1';++ // Reconnect+ connectApi();+ connectWebSocket();++ toast('Configuration saved & reconnecting', 'success');+}++// ── Modals ────────────────────────────────────────────────────────────++function openModal(id) {+ document.getElementById(id).classList.add('open');+}++function closeModal(id) {+ document.getElementById(id).classList.remove('open');+}++// Close modal on backdrop click+document.addEventListener('click', e => {+ if (e.target.classList.contains('modal-backdrop')) {+ e.target.classList.remove('open');+ }+});++// ── Toast ─────────────────────────────────────────────────────────────++function toast(msg, type = '') {+ const container = document.getElementById('toasts');+ const div = document.createElement('div');+ div.className = 'toast ' + type;+ div.textContent = msg;+ container.appendChild(div);+ setTimeout(() => div.remove(), 4000);+}++// ── Utilities ─────────────────────────────────────────────────────────++function shortAddr(addr) {+ if (!addr || addr.length < 8) return addr || '';+ return addr.slice(0, 4) + '…' + addr.slice(-4);+}++function escapeHtml(str) {+ if (!str) return '';+ return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');+}+</script>+</body>+</html>diff --git a/pump-live.html b/pump-live.htmlnew file mode 100644index 000000000..c6a66ce0c--- /dev/null+++ b/pump-live.html@@ -0,0 +1,822 @@+<!DOCTYPE html>+<html lang="en">+<head>+<meta charset="UTF-8">+<meta name="viewport" content="width=device-width, initial-scale=1.0">+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🟢</text></svg>">+<title>PumpFun Live — New Token Launches</title>+<style>+ * { margin: 0; padding: 0; box-sizing: border-box; }+ body {+ background: #0a0a0a;+ color: #00ff41;+ font-family: 'Courier New', monospace;+ font-size: 13px;+ line-height: 1.5;+ padding: 0;+ }++ /* ── Header ────────────────────────────────────────── */+ #header {+ background: #111;+ border-bottom: 1px solid #222;+ padding: 12px 20px;+ display: flex;+ align-items: center;+ gap: 16px;+ flex-wrap: wrap;+ position: sticky;+ top: 0;+ z-index: 10;+ }+ #header h1 {+ font-size: 16px;+ color: #00ff41;+ white-space: nowrap;+ }+ #header .status {+ font-size: 12px;+ color: #666;+ }+ #header .status.connected { color: #00ff41; }+ #header .status.error { color: #ff4141; }+ #header .controls {+ margin-left: auto;+ display: flex;+ gap: 8px;+ align-items: center;+ }+ input[type="text"] {+ background: #1a1a1a;+ border: 1px solid #333;+ color: #ccc;+ padding: 6px 10px;+ font-family: inherit;+ font-size: 12px;+ width: 340px;+ border-radius: 3px;+ }+ input[type="text"]:focus { outline: none; border-color: #00ff41; }+ button {+ background: #1a1a1a;+ border: 1px solid #333;+ color: #00ff41;+ padding: 6px 14px;+ cursor: pointer;+ font-family: inherit;+ font-size: 12px;+ border-radius: 3px;+ }+ button:hover { background: #252525; border-color: #00ff41; }+ button.active { background: #002200; border-color: #00ff41; }++ /* ── Stats bar ─────────────────────────────────────── */+ #stats {+ background: #0d0d0d;+ border-bottom: 1px solid #1a1a1a;+ padding: 6px 20px;+ font-size: 11px;+ color: #555;+ display: flex;+ gap: 24px;+ }+ #stats span { color: #888; }+ #stats .val { color: #00ff41; }++ /* ── Log area ──────────────────────────────────────── */+ #log {+ padding: 12px 20px;+ max-height: calc(100vh - 110px);+ overflow-y: auto;+ }+ .entry {+ border-bottom: 1px solid #111;+ padding: 8px 0;+ animation: fadeIn 0.3s ease;+ }+ @keyframes fadeIn {+ from { opacity: 0; transform: translateY(-4px); }+ to { opacity: 1; transform: translateY(0); }+ }++ .entry .time { color: #444; }+ .entry .label { color: #888; }+ .entry .name { color: #ffcc00; font-weight: bold; font-size: 15px; }+ .entry .symbol { color: #ff9900; font-weight: bold; }+ .entry .addr { color: #4a9eff; }+ .entry .github { color: #00ff41; font-weight: bold; }+ .entry .raw { color: #333; font-size: 11px; word-break: break-all; display: none; }+ .entry a { color: #4a9eff; text-decoration: none; }+ .entry a:hover { text-decoration: underline; }++ .entry .token-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }+ .entry .token-img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #333; object-fit: cover; background: #111; }+ .entry .token-details { flex: 1; min-width: 0; }+ .entry .meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #666; margin-top: 3px; }+ .entry .meta-row .key { color: #555; }+ .entry .meta-row .val { color: #aaa; }+ .entry .meta-row .val.green { color: #00ff41; }+ .entry .meta-row .val.blue { color: #4a9eff; }+ .entry .meta-row a { font-size: 11px; }+ .entry .sol-val { color: #00e5ff; font-weight: bold; }+ .entry .mcap { color: #b366ff; font-weight: bold; }++ .sys { color: #555; padding: 4px 0; }+ .sys.error { color: #ff4141; }+ .sys.warn { color: #ffcc00; }++ /* ── Scrollbar ─────────────────────────────────────── */+ ::-webkit-scrollbar { width: 6px; }+ ::-webkit-scrollbar-track { background: #0a0a0a; }+ ::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }+ ::-webkit-scrollbar-thumb:hover { background: #333; }++ /* ── Responsive ────────────────────────────────────── */+ @media (max-width: 700px) {+ input[type="text"] { width: 100%; }+ #header { flex-direction: column; align-items: flex-start; }+ #header .controls { margin-left: 0; width: 100%; flex-wrap: wrap; }+ }+</style>+</head>+<body>++<div id="header">+ <h1>⚡ PumpFun Live</h1>+ <a href="/trades" style="color:#4a9eff; text-decoration:none; font-size:12px; border:1px solid #333; padding:4px 10px; border-radius:3px;">📊 Trades Dashboard</a>+ <a href="/vanity" style="color:#ffcc00; text-decoration:none; font-size:12px; border:1px solid #333; padding:4px 10px; border-radius:3px;">🔑 Vanity Generator</a>+ <div class="status" id="status">● Disconnected</div>+ <div class="controls">+ <input type="text" id="rpc" value="" placeholder="wss:// custom RPC" style="display:none" />+ <button id="btn-connect">Disconnect</button>+ <button id="btn-pause">Pause</button>+ <button id="btn-clear">Clear</button>+ </div>+</div>++<div id="stats">+ <div>Tokens: <span class="val" id="s-total">0</span></div>+ <div>With GitHub: <span class="val" id="s-github">0</span></div>+ <div>Viewers: <span class="val" id="s-viewers">—</span></div>+ <div>Logs/sec: <span class="val" id="s-rate">0</span></div>+ <div>Uptime: <span class="val" id="s-uptime">0s</span></div>+</div>++<div id="log"></div>++<script>+// ════════════════════════════════════════════════════════════════════+// PumpFun Live Token Launch WebSocket Monitor+// Connects to a Solana RPC WebSocket and subscribes to Pump program+// logs. Detects createV2 token launches in real-time.+// ════════════════════════════════════════════════════════════════════++const PUMP_PROGRAM = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P';+const MAX_LOG_ENTRIES = 500;++// ── Endpoints (PumpPortal primary, relay fallback) ──────────────+// PumpPortal is a free, purpose-built WebSocket API for Pump.fun.+// The Railway relay server proxies Solana RPC logsSubscribe server-side+// and re-broadcasts parsed events, avoiding public RPC rate limits.+const RPC_ENDPOINTS = [+ { url: 'wss://pumpportal.fun/api/data', protocol: 'pumpportal', label: 'PumpPortal' },+ { url: 'wss://pump-fun-websocket-production.up.railway.app/ws', protocol: 'relay', label: 'Relay Server' },+];+let rpcIndex = 0;+let connectAttempts = 0;+let currentProtocol = null;++// ── State ───────────────────────────────────────────────────────────+let ws = null;+let subId = null;+let paused = false;+let startTime = 0;+let stats = { total: 0, github: 0, logsReceived: 0, lastSecondLogs: 0 };+let rateInterval = null;+let reconnectDelay = 1000; // starts at 1s, doubles up to 30s+let reconnectTimer = null;+let manualDisconnect = false;++// ── DOM refs ────────────────────────────────────────────────────────+const $log = document.getElementById('log');+const $status = document.getElementById('status');+const $rpc = document.getElementById('rpc');+const $btnConnect = document.getElementById('btn-connect');+const $btnPause = document.getElementById('btn-pause');+const $btnClear = document.getElementById('btn-clear');++// ── Buttons ─────────────────────────────────────────────────────────+$btnPause.onclick = () => {+ paused = !paused;+ $btnPause.textContent = paused ? 'Resume' : 'Pause';+ $btnPause.classList.toggle('active', paused);+ sysLog(paused ? 'Paused — events still tracked, display frozen' : 'Resumed');+};+$btnConnect.onclick = () => {+ if (ws) {+ disconnect();+ $btnConnect.textContent = 'Connect';+ } else {+ manualDisconnect = false;+ reconnectDelay = 1000;+ connectAttempts = 0;+ connect();+ }+};+$btnClear.onclick = () => { $log.innerHTML = ''; };++// ── Connect to WebSocket (PumpPortal or Solana RPC) ───────────────+function getNextEndpoint() {+ const custom = $rpc.value.trim();+ if (custom && custom.startsWith('wss://')) {+ const proto = custom.includes('pumpportal') ? 'pumpportal' : 'solana-rpc';+ return { url: custom, protocol: proto, label: 'Custom' };+ }+ const ep = RPC_ENDPOINTS[rpcIndex % RPC_ENDPOINTS.length];+ rpcIndex++;+ return ep;+}++function connect() {+ if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }+ const ep = getNextEndpoint();+ const url = ep.url;+ currentProtocol = ep.protocol;+ const shortUrl = url.replace(/api-key=\w+/, 'api-key=***').slice(0, 60);+ setStatus('Connecting...', '');+ $btnConnect.textContent = 'Disconnect';+ connectAttempts++;+ sysLog(`Connecting to ${ep.label} (${shortUrl})...`);++ try {+ ws = new WebSocket(url);+ } catch (e) {+ sysLog(`Invalid URL: ${e.message}`, 'error');+ scheduleReconnect();+ return;+ }++ const connectTimeout = setTimeout(() => {+ if (ws && ws.readyState !== WebSocket.OPEN) {+ sysLog(`Timeout on ${ep.label}, trying next...`, 'warn');+ try { ws.close(); } catch {}+ }+ }, 10000);++ ws.onopen = () => {+ clearTimeout(connectTimeout);+ reconnectDelay = 1000;+ connectAttempts = 0;+ if (!startTime) startTime = Date.now();+ startRateCounter();++ if (currentProtocol === 'pumpportal') {+ // PumpPortal: subscribe to new token creates+ ws.send(JSON.stringify({ method: 'subscribeNewToken' }));+ setStatus(`● Live — PumpPortal`, 'connected');+ sysLog('Subscribed via PumpPortal — streaming new token launches');+ } else if (currentProtocol === 'relay') {+ // Railway relay: already subscribed server-side, just listen+ setStatus('● Live — Relay', 'connected');+ sysLog('Connected to relay server — receiving proxied token launches');+ } else {+ // Solana RPC: subscribe to program logs+ setStatus('● Connected — subscribing to Pump program...', 'connected');+ ws.send(JSON.stringify({+ jsonrpc: '2.0', id: 1,+ method: 'logsSubscribe',+ params: [{ mentions: [PUMP_PROGRAM] }, { commitment: 'confirmed' }],+ }));+ }+ };++ ws.onmessage = (evt) => {+ let msg;+ try { msg = JSON.parse(evt.data); } catch { return; }++ if (currentProtocol === 'relay') {+ // Relay server sends { type:'token-launch', mint, name, symbol, ... }+ if (msg.type === 'heartbeat') return;+ if (msg.type === 'status') {+ if (typeof msg.clients === 'number') {+ document.getElementById('s-viewers').textContent = msg.clients;+ }+ return;+ }+ if (msg.type === 'token-launch' || msg.mint) {+ stats.logsReceived++;+ const info = {+ signature: msg.signature || '',+ time: new Date().toLocaleTimeString(),+ name: msg.name || null,+ symbol: msg.symbol || null,+ metadataUri: msg.metadataUri || null,+ mint: msg.mint || 'unknown',+ creator: msg.creator || null,+ user: msg.creator || null,+ hasGithub: msg.hasGithub || false,+ githubUrls: msg.githubUrls || [],+ rawLogs: [],+ isV2: msg.isV2 !== false,+ imageUrl: msg.imageUri || null,+ };+ stats.total++;+ if (info.hasGithub) stats.github++;+ if (!paused) renderEntry(info);+ updateStats();+ }+ return;+ }++ if (currentProtocol === 'pumpportal') {+ // PumpPortal sends flat objects: { txType:'create', mint, name, symbol, uri, signature, ... }+ if (msg && msg.mint) {+ stats.logsReceived++;+ const vSol = msg.vSolInBondingCurve || 0;+ const vTok = msg.vTokensInBondingCurve || 0;+ const supply = msg.tokenTotalSupply || (vTok > 0 ? 1e15 : 0);+ let mcap = msg.marketCapSol || 0;+ if (!mcap && vTok > 0 && vSol > 0) {+ mcap = (vSol / vTok) * supply / 1e9;+ }+ const info = {+ signature: msg.signature || '',+ time: new Date().toLocaleTimeString(),+ name: msg.name || null,+ symbol: msg.symbol || null,+ metadataUri: msg.uri || null,+ mint: msg.mint,+ bondingCurve: msg.bondingCurveKey || null,+ creator: msg.traderPublicKey || null,+ user: msg.traderPublicKey || null,+ hasGithub: false,+ githubUrls: [],+ rawLogs: [],+ isV2: true,+ virtualTokenReserves: vTok,+ virtualSolReserves: vSol,+ realTokenReserves: 0,+ tokenTotalSupply: supply,+ marketCapSol: mcap,+ imageUrl: null,+ };+ stats.total++;+ if (info.metadataUri && info.metadataUri.includes('github.com')) {+ info.hasGithub = true;+ stats.github++;+ }+ if (info.metadataUri) fetchMetadata(info.metadataUri, info.signature);+ if (!paused) renderEntry(info);+ updateStats();+ }+ return;+ }++ // ── Solana RPC protocol ──+ // Subscription confirmation+ if (msg.id === 1 && msg.result !== undefined) {+ subId = msg.result;+ setStatus(`● Live — subscriptionId: ${subId}`, 'connected');+ sysLog(`Subscribed to ${PUMP_PROGRAM} (sub=${subId}). Waiting for token launches...`);+ return;+ }++ // RPC error (rejected subscription)+ if (msg.id === 1 && msg.error) {+ sysLog(`RPC rejected logsSubscribe: ${msg.error.message || JSON.stringify(msg.error)}`, 'error');+ sysLog('Tip: public RPCs rate-limit this. PumpPortal is recommended.', 'warn');+ try { ws.close(); } catch {}+ return;+ }++ // Log notification+ if (msg.method === 'logsNotify' && msg.params?.result) {+ stats.logsReceived++;+ handleLogNotification(msg.params.result);+ }+ };++ ws.onerror = (err) => {+ clearTimeout(connectTimeout);+ setStatus('● Error', 'error');+ sysLog(`WebSocket error on ${ep.label}`, 'error');+ console.error('WS Error:', err);+ };++ ws.onclose = (evt) => {+ clearTimeout(connectTimeout);+ ws = null;+ subId = null;+ currentProtocol = null;+ if (!manualDisconnect) {+ scheduleReconnect();+ } else {+ setStatus('● Disconnected', '');+ sysLog(`Disconnected (code=${evt.code}).`);+ $btnConnect.textContent = 'Connect';+ stopRateCounter();+ }+ };+}++function scheduleReconnect() {+ const delay = Math.min(reconnectDelay, 15000);+ const nextEp = RPC_ENDPOINTS[rpcIndex % RPC_ENDPOINTS.length];+ setStatus(`● Retrying ${(delay / 1000).toFixed(0)}s → ${nextEp.label}`, 'error');+ sysLog(`Trying ${nextEp.label} in ${(delay / 1000).toFixed(0)}s...`, 'warn');+ reconnectTimer = setTimeout(connect, delay);+ if (connectAttempts >= RPC_ENDPOINTS.length) {+ reconnectDelay = Math.min(reconnectDelay * 1.5, 15000);+ }+}++function disconnect() {+ manualDisconnect = true;+ if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }+ if (ws) {+ if (subId !== null) {+ try { ws.send(JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'logsUnsubscribe', params: [subId] })); } catch {}+ }+ ws.close();+ }+}++// ── Handle incoming log notifications ───────────────────────────────+function handleLogNotification(result) {+ const { value } = result;+ if (!value || value.err) return;++ const { signature, logs } = value;+ if (!logs || !Array.isArray(logs)) return;++ const logsText = logs.join('\n');++ // Detect token creation: look for Create or CreateV2 instruction+ const isCreate = logsText.includes('Instruction: Create');+ if (!isCreate) return;++ // ── Parse what we can from the raw logs ─────────────────────────+ const info = parseCreateLogs(logs, signature);+ stats.total++;++ // Check if we can find a GitHub reference in the logs (unlikely from+ // raw logs, but metadata URI might be visible in Program data)+ if (info.metadataUri && info.metadataUri.includes('github.com')) {+ info.hasGithub = true;+ stats.github++;+ }++ // Try fetching metadata in background (best-effort)+ if (info.metadataUri) {+ fetchMetadata(info.metadataUri, signature);+ }++ if (!paused) renderEntry(info);+ updateStats();+}++// ── Base58 encoder ──────────────────────────────────────────────────+const B58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';+function bytesToBase58(bytes) {+ let num = BigInt(0);+ for (const b of bytes) num = num * 256n + BigInt(b);+ if (num === 0n) return '1';+ let str = '';+ while (num > 0n) { str = B58[Number(num % 58n)] + str; num /= 58n; }+ for (const b of bytes) { if (b === 0) str = '1' + str; else break; }+ return str;+}++// ── Borsh reader for Anchor CreateEvent ─────────────────────────────+function readBorshString(buf, offset) {+ if (offset + 4 > buf.length) return { val: '', end: offset };+ const len = buf[offset] | (buf[offset+1] << 8) | (buf[offset+2] << 16) | (buf[offset+3] << 24);+ offset += 4;+ if (len <= 0 || len > 1000 || offset + len > buf.length) return { val: '', end: offset };+ const val = new TextDecoder().decode(buf.slice(offset, offset + len));+ return { val, end: offset + len };+}++function readPubkey(buf, offset) {+ if (offset + 32 > buf.length) return { val: '', end: offset };+ return { val: bytesToBase58(buf.slice(offset, offset + 32)), end: offset + 32 };+}++function readU64(buf, offset) {+ if (offset + 8 > buf.length) return { val: 0, end: offset };+ const view = new DataView(buf.buffer, buf.byteOffset + offset, 8);+ return { val: Number(view.getBigUint64(0, true)), end: offset + 8 };+}++function readI64(buf, offset) {+ if (offset + 8 > buf.length) return { val: 0, end: offset };+ const view = new DataView(buf.buffer, buf.byteOffset + offset, 8);+ return { val: Number(view.getBigInt64(0, true)), end: offset + 8 };+}++// ── Parse create instruction data from logs ─────────────────────────+function parseCreateLogs(logs, signature) {+ const info = {+ signature,+ time: new Date().toLocaleTimeString(),+ name: null,+ symbol: null,+ metadataUri: null,+ mint: null,+ bondingCurve: null,+ creator: null,+ user: null,+ hasGithub: false,+ githubUrls: [],+ rawLogs: logs,+ isV2: false,+ virtualTokenReserves: 0,+ virtualSolReserves: 0,+ realTokenReserves: 0,+ tokenTotalSupply: 0,+ marketCapSol: 0,+ imageUrl: null,+ };++ for (const line of logs) {+ if (line.includes('Instruction: CreateV2')) info.isV2 = true;+ else if (line.includes('Instruction: Create') && !info.isV2) info.isV2 = false;++ // Decode Anchor CreateEvent from Program data+ if (line.startsWith('Program data: ')) {+ try {+ const b64 = line.slice('Program data: '.length).trim();+ const raw = Uint8Array.from(atob(b64), c => c.charCodeAt(0));++ // Skip 8-byte Anchor event discriminator+ let off = 8;+ if (raw.length < 50) continue; // too short for CreateEvent++ // Read strings: name, symbol, uri+ const name = readBorshString(raw, off); off = name.end;+ const symbol = readBorshString(raw, off); off = symbol.end;+ const uri = readBorshString(raw, off); off = uri.end;++ // Read pubkeys: mint, bondingCurve, user+ const mint = readPubkey(raw, off); off = mint.end;+ const bc = readPubkey(raw, off); off = bc.end;+ const user = readPubkey(raw, off); off = user.end;++ // Creator pubkey (only in newer events)+ let creator = { val: '', end: off };+ if (off + 32 <= raw.length) {+ creator = readPubkey(raw, off); off = creator.end;+ }++ // Timestamp (i64)+ let timestamp = { val: 0, end: off };+ if (off + 8 <= raw.length) {+ timestamp = readI64(raw, off); off = timestamp.end;+ }++ // virtualTokenReserves, virtualSolReserves, realTokenReserves, tokenTotalSupply+ let vTok = { val: 0, end: off };+ let vSol = { val: 0, end: off };+ let rTok = { val: 0, end: off };+ let supply = { val: 0, end: off };+ if (off + 32 <= raw.length) {+ vTok = readU64(raw, off); off = vTok.end;+ vSol = readU64(raw, off); off = vSol.end;+ rTok = readU64(raw, off); off = rTok.end;+ supply = readU64(raw, off); off = supply.end;+ }++ // Populate info with decoded data+ if (name.val) info.name = name.val;+ if (symbol.val) info.symbol = symbol.val;+ if (uri.val) info.metadataUri = uri.val;+ if (mint.val && mint.val.length >= 32) info.mint = mint.val;+ if (bc.val && bc.val.length >= 32) info.bondingCurve = bc.val;+ if (user.val && user.val.length >= 32) info.user = user.val;+ if (creator.val && creator.val.length >= 32) info.creator = creator.val;+ info.virtualTokenReserves = vTok.val;+ info.virtualSolReserves = vSol.val;+ info.realTokenReserves = rTok.val;+ info.tokenTotalSupply = supply.val;++ // Calculate market cap in SOL: vSol * totalSupply / vToken / 1e9+ if (vTok.val > 0 && vSol.val > 0 && supply.val > 0) {+ const price = vSol.val / vTok.val;+ info.marketCapSol = (price * supply.val) / 1e9;+ }+ } catch { /* ignore decode errors */ }+ }++ // Fallback: mint from log line+ if (line.includes('Program log: mint:') && !info.mint) {+ const m = line.match(/mint:\s*(\w{32,})/);+ if (m) info.mint = m[1];+ }+ }++ return info;+}++// ── Fetch token metadata (best-effort, non-blocking) ────────────────+async function fetchMetadata(uri, signature) {+ try {+ // Normalize IPFS URIs+ let url = uri;+ if (url.startsWith('ipfs://')) {+ url = 'https://cf-ipfs.com/ipfs/' + url.slice(7);+ }++ const resp = await fetch(url, { signal: AbortSignal.timeout(5000) });+ if (!resp.ok) return;++ const meta = await resp.json();+ const githubUrls = extractGithubUrls(meta);++ if (githubUrls.length > 0) {+ stats.github++;+ updateStats();++ // Update the existing entry if visible+ const el = document.getElementById('tx-' + signature.slice(0, 16));+ if (el) {+ const githubDiv = document.createElement('div');+ githubDiv.innerHTML = '🌐 <span class="github">GitHub: ' ++ githubUrls.map(u => `<a href="${esc(u)}" target="_blank">${esc(u)}</a>`).join(', ') ++ '</span>';+ el.appendChild(githubDiv);+ }+ }++ // Update name/symbol/image if found+ const el = document.getElementById('tx-' + signature.slice(0, 16));+ if (el) {+ if (meta.name) {+ const nameEl = el.querySelector('.name');+ if (nameEl) nameEl.textContent = meta.name;+ }+ if (meta.symbol) {+ const symEl = el.querySelector('.symbol');+ if (symEl) symEl.textContent = '$' + meta.symbol;+ }+ if (meta.image) {+ let imgSrc = meta.image;+ if (imgSrc.startsWith('ipfs://')) imgSrc = 'https://cf-ipfs.com/ipfs/' + imgSrc.slice(7);+ const imgEl = el.querySelector('.token-img');+ if (imgEl) { imgEl.src = imgSrc; imgEl.style.display = 'block'; }+ }+ if (meta.description) {+ const descEl = el.querySelector('.token-desc');+ if (descEl) {+ const short = meta.description.length > 80 ? meta.description.slice(0, 80) + '…' : meta.description;+ descEl.textContent = short;+ descEl.style.display = 'block';+ }+ }+ }+ } catch { /* metadata fetch is best-effort */ }+}++// ── Extract GitHub URLs from metadata ───────────────────────────────+function extractGithubUrls(meta) {+ const urls = new Set();+ const ghPattern = /https?:\/\/(www\.)?github\.com\/[^\s"'<>]+/gi;++ function scan(val) {+ if (typeof val === 'string') {+ const matches = val.match(ghPattern);+ if (matches) matches.forEach(u => urls.add(u));+ } else if (val && typeof val === 'object') {+ Object.values(val).forEach(scan);+ }+ }+ scan(meta);+ return [...urls];+}++// ── Format helpers ──────────────────────────────────────────────────+function fmtSol(lamports) {+ if (!lamports || lamports <= 0) return null;+ const sol = lamports / 1e9;+ if (sol >= 1000) return sol.toFixed(0) + ' SOL';+ if (sol >= 1) return sol.toFixed(2) + ' SOL';+ return sol.toFixed(4) + ' SOL';+}+function fmtMcap(sol) {+ if (!sol || sol <= 0) return null;+ if (sol >= 1000) return sol.toFixed(0) + ' SOL';+ if (sol >= 1) return sol.toFixed(2) + ' SOL';+ return sol.toFixed(4) + ' SOL';+}+function shortAddr(addr) {+ if (!addr || addr.length < 10) return addr || '';+ return addr.slice(0, 4) + '…' + addr.slice(-4);+}++// ── Render a token launch entry ─────────────────────────────────────+function renderEntry(info) {+ const div = document.createElement('div');+ div.className = 'entry';+ div.id = 'tx-' + info.signature.slice(0, 16);++ const shortSig = info.signature.slice(0, 6) + '…' + info.signature.slice(-4);+ const version = info.isV2 ? 'CreateV2' : 'Create';+ const displayName = info.name || 'Unknown';+ const displaySymbol = info.symbol ? '$' + info.symbol : '';+ const mcap = info.marketCapSol ? fmtMcap(info.marketCapSol) : null;+ const mintFull = info.mint || '';+ const mintShort = mintFull ? shortAddr(mintFull) : '—';+ const creatorAddr = info.creator || info.user || '';+ const creatorShort = creatorAddr ? shortAddr(creatorAddr) : '';++ let html = `<div class="token-row">`;+ html += `<img class="token-img" src="" alt="" style="display:none" onerror="this.style.display='none'" />`;+ html += `<div class="token-details">`;+ html += `<div><span class="time">${info.time}</span> `;+ html += `🚀 <span class="name">${esc(displayName)}</span> `;+ html += `<span class="symbol">${esc(displaySymbol)}</span> `;+ html += `<span class="label">[${version}]</span>`;+ if (info.hasGithub) html += ` <span class="github">★ GitHub</span>`;+ html += `</div>`;++ // Description placeholder+ html += `<div class="token-desc" style="display:none; font-size:11px; color:#666; margin:2px 0;"></div>`;++ // Metadata row+ html += `<div class="meta-row">`;+ if (mintFull) html += `<span><span class="key">Mint:</span> <a href="https://pump.fun/coin/${mintFull}" target="_blank">${mintShort}</a></span>`;+ if (creatorAddr) html += `<span><span class="key">Creator:</span> <a href="https://solscan.io/account/${creatorAddr}" target="_blank">${creatorShort}</a></span>`;+ if (mcap) html += `<span><span class="key">MCap:</span> <span class="mcap">${mcap}</span></span>`;+ if (info.virtualSolReserves > 0) html += `<span><span class="key">Pool:</span> <span class="sol-val">${fmtSol(info.virtualSolReserves)}</span></span>`;+ html += `<span><a href="https://solscan.io/tx/${info.signature}" target="_blank">tx:${shortSig}</a></span>`;+ if (info.metadataUri) {+ const shortUri = info.metadataUri.length > 40 ? info.metadataUri.slice(0, 37) + '…' : info.metadataUri;+ html += `<span><a href="${esc(info.metadataUri)}" target="_blank" title="${esc(info.metadataUri)}">${esc(shortUri)}</a></span>`;+ }+ html += `</div>`;++ html += `</div></div>`; // close token-details, token-row++ div.innerHTML = html;++ $log.prepend(div);+ while ($log.children.length > MAX_LOG_ENTRIES) $log.removeChild($log.lastChild);+}++// ── System log ──────────────────────────────────────────────────────+function sysLog(msg, level = '') {+ const div = document.createElement('div');+ div.className = 'sys' + (level ? ' ' + level : '');+ div.textContent = `[${new Date().toLocaleTimeString()}] ${msg}`;+ $log.prepend(div);+}++// ── Stats ───────────────────────────────────────────────────────────+function updateStats() {+ document.getElementById('s-total').textContent = stats.total;+ document.getElementById('s-github').textContent = stats.github;+}++function startRateCounter() {+ let prev = 0;+ rateInterval = setInterval(() => {+ const rate = stats.logsReceived - prev;+ prev = stats.logsReceived;+ document.getElementById('s-rate').textContent = rate;++ if (startTime) {+ const sec = Math.floor((Date.now() - startTime) / 1000);+ const m = Math.floor(sec / 60);+ const s = sec % 60;+ document.getElementById('s-uptime').textContent = m > 0 ? `${m}m ${s}s` : `${s}s`;+ }+ }, 1000);+}++function stopRateCounter() {+ if (rateInterval) { clearInterval(rateInterval); rateInterval = null; }+}++// ── Helpers ─────────────────────────────────────────────────────────+function setStatus(text, cls) {+ $status.textContent = text;+ $status.className = 'status' + (cls ? ' ' + cls : '');+}++function esc(s) {+ const d = document.createElement('div');+ d.textContent = s || '';+ return d.innerHTML;+}++// ── Init ────────────────────────────────────────────────────────────+sysLog('PumpFun Live Monitor — always-on, auto-reconnecting');+sysLog(`Monitoring program: ${PUMP_PROGRAM}`);+sysLog('Primary: PumpPortal API (pre-parsed, no RPC limits)');+sysLog(`Fallback: ${RPC_ENDPOINTS.filter(e => e.protocol === 'solana-rpc').length} Solana RPC endpoints`);++// Connect immediately on page load+connect();+</script>+</body>+</html>+diff --git a/rider/src/components/multiplayer.js b/rider/src/components/multiplayer.jsnew file mode 100644index 000000000..b13c64d98--- /dev/null+++ b/rider/src/components/multiplayer.js@@ -0,0 +1,209 @@+const { MultiplayerClient } = require('../lib/multiplayer');++/**+ * Wires Firebase Realtime Database multiplayer rooms into the rider state.+ *+ * Async-race model: host picks song, broadcasts, all players start loading+ * locally and run on their own clock. Live scores stream into a shared room+ * node so each player can see opponents' progress. Final scores compared on+ * victory screen.+ *+ * Events consumed (on a-scene):+ * mpcreate create room as host+ * mpjoin {code} join existing room+ * mpleave leave / cleanup+ * mpready {value} toggle ready flag in lobby+ * mpsetname {value} update display name+ * mprematch host: reset room to lobby+ *+ * Events emitted (on a-scene):+ * mproomjoined {code, isHost}+ * mproomleft+ * mproomupdate {code, isHost, uid, status, song, startAt, players}+ * mpremotesongselect <songObj> non-host: host picked a song+ * mpremoteplaystart non-host: host pressed start+ * mperror {message}+ */+AFRAME.registerComponent('multiplayer', {+ schema: {+ apiKey: { type: 'string' },+ authDomain: { type: 'string' },+ databaseURL: { type: 'string' },+ projectId: { type: 'string' },+ storageBucket: { type: 'string' },+ messagingSenderId: { type: 'string' }+ },++ init: function () {+ this.client = null;+ this.lastRoom = null;++ this.onCreate = this.onCreate.bind(this);+ this.onJoin = this.onJoin.bind(this);+ this.onLeave = this.onLeave.bind(this);+ this.onReady = this.onReady.bind(this);+ this.onSetName = this.onSetName.bind(this);+ this.onPlayButtonClick = this.onPlayButtonClick.bind(this);+ this.onBeatHit = this.onBeatHit.bind(this);+ this.onBeatMiss = this.onBeatMiss.bind(this);+ this.onSongComplete = this.onSongComplete.bind(this);+ this.onRematch = this.onRematch.bind(this);+ this.onRoomUpdate = this.onRoomUpdate.bind(this);++ const sceneEl = this.el.sceneEl || this.el;+ sceneEl.addEventListener('mpcreate', this.onCreate);+ sceneEl.addEventListener('mpjoin', this.onJoin);+ sceneEl.addEventListener('mpleave', this.onLeave);+ sceneEl.addEventListener('mpready', this.onReady);+ sceneEl.addEventListener('mpsetname', this.onSetName);+ sceneEl.addEventListener('mprematch', this.onRematch);+ sceneEl.addEventListener('beathit', this.onBeatHit);+ sceneEl.addEventListener('beatmiss', this.onBeatMiss);+ sceneEl.addEventListener('beatwrong', this.onBeatMiss);+ sceneEl.addEventListener('songcomplete', this.onSongComplete);+ sceneEl.addEventListener('playbuttonclick', this.onPlayButtonClick);+ },++ _ensureClient: function () {+ if (this.client) return this.client;+ if (!this.data.apiKey) {+ console.error('[multiplayer] Missing Firebase config');+ return null;+ }+ this.client = new MultiplayerClient({+ apiKey: this.data.apiKey,+ authDomain: this.data.authDomain,+ databaseURL: this.data.databaseURL,+ projectId: this.data.projectId,+ storageBucket: this.data.storageBucket,+ messagingSenderId: this.data.messagingSenderId+ });+ this.client.onRoomUpdate(this.onRoomUpdate);+ return this.client;+ },++ _name: function () {+ return localStorage.getItem('threewsusername') || 'Player';+ },++ onCreate: async function () {+ const c = this._ensureClient();+ if (!c) return;+ try {+ const code = await c.createRoom(this._name());+ this.el.sceneEl.emit('mproomjoined', { code, isHost: true }, false);+ } catch (e) {+ console.error('[multiplayer] create failed', e);+ this.el.sceneEl.emit('mperror', { message: 'Could not create room' }, false);+ }+ },++ onJoin: async function (evt) {+ const c = this._ensureClient();+ if (!c) return;+ const code = (evt.detail && evt.detail.code) || '';+ try {+ await c.joinRoom(code, this._name());+ this.el.sceneEl.emit('mproomjoined', { code: code.toUpperCase(), isHost: false }, false);+ } catch (e) {+ console.error('[multiplayer] join failed', e);+ this.el.sceneEl.emit('mperror', { message: e.message || 'Join failed' }, false);+ }+ },++ onLeave: async function () {+ if (!this.client) return;+ await this.client.leaveRoom();+ this.lastRoom = null;+ this.el.sceneEl.emit('mproomleft', null, false);+ },++ onReady: function (evt) {+ if (!this.client) return;+ this.client.setReady(evt.detail && evt.detail.value);+ },++ onSetName: function (evt) {+ if (!this.client) return;+ this.client.setName((evt.detail && evt.detail.value) || this._name());+ },++ onRematch: async function () {+ if (!this.client) return;+ await this.client.resetForRematch();+ },++ /**+ * When local user presses play in MP mode and is host, broadcast to room.+ * Non-host's playbuttonclick is suppressed via state guard, so this is+ * effectively host-only.+ */+ onPlayButtonClick: function () {+ if (!this.client || !this.client.roomRef) return;+ const state = this.el.sceneEl.systems.state.state;+ if (!state.multiplayer || !state.multiplayer.active) return;+ if (!this.client.isHost) return;+ const challenge = Object.assign({}, state.menuSelectedChallenge);+ this.client.broadcastSong(challenge)+ .then(() => this.client.startSong())+ .catch(err => console.error('[multiplayer] host start failed', err));+ },++ onBeatHit: function () {+ if (!this.client || !this.client.roomRef) return;+ const state = this.el.sceneEl.systems.state.state;+ this.client.pushScore(state.score);+ },++ onBeatMiss: function () {+ if (!this.client || !this.client.roomRef) return;+ const state = this.el.sceneEl.systems.state.state;+ this.client.pushScore(state.score);+ },++ onSongComplete: function () {+ if (!this.client || !this.client.roomRef) return;+ const state = this.el.sceneEl.systems.state.state;+ this.client.pushFinal(state.score);+ },++ onRoomUpdate: function (room) {+ if (!room) {+ this.el.sceneEl.emit('mproomleft', null, false);+ return;+ }+ const sceneEl = this.el.sceneEl;+ const playerEntries = Object.keys(room.players || {}).map(uid => ({+ uid,+ ...room.players[uid]+ })).sort((a, b) => (a.joinedAt || 0) - (b.joinedAt || 0));++ sceneEl.emit('mproomupdate', {+ code: this.client.roomCode,+ isHost: room.host === this.client.uid,+ uid: this.client.uid,+ status: room.status,+ song: room.song,+ startAt: room.startAt,+ players: playerEntries+ }, false);++ // Non-host: when host broadcasts a new song, surface it.+ if (!this.client.isHost && room.song && room.song.id) {+ const prevSongId = this.lastRoom && this.lastRoom.song && this.lastRoom.song.id;+ if (room.song.id !== prevSongId) {+ sceneEl.emit('mpremotesongselect', room.song, false);+ }+ }++ // Non-host: status flips to playing → trigger local play.+ if (!this.client.isHost && room.status === 'playing') {+ const prevStatus = this.lastRoom && this.lastRoom.status;+ if (prevStatus !== 'playing') {+ sceneEl.emit('mpremoteplaystart', null, false);+ }+ }++ this.lastRoom = room;+ }+});diff --git a/rider/src/lib/multiplayer.js b/rider/src/lib/multiplayer.jsnew file mode 100644index 000000000..50ac532f6--- /dev/null+++ b/rider/src/lib/multiplayer.js@@ -0,0 +1,264 @@+/**+ * Firebase Realtime Database client for /rider multiplayer.+ *+ * Room shape at /rooms/{code}:+ * {+ * host: <uid>,+ * createdAt: <serverTimestamp>,+ * status: 'lobby' | 'playing' | 'finished',+ * song: { id, difficulty, beatmapCharacteristic, difficultyId,+ * songName, songSubName, image, version, directDownload,+ * metadata, downloads, downloadsText, songDuration } | null,+ * startAt: <ms epoch> | null, // synchronized song start+ * players: {+ * <uid>: {+ * name, joinedAt, ready,+ * score, combo, maxCombo, accuracy, beatsHit, beatsMissed,+ * finished, rank, finalScore+ * }+ * }+ * }+ */+const firebase = require('firebase/app');+require('firebase/database');++const ROOM_CODE_ALPHA = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';+const ROOM_CODE_LEN = 4;+const SCORE_WRITE_INTERVAL_MS = 250;+const START_DELAY_MS = 5000;++function genRoomCode () {+ let s = '';+ for (let i = 0; i < ROOM_CODE_LEN; i++) {+ s += ROOM_CODE_ALPHA[Math.floor(Math.random() * ROOM_CODE_ALPHA.length)];+ }+ return s;+}++function genUid () {+ const stored = localStorage.getItem('threewsmpuid');+ if (stored) return stored;+ const uid = 'u_' + Math.random().toString(36).slice(2, 10) + Date.now().toString(36);+ localStorage.setItem('threewsmpuid', uid);+ return uid;+}++class MultiplayerClient {+ constructor (config) {+ if (!firebase.apps.length) {+ firebase.initializeApp(config);+ } else {+ // The leaderboard component initializes firebase first; database picks up+ // databaseURL from the existing app.+ }+ this.db = firebase.database();+ this.uid = genUid();+ this.roomCode = null;+ this.roomRef = null;+ this.playerRef = null;+ this.isHost = false;+ this.lastScoreWrite = 0;+ this._roomListener = null;+ this._onRoomUpdate = null;+ this._serverOffset = 0;+ this.db.ref('.info/serverTimeOffset').on('value', snap => {+ this._serverOffset = snap.val() || 0;+ });+ }++ serverNow () {+ return Date.now() + this._serverOffset;+ }++ async createRoom (name) {+ // Try a few codes in case of collision.+ for (let attempt = 0; attempt < 5; attempt++) {+ const code = genRoomCode();+ const ref = this.db.ref('rooms/' + code);+ const snap = await ref.once('value');+ if (snap.exists()) continue;+ const room = {+ host: this.uid,+ createdAt: firebase.database.ServerValue.TIMESTAMP,+ status: 'lobby',+ song: null,+ startAt: null,+ players: {+ [this.uid]: this._initialPlayer(name)+ }+ };+ await ref.set(room);+ this._attach(code, true);+ return code;+ }+ throw new Error('Could not generate unique room code');+ }++ async joinRoom (code, name) {+ code = (code || '').toUpperCase().trim();+ if (!code) throw new Error('Room code required');+ const ref = this.db.ref('rooms/' + code);+ const snap = await ref.once('value');+ if (!snap.exists()) throw new Error('Room not found');+ await ref.child('players/' + this.uid).set(this._initialPlayer(name));+ this._attach(code, false);+ return code;+ }++ _initialPlayer (name) {+ return {+ name: (name || 'Player').slice(0, 20),+ joinedAt: firebase.database.ServerValue.TIMESTAMP,+ ready: false,+ score: 0,+ combo: 0,+ maxCombo: 0,+ accuracy: 100,+ beatsHit: 0,+ beatsMissed: 0,+ finished: false,+ rank: '',+ finalScore: 0+ };+ }++ _attach (code, isHost) {+ this.roomCode = code;+ this.isHost = isHost;+ this.roomRef = this.db.ref('rooms/' + code);+ this.playerRef = this.roomRef.child('players/' + this.uid);+ // Auto-cleanup on disconnect.+ this.playerRef.onDisconnect().remove();+ this._roomListener = snap => {+ const v = snap.val();+ if (this._onRoomUpdate) this._onRoomUpdate(v);+ };+ this.roomRef.on('value', this._roomListener);+ }++ onRoomUpdate (cb) { this._onRoomUpdate = cb; }++ async leaveRoom () {+ if (!this.roomRef) return;+ try {+ this.roomRef.off('value', this._roomListener);+ await this.playerRef.onDisconnect().cancel();+ await this.playerRef.remove();+ // If host abandoned and was last player, drop room.+ const snap = await this.roomRef.child('players').once('value');+ if (!snap.exists()) {+ await this.roomRef.remove();+ } else if (this.isHost) {+ // Promote arbitrary remaining player to host.+ const nextHost = Object.keys(snap.val())[0];+ await this.roomRef.child('host').set(nextHost);+ }+ } catch (e) { /* best-effort */ }+ this.roomCode = null;+ this.roomRef = null;+ this.playerRef = null;+ this.isHost = false;+ }++ async setReady (ready) {+ if (!this.playerRef) return;+ await this.playerRef.child('ready').set(!!ready);+ }++ async setName (name) {+ if (!this.playerRef) return;+ await this.playerRef.child('name').set((name || 'Player').slice(0, 20));+ }++ /**+ * Host: broadcast the selected song to all players in the room.+ */+ async broadcastSong (challenge) {+ if (!this.isHost || !this.roomRef) return;+ const safe = {+ id: challenge.id || '',+ difficulty: challenge.difficulty || '',+ beatmapCharacteristic: challenge.beatmapCharacteristic || '',+ difficultyId: challenge.difficultyId || '',+ songName: challenge.songName || '',+ songSubName: challenge.songSubName || '',+ image: challenge.image || challenge.coverURL || '',+ version: challenge.version || '',+ directDownload: challenge.directDownload || '',+ downloads: challenge.downloads || '',+ downloadsText: challenge.downloadsText || '',+ songDuration: challenge.songDuration || 0,+ metadata: challenge.metadata || {}+ };+ await this.roomRef.update({ song: safe });+ // Reset all players' ready flags when song changes.+ const players = (await this.roomRef.child('players').once('value')).val() || {};+ const updates = {};+ Object.keys(players).forEach(uid => {+ updates['players/' + uid + '/ready'] = false;+ updates['players/' + uid + '/finished'] = false;+ updates['players/' + uid + '/score'] = 0;+ updates['players/' + uid + '/finalScore'] = 0;+ updates['players/' + uid + '/combo'] = 0;+ updates['players/' + uid + '/maxCombo'] = 0;+ updates['players/' + uid + '/accuracy'] = 100;+ updates['players/' + uid + '/beatsHit'] = 0;+ updates['players/' + uid + '/beatsMissed'] = 0;+ updates['players/' + uid + '/rank'] = '';+ });+ await this.roomRef.update(updates);+ }++ /**+ * Host: schedule synchronized start. All clients begin the song at startAt.+ */+ async startSong () {+ if (!this.isHost || !this.roomRef) return;+ const startAt = this.serverNow() + START_DELAY_MS;+ await this.roomRef.update({ status: 'playing', startAt });+ return startAt;+ }++ /**+ * Throttled live score push.+ */+ pushScore (score) {+ if (!this.playerRef) return;+ const now = Date.now();+ if (now - this.lastScoreWrite < SCORE_WRITE_INTERVAL_MS) return;+ this.lastScoreWrite = now;+ this.playerRef.update({+ score: score.score | 0,+ combo: score.combo | 0,+ maxCombo: score.maxCombo | 0,+ accuracy: parseFloat(score.accuracy) || 0,+ beatsHit: score.beatsHit | 0,+ beatsMissed: score.beatsMissed | 0+ });+ }++ async pushFinal (score) {+ if (!this.playerRef) return;+ await this.playerRef.update({+ finished: true,+ finalScore: score.score | 0,+ score: score.score | 0,+ maxCombo: score.maxCombo | 0,+ accuracy: parseFloat(score.accuracy) || 0,+ beatsHit: score.beatsHit | 0,+ beatsMissed: score.beatsMissed | 0,+ rank: score.rank || ''+ });+ if (this.isHost && this.roomRef) {+ // Mark room finished once host reports done; players may still be on outro.+ this.roomRef.update({ status: 'finished' });+ }+ }++ async resetForRematch () {+ if (!this.isHost || !this.roomRef) return;+ await this.roomRef.update({ status: 'lobby', startAt: null });+ }+}++module.exports = { MultiplayerClient, START_DELAY_MS };diff --git a/rider/src/state/index.js b/rider/src/state/index.jsindex f033c16fd..fb1997ff9 100644--- a/rider/src/state/index.js+++ b/rider/src/state/index.js@@ -118,6 +118,23 @@ AFRAME.registerState({leaderboardScores: '',mainMenuActive: false,menuActive: SKIP_INTRO, // Main menu active.+ multiplayer: {+ active: false, // In MP flow at all.+ lobbyOpen: false, // Lobby panel visible.+ roomCode: '',+ isHost: false,+ uid: '',+ status: 'idle', // idle | connecting | lobby | playing | finished+ players: [], // [{uid, name, score, combo, accuracy, ready, finished, finalScore, rank}]+ playerCount: 0,+ readyCount: 0,+ everyoneReady: false,+ opponentText: '', // Pre-rendered HUD text for non-self players.+ opponentScores: '',+ hostName: '',+ lastError: '',+ joinCodeInput: ''+ },menuDifficulties: [],menuDifficultiesIds: [],menuSelectedChallenge: { // Currently selected challenge in the main menu.diff --git a/src/embed-action-bridge.js b/src/embed-action-bridge.jsindex 5485a9f94..ef2858af0 100644--- a/src/embed-action-bridge.js+++ b/src/embed-action-bridge.js@@ -52,6 +52,20 @@ export class EmbedActionBridge {this._running = false;this._onMessage = this._handleMessage.bind(this);this._onAction = this._handleAction.bind(this);+ // Parent origin is locked to ev.origin of the first valid host message.+ // Best-effort seed from document.referrer so we can announce 'ready' to a+ // known origin instead of '*'.+ this._parentOrigin = this._seedParentOrigin();+ this._parentOriginLocked = false;+ }++ _seedParentOrigin() {+ try {+ if (this._win.parent === this._win) return this._win.location.origin;+ const ref = this._win.document?.referrer;+ if (ref) return new URL(ref).origin;+ } catch {}+ return null;}start() {@@ -131,11 +145,16 @@ export class EmbedActionBridge {}_toParent(msg) {- // Use '*' as targetOrigin — we don't know the parent's origin at construction time.- // Incoming messages are validated via _originAllowed before acting on them.+ // Origin lockdown: we never post with '*'. Until we observe a valid host+ // message we use the referrer-derived origin (best effort); after we lock,+ // we use the host's actual origin.+ if (!this._parentOrigin) {+ console.warn('[embed-action-bridge] parent origin unknown; dropping', msg.op);+ return;+ }this._win.parent.postMessage({ ...msg, v: PROTOCOL_VERSION, source: 'agent-3d', id: msg.id || genId() },- '*',+ this._parentOrigin,);}@@ -168,6 +187,16 @@ export class EmbedActionBridge {if (!msg || msg.v !== PROTOCOL_VERSION || msg.source !== 'agent-host') return;if (msg.kind !== 'request') return;+ // Lock the parent origin to the first authenticated message we observe.+ // Subsequent messages from a different origin are rejected, even if they+ // were nominally allowed by the manifest policy.+ if (!this._parentOriginLocked) {+ this._parentOrigin = event.origin;+ this._parentOriginLocked = true;+ } else if (event.origin !== this._parentOrigin) {+ return;+ }+const { op, payload = {} } = msg;if (op === 'ping') {diff --git a/src/embed-host-bridge.js b/src/embed-host-bridge.jsindex 2a656bc4c..9a608af7d 100644--- a/src/embed-host-bridge.js+++ b/src/embed-host-bridge.js@@ -33,6 +33,14 @@ export class EmbedHostBridge {* @param {{ iframe: HTMLIFrameElement, agentId: string, allowedOrigin: string }} opts*/constructor({ iframe, agentId, allowedOrigin }) {+ if (!iframe) throw new Error('EmbedHostBridge: iframe required');+ if (!agentId) throw new Error('EmbedHostBridge: agentId required');+ if (!allowedOrigin || allowedOrigin === '*') {+ throw new Error(+ 'EmbedHostBridge: allowedOrigin must be an explicit origin (wildcard "*" is not allowed). ' ++ 'Pass the iframe origin, e.g. new URL(iframe.src).origin.',+ );+ }this._iframe = iframe;this._agentId = agentId;this._allowedOrigin = allowedOrigin;diff --git a/tests/src/pumpfun-reactions.test.js b/tests/src/pumpfun-reactions.test.jsnew file mode 100644index 000000000..a18e1a56b--- /dev/null+++ b/tests/src/pumpfun-reactions.test.js@@ -0,0 +1,195 @@+import { describe, it, expect } from 'vitest';+import {+ reactionFor,+ createReactionDispatcher,+ applyReaction,+} from '../../src/widgets/pumpfun-reactions.js';++describe('reactionFor', () => {+ it('returns null for unknown kinds', () => {+ expect(reactionFor('unknown', { mint: 'x' })).toBe(null);+ });++ it('returns null when ev is missing', () => {+ expect(reactionFor('claim', null)).toBe(null);+ });++ describe('graduation', () => {+ it('dances rumba with celebration emote and a speak line', () => {+ const r = reactionFor('graduation', { mint: 'M', symbol: 'WIF' });+ expect(r.gesture.name).toBe('rumba');+ expect(r.emote.trigger).toBe('celebration');+ expect(r.speak.text).toContain('WIF');+ expect(r.priority).toBe(90);+ });++ it('scales duration with MC multiple', () => {+ const small = reactionFor('graduation', {+ mint: 'M',+ market_cap_usd_initial: 10_000,+ usd_market_cap: 12_000,+ });+ const big = reactionFor('graduation', {+ mint: 'M',+ market_cap_usd_initial: 10_000,+ usd_market_cap: 1_000_000,+ });+ expect(big.gesture.duration).toBeGreaterThan(small.gesture.duration);+ expect(big.gesture.duration).toBeLessThanOrEqual(9000);+ expect(small.gesture.duration).toBeGreaterThanOrEqual(4500);+ });+ });++ describe('claim', () => {+ it('first-time GitHub-linked verified claim plays thriller', () => {+ const r = reactionFor('claim', {+ mint: 'M',+ first_time_claim: true,+ github_user: 'alice',+ signal_verified: true,+ });+ expect(r.gesture.name).toBe('thriller');+ expect(r.priority).toBe(85);+ });++ it('first-time GitHub-linked unverified claim plays silly', () => {+ const r = reactionFor('claim', {+ mint: 'M',+ first_time_claim: true,+ github_user: 'alice',+ });+ expect(r.gesture.name).toBe('silly');+ });++ it('first-time non-GitHub claim plays the celebrate clip', () => {+ const r = reactionFor('claim', {+ mint: 'M',+ first_time_claim: true,+ claimer: 'wallet1',+ });+ expect(r.gesture.name).toBe('celebrate');+ });++ it('fake claim plays a head-shake with concern', () => {+ const r = reactionFor('claim', { mint: 'M', fake_claim: true, claimer: 'badactor' });+ expect(r.gesture.name).toBe('shake');+ expect(r.emote.trigger).toBe('concern');+ });++ it('mega tier claims taunt', () => {+ const r = reactionFor('claim', { mint: 'M', tier: 'mega' });+ expect(r.gesture.name).toBe('taunt');+ expect(r.priority).toBe(50);+ });++ it('influencer tier claims play a brief reaction', () => {+ const r = reactionFor('claim', { mint: 'M', tier: 'influencer' });+ expect(r.gesture.name).toBe('reaction');+ });++ it('notable tier claims emote without a gesture', () => {+ const r = reactionFor('claim', { mint: 'M', tier: 'notable' });+ expect(r.gesture).toBeUndefined();+ expect(r.emote.trigger).toBe('curiosity');+ });++ it('untiered repeat claim returns null', () => {+ expect(reactionFor('claim', { mint: 'M' })).toBe(null);+ });+ });++ describe('mint', () => {+ it('reacts to large initial buys', () => {+ const r = reactionFor('mint', { mint: 'M', initial_buy_sol: 7 });+ expect(r.gesture.name).toBe('wave');+ });++ it('quietly notes mid-tier mints', () => {+ const r = reactionFor('mint', { mint: 'M', initial_buy_sol: 1.5 });+ expect(r.gesture).toBeUndefined();+ expect(r.emote.trigger).toBe('curiosity');+ });++ it('ignores small mints', () => {+ expect(reactionFor('mint', { mint: 'M', initial_buy_sol: 0.1 })).toBe(null);+ });+ });+});++describe('createReactionDispatcher', () => {+ it('dedupes the same event within the dedupe window', () => {+ let now = 1000;+ const d = createReactionDispatcher({ now: () => now });+ const ev = { mint: 'M', first_time_claim: true, github_user: 'a' };+ const ran = [];+ expect(d.dispatch('claim', ev, (r) => ran.push(r))).toBe(true);+ now += 5000;+ expect(d.dispatch('claim', ev, (r) => ran.push(r))).toBe(false);+ expect(ran.length).toBe(1);+ });++ it('lets a different mint through immediately', () => {+ let now = 1000;+ const d = createReactionDispatcher({ now: () => now });+ const ran = [];+ d.dispatch('graduation', { mint: 'A', symbol: 'A' }, (r) => ran.push(r));+ now += 100;+ // Same kind, same priority, but cooldown still active. New mint but+ // not higher priority → shouldn't preempt mid-dance.+ const ok = d.dispatch('graduation', { mint: 'B', symbol: 'B' }, (r) => ran.push(r));+ expect(ok).toBe(false);+ expect(ran.length).toBe(1);+ });++ it('higher priority preempts an in-flight lower priority gesture', () => {+ let now = 1000;+ const d = createReactionDispatcher({ now: () => now });+ const ran = [];+ // Influencer claim (pri 35) → 1.8s reaction.+ d.dispatch('claim', { mint: 'A', tier: 'influencer' }, (r) => ran.push(r));+ now += 200;+ // Graduation (pri 90) lands while reaction is still playing.+ const ok = d.dispatch('graduation', { mint: 'B', symbol: 'B' }, (r) => ran.push(r));+ expect(ok).toBe(true);+ expect(ran[1].gesture.name).toBe('rumba');+ });++ it('lets cooldown expire so subsequent reactions can play', () => {+ let now = 1000;+ const d = createReactionDispatcher({ now: () => now });+ const ran = [];+ d.dispatch('claim', { mint: 'A', tier: 'influencer' }, (r) => ran.push(r));+ now += 5000;+ const ok = d.dispatch('claim', { mint: 'B', tier: 'influencer' }, (r) => ran.push(r));+ expect(ok).toBe(true);+ expect(ran.length).toBe(2);+ });+});++describe('applyReaction', () => {+ it('emits emote, gesture, and speak by default', () => {+ const emitted = [];+ const protocol = { emit: (a) => emitted.push(a) };+ applyReaction(protocol, {+ emote: { trigger: 'celebration', weight: 0.9 },+ gesture: { name: 'rumba', duration: 5000 },+ speak: { text: 'hi', sentiment: 0.5 },+ });+ expect(emitted.map((a) => a.type)).toEqual(['emote', 'gesture', 'speak']);+ });++ it('honors flags to suppress channels', () => {+ const emitted = [];+ const protocol = { emit: (a) => emitted.push(a) };+ applyReaction(protocol, {+ emote: { trigger: 'celebration', weight: 0.9 },+ gesture: { name: 'rumba', duration: 5000 },+ speak: { text: 'hi', sentiment: 0.5 },+ }, { speak: false });+ expect(emitted.map((a) => a.type)).toEqual(['emote', 'gesture']);+ });++ it('is safe with a null protocol', () => {+ expect(() => applyReaction(null, { emote: { trigger: 'x', weight: 1 } })).not.toThrow();+ });+});