Skip to content

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 fb95327 to fe0925d Compare October 3, 2024 13:36
@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.

2 participants