{"_id":"@a3e9-microservices/wallet-auth","_rev":"3-0342c36d29744bd4bd895cc4443bbd96","name":"@a3e9-microservices/wallet-auth","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@a3e9-microservices/wallet-auth","version":"1.0.0","keywords":["solana","wallet","authentication","phantom","solflare","sbt","nft"],"author":{"name":"A3E9"},"license":"MIT","_id":"@a3e9-microservices/wallet-auth@1.0.0","maintainers":[{"name":"drzweigle","email":"dz@baeb90.com"}],"homepage":"https://github.com/a3e9-microservices/wallet-auth-package#readme","bugs":{"url":"https://github.com/a3e9-microservices/wallet-auth-package/issues"},"dist":{"shasum":"6bd25ccac017aa5fd7b7388295f823387a945a1e","tarball":"https://registry.npmjs.org/@a3e9-microservices/wallet-auth/-/wallet-auth-1.0.0.tgz","fileCount":38,"integrity":"sha512-WbGecqv44xracH0ZnIGAvwllYop8CYXLH0OQmOpYPwAl/DUBfcrN0b8IpcJltfofGewlEYQ3VbIc7sVQJUwJqA==","signatures":[{"sig":"MEYCIQDO6d9vtR55eFL/+yvx8aU1ARq0nnKCzEwiZmEsElmCQQIhAPExPu34dvKkJGi69Sff6xq9nwP0cIvBYhQapPGrs9U4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49197},"main":"dist/index.js","type":"module","_from":"file:a3e9-microservices-wallet-auth-1.0.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.js"}},"scripts":{"dev":"tsc --watch","test":"jest","build":"tsc"},"_npmUser":{"name":"drzweigle","email":"dz@baeb90.com"},"_resolved":"/tmp/337198906ea02f99e64d110f894bca2a/a3e9-microservices-wallet-auth-1.0.0.tgz","_integrity":"sha512-WbGecqv44xracH0ZnIGAvwllYop8CYXLH0OQmOpYPwAl/DUBfcrN0b8IpcJltfofGewlEYQ3VbIc7sVQJUwJqA==","repository":{"url":"git+https://github.com/a3e9-microservices/wallet-auth-package.git","type":"git"},"_npmVersion":"11.7.0","description":"Reusable Solana wallet authentication and SBT NFT integration package","directories":{},"_nodeVersion":"24.12.0","dependencies":{"bs58":"^5.0.0","tweetnacl":"^1.0.3","@types/bs58":"^4.0.4","firebase-admin":"^13.6.0","@solana/web3.js":"^1.98.4"},"publishConfig":{"registry":"https://npm.pkg.github.com"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/wallet-auth_1.0.0_1768622721618_0.3657030098519276","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@a3e9-microservices/wallet-auth","version":"1.0.1","keywords":["solana","wallet","authentication","phantom","solflare","sbt","nft"],"author":{"name":"A3E9"},"license":"MIT","_id":"@a3e9-microservices/wallet-auth@1.0.1","maintainers":[{"name":"drzweigle","email":"dz@baeb90.com"}],"homepage":"https://github.com/a3e9-microservices/wallet-auth-package#readme","bugs":{"url":"https://github.com/a3e9-microservices/wallet-auth-package/issues"},"dist":{"shasum":"d7bf25ef45da77f2a5c9ea0aed7a97a61f20153c","tarball":"https://registry.npmjs.org/@a3e9-microservices/wallet-auth/-/wallet-auth-1.0.1.tgz","fileCount":38,"integrity":"sha512-6wLSlV3vKDzzlLzUW8fsbSsQXk3XKrvPItw7p50B7vaWeqcZjfMUkwRTddUXNBmTTVyaD5IzZePVjGxU/6BNdQ==","signatures":[{"sig":"MEQCIHjAXZUjvXAxuwRBGsg7YS0EOoyCZJ92ytQbGjPMTC7SAiB5X1oymQQxL/u5adJGDEKAXwsqv63nc4lWmmIjfAloUg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49197},"main":"dist/index.js","type":"module","_from":"file:a3e9-microservices-wallet-auth-1.0.1.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./client":{"types":"./dist/client/index.d.ts","import":"./dist/client/index.js","require":"./dist/client/index.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.js"}},"scripts":{"dev":"tsc --watch","test":"jest","build":"tsc"},"_npmUser":{"name":"drzweigle","email":"dz@baeb90.com"},"_resolved":"/tmp/719e65c67b108b0a0c945a8210140968/a3e9-microservices-wallet-auth-1.0.1.tgz","_integrity":"sha512-6wLSlV3vKDzzlLzUW8fsbSsQXk3XKrvPItw7p50B7vaWeqcZjfMUkwRTddUXNBmTTVyaD5IzZePVjGxU/6BNdQ==","repository":{"url":"git+https://github.com/a3e9-microservices/wallet-auth-package.git","type":"git"},"_npmVersion":"11.7.0","description":"Reusable Solana wallet authentication and SBT NFT integration package","directories":{},"_nodeVersion":"24.12.0","dependencies":{"bs58":"^5.0.0","tweetnacl":"^1.0.3","@types/bs58":"^4.0.4","firebase-admin":"^13.6.0","@solana/web3.js":"^1.98.4"},"publishConfig":{"registry":"https://npm.pkg.github.com"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/wallet-auth_1.0.1_1768623378138_0.3267363545013975","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@a3e9-microservices/wallet-auth","version":"1.0.2","type":"module","description":"Reusable Solana wallet authentication and SBT NFT integration package","main":"dist/index.js","types":"dist/index.d.ts","publishConfig":{"registry":"https://npm.pkg.github.com"},"repository":{"type":"git","url":"git+https://github.com/a3e9-microservices/wallet-auth-package.git"},"keywords":["solana","wallet","authentication","phantom","solflare","sbt","nft"],"author":{"name":"A3E9"},"license":"MIT","devDependencies":{"@types/node":"^20.0.0","typescript":"^5.9.3"},"dependencies":{"@solana/web3.js":"^1.98.4","@types/bs58":"^4.0.4","bs58":"^5.0.0","firebase-admin":"^13.6.0","tweetnacl":"^1.0.3"},"exports":{".":{"import":"./dist/index.js","require":"./dist/index.js","types":"./dist/index.d.ts"},"./client":{"import":"./dist/client/index.js","require":"./dist/client/index.js","types":"./dist/client/index.d.ts"},"./server":{"import":"./dist/server/index.js","require":"./dist/server/index.js","types":"./dist/server/index.d.ts"}},"scripts":{"build":"tsc","dev":"tsc --watch","test":"jest"},"_id":"@a3e9-microservices/wallet-auth@1.0.2","bugs":{"url":"https://github.com/a3e9-microservices/wallet-auth-package/issues"},"homepage":"https://github.com/a3e9-microservices/wallet-auth-package#readme","_integrity":"sha512-jngB87TEcnD0FvmcQvXa+aTtow6z9W5q5ggCTBWcTggUtDdBJImWAFtIUCf0oBuwvbWsvdfwroISC9zkRhqR6Q==","_resolved":"/tmp/5b6d080542b718d06678ae1e94b8c9c9/a3e9-microservices-wallet-auth-1.0.2.tgz","_from":"file:a3e9-microservices-wallet-auth-1.0.2.tgz","_nodeVersion":"24.12.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-jngB87TEcnD0FvmcQvXa+aTtow6z9W5q5ggCTBWcTggUtDdBJImWAFtIUCf0oBuwvbWsvdfwroISC9zkRhqR6Q==","shasum":"6369c37894c76f2028ad57c5584ee111a171ec65","tarball":"https://registry.npmjs.org/@a3e9-microservices/wallet-auth/-/wallet-auth-1.0.2.tgz","fileCount":38,"unpackedSize":49197,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCdxH0KUdG9NtS2OJMq8DoEfL7HymQO0AYbx1hvGoIwgAIhAJv5pNrDMZ7Y3I6MVbD/Ra6f02Fc7x1Uc9jfbJr+ek7O"}]},"_npmUser":{"name":"drzweigle","email":"dz@baeb90.com"},"directories":{},"maintainers":[{"name":"drzweigle","email":"dz@baeb90.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wallet-auth_1.0.2_1768624119050_0.8581076003234893"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-17T04:05:21.520Z","modified":"2026-01-17T04:28:39.319Z","1.0.0":"2026-01-17T04:05:21.749Z","1.0.1":"2026-01-17T04:16:18.284Z","1.0.2":"2026-01-17T04:28:39.210Z"},"bugs":{"url":"https://github.com/a3e9-microservices/wallet-auth-package/issues"},"author":{"name":"A3E9"},"license":"MIT","homepage":"https://github.com/a3e9-microservices/wallet-auth-package#readme","keywords":["solana","wallet","authentication","phantom","solflare","sbt","nft"],"repository":{"type":"git","url":"git+https://github.com/a3e9-microservices/wallet-auth-package.git"},"description":"Reusable Solana wallet authentication and SBT NFT integration package","maintainers":[{"name":"drzweigle","email":"dz@baeb90.com"}],"readme":"# @a3e9-microservices/wallet-auth\n\nReusable Solana wallet authentication and SBT NFT integration package for A3E9 microservices.\n\n## Features\n\n- 🔐 Wallet connection (Phantom, Solflare)\n- ✅ Signature verification\n- 🎫 SBT NFT lookup and validation\n- 💾 Session management\n- 📦 TypeScript support\n- 🔄 Reusable across frontend and backend\n\n## Installation\n\n```bash\nnpm install @a3e9-microservices/wallet-auth\n```\n\n## Usage\n\n### Client-Side (Frontend)\n\n```typescript\nimport { connectWallet, disconnectWallet } from '@a3e9-microservices/wallet-auth/client';\n\n// Connect to Phantom wallet\nconst connection = await connectWallet('phantom');\nconsole.log('Connected:', connection.publicKey);\n\n// Disconnect\nawait disconnectWallet('phantom');\n```\n\n### Server-Side (Backend)\n\n```typescript\nimport { verifySignature, getTokenCustomization } from '@a3e9-microservices/wallet-auth/server';\n\n// Verify wallet signature\nconst isValid = await verifySignature(publicKey, message, signature);\n\n// Get token customization from SBT NFT\nconst customization = await getTokenCustomization(walletAddress);\n```\n\n## API Reference\n\n### Client API\n\n#### `connectWallet(walletType: 'phantom' | 'solflare'): Promise<WalletConnection>`\n\nConnect to a Solana wallet.\n\n#### `disconnectWallet(walletType: 'phantom' | 'solflare'): Promise<void>`\n\nDisconnect from wallet.\n\n#### `signMessage(walletType: 'phantom' | 'solflare', message: string): Promise<Uint8Array>`\n\nSign a message with the connected wallet.\n\n#### `isWalletInstalled(walletType: 'phantom' | 'solflare'): boolean`\n\nCheck if a wallet is installed.\n\n#### `saveWalletConnection(publicKey: string, walletType: 'phantom' | 'solflare'): void`\n\nSave wallet connection to localStorage.\n\n#### `getSavedWalletConnection(): { publicKey: string; walletType: WalletType } | null`\n\nGet saved wallet connection from localStorage.\n\n### Server API\n\n#### `verifySignature(publicKey: string, message: string, signature: Uint8Array | string): Promise<boolean>`\n\nVerify a wallet signature.\n\n#### `createAuthChallenge(publicKey: string): string`\n\nCreate an authentication challenge message.\n\n#### `authenticateWallet(publicKey: string, walletType: 'phantom' | 'solflare', message: string, signature: string): Promise<AuthResult>`\n\nAuthenticate a wallet with signature verification.\n\n#### `findSBTForWallet(walletAddress: string, rpcUrl?: string): Promise<SBTLookupResult>`\n\nFind SBT NFT for a wallet address.\n\n#### `getTokenCustomization(walletAddress: string, rpcUrl?: string): Promise<TokenCustomization | null>`\n\nGet token customization from SBT NFT.\n\n#### `hasActiveSubscription(walletAddress: string, rpcUrl?: string): Promise<boolean>`\n\nCheck if wallet has an active subscription.\n\n## Types\n\n```typescript\nexport type WalletType = 'phantom' | 'solflare';\n\nexport interface WalletConnection {\n  publicKey: string;\n  walletType: WalletType;\n  connected: boolean;\n}\n\nexport interface TokenCustomization {\n  tokenAddress: string;\n  theme: 'Default' | 'Galaxy' | 'Ocean' | 'Sunset';\n  tokenInfo: {\n    name: string;\n    symbol: string;\n    logo: string;\n    description: string;\n  };\n  socialLinks: {\n    twitter?: string;\n    telegram?: string;\n    discord?: string;\n    website?: string;\n  };\n  subscription: {\n    tier: 'growth' | 'established' | 'enterprise';\n    active: boolean;\n    expiresAt?: string;\n  };\n  createdAt: string;\n  updatedAt: string;\n}\n```\n\n## Integration Examples\n\n### React Frontend\n\n```typescript\nimport { useState } from 'react';\nimport { connectWallet, saveWalletConnection } from '@a3e9-microservices/wallet-auth/client';\n\nfunction WalletButton() {\n  const [connected, setConnected] = useState(false);\n\n  const handleConnect = async () => {\n    try {\n      const connection = await connectWallet('phantom');\n      saveWalletConnection(connection.publicKey, connection.walletType);\n      setConnected(true);\n    } catch (error) {\n      console.error('Connection failed:', error);\n    }\n  };\n\n  return (\n    <button onClick={handleConnect}>\n      {connected ? 'Connected' : 'Connect Wallet'}\n    </button>\n  );\n}\n```\n\n### Express Backend\n\n```typescript\nimport express from 'express';\nimport { authenticateWallet, getTokenCustomization } from '@a3e9-microservices/wallet-auth/server';\n\nconst app = express();\n\napp.post('/api/auth/login', async (req, res) => {\n  const { publicKey, walletType, message, signature } = req.body;\n\n  const authResult = await authenticateWallet(publicKey, walletType, message, signature);\n\n  if (authResult.success) {\n    // Check for existing customization\n    const customization = await getTokenCustomization(publicKey);\n\n    res.json({\n      success: true,\n      session: authResult.session,\n      customization,\n      isFirstTime: !customization,\n    });\n  } else {\n    res.status(401).json({ error: authResult.error });\n  }\n});\n```\n\n## Environment Variables\n\n```env\nSOLANA_RPC_URL=https://api.mainnet-beta.solana.com\n```\n\n## License\n\nMIT\n\n## Author\n\nA3E9\n","readmeFilename":"README.md"}