GemWallet / gemwallet-extension

GemWallet is a cutting-edge crypto wallet and Web3 layer for the XRP Ledger. Our browser extension enables you to interact with the XRP Ledger directly from your browser (Metamask for the XRPL). - https://gemwallet.app

Home Page:https://gemwallet.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feat] Events to notify web app about state changes

rikublock opened this issue · comments

commented

Add an event system that allows web apps to react to extension state changes. It's currently quite difficult to stay in sync with what is happening with the extension without constantly polling the state.
Possibly something based on Node.js EventEmitter.

Example:

  • networkChanged: switch from "devnet" to "testnet"
  • walletChanged / accountChanged: selected new active wallet
  • login, logout: extension locked or unlocked
  • etc.

Usage:

GemWalletApi.on('networkChanged', (network: string) => {
  console.log(`New network: ${network}`);
});

Hi @rikublock,
That's a really good feedback, let us working on it in our next releases.
Thank you so much for your feedbacks.

@all-contributors add @rikublock for bug and ideas

Hi @rikublock, just to let you know that the change got merged to master, thanks for the suggestion.
We will be planning a release pretty soon to make the changes live.

commented

Hi @rikublock, just to let you know that the change got merged to master, thanks for the suggestion. We will be planning a release pretty soon to make the changes live.

Cheers. Will give it a try once the docs are updated.

Hi @rikublock,
The doc has been updated.

commented

@FlorianBouron @ThibautBremand Got to say. You guys keep pushing these changes so quickly. I'm just amazed! Keep up the good work.

@rikublock Thank you! :)