{"_id":"@aiindigo/btcfi","name":"@aiindigo/btcfi","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@aiindigo/btcfi","version":"3.0.0","description":"TypeScript SDK for BTCFi API — Bitcoin data, intelligence, security, Solv Protocol, and ZK proofs via x402 micropayments","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","prepublishOnly":"npm run build"},"keywords":["bitcoin","btcfi","x402","micropayments","mcp","ai-agents","solv-protocol","zk-proofs","mempool","whale-alerts","threat-analysis"],"author":{"name":"AI Indigo","email":"ai@aiindigo.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aiindigo925/btcfi-api.git"},"homepage":"https://btcfi.aiindigo.com","bugs":{"url":"https://github.com/aiindigo925/btcfi-api/issues"},"engines":{"node":">=18"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0"},"gitHead":"f0bfd048c8ad8d32c566d31bcb88367ea7794ad9","_id":"@aiindigo/btcfi@3.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-v/JUL9PUjRwE2qetUq76z6tSn34f/bfyW55wcLF6KXS+Rsy174jVdMbTUKY8mmUKXHCrYREp6tbLMDfaFzqk3Q==","shasum":"85bc0ba428377acadc85f0a171254b1d3eb9032d","tarball":"https://registry.npmjs.org/@aiindigo/btcfi/-/btcfi-3.0.0.tgz","fileCount":7,"unpackedSize":40310,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDCqux8iEdeS6/njMDsLtwi/q1eWrubsMAnbk2oY6K7TwIhAMTbxwXfZ5OXAOchAFauRyhtLyYg6dt/asFeV05zn1B1"}]},"_npmUser":{"name":"aiindigo","email":"yogigames@protonmail.ch"},"directories":{},"maintainers":[{"name":"aiindigo","email":"yogigames@protonmail.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/btcfi_3.0.0_1770801842933_0.8683185656246324"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T09:24:02.815Z","3.0.0":"2026-02-11T09:24:03.075Z","modified":"2026-02-11T09:24:03.316Z"},"maintainers":[{"name":"aiindigo","email":"yogigames@protonmail.ch"}],"description":"TypeScript SDK for BTCFi API — Bitcoin data, intelligence, security, Solv Protocol, and ZK proofs via x402 micropayments","homepage":"https://btcfi.aiindigo.com","keywords":["bitcoin","btcfi","x402","micropayments","mcp","ai-agents","solv-protocol","zk-proofs","mempool","whale-alerts","threat-analysis"],"repository":{"type":"git","url":"git+https://github.com/aiindigo925/btcfi-api.git"},"author":{"name":"AI Indigo","email":"ai@aiindigo.com"},"bugs":{"url":"https://github.com/aiindigo925/btcfi-api/issues"},"license":"MIT","readme":"# @aiindigo/btcfi\n\nTypeScript SDK for the [BTCFi API](https://btcfi.aiindigo.com) — Bitcoin data, intelligence, security, Solv Protocol, and ZK proofs via x402 micropayments.\n\n## Install\n\n```bash\nnpm install @aiindigo/btcfi\n```\n\n## Quick Start\n\n```ts\nimport { BTCFi } from '@aiindigo/btcfi';\n\nconst btcfi = new BTCFi();\n\n// Free endpoints\nconst health = await btcfi.getHealth();\n\n// Paid endpoints (returns 402 PaymentRequiredError without payment)\nconst fees = await btcfi.getFees();\n\n// Auto-pay with private key\nconst btcfiPaid = new BTCFi({\n  evmPrivateKey: process.env.EVM_PRIVATE_KEY,  // Base USDC\n  // OR\n  svmPrivateKey: process.env.SVM_PRIVATE_KEY,  // Solana USDC\n});\nconst whales = await btcfiPaid.getWhaleAlerts();\n```\n\n## 28 Methods\n\n### Core\n| Method | Endpoint | Price |\n|--------|----------|-------|\n| `getFees()` | GET /api/v1/fees | $0.01 |\n| `getMempool()` | GET /api/v1/mempool | $0.01 |\n| `getAddress(addr)` | GET /api/v1/address/:addr | $0.01 |\n| `getUtxos(addr)` | GET /api/v1/address/:addr/utxos | $0.01 |\n| `getAddressTxs(addr)` | GET /api/v1/address/:addr/txs | $0.01 |\n| `getTx(txid)` | GET /api/v1/tx/:txid | $0.01 |\n| `getTxStatus(txid)` | GET /api/v1/tx/:txid/status | $0.01 |\n| `broadcastTx(hex)` | POST /api/v1/tx/broadcast | $0.05 |\n| `getBlock(id)` | GET /api/v1/block/:id | $0.01 |\n| `getLatestBlocks(n)` | GET /api/v1/block/latest | $0.01 |\n\n### Intelligence\n| Method | Endpoint | Price |\n|--------|----------|-------|\n| `getConsolidationAdvice(addr)` | GET /api/v1/intelligence/consolidate/:addr | $0.02 |\n| `getFeePrediction()` | GET /api/v1/intelligence/fees | $0.02 |\n| `getWhaleAlerts()` | GET /api/v1/intelligence/whales | $0.02 |\n| `getAddressRisk(addr)` | GET /api/v1/intelligence/risk/:addr | $0.02 |\n| `getNetworkHealth()` | GET /api/v1/intelligence/network | $0.02 |\n\n### Security\n| Method | Endpoint | Price |\n|--------|----------|-------|\n| `getThreatAnalysis(addr)` | GET /api/v1/security/threat/:addr | $0.02 |\n\n### Solv Protocol\n| Method | Endpoint | Price |\n|--------|----------|-------|\n| `getSolvReserves()` | GET /api/v1/solv/reserves | $0.02 |\n| `getSolvYield()` | GET /api/v1/solv/yield | $0.02 |\n| `getSolvLiquidity(chain?)` | GET /api/v1/solv/liquidity | $0.02 |\n| `getSolvRisk()` | GET /api/v1/solv/risk | $0.02 |\n\n### ZK Proofs\n| Method | Endpoint | Price |\n|--------|----------|-------|\n| `generateBalanceProof(addr, threshold, unit?)` | POST /api/v1/zk/balance-proof | $0.03 |\n| `generateAgeProof(addr, minBlocks)` | POST /api/v1/zk/age-proof | $0.03 |\n| `generateMembershipProof(addr, root, proof)` | POST /api/v1/zk/membership | $0.03 |\n| `verifyProof(type, proof, inputs)` | POST /api/v1/zk/verify | $0.01 |\n\n### Streams & System\n| Method | Endpoint | Price |\n|--------|----------|-------|\n| `stream({ channel, min })` | GET /api/v1/stream | $0.01 |\n| `getStakingStatus(addr?)` | GET /api/v1/staking/status | free |\n| `getHealth()` | GET /api/health | free |\n| `getApiIndex()` | GET /api/v1 | free |\n\n## Payment Networks\n\n| Network | Facilitator | Fees |\n|---------|------------|------|\n| Base | Coinbase x402 (ERC-3009) | Zero |\n| Solana | NLx402 (PCEF nonprofit) | Zero |\n\n## Real-Time Streams\n\n```ts\nconst es = btcfi.stream({ channel: 'whales', min: 100 });\nes.onmessage = (e) => console.log(JSON.parse(e.data));\nes.onerror = () => es.close();\n```\n\n## Error Handling\n\n```ts\nimport { BTCFi, PaymentRequiredError } from '@aiindigo/btcfi';\n\ntry {\n  const fees = await btcfi.getFees();\n} catch (e) {\n  if (e instanceof PaymentRequiredError) {\n    console.log('Pay:', e.paymentRequirements);\n  }\n}\n```\n\n## License\n\nMIT — [AI Indigo](https://aiindigo.com)\n","readmeFilename":"README.md","_rev":"1-ea2f47343854dec9ba10f5c3ab548914"}