launchBlockExplorer method

  1. @override
void launchBlockExplorer()
override

Launch blockchain explorer for the current chain in external browser

Implementation

@override
void launchBlockExplorer() async {
  if ((selectedChain?.explorerUrl ?? '').isNotEmpty) {
    final blockExplorer = selectedChain!.explorerUrl;
    final namespace = ReownAppKitModalNetworks.getNamespaceForChainId(
      selectedChain!.chainId,
    );
    final address = _currentSession?.getAddress(namespace) ?? '';
    final explorerUrl = '$blockExplorer/address/$address';
    await ReownCoreUtils.openURL(explorerUrl);
  }
}