From 7b792aa0eb29375a5c1a9eebcce5789941d33055 Mon Sep 17 00:00:00 2001 From: Justin Enerio Date: Sun, 15 Dec 2024 23:11:36 +0800 Subject: [PATCH] fix: brij onramp input amount (#1647) --- .../ramp/services/on_ramp_order_service.dart | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/espressocash_app/lib/features/ramp/services/on_ramp_order_service.dart b/packages/espressocash_app/lib/features/ramp/services/on_ramp_order_service.dart index 8745676f9..f1e27cf03 100644 --- a/packages/espressocash_app/lib/features/ramp/services/on_ramp_order_service.dart +++ b/packages/espressocash_app/lib/features/ramp/services/on_ramp_order_service.dart @@ -21,7 +21,7 @@ import '../../tokens/token.dart'; typedef OnRampOrder = ({ String id, DateTime created, - CryptoAmount submittedAmount, + Amount submittedAmount, CryptoAmount? receiveAmount, RampPartner partner, OnRampOrderStatus status, @@ -222,15 +222,22 @@ class OnRampOrderService implements Disposable { ) as FiatAmount, ); + final submittedAmount = row.partner == RampPartner.brij + ? FiatAmount( + value: row.amount, + fiatCurrency: currencyFromString(row.fiatSymbol ?? 'USD'), + ) + : CryptoAmount( + value: row.amount, + cryptoCurrency: CryptoCurrency( + token: token ?? Token.unk, + ), + ); + return ( id: row.id, created: row.created, - submittedAmount: CryptoAmount( - value: row.amount, - cryptoCurrency: CryptoCurrency( - token: token ?? Token.unk, - ), - ), + submittedAmount: submittedAmount, receiveAmount: row.receiveAmount?.let( (amount) => CryptoAmount( value: amount,