Skip to content

feat(wallet-extensions): add Noir Wallet connector for Zcash#111

Open
harry1115 wants to merge 1 commit into
swapkit:developfrom
NoirWallet:feat/noir-wallet-zcash
Open

feat(wallet-extensions): add Noir Wallet connector for Zcash#111
harry1115 wants to merge 1 commit into
swapkit:developfrom
NoirWallet:feat/noir-wallet-zcash

Conversation

@harry1115

Copy link
Copy Markdown

Summary

  • Adds a NOIR_WALLET connector backed by the Noir Wallet browser
    extension (window.noirwallet), following the same injected-provider
    pattern as the Vultisig and Petra connectors.
  • Registers Chain.Zcash on the UTXO toolbox, overriding getBalance,
    transfer, and 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: the
    extension cannot attach OP_RETURN data to transparent recipients, so
    OP_RETURN-based routes (Maya) are rejected explicitly with a clear error
    instead of failing silently on-chain. Deposit-address routes (NEAR
    Intents) are fully supported and verified with a live mainnet swap.
  • No new dependency — the connector talks to window.noirwallet directly.
  • Registration follows the Petra precedent: wallet-extensions subpath +
    loadWallet/SKWallets/SKWalletsSupportedChains only.

Dependency note

This PR requires @swapkit/helpers with WalletOption.NOIR_WALLET and the
wallet_noir_wallet_* error codes (22201-22203) — companion change
submitted to the SwapKit monorepo. CI will stay red until that helpers
release is published; all checks pass locally against a patched helpers
build simulating the release.

Notes for reviewers

  • Noir Wallet reports the shielded-pool spendable balance via
    zcash_getBalance().available, not the transparent address' on-chain
    UTXO set, so the displayed balance intentionally won't match a block
    explorer lookup of the transparent address.
  • Bought ZEC arrives at the transparent address and requires a user-approved
    shield inside the wallet before it becomes spendable — by design for a
    shielded-first wallet.

Test plan

  • bun run build:ci — full build + .d.ts generation
  • Package type-checks and bun biome check — clean
  • bun test packages/wallet-extensions/src/noir-wallet/__tests__/noir-wallet.test.ts — 7/7 passing
  • Manual verification with a real Noir Wallet extension build, including a live mainnet swap via NEAR Intents
  • CI green once the @swapkit/helpers release containing WalletOption.NOIR_WALLET is published

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).
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.

1 participant