feat: add wallet connect notification #909
Open
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
This is about how we could use wallet connect notification service to push notification for users, especially for swap status.
Based on the R&D conducted, the following tasks should be carried out:
- use Reown Cloud
- use appkit API in your backend
AppKit Notifications supports EOA accounts on all eip155
(EVM)
chains, and smart accounts on all eip155 chains that our Blockchain API supports.Cloud reown
This panel is used to configure the project to receive notifications and to manage existing notifications.
To configure the project, first create the project, then navigate to the
settings
and select theNotify API
option. Here, you can add the project's domain, Dapp name, description, and logo. Additionally, you can create different types of notifications. After that, a JSON file is generated that we should download and include in project. Finally, we can set up a welcome notification for our subscribers.Implementation
For the implementation, we need to use the
@web3inbox/react
package.On the widget side, we need a section where users can subscribe to receive notifications. In this section, notifications should also be displayed, and users should have the option to unsubscribe.
According to the docs, we can receive different types of notifications and display them to the user, giving the user the option to enable or disable specific types.
Another point we need to consider for the implementation is that the initial data required should be retrieved from the config. Additionally, we need to add the
did file
to the project.