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

support gate wallet #349

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

vdgwerdfgCell
Copy link

No description provided.

connectWallet = async (): Promise<this> => {
let result;
try {
result = await this.bitcoinNetwork.requestAccounts("SIGNET_TEST"); // Connect to Gate Wallet extension
Copy link
Collaborator

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?

Copy link
Author

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

Copy link
Author

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?

Copy link
Collaborator

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

Copy link
Author

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

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