Skip to content

Commit

Permalink
fix: Fix binance web3 wallet successfully detected trustwallet on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Nov 27, 2024
1 parent 317add9 commit f06cd1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilled-pots-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@node-real/walletkit': patch
---

Fix binance web3 wallet successfully detected trustwallet on mobile
4 changes: 4 additions & 0 deletions packages/walletkit/src/evm/wallets/trustWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,9 @@ export function trustWallet(props: InjectedEvmWalletOptions = {}): EvmWallet {

function getProvider() {
if (typeof window === 'undefined') return;

// binance web3 wallet will inject a trustwallet object with no request on mobile
if (!window?.trustwallet?.request) return;

return window.trustwallet ?? window.trustWallet ?? getEvmInjectedProvider('isTrust');
}

0 comments on commit f06cd1f

Please sign in to comment.