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

Add ability for app to listen network changing and get network info #263

Open
bolasblack opened this issue Jul 31, 2022 · 0 comments
Open
Labels

Comments

@bolasblack
Copy link

We have our own testnet instance and we hope our app can alert users that they are using an unexpected network in their stacks wallet

So we hope @stacks/connect can provide some API to make the app able to know which network users are using, just like connect event and chainChanged event of MetaMask

Maybe we can do it like this:

interface NetworkInfo {
  networkAddress: string
}

interface UserSession {
  // other properties ...

  // return network info, or throw an error if users not signed in
  getNetworkInfo(): Promise<NetworkInfo>
}

interface AuthOptions {
  // other properties ...

  onNetworkChanged: () => void
}

Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants