Add browser notifications for wallet transactions#1095
Add browser notifications for wallet transactions#1095jinhojang6 wants to merge 29 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 7 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 3c0dac0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Jenkins BuildsClick to see older builds (18)
|
f3fddf0 to
f3d5b79
Compare
…or better error handling
f3d5b79 to
583fff4
Compare
…fy transaction notifications
JulesFiliot
left a comment
There was a problem hiding this comment.
I'm trying to trigger the notification but it is not working.
I followed the test guide and tried to send assets multiple times with my local anvil chain running but I can only see my balance getting depleted but no notification. In the history the tx is on pending forever but I guess that's expected. The only errors I get are [assets.all] Failed to fetch ERC20 token balances for ethereum: Error: Failed to fetch. and No price data for ETH: Error: Failed to fetch: 404 but I also guess that they are expected. I tried sending to addresses provided by Anvil as well as to my own wallet address.
Also note that I had to remove the network parameter from fetchNetworkNonce at the line bellow to get the wallet to build without errors:
I checked-out to the wallet-notifications branch, did a clean install, then cherry-picked the commit with the command you shared and did a clean install again.
I am using Brave.
|
For testing notifications: the current code queries anvil directly at |
31575b4 to
6a1b96e
Compare
|
I've added a toast to encourage users to enable notifications.
|
|
@jkbktl Great point! Updated it like this |
c4bc9df to
3c0dac0
Compare





Summary
/page.html#/settings, top-right corner gear icon) and toggle to enable or disable transaction notifications. Implemented this feature based on conventional assumption, but it is okay to remove it and enable the notifications always.In the same tab:

In a different tab:

Relevant issue
#930
Testing guide
Start a local chain:
anvil --host 0.0.0.0 --port 8545 --chain-id 31337 --block-time 1Fetch the testing commit and cherry-pick it for local chain testing:
git fetch origin wallet-notifications-anvil && git cherry-pick b11fe716be9dc053c70a2508af35e1cbded7659aRun the extension and import the default Anvil recovery phrase in the wallet:
test test test test test test test test test test test junkIf there is no ETH, click
Receiveand copy the current wallet address, and fund it on Anvil:cast rpc anvil_setBalance <YOUR_WALLET_ADDRESS> 0x8AC7230489E80000 --rpc-url http://127.0.0.1:8545Verify the funded balance:
cast balance <YOUR_WALLET_ADDRESS> --rpc-url http://127.0.0.1:8545Then send ETH in the wallet UI to another Anvil address like
0x70997970C51812dc3A010C7d01b50e0d17dc79C8Verify that a browser notification appears when the transaction is sent.
Keep the wallet unfocused or switch to another tab, and verify that a confirmation notification still appears after the transaction is mined.
Disable transaction notifications in settings, send another transaction, and verify that no browser notification is shown.