Skip to content

Commit

Permalink
add detecting bitget through window object (#1142)
Browse files Browse the repository at this point in the history
* add detecting bitget through window object

* changeset

---------

Co-authored-by: Marek Epicode <m.sadura@outlook.com>
  • Loading branch information
0xepicode and msadura authored Dec 27, 2024
1 parent 349a921 commit 0dc7610
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/unlucky-houses-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swapkit/helpers": patch
---

Detect bitget wallet
3 changes: 3 additions & 0 deletions packages/swapkit/helpers/src/helpers/web3wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare const window: {
trustwallet: EthereumWindowProvider;
coinbaseWalletExtension: EthereumWindowProvider;
braveSolana: any;
bitkeep?: { ethereum: EthereumWindowProvider };
} & Window;

type NetworkParams = {
Expand Down Expand Up @@ -157,6 +158,7 @@ export const listWeb3EVMWallets = () => {
(window?.ethereum?.overrideIsMetaMask &&
window?.ethereum?.selectedProvider?.isCoinbaseWallet) ||
window?.coinbaseWalletExtension;
const bitgetEnabled = window?.bitkeep?.ethereum;

const wallets = [];
if (metamaskEnabled) wallets.push(WalletOption.METAMASK);
Expand All @@ -165,6 +167,7 @@ export const listWeb3EVMWallets = () => {
if (trustEnabled) wallets.push(WalletOption.TRUSTWALLET_WEB);
if (coinbaseEnabled) wallets.push(WalletOption.COINBASE_WEB);
if (okxMobileEnabled()) wallets.push(WalletOption.OKX_MOBILE);
if (bitgetEnabled) wallets.push(WalletOption.BITGET);

return wallets;
};
Expand Down

0 comments on commit 0dc7610

Please sign in to comment.