buildCheckoutConnectWalletSuccess function

Map<String, Object?> buildCheckoutConnectWalletSuccess({
  1. required String address,
  2. required String chain,
  3. String? walletProviderKey,
})

Builds the reply sent back when wallet connection succeeds. Pass the wallet address, the connected chain, and optionally the provider identifier (e.g. "metamask", "coinbase").

Implementation

Map<String, Object?> buildCheckoutConnectWalletSuccess({
  required String address,
  required String chain,
  String? walletProviderKey,
}) {
  return <String, Object?>{
    'event': 'crypto:connect-wallet.success',
    'data': <String, Object?>{
      'address': address,
      'chain': chain,
      if (walletProviderKey case final String key) 'walletProviderKey': key,
    },
  };
}