mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Phase 0+1 of docs/bitcoin-connect-plan.md (#61). Adds Alby's Bitcoin Connect as a one-tap NWC connect front-end that feeds bitvid's EXISTING wallet pipeline; manual URI entry stays as the backup. - Vendored: pinned @getalby/[email protected].3 bundled by scripts/build-bitcoin-connect.mjs → vendor/bitcoin-connect.bundle.min.js (esbuild, browser ESM). crypto-shim aliases the L402-only `import('crypto')` bitvid never calls. `npm run build:bitcoin-connect` rebuilds it. - Flag: FEATURE_BITCOIN_CONNECT wired like FEATURE_AUDIO_INGEST (instance-config → config → constants). - UI: a "Connect wallet" button in the Wallet Connect pane (hidden unless the flag is on); the manual URI field stays below as the backup. - Controller: ProfileWalletController.handleBitcoinConnect() lazy-imports the bundle (only on click — the ~700KB never touches the main bundle), inits NWC-only with least-privilege requestMethods and persistConnection:false, then on onConnected extracts provider.client.nostrWalletConnectUrl → the SAME validate→save path as the manual field → disconnect() so bitvid solely holds the spending secret. The URI is never logged. NOTE: config/instance-config.js FEATURE_BITCOIN_CONNECT is TRUE for local testing only. Reset to false (shipping default) before pushing/deploying. Local commit; not pushed, not deployed. Co-Authored-By: Claude Opus 4.8 <[email protected]>
18 lines
654 B
JavaScript
18 lines
654 B
JavaScript
// Vendor entry for Alby's Bitcoin Connect (getalby/bitcoin-connect), bundled by
|
|
// scripts/build-bitcoin-connect.mjs into vendor/bitcoin-connect.bundle.min.js so
|
|
// bitvid can lazy-import it behind FEATURE_BITCOIN_CONNECT without a runtime CDN.
|
|
//
|
|
// Importing the package self-registers its web components (bc-modal, etc.), so a
|
|
// single import both loads the API and boots the UI. We re-export only the small
|
|
// surface ProfileWalletController needs. See docs/bitcoin-connect-plan.md.
|
|
export {
|
|
init,
|
|
launchModal,
|
|
closeModal,
|
|
onConnected,
|
|
onDisconnected,
|
|
disconnect,
|
|
getConnectorConfig,
|
|
isConnected,
|
|
} from "@getalby/bitcoin-connect";
|