buildCheckoutConnectWalletSuccess function
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,
},
};
}