Skip to content

feat: minotari wallet integration#3112

Open
shanimal08 wants to merge 36 commits intomainfrom
build-feat/wallet
Open

feat: minotari wallet integration#3112
shanimal08 wants to merge 36 commits intomainfrom
build-feat/wallet

Conversation

@shanimal08
Copy link
Collaborator

Description

Motivation and Context

How Has This Been Tested?

What process can a PR reviewer use to test or verify this change?

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

@gemini-code-assist
Copy link
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

martinserts and others added 4 commits January 26, 2026 12:22
Co-authored-by: Misieq01 <bartosz2000walczak@gmail.com>
## Description

`get_key_manager()` will ask for PIN and decrypt cipherseed, if it is
protected.
…3117)

## Description

Runs transaction unlocker in background.

Closes #3115

## Motivation and Context

We need to run transaction unlocker from the new wallet to revert
expired locks for transactions.

## How Has This Been Tested?

Started TU.

```
09:49:49 INFO  Starting Transaction Unlocker...   
```

Stopped TU

```
09:50:53 INFO  Shutdown signal received. Stopping Transaction Unlocker.      
```
## Description

- fixed seedless `handle_new_block_height` emit in the setup loop
- added back the scanning/syncing UI elements
- implemented list virutalization properly (list should have been the
direct child of the wrapper)
- fixed the seedless UI wallet visual bug (#3101)
- significant re-factoring of the Sidebar wallet components to resolve
the above, but also for code readability, and small styling fixes
- split sections from `SidebarWallet.tsx` out into their own components
(eg. wallet details, swap panel handler) all handled in the new
`wallet.tsx` file
  - thinned out and de-duped styling 



## Motivation and Context

- closes #3101 
- sync & scanning UI was removed accidentally in the initial integration
PR

## How Has This Been Tested?

- locally:


https://github.com/user-attachments/assets/bfe2ca7d-c2e8-492c-a750-dceb3f1aadce
shanimal08 and others added 16 commits January 28, 2026 13:17
## Description
- re-implement new block height events with changes
- remove coinbase tx checks from new block height event (was used on FE
for **solo-mining** block win animations which are at this point very
unlikely and no longer needed)
- removed `handle_new_block_height` which handled the different ways we
emmitted `EventsEmitter::emit_new_block_mined` and just emit directly
from the node updates
- ~~cleaned up the `useBlockTip` hook~~ moved `processNewBlock` to
`useFetchExplorerData` & cleaned up the checks for more accurate timing
between the explorer block change and when the node block comes in (only
relevant if mining & visual mode is on)
- removed dead code


## Motivation and Context
- the events were commented out in initial integration, likely because
`wallet_manager` changed so much and the previously used functions are
no longer available with the new wallet


## How Has This Been Tested?

- locally:

**explorer x animation timing synced even if node block change comes in
significantly earlier than explorer data:**


https://github.com/user-attachments/assets/80bb5650-a26a-4544-99e2-ec4464ef8554
## Description
- updated `minotari-cli` to
[`4d39146`](tari-project/minotari-cli@4d39146)
- adjusted `balance_tracker` items to suit
- updated `minotari_wallet/mod.rs` - types as well as using tx id for
pending txs
- updated FE structs to suit
## Description
- add minotari-cli wallet dir to `clean_data_folder`
- fix the tx timestamp
- only emit tx updates for confirmed transaction events
- clear pending txs on refresh too

## How Has This Been Tested?
- locally
## Description

- use account balance directly for `available` balance
- send the calculated balance to FE for the display value (was
previously sent off as the whole balance)
- adjusted logs so we'd actually see the minotari items in their own log
file
- added wallet store helpers based off #3118 for updating the tx list
items in the right place

## Motivation and Context

- available x pending balance wasn't implemented with new wallet 

## How Has This Been Tested?
- locally 


**immediate update on tx:**


https://github.com/user-attachments/assets/5efd3aa9-c58a-458a-9911-cf859fcfe4e6

**update after scan event:**



https://github.com/user-attachments/assets/d597eeab-5910-4b3d-9992-2fd9fcebc9de
Copy link
Collaborator

@brianp brianp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things I noticed while going through this.

brianp and others added 6 commits February 22, 2026 23:33
The merge brought in wait_for_initial_wallet_scan and
reset_initial_scan_completed calls on WalletManager, but this branch
replaced that flow with MinotariWalletManager's own scanning. Removed the
dead code and the setup_manager plumbing that passed wallet_manager into
the MCP server (already handled in a prior commit).

Amp-Thread-ID: https://ampcode.com/threads/T-019c7b90-2d92-74cd-a67b-097a301173cf
Co-authored-by: Amp <amp@ampcode.com>
…hashes

isTransactionMatch only checked matched inputs from txA against txB. If
txA had no matched inputs but txB did, they wouldn't match and you'd get
duplicates in the list. Now checks both directions and also compares
sent_output_hashes first since that's the most stable fingerprint for
linking pending to scanned transactions.

Amp-Thread-ID: https://ampcode.com/threads/T-019c7b90-2d92-74cd-a67b-097a301173cf
Co-authored-by: Amp <amp@ampcode.com>
dedup_by on a Vec only catches dupes sitting next to each other. If the
same tx id appears at non-adjacent positions (which is totally possible
from scan events), they'd slip through. Switched to HashSet + retain so
it actually works regardless of ordering.

Amp-Thread-ID: https://ampcode.com/threads/T-019c7b90-2d92-74cd-a67b-097a301173cf
Co-authored-by: Amp <amp@ampcode.com>
…ures

Added get_transaction_history on MinotariWalletManager so the MCP tools
can load tx history without going through the old WalletManager.

The transaction unlocker was silently returning Ok even if the task died
on spawn. Now it checks is_finished immediately after spawn to catch
instant failures and surfaces them properly. Also improved shutdown
logging to distinguish clean stop vs error vs panic.

Amp-Thread-ID: https://ampcode.com/threads/T-019c7b90-2d92-74cd-a67b-097a301173cf
Co-authored-by: Amp <amp@ampcode.com>
brianp and others added 4 commits February 23, 2026 09:53
## Description
- remove `BalanceCalculator` and the calculations from balance changes
- use the account balance directly from db
- add small temporary value for `total` directly after an outgoing
transaction

## Motivation and Context

## How Has This Been Tested?
- locally

## Breaking Changes

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify
@brianp brianp marked this pull request as ready for review March 6, 2026 09:36
brianp added 5 commits March 6, 2026 13:34
- Fix operator precedence bug in phase_node.rs where missing parentheses
  caused block height updates to fire regardless of sync state
- Fix race condition in get_owner_address using double-checked locking
- Add zero-amount validation to send_one_sided_transaction
- Replace println! with log::info! in transaction module
- Remove all #[allow(dead_code)] annotations:
  - Delete unused stop_scanning method
  - Delete unused get_account_by_name method
  - Delete unused CommandBuilder module
  - Remove annotation from emit_wallet_transactions_cleared
  - Revert process_adapter trait annotations to pre-existing state
- Remove stale commented-out code in transaction/mod.rs
- Replace LazyLock DEFAULT_GRPC_URL with get_grpc_url() function so
  network changes are reflected at runtime
- Add destination address network validation in send_one_sided_transaction
  to prevent cross-network fund loss (covers both Tauri and MCP paths)
- Fix balance tracker race condition by acquiring both locks atomically
  and removing deadlock-prone get_account_balance() call under write lock
- Reduce UTXO lock duration from 24 hours to 2 hours to limit fund
  lockup on failed broadcasts
- Remove unused WalletNotStarted variant and #[allow(dead_code)]
- Remove dead code: WalletTransactionsCleared event, unused
  ProcessInstanceTrait methods (wait, start_and_wait_for_output)
@brianp brianp changed the title feat: minotari wallet integration [DNM] feat: minotari wallet integration Mar 6, 2026
Copy link
Collaborator

@brianp brianp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wallet scanning isn't working after initial scan finishes. New TX's never arrived even after mining confirmed.

Opened new issue: tari-project/minotari-cli#96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants