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:

@lgalabru lgalabru added this to DevTools Feb 3, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Feb 3, 2023
@janniks janniks moved this from 🆕 New to ❄️ Icebox in DevTools Feb 8, 2023
@smcclellan smcclellan moved this from ❄️ Icebox to 📋 Backlog in DevTools Jul 7, 2023
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