Skip to content

Commit

Permalink
fix: recovery amount (#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinenerio authored Nov 29, 2024
1 parent 479fad5 commit 2f693d3
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,19 @@ class StellarRecoveryService extends ValueNotifier<StellarRecoveryState> {

if (usdcBalance == null || usdcBalance.isEmpty) return;

final fee = await _ecClient.calculateMoneygramFee(
MoneygramFeeRequestDto(
type: RampTypeDto.onRamp,
amount: usdcBalance.toString(),
),
);
final fee = await _ecClient
.calculateMoneygramFee(
MoneygramFeeRequestDto(
type: RampTypeDto.onRamp,
amount: usdcBalance.toString(),
),
)
.then((e) => e.bridgeFee);

final total = Decimal.parse(usdcBalance.toString()) - Decimal.parse(fee);

final amount = Amount.fromDecimal(
value: Decimal.parse(fee.totalAmount),
value: total,
currency: Currency.usdc,
) as CryptoAmount;

Expand Down

0 comments on commit 2f693d3

Please sign in to comment.