{"_id":"@baoku26/sbtc-sdk","name":"@baoku26/sbtc-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@baoku26/sbtc-sdk","version":"1.0.0","description":"Universal React SDK for sBTC and Stacks — works on React Native / Expo and React (web) from a single install.","license":"MIT","homepage":"https://github.com/Baoku26/stacks-SDK#readme","repository":{"type":"git","url":"git+https://github.com/Baoku26/stacks-SDK.git","directory":"packages/core"},"bugs":{"url":"https://github.com/Baoku26/stacks-SDK/issues"},"publishConfig":{"access":"public"},"keywords":["sbtc","stacks","bitcoin","react","react-native","expo","wallet"],"sideEffects":["./dist/polyfills.js","./dist/polyfills.mjs"],"main":"./dist/index.js","module":"./dist/index.mjs","react-native":"./dist/index.native.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","react-native":{"types":"./dist/index.native.d.ts","import":"./dist/index.native.mjs","require":"./dist/index.native.js"},"import":"./dist/index.mjs","require":"./dist/index.js"},"./polyfills":{"types":"./dist/polyfills.d.ts","import":"./dist/polyfills.mjs","require":"./dist/polyfills.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","lint":"eslint src","lint:fix":"eslint src --fix","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","size-check":"bundlesize"},"bundlesize":[{"path":"./dist/index.mjs","maxSize":"60 kB","compression":"gzip"},{"path":"./dist/polyfills.mjs","maxSize":"80 kB","compression":"gzip"}],"peerDependencies":{"@stacks/connect":">=7","expo-linking":">=6","expo-local-authentication":">=14","expo-secure-store":">=13","react":">=18","react-native":">=0.73","sbtc":">=0.3"},"peerDependenciesMeta":{"react-native":{"optional":true},"sbtc":{"optional":true},"expo-secure-store":{"optional":true},"expo-local-authentication":{"optional":true},"expo-linking":{"optional":true},"@stacks/connect":{"optional":true}},"devDependencies":{"@eslint/js":"^9.17.0","@stacks/connect":"^8.2.6","@types/react":"^18.3.12","@types/react-test-renderer":"^18.3.1","@vitest/coverage-v8":"^4.1.8","bundlesize2":"^0.0.35","eslint":"^9.17.0","expo-linking":"^56.0.14","expo-local-authentication":"^56.0.4","expo-secure-store":"^56.0.4","globals":"^15.14.0","react":"^18.3.1","react-test-renderer":"^18.3.1","sbtc":"^0.3.2","tsup":"^8.3.5","typescript":"^5.7.2","typescript-eslint":"^8.18.0","vitest":"^4.1.8"},"dependencies":{"@scure/base":"^2.2.0","@scure/bip32":"1.1.3","@scure/bip39":"1.1.0","@scure/btc-signer":"^2.2.0","@stacks/transactions":"^7.4.0","@stacks/wallet-sdk":"^7.4.0","buffer":"^6.0.3","react-native-get-random-values":"^2.0.0","readable-stream":"^4.7.0"},"gitHead":"055804b276412f786f87b0d529128ba19c666fc2","_id":"@baoku26/sbtc-sdk@1.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-19t+AuR/kXoOfgfOOSNWQi0gT0gebt30jJFzZVud8SuYM5h6K2Dk3EzfSB4sDrQPzo10QaIDiIUfuPq38QDLng==","shasum":"80f24b1e45129d026151ea9901bf6e2001fad37e","tarball":"https://registry.npmjs.org/@baoku26/sbtc-sdk/-/sbtc-sdk-1.0.0.tgz","fileCount":21,"unpackedSize":1034926,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCU9k8dPyJCiXalJT30jgYFzKtyh98EHhHH/MU2FBzC2QIhAPm4xmgK/B1377XDAfskHZnRAliALYMtlSA6S0lPrtaj"}]},"_npmUser":{"name":"baoku26","email":"damolaayesoro360@gmail.com"},"directories":{},"maintainers":[{"name":"baoku26","email":"damolaayesoro360@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sbtc-sdk_1.0.0_1781471641776_0.7175167238292945"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-14T21:14:01.603Z","1.0.0":"2026-06-14T21:14:01.958Z","modified":"2026-06-14T21:14:02.188Z"},"maintainers":[{"name":"baoku26","email":"damolaayesoro360@gmail.com"}],"description":"Universal React SDK for sBTC and Stacks — works on React Native / Expo and React (web) from a single install.","homepage":"https://github.com/Baoku26/stacks-SDK#readme","keywords":["sbtc","stacks","bitcoin","react","react-native","expo","wallet"],"repository":{"type":"git","url":"git+https://github.com/Baoku26/stacks-SDK.git","directory":"packages/core"},"bugs":{"url":"https://github.com/Baoku26/stacks-SDK/issues"},"license":"MIT","readme":"# @baoku26/sbtc-sdk\n\n**Universal React SDK for sBTC and Stacks.** One install, one API — works on **React Native / Expo** and **React (web)**. Platform differences (secure storage, biometric auth, wallet connection) are handled by a pluggable adapter system, so your hooks stay platform-agnostic.\n\n```bash\nnpm install @baoku26/sbtc-sdk\n```\n\n## Features\n\n- **One API, both platforms** — the same hooks run on native and web; the SDK auto-detects the platform and wires the right adapter.\n- **No web bundler config** — the web build contains no `expo-*` / `react-native` references, so there's nothing to alias.\n- **Native-ready** — ships polyfills and a Metro config for React Native (Hermes); keys live in the device secure enclave.\n- **Self-custodial wallet** — generate / restore / lock / export, biometric- or WebAuthn-gated.\n- **sBTC bridge** — deposit (BTC → sBTC) and withdraw (sBTC → BTC) with Emily status polling.\n- **Contracts & balances** — read-only calls, contract calls, sBTC / STX balances, nonce.\n- **Typed & tree-shakeable** — strict TypeScript, explicit hook return types, per-platform builds.\n\n## Quick start\n\n```tsx\nimport { SbtcProvider, useStacksWallet } from '@baoku26/sbtc-sdk';\n\nfunction App() {\n  return (\n    <SbtcProvider network=\"testnet\">\n      <Wallet />\n    </SbtcProvider>\n  );\n}\n\nfunction Wallet() {\n  const { address, btcAddress, generateWallet, error } = useStacksWallet();\n  if (address) return <p>{address} · {btcAddress}</p>;\n  return (\n    <>\n      <button onClick={generateWallet}>Generate wallet</button>\n      {error && <p>{error.code}: {error.message}</p>}\n    </>\n  );\n}\n```\n\n### React Native: two setup steps\n\n1. Import the polyfills as the **first line** of your entry file:\n   ```ts\n   import '@baoku26/sbtc-sdk/polyfills'; // before anything that touches Buffer / crypto\n   ```\n2. Alias Node's `stream` in `metro.config.js` (a ready-to-copy file ships at `@baoku26/sbtc-sdk/templates/metro.config.js`).\n\nOn **web** there's no extra setup.\n\n## Hooks\n\n| Hook | Purpose |\n| --- | --- |\n| `useStacksWallet` | Self-custodial HD wallet (generate / restore / lock / export / clear) |\n| `useSbtcDeposit` | BTC → sBTC |\n| `useSbtcWithdraw` | sBTC → BTC |\n| `useSbtcBalance` / `useStxBalance` | Live balances |\n| `useStacksContract` / `useNonce` | Read-only queries, contract calls, nonce |\n\n## Platforms\n\n| Platform | Storage | Auth | Wallet connect |\n| --- | --- | --- | --- |\n| React Native / Expo | `expo-secure-store` | `expo-local-authentication` | Leather / Xverse deep links |\n| React (web) | `localStorage` + AES-GCM | WebAuthn | `@stacks/connect` |\n| SSR | no-op | no-op | no-op |\n\n## Documentation\n\nFull guides and the complete hook reference are in [`/docs`](https://github.com/Baoku26/stacks-SDK/tree/main/docs) — Getting Started, Polyfills, Platform Adapters, Provider, Security, and per-hook pages.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-ed87072efa9872391c207b4fb8bd95bb"}