Skip to content

feat(wallet-extensions): Noir Wallet connector for Zcash (registry-based) - #144

Open
towanTG wants to merge 9 commits into
developfrom
feat/noir-wallet
Open

feat(wallet-extensions): Noir Wallet connector for Zcash (registry-based)#144
towanTG wants to merge 9 commits into
developfrom
feat/noir-wallet

Conversation

@towanTG

@towanTG towanTG commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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:

  • Adopt the 2026-08-25 @swapkit release train (helpers 5.1.0, core 5.0.3, toolboxes 5.1.2, plugins 5.0.3, server 5.1.1, wallet-core 5.0.3, wallet-keystore 5.0.3). Published sdk packages pin helpers exactly, so partial bumps fork the lockfile into dual helpers copies — which would silently break the new registries. Lockfile regenerated with the CI-pinned bun 1.3.13 from a clean install; single helpers@5.1.0 resolution verified.
  • Register NOIR_WALLET through the helpers 5.1.0 extensible registries (swapkit/sdk#346): noir-wallet/register.ts declares the WalletOptionRegistry/SwapKitErrorRegistry augmentations and registers the wallet option plus wallet_noir_wallet_* error codes 80101-80103 in the reserved extension range. The register module is side-effect-imported in loadWallet before the match reads it.
  • Original PR could not compile against published helpers (WalletOption.NOIR_WALLET and 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

  • Deposit-address swap routes (NEAR Intents) work — verified by the contributor with a live mainnet swap.
  • OP_RETURN memo routes (THORChain/Maya) throw wallet_noir_wallet_memo_not_supported explicitly.
  • Balance reads the extension's shielded-pool spendable balance by design.

Verification

  • bun run build:ci green (bun 1.3.13)
  • type-check clean on wallet-extensions and wallets (original PR failed this)
  • Tests: wallet-extensions 27/27 (incl. new registry-registration test), wallets 62/62
  • Runtime smoke: importing utils.ts registers the option; loadWallet("NOIR_WALLET") resolves connectNoirWallet

🤖 Generated with Claude Code

Also included

  • TON_CONNECT shim unwind: with the registry released, the tonconnect outside-the-enum literal shim is replaced by the same register.ts pattern — WalletOption.TON_CONNECT everywhere, no casts, runtime value unchanged.

harry1115 and others added 9 commits August 25, 2026 16:29
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants