diff --git a/packages/espressocash_app/lib/data/db/db.dart b/packages/espressocash_app/lib/data/db/db.dart index b5427aaea1..b41ed7fe60 100644 --- a/packages/espressocash_app/lib/data/db/db.dart +++ b/packages/espressocash_app/lib/data/db/db.dart @@ -24,7 +24,7 @@ class OutgoingTransferRows extends Table { Set> get primaryKey => {id}; } -const int latestVersion = 59; +const int latestVersion = 60; const _tables = [ OutgoingTransferRows, @@ -168,6 +168,9 @@ class MyDatabase extends _$MyDatabase { await m.addColumn(offRampOrderRows, offRampOrderRows.priorityFee); await m.addColumn(offRampOrderRows, offRampOrderRows.gasFee); } + if (from >= 39 && from < 60) { + await m.addColumn(iLPRows, iLPRows.receiveAmount); + } }, ); } diff --git a/packages/espressocash_app/lib/features/analytics/analytics_manager.dart b/packages/espressocash_app/lib/features/analytics/analytics_manager.dart index 446970d2f0..e8f3b62a9d 100644 --- a/packages/espressocash_app/lib/features/analytics/analytics_manager.dart +++ b/packages/espressocash_app/lib/features/analytics/analytics_manager.dart @@ -65,7 +65,13 @@ class AnalyticsManager { properties: {'amount': amount.toDouble()}, ); - void singleLinkReceived() => _analytics.track('singleLinkReceived'); + void singleLinkReceived({ + required Decimal? amount, + }) => + _analytics.track( + 'singleLinkReceived', + properties: amount != null ? {'amount': amount.toDouble()} : {}, + ); void directPaymentSent({ required Decimal amount, diff --git a/packages/espressocash_app/lib/features/incoming_link_payments/data/ilp_repository.dart b/packages/espressocash_app/lib/features/incoming_link_payments/data/ilp_repository.dart index 9dbdb3b114..7c16a0a625 100644 --- a/packages/espressocash_app/lib/features/incoming_link_payments/data/ilp_repository.dart +++ b/packages/espressocash_app/lib/features/incoming_link_payments/data/ilp_repository.dart @@ -70,6 +70,7 @@ class ILPRows extends Table with EntityMixin, TxStatusMixin { IntColumn get status => intEnum()(); IntColumn get feeAmount => integer().nullable()(); + IntColumn get receiveAmount => integer().nullable()(); } enum ILPStatusDto { @@ -105,12 +106,19 @@ extension on ILPStatusDto { ); case ILPStatusDto.success: final feeAmount = row.feeAmount; + final receiveAmount = row.receiveAmount; return ILPStatus.success( tx: tx ?? StubSignedTx(txId!), fee: feeAmount != null ? CryptoAmount(value: feeAmount, cryptoCurrency: Currency.usdc) : null, + receiveAmount: receiveAmount != null + ? CryptoAmount( + value: receiveAmount, + cryptoCurrency: Currency.usdc, + ) + : null, ); case ILPStatusDto.txFailure: return ILPStatus.txFailure( @@ -133,6 +141,10 @@ extension on IncomingLinkPayment { ILPStatusSuccess(:final fee) => fee?.value, _ => null, }, + receiveAmount: switch (status) { + ILPStatusSuccess(:final receiveAmount) => receiveAmount?.value, + _ => null, + }, ); } diff --git a/packages/espressocash_app/lib/features/incoming_link_payments/models/incoming_link_payment.dart b/packages/espressocash_app/lib/features/incoming_link_payments/models/incoming_link_payment.dart index 05925a10eb..99bcc4cba0 100644 --- a/packages/espressocash_app/lib/features/incoming_link_payments/models/incoming_link_payment.dart +++ b/packages/espressocash_app/lib/features/incoming_link_payments/models/incoming_link_payment.dart @@ -32,6 +32,7 @@ sealed class ILPStatus with _$ILPStatus { const factory ILPStatus.success({ required SignedTx tx, required CryptoAmount? fee, + required CryptoAmount? receiveAmount, }) = ILPStatusSuccess; /// Failed to create the tx, a new tx should be created. diff --git a/packages/espressocash_app/lib/features/incoming_link_payments/screens/incoming_link_payment_screen.dart b/packages/espressocash_app/lib/features/incoming_link_payments/screens/incoming_link_payment_screen.dart index 4c01235237..7fbc4a8807 100644 --- a/packages/espressocash_app/lib/features/incoming_link_payments/screens/incoming_link_payment_screen.dart +++ b/packages/espressocash_app/lib/features/incoming_link_payments/screens/incoming_link_payment_screen.dart @@ -57,12 +57,20 @@ class _IncomingLinkPaymentScreenState extends State { onBack: () => Navigator.pop(context), ) : payment.status.maybeMap( - success: (e) => TransferSuccess( - onBack: () => Navigator.pop(context), - onOkPressed: () => Navigator.pop(context), - content: e.fee?.let(_FeeNotice.new), - statusContent: context.l10n.moneyReceived, - ), + success: (e) { + final receiveAmount = e.receiveAmount?.let( + (e) => e.format(context.locale, maxDecimals: 2), + ); + + return TransferSuccess( + onBack: () => Navigator.pop(context), + onOkPressed: () => Navigator.pop(context), + content: e.fee?.let(_FeeNotice.new), + statusContent: receiveAmount != null + ? context.l10n.moneyReceivedAmount(receiveAmount) + : context.l10n.moneyReceived, + ); + }, txFailure: (it) => it.reason == TxFailureReason.escrowFailure ? const InvalidEscrowErrorWidget() : TransferError( diff --git a/packages/espressocash_app/lib/features/incoming_link_payments/services/ilp_service.dart b/packages/espressocash_app/lib/features/incoming_link_payments/services/ilp_service.dart index 8ce87c66f0..0675283781 100644 --- a/packages/espressocash_app/lib/features/incoming_link_payments/services/ilp_service.dart +++ b/packages/espressocash_app/lib/features/incoming_link_payments/services/ilp_service.dart @@ -5,18 +5,21 @@ import 'package:espressocash_api/espressocash_api.dart'; import 'package:get_it/get_it.dart'; import 'package:injectable/injectable.dart'; import 'package:rxdart/rxdart.dart'; +import 'package:solana/dto.dart'; import 'package:solana/encoder.dart'; import 'package:solana/solana.dart'; import 'package:uuid/uuid.dart'; import '../../accounts/auth_scope.dart'; import '../../accounts/models/ec_wallet.dart'; +import '../../analytics/analytics_manager.dart'; import '../../balances/services/refresh_balance.dart'; import '../../currency/models/amount.dart'; import '../../currency/models/currency.dart'; import '../../escrow/models/escrow_private_key.dart'; import '../../escrow_payments/create_incoming_escrow.dart'; import '../../escrow_payments/escrow_exception.dart'; +import '../../tokens/token.dart'; import '../../transactions/models/tx_results.dart'; import '../../transactions/services/resign_tx.dart'; import '../../transactions/services/tx_confirm.dart'; @@ -31,6 +34,9 @@ class ILPService implements Disposable { this._ecClient, this._refreshBalance, this._txConfirm, + this._solanaClient, + this._wallet, + this._analytics, ); final ILPRepository _repository; @@ -38,6 +44,9 @@ class ILPService implements Disposable { final EspressoCashClient _ecClient; final RefreshBalance _refreshBalance; final TxConfirm _txConfirm; + final SolanaClient _solanaClient; + final ECWallet _wallet; + final AnalyticsManager _analytics; final Map> _subscriptions = {}; @@ -147,6 +156,8 @@ class ILPService implements Disposable { await _txConfirm(txId: status.signature); + final receiveAmount = await _getUsdcAmount(status.signature); + int? fee; try { fee = status.tx.containsAta @@ -158,9 +169,12 @@ class ILPService implements Disposable { _refreshBalance(); + _analytics.singleLinkReceived(amount: receiveAmount?.decimal); + return payment.copyWith( status: ILPStatus.success( tx: status.tx, + receiveAmount: receiveAmount, fee: fee?.let( (fee) => CryptoAmount(value: fee, cryptoCurrency: Currency.usdc), ), @@ -168,6 +182,55 @@ class ILPService implements Disposable { ); } + Future _getUsdcAmount(String signature) async { + try { + final details = await _solanaClient.rpcClient.getTransaction( + signature, + encoding: Encoding.base64, + commitment: Commitment.confirmed, + ); + + if (details == null) return null; + + final usdcTokenAddress = await findAssociatedTokenAddress( + owner: _wallet.publicKey, + mint: Ed25519HDPublicKey.fromBase58(Token.usdc.address), + ); + + final rawTx = details.transaction as RawTransaction; + final tx = SignedTx.fromBytes(rawTx.data); + + final accountIndex = tx.compiledMessage.accountKeys + .indexWhere((e) => e == usdcTokenAddress); + + final postTokenBalance = details.meta?.postTokenBalances + .where((e) => e.mint == Token.usdc.address) + .where((e) => e.accountIndex == accountIndex) + .firstOrNull; + + if (postTokenBalance == null) return null; + + final preTokenBalance = details.meta?.preTokenBalances + .where((e) => e.mint == Token.usdc.address) + .where((e) => e.accountIndex == accountIndex) + .firstOrNull; + + final preAmount = preTokenBalance?.uiTokenAmount.amount ?? '0'; + final postAmount = postTokenBalance.uiTokenAmount.amount; + + final rawAmount = int.parse(postAmount) - int.parse(preAmount); + + if (rawAmount <= 0) return null; + + return CryptoAmount( + value: rawAmount, + cryptoCurrency: Currency.usdc, + ); + } on Exception { + return null; + } + } + @override Future onDispose() async { await Future.wait(_subscriptions.values.map((it) => it.cancel())); diff --git a/packages/espressocash_app/lib/features/incoming_link_payments/widgets/pending_ilp_listener.dart b/packages/espressocash_app/lib/features/incoming_link_payments/widgets/pending_ilp_listener.dart index d55b0da4f8..44892d5150 100644 --- a/packages/espressocash_app/lib/features/incoming_link_payments/widgets/pending_ilp_listener.dart +++ b/packages/espressocash_app/lib/features/incoming_link_payments/widgets/pending_ilp_listener.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; -import '../../../di.dart'; import '../../accounts/models/wallet.dart'; -import '../../analytics/analytics_manager.dart'; import '../../dynamic_links/widgets/dynamic_link_handler.dart'; import '../../link_payments/models/link_payment.dart'; import '../screens/incoming_link_payment_screen.dart'; @@ -36,7 +34,6 @@ class _PendingILPListenerState extends State final payment = LinkPayment.tryParse(uri); if (payment != null) { - sl().singleLinkReceived(); _processLink(payment); return true; diff --git a/packages/espressocash_app/lib/l10n/intl_en.arb b/packages/espressocash_app/lib/l10n/intl_en.arb index b3272b97aa..1d674bf024 100644 --- a/packages/espressocash_app/lib/l10n/intl_en.arb +++ b/packages/espressocash_app/lib/l10n/intl_en.arb @@ -199,6 +199,14 @@ "@mobileWalletTitle": {}, "moneyReceived": "Money has been received", "@moneyReceived": {}, + "moneyReceivedAmount": "{amount} Transaction successful received", + "@moneyReceivedAmount": { + "placeholders": { + "amount": { + "type": "String" + } + } + }, "moreDetails": "View more details", "@moreDetails": {}, "next": "Next", diff --git a/packages/espressocash_app/moor_schemas/moor_schema_v60.json b/packages/espressocash_app/moor_schemas/moor_schema_v60.json new file mode 100644 index 0000000000..9a32aadcef --- /dev/null +++ b/packages/espressocash_app/moor_schemas/moor_schema_v60.json @@ -0,0 +1 @@ +{"_meta":{"description":"This file contains a serialized version of schema entities for drift.","version":"1.1.0"},"options":{"store_date_time_values_as_text":false},"entities":[{"id":0,"references":[],"type":"table","data":{"name":"outgoing_transfer_rows","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"data","getter_name":"data","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":1,"references":[],"type":"table","data":{"name":"payment_request_rows","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"dynamic_link","getter_name":"dynamicLink","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"short_link","getter_name":"shortLink","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"state","getter_name":"state","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(PaymentRequestStateDto.values)","dart_type_name":"PaymentRequestStateDto"}},{"name":"transaction_id","getter_name":"transactionId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"resolved_at","getter_name":"resolvedAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"recipient","getter_name":"recipient","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"amount","getter_name":"amount","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"splt_token","getter_name":"spltToken","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"message","getter_name":"message","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"memo","getter_name":"memo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":2,"references":[],"type":"table","data":{"name":"o_d_p_rows","was_declared_in_moor":false,"columns":[{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"receiver","getter_name":"receiver","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference","getter_name":"reference","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(ODPStatusDto.values)","dart_type_name":"ODPStatusDto"}},{"name":"tx","getter_name":"tx","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_id","getter_name":"txId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_failure_reason","getter_name":"txFailureReason","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(TxFailureReason.values)","dart_type_name":"TxFailureReason"}},{"name":"slot","getter_name":"slot","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":3,"references":[],"type":"table","data":{"name":"transaction_rows","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"encoded_tx","getter_name":"encodedTx","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(TxCommonStatus.values)","dart_type_name":"TxCommonStatus"}},{"name":"amount","getter_name":"amount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":4,"references":[],"type":"table","data":{"name":"o_l_p_rows","was_declared_in_moor":false,"columns":[{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(OLPStatusDto.values)","dart_type_name":"OLPStatusDto"}},{"name":"tx","getter_name":"tx","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_id","getter_name":"txId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"withdraw_tx_id","getter_name":"withdrawTxId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"private_key","getter_name":"privateKey","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"link","getter_name":"link","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_failure_reason","getter_name":"txFailureReason","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(TxFailureReason.values)","dart_type_name":"TxFailureReason"}},{"name":"cancel_tx","getter_name":"cancelTx","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"cancel_tx_id","getter_name":"cancelTxId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"generated_links_at","getter_name":"generatedLinksAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"resolved_at","getter_name":"resolvedAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"slot","getter_name":"slot","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":5,"references":[],"type":"table","data":{"name":"i_l_p_rows","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx","getter_name":"tx","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_id","getter_name":"txId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_failure_reason","getter_name":"txFailureReason","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(TxFailureReason.values)","dart_type_name":"TxFailureReason"}},{"name":"slot","getter_name":"slot","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"private_key","getter_name":"privateKey","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(ILPStatusDto.values)","dart_type_name":"ILPStatusDto"}},{"name":"fee_amount","getter_name":"feeAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"receive_amount","getter_name":"receiveAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":6,"references":[],"type":"table","data":{"name":"on_ramp_order_rows","was_declared_in_moor":false,"columns":[{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_completed","getter_name":"isCompleted","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_completed\" IN (0, 1))","default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"human_status","getter_name":"humanStatus","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"machine_status","getter_name":"machineStatus","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"partner_order_id","getter_name":"partnerOrderId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"receive_amount","getter_name":"receiveAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_hash","getter_name":"txHash","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"partner","getter_name":"partner","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant('kado')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RampPartner.values)","dart_type_name":"RampPartner"}},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(OnRampOrderStatus.values)","dart_type_name":"OnRampOrderStatus"}},{"name":"bank_name","getter_name":"bankName","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bank_account","getter_name":"bankAccount","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bank_transfer_expiry","getter_name":"bankTransferExpiry","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bank_transfer_amount","getter_name":"bankTransferAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"fiat_symbol","getter_name":"fiatSymbol","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"auth_token","getter_name":"authToken","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"more_info_url","getter_name":"moreInfoUrl","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"stellar_tx_hash","getter_name":"stellarTxHash","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"fee_amount","getter_name":"feeAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference_number","getter_name":"referenceNumber","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bridge_amount","getter_name":"bridgeAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":7,"references":[],"type":"table","data":{"name":"off_ramp_order_rows","was_declared_in_moor":false,"columns":[{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(OffRampOrderStatus.values)","dart_type_name":"OffRampOrderStatus"}},{"name":"human_status","getter_name":"humanStatus","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"machine_status","getter_name":"machineStatus","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"partner_order_id","getter_name":"partnerOrderId","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"transaction","getter_name":"transaction","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"deposit_address","getter_name":"depositAddress","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"slot","getter_name":"slot","moor_type":"bigInt","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"resolved_at","getter_name":"resolvedAt","moor_type":"dateTime","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"receive_amount","getter_name":"receiveAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"fiat_symbol","getter_name":"fiatSymbol","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"partner","getter_name":"partner","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":"const Constant('kado')","default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(RampPartner.values)","dart_type_name":"RampPartner"}},{"name":"fee_amount","getter_name":"feeAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"fee_token","getter_name":"feeToken","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"auth_token","getter_name":"authToken","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"withdraw_anchor_account","getter_name":"withdrawAnchorAccount","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"withdraw_memo","getter_name":"withdrawMemo","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"withdraw_url","getter_name":"withdrawUrl","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"more_info_url","getter_name":"moreInfoUrl","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"solana_bridge_tx","getter_name":"solanaBridgeTx","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"stellar_tx_hash","getter_name":"stellarTxHash","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"bridge_amount","getter_name":"bridgeAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"reference_number","getter_name":"referenceNumber","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"refund_amount","getter_name":"refundAmount","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"priority_fee","getter_name":"priorityFee","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"gas_fee","getter_name":"gasFee","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":8,"references":[],"type":"table","data":{"name":"outgoing_dln_payment_rows","was_declared_in_moor":false,"columns":[{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx","getter_name":"tx","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_id","getter_name":"txId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"tx_failure_reason","getter_name":"txFailureReason","moor_type":"int","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(TxFailureReason.values)","dart_type_name":"TxFailureReason"}},{"name":"slot","getter_name":"slot","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"receiver_blockchain","getter_name":"receiverBlockchain","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(BlockchainDto.values)","dart_type_name":"BlockchainDto"}},{"name":"receiver_address","getter_name":"receiverAddress","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumIndexConverter(ODLNPaymentStatusDto.values)","dart_type_name":"ODLNPaymentStatusDto"}},{"name":"order_id","getter_name":"orderId","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":9,"references":[],"type":"table","data":{"name":"transaction_request_rows","was_declared_in_moor":false,"columns":[{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"id","getter_name":"id","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"created","getter_name":"created","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"label","getter_name":"label","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"transaction","getter_name":"transaction","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"slot","getter_name":"slot","moor_type":"bigInt","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"status","getter_name":"status","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[],"type_converter":{"dart_expr":"const EnumNameConverter(TRStatusDto.values)","dart_type_name":"TRStatusDto"}}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["id"]}},{"id":10,"references":[],"type":"table","data":{"name":"token_balance_rows","was_declared_in_moor":false,"columns":[{"name":"amount","getter_name":"amount","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["token"]}},{"id":11,"references":[],"type":"table","data":{"name":"conversion_rates_rows","was_declared_in_moor":false,"columns":[{"name":"token","getter_name":"token","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"fiat_currency","getter_name":"fiatCurrency","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"rate","getter_name":"rate","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"updated_at","getter_name":"updatedAt","moor_type":"dateTime","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["token","fiat_currency"]}},{"id":12,"references":[],"type":"table","data":{"name":"token_rows","was_declared_in_moor":false,"columns":[{"name":"chain_id","getter_name":"chainId","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"address","getter_name":"address","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"symbol","getter_name":"symbol","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"name","getter_name":"name","moor_type":"string","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"decimals","getter_name":"decimals","moor_type":"int","nullable":false,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"logo_u_r_i","getter_name":"logoURI","moor_type":"string","nullable":true,"customConstraints":null,"default_dart":null,"default_client_dart":null,"dsl_features":[]},{"name":"is_stablecoin","getter_name":"isStablecoin","moor_type":"bool","nullable":false,"customConstraints":null,"defaultConstraints":"CHECK (\"is_stablecoin\" IN (0, 1))","default_dart":null,"default_client_dart":null,"dsl_features":[]}],"is_virtual":false,"without_rowid":false,"constraints":[],"explicit_pk":["chain_id","address"]}}]} \ No newline at end of file diff --git a/packages/espressocash_app/test/stub_analytics_manager.dart b/packages/espressocash_app/test/stub_analytics_manager.dart index 4ff8e4ff0b..ae2e609588 100644 --- a/packages/espressocash_app/test/stub_analytics_manager.dart +++ b/packages/espressocash_app/test/stub_analytics_manager.dart @@ -24,7 +24,7 @@ class StubAnalyticsManager implements AnalyticsManager { void singleLinkCreated({required Decimal amount}) {} @override - void singleLinkReceived() {} + void singleLinkReceived({required Decimal? amount}) {} @override void swapTransactionCreated({