-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Haze <[email protected]> Co-authored-by: Sven <[email protected]>
- Loading branch information
1 parent
ee1da0a
commit 81edbe7
Showing
11 changed files
with
133 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { WcWallet } from '@web3modal/core' | ||
import { ConnectorController } from '@web3modal/core' | ||
|
||
export function markWalletsAsInstalled(wallets: WcWallet[]) { | ||
const { connectors } = ConnectorController.state | ||
const installedConnectors = connectors | ||
.filter(c => c.type === 'ANNOUNCED') | ||
.reduce<Record<string, boolean>>((acum, val) => { | ||
if (!val.info?.rdns) { | ||
return acum | ||
} | ||
acum[val.info.rdns] = true | ||
|
||
return acum | ||
}, {}) | ||
|
||
const walletsWithInstalled: (WcWallet & { installed: boolean })[] = wallets.map(wallet => ({ | ||
...wallet, | ||
installed: Boolean(wallet.rdns) && Boolean(installedConnectors[wallet.rdns ?? '']) | ||
})) | ||
|
||
const sortedWallets = walletsWithInstalled.sort( | ||
(a, b) => Number(b.installed) - Number(a.installed) | ||
) | ||
|
||
return sortedWallets | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81edbe7
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.
Successfully deployed to the following URLs:
web3modal-react-wagmi-ex – ./
web3modal-react-wagmi-ex-git-v3-walletconnect1.vercel.app
web3modal-react-wagmi-ex-walletconnect1.vercel.app
web3modal-react-wagmi-example.vercel.app
81edbe7
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.
Successfully deployed to the following URLs:
web3modal-laboratory – ./
web3modal-laboratory-walletconnect1.vercel.app
web3modal-laboratory-v3.vercel.app
web3modal-laboratory-git-v3-walletconnect1.vercel.app
lab.web3modal.com
81edbe7
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.
Successfully deployed to the following URLs:
web3modal-vue-wagmi-ex – ./
web3modal-vue-wagmi-ex-git-v3-walletconnect1.vercel.app
web3modal-vue-wagmi-ex-walletconnect1.vercel.app
web3modal-vue-wagmi-example.vercel.app