options method
Builds picker options for WalletConnect sign_v2 and installed mechanismKeys. Sorts by registry priority, then name. Usable directly by a provider without a client.
Implementation
List<ExternalWalletOption> options(List<String> mechanismKeys) {
final grouped = (this.wallets ?? const {}).entries.map((entry) { final walletKey = entry.key; final wallet = entry.value; return (wallet.isOffered(walletKey, mechanismKeys) ? WalletBookGroupedEntry(key: walletKey, wallet: wallet, group: this.groups?[(wallet.group ?? "")]) : null); }).where((v) => v != null).map((v) => v!).toList();
final options = grouped.map((grouped) => ExternalWalletOption(key: grouped.key, name: (grouped.group?.name ?? grouped.wallet.name ?? grouped.key), chain: grouped.wallet.chainCode(), iconUrl: dynPrefixed("https://iconic.dynamic-static-assets.com/icons/sprite.svg#", (grouped.group?.brand?.spriteId ?? grouped.wallet.brand?.spriteId)), primaryColor: (grouped.group?.brand?.primaryColor ?? grouped.wallet.brand?.primaryColor), nativeLink: (grouped.wallet.mobile?.native != null ? grouped.wallet.mobile?.native : ((switch (grouped.key) { "xverse" => "xverse://wc", _ => "" }) != "" ? (switch (grouped.key) { "xverse" => "xverse://wc", _ => "" }) : null)), universalLink: grouped.wallet.mobile?.universal, androidStoreUrl: dynPrefixed("https://play.google.com/store/apps/details?id=", grouped.wallet.mobile?.androidId), iosStoreUrl: dynPrefixed("https://apps.apple.com/app/", grouped.wallet.mobile?.iosId))).toList();
return dynSortedBy<ExternalWalletOption>(options, [(option) => dynRankIn((this.priority ?? const <String>[]), option.key), (option) => option.name, (option) => option.key], const [false, false, false]);
}