Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement on/off event methods in cip30.experimental #1500

Closed

Conversation

mirceahasegan
Copy link
Collaborator

@mirceahasegan mirceahasegan commented Oct 3, 2024

Context

Some DApps are using experimental CIP30 APIs that allow registering to networkChange/accountChange events.

 /**
 * Deregister the callback from the event.
 *
 * @param {EventName} eventName The event to deregister from. Accepted values are 'accountChange' | 'networkChange'
 * @param {AccountChangeCb | NetworkChangeCb} callback  Must be the same cb reference used on registration.
 */
off: (eventName: Cip30EventName, callback: AccountChangeCb | NetworkChangeCb) =>

/**
 * Register to events coming from the wallet. Registrations are stored by callback reference.
 *
 * @param {EventName} eventName The event to register to. Accepted values are 'accountChange' | 'networkChange'
 * @param {AccountChangeCb | NetworkChangeCb} callback The callback to be called when the event is triggered.
 */
on: (eventName: Cip30EventName, callback: AccountChangeCb | NetworkChangeCb)

Proposed Solution

Add support for these new methods.

Important Changes Introduced

@mirceahasegan mirceahasegan force-pushed the feat/lw-11630-dapp-experimental-on-off-methods branch from fe0925d to d41efc8 Compare October 3, 2024 15:22
@mirceahasegan mirceahasegan self-assigned this Oct 3, 2024
@mirceahasegan mirceahasegan marked this pull request as draft October 3, 2024 19:41
@mirceahasegan
Copy link
Collaborator Author

I found some issues with the implementation. I am working on it...

Base automatically changed from feat/lw-11630-dapp-custom-extensions-and-inject to master October 4, 2024 08:43
@mirceahasegan
Copy link
Collaborator Author

Closed due to missing support to push data from content script to injected script, and it makes this feature much more complicated.

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