Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
fix: Added tx spy to send crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed Sep 20, 2023
1 parent 2f2c8e3 commit cb74eec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ class SendCryptoPresenter extends CompletePresenter<SendCryptoState> {
amount: amount,
tokenAddress: token.address);

final tx = TransactionModel(
hash: res,
status: TransactionStatus.pending,
type: TransactionType.sent,
value: amount.getValueInUnit(EtherUnit.wei).toString(),
token: token,
timeStamp: DateTime.now());

_transactionHistoryUseCase.updateItemTx(tx, state.network!.chainId);

_transactionHistoryUseCase.spyOnTransaction(tx, state.network!.chainId);

return res;
} catch (e, s) {
addError(e, s);
Expand Down
2 changes: 2 additions & 0 deletions lib/features/wallet/presentation/wallet_page_presenter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class WalletPresenter extends CompletePresenter<WalletState> {
super.initState();

getMXCTweets();
_transactionHistoryUseCase.checkForPendingTransactions(
_chainConfigurationUseCase.getCurrentNetworkWithoutRefresh().chainId);

listen(_chainConfigurationUseCase.selectedNetwork, (value) {
if (value != null) {
Expand Down

0 comments on commit cb74eec

Please sign in to comment.