-
Notifications
You must be signed in to change notification settings - Fork 13
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
support gate wallet #349
base: dev
Are you sure you want to change the base?
support gate wallet #349
Conversation
connectWallet = async (): Promise<this> => { | ||
let result; | ||
try { | ||
result = await this.bitcoinNetwork.requestAccounts("SIGNET_TEST"); // Connect to Gate Wallet extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a temporary solution? is there a way to determine the signet and mainnet env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a temporary solution. if there's no requestAccounts params, it will connect mainnet. It can be checked by gatewallet.bitcoin. _network.name, it will be 'livenet' if connected by mainnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a temporary solution, sir. Is there any situation both connect mainnet and signet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a utils method that we expose which you can use it to check whether we are on a btc mainnet. https://github.com/babylonchain/simple-staking/blob/dev/src/config/network.config.ts#L44
Based on the value, the wallet provider can request account for the corresponding btc network.
example https://github.com/babylonchain/simple-staking/blob/dev/src/utils/wallet/providers/okx_wallet.ts#L40-L54
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I push a new commit
No description provided.