Options
final _w3mService = W3MService(
projectId: '{YOUR_PROJECT_ID}',
metadata: const PairingMetadata(
name: 'Web3Modal Flutter Example',
description: 'Web3Modal Flutter Example',
url: 'https://www.walletconnect.com/',
icons: ['https://walletconnect.com/walletconnect-logo.png'],
redirect: Redirect(
native: 'flutterdapp://',
universal: 'https://www.walletconnect.com',
),
),
// requiredNamespaces: {}, OPTIONAL
// optionalNamespaces: {}, OPTIONAL
// featuredWalletIds: {}, OPTIONAL
// includedWalletIds: {}, OPTIONAL
// excludedWalletIds: {}, OPTIONAL
);
requiredNamespaces and optionalNamespaces​
These values are optionals and, in most cases, not required since Web3Modal already defines every required and optional namespace internally. However, if you would want to override that definition with your own, these are the object yout should use.
These are the set of namespaces that will be requested from the wallet you are connecting to.
featuredWalletIds​
Allows to override default recommended wallets that are fetched from the API. You can define an array of wallet ids you'd like to prioritize (order is respected). You can get these ids from the WalletConnect Explorer by clicking on the copy icon of desired wallet card.
- Defaults to
null
, Wallets are ordered as they are got
final Set<String> featuredWalletIds = {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
}
includedWalletIds​
Similar to featuredWalletIds
this option allows you to determine exactly which wallets do you want to show. If includedWalletIds
is set then only the wallets listed in this object are going to be displayed in the modal.
- Defaults to
null
, every wallet in our explorer service is included
final Set<String> includedWalletIds = {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
}
excludedWalletIds​
Similar to includedWalletIds
this option allows you to exclude a list of wallets from the API response.
- Defaults to
null
, no wallet is excluded
final Set<String> excludedWalletIds = {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
}
Was this helpful?