Wallet Discovery
Create a UI of wallets for user to log in
To allow the user to choose a wallet from the supported wallets you've added during FCL initialization, FCL provides Discovery for developers to focus on building their dApps.
There are two ways an app can use Discovery:
Discovery UI: A wallet list applying Material Design
Config: A list of wallets for custom UI
Discovery UI
Discovery UI is the simplest way to integrate Wallet Discovery. By calling showConnectWalletDialog()
, FCL presents a list of wallet providers for a user to log in.
// MainActivity.kt
showConnectWalletDialog(this) {
// authentication on user click
}
Config
FCL allows the developer to control over the authentication UI. You can access the wallet providers directly from Fcl.config.supportedWallets
.
// Create your own UI by supplying wallet provider list as data to an adapter
val providerList = Fcl.config.supportedWallets
// Once you get the user's selected provider, you need to add it to config
Fcl.config.put(Config.Option.SelectedWalletProvider(provider))
Last updated
Was this helpful?