{"_id":"@blueshift-gg/faucet-react","_rev":"5-146ecabb25d8c5c7a64b6fd0d92ed890","name":"@blueshift-gg/faucet-react","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@blueshift-gg/faucet-react","version":"0.1.0","keywords":["solana","faucet","react","airdrop","blueshift"],"license":"MIT","_id":"@blueshift-gg/faucet-react@0.1.0","maintainers":[{"name":"deanmlittle","email":"hi@deanlittle.com"},{"name":"jyezy","email":"webjyezy@gmail.com"},{"name":"dhkl","email":"david@davidslab.com"}],"dist":{"shasum":"137e3cfa727a6d0f1a3aae4ae343fac68c14681f","tarball":"https://registry.npmjs.org/@blueshift-gg/faucet-react/-/faucet-react-0.1.0.tgz","fileCount":8,"integrity":"sha512-0+raF/sljE/PPv+yFsDR1Gp7kRxSx4FpcmoaMSiRmN0S4oiUJX8l7RE/MQGtuaObWR+rQG5hau/ZCL6sjHEBmA==","signatures":[{"sig":"MEQCIHDAncTmfnPuW2MH/9F9wRUR9GpjxmbtpxZTnkqb7snYAiBLLzK1i71/PjPr6XsxHVRh75+9fJYhlcXrqgha0NJRAg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":247454},"main":"dist/index.cjs","type":"module","_from":"file:blueshift-gg-faucet-react-0.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"lint":"biome check src","build":"tsdown"},"_npmUser":{"name":"dhkl","email":"david@davidslab.com"},"_resolved":"/tmp/2779af77989d908747205e642d71bbb8/blueshift-gg-faucet-react-0.1.0.tgz","_integrity":"sha512-0+raF/sljE/PPv+yFsDR1Gp7kRxSx4FpcmoaMSiRmN0S4oiUJX8l7RE/MQGtuaObWR+rQG5hau/ZCL6sjHEBmA==","_npmVersion":"11.6.0","description":"Blueshift faucet React component","directories":{},"sideEffects":false,"_nodeVersion":"24.8.0","dependencies":{"@blueshift-gg/faucet-sdk":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.17.2","typescript":"^5.6.0","@types/react":"^19.2.0","@biomejs/biome":"^2.3.8","@types/react-dom":"^19.2.0"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","@mantine/hooks":"^7.0.0 || ^8.0.0","@tanstack/react-query":"^5.0.0","@blueshift-gg/ui-components":"^0.1.50"},"_npmOperationalInternal":{"tmp":"tmp/faucet-react_0.1.0_1765348641197_0.6153833421188777","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@blueshift-gg/faucet-react","version":"0.1.1","keywords":["solana","faucet","react","airdrop","blueshift"],"license":"MIT","_id":"@blueshift-gg/faucet-react@0.1.1","maintainers":[{"name":"deanmlittle","email":"hi@deanlittle.com"},{"name":"jyezy","email":"webjyezy@gmail.com"},{"name":"dhkl","email":"david@davidslab.com"}],"dist":{"shasum":"8e1f230d443b0406d42780826518093819205d68","tarball":"https://registry.npmjs.org/@blueshift-gg/faucet-react/-/faucet-react-0.1.1.tgz","fileCount":8,"integrity":"sha512-hQEhEpZkTQsx4n4uIdnf/L6Uj/eio9msvGuBy3Gr88H26IYMTiE66SrE2oDYeOhxH+wDf84mQh90WyTsMsBjpQ==","signatures":[{"sig":"MEYCIQCHha9nAh7MVHD+fUqCV3s2NIuMGw/7r+94fVZ8x4f2uwIhAO1HpdFfJpEDpLiITAF+UyLxJ1gxv0k9lYoABmLnH9Ef","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":247458},"main":"dist/index.cjs","type":"module","_from":"file:blueshift-gg-faucet-react-0.1.1.tgz","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"lint":"biome check src","build":"tsdown"},"_npmUser":{"name":"dhkl","email":"david@davidslab.com"},"_resolved":"/tmp/f359aa8a52f943066ec2d131e72074f1/blueshift-gg-faucet-react-0.1.1.tgz","_integrity":"sha512-hQEhEpZkTQsx4n4uIdnf/L6Uj/eio9msvGuBy3Gr88H26IYMTiE66SrE2oDYeOhxH+wDf84mQh90WyTsMsBjpQ==","_npmVersion":"11.6.0","description":"Blueshift faucet React component","directories":{},"sideEffects":false,"_nodeVersion":"24.8.0","dependencies":{"@blueshift-gg/faucet-sdk":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.17.2","typescript":"^5.6.0","@types/react":"^19.2.0","@biomejs/biome":"^2.3.8","@types/react-dom":"^19.2.0"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","@mantine/hooks":"^7.0.0 || ^8.0.0","@tanstack/react-query":"^5.0.0","@blueshift-gg/ui-components":"^0.1.50"},"_npmOperationalInternal":{"tmp":"tmp/faucet-react_0.1.1_1765353874967_0.014250863057708063","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@blueshift-gg/faucet-react","version":"0.2.0","keywords":["solana","faucet","react","airdrop","blueshift"],"license":"MIT","_id":"@blueshift-gg/faucet-react@0.2.0","maintainers":[{"name":"deanmlittle","email":"hi@deanlittle.com"},{"name":"jyezy","email":"webjyezy@gmail.com"},{"name":"dhkl","email":"david@davidslab.com"}],"dist":{"shasum":"f6f0d0c9b80ace79810bc16353d524a00b6b8ed7","tarball":"https://registry.npmjs.org/@blueshift-gg/faucet-react/-/faucet-react-0.2.0.tgz","fileCount":8,"integrity":"sha512-VFmFPtFD9qmKfa7kbDcsmEGxzV7ToF7VuqOC1BUbObn34r7vRL/n1f43uP4MHWqvWhcB61KNLSYSQohXfacIzA==","signatures":[{"sig":"MEUCIQDsZLlX4MiMzEXhC/Da9a5S07nTHeXo8PFvdxkFhY0wXQIgPP/3tSVGTAec2H7TuD5IpNs1Q5XFr4/5u3NM41XtJ1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":256639},"main":"dist/index.cjs","type":"module","_from":"file:blueshift-gg-faucet-react-0.2.0.tgz","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"lint":"biome check src","build":"tsdown"},"_npmUser":{"name":"dhkl","email":"david@davidslab.com"},"_resolved":"/tmp/2b06d490e08d9c0d6ea48b69924a9f8d/blueshift-gg-faucet-react-0.2.0.tgz","_integrity":"sha512-VFmFPtFD9qmKfa7kbDcsmEGxzV7ToF7VuqOC1BUbObn34r7vRL/n1f43uP4MHWqvWhcB61KNLSYSQohXfacIzA==","_npmVersion":"11.6.0","description":"Blueshift faucet React component","directories":{},"sideEffects":false,"_nodeVersion":"24.8.0","dependencies":{"p-retry":"^7.1.0","@blueshift-gg/faucet-sdk":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.17.2","typescript":"^5.6.0","@types/react":"^19.2.0","@biomejs/biome":"^2.3.8","@types/react-dom":"^19.2.0"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","@mantine/hooks":"^7.0.0 || ^8.0.0","@tanstack/react-query":"^5.0.0","@blueshift-gg/ui-components":"^0.1.50"},"_npmOperationalInternal":{"tmp":"tmp/faucet-react_0.2.0_1765369226365_0.7852316834738018","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@blueshift-gg/faucet-react","version":"0.2.1","keywords":["solana","faucet","react","airdrop","blueshift"],"license":"MIT","_id":"@blueshift-gg/faucet-react@0.2.1","maintainers":[{"name":"deanmlittle","email":"hi@deanlittle.com"},{"name":"jyezy","email":"webjyezy@gmail.com"},{"name":"dhkl","email":"david@davidslab.com"}],"dist":{"shasum":"8071e1ba4e18bc4a8ded7b30abf53b4a2365cd14","tarball":"https://registry.npmjs.org/@blueshift-gg/faucet-react/-/faucet-react-0.2.1.tgz","fileCount":8,"integrity":"sha512-ijtNgkKDZqBH2vZooOyOAxqi4O22TYrWm3je61qTkhbOoxW2dGSeZopEWFA0ChvfncpL0Eyytm+TVKVh1wSkWQ==","signatures":[{"sig":"MEUCIQCgOQOFX4CjmM1mpIrr9z2Ljmx5k1efC7qsJHcUAJk8jgIgJ2w9kvBz7pGUQxwdF1GqcXwtcFpJw0zxjv0CZ3Dus/A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":257399},"main":"dist/index.cjs","type":"module","_from":"file:blueshift-gg-faucet-react-0.2.1.tgz","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"lint":"biome check src","build":"tsdown"},"_npmUser":{"name":"dhkl","email":"david@davidslab.com"},"_resolved":"/tmp/10268b2c54efa939401a467bc79e641c/blueshift-gg-faucet-react-0.2.1.tgz","_integrity":"sha512-ijtNgkKDZqBH2vZooOyOAxqi4O22TYrWm3je61qTkhbOoxW2dGSeZopEWFA0ChvfncpL0Eyytm+TVKVh1wSkWQ==","_npmVersion":"11.6.0","description":"Blueshift faucet React component","directories":{},"sideEffects":false,"_nodeVersion":"24.8.0","dependencies":{"p-retry":"^7.1.0","@blueshift-gg/faucet-sdk":"^1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.17.2","typescript":"^5.6.0","@types/react":"^19.2.0","@biomejs/biome":"^2.3.8","@types/react-dom":"^19.2.0"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0","@mantine/hooks":"^7.0.0 || ^8.0.0","@tanstack/react-query":"^5.0.0","@blueshift-gg/ui-components":"^0.1.50"},"_npmOperationalInternal":{"tmp":"tmp/faucet-react_0.2.1_1765376381396_0.9277077749473537","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@blueshift-gg/faucet-react","version":"0.2.2","description":"Blueshift faucet React component","license":"MIT","type":"module","sideEffects":false,"main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/index.d.mts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.mts"}},"keywords":["solana","faucet","react","airdrop","blueshift"],"peerDependencies":{"@blueshift-gg/ui-components":"^0.1.50","@mantine/hooks":"^7.0.0 || ^8.0.0","@tanstack/react-query":"^5.0.0","react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"dependencies":{"@blueshift-gg/faucet-sdk":"^1.1.1","p-retry":"^7.1.0"},"devDependencies":{"@biomejs/biome":"^2.3.8","@types/react":"^19.2.0","@types/react-dom":"^19.2.0","tsdown":"^0.17.2","typescript":"^5.6.0"},"scripts":{"build":"tsdown","lint":"biome check src"},"_id":"@blueshift-gg/faucet-react@0.2.2","_integrity":"sha512-pcNQWCVKi0wZAJWjSlmGUiJ3BL1V+rrNNXx8y/1eYFlu10MBVPx4CSDYTvXSoMKmmzdPaYXWBf/ZsWx4nxjf/g==","_resolved":"/tmp/e42f6e86c5d08f9f91d556ba015dab77/blueshift-gg-faucet-react-0.2.2.tgz","_from":"file:blueshift-gg-faucet-react-0.2.2.tgz","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-pcNQWCVKi0wZAJWjSlmGUiJ3BL1V+rrNNXx8y/1eYFlu10MBVPx4CSDYTvXSoMKmmzdPaYXWBf/ZsWx4nxjf/g==","shasum":"0cf5bc6ed844999d470227fbbf82b2a56ff56738","tarball":"https://registry.npmjs.org/@blueshift-gg/faucet-react/-/faucet-react-0.2.2.tgz","fileCount":8,"unpackedSize":264210,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDfzTS9EyXlW5gqml4xNAdD0gDdI7SSPnHmvftWTNdQiAIhAJLQV3GLrYnUOIqa7gJmnROJYN2h/ZJQX1X7g3XJNcYv"}]},"_npmUser":{"name":"dhkl","email":"david@davidslab.com"},"directories":{},"maintainers":[{"name":"deanmlittle","email":"hi@deanlittle.com"},{"name":"jyezy","email":"webjyezy@gmail.com"},{"name":"dhkl","email":"david@davidslab.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/faucet-react_0.2.2_1765430453988_0.37536615252709593"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-10T06:37:21.064Z","modified":"2025-12-11T05:20:54.390Z","0.1.0":"2025-12-10T06:37:21.364Z","0.1.1":"2025-12-10T08:04:35.149Z","0.2.0":"2025-12-10T12:20:26.495Z","0.2.1":"2025-12-10T14:19:41.551Z","0.2.2":"2025-12-11T05:20:54.159Z"},"license":"MIT","keywords":["solana","faucet","react","airdrop","blueshift"],"description":"Blueshift faucet React component","maintainers":[{"name":"deanmlittle","email":"hi@deanlittle.com"},{"name":"jyezy","email":"webjyezy@gmail.com"},{"name":"dhkl","email":"david@davidslab.com"}],"readme":"# Faucet Component\n\nA self-contained React component for claiming testnet/devnet SOL tokens. Works with any Solana wallet library.\n\n## Installation\n\n```bash\npnpm add @blueshift-gg/faucet-react @blueshift-gg/ui-components @tanstack/react-query\n```\n\n## Usage\n\n### With @solana/web3.js (wallet-adapter)\n\n```tsx\nimport { useWallet } from \"@solana/wallet-adapter-react\";\nimport { Faucet } from \"@blueshift-gg/faucet-react\";\n\nfunction MyApp() {\n  const { publicKey, signMessage } = useWallet();\n\n  return (\n    <Faucet\n      config={{\n        faucetProgramId: \"YOUR_FAUCET_PROGRAM_ID\",\n        claimAmounts: [1, 2, 5, 10],\n      }}\n      apiConfig={{\n        baseUrl: \"https://faucet-api.blueshift.gg\",\n        devnetRpc: \"https://api.devnet.solana.com\",\n        testnetRpc: \"https://api.testnet.solana.com\",\n      }}\n      address={publicKey?.toBase58()}\n      signMessage={signMessage}\n    />\n  );\n}\n```\n\n### With @solana/react (Kit)\n\n```tsx\nimport { useSignMessage } from \"@solana/react\";\nimport { Faucet } from \"@blueshift-gg/faucet-react\";\n\nfunction MyApp() {\n  const [account] = useContext(SelectedWalletAccountContext);\n  const signMessage = useSignMessage(account!);\n\n  return (\n    <Faucet\n      config={{\n        faucetProgramId: \"YOUR_FAUCET_PROGRAM_ID\",\n        claimAmounts: [1, 2, 5, 10],\n      }}\n      apiConfig={{\n        baseUrl: \"https://faucet-api.blueshift.gg\",\n        devnetRpc: \"https://api.devnet.solana.com\",\n        testnetRpc: \"https://api.testnet.solana.com\",\n      }}\n      address={account?.address}\n      signMessage={\n        account\n          ? async (msg) => (await signMessage({ message: msg })).signature\n          : undefined\n      }\n    />\n  );\n}\n```\n\n## Props\n\n| Prop | Type | Required | Default | Description |\n|------|------|----------|---------|-------------|\n| `config` | `FaucetConfig` | Yes | - | Faucet configuration |\n| `apiConfig` | `FaucetApiConfig` | No* | - | API endpoints (simplest setup) |\n| `service` | `FaucetService` | No* | - | Custom service (advanced) |\n| `network` | `\"devnet\" \\| \"testnet\"` | No | `\"devnet\"` | Current network |\n| `onNetworkChange` | `(network) => void` | No | - | Network change callback |\n| `address` | `string` | No | - | Connected wallet address (base58) |\n| `signMessage` | `(msg: Uint8Array) => Promise<Uint8Array>` | No | - | Sign message function |\n| `notifications` | `FaucetNotifications` | No | Toast | Custom notification handlers |\n| `className` | `string` | No | - | Additional CSS classes |\n| `showReturnSection` | `boolean` | No | `true` | Show \"Return SOL\" section |\n\n*Either `apiConfig` or `service` must be provided.\n\n## FaucetApiConfig\n\n| Property | Type | Required | Description |\n|----------|------|----------|-------------|\n| `baseUrl` | `string` | Yes | Faucet API base URL |\n| `devnetRpc` | `string` | Yes | Devnet RPC endpoint |\n| `testnetRpc` | `string` | Yes | Testnet RPC endpoint |\n\n## FaucetConfig\n\n| Property | Type | Required | Description |\n|----------|------|----------|-------------|\n| `faucetProgramId` | `string` | Yes | The faucet program address |\n| `claimAmounts` | `number[]` | No | Available claim amounts (default: `[1,2,5,10]`) |\n| `challengeUrl` | `string` | No | URL for eligibility challenges |\n| `explorerBaseUrl` | `string` | No | Explorer base URL |\n\n## FaucetService Interface\n\n```tsx\ntype FaucetService = {\n  checkCertification: (address: string) => Promise<{ is_certified: boolean }>;\n  \n  getClaimStatus: (address: string) => Promise<{\n    devnet: { cooldownSeconds: number };\n    testnet: { cooldownSeconds: number };\n  }>;\n  \n  submitClaim: (\n    network: \"devnet\" | \"testnet\",\n    address: string,\n    message: string,\n    signature: Uint8Array | number[],\n  ) => Promise<{ signature: string }>;\n  \n  prepareClaimMessage: (amount: number) => {\n    message: string;\n    messageBytes: Uint8Array;\n  };\n\n  // Optional methods\n  getFaucetBalance?: (network: \"devnet\" | \"testnet\") => Promise<{ sol: number }>;\n  waitForConfirmation?: (signature: string) => Promise<{ confirmed: boolean }>;\n};\n```\n\n## Custom Notifications\n\nBy default, the component uses `@blueshift-gg/ui-components` Toast for notifications. You can provide your own handlers:\n\n```tsx\n<Faucet\n  config={config}\n  service={service}\n  notifications={{\n    onSuccess: (title, message) => myToast.success(`${title}: ${message}`),\n    onError: (title, message) => myToast.error(`${title}: ${message}`),\n  }}\n/>\n```\n\n## Advanced: Using the Hook\n\nFor custom UIs, use the `useFaucet` hook directly:\n\n```tsx\nimport { useFaucet, FaucetContext } from \"@blueshift-gg/faucet-react\";\n\nfunction CustomFaucet() {\n  // Must be inside FaucetContext.Provider\n  const faucet = useFaucet({ network: \"devnet\" });\n\n  return (\n    <div>\n      <p>Connected: {faucet.isConnected ? \"Yes\" : \"No\"}</p>\n      <p>Certified: {faucet.isCertified ? \"Yes\" : \"No\"}</p>\n      <p>On Cooldown: {faucet.isOnCooldown ? \"Yes\" : \"No\"}</p>\n      <button onClick={faucet.claim} disabled={!faucet.canClaim}>\n        Claim {faucet.selectedAmount} SOL\n      </button>\n    </div>\n  );\n}\n```\n\n## Requirements\n\nMust be wrapped in `QueryClientProvider` from `@tanstack/react-query`.\n\n## CSS Styling\n\nThis package uses the Blueshift design tokens provided by `@blueshift-gg/ui-components`.\nMake sure the consuming app includes the base styles from that library and defines\nthe CSS variables/classes referenced in the component markup.\n\n# License\n\nMIT\n","readmeFilename":"README.md"}