walletSendRequestFaultFromApiError function
Map a parsePaymentUri bridge failure to the seam's typed fault. Reads the
typed WalletApiError.kind ONLY (never a payload โ ยง5.4); a cross-network
URI is WalletSendRequestFault.wrongNetwork (distinct, renderable), and
anything else โ malformed, oversized, a bad leg โ collapses to
WalletSendRequestFault.malformed. Pure + total.
Implementation
WalletSendRequestException walletSendRequestFaultFromApiError(Object error) {
if (error is WalletApiError &&
error.kind is WalletErrorKind_NetworkMismatch) {
return const WalletSendRequestException(
WalletSendRequestFault.wrongNetwork,
);
}
return const WalletSendRequestException(WalletSendRequestFault.malformed);
}