feat(wallet-extensions): Noir Wallet connector for Zcash (registry-based) - #144
Open
towanTG wants to merge 9 commits into
Open
feat(wallet-extensions): Noir Wallet connector for Zcash (registry-based)#144towanTG wants to merge 9 commits into
towanTG wants to merge 9 commits into
Conversation
Adds a NOIR_WALLET connector backed by the Noir Wallet browser extension (window.noirwallet). The connector registers Chain.Zcash with the UTXO toolbox, overriding getBalance/transfer/signMessage to delegate to the extension, which spends from the shielded pool and builds/signs transactions internally. Memo'd transfers throw wallet_noir_wallet_memo_not_supported since the extension cannot attach OP_RETURN data to transparent recipients, so OP_RETURN-based routes (Maya) are rejected explicitly while deposit-address routes (NEAR Intents) are fully supported. Requires @swapkit/helpers with WalletOption.NOIR_WALLET and the wallet_noir_wallet_* error codes (companion change in the SwapKit monorepo).
… option shim helpers 5.0.x shipped without the extensible WalletOption registry (swapkit/sdk#346 unmerged), so NOIR_WALLET moves outside the enum the same way TON_CONNECT does: a dedicated option.ts with the literal const + type, threaded through loadWallet's match union and SKWallets literal keys. Interim error keys until the registry ships the wallet_noir_wallet_* range (80101-80103): wallet_provider_not_found, core_wallet_connection_failed, wallet_walletconnect_method_not_supported — each with an info payload carrying the NOIR_WALLET wallet tag and reason. Unwind together with the tonconnect shim once sdk#346 is released. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bump @swapkit/* ranges to today's sdk release train so every package resolves the single helpers@5.1.0 copy carrying the extensible WalletOption/error registries (swapkit/sdk#346). Lockfile regenerated with the CI-pinned bun 1.3.13 from a clean node_modules. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the TON_CONNECT-style option shim with the real extensible registries from @swapkit/helpers 5.1.0 (swapkit/sdk#346): register.ts declares the WalletOptionRegistry/SwapKitErrorRegistry augmentations and registers NOIR_WALLET plus wallet_noir_wallet_* codes 80101-80103 in the reserved extension range. Connector, loadWallet, and SKWallets go back to WalletOption.NOIR_WALLET; semantic error keys are restored; the register module is side-effect-imported in utils.ts before the match reads it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Unwind the TON_CONNECT outside-the-enum literal shim now that the extensible WalletOption registry shipped (swapkit/sdk#346, helpers 5.1.0): tonconnect/register.ts declares the WalletOptionRegistry augmentation and registers the option; index/utils/types/tests go back to WalletOption.TON_CONNECT with no casts. Runtime value unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The lock carried develop's hoisted @near-js/crypto+transactions 2.5.0 entries alongside nested 2.5.1 pins; bun 1.3.13's frozen validation flags the stale split. Regenerated so both dedupe to 2.5.1 — bun install --frozen-lockfile now passes clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documents the connector + register.ts workflow against the @swapkit/helpers 5.1.0 extensible registries, the loadWallet/SKWallets wiring, and the gotchas that bit during the Noir Wallet review: type/runtime registration skew, sideEffects tree-shaking, dual-copy helpers lockfile forks, and the vacuous walletType test trap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Apps that reference registered wallet options at module scope (e.g. the SwapKit UI's static wallet dialog list) evaluate WalletOption.NOIR_WALLET before any connector or loadWallet module runs — without a register import the list silently contains undefined. Roll up the per-wallet register modules into src/register.ts, exported as @swapkit/wallets/register; loadWallet now imports the roll-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the Noir Wallet Zcash connector from #111 (squash-merged into this branch with contributor attribution) plus the follow-ups that make it releasable:
helpers@5.1.0resolution verified.NOIR_WALLETthrough the helpers 5.1.0 extensible registries (swapkit/sdk#346):noir-wallet/register.tsdeclares theWalletOptionRegistry/SwapKitErrorRegistryaugmentations and registers the wallet option pluswallet_noir_wallet_*error codes 80101-80103 in the reserved extension range. The register module is side-effect-imported inloadWalletbefore the match reads it.WalletOption.NOIR_WALLETand its error keys didn't exist at runtime); an interim TON_CONNECT-style shim commit documents the transition and is unwound by the registry commit.Behavior
wallet_noir_wallet_memo_not_supportedexplicitly.Verification
bun run build:cigreen (bun 1.3.13)type-checkclean on wallet-extensions and wallets (original PR failed this)utils.tsregisters the option;loadWallet("NOIR_WALLET")resolvesconnectNoirWallet🤖 Generated with Claude Code
Also included
register.tspattern —WalletOption.TON_CONNECTeverywhere, no casts, runtime value unchanged.