fix: validate Nostr Wallet Connect URIs before saving wallet config#4153
fix: validate Nostr Wallet Connect URIs before saving wallet config#4153ajaysehwal wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces validation logic for Nostr Wallet Connect (NWC) URLs by adding "isValidNostrWalletConnectUrl" in "ValidationUtils" and integrating it into the "WalletConfiguration" view, along with comprehensive unit tests. The feedback suggests adding defensive checks to handle "null" or "undefined" URLs to prevent runtime crashes, simplifying the relay URL validation by removing redundant "decodeURIComponent" calls which could throw errors, and adding corresponding unit tests for non-string inputs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
510aa7c to
f6c3c67
Compare
Description
Please enter a description and screenshots, if appropriate, of the work covered in this PR
In this PR, We Prevent invalid Nostr Wallet Connect (NWC) wallet configurations from being saved by validating connection URIs against the NWC spec before saving.
Changes:
invalid schemes
Result
Users can no longer save invalid NWC connection URIs, helping prevent misconfigured wallets and ensuring better compliance with the NWC specification
This pull request is categorized as a:
Checklist
yarn run tscand made sure my code compiles correctlyyarn run lintand made sure my code didn’t contain any problematic patternsyarn run prettierand made sure my code is formatted correctlyyarn run testand made sure all of the tests passTesting
If you modified or added a utility file, did you add new unit tests?
I have tested this PR on the following platforms (please specify OS version and phone model/VM):
I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):
On-device
Remote
Locales
Third Party Dependencies and Packages
yarnafter this PR is merged inpackage.jsonandyarn.lockhave been properly updatedOther: