refactor: port the CLI off NDK and drop @nostr-dev-kit/ndk entirely #47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/drop-ndk-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The final NDK removal, following #45 (which made the daemon NDK-free). The standalone CLI (
src/client.ts) was the last user of@nostr-dev-kit/ndk— a NIP-46 client (NDKNip46Signer). Porting it lets the dependency leave the repo completely.What
src/nip46-client.ts(new) — a minimal NIP-46 client over theRelayPool, the inverse of the daemon'sNip46Transport: send requests to a remote signer, match responses by id, surfaceauth_urlprompts; nip44 envelope. Methods:connect/signEvent/createAccount.src/client.ts— rebuilt on it. npub / nip05 / bare-domain resolution via nostr-toolsnip05.queryProfile+nip19; local client key stored as hex; events published through the pool. Dropped the now-unusedwebsocket-polyfillimport.package.json+pnpm-lock.yaml—@nostr-dev-kit/ndkremoved, along with its now-orphaned transitive deps (446 lockfile deletions, reconciled viapnpm install --lockfile-only— no lockfile-format change).Verification
grep -r @nostr-dev-kit/ndk src→ empty.index,daemon,client) build with 0 NDK references.lifecycle 7 / relay 2 / nip46 1 / admin 2green;tscat the pre-existing baseline (3 unrelatedauthorize.ts/web/authorize.tserrors).Note
The CLI is a debug/test tool and isn't covered by unit tests; the port mirrors the prior NIP-46 client behavior (connect → sign / create_account, with
auth_urlhandling). The NIP-46 client logic is small and shares the sameRelayPool+ crypto as the daemon. Worth a quick smoke against a live bunker before relying on it, but it's not on any production path (lnbits is the real client).With this merged, nsecbunkerd carries no NDK at all — the transport, daemon, and CLI are 100% nostr-tools.
Refs: #44, #45, #43, #42, #41
🤖 Generated with Claude Code