feat(wallets): add Noir Wallet connector for Zcash#1634
Open
harry1115 wants to merge 3 commits into
Open
Conversation
Adds a NOIR_WALLET wallet option 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.
The extension now supports memos for shielded recipients (zs/u1), so remove the blanket memo rejection from the connector and let the wallet decide validity. Memos to transparent addresses (t1/t3) are still rejected at the extension level.
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
NOIR_WALLETwallet option backed by the Noir Wallet browserextension (
window.noirwallet), following the same injected-providerpattern already used for Vultisig/CTRL and the MetaMask SDK connector.
Chain.Zcashon the UTXO toolbox, overridinggetBalance,transfer, andsignMessageto delegate to the extension, which spendsfrom the shielded pool and builds/signs transactions internally.
shielded recipients (zs/u1) and rejects them for transparent addresses
(t1/t3). This means deposit-address routes (NEAR Intents) and
shielded-memo transfers work, while OP_RETURN-based routes
(Maya/THORChain) fail at the wallet level with a clear error.
window.noirwalletdirectly,same approach as the Vultisig connector.
Notes for reviewers
zcash_getBalance().available, not the transparent address on-chainUTXO set, so the displayed balance intentionally will not match a block
explorer lookup of the transparent address.
wallet level (memo to transparent address is rejected by the extension).
A follow-up extension-side change (adding transparent-pool spends with
OP_RETURN support) could unlock the Maya route later; out of scope here.
Test plan
bun run build:ci— full monorepo build +.d.tsgenerationbun biome check— lint cleanbun test packages/wallet-extensions/src/noir-wallet/__tests__/noir-wallet.test.ts— 7/7 passingcreateSwapKit()->connectNoirWallet-> balance/transfer/signMessage against a mockedwindow.noirwallet