Skip to content

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

agent-payments-sdk

nirholasde765469abe2
diff --git a/agent-payments-crosschain-sdk/package-lock.json b/agent-payments-crosschain-sdk/package-lock.json
new file mode 100644
index 000000000..70cc6f2f0
--- /dev/null
+++ b/agent-payments-crosschain-sdk/package-lock.json
@@ -0,0 +1,2680 @@
+{
+ "name": "@pump-fun/agent-payments-crosschain-sdk",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@pump-fun/agent-payments-crosschain-sdk",
+ "version": "0.1.0",
+ "license": "ISC",
+ "dependencies": {
+ "@coral-xyz/anchor": "^0.31.1",
+ "@solana/spl-token": "^0.4.9",
+ "@solana/web3.js": "^1.98.0",
+ "viem": "^2.21.0"
+ },
+ "devDependencies": {
+ "@types/node": "^22.0.0",
+ "tsup": "^8.3.5",
+ "typescript": "^5.7.3"
+ },
+ "peerDependencies": {
+ "zod": "^3.0.0"
+ },
+ "peerDependenciesMeta": {
+ "zod": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@adraffy/ens-normalize": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz",
+ "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==",
+ "license": "MIT"
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.29.2",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.2.tgz",
+ "integrity": "sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@coral-xyz/anchor": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.31.1.tgz",
+ "integrity": "sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "node_modules/@coral-xyz/anchor-errors": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.31.1.tgz",
+ "integrity": "sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@coral-xyz/borsh": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.31.1.tgz",
+ "integrity": "sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.1.2",
+ "buffer-layout": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.69.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",
+ "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz",
+ "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz",
+ "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz",
+ "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz",
+ "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz",
+ "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz",
+ "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz",
+ "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz",
+ "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz",
+ "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz",
+ "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz",
+ "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz",
+ "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz",
+ "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz",
+ "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz",
+ "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz",
+ "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz",
+ "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz",
+ "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz",
+ "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz",
+ "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz",
+ "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz",
+ "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz",
+ "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@noble/ciphers": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
+ "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.3.tgz",
+ "integrity": "sha512-x35CNW/ANXG3hE/EZpRU8MXX1JDN86hBb2wMGAtltkz7pc6cxgjpy1OMMfDosOQ+2hWqIkag/fGok1Yady9nGw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.3.tgz",
+ "integrity": "sha512-xw3xtkDApIOGayehp2+Rz4zimfkaX65r4t47iy+ymQB2G4iJCBBfj0ogVg5jpvjpn8UWn/+q9tprxleYeNp3Hw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.3.tgz",
+ "integrity": "sha512-vo6Y5Qfpx7/5EaamIwi0WqW2+zfiusVihKatLvtN1VFVy3D13uERk/6gZLU1UiHRL6fDXqj/ELIeVRGnvcTE1g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.3.tgz",
+ "integrity": "sha512-D+0QGcZhBzTN82weOnsSlY7V7+RMmPuF1CkbxyMAGE8+ZHeUjyb76ZiWmBlCu//AQQONvxcqRbwZTajZKqjuOw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.3.tgz",
+ "integrity": "sha512-6HnvHCT7fDyj6R0Ph7A6x8dQS/S38MClRWeDLqc0MdfWkxjiu1HSDYrdPhqSILzjTIC/pnXbbJbo+ft+gy/9hQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.3.tgz",
+ "integrity": "sha512-KHLgC3WKlUYW3ShFKnnosZDOJ0xjg9zp7au3sIm2bs/tGBeC2ipmvRh/N7JKi0t9Ue20C0dpEshi8WUubg+cnA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.3.tgz",
+ "integrity": "sha512-DV6fJoxEYWJOvaZIsok7KrYl0tPvga5OZ2yvKHNNYyk/2roMLqQAbGhr78EQ5YhHpnhLKJD3S1WFusAkmUuV5g==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.3.tgz",
+ "integrity": "sha512-mQKoJAzvuOs6F+TZybQO4GOTSMUu7v0WdxEk24krQ/uUxXoPTtHjuaUuPmFhtBcM4K0ons8nrE3JyhTuCFtT/w==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.3.tgz",
+ "integrity": "sha512-Whjj2qoiJ6+OOJMGptTYazaJvjOJm+iKHpXQM1P3LzGjt7Ff++Tp7nH4N8J/BUA7R9IHfDyx4DJIflifwnbmIA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.3.tgz",
+ "integrity": "sha512-4YTNHKqGng5+yiZt3mg77nmyuCfmNfX4fPmyUapBcIk+BdwSwmCWGXOUxhXbBEkFHtoN5boLj/5NON+u5QC9tg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.3.tgz",
+ "integrity": "sha512-SU3kNlhkpI4UqlUc2VXPGK9o886ZsSeGfMAX2ba2b8DKmMXq4AL7KUrkSWVbb7koVqx41Yczx6dx5PNargIrEA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.3.tgz",
+ "integrity": "sha512-6lDLl5h4TXpB1mTf2rQWnAk/LcXrx9vBfu/DT5TIPhvMhRWaZ5MxkIc8u4lJAmBo6klTe1ywXIUHFjylW505sg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.3.tgz",
+ "integrity": "sha512-BMo8bOw8evlup/8G+cj5xWtPyp93xPdyoSN16Zy90Q2QZ0ZYRhCt6ZJSwbrRzG9HApFabjwj2p25TUPDWrhzqQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.3.tgz",
+ "integrity": "sha512-E0L8X1dZN1/Rph+5VPF6Xj2G7JJvMACVXtamTJIDrVI44Y3K+G8gQaMEAavbqCGTa16InptiVrX6eM6pmJ+7qA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.3.tgz",
+ "integrity": "sha512-oZJ/WHaVfHUiRAtmTAeo3DcevNsVvH8mbvodjZy7D5QKvCefO371SiKRpxoDcCxB3PTRTLayWBkvmDQKTcX/sw==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.3.tgz",
+ "integrity": "sha512-Dhbyh7j9FybM3YaTgaHmVALwA8AkUwTPccyCQ79TG9AJUsMQqgN1DDEZNr4+QUfwiWvLDumW5vdwzoeUF+TNxQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.3.tgz",
+ "integrity": "sha512-cJd1X5XhHHlltkaypz1UcWLA8AcoIi1aWhsvaWDskD1oz2eKCypnqvTQ8ykMNI0RSmm7NkTdSqSSD7zM0xa6Ig==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.3.tgz",
+ "integrity": "sha512-DAZDBHQfG2oQuhY7mc6I3/qB4LU2fQCjRvxbDwd/Jdvb9fypP4IJ4qmtu6lNjes6B531AI8cg1aKC2di97bUxA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.3.tgz",
+ "integrity": "sha512-cRxsE8c13mZOh3vP+wLDxpQBRrOHDIGOWyDL93Sy0Ga8y515fBcC2pjUfFwUe5T7tqvTvWbCpg1URM/AXdWIXA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.3.tgz",
+ "integrity": "sha512-QaWcIgRxqEdQdhJqW4DJctsH6HCmo5vHxY0krHSX4jMtOqfzC+dqDGuHM87bu4H8JBeibWx7jFz+h6/4C8wA5Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.3.tgz",
+ "integrity": "sha512-AaXwSvUi3QIPtroAUw1t5yHGIyqKEXwH54WUocFolZhpGDruJcs8c+xPNDRn4XiQsS7MEwnYsHW2l0MBLDMkWg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.3.tgz",
+ "integrity": "sha512-65LAKM/bAWDqKNEelHlcHvm2V+Vfb8C6INFxQXRHCvaVN1rJfwr4NvdP4FyzUaLqWfaCGaadf6UbTm8xJeYfEg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.3.tgz",
+ "integrity": "sha512-EEM2gyhBF5MFnI6vMKdX1LAosE627RGBzIoGMdLloPZkXrUN0Ckqgr2Qi8+J3zip/8NVVro3/FjB+tjhZUgUHA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.3.tgz",
+ "integrity": "sha512-E5Eb5H/DpxaoXH++Qkv28RcUJboMopmdDUALBczvHMf7hNIxaDZqwY5lK12UK1BHacSmvupoEWGu+n993Z0y1A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.3.tgz",
+ "integrity": "sha512-hPt/bgL5cE+Qp+/TPHBqptcAgPzgj46mPcg/16zNUmbQk0j+mOEQV/+Lqu8QRtDV3Ek95Q6FeFITpuhl6OTsAA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@scure/base": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz",
+ "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip32": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz",
+ "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "~1.9.0",
+ "@noble/hashes": "~1.8.0",
+ "@scure/base": "~1.2.5"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip39": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz",
+ "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "~1.8.0",
+ "@scure/base": "~1.2.5"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@solana/buffer-layout": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz",
+ "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer": "~6.0.3"
+ },
+ "engines": {
+ "node": ">=5.10"
+ }
+ },
+ "node_modules/@solana/buffer-layout-utils": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz",
+ "integrity": "sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/web3.js": "^1.32.0",
+ "bigint-buffer": "^1.1.5",
+ "bignumber.js": "^9.0.1"
+ },
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@solana/codecs": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs/-/codecs-2.0.0-rc.1.tgz",
+ "integrity": "sha512-qxoR7VybNJixV51L0G1RD2boZTcxmwUWnKCaJJExQ5qNKwbpSyDdWfFJfM5JhGyKe9DnPVOZB+JHWXnpbZBqrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/options": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-core": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.0.0-rc.1.tgz",
+ "integrity": "sha512-bauxqMfSs8EHD0JKESaNmNuNvkvHSuN3bbWAF5RjOfDu2PugxHrvRebmYauvSumZ3cTfQ4HJJX6PG5rN852qyQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-data-structures": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-rc.1.tgz",
+ "integrity": "sha512-rinCv0RrAVJ9rE/rmaibWJQxMwC5lSaORSZuwjopSUE6T0nb/MVg6Z1siNCXhh/HFTOg0l8bNvZHgBcN/yvXog==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-numbers": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.0.0-rc.1.tgz",
+ "integrity": "sha512-J5i5mOkvukXn8E3Z7sGIPxsThRCgSdgTWJDQeZvucQ9PT6Y3HiVXJ0pcWiOWAoQ3RX8e/f4I3IC+wE6pZiJzDQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/codecs-strings": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-2.0.0-rc.1.tgz",
+ "integrity": "sha512-9/wPhw8TbGRTt6mHC4Zz1RqOnuPTqq1Nb4EyuvpZ39GW6O2t2Q7Q0XxiB3+BdoEjwA2XgPw6e2iRfvYgqty44g==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "fastestsmallesttextencoderdecoder": "^1.0.22",
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/errors": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.0.0-rc.1.tgz",
+ "integrity": "sha512-ejNvQ2oJ7+bcFAYWj225lyRkHnixuAeb7RQCixm+5mH4n1IA4Qya/9Bmfy5RAAHQzxK43clu3kZmL5eF9VGtYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "commander": "^12.1.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/options": {
+ "version": "2.0.0-rc.1",
+ "resolved": "https://registry.npmjs.org/@solana/options/-/options-2.0.0-rc.1.tgz",
+ "integrity": "sha512-mLUcR9mZ3qfHlmMnREdIFPf9dpMc/Bl66tLSOOWxw4ml5xMT2ohFn7WGqoKcu/UHkT9CrC6+amEdqCNvUqI7AA==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.0.0-rc.1",
+ "@solana/codecs-data-structures": "2.0.0-rc.1",
+ "@solana/codecs-numbers": "2.0.0-rc.1",
+ "@solana/codecs-strings": "2.0.0-rc.1",
+ "@solana/errors": "2.0.0-rc.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5"
+ }
+ },
+ "node_modules/@solana/spl-token": {
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.4.14.tgz",
+ "integrity": "sha512-u09zr96UBpX4U685MnvQsNzlvw9TiY005hk1vJmJr7gMJldoPG1eYU5/wNEyOA5lkMLiR/gOi9SFD4MefOYEsA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/buffer-layout": "^4.0.0",
+ "@solana/buffer-layout-utils": "^0.2.0",
+ "@solana/spl-token-group": "^0.0.7",
+ "@solana/spl-token-metadata": "^0.1.6",
+ "buffer": "^6.0.3"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.5"
+ }
+ },
+ "node_modules/@solana/spl-token-group": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-group/-/spl-token-group-0.0.7.tgz",
+ "integrity": "sha512-V1N/iX7Cr7H0uazWUT2uk27TMqlqedpXHRqqAbVO2gvmJyT0E0ummMEAVQeXZ05ZhQ/xF39DLSdBp90XebWEug==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/spl-token-metadata": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@solana/spl-token-metadata/-/spl-token-metadata-0.1.6.tgz",
+ "integrity": "sha512-7sMt1rsm/zQOQcUWllQX9mD2O6KhSAtY1hFR2hfFwgqfFWzSY9E9GDvFVNYUI1F0iQKcm6HmePU9QbKRXTEBiA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@solana/codecs": "2.0.0-rc.1"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.95.3"
+ }
+ },
+ "node_modules/@solana/web3.js": {
+ "version": "1.98.4",
+ "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.4.tgz",
+ "integrity": "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.25.0",
+ "@noble/curves": "^1.4.2",
+ "@noble/hashes": "^1.4.0",
+ "@solana/buffer-layout": "^4.0.1",
+ "@solana/codecs-numbers": "^2.1.0",
+ "agentkeepalive": "^4.5.0",
+ "bn.js": "^5.2.1",
+ "borsh": "^0.7.0",
+ "bs58": "^4.0.1",
+ "buffer": "6.0.3",
+ "fast-stable-stringify": "^1.0.0",
+ "jayson": "^4.1.1",
+ "node-fetch": "^2.7.0",
+ "rpc-websockets": "^9.0.2",
+ "superstruct": "^2.0.2"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-core": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.3.0.tgz",
+ "integrity": "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/codecs-numbers": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.3.0.tgz",
+ "integrity": "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==",
+ "license": "MIT",
+ "dependencies": {
+ "@solana/codecs-core": "2.3.0",
+ "@solana/errors": "2.3.0"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/@solana/errors": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.3.0.tgz",
+ "integrity": "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.4.1",
+ "commander": "^14.0.0"
+ },
+ "bin": {
+ "errors": "bin/cli.mjs"
+ },
+ "engines": {
+ "node": ">=20.18.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.3.3"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@solana/web3.js/node_modules/superstruct": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz",
+ "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@swc/helpers": {
+ "version": "0.5.21",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.21.tgz",
+ "integrity": "sha512-jI/VAmtdjB/RnI8GTnokyX7Ug8c+g+ffD6QRLa6XQewtnGyukKkKSk3wLTM3b5cjt1jNh9x0jfVlagdN2gDKQg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "tslib": "^2.8.0"
+ }
+ },
+ "node_modules/@types/connect": {
+ "version": "3.4.38",
+ "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
+ "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "22.19.17",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz",
+ "integrity": "sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==",
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/@types/uuid": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
+ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
+ "license": "MIT"
+ },
+ "node_modules/@types/ws": {
+ "version": "7.4.7",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
+ "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
+ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/agentkeepalive": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz",
+ "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "humanize-ms": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ }
+ },
+ "node_modules/any-promise": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
+ "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/bigint-buffer": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz",
+ "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==",
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bindings": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/bignumber.js": {
+ "version": "9.3.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
+ "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/bindings": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+ "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "file-uri-to-path": "1.0.0"
+ }
+ },
+ "node_modules/bn.js": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz",
+ "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==",
+ "license": "MIT"
+ },
+ "node_modules/borsh": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz",
+ "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.2.0",
+ "bs58": "^4.0.0",
+ "text-encoding-utf-8": "^1.0.2"
+ }
+ },
+ "node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "node_modules/buffer": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.2.1"
+ }
+ },
+ "node_modules/buffer-layout": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz",
+ "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.5"
+ }
+ },
+ "node_modules/bufferutil": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz",
+ "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/bundle-require": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz",
+ "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "load-tsconfig": "^0.2.3"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "esbuild": ">=0.18"
+ }
+ },
+ "node_modules/cac": {
+ "version": "6.7.14",
+ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
+ "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+ "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "readdirp": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 14.16.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/commander": {
+ "version": "12.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
+ "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/confbox": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz",
+ "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/consola": {
+ "version": "3.4.2",
+ "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
+ "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.18.0 || >=16.10.0"
+ }
+ },
+ "node_modules/cross-fetch": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz",
+ "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==",
+ "license": "MIT",
+ "dependencies": {
+ "node-fetch": "^2.7.0"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/delay": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
+ "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/es6-promise": {
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
+ "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
+ "license": "MIT"
+ },
+ "node_modules/es6-promisify": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
+ "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es6-promise": "^4.0.3"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.27.7",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",
+ "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.7",
+ "@esbuild/android-arm": "0.27.7",
+ "@esbuild/android-arm64": "0.27.7",
+ "@esbuild/android-x64": "0.27.7",
+ "@esbuild/darwin-arm64": "0.27.7",
+ "@esbuild/darwin-x64": "0.27.7",
+ "@esbuild/freebsd-arm64": "0.27.7",
+ "@esbuild/freebsd-x64": "0.27.7",
+ "@esbuild/linux-arm": "0.27.7",
+ "@esbuild/linux-arm64": "0.27.7",
+ "@esbuild/linux-ia32": "0.27.7",
+ "@esbuild/linux-loong64": "0.27.7",
+ "@esbuild/linux-mips64el": "0.27.7",
+ "@esbuild/linux-ppc64": "0.27.7",
+ "@esbuild/linux-riscv64": "0.27.7",
+ "@esbuild/linux-s390x": "0.27.7",
+ "@esbuild/linux-x64": "0.27.7",
+ "@esbuild/netbsd-arm64": "0.27.7",
+ "@esbuild/netbsd-x64": "0.27.7",
+ "@esbuild/openbsd-arm64": "0.27.7",
+ "@esbuild/openbsd-x64": "0.27.7",
+ "@esbuild/openharmony-arm64": "0.27.7",
+ "@esbuild/sunos-x64": "0.27.7",
+ "@esbuild/win32-arm64": "0.27.7",
+ "@esbuild/win32-ia32": "0.27.7",
+ "@esbuild/win32-x64": "0.27.7"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "node_modules/eyes": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
+ "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==",
+ "engines": {
+ "node": "> 0.1.90"
+ }
+ },
+ "node_modules/fast-stable-stringify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz",
+ "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==",
+ "license": "MIT"
+ },
+ "node_modules/fastestsmallesttextencoderdecoder": {
+ "version": "1.0.22",
+ "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz",
+ "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==",
+ "license": "CC0-1.0",
+ "peer": true
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/file-uri-to-path": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+ "license": "MIT"
+ },
+ "node_modules/fix-dts-default-cjs-exports": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz",
+ "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "magic-string": "^0.30.17",
+ "mlly": "^1.7.4",
+ "rollup": "^4.34.8"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/humanize-ms": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
+ "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.0.0"
+ }
+ },
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/isomorphic-ws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz",
+ "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
+ "node_modules/isows": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz",
+ "integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "peerDependencies": {
+ "ws": "*"
+ }
+ },
+ "node_modules/jayson": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.3.0.tgz",
+ "integrity": "sha512-AauzHcUcqs8OBnCHOkJY280VaTiCm57AbuO7lqzcw7JapGj50BisE3xhksye4zlTSR1+1tAz67wLTl8tEH1obQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/connect": "^3.4.33",
+ "@types/node": "^12.12.54",
+ "@types/ws": "^7.4.4",
+ "commander": "^2.20.3",
+ "delay": "^5.0.0",
+ "es6-promisify": "^5.0.0",
+ "eyes": "^0.1.8",
+ "isomorphic-ws": "^4.0.1",
+ "json-stringify-safe": "^5.0.1",
+ "stream-json": "^1.9.1",
+ "uuid": "^8.3.2",
+ "ws": "^7.5.10"
+ },
+ "bin": {
+ "jayson": "bin/jayson.js"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/jayson/node_modules/@types/node": {
+ "version": "12.20.55",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz",
+ "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==",
+ "license": "MIT"
+ },
+ "node_modules/jayson/node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "license": "MIT"
+ },
+ "node_modules/joycon": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
+ "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
+ "license": "ISC"
+ },
+ "node_modules/lilconfig": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
+ "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antonk52"
+ }
+ },
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/load-tsconfig": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz",
+ "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "0.30.21",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.5"
+ }
+ },
+ "node_modules/mlly": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz",
+ "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "acorn": "^8.16.0",
+ "pathe": "^2.0.3",
+ "pkg-types": "^1.3.1",
+ "ufo": "^1.6.3"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/mz": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
+ "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "any-promise": "^1.0.0",
+ "object-assign": "^4.0.1",
+ "thenify-all": "^1.0.0"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-gyp-build": {
+ "version": "4.8.4",
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
+ "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
+ "license": "MIT",
+ "optional": true,
+ "bin": {
+ "node-gyp-build": "bin.js",
+ "node-gyp-build-optional": "optional.js",
+ "node-gyp-build-test": "build-test.js"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/ox": {
+ "version": "0.14.20",
+ "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.20.tgz",
+ "integrity": "sha512-rby38C3nDn8eQkf29Zgw4hkCZJ64Qqi0zRPWL8ENUQ7JVuoITqrVtwWQgM/He19SCMUEc7hS/Sjw0jIOSLJhOw==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@adraffy/ens-normalize": "^1.11.0",
+ "@noble/ciphers": "^1.3.0",
+ "@noble/curves": "1.9.1",
+ "@noble/hashes": "^1.8.0",
+ "@scure/bip32": "^1.7.0",
+ "@scure/bip39": "^1.6.0",
+ "abitype": "^1.2.3",
+ "eventemitter3": "5.0.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ox/node_modules/@noble/curves": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz",
+ "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/ox/node_modules/abitype": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.4.tgz",
+ "integrity": "sha512-dpKH+N27vRjarMVTFFkeY445VTKftzGWpL0FiT7xmVmzQRKazZexzC5uHG0f6XKsVLAuUlndnbGau6lRejClxg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/wevm"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4",
+ "zod": "^3.22.0 || ^4.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ },
+ "zod": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ox/node_modules/eventemitter3": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
+ "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
+ "license": "MIT"
+ },
+ "node_modules/pako": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
+ "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
+ "license": "(MIT AND Zlib)"
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
+ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pirates": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
+ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/pkg-types": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz",
+ "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "confbox": "^0.1.8",
+ "mlly": "^1.7.4",
+ "pathe": "^2.0.1"
+ }
+ },
+ "node_modules/postcss-load-config": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz",
+ "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "lilconfig": "^3.1.1"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "peerDependencies": {
+ "jiti": ">=1.21.0",
+ "postcss": ">=8.0.9",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
+ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14.18.0"
+ },
+ "funding": {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/resolve-from": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.60.3",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.3.tgz",
+ "integrity": "sha512-pAQK9HalE84QSm4Po3EmWIZPd3FnjkShVkiMlz1iligWYkWQ7wHYd1PF/T7QZ5TVSD6uSTon5gBVMSM4JfBV+A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.8"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.60.3",
+ "@rollup/rollup-android-arm64": "4.60.3",
+ "@rollup/rollup-darwin-arm64": "4.60.3",
+ "@rollup/rollup-darwin-x64": "4.60.3",
+ "@rollup/rollup-freebsd-arm64": "4.60.3",
+ "@rollup/rollup-freebsd-x64": "4.60.3",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.60.3",
+ "@rollup/rollup-linux-arm-musleabihf": "4.60.3",
+ "@rollup/rollup-linux-arm64-gnu": "4.60.3",
+ "@rollup/rollup-linux-arm64-musl": "4.60.3",
+ "@rollup/rollup-linux-loong64-gnu": "4.60.3",
+ "@rollup/rollup-linux-loong64-musl": "4.60.3",
+ "@rollup/rollup-linux-ppc64-gnu": "4.60.3",
+ "@rollup/rollup-linux-ppc64-musl": "4.60.3",
+ "@rollup/rollup-linux-riscv64-gnu": "4.60.3",
+ "@rollup/rollup-linux-riscv64-musl": "4.60.3",
+ "@rollup/rollup-linux-s390x-gnu": "4.60.3",
+ "@rollup/rollup-linux-x64-gnu": "4.60.3",
+ "@rollup/rollup-linux-x64-musl": "4.60.3",
+ "@rollup/rollup-openbsd-x64": "4.60.3",
+ "@rollup/rollup-openharmony-arm64": "4.60.3",
+ "@rollup/rollup-win32-arm64-msvc": "4.60.3",
+ "@rollup/rollup-win32-ia32-msvc": "4.60.3",
+ "@rollup/rollup-win32-x64-gnu": "4.60.3",
+ "@rollup/rollup-win32-x64-msvc": "4.60.3",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/rpc-websockets": {
+ "version": "9.3.8",
+ "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.8.tgz",
+ "integrity": "sha512-7r+fm4tSJmLf9GvZfL1DJ1SJwpagpp6AazqM0FUaeV7CA+7+NYINSk1syWa4tU/6OF2CyBicLtzENGmXRJH6wQ==",
+ "license": "LGPL-3.0-only",
+ "dependencies": {
+ "@swc/helpers": "^0.5.11",
+ "@types/uuid": "^10.0.0",
+ "@types/ws": "^8.2.2",
+ "buffer": "^6.0.3",
+ "eventemitter3": "^5.0.1",
+ "uuid": "^11.0.0",
+ "ws": "^8.5.0"
+ },
+ "funding": {
+ "type": "paypal",
+ "url": "https://paypal.me/kozjak"
+ },
+ "optionalDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^6.0.0"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/@types/ws": {
+ "version": "8.18.1",
+ "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
+ "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/eventemitter3": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
+ "license": "MIT"
+ },
+ "node_modules/rpc-websockets/node_modules/utf-8-validate": {
+ "version": "6.0.6",
+ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-6.0.6.tgz",
+ "integrity": "sha512-q3l3P9UtEEiAHcsgsqTgf9PPjctrDWoIXW3NpOHFdRDbLvu4DLIcxHangJ4RLrWkBcKjmcs/6NkerI8T/rE4LA==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "node-gyp-build": "^4.3.0"
+ },
+ "engines": {
+ "node": ">=6.14.2"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/uuid": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz",
+ "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/esm/bin/uuid"
+ }
+ },
+ "node_modules/rpc-websockets/node_modules/ws": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/source-map": {
+ "version": "0.7.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
+ "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/stream-chain": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz",
+ "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/stream-json": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz",
+ "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "stream-chain": "^2.2.5"
+ }
+ },
+ "node_modules/sucrase": {
+ "version": "3.35.1",
+ "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",
+ "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "commander": "^4.0.0",
+ "lines-and-columns": "^1.1.6",
+ "mz": "^2.7.0",
+ "pirates": "^4.0.1",
+ "tinyglobby": "^0.2.11",
+ "ts-interface-checker": "^0.1.9"
+ },
+ "bin": {
+ "sucrase": "bin/sucrase",
+ "sucrase-node": "bin/sucrase-node"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "node_modules/sucrase/node_modules/commander": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
+ "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
+ "node_modules/text-encoding-utf-8": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz",
+ "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg=="
+ },
+ "node_modules/thenify": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
+ "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "any-promise": "^1.0.0"
+ }
+ },
+ "node_modules/thenify-all": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
+ "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "thenify": ">= 3.1.0 < 4"
+ },
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
+ "node_modules/tinyexec": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
+ "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.16",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
+ "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/toml": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
+ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
+ "license": "MIT"
+ },
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
+ "license": "MIT"
+ },
+ "node_modules/tree-kill": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
+ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "tree-kill": "cli.js"
+ }
+ },
+ "node_modules/ts-interface-checker": {
+ "version": "0.1.13",
+ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
+ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",
+ "dev": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "license": "0BSD"
+ },
+ "node_modules/tsup": {
+ "version": "8.5.1",
+ "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz",
+ "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bundle-require": "^5.1.0",
+ "cac": "^6.7.14",
+ "chokidar": "^4.0.3",
+ "consola": "^3.4.0",
+ "debug": "^4.4.0",
+ "esbuild": "^0.27.0",
+ "fix-dts-default-cjs-exports": "^1.0.0",
+ "joycon": "^3.1.1",
+ "picocolors": "^1.1.1",
+ "postcss-load-config": "^6.0.1",
+ "resolve-from": "^5.0.0",
+ "rollup": "^4.34.8",
+ "source-map": "^0.7.6",
+ "sucrase": "^3.35.0",
+ "tinyexec": "^0.3.2",
+ "tinyglobby": "^0.2.11",
+ "tree-kill": "^1.2.2"
+ },
+ "bin": {
+ "tsup": "dist/cli-default.js",
+ "tsup-node": "dist/cli-node.js"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@microsoft/api-extractor": "^7.36.0",
+ "@swc/core": "^1",
+ "postcss": "^8.4.12",
+ "typescript": ">=4.5.0"
+ },
+ "peerDependenciesMeta": {
+ "@microsoft/api-extractor": {
+ "optional": true
+ },
+ "@swc/core": {
+ "optional": true
+ },
+ "postcss": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/ufo": {
+ "version": "1.6.4",
+ "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz",
+ "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "license": "MIT"
+ },
+ "node_modules/uuid": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+ "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).",
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/bin/uuid"
+ }
+ },
+ "node_modules/viem": {
+ "version": "2.48.8",
+ "resolved": "https://registry.npmjs.org/viem/-/viem-2.48.8.tgz",
+ "integrity": "sha512-Xj3Nrt66SKtn06kczU91ELn9Difr84ZM5A62BTlaisT5lpgt058i2mBkfMZCXHGb1ocOLjzC2ztPhD0Lvky7uQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/wevm"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "1.9.1",
+ "@noble/hashes": "1.8.0",
+ "@scure/bip32": "1.7.0",
+ "@scure/bip39": "1.6.0",
+ "abitype": "1.2.3",
+ "isows": "1.0.7",
+ "ox": "0.14.20",
+ "ws": "8.18.3"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/viem/node_modules/@noble/curves": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz",
+ "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/viem/node_modules/abitype": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz",
+ "integrity": "sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/wevm"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.4",
+ "zod": "^3.22.0 || ^4.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ },
+ "zod": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/viem/node_modules/ws": {
+ "version": "8.18.3",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz",
+ "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "license": "MIT",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
+ "node_modules/ws": {
+ "version": "7.5.10",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
+ "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.3.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": "^5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/agent-payments-crosschain-sdk/package.json b/agent-payments-crosschain-sdk/package.json
index 182f6f110..544be9afd 100644
--- a/agent-payments-crosschain-sdk/package.json
+++ b/agent-payments-crosschain-sdk/package.json
@@ -1,7 +1,7 @@
{
"name": "@pump-fun/agent-payments-crosschain-sdk",
"version": "0.1.0",
- "description": "Cross-chain payments SDK for Pump Agent — accept ETH/USDC on EVM chains, agent receives on Solana",
+ "description": "Cross-chain payments SDK for Pump Agent — Solana-native + EVM cross-chain support",
"publishConfig": {
"access": "public"
},
@@ -31,6 +31,11 @@
"types": "./dist/x402/index.d.ts",
"import": "./dist/x402/index.js",
"require": "./dist/x402/index.cjs"
+ },
+ "./solana-agent-kit": {
+ "types": "./dist/solana/solana-agent-kit/index.d.ts",
+ "import": "./dist/solana/solana-agent-kit/index.js",
+ "require": "./dist/solana/solana-agent-kit/index.cjs"
}
},
"files": [
@@ -44,11 +49,12 @@
"clean": "rm -rf dist"
},
"dependencies": {
- "@pump-fun/agent-payments-sdk": "^3.0.3",
+ "@coral-xyz/anchor": "^0.31.1",
+ "@solana/spl-token": "^0.4.9",
+ "@solana/web3.js": "^1.98.0",
"viem": "^2.21.0"
},
"peerDependencies": {
- "@solana/web3.js": "^1.98.0",
"zod": "^3.0.0"
},
"peerDependenciesMeta": {
diff --git a/agent-payments-crosschain-sdk/pump-fun-agent-payments-sdk-3.0.3.tgz b/agent-payments-crosschain-sdk/pump-fun-agent-payments-sdk-3.0.3.tgz
new file mode 100644
index 000000000..f15fe2737
Binary files /dev/null and b/agent-payments-crosschain-sdk/pump-fun-agent-payments-sdk-3.0.3.tgz differ
diff --git a/agent-payments-crosschain-sdk/src/CrossChainPaymentClient.ts b/agent-payments-crosschain-sdk/src/CrossChainPaymentClient.ts
new file mode 100644
index 000000000..dfd83ef94
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/CrossChainPaymentClient.ts
@@ -0,0 +1,139 @@
+import { Connection, PublicKey } from "@solana/web3.js";
+import type { Address } from "viem";
+import { PumpAgent } from "./solana/PumpAgent.js";
+import type {
+ CrossChainPaymentStatusResult,
+ CrossChainQuote,
+ EvmPaymentParams,
+ EvmPaymentReceipt,
+ EvmPaymentTransaction,
+ SupportedEvmChainId,
+} from "./types.js";
+import { getChain, isSupported } from "./chains.js";
+import { getQuote, type QuoteRequest } from "./evm/quote.js";
+import { buildEvmPaymentTransaction } from "./evm/transaction.js";
+import { getPaymentStatus, waitForSolanaArrival } from "./evm/validate.js";
+
+export interface CrossChainPaymentClientConfig {
+ /** Solana RPC endpoint */
+ rpcEndpoint: string;
+ /** Agent token mint (base58) */
+ agentMint: string;
+ /** "mainnet" | "devnet" — defaults to mainnet */
+ environment?: "mainnet" | "devnet";
+ /** Optional Pump.fun API key for higher rate limits */
+ apiKey?: string;
+}
+
+/**
+ * CrossChainPaymentClient — unified entry point for agent payments from any chain.
+ *
+ * Solana-native flow (existing):
+ * client.solana.buildAcceptPaymentInstructions(...)
+ *
+ * EVM cross-chain flow (new):
+ * const quote = await client.getEvmQuote(...)
+ * const txs = await client.buildEvmPayment({ quote, ... })
+ * // user signs txs.approval then txs.bridge in their EVM wallet
+ * const receipt = await client.submitEvmPayment(bridgeTxHash, quote)
+ * const result = await client.waitForArrival(receipt)
+ */
+export class CrossChainPaymentClient {
+ readonly agentMint: string;
+ readonly solana: PumpAgent;
+ private readonly apiKey?: string;
+
+ constructor(config: CrossChainPaymentClientConfig) {
+ this.agentMint = config.agentMint;
+ this.apiKey = config.apiKey;
+
+ const connection = new Connection(config.rpcEndpoint, "confirmed");
+ const mint = new PublicKey(config.agentMint);
+ this.solana = new PumpAgent(mint, config.environment ?? "mainnet", connection);
+ }
+
+ // ---------------------------------------------------------------------------
+ // EVM → Solana cross-chain flow
+ // ---------------------------------------------------------------------------
+
+ /**
+ * Get a cross-chain payment quote.
+ * Always fetch a fresh quote immediately before building the transaction.
+ */
+ async getEvmQuote(
+ fromChainId: SupportedEvmChainId,
+ fromToken: Address | "native",
+ fromAmount: bigint
+ ): Promise<CrossChainQuote> {
+ if (!isSupported(fromChainId)) {
+ throw new Error(`Chain ${fromChainId} is not supported`);
+ }
+ const req: QuoteRequest = {
+ fromChainId,
+ fromToken,
+ fromAmount,
+ agentMint: this.agentMint,
+ };
+ return getQuote(req, this.apiKey);
+ }
+
+ /**
+ * Build the EVM transaction(s) for a cross-chain payment.
+ * Send approval first (if present), then bridge.
+ */
+ async buildEvmPayment(
+ quote: CrossChainQuote,
+ sender: Address,
+ destinationSolanaWallet: string,
+ memo: string
+ ): Promise<EvmPaymentTransaction> {
+ const params: EvmPaymentParams = {
+ quote,
+ agentMint: this.agentMint,
+ destinationSolanaWallet,
+ memo,
+ sender,
+ };
+ return buildEvmPaymentTransaction(params, this.apiKey);
+ }
+
+ /**
+ * After the user submits the bridge transaction, create a receipt
+ * to track the cross-chain payment through to Solana.
+ */
+ createReceipt(
+ bridgeTxHash: `0x${string}`,
+ quote: CrossChainQuote,
+ depositId: string
+ ): EvmPaymentReceipt {
+ return {
+ txHash: bridgeTxHash,
+ chainId: quote.fromChainId,
+ fromAmount: quote.fromAmount,
+ fromToken: quote.fromToken,
+ depositId,
+ estimatedArrivalAt:
+ Math.floor(Date.now() / 1000) + quote.estimatedTimeSeconds,
+ };
+ }
+
+ /** Poll until the payment arrives on Solana or times out. */
+ async waitForArrival(
+ receipt: EvmPaymentReceipt,
+ opts: { timeoutMs?: number; pollIntervalMs?: number } = {}
+ ): Promise<CrossChainPaymentStatusResult> {
+ return waitForSolanaArrival(receipt, opts);
+ }
+
+ /** Single status check without blocking. */
+ async getPaymentStatus(
+ depositId: string
+ ): Promise<CrossChainPaymentStatusResult> {
+ return getPaymentStatus(depositId);
+ }
+
+ /** Chain metadata helper. */
+ getChainConfig(chainId: SupportedEvmChainId) {
+ return getChain(chainId);
+ }
+}
diff --git a/agent-payments-crosschain-sdk/src/index.ts b/agent-payments-crosschain-sdk/src/index.ts
new file mode 100644
index 000000000..201c488d5
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/index.ts
@@ -0,0 +1,15 @@
+// Solana — full source (PumpAgent, PumpAgentOffline, PDAs, events, x402, solana-agent-kit)
+export * from "./solana/index.js";
+
+// EVM cross-chain additions
+export * from "./types.js";
+export * from "./chains.js";
+export * from "./constants.js";
+export * from "./CrossChainPaymentClient.js";
+export * from "./evm/quote.js";
+export * from "./evm/transaction.js";
+export * from "./evm/validate.js";
+
+// Namespaced exports
+export * as evm from "./evm/index.js";
+export * as x402Evm from "./x402/index.js";
diff --git a/agent-payments-crosschain-sdk/src/solana/PumpAgent.ts b/agent-payments-crosschain-sdk/src/solana/PumpAgent.ts
new file mode 100644
index 000000000..526a0efa8
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/PumpAgent.ts
@@ -0,0 +1,416 @@
+import {
+ type Connection,
+ PublicKey,
+ type TransactionInstruction,
+} from "@solana/web3.js";
+import {
+ TOKEN_PROGRAM_ID,
+ getAssociatedTokenAddressSync,
+} from "@solana/spl-token";
+import { BN, EventParser } from "@coral-xyz/anchor";
+
+import { PumpAgentOffline } from "./PumpAgentOffline";
+import { getPumpProgramWithFallback } from "./program";
+import {
+ getBuybackAuthorityPDA,
+ getGlobalConfigPDA,
+ getInvoiceIdPDA,
+ getPaymentInCurrencyPDA,
+ getTokenAgentPaymentsPDA,
+ getWithdrawAuthorityPDA,
+} from "./pdas";
+import type {
+ AgentBalances,
+ GlobalConfig,
+ PumpEnvironment,
+ TokenAgentPaymentInCurrency,
+ TokenAgentPayments,
+ UpdateBuybackBpsParams,
+} from "./types";
+import {
+ parseAgentEvents,
+ type AgentAcceptPaymentEvent,
+ type ParsedAgentEvent,
+} from "./events";
+
+export class PumpAgent extends PumpAgentOffline {
+ private connection?: Connection;
+ private environment: PumpEnvironment;
+
+ constructor(
+ mint: PublicKey,
+ environment: PumpEnvironment = "mainnet",
+ connection?: Connection,
+ ) {
+ super(mint, getPumpProgramWithFallback(connection));
+ this.connection = connection;
+ this.environment = environment;
+ }
+
+ private get blockchainClientBaseUrl(): string {
+ return this.environment === "devnet"
+ ? "https://blockchain-client.internal.pump.fun"
+ : "https://fun-block.pump.fun";
+ }
+
+ /**
+ * Fetches the current balances for all three vaults for a given currency.
+ * Returns the vault address and its token balance.
+ * If a vault ATA does not exist yet the balance is reported as 0n.
+ */
+ async getBalances(
+ currencyMint: PublicKey,
+ currencyTokenProgram: PublicKey = TOKEN_PROGRAM_ID,
+ ): Promise<AgentBalances> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const [buybackAuthority] = getBuybackAuthorityPDA(this.mint);
+ const [withdrawAuthority] = getWithdrawAuthorityPDA(this.mint);
+
+ const paymentAta = getAssociatedTokenAddressSync(
+ currencyMint,
+ tokenAgentPayments,
+ true,
+ currencyTokenProgram,
+ );
+ const buybackAta = getAssociatedTokenAddressSync(
+ currencyMint,
+ buybackAuthority,
+ true,
+ currencyTokenProgram,
+ );
+ const withdrawAta = getAssociatedTokenAddressSync(
+ currencyMint,
+ withdrawAuthority,
+ true,
+ currencyTokenProgram,
+ );
+
+ const fetchBalance = async (ata: PublicKey): Promise<bigint> => {
+ try {
+ const resp = await connection.getTokenAccountBalance(ata);
+ return BigInt(resp.value.amount);
+ } catch {
+ return 0n;
+ }
+ };
+
+ const [paymentBal, buybackBal, withdrawBal] = await Promise.all([
+ fetchBalance(paymentAta),
+ fetchBalance(buybackAta),
+ fetchBalance(withdrawAta),
+ ]);
+
+ return {
+ paymentVault: { address: paymentAta, balance: paymentBal },
+ buybackVault: { address: buybackAta, balance: buybackBal },
+ withdrawVault: { address: withdrawAta, balance: withdrawBal },
+ };
+ }
+
+ /**
+ * Returns the `agent_update_buyback_bps` instruction and auto-fetches
+ * supported currencies from GlobalConfig when options are omitted.
+ */
+ async updateBuybackBps(
+ params: UpdateBuybackBpsParams,
+ ): Promise<TransactionInstruction> {
+ const { authority, buybackBps } = params;
+ const [globalConfigPda] = getGlobalConfigPDA();
+
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const globalConfigAccount =
+ await this.program.account.GlobalConfig.fetch(globalConfigPda);
+
+ const mints = globalConfigAccount.supportedCurrenciesMint.filter(
+ (m: PublicKey) => !PublicKey.default.equals(m),
+ );
+
+ const accountInfos = await connection.getMultipleAccountsInfo(mints);
+
+ const supportedCurrencies: { mint: PublicKey; tokenProgram: PublicKey }[] =
+ [];
+ for (const [idx, mint] of mints.entries()) {
+ const info = accountInfos[idx];
+ if (info) {
+ supportedCurrencies.push({ mint, tokenProgram: info.owner });
+ }
+ }
+
+ return super.updateBuybackBps(
+ { authority, buybackBps },
+ { supportedCurrencies },
+ );
+ }
+
+ // ─── Account Fetch Helpers ──────────────────────────────────────────────
+
+ /**
+ * Fetch the on-chain TokenAgentPayments config for this agent's mint.
+ * Returns the authority, buyback bps, and mint.
+ */
+ async getAgentConfig(): Promise<TokenAgentPayments> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [pda] = getTokenAgentPaymentsPDA(this.mint);
+ return this.program.account.TokenAgentPayments.fetch(pda);
+ }
+
+ /**
+ * Fetch the protocol-wide GlobalConfig account.
+ * Returns authorities and the list of supported currency mints.
+ */
+ async getGlobalConfig(): Promise<GlobalConfig> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [pda] = getGlobalConfigPDA();
+ return this.program.account.GlobalConfig.fetch(pda);
+ }
+
+ /**
+ * Fetch the per-currency accounting stats for this agent.
+ * Returns total payments, buybacks, withdrawals, and tokens burned.
+ */
+ async getPaymentStats(
+ currencyMint: PublicKey,
+ ): Promise<TokenAgentPaymentInCurrency> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [pda] = getPaymentInCurrencyPDA(this.mint, currencyMint);
+ return this.program.account.TokenAgentPaymentInCurrency.fetch(pda);
+ }
+
+ /**
+ * Fetch the list of supported currency mints from GlobalConfig,
+ * filtered to only non-default (non-zero) entries.
+ */
+ async getSupportedCurrencies(): Promise<PublicKey[]> {
+ const config = await this.getGlobalConfig();
+ return config.supportedCurrenciesMint.filter(
+ (m: PublicKey) => !PublicKey.default.equals(m),
+ );
+ }
+
+ /**
+ * Check whether the TokenAgentPayments account exists on-chain
+ * (i.e. whether this agent has been initialized).
+ */
+ async isInitialized(): Promise<boolean> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [pda] = getTokenAgentPaymentsPDA(this.mint);
+ const info = await connection.getAccountInfo(pda);
+ return info !== null;
+ }
+
+ // ─── Payment History ────────────────────────────────────────────────────
+
+ /**
+ * Fetch recent payment events for this agent by scanning on-chain
+ * transaction logs on the TokenAgentPayments PDA.
+ *
+ * @param limit - Maximum number of transactions to scan (default: 50)
+ * @returns Parsed `AgentAcceptPaymentEvent`s in reverse chronological order
+ */
+ async getPaymentHistory(
+ limit = 50,
+ ): Promise<AgentAcceptPaymentEvent[]> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const signatures = await connection.getSignaturesForAddress(
+ tokenAgentPayments,
+ { limit },
+ );
+
+ const payments: AgentAcceptPaymentEvent[] = [];
+
+ for (const sig of signatures) {
+ if (sig.err) continue;
+ const tx = await connection.getTransaction(sig.signature, {
+ maxSupportedTransactionVersion: 0,
+ });
+ if (!tx?.meta?.logMessages) continue;
+
+ const events = parseAgentEvents(tx.meta.logMessages, connection);
+ for (const event of events) {
+ if (event.name === "agentAcceptPaymentEvent") {
+ payments.push(event.data as AgentAcceptPaymentEvent);
+ }
+ }
+ }
+
+ return payments;
+ }
+
+ /**
+ * Fetch all recent events for this agent (payments, distributions,
+ * buybacks, withdrawals, etc.) from on-chain transaction logs.
+ *
+ * @param limit - Maximum number of transactions to scan (default: 50)
+ */
+ async getEventHistory(
+ limit = 50,
+ ): Promise<ParsedAgentEvent[]> {
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const signatures = await connection.getSignaturesForAddress(
+ tokenAgentPayments,
+ { limit },
+ );
+
+ const allEvents: ParsedAgentEvent[] = [];
+
+ for (const sig of signatures) {
+ if (sig.err) continue;
+ const tx = await connection.getTransaction(sig.signature, {
+ maxSupportedTransactionVersion: 0,
+ });
+ if (!tx?.meta?.logMessages) continue;
+
+ const events = parseAgentEvents(tx.meta.logMessages, connection);
+ allEvents.push(...events);
+ }
+
+ return allEvents;
+ }
+
+ // ─── Invoice Validation ─────────────────────────────────────────────────
+
+ async validateInvoicePayment(params: {
+ user: PublicKey;
+ currencyMint: PublicKey;
+ amount: number;
+ memo: number;
+ startTime: number;
+ endTime: number;
+ }): Promise<boolean> {
+ const { user, currencyMint } = params;
+ const amount = new BN(params.amount);
+ const memo = new BN(params.memo);
+ const startTime = new BN(params.startTime);
+ const endTime = new BN(params.endTime);
+
+ const [invoiceId] = getInvoiceIdPDA(
+ this.mint,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ );
+
+ try {
+ const url = new URL(
+ "/agents/invoice-id",
+ this.blockchainClientBaseUrl,
+ );
+ url.searchParams.set("invoice-id", invoiceId.toBase58());
+ url.searchParams.set("mint", this.mint.toBase58());
+
+ const response = await fetch(url.toString());
+ if (response.ok) {
+ const data = await response.json();
+ return (
+ data.user === user.toBase58() &&
+ data.tokenized_agent_mint === this.mint.toBase58() &&
+ data.currency_mint === currencyMint.toBase58() &&
+ new BN(data.amount).eq(amount) &&
+ new BN(data.memo).eq(memo) &&
+ new BN(data.start_time).eq(startTime) &&
+ new BN(data.end_time).eq(endTime)
+ );
+ }
+ } catch {
+ // Fall through to RPC validation
+ }
+
+ return this.validateInvoicePaymentViaRpc({
+ user,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ });
+ }
+
+ /** RPC-based fallback: scans on-chain transaction logs for the payment event. */
+ private async validateInvoicePaymentViaRpc(params: {
+ user: PublicKey;
+ currencyMint: PublicKey;
+ amount: BN;
+ memo: BN;
+ startTime: BN;
+ endTime: BN;
+ }): Promise<boolean> {
+ const { user, currencyMint, amount, memo, startTime, endTime } = params;
+ const connection = this.connection;
+ if (!connection) throw new Error("Connection is required");
+
+ const [invoiceId] = getInvoiceIdPDA(
+ this.mint,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ );
+
+ const signatures = await connection.getSignaturesForAddress(invoiceId);
+
+ for (const sig of signatures) {
+ const tx = await connection.getTransaction(sig.signature, {
+ maxSupportedTransactionVersion: 0,
+ });
+ if (!tx || tx.meta?.err) continue;
+
+ const logs = tx.meta?.logMessages;
+ if (!logs) continue;
+
+ const parser = new EventParser(
+ this.program.programId,
+ this.program.coder,
+ );
+
+ for (const event of parser.parseLogs(logs)) {
+ if (event.name !== "agentAcceptPaymentEvent") continue;
+
+ const data = event.data as {
+ user: PublicKey;
+ tokenizedAgentMint: PublicKey;
+ currencyMint: PublicKey;
+ amount: BN;
+ memo: BN;
+ startTime: BN;
+ endTime: BN;
+ };
+
+ if (
+ data.user.equals(user) &&
+ data.tokenizedAgentMint.equals(this.mint) &&
+ data.currencyMint.equals(currencyMint) &&
+ data.amount.eq(amount) &&
+ data.memo.eq(memo) &&
+ data.startTime.eq(startTime) &&
+ data.endTime.eq(endTime)
+ ) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/PumpAgentOffline.ts b/agent-payments-crosschain-sdk/src/solana/PumpAgentOffline.ts
new file mode 100644
index 000000000..931db430c
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/PumpAgentOffline.ts
@@ -0,0 +1,432 @@
+import {
+ ComputeBudgetProgram,
+ PublicKey,
+ SystemProgram,
+ type Connection,
+ type TransactionInstruction,
+} from "@solana/web3.js";
+import {
+ getAssociatedTokenAddressSync,
+ TOKEN_PROGRAM_ID,
+ NATIVE_MINT,
+ createAssociatedTokenAccountIdempotentInstruction,
+ createSyncNativeInstruction,
+ createCloseAccountInstruction,
+} from "@solana/spl-token";
+import { BN, type Program } from "@coral-xyz/anchor";
+
+import type { PumpAgentPayments as PumpAgentPaymentsIDL } from "./idl/pump_agent_payments";
+import { getPumpProgramWithFallback } from "./program";
+import {
+ getBondingCurvePDA,
+ getBuybackAuthorityPDA,
+ getGlobalConfigPDA,
+ getInvoiceIdPDA,
+ getPaymentInCurrencyPDA,
+ getTokenAgentPaymentsPDA,
+ getWithdrawAuthorityPDA,
+} from "./pdas";
+import type {
+ AcceptPaymentParams,
+ BuildAcceptPaymentParams,
+ BuybackTriggerParams,
+ CloseAccountParams,
+ CreateParams,
+ DistributePaymentsParams,
+ ExtendAccountParams,
+ UpdateAuthorityParams,
+ UpdateBuybackBpsOptions,
+ UpdateBuybackBpsParams,
+ WithdrawParams,
+} from "./types";
+
+function toBN(value: bigint | number | string): BN {
+ return new BN(value.toString());
+}
+
+export class PumpAgentOffline {
+ readonly mint: PublicKey;
+ protected readonly program: Program<PumpAgentPaymentsIDL>;
+
+ static readonly DEFAULT_COMPUTE_UNIT_LIMIT_FOR_AGENT_PAYMENTS = 100_000;
+ static readonly DEFAULT_PRIORITY_FEE_MICRO_LAMPORTS = 1_000;
+
+ constructor(
+ mint: PublicKey,
+ program: Program<PumpAgentPaymentsIDL> = getPumpProgramWithFallback(),
+ ) {
+ this.mint = mint;
+ this.program = program;
+ }
+
+ static load(
+ mint: PublicKey,
+ connection?: Connection,
+ ): PumpAgentOffline {
+ return new PumpAgentOffline(mint, getPumpProgramWithFallback(connection));
+ }
+
+ async create(params: CreateParams): Promise<TransactionInstruction> {
+ const { authority, mint, agentAuthority, buybackBps } = params;
+ const [bondingCurve] = getBondingCurvePDA(mint);
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(mint);
+
+ return this.program.methods
+ .agentInitialize(agentAuthority, buybackBps)
+ .accountsPartial({
+ authority,
+ bondingCurve,
+ mint,
+ tokenAgentPayments,
+ })
+ .instruction();
+ }
+
+ async withdraw(params: WithdrawParams): Promise<TransactionInstruction> {
+ const { authority, currencyMint, receiverAta, tokenProgram } = params;
+ const tp = tokenProgram ?? TOKEN_PROGRAM_ID;
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const [withdrawAuthority] = getWithdrawAuthorityPDA(this.mint);
+ const withdrawVault = getAssociatedTokenAddressSync(
+ currencyMint,
+ withdrawAuthority,
+ true,
+ tp,
+ );
+
+ return this.program.methods
+ .agentWithdraw()
+ .accountsPartial({
+ authority,
+ tokenAgentPayments,
+ currencyMint,
+ withdrawAuthority,
+ withdrawVault,
+ receiverAta,
+ tokenProgram: tp,
+ })
+ .instruction();
+ }
+
+ async updateBuybackBps(
+ params: UpdateBuybackBpsParams,
+ options: UpdateBuybackBpsOptions,
+ ): Promise<TransactionInstruction> {
+ const { authority, buybackBps } = params;
+ const supportedCurrencies = options.supportedCurrencies;
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const [globalConfig] = getGlobalConfigPDA();
+
+ const remainingAccounts: {
+ pubkey: PublicKey;
+ isWritable: boolean;
+ isSigner: boolean;
+ }[] = [];
+
+ for (const currency of supportedCurrencies) {
+ if (currency.mint.equals(PublicKey.default)) continue;
+ const ata = getAssociatedTokenAddressSync(
+ currency.mint,
+ tokenAgentPayments,
+ true,
+ currency.tokenProgram,
+ );
+ remainingAccounts.push({
+ pubkey: ata,
+ isWritable: false,
+ isSigner: false,
+ });
+ }
+
+ return this.program.methods
+ .agentUpdateBuybackBps(buybackBps)
+ .accountsPartial({
+ authority,
+ tokenAgentPayments,
+ globalConfig,
+ })
+ .remainingAccounts(remainingAccounts)
+ .instruction();
+ }
+
+ async acceptPayment(
+ params: AcceptPaymentParams,
+ ): Promise<TransactionInstruction> {
+ const {
+ user,
+ userTokenAccount,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ tokenProgram,
+ } = params;
+ const tp = tokenProgram ?? TOKEN_PROGRAM_ID;
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const [globalConfig] = getGlobalConfigPDA();
+ const [paymentInCurrency] = getPaymentInCurrencyPDA(
+ this.mint,
+ currencyMint,
+ );
+ const [invoiceId] = getInvoiceIdPDA(
+ this.mint,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ );
+ const tokenAgentAssociatedAccount = getAssociatedTokenAddressSync(
+ currencyMint,
+ tokenAgentPayments,
+ true,
+ tp,
+ );
+
+ return this.program.methods
+ .agentAcceptPayment(amount, memo, startTime, endTime)
+ .accountsPartial({
+ user,
+ userTokenAccount,
+ tokenAgentPayments,
+ tokenAgentAssociatedAccount,
+ tokenAgentPaymentInCurrency: paymentInCurrency,
+ globalConfig,
+ invoiceId,
+ currencyMint,
+ tokenProgram: tp,
+ })
+ .instruction();
+ }
+
+ async buildAcceptPaymentInstructions(
+ params: BuildAcceptPaymentParams,
+ ): Promise<TransactionInstruction[]> {
+ const { user, currencyMint } = params;
+ const computeUnitLimit =
+ params.computeUnitLimit ??
+ PumpAgentOffline.DEFAULT_COMPUTE_UNIT_LIMIT_FOR_AGENT_PAYMENTS;
+ const tp = params.tokenProgram ?? TOKEN_PROGRAM_ID;
+
+ const userTokenAccount = getAssociatedTokenAddressSync(
+ currencyMint,
+ user,
+ false,
+ tp,
+ );
+
+ const acceptIx = await this.acceptPayment({
+ user,
+ userTokenAccount,
+ currencyMint,
+ amount: toBN(params.amount),
+ memo: toBN(params.memo),
+ startTime: toBN(params.startTime),
+ endTime: toBN(params.endTime),
+ tokenProgram: params.tokenProgram,
+ });
+
+ const ixs: TransactionInstruction[] = [
+ ComputeBudgetProgram.setComputeUnitLimit({ units: computeUnitLimit }),
+ ];
+
+ if (params.computeUnitPrice != null) {
+ ixs.push(
+ ComputeBudgetProgram.setComputeUnitPrice({
+ microLamports: params.computeUnitPrice,
+ }),
+ );
+ }
+
+ if (currencyMint.equals(NATIVE_MINT)) {
+ return [
+ ...ixs,
+ createAssociatedTokenAccountIdempotentInstruction(
+ user,
+ userTokenAccount,
+ user,
+ NATIVE_MINT,
+ ),
+ SystemProgram.transfer({
+ fromPubkey: user,
+ toPubkey: userTokenAccount,
+ lamports: BigInt(params.amount.toString()),
+ }),
+ createSyncNativeInstruction(userTokenAccount),
+ acceptIx,
+ createCloseAccountInstruction(userTokenAccount, user, user),
+ ];
+ }
+
+ return [...ixs, acceptIx];
+ }
+
+ async distributePayments(
+ params: DistributePaymentsParams,
+ ): Promise<TransactionInstruction[]> {
+ const {
+ user,
+ currencyMint,
+ tokenProgram,
+ includeTransferExtraLamportsForNative = false,
+ } = params;
+ const tp = tokenProgram ?? TOKEN_PROGRAM_ID;
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const [globalConfig] = getGlobalConfigPDA();
+ const [paymentInCurrency] = getPaymentInCurrencyPDA(
+ this.mint,
+ currencyMint,
+ );
+ const [buybackAuthority] = getBuybackAuthorityPDA(this.mint);
+ const [withdrawAuthority] = getWithdrawAuthorityPDA(this.mint);
+
+ const tokenAgentAssociatedAccount = getAssociatedTokenAddressSync(
+ currencyMint,
+ tokenAgentPayments,
+ true,
+ tp,
+ );
+ const buybackVault = getAssociatedTokenAddressSync(
+ currencyMint,
+ buybackAuthority,
+ true,
+ tp,
+ );
+ const withdrawVault = getAssociatedTokenAddressSync(
+ currencyMint,
+ withdrawAuthority,
+ true,
+ tp,
+ );
+
+ const distributeIx = await this.program.methods
+ .agentDistributePayments()
+ .accountsPartial({
+ user,
+ globalConfig,
+ currencyMint,
+ tokenAgentPayments,
+ tokenAgentPaymentInCurrency: paymentInCurrency,
+ tokenAgentAssociatedAccount,
+ buybackAuthority,
+ withdrawAuthority,
+ buybackVault,
+ withdrawVault,
+ tokenProgram: tp,
+ })
+ .instruction();
+
+ if (includeTransferExtraLamportsForNative && currencyMint.equals(NATIVE_MINT)) {
+ const transferIx = await this.program.methods
+ .agentTransferExtraLamports()
+ .accountsPartial({
+ tokenAgentPayments,
+ tokenAgentAssociatedAccount,
+ })
+ .instruction();
+ return [transferIx, distributeIx];
+ }
+
+ return [distributeIx];
+ }
+
+ async buybackTrigger(
+ params: BuybackTriggerParams,
+ ): Promise<TransactionInstruction> {
+ const {
+ globalBuybackAuthority,
+ currencyMint,
+ swapProgramToInvoke,
+ swapInstructionData,
+ remainingAccounts,
+ tokenProgramCurrency,
+ tokenProgram,
+ } = params;
+ const tp = tokenProgram ?? TOKEN_PROGRAM_ID;
+ const tpCurrency = tokenProgramCurrency ?? TOKEN_PROGRAM_ID;
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+ const [globalConfig] = getGlobalConfigPDA();
+ const [buybackAuthority] = getBuybackAuthorityPDA(this.mint);
+ const [paymentInCurrency] = getPaymentInCurrencyPDA(
+ this.mint,
+ currencyMint,
+ );
+ const burnMintVault = getAssociatedTokenAddressSync(
+ this.mint,
+ buybackAuthority,
+ true,
+ tp,
+ );
+ const burnCurrencyMintVault = getAssociatedTokenAddressSync(
+ currencyMint,
+ buybackAuthority,
+ true,
+ tpCurrency,
+ );
+
+ return this.program.methods
+ .agentBuybackTrigger(swapInstructionData)
+ .accountsPartial({
+ globalBuybackAuthority,
+ mint: this.mint,
+ tokenAgentPayments,
+ tokenAgentPaymentInCurrency: paymentInCurrency,
+ currencyMint,
+ globalConfig,
+ swapProgramToInvoke,
+ burnAuthority: buybackAuthority,
+ burnMintVault,
+ burnCurrencyMintVault,
+ tokenProgram: tp,
+ tokenProgramCurrency: tpCurrency,
+ })
+ .remainingAccounts(remainingAccounts)
+ .instruction();
+ }
+
+ async extendAccount(
+ params: ExtendAccountParams,
+ ): Promise<TransactionInstruction> {
+ const { account, user } = params;
+ return this.program.methods
+ .extendAccount()
+ .accountsPartial({ account, user })
+ .instruction();
+ }
+
+ async updateAuthority(
+ params: UpdateAuthorityParams,
+ ): Promise<TransactionInstruction> {
+ const { authority, newAuthority } = params;
+ const [tokenAgentPayments] = getTokenAgentPaymentsPDA(this.mint);
+
+ return this.program.methods
+ .agentUpdateAuthority(newAuthority)
+ .accountsPartial({
+ authority,
+ tokenAgentPayments,
+ })
+ .instruction();
+ }
+
+ /**
+ * Returns the `close_account` instruction to close a program account
+ * and reclaim its rent-exempt lamports.
+ */
+ async closeAccount(
+ params: CloseAccountParams,
+ ): Promise<TransactionInstruction> {
+ const { account, user } = params;
+ const [globalConfig] = getGlobalConfigPDA();
+
+ return this.program.methods
+ .closeAccount()
+ .accountsPartial({
+ account,
+ user,
+ globalConfig,
+ })
+ .instruction();
+ }
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/decoders.ts b/agent-payments-crosschain-sdk/src/solana/decoders.ts
new file mode 100644
index 000000000..922507469
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/decoders.ts
@@ -0,0 +1,31 @@
+import { OFFLINE_PUMP_PROGRAM } from "./program";
+import type {
+ GlobalConfig,
+ TokenAgentPaymentInCurrency,
+ TokenAgentPayments,
+} from "./types";
+
+export function decodeGlobalConfig(accountData: Buffer): GlobalConfig {
+ return OFFLINE_PUMP_PROGRAM.coder.accounts.decode(
+ "globalConfig",
+ accountData,
+ );
+}
+
+export function decodeTokenAgentPaymentInCurrency(
+ accountData: Buffer,
+): TokenAgentPaymentInCurrency {
+ return OFFLINE_PUMP_PROGRAM.coder.accounts.decode(
+ "tokenAgentPaymentInCurrency",
+ accountData,
+ );
+}
+
+export function decodeTokenAgentPayments(
+ accountData: Buffer,
+): TokenAgentPayments {
+ return OFFLINE_PUMP_PROGRAM.coder.accounts.decode(
+ "tokenAgentPayments",
+ accountData,
+ );
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/events.ts b/agent-payments-crosschain-sdk/src/solana/events.ts
new file mode 100644
index 000000000..2aa47876a
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/events.ts
@@ -0,0 +1,242 @@
+import { PublicKey, type Connection } from "@solana/web3.js";
+import { BN, EventParser, type Program } from "@coral-xyz/anchor";
+import type { PumpAgentPayments as PumpAgentPaymentsIDL } from "./idl/pump_agent_payments";
+import { getPumpProgramWithFallback, OFFLINE_PUMP_PROGRAM } from "./program";
+
+// ─── Typed Event Interfaces ─────────────────────────────────────────────────
+
+export interface AgentAcceptPaymentEvent {
+ user: PublicKey;
+ tokenizedAgentMint: PublicKey;
+ tokenAgentPayments: PublicKey;
+ currencyMint: PublicKey;
+ amount: BN;
+ memo: BN;
+ startTime: BN;
+ endTime: BN;
+ invoiceId: PublicKey;
+ agentPostBalance: BN;
+ timestamp: BN;
+}
+
+export interface AgentBuybackTriggerEvent {
+ tokenizedAgentMint: PublicKey;
+ currencyMint: PublicKey;
+ amountBurned: BN;
+ swapProgram: PublicKey;
+ newTokensBoughtAndBurnedForCurrency: BN;
+ agentPostBalance: BN;
+ timestamp: BN;
+ currencyMintAmountForBuyback: BN;
+}
+
+export interface AgentDistributePaymentsEvent {
+ tokenAgentPayments: PublicKey;
+ currencyMint: PublicKey;
+ buybackBps: number;
+ buybackAmount: BN;
+ withdrawAmount: BN;
+ timestamp: BN;
+}
+
+export interface AgentInitializeEvent {
+ tokenAgentPayments: PublicKey;
+ mint: PublicKey;
+ authority: PublicKey;
+ buybackBps: number;
+ timestamp: BN;
+ tokenizedAgentSequence: BN;
+}
+
+export interface AgentUpdateAuthorityEvent {
+ tokenAgentPayments: PublicKey;
+ oldAuthority: PublicKey;
+ newAuthority: PublicKey;
+ timestamp: BN;
+}
+
+export interface AgentUpdateBuybackBpsEvent {
+ tokenAgentPayments: PublicKey;
+ mint: PublicKey;
+ oldBuybackBps: number;
+ newBuybackBps: number;
+ timestamp: BN;
+}
+
+export interface AgentWithdrawEvent {
+ tokenizedAgentMint: PublicKey;
+ currencyMint: PublicKey;
+ amount: BN;
+ receiver: PublicKey;
+ timestamp: BN;
+}
+
+export interface ExtendAccountEvent {
+ account: PublicKey;
+ user: PublicKey;
+ currentSize: BN;
+ newSize: BN;
+ timestamp: BN;
+}
+
+export interface GlobalAddNewCurrencyEvent {
+ globalConfig: PublicKey;
+ currencyMint: PublicKey;
+ timestamp: BN;
+}
+
+export interface GlobalConfigInitializeEvent {
+ globalConfig: PublicKey;
+ protocolAuthority: PublicKey;
+ buybackAuthority: PublicKey;
+ timestamp: BN;
+}
+
+export interface GlobalUpdateAuthoritiesEvent {
+ globalConfig: PublicKey;
+ protocolAuthority: PublicKey | null;
+ buybackAuthority: PublicKey | null;
+ timestamp: BN;
+}
+
+// ─── Event Name Union ───────────────────────────────────────────────────────
+
+export type AgentEventName =
+ | "agentAcceptPaymentEvent"
+ | "agentBuybackTriggerEvent"
+ | "agentDistributePaymentsEvent"
+ | "agentInitializeEvent"
+ | "agentUpdateAuthorityEvent"
+ | "agentUpdateBuybackBpsEvent"
+ | "agentWithdrawEvent"
+ | "extendAccountEvent"
+ | "globalAddNewCurrencyEvent"
+ | "globalConfigInitializeEvent"
+ | "globalUpdateAuthoritiesEvent";
+
+export type AgentEventData =
+ | AgentAcceptPaymentEvent
+ | AgentBuybackTriggerEvent
+ | AgentDistributePaymentsEvent
+ | AgentInitializeEvent
+ | AgentUpdateAuthorityEvent
+ | AgentUpdateBuybackBpsEvent
+ | AgentWithdrawEvent
+ | ExtendAccountEvent
+ | GlobalAddNewCurrencyEvent
+ | GlobalConfigInitializeEvent
+ | GlobalUpdateAuthoritiesEvent;
+
+export interface ParsedAgentEvent<
+ T extends AgentEventData = AgentEventData,
+> {
+ name: AgentEventName;
+ data: T;
+}
+
+// ─── Event Parser ───────────────────────────────────────────────────────────
+
+/**
+ * Create an Anchor EventParser bound to the Pump Agent Payments program.
+ * Works offline (no connection required) or with a connection.
+ */
+export function createEventParser(
+ connection?: Connection,
+): EventParser {
+ const program: Program<PumpAgentPaymentsIDL> = connection
+ ? getPumpProgramWithFallback(connection)
+ : OFFLINE_PUMP_PROGRAM;
+ return new EventParser(program.programId, program.coder);
+}
+
+/**
+ * Parse transaction log messages into typed agent events.
+ *
+ * @example
+ * ```ts
+ * const tx = await connection.getTransaction(sig, { maxSupportedTransactionVersion: 0 });
+ * const events = parseAgentEvents(tx.meta.logMessages);
+ * for (const event of events) {
+ * if (event.name === "agentAcceptPaymentEvent") {
+ * console.log("Payment:", event.data.amount.toString());
+ * }
+ * }
+ * ```
+ */
+export function parseAgentEvents(
+ logs: string[],
+ connection?: Connection,
+): ParsedAgentEvent[] {
+ const parser = createEventParser(connection);
+ const events: ParsedAgentEvent[] = [];
+
+ for (const event of parser.parseLogs(logs)) {
+ events.push({
+ name: event.name as AgentEventName,
+ data: event.data as AgentEventData,
+ });
+ }
+
+ return events;
+}
+
+// ─── Event Subscription ─────────────────────────────────────────────────────
+
+export interface EventSubscriptionOptions {
+ /** Filter to specific event names. If omitted, all events are emitted. */
+ eventNames?: AgentEventName[];
+}
+
+export interface EventSubscription {
+ /** Stop listening and clean up the WebSocket subscription. */
+ unsubscribe(): void;
+}
+
+/**
+ * Subscribe to real-time Pump Agent Payments program events via WebSocket.
+ * Calls the provided callback whenever a matching event is detected.
+ *
+ * @example
+ * ```ts
+ * const sub = subscribeToAgentEvents(connection, (event, slot) => {
+ * console.log(`[slot ${slot}] ${event.name}`, event.data);
+ * }, { eventNames: ["agentAcceptPaymentEvent"] });
+ *
+ * // Later: stop listening
+ * sub.unsubscribe();
+ * ```
+ */
+export function subscribeToAgentEvents(
+ connection: Connection,
+ callback: (event: ParsedAgentEvent, slot: number) => void,
+ options?: EventSubscriptionOptions,
+): EventSubscription {
+ const parser = createEventParser(connection);
+ const filterNames = options?.eventNames
+ ? new Set(options.eventNames)
+ : null;
+
+ const subId = connection.onLogs(
+ OFFLINE_PUMP_PROGRAM.programId,
+ (logInfo, ctx) => {
+ if (logInfo.err) return;
+
+ for (const event of parser.parseLogs(logInfo.logs)) {
+ const parsed: ParsedAgentEvent = {
+ name: event.name as AgentEventName,
+ data: event.data as AgentEventData,
+ };
+
+ if (filterNames && !filterNames.has(parsed.name)) continue;
+ callback(parsed, ctx.slot);
+ }
+ },
+ "confirmed",
+ );
+
+ return {
+ unsubscribe() {
+ connection.removeOnLogsListener(subId);
+ },
+ };
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/idl/pump_agent_payments.json b/agent-payments-crosschain-sdk/src/solana/idl/pump_agent_payments.json
new file mode 100644
index 000000000..40015e533
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/idl/pump_agent_payments.json
@@ -0,0 +1,766 @@
+{
+ "address": "AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7",
+ "metadata": {
+ "name": "pump_agent_payments",
+ "version": "0.1.0",
+ "spec": "0.1.0",
+ "description": "Created with Anchor"
+ },
+ "instructions": [
+ {
+ "name": "agent_accept_payment",
+ "discriminator": [34, 157, 64, 220, 74, 32, 48, 225],
+ "accounts": [
+ { "name": "user", "writable": true, "signer": true },
+ { "name": "user_token_account", "writable": true },
+ { "name": "token_agent_payments" },
+ {
+ "name": "token_agent_associated_account",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "token_agent_payments" },
+ {
+ "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": "currency_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": "token_agent_payment_in_currency",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [112,97,121,109,101,110,116,45,105,110,45,99,117,114,114,101,110,99,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" },
+ { "kind": "account", "path": "currency_mint" }
+ ]
+ }
+ },
+ {
+ "name": "global_config",
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "invoice_id" },
+ { "name": "currency_mint" },
+ { "name": "token_program" },
+ { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { "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": "amount", "type": "u64" },
+ { "name": "memo", "type": "u64" },
+ { "name": "start_time", "type": "i64" },
+ { "name": "end_time", "type": "i64" }
+ ]
+ },
+ {
+ "name": "agent_buyback_trigger",
+ "discriminator": [95, 231, 193, 2, 245, 75, 125, 155],
+ "accounts": [
+ { "name": "global_buyback_authority", "writable": true, "signer": true },
+ { "name": "mint", "writable": true },
+ {
+ "name": "token_agent_payments",
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [116,111,107,101,110,45,97,103,101,110,116,45,112,97,121,109,101,110,116,115] },
+ { "kind": "account", "path": "mint" }
+ ]
+ }
+ },
+ {
+ "name": "token_agent_payment_in_currency",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [112,97,121,109,101,110,116,45,105,110,45,99,117,114,114,101,110,99,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" },
+ { "kind": "account", "path": "currency_mint" }
+ ]
+ }
+ },
+ { "name": "currency_mint" },
+ {
+ "name": "global_config",
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "swap_program_to_invoke" },
+ {
+ "name": "burn_authority",
+ "docs": ["Intentionally called burn_authority", "TO avoid any confusion with the global buyback authority."],
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [98,117,121,98,97,99,107,45,97,117,116,104,111,114,105,116,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" }
+ ]
+ }
+ },
+ {
+ "name": "burn_mint_vault",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "burn_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": "burn_currency_mint_vault",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "burn_authority" },
+ { "kind": "account", "path": "token_program_currency" },
+ { "kind": "account", "path": "currency_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": "token_program" },
+ { "name": "token_program_currency" },
+ { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { "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": "swap_instruction_data", "type": "bytes" }
+ ]
+ },
+ {
+ "name": "agent_distribute_payments",
+ "discriminator": [145, 44, 246, 47, 192, 204, 95, 32],
+ "accounts": [
+ { "name": "user", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "currency_mint" },
+ { "name": "token_agent_payments", "writable": true },
+ {
+ "name": "token_agent_payment_in_currency",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [112,97,121,109,101,110,116,45,105,110,45,99,117,114,114,101,110,99,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" },
+ { "kind": "account", "path": "currency_mint" }
+ ]
+ }
+ },
+ {
+ "name": "token_agent_associated_account",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "token_agent_payments" },
+ { "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": "currency_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": "buyback_authority",
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [98,117,121,98,97,99,107,45,97,117,116,104,111,114,105,116,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" }
+ ]
+ }
+ },
+ {
+ "name": "withdraw_authority",
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [119,105,116,104,100,114,97,119,45,97,117,116,104,111,114,105,116,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" }
+ ]
+ }
+ },
+ {
+ "name": "buyback_vault",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "buyback_authority" },
+ { "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": "currency_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": "withdraw_vault",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "withdraw_authority" },
+ { "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": "currency_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": "token_program" },
+ { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { "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": "agent_initialize",
+ "discriminator": [180, 248, 163, 8, 49, 94, 126, 96],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ {
+ "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": "global_config",
+ "writable": true,
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "mint" },
+ {
+ "name": "token_agent_payments",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [116,111,107,101,110,45,97,103,101,110,116,45,112,97,121,109,101,110,116,115] },
+ { "kind": "account", "path": "mint" }
+ ]
+ }
+ },
+ { "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": "authority", "type": "pubkey" },
+ { "name": "buyback_bps", "type": "u16" }
+ ]
+ },
+ {
+ "name": "agent_transfer_extra_lamports",
+ "discriminator": [39, 206, 214, 167, 55, 44, 221, 81],
+ "accounts": [
+ {
+ "name": "token_agent_payments",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [116,111,107,101,110,45,97,103,101,110,116,45,112,97,121,109,101,110,116,115] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" }
+ ]
+ }
+ },
+ {
+ "name": "token_agent_associated_account",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "token_agent_payments" },
+ { "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": "const", "value": [6,155,136,87,254,171,129,132,251,104,127,99,70,24,192,53,218,196,57,220,26,235,59,85,152,160,240,0,0,0,0,1] }
+ ],
+ "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]
+ }
+ }
+ }
+ ],
+ "args": []
+ },
+ {
+ "name": "agent_update_authority",
+ "discriminator": [237, 228, 227, 224, 226, 198, 167, 83],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "token_agent_payments", "writable": 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": "new_authority", "type": "pubkey" }
+ ]
+ },
+ {
+ "name": "agent_update_buyback_bps",
+ "discriminator": [41, 28, 118, 90, 53, 24, 63, 160],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ { "name": "token_agent_payments", "writable": true },
+ {
+ "name": "global_config",
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ {
+ "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": "buyback_bps", "type": "u16" }
+ ]
+ },
+ {
+ "name": "agent_withdraw",
+ "discriminator": [13, 149, 99, 245, 171, 171, 185, 53],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ { "name": "token_agent_payments" },
+ { "name": "currency_mint" },
+ {
+ "name": "withdraw_authority",
+ "pda": {
+ "seeds": [
+ { "kind": "const", "value": [119,105,116,104,100,114,97,119,45,97,117,116,104,111,114,105,116,121] },
+ { "kind": "account", "path": "token_agent_payments.mint", "account": "TokenAgentPayments" }
+ ]
+ }
+ },
+ {
+ "name": "withdraw_vault",
+ "writable": true,
+ "pda": {
+ "seeds": [
+ { "kind": "account", "path": "withdraw_authority" },
+ { "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": "currency_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": "receiver_ata", "writable": true },
+ { "name": "token_program" },
+ { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { "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": "close_account",
+ "discriminator": [125, 255, 149, 14, 110, 34, 72, 24],
+ "accounts": [
+ { "name": "account", "writable": true },
+ { "name": "user", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "system_program", "address": "11111111111111111111111111111111" }
+ ],
+ "args": []
+ },
+ {
+ "name": "extend_account",
+ "discriminator": [234, 102, 194, 203, 150, 72, 62, 229],
+ "accounts": [
+ { "name": "account", "writable": true },
+ { "name": "user", "writable": true, "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": "global_add_new_currency",
+ "discriminator": [46, 135, 47, 120, 118, 204, 177, 224],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "writable": true,
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ { "name": "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": "global_config_initialize",
+ "discriminator": [61, 23, 208, 192, 232, 52, 8, 66],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "writable": true,
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,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": "protocol_authority", "type": "pubkey" },
+ { "name": "buyback_authority", "type": "pubkey" }
+ ]
+ },
+ {
+ "name": "global_remove_currency",
+ "discriminator": [57, 226, 180, 140, 91, 14, 231, 196],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "writable": true,
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ {
+ "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": "u8" }
+ ]
+ },
+ {
+ "name": "global_update_authorities",
+ "discriminator": [91, 137, 72, 77, 183, 184, 168, 125],
+ "accounts": [
+ { "name": "authority", "writable": true, "signer": true },
+ {
+ "name": "global_config",
+ "writable": true,
+ "pda": { "seeds": [{ "kind": "const", "value": [103,108,111,98,97,108,45,99,111,110,102,105,103] }] }
+ },
+ {
+ "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": "protocol_authority", "type": { "option": "pubkey" } },
+ { "name": "buyback_authority", "type": { "option": "pubkey" } }
+ ]
+ }
+ ],
+ "accounts": [
+ { "name": "BondingCurve", "discriminator": [23, 183, 248, 55, 96, 216, 172, 96] },
+ { "name": "GlobalConfig", "discriminator": [149, 8, 156, 202, 160, 252, 176, 217] },
+ { "name": "TokenAgentPaymentInCurrency", "discriminator": [225, 195, 81, 227, 115, 43, 25, 177] },
+ { "name": "TokenAgentPayments", "discriminator": [136, 241, 242, 217, 173, 77, 112, 186] }
+ ],
+ "events": [
+ { "name": "AgentAcceptPaymentEvent", "discriminator": [114, 190, 188, 192, 105, 79, 41, 147] },
+ { "name": "AgentBuybackTriggerEvent", "discriminator": [139, 240, 9, 225, 214, 63, 232, 165] },
+ { "name": "AgentDistributePaymentsEvent", "discriminator": [137, 116, 114, 140, 54, 111, 230, 26] },
+ { "name": "AgentInitializeEvent", "discriminator": [192, 5, 183, 151, 0, 64, 100, 207] },
+ { "name": "AgentUpdateAuthorityEvent", "discriminator": [36, 212, 117, 235, 74, 166, 60, 16] },
+ { "name": "AgentUpdateBuybackBpsEvent", "discriminator": [165, 251, 40, 19, 114, 26, 128, 232] },
+ { "name": "AgentWithdrawEvent", "discriminator": [174, 231, 201, 69, 254, 183, 49, 85] },
+ { "name": "ExtendAccountEvent", "discriminator": [97, 97, 215, 144, 93, 146, 22, 124] },
+ { "name": "GlobalAddNewCurrencyEvent", "discriminator": [130, 202, 37, 248, 241, 182, 233, 35] },
+ { "name": "GlobalConfigInitializeEvent", "discriminator": [241, 51, 222, 190, 142, 245, 176, 53] },
+ { "name": "GlobalUpdateAuthoritiesEvent", "discriminator": [82, 27, 22, 232, 53, 66, 35, 207] }
+ ],
+ "errors": [
+ { "code": 6000, "name": "UnauthorizedSigner", "msg": "The given account is not authorized to execute this instruction." },
+ { "code": 6001, "name": "CurrencyAlreadySupported", "msg": "The given currency is already supported." },
+ { "code": 6002, "name": "MaxCurrenciesReached", "msg": "The maximum number of currencies has been reached." },
+ { "code": 6003, "name": "InvalidBuybackBps", "msg": "The buyback basis points is greater than 10000." },
+ { "code": 6004, "name": "CurrencyNotSupported", "msg": "The given currency is not supported." },
+ { "code": 6005, "name": "MathOverflow", "msg": "Math overflow." },
+ { "code": 6006, "name": "InvalidRemainingAccountAddress", "msg": "The given remaining account address is invalid." },
+ { "code": 6007, "name": "PaymentVaultNotEmpty", "msg": "The payment vault is not empty. Distribute the payments first." },
+ { "code": 6008, "name": "InvalidInvoiceAccount", "msg": "The invoice account does not match the expected PDA seeds" },
+ { "code": 6009, "name": "InvalidProgramToInvoke", "msg": "The program to invoke is not allowed." },
+ { "code": 6010, "name": "InvalidCallbackProgram", "msg": "The callback program is invalid." },
+ { "code": 6011, "name": "SwapFailedAmountDidNotIncrease", "msg": "The swap failed and the amount did not increase." },
+ { "code": 6012, "name": "AccountTypeNotSupported", "msg": "The account type is not supported for extension." },
+ { "code": 6013, "name": "InvalidIndex", "msg": "The index is invalid." }
+ ],
+ "types": [
+ {
+ "name": "AgentAcceptPaymentEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "user", "type": "pubkey" },
+ { "name": "tokenized_agent_mint", "type": "pubkey" },
+ { "name": "token_agent_payments", "type": "pubkey" },
+ { "name": "currency_mint", "type": "pubkey" },
+ { "name": "amount", "type": "u64" },
+ { "name": "memo", "type": "u64" },
+ { "name": "start_time", "type": "i64" },
+ { "name": "end_time", "type": "i64" },
+ { "name": "invoice_id", "type": "pubkey" },
+ { "name": "agent_post_balance", "type": "u64" },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "AgentBuybackTriggerEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "tokenized_agent_mint", "type": "pubkey" },
+ { "name": "currency_mint", "type": "pubkey" },
+ { "name": "amount_burned", "type": "u64" },
+ { "name": "swap_program", "type": "pubkey" },
+ { "name": "new_tokens_bought_and_burned_for_currency", "type": "u64" },
+ { "name": "agent_post_balance", "type": "u64" },
+ { "name": "timestamp", "type": "i64" },
+ { "name": "currency_mint_amount_for_buyback", "type": "u64" }
+ ]
+ }
+ },
+ {
+ "name": "AgentDistributePaymentsEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "token_agent_payments", "type": "pubkey" },
+ { "name": "currency_mint", "type": "pubkey" },
+ { "name": "buyback_bps", "type": "u16" },
+ { "name": "buyback_amount", "type": "u64" },
+ { "name": "withdraw_amount", "type": "u64" },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "AgentInitializeEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "token_agent_payments", "type": "pubkey" },
+ { "name": "mint", "type": "pubkey" },
+ { "name": "authority", "type": "pubkey" },
+ { "name": "buyback_bps", "type": "u16" },
+ { "name": "timestamp", "type": "i64" },
+ { "name": "tokenized_agent_sequence", "type": "u64" }
+ ]
+ }
+ },
+ {
+ "name": "AgentUpdateAuthorityEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "token_agent_payments", "type": "pubkey" },
+ { "name": "old_authority", "type": "pubkey" },
+ { "name": "new_authority", "type": "pubkey" },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "AgentUpdateBuybackBpsEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "token_agent_payments", "type": "pubkey" },
+ { "name": "mint", "type": "pubkey" },
+ { "name": "old_buyback_bps", "type": "u16" },
+ { "name": "new_buyback_bps", "type": "u16" },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "AgentWithdrawEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "tokenized_agent_mint", "type": "pubkey" },
+ { "name": "currency_mint", "type": "pubkey" },
+ { "name": "amount", "type": "u64" },
+ { "name": "receiver", "type": "pubkey" },
+ { "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": "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": "GlobalAddNewCurrencyEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "global_config", "type": "pubkey" },
+ { "name": "currency_mint", "type": "pubkey" },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "GlobalConfig",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "bump", "type": "u8" },
+ { "name": "protocol_authority", "type": "pubkey" },
+ { "name": "buyback_authority", "type": "pubkey" },
+ { "name": "supported_currencies_mint", "type": { "array": ["pubkey", 10] } },
+ { "name": "tokenized_agent_sequence", "type": "u64" }
+ ]
+ }
+ },
+ {
+ "name": "GlobalConfigInitializeEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "global_config", "type": "pubkey" },
+ { "name": "protocol_authority", "type": "pubkey" },
+ { "name": "buyback_authority", "type": "pubkey" },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "GlobalUpdateAuthoritiesEvent",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "global_config", "type": "pubkey" },
+ { "name": "protocol_authority", "type": { "option": "pubkey" } },
+ { "name": "buyback_authority", "type": { "option": "pubkey" } },
+ { "name": "timestamp", "type": "i64" }
+ ]
+ }
+ },
+ {
+ "name": "TokenAgentPaymentInCurrency",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "mint", "type": "pubkey" },
+ { "name": "currency_mint", "type": "pubkey" },
+ { "name": "total_invoice_payments_made", "type": "u64" },
+ { "name": "total_buyback", "type": "u64" },
+ { "name": "total_withdrawals", "type": "u64" },
+ { "name": "tokens_bought_back_and_burned", "type": "u64" }
+ ]
+ }
+ },
+ {
+ "name": "TokenAgentPayments",
+ "type": {
+ "kind": "struct",
+ "fields": [
+ { "name": "bump", "type": "u8" },
+ { "name": "mint", "type": "pubkey" },
+ { "name": "authority", "type": "pubkey" },
+ { "name": "buyback_bps", "type": "u16" }
+ ]
+ }
+ }
+ ]
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/idl/pump_agent_payments.ts b/agent-payments-crosschain-sdk/src/solana/idl/pump_agent_payments.ts
new file mode 100644
index 000000000..1fcca0cbb
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/idl/pump_agent_payments.ts
@@ -0,0 +1,782 @@
+/**
+ * Program IDL in camelCase format in order to be used in JS/TS.
+ *
+ * Note that this is only a type helper and is not the actual IDL. The original
+ * IDL can be found at `target/idl/pump_agent_payments.json`.
+ */
+export type PumpAgentPayments = {
+ address: "AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7";
+ metadata: {
+ name: "pumpAgentPayments";
+ version: "0.1.0";
+ spec: "0.1.0";
+ description: "Created with Anchor";
+ };
+ instructions: [
+ {
+ name: "agentAcceptPayment";
+ discriminator: [34, 157, 64, 220, 74, 32, 48, 225];
+ accounts: [
+ { name: "user"; writable: true; signer: true },
+ { name: "userTokenAccount"; writable: true },
+ { name: "tokenAgentPayments" },
+ {
+ name: "tokenAgentAssociatedAccount";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "tokenAgentPayments" },
+ {
+ 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: "currencyMint" },
+ ];
+ 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: "tokenAgentPaymentInCurrency";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "const"; value: [112,97,121,109,101,110,116,45,105,110,45,99,117,114,114,101,110,99,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ { kind: "account"; path: "currencyMint" },
+ ];
+ };
+ },
+ {
+ name: "globalConfig";
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "invoiceId" },
+ { name: "currencyMint" },
+ { name: "tokenProgram" },
+ { name: "associatedTokenProgram"; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "amount"; type: "u64" },
+ { name: "memo"; type: "u64" },
+ { name: "startTime"; type: "i64" },
+ { name: "endTime"; type: "i64" },
+ ];
+ },
+ {
+ name: "agentBuybackTrigger";
+ discriminator: [95, 231, 193, 2, 245, 75, 125, 155];
+ accounts: [
+ { name: "globalBuybackAuthority"; writable: true; signer: true },
+ { name: "mint"; writable: true },
+ {
+ name: "tokenAgentPayments";
+ pda: {
+ seeds: [
+ { kind: "const"; value: [116,111,107,101,110,45,97,103,101,110,116,45,112,97,121,109,101,110,116,115] },
+ { kind: "account"; path: "mint" },
+ ];
+ };
+ },
+ {
+ name: "tokenAgentPaymentInCurrency";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "const"; value: [112,97,121,109,101,110,116,45,105,110,45,99,117,114,114,101,110,99,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ { kind: "account"; path: "currencyMint" },
+ ];
+ };
+ },
+ { name: "currencyMint" },
+ {
+ name: "globalConfig";
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "swapProgramToInvoke" },
+ {
+ name: "burnAuthority";
+ docs: ["Intentionally called burn_authority", "TO avoid any confusion with the global buyback authority."];
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "const"; value: [98,117,121,98,97,99,107,45,97,117,116,104,111,114,105,116,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ ];
+ };
+ },
+ {
+ name: "burnMintVault";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "burnAuthority" },
+ { kind: "account"; path: "tokenProgram" },
+ { 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: "burnCurrencyMintVault";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "burnAuthority" },
+ { kind: "account"; path: "tokenProgramCurrency" },
+ { kind: "account"; path: "currencyMint" },
+ ];
+ 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: "tokenProgram" },
+ { name: "tokenProgramCurrency" },
+ { name: "associatedTokenProgram"; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "swapInstructionData"; type: "bytes" }];
+ },
+ {
+ name: "agentDistributePayments";
+ discriminator: [145, 44, 246, 47, 192, 204, 95, 32];
+ accounts: [
+ { name: "user"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "currencyMint" },
+ { name: "tokenAgentPayments"; writable: true },
+ {
+ name: "tokenAgentPaymentInCurrency";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "const"; value: [112,97,121,109,101,110,116,45,105,110,45,99,117,114,114,101,110,99,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ { kind: "account"; path: "currencyMint" },
+ ];
+ };
+ },
+ {
+ name: "tokenAgentAssociatedAccount";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "tokenAgentPayments" },
+ {
+ 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: "currencyMint" },
+ ];
+ 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: "buybackAuthority";
+ pda: {
+ seeds: [
+ { kind: "const"; value: [98,117,121,98,97,99,107,45,97,117,116,104,111,114,105,116,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ ];
+ };
+ },
+ {
+ name: "withdrawAuthority";
+ pda: {
+ seeds: [
+ { kind: "const"; value: [119,105,116,104,100,114,97,119,45,97,117,116,104,111,114,105,116,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ ];
+ };
+ },
+ {
+ name: "buybackVault";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "buybackAuthority" },
+ {
+ 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: "currencyMint" },
+ ];
+ 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: "withdrawVault";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "withdrawAuthority" },
+ {
+ 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: "currencyMint" },
+ ];
+ 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: "tokenProgram" },
+ { name: "associatedTokenProgram"; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "agentInitialize";
+ discriminator: [180, 248, 163, 8, 49, 94, 126, 96];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ {
+ name: "bondingCurve";
+ 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: "globalConfig";
+ writable: true;
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "mint" },
+ {
+ name: "tokenAgentPayments";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "const"; value: [116,111,107,101,110,45,97,103,101,110,116,45,112,97,121,109,101,110,116,115] },
+ { kind: "account"; path: "mint" },
+ ];
+ };
+ },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "authority"; type: "pubkey" },
+ { name: "buybackBps"; type: "u16" },
+ ];
+ },
+ {
+ name: "agentTransferExtraLamports";
+ discriminator: [39, 206, 214, 167, 55, 44, 221, 81];
+ accounts: [
+ {
+ name: "tokenAgentPayments";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "const"; value: [116,111,107,101,110,45,97,103,101,110,116,45,112,97,121,109,101,110,116,115] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ ];
+ };
+ },
+ {
+ name: "tokenAgentAssociatedAccount";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "tokenAgentPayments" },
+ {
+ 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: "const";
+ value: [6,155,136,87,254,171,129,132,251,104,127,99,70,24,192,53,218,196,57,220,26,235,59,85,152,160,240,0,0,0,0,1];
+ },
+ ];
+ 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];
+ };
+ };
+ },
+ ];
+ args: [];
+ },
+ {
+ name: "agentUpdateAuthority";
+ discriminator: [237, 228, 227, 224, 226, 198, 167, 83];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "tokenAgentPayments"; writable: true },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "newAuthority"; type: "pubkey" }];
+ },
+ {
+ name: "agentUpdateBuybackBps";
+ discriminator: [41, 28, 118, 90, 53, 24, 63, 160];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ { name: "tokenAgentPayments"; writable: true },
+ {
+ name: "globalConfig";
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ {
+ name: "eventAuthority";
+ 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: "buybackBps"; type: "u16" }];
+ },
+ {
+ name: "agentWithdraw";
+ discriminator: [13, 149, 99, 245, 171, 171, 185, 53];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ { name: "tokenAgentPayments" },
+ { name: "currencyMint" },
+ {
+ name: "withdrawAuthority";
+ pda: {
+ seeds: [
+ { kind: "const"; value: [119,105,116,104,100,114,97,119,45,97,117,116,104,111,114,105,116,121] },
+ { kind: "account"; path: "tokenAgentPayments.mint"; account: "TokenAgentPayments" },
+ ];
+ };
+ },
+ {
+ name: "withdrawVault";
+ writable: true;
+ pda: {
+ seeds: [
+ { kind: "account"; path: "withdrawAuthority" },
+ {
+ 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: "currencyMint" },
+ ];
+ 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: "receiverAta"; writable: true },
+ { name: "tokenProgram" },
+ { name: "associatedTokenProgram"; address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "closeAccount";
+ discriminator: [125, 255, 149, 14, 110, 34, 72, 24];
+ accounts: [
+ { name: "account"; writable: true },
+ { name: "user"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ ];
+ args: [];
+ },
+ {
+ name: "extendAccount";
+ discriminator: [234, 102, 194, 203, 150, 72, 62, 229];
+ accounts: [
+ { name: "account"; writable: true },
+ { name: "user"; writable: true; signer: true },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "globalAddNewCurrency";
+ discriminator: [46, 135, 47, 120, 118, 204, 177, 224];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ writable: true;
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "mint" },
+ {
+ name: "eventAuthority";
+ 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: "globalConfigInitialize";
+ discriminator: [61, 23, 208, 192, 232, 52, 8, 66];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ writable: true;
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ { name: "systemProgram"; address: "11111111111111111111111111111111" },
+ {
+ name: "eventAuthority";
+ 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: "protocolAuthority"; type: "pubkey" },
+ { name: "buybackAuthority"; type: "pubkey" },
+ ];
+ },
+ {
+ name: "globalRemoveCurrency";
+ discriminator: [57, 226, 180, 140, 91, 14, 231, 196];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ writable: true;
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ {
+ name: "eventAuthority";
+ 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: "u8" }];
+ },
+ {
+ name: "globalUpdateAuthorities";
+ discriminator: [91, 137, 72, 77, 183, 184, 168, 125];
+ accounts: [
+ { name: "authority"; writable: true; signer: true },
+ {
+ name: "globalConfig";
+ writable: true;
+ pda: { seeds: [{ kind: "const"; value: [103,108,111,98,97,108,45,99,111,110,102,105,103] }] };
+ },
+ {
+ name: "eventAuthority";
+ 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: "protocolAuthority"; type: { option: "pubkey" } },
+ { name: "buybackAuthority"; type: { option: "pubkey" } },
+ ];
+ },
+ ];
+ accounts: [
+ { name: "BondingCurve"; discriminator: [23, 183, 248, 55, 96, 216, 172, 96] },
+ { name: "GlobalConfig"; discriminator: [149, 8, 156, 202, 160, 252, 176, 217] },
+ { name: "TokenAgentPaymentInCurrency"; discriminator: [225, 195, 81, 227, 115, 43, 25, 177] },
+ { name: "TokenAgentPayments"; discriminator: [136, 241, 242, 217, 173, 77, 112, 186] },
+ ];
+ events: [
+ { name: "AgentAcceptPaymentEvent"; discriminator: [114, 190, 188, 192, 105, 79, 41, 147] },
+ { name: "AgentBuybackTriggerEvent"; discriminator: [139, 240, 9, 225, 214, 63, 232, 165] },
+ { name: "AgentDistributePaymentsEvent"; discriminator: [137, 116, 114, 140, 54, 111, 230, 26] },
+ { name: "AgentInitializeEvent"; discriminator: [192, 5, 183, 151, 0, 64, 100, 207] },
+ { name: "AgentUpdateAuthorityEvent"; discriminator: [36, 212, 117, 235, 74, 166, 60, 16] },
+ { name: "AgentUpdateBuybackBpsEvent"; discriminator: [165, 251, 40, 19, 114, 26, 128, 232] },
+ { name: "AgentWithdrawEvent"; discriminator: [174, 231, 201, 69, 254, 183, 49, 85] },
+ { name: "ExtendAccountEvent"; discriminator: [97, 97, 215, 144, 93, 146, 22, 124] },
+ { name: "GlobalAddNewCurrencyEvent"; discriminator: [130, 202, 37, 248, 241, 182, 233, 35] },
+ { name: "GlobalConfigInitializeEvent"; discriminator: [241, 51, 222, 190, 142, 245, 176, 53] },
+ { name: "GlobalUpdateAuthoritiesEvent"; discriminator: [82, 27, 22, 232, 53, 66, 35, 207] },
+ ];
+ errors: [
+ { code: 6000; name: "UnauthorizedSigner"; msg: "The given account is not authorized to execute this instruction." },
+ { code: 6001; name: "CurrencyAlreadySupported"; msg: "The given currency is already supported." },
+ { code: 6002; name: "MaxCurrenciesReached"; msg: "The maximum number of currencies has been reached." },
+ { code: 6003; name: "InvalidBuybackBps"; msg: "The buyback basis points is greater than 10000." },
+ { code: 6004; name: "CurrencyNotSupported"; msg: "The given currency is not supported." },
+ { code: 6005; name: "MathOverflow"; msg: "Math overflow." },
+ { code: 6006; name: "InvalidRemainingAccountAddress"; msg: "The given remaining account address is invalid." },
+ { code: 6007; name: "PaymentVaultNotEmpty"; msg: "The payment vault is not empty. Distribute the payments first." },
+ { code: 6008; name: "InvalidInvoiceAccount"; msg: "The invoice account does not match the expected PDA seeds" },
+ { code: 6009; name: "InvalidProgramToInvoke"; msg: "The program to invoke is not allowed." },
+ { code: 6010; name: "InvalidCallbackProgram"; msg: "The callback program is invalid." },
+ { code: 6011; name: "SwapFailedAmountDidNotIncrease"; msg: "The swap failed and the amount did not increase." },
+ { code: 6012; name: "AccountTypeNotSupported"; msg: "The account type is not supported for extension." },
+ { code: 6013; name: "InvalidIndex"; msg: "The index is invalid." },
+ ];
+ types: [
+ {
+ name: "AgentAcceptPaymentEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "user"; type: "pubkey" },
+ { name: "tokenizedAgentMint"; type: "pubkey" },
+ { name: "tokenAgentPayments"; type: "pubkey" },
+ { name: "currencyMint"; type: "pubkey" },
+ { name: "amount"; type: "u64" },
+ { name: "memo"; type: "u64" },
+ { name: "startTime"; type: "i64" },
+ { name: "endTime"; type: "i64" },
+ { name: "invoiceId"; type: "pubkey" },
+ { name: "agentPostBalance"; type: "u64" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "AgentBuybackTriggerEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "tokenizedAgentMint"; type: "pubkey" },
+ { name: "currencyMint"; type: "pubkey" },
+ { name: "amountBurned"; type: "u64" },
+ { name: "swapProgram"; type: "pubkey" },
+ { name: "newTokensBoughtAndBurnedForCurrency"; type: "u64" },
+ { name: "agentPostBalance"; type: "u64" },
+ { name: "timestamp"; type: "i64" },
+ { name: "currencyMintAmountForBuyback"; type: "u64" },
+ ];
+ };
+ },
+ {
+ name: "AgentDistributePaymentsEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "tokenAgentPayments"; type: "pubkey" },
+ { name: "currencyMint"; type: "pubkey" },
+ { name: "buybackBps"; type: "u16" },
+ { name: "buybackAmount"; type: "u64" },
+ { name: "withdrawAmount"; type: "u64" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "AgentInitializeEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "tokenAgentPayments"; type: "pubkey" },
+ { name: "mint"; type: "pubkey" },
+ { name: "authority"; type: "pubkey" },
+ { name: "buybackBps"; type: "u16" },
+ { name: "timestamp"; type: "i64" },
+ { name: "tokenizedAgentSequence"; type: "u64" },
+ ];
+ };
+ },
+ {
+ name: "AgentUpdateAuthorityEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "tokenAgentPayments"; type: "pubkey" },
+ { name: "oldAuthority"; type: "pubkey" },
+ { name: "newAuthority"; type: "pubkey" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "AgentUpdateBuybackBpsEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "tokenAgentPayments"; type: "pubkey" },
+ { name: "mint"; type: "pubkey" },
+ { name: "oldBuybackBps"; type: "u16" },
+ { name: "newBuybackBps"; type: "u16" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "AgentWithdrawEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "tokenizedAgentMint"; type: "pubkey" },
+ { name: "currencyMint"; type: "pubkey" },
+ { name: "amount"; type: "u64" },
+ { name: "receiver"; type: "pubkey" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "BondingCurve";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "virtualTokenReserves"; type: "u64" },
+ { name: "virtualSolReserves"; type: "u64" },
+ { name: "realTokenReserves"; type: "u64" },
+ { name: "realSolReserves"; type: "u64" },
+ { name: "tokenTotalSupply"; type: "u64" },
+ { name: "complete"; type: "bool" },
+ { name: "creator"; type: "pubkey" },
+ { name: "isMayhemMode"; type: "bool" },
+ ];
+ };
+ },
+ {
+ name: "ExtendAccountEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "account"; type: "pubkey" },
+ { name: "user"; type: "pubkey" },
+ { name: "currentSize"; type: "u64" },
+ { name: "newSize"; type: "u64" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "GlobalAddNewCurrencyEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "globalConfig"; type: "pubkey" },
+ { name: "currencyMint"; type: "pubkey" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "GlobalConfig";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "bump"; type: "u8" },
+ { name: "protocolAuthority"; type: "pubkey" },
+ { name: "buybackAuthority"; type: "pubkey" },
+ { name: "supportedCurrenciesMint"; type: { array: ["pubkey", 10] } },
+ { name: "tokenizedAgentSequence"; type: "u64" },
+ ];
+ };
+ },
+ {
+ name: "GlobalConfigInitializeEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "globalConfig"; type: "pubkey" },
+ { name: "protocolAuthority"; type: "pubkey" },
+ { name: "buybackAuthority"; type: "pubkey" },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "GlobalUpdateAuthoritiesEvent";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "globalConfig"; type: "pubkey" },
+ { name: "protocolAuthority"; type: { option: "pubkey" } },
+ { name: "buybackAuthority"; type: { option: "pubkey" } },
+ { name: "timestamp"; type: "i64" },
+ ];
+ };
+ },
+ {
+ name: "TokenAgentPaymentInCurrency";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "mint"; type: "pubkey" },
+ { name: "currencyMint"; type: "pubkey" },
+ { name: "totalInvoicePaymentsMade"; type: "u64" },
+ { name: "totalBuyback"; type: "u64" },
+ { name: "totalWithdrawals"; type: "u64" },
+ { name: "tokensBoughtBackAndBurned"; type: "u64" },
+ ];
+ };
+ },
+ {
+ name: "TokenAgentPayments";
+ type: {
+ kind: "struct";
+ fields: [
+ { name: "bump"; type: "u8" },
+ { name: "mint"; type: "pubkey" },
+ { name: "authority"; type: "pubkey" },
+ { name: "buybackBps"; type: "u16" },
+ ];
+ };
+ },
+ ];
+};
diff --git a/agent-payments-crosschain-sdk/src/solana/index.ts b/agent-payments-crosschain-sdk/src/solana/index.ts
index dcb06bd53..757cd0e75 100644
--- a/agent-payments-crosschain-sdk/src/solana/index.ts
+++ b/agent-payments-crosschain-sdk/src/solana/index.ts
@@ -1,5 +1,115 @@
-// Full re-export of the Solana agent payments SDK.
-// Consumers can import everything Solana-related from this sub-path:
-// import { PumpAgent, PumpAgentOffline } from "@pump-fun/agent-payments-crosschain-sdk/solana"
-export * from "@pump-fun/agent-payments-sdk";
-export * as x402Solana from "@pump-fun/agent-payments-sdk/x402";
+/**
+ * @pump-fun/agent-payments-sdk
+ * TypeScript SDK for Pump Agent Payments
+ */
+
+// IDL type
+export type { PumpAgentPayments } from "./idl/pump_agent_payments";
+
+// Program helpers
+export {
+ getPumpProgram,
+ OFFLINE_PUMP_PROGRAM,
+ getPumpProgramWithFallback,
+ getOfflineProgram,
+} from "./program";
+
+// PDA derivation
+export {
+ PROGRAM_ID,
+ PUMP_PROGRAM_ID,
+ GLOBAL_CONFIG_SEED,
+ TOKEN_AGENT_PAYMENTS_SEED,
+ PAYMENT_IN_CURRENCY_SEED,
+ INVOICE_ID_SEED,
+ BUYBACK_AUTHORITY_SEED,
+ WITHDRAW_AUTHORITY_SEED,
+ BONDING_CURVE_SEED,
+ TOKEN_AGENT_PAYMENTS_MIN_RENT_EXEMPT_LAMPORTS,
+ getGlobalConfigPDA,
+ getTokenAgentPaymentsPDA,
+ getPaymentInCurrencyPDA,
+ getInvoiceIdPDA,
+ getBuybackAuthorityPDA,
+ getWithdrawAuthorityPDA,
+ getBondingCurvePDA,
+} from "./pdas";
+
+// Classes
+export { PumpAgentOffline } from "./PumpAgentOffline";
+export { PumpAgent } from "./PumpAgent";
+
+// Decoders
+export {
+ decodeGlobalConfig,
+ decodeTokenAgentPaymentInCurrency,
+ decodeTokenAgentPayments,
+} from "./decoders";
+
+// Types
+export type {
+ PumpEnvironment,
+ VaultBalance,
+ AgentBalances,
+ CreateParams,
+ WithdrawParams,
+ UpdateBuybackBpsParams,
+ UpdateBuybackBpsOptions,
+ AcceptPaymentParams,
+ AcceptPaymentSimpleParams,
+ BuildAcceptPaymentParams,
+ DistributePaymentsParams,
+ BuybackTriggerParams,
+ ExtendAccountParams,
+ UpdateAuthorityParams,
+ CloseAccountParams,
+ GlobalConfig,
+ TokenAgentPaymentInCurrency,
+ TokenAgentPayments,
+} from "./types";
+
+// Convenience re-export
+import { PublicKey, type Connection } from "@solana/web3.js";
+import type { Program } from "@coral-xyz/anchor";
+import type { PumpAgentPayments } from "./idl/pump_agent_payments";
+import IDL from "./idl/pump_agent_payments.json";
+import { getPumpProgram } from "./program";
+
+export const PUMP_AGENT_PAYMENTS_PROGRAM_ID = new PublicKey(IDL.address);
+
+export function getProgram(
+ connection: Connection,
+): Program<PumpAgentPayments> {
+ return getPumpProgram(connection);
+}
+
+// Events
+export {
+ createEventParser,
+ parseAgentEvents,
+ subscribeToAgentEvents,
+} from "./events";
+export type {
+ AgentAcceptPaymentEvent,
+ AgentBuybackTriggerEvent,
+ AgentDistributePaymentsEvent,
+ AgentInitializeEvent,
+ AgentUpdateAuthorityEvent,
+ AgentUpdateBuybackBpsEvent,
+ AgentWithdrawEvent,
+ ExtendAccountEvent,
+ GlobalAddNewCurrencyEvent,
+ GlobalConfigInitializeEvent,
+ GlobalUpdateAuthoritiesEvent,
+ AgentEventName,
+ AgentEventData,
+ ParsedAgentEvent,
+ EventSubscriptionOptions,
+ EventSubscription,
+} from "./events";
+
+// solana-agent-kit plugin
+export { PumpAgentPaymentsPlugin } from "./solana-agent-kit";
+
+// x402 protocol
+export * as x402 from "./x402";
diff --git a/agent-payments-crosschain-sdk/src/solana/pdas.ts b/agent-payments-crosschain-sdk/src/solana/pdas.ts
new file mode 100644
index 000000000..e98ceff00
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/pdas.ts
@@ -0,0 +1,127 @@
+import { PublicKey } from "@solana/web3.js";
+import type BN from "bn.js";
+
+/** Pump Agent Payments program ID */
+export const PROGRAM_ID = new PublicKey(
+ "AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7",
+);
+
+/** Pump (bonding curve) program ID */
+export const PUMP_PROGRAM_ID = new PublicKey(
+ "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
+);
+
+// PDA seeds
+export const GLOBAL_CONFIG_SEED = Buffer.from("global-config");
+export const TOKEN_AGENT_PAYMENTS_SEED = Buffer.from("token-agent-payments");
+export const PAYMENT_IN_CURRENCY_SEED = Buffer.from("payment-in-currency");
+export const INVOICE_ID_SEED = Buffer.from("invoice-id");
+export const BUYBACK_AUTHORITY_SEED = Buffer.from("buyback-authority");
+export const WITHDRAW_AUTHORITY_SEED = Buffer.from("withdraw-authority");
+export const BONDING_CURVE_SEED = Buffer.from("bonding-curve");
+
+/**
+ * Minimum rent-exempt lamports for TokenAgentPayments account.
+ * 0.00141288 SOL.
+ */
+export const TOKEN_AGENT_PAYMENTS_MIN_RENT_EXEMPT_LAMPORTS = 1_412_880;
+
+/**
+ * Derives the GlobalConfig PDA.
+ * Seeds: ["global-config"]
+ */
+export function getGlobalConfigPDA(): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync([GLOBAL_CONFIG_SEED], PROGRAM_ID);
+}
+
+/**
+ * Derives the TokenAgentPayments PDA for a given mint.
+ * Seeds: ["token-agent-payments", mint]
+ */
+export function getTokenAgentPaymentsPDA(
+ mint: PublicKey,
+): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync(
+ [TOKEN_AGENT_PAYMENTS_SEED, mint.toBuffer()],
+ PROGRAM_ID,
+ );
+}
+
+/**
+ * Derives the TokenAgentPaymentInCurrency PDA.
+ * Seeds: ["payment-in-currency", tokenMint, currencyMint]
+ */
+export function getPaymentInCurrencyPDA(
+ tokenMint: PublicKey,
+ currencyMint: PublicKey,
+): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync(
+ [PAYMENT_IN_CURRENCY_SEED, tokenMint.toBuffer(), currencyMint.toBuffer()],
+ PROGRAM_ID,
+ );
+}
+
+/**
+ * Derives the Invoice ID PDA used to validate payment uniqueness.
+ * Seeds: ["invoice-id", tokenMint, currencyMint, amount, memo, startTime, endTime]
+ */
+export function getInvoiceIdPDA(
+ tokenMint: PublicKey,
+ currencyMint: PublicKey,
+ amount: BN,
+ memo: BN,
+ startTime: BN,
+ endTime: BN,
+): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync(
+ [
+ INVOICE_ID_SEED,
+ tokenMint.toBuffer(),
+ currencyMint.toBuffer(),
+ amount.toArrayLike(Buffer, "le", 8),
+ memo.toArrayLike(Buffer, "le", 8),
+ startTime.toArrayLike(Buffer, "le", 8),
+ endTime.toArrayLike(Buffer, "le", 8),
+ ],
+ PROGRAM_ID,
+ );
+}
+
+/**
+ * Derives the Buyback Authority PDA for a given token mint.
+ * Seeds: ["buyback-authority", tokenMint]
+ */
+export function getBuybackAuthorityPDA(
+ tokenMint: PublicKey,
+): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync(
+ [BUYBACK_AUTHORITY_SEED, tokenMint.toBuffer()],
+ PROGRAM_ID,
+ );
+}
+
+/**
+ * Derives the Withdraw Authority PDA for a given token mint.
+ * Seeds: ["withdraw-authority", tokenMint]
+ */
+export function getWithdrawAuthorityPDA(
+ tokenMint: PublicKey,
+): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync(
+ [WITHDRAW_AUTHORITY_SEED, tokenMint.toBuffer()],
+ PROGRAM_ID,
+ );
+}
+
+/**
+ * Derives the BondingCurve PDA from the Pump program for a given mint.
+ * Seeds: ["bonding-curve", mint] (program = Pump)
+ */
+export function getBondingCurvePDA(
+ mint: PublicKey,
+): [PublicKey, number] {
+ return PublicKey.findProgramAddressSync(
+ [BONDING_CURVE_SEED, mint.toBuffer()],
+ PUMP_PROGRAM_ID,
+ );
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/program.ts b/agent-payments-crosschain-sdk/src/solana/program.ts
new file mode 100644
index 000000000..e04dbfa7e
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/program.ts
@@ -0,0 +1,50 @@
+import { AnchorProvider, Program } from "@coral-xyz/anchor";
+import { Connection, PublicKey } from "@solana/web3.js";
+import type { PumpAgentPayments } from "./idl/pump_agent_payments";
+
+// The IDL object is imported at runtime from the JSON file via tsup bundling.
+// We use a require/import pattern that tsup resolves.
+import IDL from "./idl/pump_agent_payments.json";
+
+/**
+ * Creates an Anchor Program instance for the Pump Agent Payments program.
+ * Uses a dummy wallet since most operations only build instructions.
+ */
+export function getPumpProgram(
+ connection: Connection,
+): Program<PumpAgentPayments> {
+ const dummyWallet = {
+ publicKey: PublicKey.default,
+ signTransaction: () => Promise.reject(),
+ signAllTransactions: () => Promise.reject(),
+ };
+ return new Program(
+ IDL as unknown as PumpAgentPayments,
+ new AnchorProvider(connection, dummyWallet, {}),
+ );
+}
+
+/**
+ * Offline program instance (no connection required).
+ * Useful for instruction building and account decoding without RPC.
+ */
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export const OFFLINE_PUMP_PROGRAM: Program<PumpAgentPayments> =
+ getPumpProgram(null as any);
+
+/**
+ * Returns the program instance, falling back to the offline program
+ * if no connection is provided.
+ */
+export function getPumpProgramWithFallback(
+ connection?: Connection,
+): Program<PumpAgentPayments> {
+ return connection ? getPumpProgram(connection) : OFFLINE_PUMP_PROGRAM;
+}
+
+/**
+ * Returns the offline program instance (alias for convenience).
+ */
+export function getOfflineProgram(): Program<PumpAgentPayments> {
+ return OFFLINE_PUMP_PROGRAM;
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/actions.ts b/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/actions.ts
new file mode 100644
index 000000000..a9d579e33
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/actions.ts
@@ -0,0 +1,534 @@
+import { z } from "zod";
+import {
+ PublicKey,
+ type TransactionInstruction,
+} from "@solana/web3.js";
+import { NATIVE_MINT, getAssociatedTokenAddressSync } from "@solana/spl-token";
+
+import { PumpAgent } from "../PumpAgent";
+import { PumpAgentOffline } from "../PumpAgentOffline";
+import type { Action, SolanaAgentKitLike } from "./types";
+
+// ─── Helpers ──────────────────────────────────────────────────────────────────
+
+function pk(value: string): PublicKey {
+ return new PublicKey(value);
+}
+
+function serializeIx(ix: TransactionInstruction) {
+ return {
+ programId: ix.programId.toBase58(),
+ keys: ix.keys.map((k) => ({
+ pubkey: k.pubkey.toBase58(),
+ isSigner: k.isSigner,
+ isWritable: k.isWritable,
+ })),
+ data: Buffer.from(ix.data).toString("base64"),
+ };
+}
+
+function agent(kit: SolanaAgentKitLike, mint: string): PumpAgent {
+ return new PumpAgent(pk(mint), "mainnet", kit.connection);
+}
+
+// ─── Action definitions ───────────────────────────────────────────────────────
+
+export const createAgentPaymentsAction: Action = {
+ name: "pump_agent_create",
+ similes: [
+ "initialize agent payments",
+ "set up agent monetization",
+ "create tokenized agent payment config",
+ "enable payments for my agent",
+ ],
+ description:
+ "Initialize the on-chain Agent Payments configuration for a Pump Fun token. " +
+ "This must be called once by the token's bonding-curve creator before the agent " +
+ "can accept payments. Sets the agent authority and buyback basis points.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ buybackBps: "500",
+ },
+ output: {
+ status: "success",
+ signature: "5K4b...txSig",
+ },
+ explanation:
+ "Initialize agent payments for the given token with 5% buyback.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address"),
+ agentAuthority: z
+ .string()
+ .optional()
+ .describe(
+ "Public key of the agent authority. Defaults to the agent wallet.",
+ ),
+ buybackBps: z
+ .number()
+ .int()
+ .min(0)
+ .max(10000)
+ .describe("Buyback basis points (0–10000, e.g. 500 = 5%)"),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = PumpAgentOffline.load(pk(input.mint), kit.connection);
+ const authority = kit.wallet_address;
+ const agentAuthority = input.agentAuthority
+ ? pk(input.agentAuthority)
+ : kit.wallet_address;
+
+ const ix = await pumpAgent.create({
+ authority,
+ mint: pk(input.mint),
+ agentAuthority,
+ buybackBps: input.buybackBps,
+ });
+
+ return { instruction: serializeIx(ix) };
+ },
+};
+
+export const buildPaymentInstructionsAction: Action = {
+ name: "pump_agent_build_payment_instructions",
+ similes: [
+ "build payment instructions",
+ "create payment transaction",
+ "generate agent payment",
+ "prepare agent payment",
+ "build agent invoice",
+ ],
+ description:
+ "Build the accept-payment instructions for a tokenized agent. Returns serialized " +
+ "instructions that the payer must sign — does NOT auto-submit. Handles native SOL " +
+ "wrapping automatically when paying in SOL.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ user: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
+ amount: "1000000",
+ memo: "1",
+ },
+ output: {
+ instructions: "[...serialized instructions]",
+ },
+ explanation:
+ "Build payment instructions for 0.001 SOL to the agent with memo 1.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent to pay"),
+ user: z.string().describe("Public key of the payer"),
+ currencyMint: z
+ .string()
+ .optional()
+ .describe("Currency mint to pay in. Defaults to native SOL (wrapped)."),
+ amount: z.string().describe("Payment amount in the currency's smallest unit"),
+ memo: z.string().default("0").describe("Invoice memo / identifier"),
+ startTime: z
+ .string()
+ .default("0")
+ .describe("Invoice start time (unix seconds). Defaults to 0."),
+ endTime: z
+ .string()
+ .default("0")
+ .describe("Invoice end time (unix seconds). Defaults to 0."),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = PumpAgentOffline.load(pk(input.mint), kit.connection);
+ const currencyMint = input.currencyMint
+ ? pk(input.currencyMint)
+ : NATIVE_MINT;
+
+ const ixs = await pumpAgent.buildAcceptPaymentInstructions({
+ user: pk(input.user),
+ currencyMint,
+ amount: input.amount,
+ memo: input.memo,
+ startTime: input.startTime,
+ endTime: input.endTime,
+ });
+
+ return { instructions: ixs.map(serializeIx) };
+ },
+};
+
+export const getBalancesAction: Action = {
+ name: "pump_agent_get_balances",
+ similes: [
+ "check agent balances",
+ "get agent earnings",
+ "view agent vault balances",
+ "how much has the agent earned",
+ ],
+ description:
+ "Fetch the current balances across all three agent vaults (payment, buyback, " +
+ "withdraw) for a given currency. Returns vault addresses and token balances.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ },
+ output: {
+ paymentVault: '{"address":"...","balance":"500000"}',
+ buybackVault: '{"address":"...","balance":"100000"}',
+ withdrawVault: '{"address":"...","balance":"400000"}',
+ },
+ explanation: "Check SOL balances across all vaults for the agent.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ currencyMint: z
+ .string()
+ .optional()
+ .describe("Currency mint to check balances for. Defaults to native SOL."),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = agent(kit, input.mint);
+ const currencyMint = input.currencyMint
+ ? pk(input.currencyMint)
+ : NATIVE_MINT;
+
+ const balances = await pumpAgent.getBalances(currencyMint);
+
+ return {
+ paymentVault: {
+ address: balances.paymentVault.address.toBase58(),
+ balance: balances.paymentVault.balance.toString(),
+ },
+ buybackVault: {
+ address: balances.buybackVault.address.toBase58(),
+ balance: balances.buybackVault.balance.toString(),
+ },
+ withdrawVault: {
+ address: balances.withdrawVault.address.toBase58(),
+ balance: balances.withdrawVault.balance.toString(),
+ },
+ };
+ },
+};
+
+export const validateInvoiceAction: Action = {
+ name: "pump_agent_validate_invoice",
+ similes: [
+ "verify payment",
+ "check if user paid",
+ "validate invoice",
+ "confirm agent payment",
+ "did the user pay",
+ ],
+ description:
+ "Validate that a specific payment was made to an agent. Checks on-chain records " +
+ "to confirm the invoice parameters match. Returns true if the payment is valid.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ user: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
+ currencyMint: "So11111111111111111111111111111111111111112",
+ amount: "1000000",
+ memo: "42",
+ startTime: "0",
+ endTime: "0",
+ },
+ output: {
+ valid: "true",
+ },
+ explanation: "Validate that the user paid 0.001 SOL with memo 42.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ user: z.string().describe("Public key of the payer to validate"),
+ currencyMint: z.string().describe("Currency mint used for payment"),
+ amount: z.string().describe("Expected payment amount"),
+ memo: z.string().describe("Expected invoice memo"),
+ startTime: z.string().describe("Expected invoice start time (unix seconds)"),
+ endTime: z.string().describe("Expected invoice end time (unix seconds)"),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = agent(kit, input.mint);
+
+ const valid = await pumpAgent.validateInvoicePayment({
+ user: pk(input.user),
+ currencyMint: pk(input.currencyMint),
+ amount: Number(input.amount),
+ memo: Number(input.memo),
+ startTime: Number(input.startTime),
+ endTime: Number(input.endTime),
+ });
+
+ return { valid };
+ },
+};
+
+export const distributePaymentsAction: Action = {
+ name: "pump_agent_distribute_payments",
+ similes: [
+ "distribute agent payments",
+ "split agent revenue",
+ "process agent payments",
+ "trigger payment distribution",
+ ],
+ description:
+ "Distribute accumulated payments between the buyback and withdraw vaults " +
+ "according to the configured buyback basis points. This is permissionless — " +
+ "anyone can trigger it.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ },
+ output: {
+ status: "success",
+ signature: "3Yp7...txSig",
+ },
+ explanation: "Distribute accumulated SOL payments for the agent.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ currencyMint: z
+ .string()
+ .optional()
+ .describe("Currency mint to distribute. Defaults to native SOL."),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = PumpAgentOffline.load(pk(input.mint), kit.connection);
+ const currencyMint = input.currencyMint
+ ? pk(input.currencyMint)
+ : NATIVE_MINT;
+
+ const ixs = await pumpAgent.distributePayments({
+ user: kit.wallet_address,
+ currencyMint,
+ includeTransferExtraLamportsForNative: currencyMint.equals(NATIVE_MINT),
+ });
+
+ return { instructions: ixs.map(serializeIx) };
+ },
+};
+
+export const withdrawAction: Action = {
+ name: "pump_agent_withdraw",
+ similes: [
+ "withdraw agent earnings",
+ "withdraw agent payments",
+ "claim agent revenue",
+ "withdraw from agent vault",
+ ],
+ description:
+ "Withdraw accumulated earnings from the agent withdraw vault. " +
+ "Must be called by the agent authority. Transfers tokens from the " +
+ "withdraw vault to the specified receiver token account.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ currencyMint: "So11111111111111111111111111111111111111112",
+ },
+ output: {
+ status: "success",
+ signature: "4Rz8...txSig",
+ },
+ explanation: "Withdraw accumulated SOL earnings from the agent.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ currencyMint: z.string().describe("Currency mint to withdraw"),
+ receiverAta: z
+ .string()
+ .optional()
+ .describe(
+ "Receiver token account. Defaults to the agent wallet's ATA for the currency.",
+ ),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = PumpAgentOffline.load(pk(input.mint), kit.connection);
+ const currencyMint = pk(input.currencyMint);
+
+ const receiverAta = input.receiverAta
+ ? pk(input.receiverAta)
+ : getAssociatedTokenAddressSync(currencyMint, kit.wallet_address);
+
+ const ix = await pumpAgent.withdraw({
+ authority: kit.wallet_address,
+ currencyMint,
+ receiverAta,
+ });
+
+ return { instruction: serializeIx(ix) };
+ },
+};
+
+export const getConfigAction: Action = {
+ name: "pump_agent_get_config",
+ similes: [
+ "get agent config",
+ "check agent settings",
+ "view agent payment config",
+ "agent payment configuration",
+ ],
+ description:
+ "Fetch the on-chain Agent Payments configuration for a token. " +
+ "Returns the agent authority, buyback basis points, and token mint.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ },
+ output: {
+ authority: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
+ buybackBps: "500",
+ mint: "So11111111111111111111111111111111111111112",
+ },
+ explanation: "Fetch the agent payment configuration.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = agent(kit, input.mint);
+ const config = await pumpAgent.getAgentConfig();
+
+ return {
+ authority: config.authority.toBase58(),
+ buybackBps: config.buybackBps,
+ mint: config.mint.toBase58(),
+ };
+ },
+};
+
+export const getPaymentStatsAction: Action = {
+ name: "pump_agent_get_payment_stats",
+ similes: [
+ "get payment stats",
+ "agent payment statistics",
+ "how much has the agent earned",
+ "payment analytics",
+ ],
+ description:
+ "Fetch per-currency payment statistics for an agent. Returns total payments " +
+ "received, total distributed to buyback, total distributed to withdraw, and " +
+ "tokens burned.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ currencyMint: "So11111111111111111111111111111111111111112",
+ },
+ output: {
+ totalPayments: "10000000",
+ totalBuyback: "2000000",
+ totalWithdraw: "8000000",
+ },
+ explanation: "Get SOL payment statistics for the agent.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ currencyMint: z.string().describe("Currency mint to get stats for"),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = agent(kit, input.mint);
+ const stats = await pumpAgent.getPaymentStats(pk(input.currencyMint));
+
+ // Convert all BN / bigint fields to strings for JSON serialization
+ const result: Record<string, any> = {};
+ for (const [key, value] of Object.entries(stats as Record<string, unknown>)) {
+ if (value instanceof PublicKey) {
+ result[key] = value.toBase58();
+ } else if (typeof value === "bigint") {
+ result[key] = value.toString();
+ } else if (value != null && typeof value === "object" && "toString" in value) {
+ result[key] = String(value);
+ } else {
+ result[key] = value;
+ }
+ }
+ return result;
+ },
+};
+
+export const updateBuybackBpsAction: Action = {
+ name: "pump_agent_update_buyback_bps",
+ similes: [
+ "update buyback percentage",
+ "change buyback bps",
+ "set buyback rate",
+ "modify agent buyback",
+ ],
+ description:
+ "Update the buyback basis points for an agent's payment configuration. " +
+ "Must be called by the agent authority. The new bps value determines what " +
+ "percentage of future payments are allocated to token buyback and burn.",
+ examples: [
+ [
+ {
+ input: {
+ mint: "So11111111111111111111111111111111111111112",
+ buybackBps: "1000",
+ },
+ output: {
+ status: "success",
+ signature: "5Tz9...txSig",
+ },
+ explanation: "Update buyback to 10% (1000 bps) for the agent.",
+ },
+ ],
+ ],
+ schema: z.object({
+ mint: z.string().describe("Token mint address of the agent"),
+ buybackBps: z
+ .number()
+ .int()
+ .min(0)
+ .max(10000)
+ .describe("New buyback basis points (0–10000, e.g. 1000 = 10%)"),
+ }),
+ handler: async (kit, input) => {
+ const pumpAgent = agent(kit, input.mint);
+
+ const ix = await pumpAgent.updateBuybackBps({
+ authority: kit.wallet_address,
+ buybackBps: input.buybackBps,
+ });
+
+ return { instruction: serializeIx(ix) };
+ },
+};
+
+export const allActions: Action[] = [
+ createAgentPaymentsAction,
+ buildPaymentInstructionsAction,
+ getBalancesAction,
+ validateInvoiceAction,
+ distributePaymentsAction,
+ withdrawAction,
+ getConfigAction,
+ getPaymentStatsAction,
+ updateBuybackBpsAction,
+];
diff --git a/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/index.ts b/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/index.ts
new file mode 100644
index 000000000..13945ee23
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/index.ts
@@ -0,0 +1,185 @@
+/**
+ * solana-agent-kit plugin for @pump-fun/agent-payments-sdk
+ *
+ * Usage with solana-agent-kit v2:
+ * ```ts
+ * import { SolanaAgentKit } from "solana-agent-kit";
+ * import { PumpAgentPaymentsPlugin } from "@pump-fun/agent-payments-sdk/solana-agent-kit";
+ *
+ * const agent = new SolanaAgentKit(privateKey, rpcUrl, {});
+ * agent.use(PumpAgentPaymentsPlugin);
+ * ```
+ */
+
+import { PublicKey } from "@solana/web3.js";
+import { NATIVE_MINT, getAssociatedTokenAddressSync } from "@solana/spl-token";
+
+import { PumpAgent } from "../PumpAgent";
+import { PumpAgentOffline } from "../PumpAgentOffline";
+import type { Plugin, SolanaAgentKitLike } from "./types";
+import { allActions } from "./actions";
+
+// ─── Typed helper methods (programmatic API) ─────────────────────────────────
+
+async function createAgentPayments(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ buybackBps: number,
+ agentAuthority?: PublicKey,
+) {
+ const pump = PumpAgentOffline.load(mint, agent.connection);
+ return pump.create({
+ authority: agent.wallet_address,
+ mint,
+ agentAuthority: agentAuthority ?? agent.wallet_address,
+ buybackBps,
+ });
+}
+
+async function buildPayAgentInstructions(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ currencyMint: PublicKey,
+ amount: string,
+ memo = "0",
+ startTime = "0",
+ endTime = "0",
+) {
+ const pump = PumpAgentOffline.load(mint, agent.connection);
+ return pump.buildAcceptPaymentInstructions({
+ user: agent.wallet_address,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ });
+}
+
+async function getAgentBalances(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ currencyMint: PublicKey = NATIVE_MINT,
+) {
+ const pump = new PumpAgent(mint, "mainnet", agent.connection);
+ return pump.getBalances(currencyMint);
+}
+
+async function validateInvoicePayment(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ user: PublicKey,
+ currencyMint: PublicKey,
+ amount: number,
+ memo: number,
+ startTime: number,
+ endTime: number,
+) {
+ const pump = new PumpAgent(mint, "mainnet", agent.connection);
+ return pump.validateInvoicePayment({
+ user,
+ currencyMint,
+ amount,
+ memo,
+ startTime,
+ endTime,
+ });
+}
+
+async function distributeAgentPayments(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ currencyMint: PublicKey = NATIVE_MINT,
+) {
+ const pump = PumpAgentOffline.load(mint, agent.connection);
+ return pump.distributePayments({
+ user: agent.wallet_address,
+ currencyMint,
+ includeTransferExtraLamportsForNative: currencyMint.equals(NATIVE_MINT),
+ });
+}
+
+async function withdrawAgentPayments(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ currencyMint: PublicKey,
+ receiverAta?: PublicKey,
+) {
+ const pump = PumpAgentOffline.load(mint, agent.connection);
+ return pump.withdraw({
+ authority: agent.wallet_address,
+ currencyMint,
+ receiverAta:
+ receiverAta ??
+ getAssociatedTokenAddressSync(currencyMint, agent.wallet_address),
+ });
+}
+
+async function getAgentConfig(agent: SolanaAgentKitLike, mint: PublicKey) {
+ const pump = new PumpAgent(mint, "mainnet", agent.connection);
+ return pump.getAgentConfig();
+}
+
+async function getPaymentStats(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ currencyMint: PublicKey,
+) {
+ const pump = new PumpAgent(mint, "mainnet", agent.connection);
+ return pump.getPaymentStats(currencyMint);
+}
+
+async function updateBuybackBps(
+ agent: SolanaAgentKitLike,
+ mint: PublicKey,
+ buybackBps: number,
+) {
+ const pump = new PumpAgent(mint, "mainnet", agent.connection);
+ return pump.updateBuybackBps({
+ authority: agent.wallet_address,
+ buybackBps,
+ });
+}
+
+// ─── Plugin ───────────────────────────────────────────────────────────────────
+
+export const PumpAgentPaymentsPlugin: Plugin = {
+ name: "pump-agent-payments",
+
+ methods: {
+ createAgentPayments,
+ buildPayAgentInstructions,
+ getAgentBalances,
+ validateInvoicePayment,
+ distributeAgentPayments,
+ withdrawAgentPayments,
+ getAgentConfig,
+ getPaymentStats,
+ updateBuybackBps,
+ },
+
+ actions: allActions,
+};
+
+// ─── Re-exports ───────────────────────────────────────────────────────────────
+
+export type {
+ Action,
+ ActionExample,
+ ActionHandler,
+ Plugin,
+ SolanaAgentKitLike,
+} from "./types";
+
+export {
+ createAgentPaymentsAction,
+ buildPaymentInstructionsAction,
+ getBalancesAction,
+ validateInvoiceAction,
+ distributePaymentsAction,
+ withdrawAction,
+ getConfigAction,
+ getPaymentStatsAction,
+ updateBuybackBpsAction,
+ allActions,
+} from "./actions";
diff --git a/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/types.ts b/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/types.ts
new file mode 100644
index 000000000..c81ffd36b
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/solana-agent-kit/types.ts
@@ -0,0 +1,38 @@
+import type { Connection, Keypair, PublicKey } from "@solana/web3.js";
+import type { z } from "zod";
+
+/**
+ * Minimal structural interface compatible with solana-agent-kit's SolanaAgentKit.
+ * Uses structural typing so consumers don't need to import SolanaAgentKit directly.
+ */
+export interface SolanaAgentKitLike {
+ connection: Connection;
+ wallet: Keypair;
+ wallet_address: PublicKey;
+}
+
+export type ActionHandler = (
+ agent: SolanaAgentKitLike,
+ input: Record<string, any>,
+) => Promise<Record<string, any>>;
+
+export interface ActionExample {
+ input: Record<string, string>;
+ output: Record<string, string>;
+ explanation: string;
+}
+
+export interface Action {
+ name: string;
+ similes: string[];
+ description: string;
+ examples: ActionExample[][];
+ schema: z.ZodType<any>;
+ handler: ActionHandler;
+}
+
+export interface Plugin {
+ name: string;
+ methods: Record<string, Function>;
+ actions: Action[];
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/types.ts b/agent-payments-crosschain-sdk/src/solana/types.ts
new file mode 100644
index 000000000..9146788ae
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/types.ts
@@ -0,0 +1,173 @@
+import type { AccountMeta, PublicKey } from "@solana/web3.js";
+import type { BN } from "@coral-xyz/anchor";
+
+// ─── Environment ────────────────────────────────────────────────────────────
+
+export type PumpEnvironment = "devnet" | "mainnet";
+
+// ─── Vault / Balance types ──────────────────────────────────────────────────
+
+export interface VaultBalance {
+ address: PublicKey;
+ balance: bigint;
+}
+
+export interface AgentBalances {
+ /** ATA of the TokenAgentPayments PDA (incoming payments land here) */
+ paymentVault: VaultBalance;
+ /** ATA of the Buyback Authority PDA */
+ buybackVault: VaultBalance;
+ /** ATA of the Withdraw Authority PDA */
+ withdrawVault: VaultBalance;
+}
+
+// ─── Instruction parameter interfaces ───────────────────────────────────────
+
+export interface CreateParams {
+ /** Signer – must be the bonding-curve creator for this mint */
+ authority: PublicKey;
+ /** The token mint this agent manages */
+ mint: PublicKey;
+ /** The pubkey that will act as the agent authority (for withdraw / update) */
+ agentAuthority: PublicKey;
+ /** Basis points allocated to buyback (0–10 000) */
+ buybackBps: number;
+}
+
+export interface WithdrawParams {
+ /** Agent authority signer */
+ authority: PublicKey;
+ /** Currency mint to withdraw */
+ currencyMint: PublicKey;
+ /** Receiver's token account for the currency */
+ receiverAta: PublicKey;
+ /** Token program for the currency mint (defaults to TOKEN_PROGRAM_ID) */
+ tokenProgram?: PublicKey;
+}
+
+export interface UpdateBuybackBpsParams {
+ /** Agent authority signer */
+ authority: PublicKey;
+ /** New buyback basis points (0–10 000) */
+ buybackBps: number;
+}
+
+export interface UpdateBuybackBpsOptions {
+ /** Supported currencies and their token programs */
+ supportedCurrencies: {
+ mint: PublicKey;
+ tokenProgram: PublicKey;
+ }[];
+}
+
+export interface AcceptPaymentParams {
+ /** Payer / user signer */
+ user: PublicKey;
+ /** User's token account holding the currency */
+ userTokenAccount: PublicKey;
+ /** The currency mint being paid */
+ currencyMint: PublicKey;
+ amount: BN;
+ memo: BN;
+ startTime: BN;
+ endTime: BN;
+ /** Token program for the currency mint (defaults to TOKEN_PROGRAM_ID) */
+ tokenProgram?: PublicKey;
+}
+
+export interface AcceptPaymentSimpleParams {
+ user: PublicKey;
+ userTokenAccount: PublicKey;
+ currencyMint: PublicKey;
+ amount: bigint | number | string;
+ memo: bigint | number | string;
+ startTime: bigint | number | string;
+ endTime: bigint | number | string;
+ tokenProgram?: PublicKey;
+ /** Compute unit limit (defaults to 130_000) */
+ computeUnitLimit?: number;
+ /** Priority fee in micro lamports per compute unit (defaults to 1_000) */
+ computeUnitPrice?: number;
+}
+
+export interface BuildAcceptPaymentParams {
+ user: PublicKey;
+ currencyMint: PublicKey;
+ amount: bigint | number | string;
+ memo: bigint | number | string;
+ startTime: bigint | number | string;
+ endTime: bigint | number | string;
+ tokenProgram?: PublicKey;
+ /** Compute unit limit for the transaction (defaults to 100_000) */
+ computeUnitLimit?: number;
+ /** Priority fee in microlamports per compute unit. If provided, a SetComputeUnitPrice instruction is prepended. */
+ computeUnitPrice?: number;
+}
+
+export interface DistributePaymentsParams {
+ /** Any signer (permissionless) */
+ user: PublicKey;
+ /** Currency mint to distribute */
+ currencyMint: PublicKey;
+ /** Token program for the currency mint (defaults to TOKEN_PROGRAM_ID) */
+ tokenProgram?: PublicKey;
+ /**
+ * For native SOL only: prepend `agentTransferExtraLamports` before distribute.
+ * Default is false.
+ */
+ includeTransferExtraLamportsForNative?: boolean;
+}
+
+export interface BuybackTriggerParams {
+ /** Must match globalConfig.buybackAuthority */
+ globalBuybackAuthority: PublicKey;
+ /** The currency mint used for the swap (tracks per-currency buyback accounting) */
+ currencyMint: PublicKey;
+ /** Swap program to CPI into (must be in the allowed list) */
+ swapProgramToInvoke: PublicKey;
+ /** Serialised swap instruction data (pass empty Buffer to skip swap & just burn) */
+ swapInstructionData: Buffer;
+ /** All accounts the swap instruction requires */
+ remainingAccounts: AccountMeta[];
+ /** Token program for the currency mint (defaults to TOKEN_PROGRAM_ID) */
+ tokenProgramCurrency?: PublicKey;
+ /** Token program for the agent token mint (defaults to TOKEN_PROGRAM_ID) */
+ tokenProgram?: PublicKey;
+}
+
+export interface ExtendAccountParams {
+ /** Account to extend (must be a supported account type on-chain) */
+ account: PublicKey;
+ /** Signer paying rent for extension */
+ user: PublicKey;
+}
+
+export interface UpdateAuthorityParams {
+ /** Current agent authority signer (or protocol authority for recovery) */
+ authority: PublicKey;
+ /** The new authority pubkey to set */
+ newAuthority: PublicKey;
+}
+
+export interface CloseAccountParams {
+ /** The account to close (TokenAgentPayments, PaymentInCurrency, etc.) */
+ account: PublicKey;
+ /** Signer who receives the reclaimed rent lamports */
+ user: PublicKey;
+}
+
+// ─── Decoded account types (derived from the Anchor program) ────────────────
+
+import { OFFLINE_PUMP_PROGRAM } from "./program";
+
+export type GlobalConfig = Awaited<
+ ReturnType<typeof OFFLINE_PUMP_PROGRAM.account.GlobalConfig.fetch>
+>;
+
+export type TokenAgentPaymentInCurrency = Awaited<
+ ReturnType<typeof OFFLINE_PUMP_PROGRAM.account.TokenAgentPaymentInCurrency.fetch>
+>;
+
+export type TokenAgentPayments = Awaited<
+ ReturnType<typeof OFFLINE_PUMP_PROGRAM.account.TokenAgentPayments.fetch>
+>;
diff --git a/agent-payments-crosschain-sdk/src/solana/x402/client.ts b/agent-payments-crosschain-sdk/src/solana/x402/client.ts
new file mode 100644
index 000000000..39237fe00
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/x402/client.ts
@@ -0,0 +1,313 @@
+/**
+ * x402 v2 Client – automatic 402 handling
+ *
+ * A fetch wrapper that intercepts HTTP 402 responses, builds and signs
+ * a payment transaction matching the server's PaymentRequirements, and
+ * retries the request with a PAYMENT-SIGNATURE header.
+ *
+ * Supports both "pump-agent" (Pump Agent invoice) and "exact" (SPL
+ * TransferChecked) schemes.
+ */
+
+import {
+ Connection,
+ PublicKey,
+ Transaction,
+} from "@solana/web3.js";
+import {
+ getMint,
+ getAssociatedTokenAddressSync,
+ createAssociatedTokenAccountInstruction,
+ createTransferCheckedInstruction,
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+} from "@solana/spl-token";
+import { PumpAgentOffline } from "../PumpAgentOffline";
+import {
+ encodePaymentPayload,
+ getPaymentRequiredFromResponse,
+} from "./headers";
+import type {
+ X402ClientConfig,
+ PaymentPayload,
+ PaymentRequired,
+ PaymentRequirements,
+ PumpAgentPaymentRequirements,
+ ExactPaymentRequirements,
+} from "./types";
+import {
+ X402_HEADER_PAYMENT_SIGNATURE,
+ X402_VERSION,
+ SOLANA_MAINNET,
+} from "./types";
+
+// ─── Client-side x402 fetch wrapper ─────────────────────────────────────────
+
+/**
+ * Create a fetch function that automatically handles HTTP 402 responses
+ * by building a payment transaction, signing, sending, and retrying
+ * the original request with payment proof in the PAYMENT-SIGNATURE header.
+ *
+ * @example
+ * ```ts
+ * import { createX402Fetch } from "@pump-fun/agent-payments-sdk/x402";
+ *
+ * const x402fetch = createX402Fetch({
+ * payer: wallet.publicKey.toBase58(),
+ * signTransaction: async (txBase64) => {
+ * const tx = Transaction.from(Buffer.from(txBase64, "base64"));
+ * const signed = await wallet.signTransaction(tx);
+ * return Buffer.from(signed.serialize()).toString("base64");
+ * },
+ * sendTransaction: async (signedTxBase64) => {
+ * const raw = Buffer.from(signedTxBase64, "base64");
+ * const sig = await connection.sendRawTransaction(raw);
+ * await connection.confirmTransaction(sig, "confirmed");
+ * return sig;
+ * },
+ * });
+ *
+ * const res = await x402fetch("https://api.agent.example/inference", {
+ * method: "POST",
+ * body: JSON.stringify({ prompt: "Hello" }),
+ * });
+ * ```
+ */
+export function createX402Fetch(
+ config: X402ClientConfig & { connection: Connection },
+): typeof fetch {
+ const {
+ payer,
+ signTransaction,
+ sendTransaction,
+ connection,
+ network = SOLANA_MAINNET,
+ confirmationTimeoutMs = 30_000,
+ } = config;
+
+ return async (
+ input: RequestInfo | URL,
+ init?: RequestInit,
+ ): Promise<Response> => {
+ const response = await fetch(input, init);
+
+ if (response.status !== 402) return response;
+
+ const paymentRequired = getPaymentRequiredFromResponse(response);
+ if (!paymentRequired) return response;
+
+ // Find a compatible requirement
+ const accepted = selectRequirement(paymentRequired, network);
+ if (!accepted) return response;
+
+ // Build, sign, and send the payment
+ const proof = await buildPaymentProof(
+ accepted,
+ payer,
+ connection,
+ signTransaction,
+ sendTransaction,
+ confirmationTimeoutMs,
+ );
+
+ // Build the PaymentPayload
+ const paymentPayload: PaymentPayload = {
+ x402Version: X402_VERSION,
+ resource: typeof input === "string" ? input : input instanceof URL ? input.href : input.url,
+ accepted,
+ payload: proof,
+ };
+
+ // Retry the original request with PAYMENT-SIGNATURE header
+ const retryInit: RequestInit = { ...init };
+ const headers = new Headers(retryInit.headers);
+ headers.set(X402_HEADER_PAYMENT_SIGNATURE, encodePaymentPayload(paymentPayload));
+ retryInit.headers = headers;
+
+ return fetch(input, retryInit);
+ };
+}
+
+// ─── Requirement Selection ──────────────────────────────────────────────────
+
+function selectRequirement(
+ paymentRequired: PaymentRequired,
+ network: string,
+): PaymentRequirements | null {
+ // Prefer pump-agent scheme on the matching network, then fall back to exact
+ return (
+ paymentRequired.accepts.find(
+ (r) => r.scheme === "pump-agent" && r.network === network,
+ ) ??
+ paymentRequired.accepts.find(
+ (r) => r.scheme === "exact" && r.network === network,
+ ) ??
+ null
+ );
+}
+
+// ─── Payment Proof Builder ──────────────────────────────────────────────────
+
+async function buildPaymentProof(
+ requirements: PaymentRequirements,
+ payer: string,
+ connection: Connection,
+ signTransaction: (txBase64: string) => Promise<string>,
+ sendTransaction: (signedTxBase64: string) => Promise<string>,
+ confirmationTimeoutMs: number,
+): Promise<Record<string, unknown>> {
+ const scheme = requirements.scheme;
+ if (scheme === "pump-agent") {
+ return buildPumpAgentProof(
+ requirements as PumpAgentPaymentRequirements,
+ payer,
+ connection,
+ signTransaction,
+ sendTransaction,
+ confirmationTimeoutMs,
+ );
+ }
+
+ if (scheme === "exact") {
+ return buildExactProof(
+ requirements as ExactPaymentRequirements,
+ payer,
+ connection,
+ signTransaction,
+ sendTransaction,
+ confirmationTimeoutMs,
+ );
+ }
+
+ throw new Error(`Unsupported scheme: ${scheme}`);
+}
+
+async function buildPumpAgentProof(
+ requirements: PumpAgentPaymentRequirements,
+ payer: string,
+ connection: Connection,
+ signTransaction: (txBase64: string) => Promise<string>,
+ sendTransaction: (signedTxBase64: string) => Promise<string>,
+ confirmationTimeoutMs: number,
+): Promise<Record<string, unknown>> {
+ const { extra } = requirements;
+
+ const agent = new PumpAgentOffline(new PublicKey(extra.agentMint));
+ const instructions = await agent.buildAcceptPaymentInstructions({
+ user: new PublicKey(payer),
+ currencyMint: new PublicKey(requirements.asset),
+ amount: requirements.amount,
+ memo: extra.memo,
+ startTime: extra.startTime,
+ endTime: extra.endTime,
+ });
+
+ const { blockhash, lastValidBlockHeight } =
+ await connection.getLatestBlockhash("confirmed");
+
+ const tx = new Transaction();
+ tx.recentBlockhash = blockhash;
+ tx.lastValidBlockHeight = lastValidBlockHeight;
+ tx.feePayer = new PublicKey(payer);
+ tx.add(...instructions);
+
+ const txBase64 = Buffer.from(
+ tx.serialize({ requireAllSignatures: false }),
+ ).toString("base64");
+
+ const signedTxBase64 = await signTransaction(txBase64);
+ const signature = await sendTransaction(signedTxBase64);
+
+ await waitForConfirmation(
+ connection,
+ signature,
+ lastValidBlockHeight,
+ confirmationTimeoutMs,
+ );
+
+ return {
+ signature,
+ payer,
+ agentMint: extra.agentMint,
+ asset: requirements.asset,
+ amount: requirements.amount,
+ memo: extra.memo,
+ startTime: extra.startTime,
+ endTime: extra.endTime,
+ };
+}
+
+async function buildExactProof(
+ requirements: ExactPaymentRequirements,
+ payer: string,
+ connection: Connection,
+ signTransaction: (txBase64: string) => Promise<string>,
+ sendTransaction: (signedTxBase64: string) => Promise<string>,
+ confirmationTimeoutMs: number,
+): Promise<Record<string, unknown>> {
+ const payerPk = new PublicKey(payer);
+ const mint = new PublicKey(requirements.asset);
+ const payTo = new PublicKey(requirements.payTo);
+ const amount = BigInt(requirements.amount);
+
+ const mintInfo = await getMint(connection, mint);
+ const senderAta = getAssociatedTokenAddressSync(mint, payerPk, false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID);
+ const receiverAta = getAssociatedTokenAddressSync(mint, payTo, false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID);
+
+ const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash("confirmed");
+
+ const tx = new Transaction();
+ tx.recentBlockhash = blockhash;
+ tx.lastValidBlockHeight = lastValidBlockHeight;
+ tx.feePayer = payerPk;
+
+ const receiverInfo = await connection.getAccountInfo(receiverAta);
+ if (!receiverInfo) {
+ tx.add(createAssociatedTokenAccountInstruction(
+ payerPk, receiverAta, payTo, mint,
+ TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID,
+ ));
+ }
+
+ tx.add(createTransferCheckedInstruction(
+ senderAta, mint, receiverAta, payerPk,
+ amount, mintInfo.decimals, [], TOKEN_PROGRAM_ID,
+ ));
+
+ const txBase64 = Buffer.from(tx.serialize({ requireAllSignatures: false })).toString("base64");
+ const signedTxBase64 = await signTransaction(txBase64);
+ const signature = await sendTransaction(signedTxBase64);
+
+ await waitForConfirmation(connection, signature, lastValidBlockHeight, confirmationTimeoutMs);
+
+ return { signature, network: requirements.network };
+}
+
+// ─── Confirmation Helper ────────────────────────────────────────────────────
+
+async function waitForConfirmation(
+ connection: Connection,
+ signature: string,
+ lastValidBlockHeight: number,
+ timeoutMs: number,
+): Promise<void> {
+ const start = Date.now();
+ while (Date.now() - start < timeoutMs) {
+ const status = await connection.getSignatureStatus(signature);
+ const value = status?.value;
+ if (
+ value?.confirmationStatus === "confirmed" ||
+ value?.confirmationStatus === "finalized"
+ ) {
+ if (value.err)
+ throw new Error(`Transaction failed: ${JSON.stringify(value.err)}`);
+ return;
+ }
+ const blockHeight = await connection.getBlockHeight();
+ if (blockHeight > lastValidBlockHeight) {
+ throw new Error("Transaction expired (blockhash no longer valid)");
+ }
+ await new Promise((r) => setTimeout(r, 2_000));
+ }
+ throw new Error("Transaction confirmation timed out");
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/x402/facilitator.ts b/agent-payments-crosschain-sdk/src/solana/x402/facilitator.ts
new file mode 100644
index 000000000..a390210fc
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/x402/facilitator.ts
@@ -0,0 +1,380 @@
+/**
+ * x402 v2 Facilitator & Resource Server
+ *
+ * Implements the coinbase/x402 3-party architecture:
+ * Client → Resource Server → Facilitator (verify / settle)
+ *
+ * Provides:
+ * - PumpAgentFacilitator: FacilitatorClient that verifies & settles
+ * "pump-agent" scheme payments using PumpAgent on-chain validation.
+ * - createResourceServer: framework-agnostic Request/Response middleware
+ * that returns 402s, verifies payment via a facilitator, and settles.
+ */
+
+import { PublicKey, Connection } from "@solana/web3.js";
+import { PumpAgent } from "../PumpAgent";
+import {
+ decodePaymentPayload,
+ encodePaymentRequired,
+ encodePaymentResponse,
+} from "./headers";
+import type {
+ FacilitatorClient,
+ PaymentPayload,
+ PaymentRequired,
+ PaymentRequirements,
+ PaymentResponse,
+ PumpAgentPaymentRequirements,
+ ResourceServerConfig,
+ SettleResponse,
+ SupportedResponse,
+ VerifyResponse,
+} from "./types";
+import {
+ X402_VERSION,
+ X402_HEADER_PAYMENT_REQUIRED,
+ X402_HEADER_PAYMENT_SIGNATURE,
+ X402_HEADER_PAYMENT_RESPONSE,
+ SOLANA_MAINNET,
+ USDC_MAINNET,
+} from "./types";
+
+// ─── Settlement Cache ───────────────────────────────────────────────────────
+
+class SettlementCache {
+ private cache = new Map<string, number>();
+ private maxSize: number;
+ private ttlMs: number;
+
+ constructor(maxSize = 10_000, ttlMs = 120_000) {
+ this.maxSize = maxSize;
+ this.ttlMs = ttlMs;
+ }
+
+ has(key: string): boolean {
+ const ts = this.cache.get(key);
+ if (!ts) return false;
+ if (Date.now() - ts > this.ttlMs) {
+ this.cache.delete(key);
+ return false;
+ }
+ return true;
+ }
+
+ set(key: string): void {
+ this.cache.set(key, Date.now());
+ if (this.cache.size > this.maxSize) {
+ const cutoff = Date.now() - this.ttlMs;
+ for (const [k, v] of this.cache) {
+ if (v < cutoff) this.cache.delete(k);
+ }
+ }
+ }
+}
+
+// ─── Invoice Memo Generation ────────────────────────────────────────────────
+
+let memoCounter = 0;
+
+function generateMemo(): string {
+ const ts = Date.now();
+ memoCounter = (memoCounter + 1) % 1_000_000;
+ return `${ts}${String(memoCounter).padStart(6, "0")}`;
+}
+
+// ─── Pump Agent Facilitator ─────────────────────────────────────────────────
+
+export interface PumpAgentFacilitatorConfig {
+ /** Solana RPC connection */
+ connection: Connection;
+ /** CAIP-2 network (default: SOLANA_MAINNET) */
+ network?: string;
+}
+
+/**
+ * FacilitatorClient implementation for the "pump-agent" scheme.
+ *
+ * Uses PumpAgent.validateInvoicePayment() for on-chain verification,
+ * and treats the client-submitted transaction signature as the settlement.
+ */
+export class PumpAgentFacilitator implements FacilitatorClient {
+ private connection: Connection;
+ private network: string;
+ private settlementCache = new SettlementCache();
+
+ constructor(config: PumpAgentFacilitatorConfig) {
+ this.connection = config.connection;
+ this.network = config.network ?? SOLANA_MAINNET;
+ }
+
+ async verify(
+ payload: PaymentPayload,
+ requirements: PaymentRequirements,
+ ): Promise<VerifyResponse> {
+ if (requirements.scheme !== "pump-agent") {
+ return { isValid: false, invalidReason: "Unsupported scheme" };
+ }
+
+ if (payload.x402Version !== X402_VERSION) {
+ return { isValid: false, invalidReason: `Expected x402Version ${X402_VERSION}` };
+ }
+
+ const req = requirements as PumpAgentPaymentRequirements;
+ const proof = payload.payload as Record<string, unknown>;
+ const signature = proof.signature as string | undefined;
+ const payer = proof.payer as string | undefined;
+
+ if (!signature || !payer) {
+ return { isValid: false, invalidReason: "Missing signature or payer" };
+ }
+
+ // Duplicate check
+ if (this.settlementCache.has(signature)) {
+ return { isValid: false, invalidReason: "Duplicate payment" };
+ }
+
+ // Verify amount matches
+ if (
+ payload.accepted.amount !== requirements.amount ||
+ payload.accepted.asset !== requirements.asset
+ ) {
+ return { isValid: false, invalidReason: "Amount or asset mismatch" };
+ }
+
+ try {
+ const agent = new PumpAgent(
+ new PublicKey(req.extra.agentMint),
+ req.network === SOLANA_MAINNET ? "mainnet" : "devnet",
+ this.connection,
+ );
+
+ const valid = await agent.validateInvoicePayment({
+ user: new PublicKey(payer),
+ currencyMint: new PublicKey(req.asset),
+ amount: Number(req.amount),
+ memo: Number(req.extra.memo),
+ startTime: req.extra.startTime,
+ endTime: req.extra.endTime,
+ });
+
+ if (!valid) {
+ return { isValid: false, invalidReason: "On-chain validation failed", payer };
+ }
+
+ return { isValid: true, payer };
+ } catch (err) {
+ const message = err instanceof Error ? err.message : String(err);
+ return { isValid: false, invalidReason: `Verification error: ${message}` };
+ }
+ }
+
+ async settle(
+ payload: PaymentPayload,
+ requirements: PaymentRequirements,
+ ): Promise<SettleResponse> {
+ // For pump-agent scheme the client already submitted the transaction.
+ // We just verify and cache to prevent double-spend.
+ const verifyResult = await this.verify(payload, requirements);
+
+ if (!verifyResult.isValid) {
+ return {
+ success: false,
+ errorReason: verifyResult.invalidReason,
+ payer: verifyResult.payer,
+ };
+ }
+
+ const proof = payload.payload as Record<string, unknown>;
+ const signature = proof.signature as string;
+ const payer = proof.payer as string;
+
+ this.settlementCache.set(signature);
+
+ return {
+ success: true,
+ payer,
+ transaction: signature,
+ network: this.network,
+ };
+ }
+
+ async getSupported(): Promise<SupportedResponse> {
+ return {
+ kinds: [
+ {
+ scheme: "pump-agent",
+ network: this.network,
+ asset: USDC_MAINNET,
+ },
+ ],
+ };
+ }
+}
+
+// ─── Payment Requirements Builder ───────────────────────────────────────────
+
+export interface PumpAgentRequirementsConfig {
+ /** Agent token mint (base58) */
+ agentMint: string;
+ /** Currency / asset mint (base58). Defaults to USDC mainnet */
+ asset?: string;
+ /** Recipient address (generally the payment vault) */
+ payTo: string;
+ /** Price in minor units */
+ amount: string;
+ /** CAIP-2 network (default: SOLANA_MAINNET) */
+ network?: string;
+ /** Invoice window in seconds (default: 300) */
+ invoiceWindowSeconds?: number;
+ /** Max settlement timeout in seconds (default: 60) */
+ maxTimeoutSeconds?: number;
+}
+
+/**
+ * Build fresh PumpAgentPaymentRequirements with a unique invoice memo.
+ */
+export function buildPumpAgentRequirements(
+ config: PumpAgentRequirementsConfig,
+): PumpAgentPaymentRequirements {
+ const windowSec = config.invoiceWindowSeconds ?? 300;
+ const now = Math.floor(Date.now() / 1000);
+
+ return {
+ scheme: "pump-agent",
+ network: config.network ?? SOLANA_MAINNET,
+ asset: config.asset ?? USDC_MAINNET,
+ amount: config.amount,
+ payTo: config.payTo,
+ maxTimeoutSeconds: config.maxTimeoutSeconds ?? 60,
+ extra: {
+ agentMint: config.agentMint,
+ memo: generateMemo(),
+ startTime: now,
+ endTime: now + windowSec,
+ },
+ };
+}
+
+// ─── Resource Server Middleware ──────────────────────────────────────────────
+
+/**
+ * Creates a handler wrapper that implements the x402 Resource Server role.
+ *
+ * On requests without PAYMENT-SIGNATURE: returns 402 with PAYMENT-REQUIRED.
+ * On requests with PAYMENT-SIGNATURE: verifies → settles → forwards to handler.
+ *
+ * Works with any framework using the standard Request/Response API
+ * (Hono, Next.js App Router, Cloudflare Workers, Bun, Deno, etc.).
+ *
+ * @example
+ * ```ts
+ * const gate = createResourceServer({
+ * facilitator: new PumpAgentFacilitator({ connection }),
+ * requirements: [buildPumpAgentRequirements({
+ * agentMint: "YourMint...",
+ * payTo: "PaymentVault...",
+ * amount: "1000000",
+ * })],
+ * resource: { url: "/api/inference", description: "AI call" },
+ * });
+ *
+ * // Hono
+ * app.get("/api/inference", (c) =>
+ * gate(c.req.raw, () => c.json({ result: "..." }))
+ * );
+ * ```
+ */
+export function createResourceServer(
+ config: ResourceServerConfig,
+): (
+ request: Request,
+ handler: () => Response | Promise<Response>,
+) => Promise<Response> {
+ const { facilitator, resource } = config;
+
+ return async (
+ request: Request,
+ handler: () => Response | Promise<Response>,
+ ): Promise<Response> => {
+ const paymentHeader = request.headers.get(X402_HEADER_PAYMENT_SIGNATURE);
+
+ if (!paymentHeader) {
+ // Build fresh requirements (with new invoice memos)
+ const body: PaymentRequired = {
+ x402Version: X402_VERSION,
+ resource,
+ accepts: config.requirements,
+ };
+
+ return new Response(JSON.stringify(body), {
+ status: 402,
+ statusText: "Payment Required",
+ headers: {
+ "Content-Type": "application/json",
+ [X402_HEADER_PAYMENT_REQUIRED]: encodePaymentRequired(body),
+ },
+ });
+ }
+
+ // Decode the payment payload
+ let paymentPayload: PaymentPayload;
+ try {
+ paymentPayload = decodePaymentPayload(paymentHeader);
+ } catch {
+ return new Response("Invalid PAYMENT-SIGNATURE header", { status: 400 });
+ }
+
+ // Find the matching requirement
+ const accepted = paymentPayload.accepted;
+ const matchedReq = config.requirements.find(
+ (r) => r.scheme === accepted.scheme && r.network === accepted.network,
+ );
+
+ if (!matchedReq) {
+ return new Response("No matching payment requirement", { status: 400 });
+ }
+
+ // Verify
+ const verifyResult = await facilitator.verify(paymentPayload, matchedReq);
+ if (!verifyResult.isValid) {
+ return new Response(
+ JSON.stringify({ error: verifyResult.invalidReason }),
+ { status: 402, headers: { "Content-Type": "application/json" } },
+ );
+ }
+
+ // Settle
+ const settleResult = await facilitator.settle(paymentPayload, matchedReq);
+
+ if (!settleResult.success) {
+ return new Response(
+ JSON.stringify({ error: settleResult.errorReason }),
+ { status: 402, headers: { "Content-Type": "application/json" } },
+ );
+ }
+
+ // Invoke the actual handler
+ const finalResponse = await handler();
+
+ // Attach PAYMENT-RESPONSE header to the success response
+ const paymentResponse: PaymentResponse = {
+ success: true,
+ transaction: settleResult.transaction,
+ network: settleResult.network,
+ payer: settleResult.payer,
+ };
+
+ // Clone to allow header mutation
+ const outResponse = new Response(finalResponse.body, {
+ status: finalResponse.status,
+ statusText: finalResponse.statusText,
+ headers: new Headers(finalResponse.headers),
+ });
+ outResponse.headers.set(
+ X402_HEADER_PAYMENT_RESPONSE,
+ encodePaymentResponse(paymentResponse),
+ );
+
+ return outResponse;
+ };
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/x402/headers.ts b/agent-payments-crosschain-sdk/src/solana/x402/headers.ts
new file mode 100644
index 000000000..b3e5ae005
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/x402/headers.ts
@@ -0,0 +1,86 @@
+/**
+ * x402 v2 Header encoding / decoding
+ *
+ * Standard headers (per coinbase/x402 v2 spec):
+ * PAYMENT-REQUIRED – server → client (402 response)
+ * PAYMENT-SIGNATURE – client → server (retry request)
+ * PAYMENT-RESPONSE – server → client (200 after settlement)
+ *
+ * All values are base64-encoded JSON.
+ */
+
+import type {
+ PaymentPayload,
+ PaymentRequired,
+ PaymentResponse,
+} from "./types";
+import {
+ X402_HEADER_PAYMENT_REQUIRED,
+ X402_HEADER_PAYMENT_SIGNATURE,
+ X402_HEADER_PAYMENT_RESPONSE,
+} from "./types";
+
+// ─── Encode / Decode primitives ─────────────────────────────────────────────
+
+export function encodePaymentRequired(pr: PaymentRequired): string {
+ return btoa(JSON.stringify(pr));
+}
+
+export function decodePaymentRequired(headerValue: string): PaymentRequired {
+ return JSON.parse(atob(headerValue)) as PaymentRequired;
+}
+
+export function encodePaymentPayload(payload: PaymentPayload): string {
+ return btoa(JSON.stringify(payload));
+}
+
+export function decodePaymentPayload(headerValue: string): PaymentPayload {
+ return JSON.parse(atob(headerValue)) as PaymentPayload;
+}
+
+export function encodePaymentResponse(pr: PaymentResponse): string {
+ return btoa(JSON.stringify(pr));
+}
+
+export function decodePaymentResponse(headerValue: string): PaymentResponse {
+ return JSON.parse(atob(headerValue)) as PaymentResponse;
+}
+
+// ─── Request / Response helpers ─────────────────────────────────────────────
+
+/**
+ * Extract PAYMENT-REQUIRED from a 402 Response.
+ * Returns null if not a 402 or header is missing.
+ */
+export function getPaymentRequiredFromResponse(
+ response: Response,
+): PaymentRequired | null {
+ if (response.status !== 402) return null;
+ const raw = response.headers.get(X402_HEADER_PAYMENT_REQUIRED);
+ if (!raw) return null;
+ return decodePaymentRequired(raw);
+}
+
+/**
+ * Extract PAYMENT-SIGNATURE from a Request.
+ * Returns null if header is missing.
+ */
+export function getPaymentPayloadFromRequest(
+ request: Request,
+): PaymentPayload | null {
+ const raw = request.headers.get(X402_HEADER_PAYMENT_SIGNATURE);
+ if (!raw) return null;
+ return decodePaymentPayload(raw);
+}
+
+/**
+ * Extract PAYMENT-RESPONSE from a Response.
+ * Returns null if header is missing.
+ */
+export function getPaymentResponseFromResponse(
+ response: Response,
+): PaymentResponse | null {
+ const raw = response.headers.get(X402_HEADER_PAYMENT_RESPONSE);
+ if (!raw) return null;
+ return decodePaymentResponse(raw);
+}
diff --git a/agent-payments-crosschain-sdk/src/solana/x402/index.ts b/agent-payments-crosschain-sdk/src/solana/x402/index.ts
new file mode 100644
index 000000000..f6bfd7117
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/x402/index.ts
@@ -0,0 +1,68 @@
+/**
+ * x402 v2 – HTTP 402 Payment Required protocol for Pump Agent Payments
+ *
+ * Aligned with the coinbase/x402 v2 specification.
+ * @see https://github.com/coinbase/x402
+ *
+ * Server-side: PumpAgentFacilitator, createResourceServer, buildPumpAgentRequirements
+ * Client-side: createX402Fetch
+ * Helpers: encode/decode headers, constants
+ */
+
+// Types
+export type {
+ PaymentScheme,
+ ExactScheme,
+ PumpAgentScheme,
+ ResourceInfo,
+ PaymentRequirementsBase,
+ ExactPaymentRequirements,
+ PumpAgentPaymentRequirements,
+ PaymentRequirements,
+ PaymentRequired,
+ PaymentPayload,
+ VerifyResponse,
+ SettleResponse,
+ SupportedKind,
+ SupportedResponse,
+ FacilitatorClient,
+ PaymentResponse,
+ ResourceServerConfig,
+ X402ClientConfig,
+ TransactionSigner,
+ TransactionSender,
+} from "./types";
+export {
+ X402_VERSION,
+ X402_HEADER_PAYMENT_REQUIRED,
+ X402_HEADER_PAYMENT_SIGNATURE,
+ X402_HEADER_PAYMENT_RESPONSE,
+ SOLANA_MAINNET,
+ SOLANA_DEVNET,
+ USDC_MAINNET,
+ USDC_DEVNET,
+} from "./types";
+
+// Headers
+export {
+ encodePaymentRequired,
+ decodePaymentRequired,
+ encodePaymentPayload,
+ decodePaymentPayload,
+ encodePaymentResponse,
+ decodePaymentResponse,
+ getPaymentRequiredFromResponse,
+ getPaymentPayloadFromRequest,
+ getPaymentResponseFromResponse,
+} from "./headers";
+
+// Facilitator
+export type { PumpAgentFacilitatorConfig, PumpAgentRequirementsConfig } from "./facilitator";
+export {
+ PumpAgentFacilitator,
+ buildPumpAgentRequirements,
+ createResourceServer,
+} from "./facilitator";
+
+// Client
+export { createX402Fetch } from "./client";
diff --git a/agent-payments-crosschain-sdk/src/solana/x402/types.ts b/agent-payments-crosschain-sdk/src/solana/x402/types.ts
new file mode 100644
index 000000000..a523745c5
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/solana/x402/types.ts
@@ -0,0 +1,194 @@
+/**
+ * x402 v2 Protocol Types
+ *
+ * Aligned with the coinbase/x402 specification.
+ * Supports "pump-agent" scheme (on-chain invoice payments) and
+ * the standard "exact" scheme (SPL TransferChecked).
+ *
+ * @see https://github.com/coinbase/x402
+ */
+
+// ─── Protocol Constants ─────────────────────────────────────────────────────
+
+export const X402_VERSION = 2;
+
+/** Standard x402 header names (v2 spec) */
+export const X402_HEADER_PAYMENT_REQUIRED = "PAYMENT-REQUIRED";
+export const X402_HEADER_PAYMENT_SIGNATURE = "PAYMENT-SIGNATURE";
+export const X402_HEADER_PAYMENT_RESPONSE = "PAYMENT-RESPONSE";
+
+/** CAIP-2 network identifiers for Solana */
+export const SOLANA_MAINNET = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
+export const SOLANA_DEVNET = "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
+
+/** Well-known Solana asset addresses */
+export const USDC_MAINNET = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
+export const USDC_DEVNET = "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";
+
+// ─── Scheme types ───────────────────────────────────────────────────────────
+
+/** Standard x402 "exact" scheme – SPL TransferChecked */
+export type ExactScheme = "exact";
+/** Pump Agent invoice scheme */
+export type PumpAgentScheme = "pump-agent";
+/** Supported payment schemes */
+export type PaymentScheme = ExactScheme | PumpAgentScheme;
+
+// ─── Resource Info (server describes what is being sold) ────────────────────
+
+export interface ResourceInfo {
+ /** The URL of the paid resource */
+ url: string;
+ /** Human-readable description */
+ description?: string;
+}
+
+// ─── Payment Requirements (per-scheme offer in 402 body) ────────────────────
+
+/** Base fields shared by all schemes */
+export interface PaymentRequirementsBase {
+ /** Payment scheme identifier */
+ scheme: PaymentScheme;
+ /** CAIP-2 network identifier */
+ network: string;
+ /** Token/asset mint address (base58) */
+ asset: string;
+ /** Amount in minor units (string to avoid floating point) */
+ amount: string;
+ /** Recipient address (base58) */
+ payTo: string;
+ /** Max seconds the facilitator will wait for settlement */
+ maxTimeoutSeconds: number;
+ /** Scheme-specific extra data */
+ extra?: Record<string, unknown>;
+}
+
+/** "exact" scheme – standard SPL TransferChecked */
+export interface ExactPaymentRequirements extends PaymentRequirementsBase {
+ scheme: "exact";
+}
+
+/** "pump-agent" scheme – Pump Agent on-chain invoice */
+export interface PumpAgentPaymentRequirements extends PaymentRequirementsBase {
+ scheme: "pump-agent";
+ extra: {
+ /** Agent token mint (base58) */
+ agentMint: string;
+ /** Numeric invoice memo */
+ memo: string;
+ /** Unix timestamp – invoice valid from */
+ startTime: number;
+ /** Unix timestamp – invoice valid until */
+ endTime: number;
+ };
+}
+
+/** Union of all supported requirements */
+export type PaymentRequirements =
+ | ExactPaymentRequirements
+ | PumpAgentPaymentRequirements;
+
+// ─── Payment Required (402 response body) ───────────────────────────────────
+
+export interface PaymentRequired {
+ x402Version: 2;
+ error?: string;
+ resource: ResourceInfo;
+ accepts: PaymentRequirements[];
+}
+
+// ─── Payment Payload (client → server proof in PAYMENT-SIGNATURE) ───────────
+
+export interface PaymentPayload {
+ x402Version: 2;
+ /** The resource URL this payment is for */
+ resource?: string;
+ /** Which accepted scheme/requirements this payment matches */
+ accepted: PaymentRequirements;
+ /** Scheme-specific proof data */
+ payload: Record<string, unknown>;
+}
+
+// ─── Facilitator Responses ──────────────────────────────────────────────────
+
+export interface VerifyResponse {
+ isValid: boolean;
+ invalidReason?: string;
+ payer?: string;
+}
+
+export interface SettleResponse {
+ success: boolean;
+ errorReason?: string;
+ payer?: string;
+ transaction?: string;
+ network?: string;
+}
+
+export interface SupportedKind {
+ scheme: PaymentScheme;
+ network: string;
+ asset: string;
+}
+
+export interface SupportedResponse {
+ kinds: SupportedKind[];
+}
+
+// ─── Facilitator Client Interface ───────────────────────────────────────────
+
+export interface FacilitatorClient {
+ /** Verify a payment payload against its requirements */
+ verify(
+ payload: PaymentPayload,
+ requirements: PaymentRequirements,
+ ): Promise<VerifyResponse>;
+
+ /** Settle (submit) a verified payment and return the result */
+ settle(
+ payload: PaymentPayload,
+ requirements: PaymentRequirements,
+ ): Promise<SettleResponse>;
+
+ /** Return the schemes/networks/assets this facilitator supports */
+ getSupported(): Promise<SupportedResponse>;
+}
+
+// ─── Payment Response (server → client via PAYMENT-RESPONSE header) ─────────
+
+export interface PaymentResponse {
+ success: boolean;
+ transaction?: string;
+ network?: string;
+ payer?: string;
+ errorReason?: string;
+}
+
+// ─── Server / Middleware Configuration ───────────────────────────────────────
+
+export interface ResourceServerConfig {
+ /** Facilitator client to use for verify + settle */
+ facilitator: FacilitatorClient;
+ /** Default payment requirements for this resource */
+ requirements: PaymentRequirements[];
+ /** Resource info describing what's for sale */
+ resource: ResourceInfo;
+}
+
+// ─── Client Configuration ───────────────────────────────────────────────────
+
+export type TransactionSigner = (txBase64: string) => Promise<string>;
+export type TransactionSender = (signedTxBase64: string) => Promise<string>;
+
+export interface X402ClientConfig {
+ /** Payer's public key (base58) */
+ payer: string;
+ /** Sign a serialised transaction, return signed base64 */
+ signTransaction: TransactionSigner;
+ /** Send a signed transaction, return the tx signature (base58) */
+ sendTransaction: TransactionSender;
+ /** CAIP-2 network identifier (default: SOLANA_MAINNET) */
+ network?: string;
+ /** Max time to wait for tx confirmation in ms (default: 30_000) */
+ confirmationTimeoutMs?: number;
+}
diff --git a/agent-payments-crosschain-sdk/src/x402/evm-client.ts b/agent-payments-crosschain-sdk/src/x402/evm-client.ts
new file mode 100644
index 000000000..d067e5763
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/x402/evm-client.ts
@@ -0,0 +1,140 @@
+import type { Address } from "viem";
+import type { SupportedEvmChainId } from "../types.js";
+import { getChain } from "../chains.js";
+
+/**
+ * x402 payment header encoding for EVM-originated payments.
+ *
+ * When an agent API returns HTTP 402 with an X-Payment-Required header,
+ * this client handles quoting and attaches the payment proof header
+ * (X-Payment) to the retry request.
+ *
+ * Usage:
+ * const fetcher = createEvmX402Fetch({ chainId: 8453, walletClient })
+ * const res = await fetcher("https://agent.example/api/chat", { method: "POST", ... })
+ */
+
+export interface EvmX402PaymentRequirements {
+ scheme: "pump-agent-evm";
+ network: string;
+ agentMint: string;
+ maxAmountRequired: string;
+ resource: string;
+ description: string;
+ mimeType: string;
+ payTo: Address;
+ memo: string;
+ quoteId?: string;
+}
+
+export interface EvmWalletClient {
+ chainId: SupportedEvmChainId;
+ address: Address;
+ sendTransaction: (tx: {
+ to: Address;
+ data: `0x${string}`;
+ value: bigint;
+ chainId: number;
+ }) => Promise<`0x${string}`>;
+}
+
+export interface EvmX402FetchOptions {
+ walletClient: EvmWalletClient;
+ /** Called before signing so the UI can show "paying $X..." */
+ onPaymentRequired?: (requirements: EvmX402PaymentRequirements) => Promise<boolean>;
+ /** Called after the bridge tx is submitted with the tx hash */
+ onPaymentSubmitted?: (txHash: `0x${string}`, depositId: string) => void;
+}
+
+/**
+ * Returns a fetch-compatible function that automatically handles HTTP 402
+ * responses by paying via EVM cross-chain and retrying the request.
+ */
+export function createEvmX402Fetch(opts: EvmX402FetchOptions) {
+ return async function x402Fetch(
+ input: RequestInfo | URL,
+ init?: RequestInit
+ ): Promise<Response> {
+ const firstRes = await fetch(input, init);
+
+ if (firstRes.status !== 402) return firstRes;
+
+ const requirementsHeader = firstRes.headers.get("X-Payment-Required");
+ if (!requirementsHeader) return firstRes;
+
+ let requirements: EvmX402PaymentRequirements;
+ try {
+ requirements = JSON.parse(atob(requirementsHeader));
+ } catch {
+ return firstRes;
+ }
+
+ if (requirements.scheme !== "pump-agent-evm") return firstRes;
+
+ // Let the UI confirm before signing
+ if (opts.onPaymentRequired) {
+ const confirmed = await opts.onPaymentRequired(requirements);
+ if (!confirmed) return firstRes;
+ }
+
+ const chain = getChain(opts.walletClient.chainId);
+
+ // Build and send the bridge payment
+ const { getQuote } = await import("../evm/quote.js");
+ const { buildEvmPaymentTransaction } = await import("../evm/transaction.js");
+
+ const quote = await getQuote({
+ fromChainId: opts.walletClient.chainId,
+ fromToken: chain.usdc,
+ fromAmount: BigInt(requirements.maxAmountRequired),
+ agentMint: requirements.agentMint,
+ });
+
+ const txs = await buildEvmPaymentTransaction({
+ quote,
+ agentMint: requirements.agentMint,
+ destinationSolanaWallet: requirements.payTo,
+ memo: requirements.memo,
+ sender: opts.walletClient.address,
+ });
+
+ // Send approval if needed
+ if (txs.approval) {
+ await opts.walletClient.sendTransaction({
+ to: txs.approval.to,
+ data: txs.approval.data,
+ value: txs.approval.value,
+ chainId: opts.walletClient.chainId,
+ });
+ }
+
+ // Send bridge tx
+ const bridgeTxHash = await opts.walletClient.sendTransaction({
+ to: txs.bridge.to,
+ data: txs.bridge.data,
+ value: txs.bridge.value,
+ chainId: txs.bridge.chainId,
+ });
+
+ // Build payment proof header
+ const paymentProof = btoa(
+ JSON.stringify({
+ scheme: "pump-agent-evm",
+ chainId: opts.walletClient.chainId,
+ txHash: bridgeTxHash,
+ quoteId: quote.quoteId,
+ memo: requirements.memo,
+ })
+ );
+
+ if (opts.onPaymentSubmitted) {
+ opts.onPaymentSubmitted(bridgeTxHash, quote.quoteId);
+ }
+
+ // Retry the original request with payment proof
+ const retryHeaders = new Headers(init?.headers);
+ retryHeaders.set("X-Payment", paymentProof);
+
+ return fetch(input, { ...init, headers: retryHeaders });
+ };
+}
diff --git a/agent-payments-crosschain-sdk/src/x402/evm-facilitator.ts b/agent-payments-crosschain-sdk/src/x402/evm-facilitator.ts
new file mode 100644
index 000000000..209d23c0a
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/x402/evm-facilitator.ts
@@ -0,0 +1,174 @@
+import type { Address } from "viem";
+import type { CrossChainPaymentStatusResult, SupportedEvmChainId } from "../types.js";
+import { getPaymentStatus } from "../evm/validate.js";
+import { PUMP_CROSSCHAIN_API } from "../constants.js";
+
+export interface EvmPaymentProof {
+ scheme: "pump-agent-evm";
+ chainId: SupportedEvmChainId;
+ txHash: `0x${string}`;
+ quoteId: string;
+ memo: string;
+}
+
+export interface VerifyEvmPaymentParams {
+ /** Decoded proof from the X-Payment header */
+ proof: EvmPaymentProof;
+ /** Expected memo / invoice ID */
+ expectedMemo: string;
+ /** Minimum USDC amount that must arrive on Solana (6 decimals) */
+ minAmountUsdc: bigint;
+ /** Solana agent mint for this agent */
+ agentMint: string;
+ /**
+ * Whether to wait for Solana arrival before returning.
+ * Set to false if you want to verify the EVM tx only and handle
+ * Solana arrival asynchronously (webhook / queue).
+ */
+ waitForSolana?: boolean;
+}
+
+export interface EvmPaymentVerificationResult {
+ valid: boolean;
+ /** Deposit ID for status polling */
+ depositId?: string;
+ /** Solana tx signature (only when waitForSolana: true and arrived) */
+ solanaSignature?: string;
+ /** Amount confirmed on Solana (6-decimal USDC) */
+ confirmedAmountUsdc?: bigint;
+ error?: string;
+}
+
+/**
+ * Server-side facilitator: verify an EVM payment proof from the X-Payment header.
+ *
+ * Call this from your API route after decoding the X-Payment header:
+ *
+ * const proof = JSON.parse(atob(req.headers["x-payment"]))
+ * const result = await verifyEvmPayment({ proof, expectedMemo, minAmountUsdc, agentMint })
+ * if (!result.valid) return res.status(402).json({ error: result.error })
+ */
+export async function verifyEvmPayment(
+ params: VerifyEvmPaymentParams
+): Promise<EvmPaymentVerificationResult> {
+ const { proof, expectedMemo, minAmountUsdc, agentMint } = params;
+
+ if (proof.scheme !== "pump-agent-evm") {
+ return { valid: false, error: "Unknown payment scheme" };
+ }
+
+ if (proof.memo !== expectedMemo) {
+ return { valid: false, error: "Memo mismatch" };
+ }
+
+ // Fetch the deposit record from Pump.fun API using the quoteId / txHash
+ let depositId: string;
+ try {
+ const res = await fetch(
+ `${PUMP_CROSSCHAIN_API}/deposit?txHash=${proof.txHash}&chainId=${proof.chainId}`
+ );
+ if (!res.ok) throw new Error(`Deposit lookup failed (${res.status})`);
+ const data: { depositId: string; amountUsdc: string } = await res.json();
+ depositId = data.depositId;
+
+ const confirmedAmount = BigInt(data.amountUsdc);
+ if (confirmedAmount < minAmountUsdc) {
+ return {
+ valid: false,
+ depositId,
+ error: `Insufficient amount: got ${confirmedAmount}, need ${minAmountUsdc}`,
+ };
+ }
+ } catch (err) {
+ return {
+ valid: false,
+ error: `EVM tx verification failed: ${(err as Error).message}`,
+ };
+ }
+
+ if (!params.waitForSolana) {
+ return { valid: true, depositId };
+ }
+
+ // Wait for Solana arrival
+ try {
+ const status: CrossChainPaymentStatusResult = await waitWithTimeout(depositId);
+
+ if (status.status === "arrived_on_solana") {
+ return {
+ valid: true,
+ depositId,
+ solanaSignature: status.solanaSignature,
+ };
+ }
+
+ return {
+ valid: false,
+ depositId,
+ error: `Payment failed in transit: ${status.error ?? status.status}`,
+ };
+ } catch (err) {
+ return {
+ valid: false,
+ depositId,
+ error: `Solana arrival timeout: ${(err as Error).message}`,
+ };
+ }
+}
+
+async function waitWithTimeout(
+ depositId: string,
+ maxMs = 60_000
+): Promise<CrossChainPaymentStatusResult> {
+ const deadline = Date.now() + maxMs;
+ while (Date.now() < deadline) {
+ const status = await getPaymentStatus(depositId);
+ if (status.status === "arrived_on_solana" || status.status === "failed") {
+ return status;
+ }
+ await new Promise((r) => setTimeout(r, 3_000));
+ }
+ throw new Error(`Timed out waiting for Solana arrival (${maxMs}ms)`);
+}
+
+/**
+ * Decode and validate the X-Payment header from an incoming request.
+ * Returns null if the header is missing or malformed.
+ */
+export function decodePaymentHeader(
+ headerValue: string | null | undefined
+): EvmPaymentProof | null {
+ if (!headerValue) return null;
+ try {
+ const decoded = JSON.parse(atob(headerValue));
+ if (decoded.scheme !== "pump-agent-evm") return null;
+ return decoded as EvmPaymentProof;
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * Build the X-Payment-Required header value for an agent API endpoint.
+ * Include this in HTTP 402 responses so EVM clients know how to pay.
+ */
+export function buildPaymentRequiredHeader(opts: {
+ agentMint: string;
+ maxAmountUsdc: bigint;
+ resource: string;
+ description: string;
+ payTo: Address;
+ memo: string;
+}): string {
+ return btoa(
+ JSON.stringify({
+ scheme: "pump-agent-evm",
+ agentMint: opts.agentMint,
+ maxAmountRequired: opts.maxAmountUsdc.toString(),
+ resource: opts.resource,
+ description: opts.description,
+ payTo: opts.payTo,
+ memo: opts.memo,
+ })
+ );
+}
diff --git a/agent-payments-crosschain-sdk/src/x402/index.ts b/agent-payments-crosschain-sdk/src/x402/index.ts
new file mode 100644
index 000000000..b21153a28
--- /dev/null
+++ b/agent-payments-crosschain-sdk/src/x402/index.ts
@@ -0,0 +1,2 @@
+export * from "./evm-client.js";
+export * from "./evm-facilitator.js";
diff --git a/agent-payments-crosschain-sdk/tsup.config.ts b/agent-payments-crosschain-sdk/tsup.config.ts
index 3facd0a3e..82149f86c 100644
--- a/agent-payments-crosschain-sdk/tsup.config.ts
+++ b/agent-payments-crosschain-sdk/tsup.config.ts
@@ -5,6 +5,7 @@ export default defineConfig({
index: "src/index.ts",
"evm/index": "src/evm/index.ts",
"solana/index": "src/solana/index.ts",
+ "solana/solana-agent-kit/index": "src/solana/solana-agent-kit/index.ts",
"x402/index": "src/x402/index.ts",
},
format: ["esm", "cjs"],