changed color theme to be black and added the ability to enter the amount in the recipient’s currency

This commit is contained in:
Arseni
2026-03-02 17:41:41 +03:00
parent 17e08ff26f
commit 6bb3ab5063
41 changed files with 618 additions and 239 deletions

View File

@@ -22,6 +22,8 @@ import 'package:pshared/utils/currency.dart';
import 'package:pshared/utils/payment/fx_helpers.dart';
class QuotationIntentBuilder {
static const String _settlementCurrency = 'RUB';
PaymentIntent? build({
required PaymentAmountProvider payment,
required WalletsController wallets,
@@ -39,10 +41,12 @@ class QuotationIntentBuilder {
data: paymentData,
);
final sourceCurrency = currencyCodeToString(selectedWallet.currency);
final amountCurrency = payment.settlementMode == SettlementMode.fixReceived
? _settlementCurrency
: sourceCurrency;
final amount = Money(
amount: payment.amount.toString(),
// TODO: adapt to possible other sources
currency: sourceCurrency,
currency: amountCurrency,
);
final isCryptoToCrypto =
paymentData is CryptoAddressPaymentMethod &&
@@ -50,7 +54,7 @@ class QuotationIntentBuilder {
amount.currency;
final fxIntent = FxIntentHelper.buildSellBaseBuyQuote(
baseCurrency: sourceCurrency,
quoteCurrency: 'RUB', // TODO: exentd target currencies
quoteCurrency: _settlementCurrency, // TODO: exentd target currencies
enabled: !isCryptoToCrypto,
);
return PaymentIntent(
@@ -68,7 +72,7 @@ class QuotationIntentBuilder {
feeTreatment: payment.payerCoversFee
? FeeTreatment.addToSource
: FeeTreatment.deductFromDestination,
settlementMode: SettlementMode.fixSource,
settlementMode: payment.settlementMode,
customer: customer,
);
}