{"_id":"@askdolly/x402-embed-sdk","_rev":"4-a86d3beae73afcac4fc5769b69965705","name":"@askdolly/x402-embed-sdk","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"@askdolly/x402-embed-sdk","version":"0.0.1","keywords":["solana","x402","payment","usdc","web3","chat","widget","embed","floating-chat"],"author":{"name":"Dolly"},"license":"MIT","_id":"@askdolly/x402-embed-sdk@0.0.1","maintainers":[{"name":"0xhardman","email":"sazhang0928@gmail.com"}],"homepage":"https://github.com/ContriXLimited/x402-dolly#readme","bugs":{"url":"https://github.com/ContriXLimited/x402-dolly/issues"},"dist":{"shasum":"4be36256e06423a01975fb8eea32aaa2bd370d10","tarball":"https://registry.npmjs.org/@askdolly/x402-embed-sdk/-/x402-embed-sdk-0.0.1.tgz","fileCount":9,"integrity":"sha512-FJWSoUoj5RjedBaJC9LdgVcc4vbXbM1jmsn1WIPWV1UEBxA9V+kO7IwFFuZ9FkZnV2vIfCVCUeln65ehaMNXAg==","signatures":[{"sig":"MEUCICny8M2YG1KCH/5R01OECaq2lRK+LpK9b0LQnmc6o3XcAiEAxrFLzIW+yCJvkOsefBzWcqBUj0F8vWl+gOib6spoaxs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":136758},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./styles.css":"./dist/styles.css"},"gitHead":"a6d3f55df38a8a34a525519b6ed74f20d50e7214","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","build":"tsup","check-types":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"0xhardman","email":"sazhang0928@gmail.com"},"repository":{"url":"git+https://github.com/ContriXLimited/x402-dolly.git","type":"git","directory":"packages/x402-embed-sdk"},"_npmVersion":"10.8.2","description":"Embeddable X402 payment widget for Solana - floating chat interface with built-in USDC payment support","directories":{},"_nodeVersion":"20.19.2","dependencies":{"lucide-react":"^0.553.0","@solana/web3.js":"^1.98.4","@solana/spl-token":"^0.4.14","@solana/wallet-adapter-base":"^0.9.27"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.39.1","typescript":"5.9.2","@types/node":"^22.15.3","@types/react":"19.2.2","@types/react-dom":"19.2.2","@repo/eslint-config":"workspace:*","@repo/typescript-config":"workspace:*"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0","@solana/wallet-adapter-react":"^0.15.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-embed-sdk_0.0.1_1762763443637_0.7463403174771173","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@askdolly/x402-embed-sdk","version":"0.0.5","keywords":["solana","x402","payment","usdc","web3","chat","widget","embed","floating-chat"],"author":{"name":"Dolly"},"license":"MIT","_id":"@askdolly/x402-embed-sdk@0.0.5","maintainers":[{"name":"0xhardman","email":"sazhang0928@gmail.com"}],"homepage":"https://github.com/ContriXLimited/x402-dolly#readme","bugs":{"url":"https://github.com/ContriXLimited/x402-dolly/issues"},"dist":{"shasum":"7a6b383604966e22fc7b0eee97cd9101242fecf4","tarball":"https://registry.npmjs.org/@askdolly/x402-embed-sdk/-/x402-embed-sdk-0.0.5.tgz","fileCount":9,"integrity":"sha512-mblIDBQzkC8mSzOsj1hZAdLrX2jbosGaPn+9bXRe4vuDiAt6QD22aRa96v0Pc8zEAedD2PeVbbjTpUsGB1ZzAA==","signatures":[{"sig":"MEUCIHQ4EqQNkqHR2Wd3BbS+4arm1pwHMO9OGZnV9Zqy1qnHAiEA2z79IrrBg7kb4oxpnpgDWtDy+WGrfNsOE2nZQhI7Lyk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":136762},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./styles.css":"./dist/styles.css"},"gitHead":"a9e21212e173bcb103edb574f1f1413365da6d28","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","build":"tsup","check-types":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"0xhardman","email":"sazhang0928@gmail.com"},"repository":{"url":"git+https://github.com/ContriXLimited/x402-dolly.git","type":"git","directory":"packages/x402-embed-sdk"},"_npmVersion":"10.8.2","description":"Embeddable X402 payment widget for Solana - floating chat interface with built-in USDC payment support","directories":{},"_nodeVersion":"20.19.2","dependencies":{"lucide-react":"^0.553.0","@solana/web3.js":"^1.98.4","@solana/spl-token":"^0.4.14","@solana/wallet-adapter-base":"^0.9.27"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.39.1","typescript":"5.9.2","@types/node":"^22.15.3","@types/react":"19.2.2","@types/react-dom":"19.2.2","@repo/eslint-config":"workspace:*","@repo/typescript-config":"workspace:*"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0","@solana/wallet-adapter-react":"^0.15.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-embed-sdk_0.0.5_1762765722806_0.804934126096299","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@askdolly/x402-embed-sdk","version":"0.0.6","keywords":["solana","x402","payment","usdc","web3","chat","widget","embed","floating-chat"],"author":{"name":"Dolly"},"license":"MIT","_id":"@askdolly/x402-embed-sdk@0.0.6","maintainers":[{"name":"0xhardman","email":"sazhang0928@gmail.com"}],"homepage":"https://github.com/ContriXLimited/x402-dolly#readme","bugs":{"url":"https://github.com/ContriXLimited/x402-dolly/issues"},"dist":{"shasum":"eb7568fd7b4db311bac3a3da15da6a1cacf2e30a","tarball":"https://registry.npmjs.org/@askdolly/x402-embed-sdk/-/x402-embed-sdk-0.0.6.tgz","fileCount":9,"integrity":"sha512-9EdGB/VNvPKAbb4KIfIpaDKQ/oKMxQHHk3qaevB/Yww1GL+vii6mRNtxBWPcsj5B9BfYzWyInTQ6YUK1zWhLzg==","signatures":[{"sig":"MEYCIQCKceyjLv4IgvgzuLGdSQI2L0fjaCj43tx+Hhk05IG0EAIhAK/icv6PZRLyaqLfhB+Hm+JAzfimPoshoC7WduQD20qZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@askdolly%2fx402-embed-sdk@0.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":136762},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./styles.css":"./dist/styles.css"},"gitHead":"28fa75672229e056177d032e5e05aca00b5af863","scripts":{"dev":"tsup --watch","lint":"eslint . --max-warnings 0","build":"tsup","check-types":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f01cd1e1-ff04-45b2-b0b8-fdb2a7e9e1ea"}},"repository":{"url":"git+https://github.com/ContriXLimited/x402-dolly.git","type":"git","directory":"packages/x402-embed-sdk"},"_npmVersion":"11.6.2","description":"Embeddable X402 payment widget for Solana - floating chat interface with built-in USDC payment support","directories":{},"_nodeVersion":"20.19.5","dependencies":{"lucide-react":"^0.553.0","@solana/web3.js":"^1.98.4","@solana/spl-token":"^0.4.14","@solana/wallet-adapter-base":"^0.9.27"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","eslint":"^9.39.1","typescript":"5.9.2","@types/node":"^22.15.3","@types/react":"19.2.2","@types/react-dom":"19.2.2","@repo/eslint-config":"workspace:*","@repo/typescript-config":"workspace:*"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0","@solana/wallet-adapter-react":"^0.15.0"},"_npmOperationalInternal":{"tmp":"tmp/x402-embed-sdk_0.0.6_1762765954509_0.31656727409916896","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@askdolly/x402-embed-sdk","version":"0.0.7","description":"Embeddable X402 payment widget for Solana - floating chat interface with built-in USDC payment support","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./styles.css":"./dist/styles.css"},"scripts":{"build":"tsup","dev":"tsup --watch","lint":"eslint . --max-warnings 0","check-types":"tsc --noEmit","prepublishOnly":"pnpm build"},"keywords":["solana","x402","payment","usdc","web3","chat","widget","embed","floating-chat"],"author":{"name":"Dolly"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ContriXLimited/x402-dolly.git","directory":"packages/x402-embed-sdk"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0","@solana/wallet-adapter-react":"^0.15.0"},"dependencies":{"@solana/spl-token":"^0.4.14","@solana/wallet-adapter-base":"^0.9.27","@solana/web3.js":"^1.98.4","lucide-react":"^0.553.0"},"devDependencies":{"@repo/eslint-config":"workspace:*","@repo/typescript-config":"workspace:*","@types/node":"^22.15.3","@types/react":"19.2.2","@types/react-dom":"19.2.2","eslint":"^9.39.1","tsup":"^8.3.5","typescript":"5.9.2"},"publishConfig":{"access":"public"},"gitHead":"10a5deb9cbe88b08eedeea48134c8471f0cc80c5","_id":"@askdolly/x402-embed-sdk@0.0.7","bugs":{"url":"https://github.com/ContriXLimited/x402-dolly/issues"},"homepage":"https://github.com/ContriXLimited/x402-dolly#readme","_nodeVersion":"20.19.5","_npmVersion":"11.6.2","dist":{"integrity":"sha512-vpOd2hhNvkqnC+fJjGjiszvwdbfwCVpF/JDux8MMp623GZWXD0usH+k4GsQ1xEXUw2/bfMExr+q15hOERHTeFQ==","shasum":"381e4e2a4dbe5c87a392d86ff1fdfff8aba13f64","tarball":"https://registry.npmjs.org/@askdolly/x402-embed-sdk/-/x402-embed-sdk-0.0.7.tgz","fileCount":9,"unpackedSize":139927,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@askdolly%2fx402-embed-sdk@0.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAbQV6J70j7DGmR77nTmamiXzQwhaadxw9WPZI6wVmyfAiEAxnPJgLzKBHWdQVy1hhdV6eL2CrtyVduyctZHHfSBRrU="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f01cd1e1-ff04-45b2-b0b8-fdb2a7e9e1ea"}},"directories":{},"maintainers":[{"name":"0xhardman","email":"sazhang0928@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402-embed-sdk_0.0.7_1762786265416_0.655172504549973"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-10T08:30:43.488Z","modified":"2025-11-10T14:51:06.023Z","0.0.1":"2025-11-10T08:30:43.873Z","0.0.5":"2025-11-10T09:08:43.042Z","0.0.6":"2025-11-10T09:12:34.696Z","0.0.7":"2025-11-10T14:51:05.605Z"},"bugs":{"url":"https://github.com/ContriXLimited/x402-dolly/issues"},"author":{"name":"Dolly"},"license":"MIT","homepage":"https://github.com/ContriXLimited/x402-dolly#readme","keywords":["solana","x402","payment","usdc","web3","chat","widget","embed","floating-chat"],"repository":{"type":"git","url":"git+https://github.com/ContriXLimited/x402-dolly.git","directory":"packages/x402-embed-sdk"},"description":"Embeddable X402 payment widget for Solana - floating chat interface with built-in USDC payment support","maintainers":[{"name":"0xhardman","email":"sazhang0928@gmail.com"}],"readme":"# @askdolly/x402-embed-sdk\n\nEmbeddable X402 payment widget for Solana - a beautiful floating chat interface with built-in USDC payment support.\n\n## Features\n\n- 🎨 Beautiful glassmorphism UI design\n- 💰 Built-in X402 payment protocol support\n- 🔐 Solana wallet integration via wallet-adapter\n- 💳 USDC payment on Solana Devnet\n- 🎯 Easy to integrate - just drop in one component\n- 📱 Responsive and mobile-friendly\n- ⚡ Smooth animations and transitions\n- 🛡️ Type-safe with TypeScript\n\n## Installation\n\n```bash\nnpm install @askdolly/x402-embed-sdk\n# or\nyarn add @askdolly/x402-embed-sdk\n# or\npnpm add @askdolly/x402-embed-sdk\n```\n\n## Peer Dependencies\n\nMake sure you have these installed in your project:\n\n```bash\nnpm install react react-dom @solana/wallet-adapter-react\n```\n\n## Quick Start\n\n### 1. Set up Wallet Provider\n\nFirst, wrap your app with the Solana wallet provider:\n\n```tsx\nimport { WalletProvider } from '@solana/wallet-adapter-react';\nimport { WalletAdapterNetwork } from '@solana/wallet-adapter-base';\nimport { PhantomWalletAdapter } from '@solana/wallet-adapter-wallets';\nimport { useMemo } from 'react';\n\nfunction App() {\n  const network = WalletAdapterNetwork.Devnet;\n  const wallets = useMemo(() => [new PhantomWalletAdapter()], []);\n\n  return (\n    <WalletProvider wallets={wallets} autoConnect>\n      {/* Your app content */}\n    </WalletProvider>\n  );\n}\n```\n\n### 2. Add FloatingChat Component\n\n```tsx\nimport { FloatingChat } from '@askdolly/x402-embed-sdk';\n\nexport default function MyPage() {\n  return (\n    <>\n      {/* Your page content */}\n\n      <FloatingChat\n        agentId=\"1\"\n        agentName=\"AI Assistant\"\n        agentDescription=\"How can I help you today?\"\n        position=\"bottom-right\"\n        apiEndpoint=\"https://api.yourdomain.com\"\n      />\n    </>\n  );\n}\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `agentId` | `string` | **required** | Unique identifier for the agent |\n| `agentName` | `string` | `'AI Agent'` | Display name for the agent |\n| `agentAvatar` | `string` | `''` | URL to agent's avatar image |\n| `agentDescription` | `string` | `'How can I help you today?'` | Welcome message |\n| `position` | `'bottom-right' \\| 'bottom-left'` | `'bottom-right'` | Position of the floating button |\n| `logoUrl` | `string` | `'/logo.svg'` | Logo displayed in the floating button |\n| `apiEndpoint` | `string` | `'http://localhost:3000'` | Your backend API endpoint |\n\n## Environment Variables\n\nCreate a `.env.local` file in your Next.js project:\n\n```env\nNEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com\n```\n\n## X402 Payment Flow\n\nThe widget implements a complete X402 payment flow:\n\n1. User sends a message\n2. Widget checks USDC balance\n3. Initial API request returns 402 Payment Required\n4. Widget builds a Solana SPL token transfer transaction\n5. User signs the transaction with their wallet\n6. Request is retried with `X-PAYMENT` header\n7. Server validates and broadcasts the transaction\n8. Server returns 200 with `X-PAYMENT-RESPONSE` header\n9. Transaction signature is logged to console\n\n## Payment Configuration\n\nDefault configuration (Solana Devnet):\n- **Network**: Solana Devnet\n- **Token**: USDC (`4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU`)\n- **Amount**: 0.01 USDC per request\n- **Fee Payer**: Provided by facilitator (gas abstraction)\n\n## Getting Testnet USDC\n\nTo test payments, get testnet USDC from: https://faucet.circle.com/\n\n## Backend Requirements\n\nYour backend API must implement the X402 payment protocol:\n\n1. Return `402 Payment Required` for initial requests\n2. Accept `X-PAYMENT` header with signed transaction\n3. Validate and broadcast the transaction\n4. Return `200 OK` with `X-PAYMENT-RESPONSE` header on success\n\nSee the [X402 Protocol Spec](https://github.com/dolly-x402/spec) for details.\n\n## TypeScript Support\n\nThis package is written in TypeScript and includes type definitions.\n\n```tsx\nimport type { FloatingChatProps, ChatRequest, ChatResponse, PaymentError } from '@askdolly/x402-embed-sdk';\n```\n\n## Styling\n\nThe component uses Tailwind CSS classes. Make sure Tailwind is configured in your project, or the component will fall back to inline styles.\n\n## Example Projects\n\nCheck out the example implementations:\n- [Next.js Example](../../apps/web)\n- [Docs Example](../../apps/docs)\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please open an issue or PR on GitHub.\n\n## Support\n\nFor issues and feature requests, please use [GitHub Issues](https://github.com/ContriXLimited/x402-dolly/issues).\n","readmeFilename":"README.md"}