2024-03-20 00:44:00 +02:00
|
|
|
import 'package:cake_wallet/entities/contact.dart';
|
2024-12-11 15:45:15 +01:00
|
|
|
import 'package:cake_wallet/entities/evm_transaction_error_fees_handler.dart';
|
2020-11-06 20:54:00 +02:00
|
|
|
import 'package:cake_wallet/entities/transaction_description.dart';
|
2023-10-04 21:09:07 -04:00
|
|
|
import 'package:cake_wallet/ethereum/ethereum.dart';
|
2024-03-28 14:41:11 +02:00
|
|
|
import 'package:cake_wallet/exchange/provider/exchange_provider.dart';
|
|
|
|
import 'package:cake_wallet/exchange/provider/thorchain_exchange.provider.dart';
|
2023-10-04 21:09:07 -04:00
|
|
|
import 'package:cake_wallet/nano/nano.dart';
|
2025-03-21 04:18:47 +02:00
|
|
|
import 'package:cake_wallet/decred/decred.dart';
|
2023-10-04 21:09:07 -04:00
|
|
|
import 'package:cake_wallet/core/wallet_change_listener_view_model.dart';
|
|
|
|
import 'package:cake_wallet/entities/contact_record.dart';
|
2023-08-04 14:49:26 +01:00
|
|
|
import 'package:cake_wallet/entities/wallet_contact.dart';
|
2023-12-02 03:26:43 +01:00
|
|
|
import 'package:cake_wallet/polygon/polygon.dart';
|
|
|
|
import 'package:cake_wallet/reactions/wallet_connect.dart';
|
2024-11-09 19:59:47 +01:00
|
|
|
import 'package:cake_wallet/routes.dart';
|
CW-555-Add-Solana-Wallet (#1272)
* chore: Create cw_solana package and clean up files
* feat: Add Solana Wallet - Create, Restore form seed, restore from Key, Restore from QR, Send, Receive, transaction history, spl tokens
* fix: Make transactions file specific to solana only for solana transactions
* chore: Revert inject app details script
* fix: Fix issue with node and switch current node to main beta instead of testnet
* fix: Fix merge conflicts and adjust migration version
* fix: Fetch spl token error
Signed-off-by: Blazebrain <davidadegoke16@gmail.com>
* fix: Diplay and activate spl tokens bug
* fix: Review and fixes
* fix: reverted formatting for cryptocurrency class
* fix: Review comments, split sending flow into signing and sending separately, fix issues
* fix: Revert throwing unimplenented error
* chore: Fix comment
* chore: Fix comment
* fix: Errors in flow
* Update provider_types.dart [skip ci]
* fix: Issues with solana wallet
* Update solana_wallet.dart [skip ci]
* fix: Review comments
* fix: Date time config
* fix: Revert bash script for app details
* fix: Error with balance, displaying fees, fixing sent or received identifier bug, displaying token symbol with token transaction item in transactions list
* fix: Issues with address validation when sending spl tokens and walletconnect initial setup
* fix: Issues with sending, fetching transactions history, almost wrapping up walletconnect
* fix: Adjust imports that would affect monerocom building successfully
* fix: Refine transaction direction and continue work on walletconnect
* feat: Display SPL token transfers in the transaction history and finally settle the transaction direction
* fix: Delay in transactions history dispaly, show native token transactions first, then process spl token transactions
* feat: Switch node and revert solana chain id to previous id
* fix: Remove print statement
* fix: Remove await for transactions, fetch all transaction histories instantly and adjust solana send success message
* chore: Code refactoring and streamlined wallet type check for solana send success message
* fix: Make timeout error for node silent and add spl token images
---------
Signed-off-by: Blazebrain <davidadegoke16@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-02-23 14:39:19 +01:00
|
|
|
import 'package:cake_wallet/solana/solana.dart';
|
2023-10-04 21:09:07 -04:00
|
|
|
import 'package:cake_wallet/store/app_store.dart';
|
CW-525-Add-Tron-Wallet (#1327)
* chore: Initial setup for Tron Wallet
* feat: Create Tron Wallet base flow implemented, keys, address, receive, restore and proxy classes all setup
* feat: Display seed and key within the app
* feat: Activate restore from key and seed for Tron wallet
* feat: Add icon for tron wallet in wallet listing page
* feat: Activate display of receive address for tron
* feat: Fetch and display tron balance, sending transaction flow setup, fee limit calculation setup
* feat: Implement sending of native tron, setup sending of trc20 tokens
* chore: Rename function
* Delete lib/tron/tron.dart
* feat: Activate exchange for tron and its tokens, implement balance display for trc20 tokens and setup secrets configuration for tron
* feat: Implement tron token management, add, remove, delete, and get tokens in home settings view, also minor cleanup
* feat: Activate buy and sell for tron
* feat: Implement restore from QR, transactions history listing for both native transactions and trc20 transactions
* feat: Activate send all and do some minor cleanups
* chore: Fix some lint infos and warnings
* chore: Adjust configurations
* ci: Modify CI to create and add secrets for node
* fix: Fixes made while self reviewing the PR for this feature
* feat: Add guide for adding new wallet types, and add fixes to requested changes
* fix: Handle exceptions gracefully
* fix: Alternative for trc20 estimated fee
* fix: Fixes to display of amount and fee, removing clashes
* fix: Fee calculation WIP
* fix: Fix issue with handling of send all flow and display of amount and fee values before broadcasting transaction
* fix: PR review fixes and fix merge conflicts
* fix: Modify fetching assetOfTransaction [skip ci]
* fix: Move tron settings migration to 33
2024-05-03 19:00:05 +01:00
|
|
|
import 'package:cake_wallet/tron/tron.dart';
|
2023-08-04 14:49:26 +01:00
|
|
|
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
2022-04-22 18:00:28 +03:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
|
2024-05-04 20:44:50 -05:00
|
|
|
import 'package:cake_wallet/view_model/hardware_wallet/ledger_view_model.dart';
|
2025-03-14 17:31:31 +01:00
|
|
|
import 'package:cake_wallet/view_model/send/fees_view_model.dart';
|
2024-11-27 16:34:36 +01:00
|
|
|
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_list_view_model.dart';
|
Wownero (#1485)
* fix: scanning issues
* fix: sync, storing silent unspents
* chore: deps
* fix: label issues, clear spent utxo
* chore: deps
* fix: build
* fix: missing types
* feat: new electrs API & changes, fixes for last block scanning
* feat: Scan Silent Payments homepage toggle
* chore: build configure
* feat: generic fixes, testnet UI improvements, useSSL on bitcoin nodes
* fix: invalid Object in sendData
* feat: improve addresses page & address book displays
* feat: silent payments labeled addresses disclaimer
* fix: missing i18n
* chore: print
* feat: single block scan, rescan by date working for btc mainnet
* feat: new cake features page replace market page, move sp scan toggle, auto switch node pop up alert
* feat: delete silent addresses
* fix: red dot in non ssl nodes
* fix: inconsistent connection states, fix tx history
* fix: tx & balance displays, cpfp sending
* feat: new rust lib
* chore: node path
* fix: check node based on network
* fix: missing txcount from addresses
* style: padding in feature page cards
* fix: restore not getting all wallet addresses by type
* fix: auto switch node broken
* fix: silent payment txs not being restored
* feat: change scanning to subscription model, sync improvements
* fix: scan re-subscription
* fix: default nodes
* fix: improve scanning by date, fix single block scan
* refactor: common function for input tx selection
* various fixes for build issues
* initial monero.dart implementation
* ...
* multiple wallets
new lib
minor fixes
* other fixes from monero.dart and monero_c
* fix: nodes & build
* update build scripts
fix polyseed
* remove unnecessary code
* Add windows app, build scripts and build guide for it.
* Minor fix in generated monero configs
* fix: send all with multiple outs
* add missing monero_c command
* add android build script
* Merge and fix main
* undo android ndk removal
* Fix modified exception_handler.dart
* Temporarily remove haven
* fix build issues
* fix pr script
* Fixes for build monero.dart (monero_c) for windows.
* monero build script
* wip: ios build script
* refactor: unchanged file
* Added build guides for iOS and macOS. Replaced nproc call on macOS. Added macOS configuration for configure_cake_wallet.sh script.
* Update monero.dart and monero_c versions.
* Add missed windows build scripts
* Update the application configuration for windows build script.
* Update cw_monero pubspec lock file for monero.dart
* Update pr_test_build.yml
* chore: upgrade
* chore: merge changes
* refactor: unchanged files [skip ci]
* Fix conflicts with main
* fix for multiple wallets
* Add tron to windows application configuration.
* Add macOS option for description message in configure_cake_wallet.sh
* Include missed monero dll for windows.
* fix conflicts with main
* Disable haven configuration for iOS as default. Add ability to configure cakewallet for iOS with for configuration script. Remove cw_shared configuration for cw_monero.
* fix: scan fixes, add date, allow sending while scanning
* add missing nano secrets file [skip ci]
* ios library
* don't pull prebuilds android
* Add auto generation of manifest file for android project even for iOS, macOS, Windows.
* feat: sync fixes, sp settings
* feat: fix resyncing
* store crash fix
* make init async so it won't lag
disable print starts
* fix monero_c build issues
* libstdc++
* Fix MacOS saving wallet file issue
Fix Secure Storage issue (somehow)
* update pubspec.lock
* fix build script
* Use dylib as iOS framework. Use custom path for loading of iOS framework for monero.dart. Add script for generate iOS framework for monero wallet.
* fix: date from height logic, status disconnected & chain tip get
* fix: params
* feat: electrum migration if using cake electrum
* fix nodes
update versions
* re-enable tron
* update sp_scanner to work on iOS [skip ci]
* bump monero_c hash
* bump monero_c commit
* bump moneroc version
* bump monero_c commit
* Add ability to build monero wallet lib as universal lib. Update macOS build guide. Change default arch for macOS project to .
* fix: wrong socket for old electrum nodes
* Fix unchecked wallet type call
* get App Dir correctly in default_settings_migration.dart
* handle previous issue with fetching linux documents directory [skip ci]
* backup fix
* fix NTFS issues
* Close the wallet when the wallet gets changed
* fix: double balance
* feat: node domain
* fix: menu name
* bump monero_c commit
* fix: update tip on set scanning
* fix: connection switching back and forth
* feat: check if node is electrs, and supports sp
* chore: fix build
* minor enhancements
* fixes and enhancements
* solve conflicts with main
* Only stop wallet on rename and delete
* fix: status toggle
* minor enhancement
* Monero.com fixes
* bump monero_c commit
* update sp_scanner to include windows and linux
* Update macOS build guide. Change brew dependencies for build unbound locally.
* fix conflicts and update macos build guide
* remove build cache when on gh actions
* update secure storage
* free up even more storage
* free up more storage
* Add initial wownero
* fix conflicts
* fix workflow issue
* build wownero
* ios and windows changes
* macos
* complete wownero flow (app side)
* add keychain group entitlement and update script for RunnerBase on macos
* update secure_storage version to 8.1.0 in configure.dart
* add wownero framework
* update ios builds
* proper path for wownero and monero
* finalizing wownero
* finalizing wownero
* free up even more storage
* revert commenting of build gradle configs
* revert commenting of secrets [skip ci]
* free more storage
* minor fixes
* link android wownero libraries
* bump monero_c commit
* wownero fixes
* rename target
* build_single.sh using clean env
* bump monero_c commit
* minor fix
* Add wownero polyseed
* fix conflicts with main
* fix: wallet seed display
fix: wownero not refreshing
* fix: wallet seed display
fix: wownero not refreshing
* bump monero_c commit
* minor fixes
* fix: incorrectly displaying XMR instead of WOW
* fix: incorrect restore height in wownero
* bump monero_c commit
* Add Inno Setup Script for windows exe installer
* drop libc++_shared.so
* fixes from comments
* Fix CMake for windows
* Merge latest monero dart changes [skip ci]
* bump monero_c commit
* add wownero to build scripts for macos [skip ci]
* add 14 word seed support to wownero
* UI fixes for wownero seed restore
* minor fixes
* reformat code to pass lints
* wownero: fixes
haven: removal popup
* minor iOS fix [skip ci]
* fix: wownero confirmation count (it is spendable after 3 confirms)
fix: transaction history not displaying in WOW and XMR
when tx has 0 confirms,
This is more of a workaround, because I have no idea
why would the cpp code not return pending transaction.
* Update preferences_key.dart [skip ci]
* minor fixes
---------
Co-authored-by: Rafael Saes <git@rafael.saes.dev>
Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
Co-authored-by: M <m@cakewallet.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Matthew Fosse <matt@fosse.co>
2024-07-04 22:43:17 +03:00
|
|
|
import 'package:cake_wallet/wownero/wownero.dart';
|
Zano with passphrase (#1971)
* CW-685 Add passphrase restore for xmr/wow (#1552)
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* fix build issues
* fix build errors
* fix configure script
* print -> printV
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* reuse existing passphrase field
* remove unused passphrase field
* make workflow run on pullrequests only [skip ci] [skip slack]
---------
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* Zano (#1793)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* fix parameter issue
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* - Add Zano Aliases
- Enable simpleswap [skip ci]
- Fix settings migration versions
* push missing file [skip ci]
* Zano pr with CW-685 passphrase (#1969)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* fix build issues
* fix build errors
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* fix configure script
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* print -> printV
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* reuse existing passphrase field
* add passphrase support for zano
* Drop aarch64-linux-gnu for now.
* fix passphrase display, fix gray screen
* catch errors in polyseed encryption, encrypt only polyseed, fix coin in wownero
* update monero_c
update wownero to 0.11.3.0
* Show passphrase only when non-empty, fix passphrase being displayed as view key private.
* fix NanoAccountListPage showing up instead of MoneroAccountListPage for wownero
* build zano dependencies on android
* fix parameter issue
* minor merge leftover [skip ci]
* minor cleanup [skip ci]
* fix zano alias
update eth url for ens lookup
change $MAKE_JOB_COUNT to $NPROC
* minor cleanup [skip ci]
* fix zano alias
* Disable passphrase for creation of xmr/wow/zano
minor fixes
* fix zano on iOS
* - Fix get token data
- Enable unavailable balance
- Enable confirmations count
- Adjust explorer link
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
---------
Co-authored-by: cyan <cyjan@mrcyjanek.net>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
2025-01-24 20:33:24 +02:00
|
|
|
import 'package:cake_wallet/zano/zano.dart';
|
2024-03-29 15:51:34 -03:00
|
|
|
import 'package:cw_core/exceptions.dart';
|
2024-08-23 16:19:42 +03:00
|
|
|
import 'package:cw_core/transaction_info.dart';
|
2024-10-15 00:28:38 +03:00
|
|
|
import 'package:cw_core/unspent_coin_type.dart';
|
2021-08-10 17:52:35 +03:00
|
|
|
import 'package:cake_wallet/view_model/send/output.dart';
|
2021-07-16 12:32:36 +03:00
|
|
|
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
|
2024-11-09 19:59:47 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2020-11-06 20:54:00 +02:00
|
|
|
import 'package:hive/hive.dart';
|
2020-10-30 18:32:21 +02:00
|
|
|
import 'package:mobx/mobx.dart';
|
2020-10-07 08:58:22 +03:00
|
|
|
import 'package:cake_wallet/entities/template.dart';
|
2020-08-25 19:32:40 +03:00
|
|
|
import 'package:cake_wallet/core/address_validator.dart';
|
|
|
|
import 'package:cake_wallet/core/amount_validator.dart';
|
2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cw_core/pending_transaction.dart';
|
2020-08-25 19:32:40 +03:00
|
|
|
import 'package:cake_wallet/core/validator.dart';
|
2020-09-21 14:50:26 +03:00
|
|
|
import 'package:cake_wallet/core/execution_state.dart';
|
2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cake_wallet/monero/monero.dart';
|
|
|
|
import 'package:cw_core/sync_status.dart';
|
|
|
|
import 'package:cw_core/crypto_currency.dart';
|
2020-09-21 14:50:26 +03:00
|
|
|
import 'package:cake_wallet/entities/fiat_currency.dart';
|
|
|
|
import 'package:cake_wallet/entities/calculate_fiat_amount.dart';
|
2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cw_core/wallet_type.dart';
|
2020-09-21 14:50:26 +03:00
|
|
|
import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
|
2020-08-25 19:32:40 +03:00
|
|
|
import 'package:cake_wallet/store/settings_store.dart';
|
|
|
|
import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
|
2021-11-02 09:17:24 +00:00
|
|
|
import 'package:cake_wallet/entities/parsed_address.dart';
|
2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cake_wallet/bitcoin/bitcoin.dart';
|
2023-09-25 15:20:11 +03:00
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
2020-08-25 19:32:40 +03:00
|
|
|
|
|
|
|
part 'send_view_model.g.dart';
|
|
|
|
|
|
|
|
class SendViewModel = SendViewModelBase with _$SendViewModel;
|
|
|
|
|
2023-09-01 18:06:18 +03:00
|
|
|
abstract class SendViewModelBase extends WalletChangeListenerViewModel with Store {
|
|
|
|
@override
|
|
|
|
void onWalletChange(wallet) {
|
|
|
|
currencies = wallet.balance.keys.toList();
|
|
|
|
selectedCryptoCurrency = wallet.currency;
|
CW-525-Add-Tron-Wallet (#1327)
* chore: Initial setup for Tron Wallet
* feat: Create Tron Wallet base flow implemented, keys, address, receive, restore and proxy classes all setup
* feat: Display seed and key within the app
* feat: Activate restore from key and seed for Tron wallet
* feat: Add icon for tron wallet in wallet listing page
* feat: Activate display of receive address for tron
* feat: Fetch and display tron balance, sending transaction flow setup, fee limit calculation setup
* feat: Implement sending of native tron, setup sending of trc20 tokens
* chore: Rename function
* Delete lib/tron/tron.dart
* feat: Activate exchange for tron and its tokens, implement balance display for trc20 tokens and setup secrets configuration for tron
* feat: Implement tron token management, add, remove, delete, and get tokens in home settings view, also minor cleanup
* feat: Activate buy and sell for tron
* feat: Implement restore from QR, transactions history listing for both native transactions and trc20 transactions
* feat: Activate send all and do some minor cleanups
* chore: Fix some lint infos and warnings
* chore: Adjust configurations
* ci: Modify CI to create and add secrets for node
* fix: Fixes made while self reviewing the PR for this feature
* feat: Add guide for adding new wallet types, and add fixes to requested changes
* fix: Handle exceptions gracefully
* fix: Alternative for trc20 estimated fee
* fix: Fixes to display of amount and fee, removing clashes
* fix: Fee calculation WIP
* fix: Fix issue with handling of send all flow and display of amount and fee values before broadcasting transaction
* fix: PR review fixes and fix merge conflicts
* fix: Modify fetching assetOfTransaction [skip ci]
* fix: Move tron settings migration to 33
2024-05-03 19:00:05 +01:00
|
|
|
hasMultipleTokens = isEVMCompatibleChain(wallet.type) ||
|
|
|
|
wallet.type == WalletType.solana ||
|
Zano with passphrase (#1971)
* CW-685 Add passphrase restore for xmr/wow (#1552)
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* fix build issues
* fix build errors
* fix configure script
* print -> printV
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* reuse existing passphrase field
* remove unused passphrase field
* make workflow run on pullrequests only [skip ci] [skip slack]
---------
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* Zano (#1793)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* fix parameter issue
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* - Add Zano Aliases
- Enable simpleswap [skip ci]
- Fix settings migration versions
* push missing file [skip ci]
* Zano pr with CW-685 passphrase (#1969)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* fix build issues
* fix build errors
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* fix configure script
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* print -> printV
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* reuse existing passphrase field
* add passphrase support for zano
* Drop aarch64-linux-gnu for now.
* fix passphrase display, fix gray screen
* catch errors in polyseed encryption, encrypt only polyseed, fix coin in wownero
* update monero_c
update wownero to 0.11.3.0
* Show passphrase only when non-empty, fix passphrase being displayed as view key private.
* fix NanoAccountListPage showing up instead of MoneroAccountListPage for wownero
* build zano dependencies on android
* fix parameter issue
* minor merge leftover [skip ci]
* minor cleanup [skip ci]
* fix zano alias
update eth url for ens lookup
change $MAKE_JOB_COUNT to $NPROC
* minor cleanup [skip ci]
* fix zano alias
* Disable passphrase for creation of xmr/wow/zano
minor fixes
* fix zano on iOS
* - Fix get token data
- Enable unavailable balance
- Enable confirmations count
- Adjust explorer link
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
---------
Co-authored-by: cyan <cyjan@mrcyjanek.net>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
2025-01-24 20:33:24 +02:00
|
|
|
wallet.type == WalletType.tron ||
|
|
|
|
wallet.type == WalletType.zano;
|
2023-09-01 18:06:18 +03:00
|
|
|
}
|
|
|
|
|
2024-11-27 16:34:36 +01:00
|
|
|
UnspentCoinsListViewModel unspentCoinsListViewModel;
|
|
|
|
|
2022-01-25 15:43:19 +01:00
|
|
|
SendViewModelBase(
|
2023-09-01 18:06:18 +03:00
|
|
|
AppStore appStore,
|
|
|
|
this.sendTemplateViewModel,
|
|
|
|
this._fiatConversationStore,
|
|
|
|
this.balanceViewModel,
|
|
|
|
this.contactListViewModel,
|
|
|
|
this.transactionDescriptionBox,
|
2024-11-27 16:34:36 +01:00
|
|
|
this.ledgerViewModel,
|
2025-03-14 17:31:31 +01:00
|
|
|
this.unspentCoinsListViewModel,
|
|
|
|
this.feesViewModel, {
|
2025-03-10 16:37:23 -07:00
|
|
|
this.coinTypeToSpendFrom = UnspentCoinType.nonMweb,
|
2024-10-15 00:28:38 +03:00
|
|
|
}) : state = InitialExecutionState(),
|
2023-09-01 18:06:18 +03:00
|
|
|
currencies = appStore.wallet!.balance.keys.toList(),
|
|
|
|
selectedCryptoCurrency = appStore.wallet!.currency,
|
CW-555-Add-Solana-Wallet (#1272)
* chore: Create cw_solana package and clean up files
* feat: Add Solana Wallet - Create, Restore form seed, restore from Key, Restore from QR, Send, Receive, transaction history, spl tokens
* fix: Make transactions file specific to solana only for solana transactions
* chore: Revert inject app details script
* fix: Fix issue with node and switch current node to main beta instead of testnet
* fix: Fix merge conflicts and adjust migration version
* fix: Fetch spl token error
Signed-off-by: Blazebrain <davidadegoke16@gmail.com>
* fix: Diplay and activate spl tokens bug
* fix: Review and fixes
* fix: reverted formatting for cryptocurrency class
* fix: Review comments, split sending flow into signing and sending separately, fix issues
* fix: Revert throwing unimplenented error
* chore: Fix comment
* chore: Fix comment
* fix: Errors in flow
* Update provider_types.dart [skip ci]
* fix: Issues with solana wallet
* Update solana_wallet.dart [skip ci]
* fix: Review comments
* fix: Date time config
* fix: Revert bash script for app details
* fix: Error with balance, displaying fees, fixing sent or received identifier bug, displaying token symbol with token transaction item in transactions list
* fix: Issues with address validation when sending spl tokens and walletconnect initial setup
* fix: Issues with sending, fetching transactions history, almost wrapping up walletconnect
* fix: Adjust imports that would affect monerocom building successfully
* fix: Refine transaction direction and continue work on walletconnect
* feat: Display SPL token transfers in the transaction history and finally settle the transaction direction
* fix: Delay in transactions history dispaly, show native token transactions first, then process spl token transactions
* feat: Switch node and revert solana chain id to previous id
* fix: Remove print statement
* fix: Remove await for transactions, fetch all transaction histories instantly and adjust solana send success message
* chore: Code refactoring and streamlined wallet type check for solana send success message
* fix: Make timeout error for node silent and add spl token images
---------
Signed-off-by: Blazebrain <davidadegoke16@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-02-23 14:39:19 +01:00
|
|
|
hasMultipleTokens = isEVMCompatibleChain(appStore.wallet!.type) ||
|
CW-525-Add-Tron-Wallet (#1327)
* chore: Initial setup for Tron Wallet
* feat: Create Tron Wallet base flow implemented, keys, address, receive, restore and proxy classes all setup
* feat: Display seed and key within the app
* feat: Activate restore from key and seed for Tron wallet
* feat: Add icon for tron wallet in wallet listing page
* feat: Activate display of receive address for tron
* feat: Fetch and display tron balance, sending transaction flow setup, fee limit calculation setup
* feat: Implement sending of native tron, setup sending of trc20 tokens
* chore: Rename function
* Delete lib/tron/tron.dart
* feat: Activate exchange for tron and its tokens, implement balance display for trc20 tokens and setup secrets configuration for tron
* feat: Implement tron token management, add, remove, delete, and get tokens in home settings view, also minor cleanup
* feat: Activate buy and sell for tron
* feat: Implement restore from QR, transactions history listing for both native transactions and trc20 transactions
* feat: Activate send all and do some minor cleanups
* chore: Fix some lint infos and warnings
* chore: Adjust configurations
* ci: Modify CI to create and add secrets for node
* fix: Fixes made while self reviewing the PR for this feature
* feat: Add guide for adding new wallet types, and add fixes to requested changes
* fix: Handle exceptions gracefully
* fix: Alternative for trc20 estimated fee
* fix: Fixes to display of amount and fee, removing clashes
* fix: Fee calculation WIP
* fix: Fix issue with handling of send all flow and display of amount and fee values before broadcasting transaction
* fix: PR review fixes and fix merge conflicts
* fix: Modify fetching assetOfTransaction [skip ci]
* fix: Move tron settings migration to 33
2024-05-03 19:00:05 +01:00
|
|
|
appStore.wallet!.type == WalletType.solana ||
|
Zano with passphrase (#1971)
* CW-685 Add passphrase restore for xmr/wow (#1552)
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* fix build issues
* fix build errors
* fix configure script
* print -> printV
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* reuse existing passphrase field
* remove unused passphrase field
* make workflow run on pullrequests only [skip ci] [skip slack]
---------
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* Zano (#1793)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* fix parameter issue
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* - Add Zano Aliases
- Enable simpleswap [skip ci]
- Fix settings migration versions
* push missing file [skip ci]
* Zano pr with CW-685 passphrase (#1969)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* fix build issues
* fix build errors
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* fix configure script
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* print -> printV
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* reuse existing passphrase field
* add passphrase support for zano
* Drop aarch64-linux-gnu for now.
* fix passphrase display, fix gray screen
* catch errors in polyseed encryption, encrypt only polyseed, fix coin in wownero
* update monero_c
update wownero to 0.11.3.0
* Show passphrase only when non-empty, fix passphrase being displayed as view key private.
* fix NanoAccountListPage showing up instead of MoneroAccountListPage for wownero
* build zano dependencies on android
* fix parameter issue
* minor merge leftover [skip ci]
* minor cleanup [skip ci]
* fix zano alias
update eth url for ens lookup
change $MAKE_JOB_COUNT to $NPROC
* minor cleanup [skip ci]
* fix zano alias
* Disable passphrase for creation of xmr/wow/zano
minor fixes
* fix zano on iOS
* - Fix get token data
- Enable unavailable balance
- Enable confirmations count
- Adjust explorer link
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
---------
Co-authored-by: cyan <cyjan@mrcyjanek.net>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
2025-01-24 20:33:24 +02:00
|
|
|
appStore.wallet!.type == WalletType.tron ||
|
|
|
|
appStore.wallet!.type == WalletType.zano,
|
2022-11-25 22:51:07 +02:00
|
|
|
outputs = ObservableList<Output>(),
|
2023-09-01 18:06:18 +03:00
|
|
|
_settingsStore = appStore.settingsStore,
|
|
|
|
fiatFromSettings = appStore.settingsStore.fiatCurrency,
|
|
|
|
super(appStore: appStore) {
|
2023-08-04 14:49:26 +01:00
|
|
|
outputs
|
2023-09-01 18:06:18 +03:00
|
|
|
.add(Output(wallet, _settingsStore, _fiatConversationStore, () => selectedCryptoCurrency));
|
2024-12-18 16:46:36 +02:00
|
|
|
|
2025-03-03 17:38:00 -08:00
|
|
|
unspentCoinsListViewModel.initialSetup().then((_) {
|
|
|
|
unspentCoinsListViewModel.resetUnspentCoinsInfoSelections();
|
|
|
|
});
|
2020-09-21 14:50:26 +03:00
|
|
|
}
|
2020-08-25 19:32:40 +03:00
|
|
|
|
|
|
|
@observable
|
2020-09-21 14:50:26 +03:00
|
|
|
ExecutionState state;
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2021-08-10 17:52:35 +03:00
|
|
|
ObservableList<Output> outputs;
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2025-03-10 16:37:23 -07:00
|
|
|
@observable
|
|
|
|
UnspentCoinType coinTypeToSpendFrom;
|
2024-10-15 00:28:38 +03:00
|
|
|
|
2024-12-09 22:37:06 +02:00
|
|
|
bool get showAddressBookPopup => _settingsStore.showAddressBookPopupEnabled;
|
|
|
|
|
2025-03-21 05:24:22 +02:00
|
|
|
@action
|
|
|
|
void setShowAddressBookPopup(bool value) {
|
|
|
|
_settingsStore.showAddressBookPopupEnabled = value;
|
|
|
|
}
|
|
|
|
|
2021-07-16 12:32:36 +03:00
|
|
|
@action
|
2021-08-10 17:52:35 +03:00
|
|
|
void addOutput() {
|
2023-08-04 14:49:26 +01:00
|
|
|
outputs
|
2023-09-01 18:06:18 +03:00
|
|
|
.add(Output(wallet, _settingsStore, _fiatConversationStore, () => selectedCryptoCurrency));
|
2021-07-16 12:32:36 +03:00
|
|
|
}
|
2021-01-27 15:51:51 +02:00
|
|
|
|
2021-07-16 12:32:36 +03:00
|
|
|
@action
|
2021-08-10 17:52:35 +03:00
|
|
|
void removeOutput(Output output) {
|
2021-08-12 17:56:34 +03:00
|
|
|
if (isBatchSending) {
|
|
|
|
outputs.remove(output);
|
|
|
|
}
|
2021-07-16 12:32:36 +03:00
|
|
|
}
|
2021-01-27 15:51:51 +02:00
|
|
|
|
2021-07-16 12:32:36 +03:00
|
|
|
@action
|
2021-08-10 17:52:35 +03:00
|
|
|
void clearOutputs() {
|
|
|
|
outputs.clear();
|
|
|
|
addOutput();
|
2021-01-27 15:51:51 +02:00
|
|
|
}
|
2020-09-30 21:23:15 +03:00
|
|
|
|
2025-03-10 16:37:23 -07:00
|
|
|
@action
|
|
|
|
void setAllowMwebCoins(bool allow) {
|
|
|
|
if (wallet.type == WalletType.litecoin) {
|
|
|
|
coinTypeToSpendFrom = allow ? UnspentCoinType.any : UnspentCoinType.nonMweb;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-29 20:48:57 +02:00
|
|
|
@computed
|
2021-08-10 17:52:35 +03:00
|
|
|
bool get isBatchSending => outputs.length > 1;
|
2020-12-29 20:48:57 +02:00
|
|
|
|
2024-10-17 02:17:29 +01:00
|
|
|
bool get shouldDisplaySendALL {
|
|
|
|
if (walletType == WalletType.solana) return false;
|
|
|
|
|
2024-12-11 15:45:15 +01:00
|
|
|
// if (walletType == WalletType.ethereum && selectedCryptoCurrency == CryptoCurrency.eth)
|
|
|
|
// return false;
|
2024-10-17 02:17:29 +01:00
|
|
|
|
2024-12-11 15:45:15 +01:00
|
|
|
// if (walletType == WalletType.polygon && selectedCryptoCurrency == CryptoCurrency.maticpoly)
|
|
|
|
// return false;
|
2024-10-17 02:17:29 +01:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
CW-525-Add-Tron-Wallet (#1327)
* chore: Initial setup for Tron Wallet
* feat: Create Tron Wallet base flow implemented, keys, address, receive, restore and proxy classes all setup
* feat: Display seed and key within the app
* feat: Activate restore from key and seed for Tron wallet
* feat: Add icon for tron wallet in wallet listing page
* feat: Activate display of receive address for tron
* feat: Fetch and display tron balance, sending transaction flow setup, fee limit calculation setup
* feat: Implement sending of native tron, setup sending of trc20 tokens
* chore: Rename function
* Delete lib/tron/tron.dart
* feat: Activate exchange for tron and its tokens, implement balance display for trc20 tokens and setup secrets configuration for tron
* feat: Implement tron token management, add, remove, delete, and get tokens in home settings view, also minor cleanup
* feat: Activate buy and sell for tron
* feat: Implement restore from QR, transactions history listing for both native transactions and trc20 transactions
* feat: Activate send all and do some minor cleanups
* chore: Fix some lint infos and warnings
* chore: Adjust configurations
* ci: Modify CI to create and add secrets for node
* fix: Fixes made while self reviewing the PR for this feature
* feat: Add guide for adding new wallet types, and add fixes to requested changes
* fix: Handle exceptions gracefully
* fix: Alternative for trc20 estimated fee
* fix: Fixes to display of amount and fee, removing clashes
* fix: Fee calculation WIP
* fix: Fix issue with handling of send all flow and display of amount and fee values before broadcasting transaction
* fix: PR review fixes and fix merge conflicts
* fix: Modify fetching assetOfTransaction [skip ci]
* fix: Move tron settings migration to 33
2024-05-03 19:00:05 +01:00
|
|
|
|
2020-12-29 20:48:57 +02:00
|
|
|
@computed
|
|
|
|
String get pendingTransactionFiatAmount {
|
2023-10-04 21:09:07 -04:00
|
|
|
if (pendingTransaction == null) {
|
|
|
|
return '0.00';
|
|
|
|
}
|
|
|
|
|
2020-12-29 20:48:57 +02:00
|
|
|
try {
|
2023-10-04 21:09:07 -04:00
|
|
|
final fiat = calculateFiatAmount(
|
|
|
|
price: _fiatConversationStore.prices[selectedCryptoCurrency]!,
|
|
|
|
cryptoAmount: pendingTransaction!.amountFormatted);
|
|
|
|
return fiat;
|
2020-12-29 20:48:57 +02:00
|
|
|
} catch (_) {
|
|
|
|
return '0.00';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-30 16:54:55 +02:00
|
|
|
@computed
|
|
|
|
String get pendingTransactionFeeFiatAmount {
|
|
|
|
try {
|
|
|
|
if (pendingTransaction != null) {
|
2024-05-28 14:32:36 +01:00
|
|
|
final currency = pendingTransactionFeeCurrency(walletType);
|
2020-12-30 16:54:55 +02:00
|
|
|
final fiat = calculateFiatAmount(
|
2023-08-04 20:01:49 +03:00
|
|
|
price: _fiatConversationStore.prices[currency]!,
|
2022-10-12 13:09:57 -04:00
|
|
|
cryptoAmount: pendingTransaction!.feeFormatted);
|
2020-12-30 16:54:55 +02:00
|
|
|
return fiat;
|
|
|
|
} else {
|
|
|
|
return '0.00';
|
|
|
|
}
|
|
|
|
} catch (_) {
|
|
|
|
return '0.00';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-28 14:32:36 +01:00
|
|
|
CryptoCurrency pendingTransactionFeeCurrency(WalletType type) {
|
|
|
|
switch (type) {
|
|
|
|
case WalletType.ethereum:
|
|
|
|
case WalletType.polygon:
|
|
|
|
case WalletType.tron:
|
|
|
|
case WalletType.solana:
|
|
|
|
return wallet.currency;
|
|
|
|
default:
|
|
|
|
return selectedCryptoCurrency;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
FiatCurrency get fiat => _settingsStore.fiatCurrency;
|
|
|
|
|
2023-09-01 18:06:18 +03:00
|
|
|
CryptoCurrency get currency => wallet.currency;
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2023-08-04 20:01:49 +03:00
|
|
|
Validator<String> get amountValidator =>
|
2023-09-01 18:06:18 +03:00
|
|
|
AmountValidator(currency: walletTypeToCryptoCurrency(wallet.type));
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2023-08-04 20:01:49 +03:00
|
|
|
Validator<String> get allAmountValidator => AllAmountValidator();
|
2020-10-09 10:41:29 +03:00
|
|
|
|
2023-08-04 20:01:49 +03:00
|
|
|
Validator<String> get addressValidator => AddressValidator(type: selectedCryptoCurrency);
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2023-08-04 20:01:49 +03:00
|
|
|
Validator<String> get textValidator => TextValidator();
|
2021-09-22 16:47:10 +03:00
|
|
|
|
2022-11-25 22:51:07 +02:00
|
|
|
final FiatCurrency fiatFromSettings;
|
|
|
|
|
2021-01-29 22:18:07 +02:00
|
|
|
@observable
|
2022-10-12 13:09:57 -04:00
|
|
|
PendingTransaction? pendingTransaction;
|
2020-08-25 19:32:40 +03:00
|
|
|
|
|
|
|
@computed
|
2024-10-15 00:28:38 +03:00
|
|
|
String get balance {
|
|
|
|
if (coinTypeToSpendFrom == UnspentCoinType.mweb) {
|
|
|
|
return balanceViewModel.balances.values.first.secondAvailableBalance;
|
|
|
|
} else if (coinTypeToSpendFrom == UnspentCoinType.nonMweb) {
|
|
|
|
return balanceViewModel.balances.values.first.availableBalance;
|
|
|
|
}
|
|
|
|
return wallet.balance[selectedCryptoCurrency]!.formattedFullAvailableBalance;
|
|
|
|
}
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2022-12-07 22:07:32 +02:00
|
|
|
@computed
|
|
|
|
bool get isFiatDisabled => balanceViewModel.isFiatDisabled;
|
|
|
|
|
2022-11-22 19:33:24 +02:00
|
|
|
@computed
|
|
|
|
String get pendingTransactionFiatAmountFormatted =>
|
2023-08-04 14:49:26 +01:00
|
|
|
isFiatDisabled ? '' : pendingTransactionFiatAmount + ' ' + fiat.title;
|
2022-11-22 19:33:24 +02:00
|
|
|
|
|
|
|
@computed
|
|
|
|
String get pendingTransactionFeeFiatAmountFormatted =>
|
2023-08-04 14:49:26 +01:00
|
|
|
isFiatDisabled ? '' : pendingTransactionFeeFiatAmount + ' ' + fiat.title;
|
2022-11-22 19:33:24 +02:00
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
@computed
|
Cw 453 (#1306)
* feat: rebase btc-addr-types, migrate to bitcoin_base
* feat: allow scanning elect-rs using get_tweaks
* feat: scanning and adding addresses working with getTweaks, add btc SP address type
* chore: pubspec.lock
* chore: pubspec.lock
* fix: scan when switching, fix multiple unspents in same tx
* fix: initial scan
* fix: initial scan
* fix: scanning issues
* fix: sync, storing silent unspents
* chore: deps
* fix: label issues, clear spent utxo
* chore: deps
* fix: build
* fix: missing types
* feat: new electrs API & changes, fixes for last block scanning
* feat: Scan Silent Payments homepage toggle
* chore: build configure
* feat: generic fixes, testnet UI improvements, useSSL on bitcoin nodes
* fix: invalid Object in sendData
* feat: improve addresses page & address book displays
* feat: silent payments labeled addresses disclaimer
* fix: missing i18n
* chore: print
* feat: single block scan, rescan by date working for btc mainnet
* feat: new cake features page replace market page, move sp scan toggle, auto switch node pop up alert
* feat: delete silent addresses
* fix: red dot in non ssl nodes
* fix: inconsistent connection states, fix tx history
* fix: tx & balance displays, cpfp sending
* feat: new rust lib
* chore: node path
* fix: check node based on network
* fix: missing txcount from addresses
* style: padding in feature page cards
* fix: restore not getting all wallet addresses by type
* fix: auto switch node broken
* fix: silent payment txs not being restored
* feat: change scanning to subscription model, sync improvements
* fix: scan re-subscription
* fix: default nodes
* fix: improve scanning by date, fix single block scan
* refactor: common function for input tx selection
* fix: nodes & build
* fix: send all with multiple outs
* refactor: unchanged file
* Update pr_test_build.yml
* chore: upgrade
* chore: merge changes
* refactor: unchanged files [skip ci]
* fix: scan fixes, add date, allow sending while scanning
* feat: sync fixes, sp settings
* feat: fix resyncing
* fix: date from height logic, status disconnected & chain tip get
* fix: params
* feat: electrum migration if using cake electrum
* fix nodes
update versions
* re-enable tron
* update sp_scanner to work on iOS [skip ci]
* fix: wrong socket for old electrum nodes
* Fix unchecked wallet type call
* fix: double balance
* feat: node domain
* fix: menu name
* fix: update tip on set scanning
* fix: connection switching back and forth
* feat: check if node is electrs, and supports sp
* chore: fix build
* minor enhancements
* fixes and enhancements
* solve conflicts with main
* fix: status toggle
* minor enhancement
* Monero.com fixes
* update sp_scanner to include windows and linux
---------
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-05-29 11:43:48 -03:00
|
|
|
bool get isReadyForSend =>
|
|
|
|
wallet.syncStatus is SyncedSyncStatus ||
|
|
|
|
// If silent payments scanning, can still send payments
|
|
|
|
(wallet.type == WalletType.bitcoin && wallet.syncStatus is SyncingSyncStatus);
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2020-10-07 08:58:22 +03:00
|
|
|
@computed
|
2022-01-26 17:11:32 +01:00
|
|
|
List<Template> get templates => sendTemplateViewModel.templates
|
2022-01-31 13:54:24 +01:00
|
|
|
.where((template) => _isEqualCurrency(template.cryptoCurrency))
|
2022-01-26 17:11:32 +01:00
|
|
|
.toList();
|
2020-10-07 08:58:22 +03:00
|
|
|
|
2023-08-24 16:54:05 +03:00
|
|
|
@computed
|
|
|
|
bool get hasCoinControl =>
|
2023-09-01 18:06:18 +03:00
|
|
|
wallet.type == WalletType.bitcoin ||
|
2023-10-17 11:59:41 -04:00
|
|
|
wallet.type == WalletType.litecoin ||
|
|
|
|
wallet.type == WalletType.monero ||
|
Wownero (#1485)
* fix: scanning issues
* fix: sync, storing silent unspents
* chore: deps
* fix: label issues, clear spent utxo
* chore: deps
* fix: build
* fix: missing types
* feat: new electrs API & changes, fixes for last block scanning
* feat: Scan Silent Payments homepage toggle
* chore: build configure
* feat: generic fixes, testnet UI improvements, useSSL on bitcoin nodes
* fix: invalid Object in sendData
* feat: improve addresses page & address book displays
* feat: silent payments labeled addresses disclaimer
* fix: missing i18n
* chore: print
* feat: single block scan, rescan by date working for btc mainnet
* feat: new cake features page replace market page, move sp scan toggle, auto switch node pop up alert
* feat: delete silent addresses
* fix: red dot in non ssl nodes
* fix: inconsistent connection states, fix tx history
* fix: tx & balance displays, cpfp sending
* feat: new rust lib
* chore: node path
* fix: check node based on network
* fix: missing txcount from addresses
* style: padding in feature page cards
* fix: restore not getting all wallet addresses by type
* fix: auto switch node broken
* fix: silent payment txs not being restored
* feat: change scanning to subscription model, sync improvements
* fix: scan re-subscription
* fix: default nodes
* fix: improve scanning by date, fix single block scan
* refactor: common function for input tx selection
* various fixes for build issues
* initial monero.dart implementation
* ...
* multiple wallets
new lib
minor fixes
* other fixes from monero.dart and monero_c
* fix: nodes & build
* update build scripts
fix polyseed
* remove unnecessary code
* Add windows app, build scripts and build guide for it.
* Minor fix in generated monero configs
* fix: send all with multiple outs
* add missing monero_c command
* add android build script
* Merge and fix main
* undo android ndk removal
* Fix modified exception_handler.dart
* Temporarily remove haven
* fix build issues
* fix pr script
* Fixes for build monero.dart (monero_c) for windows.
* monero build script
* wip: ios build script
* refactor: unchanged file
* Added build guides for iOS and macOS. Replaced nproc call on macOS. Added macOS configuration for configure_cake_wallet.sh script.
* Update monero.dart and monero_c versions.
* Add missed windows build scripts
* Update the application configuration for windows build script.
* Update cw_monero pubspec lock file for monero.dart
* Update pr_test_build.yml
* chore: upgrade
* chore: merge changes
* refactor: unchanged files [skip ci]
* Fix conflicts with main
* fix for multiple wallets
* Add tron to windows application configuration.
* Add macOS option for description message in configure_cake_wallet.sh
* Include missed monero dll for windows.
* fix conflicts with main
* Disable haven configuration for iOS as default. Add ability to configure cakewallet for iOS with for configuration script. Remove cw_shared configuration for cw_monero.
* fix: scan fixes, add date, allow sending while scanning
* add missing nano secrets file [skip ci]
* ios library
* don't pull prebuilds android
* Add auto generation of manifest file for android project even for iOS, macOS, Windows.
* feat: sync fixes, sp settings
* feat: fix resyncing
* store crash fix
* make init async so it won't lag
disable print starts
* fix monero_c build issues
* libstdc++
* Fix MacOS saving wallet file issue
Fix Secure Storage issue (somehow)
* update pubspec.lock
* fix build script
* Use dylib as iOS framework. Use custom path for loading of iOS framework for monero.dart. Add script for generate iOS framework for monero wallet.
* fix: date from height logic, status disconnected & chain tip get
* fix: params
* feat: electrum migration if using cake electrum
* fix nodes
update versions
* re-enable tron
* update sp_scanner to work on iOS [skip ci]
* bump monero_c hash
* bump monero_c commit
* bump moneroc version
* bump monero_c commit
* Add ability to build monero wallet lib as universal lib. Update macOS build guide. Change default arch for macOS project to .
* fix: wrong socket for old electrum nodes
* Fix unchecked wallet type call
* get App Dir correctly in default_settings_migration.dart
* handle previous issue with fetching linux documents directory [skip ci]
* backup fix
* fix NTFS issues
* Close the wallet when the wallet gets changed
* fix: double balance
* feat: node domain
* fix: menu name
* bump monero_c commit
* fix: update tip on set scanning
* fix: connection switching back and forth
* feat: check if node is electrs, and supports sp
* chore: fix build
* minor enhancements
* fixes and enhancements
* solve conflicts with main
* Only stop wallet on rename and delete
* fix: status toggle
* minor enhancement
* Monero.com fixes
* bump monero_c commit
* update sp_scanner to include windows and linux
* Update macOS build guide. Change brew dependencies for build unbound locally.
* fix conflicts and update macos build guide
* remove build cache when on gh actions
* update secure storage
* free up even more storage
* free up more storage
* Add initial wownero
* fix conflicts
* fix workflow issue
* build wownero
* ios and windows changes
* macos
* complete wownero flow (app side)
* add keychain group entitlement and update script for RunnerBase on macos
* update secure_storage version to 8.1.0 in configure.dart
* add wownero framework
* update ios builds
* proper path for wownero and monero
* finalizing wownero
* finalizing wownero
* free up even more storage
* revert commenting of build gradle configs
* revert commenting of secrets [skip ci]
* free more storage
* minor fixes
* link android wownero libraries
* bump monero_c commit
* wownero fixes
* rename target
* build_single.sh using clean env
* bump monero_c commit
* minor fix
* Add wownero polyseed
* fix conflicts with main
* fix: wallet seed display
fix: wownero not refreshing
* fix: wallet seed display
fix: wownero not refreshing
* bump monero_c commit
* minor fixes
* fix: incorrectly displaying XMR instead of WOW
* fix: incorrect restore height in wownero
* bump monero_c commit
* Add Inno Setup Script for windows exe installer
* drop libc++_shared.so
* fixes from comments
* Fix CMake for windows
* Merge latest monero dart changes [skip ci]
* bump monero_c commit
* add wownero to build scripts for macos [skip ci]
* add 14 word seed support to wownero
* UI fixes for wownero seed restore
* minor fixes
* reformat code to pass lints
* wownero: fixes
haven: removal popup
* minor iOS fix [skip ci]
* fix: wownero confirmation count (it is spendable after 3 confirms)
fix: transaction history not displaying in WOW and XMR
when tx has 0 confirms,
This is more of a workaround, because I have no idea
why would the cpp code not return pending transaction.
* Update preferences_key.dart [skip ci]
* minor fixes
---------
Co-authored-by: Rafael Saes <git@rafael.saes.dev>
Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
Co-authored-by: M <m@cakewallet.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Matthew Fosse <matt@fosse.co>
2024-07-04 22:43:17 +03:00
|
|
|
wallet.type == WalletType.wownero ||
|
2025-03-21 04:18:47 +02:00
|
|
|
wallet.type == WalletType.decred ||
|
2023-10-17 11:59:41 -04:00
|
|
|
wallet.type == WalletType.bitcoinCash;
|
2023-08-24 16:54:05 +03:00
|
|
|
|
2021-07-20 18:03:49 +03:00
|
|
|
@computed
|
2022-01-25 15:43:19 +01:00
|
|
|
bool get isElectrumWallet =>
|
2023-10-13 01:50:16 +03:00
|
|
|
wallet.type == WalletType.bitcoin ||
|
2023-10-17 11:59:41 -04:00
|
|
|
wallet.type == WalletType.litecoin ||
|
|
|
|
wallet.type == WalletType.bitcoinCash;
|
2021-07-20 18:03:49 +03:00
|
|
|
|
2022-03-30 17:57:04 +02:00
|
|
|
@observable
|
|
|
|
CryptoCurrency selectedCryptoCurrency;
|
|
|
|
|
|
|
|
List<CryptoCurrency> currencies;
|
|
|
|
|
2023-09-01 18:06:18 +03:00
|
|
|
bool get hasYat => outputs
|
|
|
|
.any((out) => out.isParsedAddress && out.parsedAddress.parseFrom == ParseFrom.yatRecord);
|
2021-11-02 09:17:24 +00:00
|
|
|
|
2023-09-01 18:06:18 +03:00
|
|
|
WalletType get walletType => wallet.type;
|
2022-03-30 17:57:04 +02:00
|
|
|
|
2023-09-01 18:06:18 +03:00
|
|
|
String? get walletCurrencyName => wallet.currency.fullName?.toLowerCase() ?? wallet.currency.name;
|
2022-08-09 17:06:21 +02:00
|
|
|
|
2022-03-30 17:57:04 +02:00
|
|
|
bool get hasCurrecyChanger => walletType == WalletType.haven;
|
|
|
|
|
2022-11-25 22:51:07 +02:00
|
|
|
@computed
|
|
|
|
FiatCurrency get fiatCurrency => _settingsStore.fiatCurrency;
|
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
final SettingsStore _settingsStore;
|
2021-07-16 12:32:36 +03:00
|
|
|
final SendTemplateViewModel sendTemplateViewModel;
|
2022-04-22 18:00:28 +03:00
|
|
|
final BalanceViewModel balanceViewModel;
|
2023-08-04 14:49:26 +01:00
|
|
|
final ContactListViewModel contactListViewModel;
|
2024-05-22 04:18:04 +03:00
|
|
|
final LedgerViewModel? ledgerViewModel;
|
2025-03-14 17:31:31 +01:00
|
|
|
final FeesViewModel feesViewModel;
|
2020-09-21 14:50:26 +03:00
|
|
|
final FiatConversionStore _fiatConversationStore;
|
2020-11-06 20:54:00 +02:00
|
|
|
final Box<TransactionDescription> transactionDescriptionBox;
|
2023-09-01 18:06:18 +03:00
|
|
|
|
|
|
|
@observable
|
|
|
|
bool hasMultipleTokens;
|
2020-08-25 19:32:40 +03:00
|
|
|
|
2023-08-04 14:49:26 +01:00
|
|
|
@computed
|
|
|
|
List<ContactRecord> get contactsToShow => contactListViewModel.contacts
|
2023-08-24 16:54:05 +03:00
|
|
|
.where((element) => element.type == selectedCryptoCurrency)
|
2023-08-04 14:49:26 +01:00
|
|
|
.toList();
|
|
|
|
|
|
|
|
@computed
|
|
|
|
List<WalletContact> get walletContactsToShow => contactListViewModel.walletContacts
|
2023-08-24 16:54:05 +03:00
|
|
|
.where((element) => element.type == selectedCryptoCurrency)
|
2023-08-04 14:49:26 +01:00
|
|
|
.toList();
|
|
|
|
|
|
|
|
@action
|
|
|
|
bool checkIfAddressIsAContact(String address) {
|
|
|
|
final contactList = contactsToShow.where((element) => element.address == address).toList();
|
|
|
|
|
|
|
|
return contactList.isNotEmpty;
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
bool checkIfWalletIsAnInternalWallet(String address) {
|
|
|
|
final walletContactList =
|
|
|
|
walletContactsToShow.where((element) => element.address == address).toList();
|
|
|
|
|
|
|
|
return walletContactList.isNotEmpty;
|
|
|
|
}
|
|
|
|
|
|
|
|
@computed
|
|
|
|
bool get shouldDisplayTOTP2FAForContact => _settingsStore.shouldRequireTOTP2FAForSendsToContact;
|
|
|
|
|
|
|
|
@computed
|
|
|
|
bool get shouldDisplayTOTP2FAForNonContact =>
|
|
|
|
_settingsStore.shouldRequireTOTP2FAForSendsToNonContact;
|
|
|
|
|
|
|
|
@computed
|
|
|
|
bool get shouldDisplayTOTP2FAForSendsToInternalWallet =>
|
|
|
|
_settingsStore.shouldRequireTOTP2FAForSendsToInternalWallets;
|
|
|
|
|
|
|
|
//* Still open to further optimize these checks
|
|
|
|
//* It works but can be made better
|
|
|
|
@action
|
|
|
|
bool checkThroughChecksToDisplayTOTP(String address) {
|
|
|
|
final isContact = checkIfAddressIsAContact(address);
|
|
|
|
final isInternalWallet = checkIfWalletIsAnInternalWallet(address);
|
|
|
|
|
|
|
|
if (isContact) {
|
|
|
|
return shouldDisplayTOTP2FAForContact;
|
|
|
|
} else if (isInternalWallet) {
|
|
|
|
return shouldDisplayTOTP2FAForSendsToInternalWallet;
|
|
|
|
} else {
|
|
|
|
return shouldDisplayTOTP2FAForNonContact;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool shouldDisplayTotp() {
|
|
|
|
List<bool> conditionsList = [];
|
|
|
|
|
|
|
|
for (var output in outputs) {
|
2023-10-09 18:18:59 +03:00
|
|
|
final show = checkThroughChecksToDisplayTOTP(output.extractedAddress);
|
2023-08-04 14:49:26 +01:00
|
|
|
conditionsList.add(show);
|
|
|
|
}
|
|
|
|
|
|
|
|
return conditionsList.contains(true);
|
|
|
|
}
|
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
@action
|
2024-03-28 14:41:11 +02:00
|
|
|
Future<PendingTransaction?> createTransaction({ExchangeProvider? provider}) async {
|
2020-08-25 19:32:40 +03:00
|
|
|
try {
|
2020-09-21 14:50:26 +03:00
|
|
|
state = IsExecutingState();
|
2024-04-25 02:14:11 +01:00
|
|
|
|
2024-05-04 20:44:50 -05:00
|
|
|
if (wallet.isHardwareWallet) state = IsAwaitingDeviceResponseState();
|
|
|
|
|
2025-01-03 08:53:15 +02:00
|
|
|
pendingTransaction = await wallet.createTransaction(_credentials(provider));
|
2024-05-04 20:44:50 -05:00
|
|
|
|
2024-03-28 14:41:11 +02:00
|
|
|
if (provider is ThorChainExchangeProvider) {
|
|
|
|
final outputCount = pendingTransaction?.outputCount ?? 0;
|
2024-04-01 15:31:14 +02:00
|
|
|
if (outputCount > 10) {
|
2024-04-25 02:14:11 +01:00
|
|
|
throw Exception("THORChain does not support more than 10 outputs");
|
2024-04-01 15:31:14 +02:00
|
|
|
}
|
2024-04-25 02:14:11 +01:00
|
|
|
|
2024-04-01 15:31:14 +02:00
|
|
|
if (_hasTaprootInput(pendingTransaction)) {
|
2024-04-25 02:14:11 +01:00
|
|
|
throw Exception("THORChain does not support Taproot addresses");
|
2024-04-01 15:31:14 +02:00
|
|
|
}
|
2024-03-28 14:41:11 +02:00
|
|
|
}
|
2024-09-20 14:24:25 +00:00
|
|
|
|
|
|
|
if (wallet.type == WalletType.bitcoin) {
|
|
|
|
final updatedOutputs = bitcoin!.updateOutputs(pendingTransaction!, outputs);
|
|
|
|
|
|
|
|
if (outputs.length == updatedOutputs.length) {
|
2024-11-11 19:39:45 +02:00
|
|
|
outputs.replaceRange(0, outputs.length, updatedOutputs);
|
2024-09-20 14:24:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-21 14:50:26 +03:00
|
|
|
state = ExecutedSuccessfullyState();
|
2024-03-28 14:41:11 +02:00
|
|
|
return pendingTransaction;
|
2020-08-25 19:32:40 +03:00
|
|
|
} catch (e) {
|
2024-10-23 17:38:31 +02:00
|
|
|
// if (e is LedgerException) {
|
|
|
|
// final errorCode = e.errorCode.toRadixString(16);
|
|
|
|
// final fallbackMsg =
|
|
|
|
// e.message.isNotEmpty ? e.message : "Unexpected Ledger Error Code: $errorCode";
|
|
|
|
// final errorMsg = ledgerViewModel!.interpretErrorCode(errorCode) ?? fallbackMsg;
|
|
|
|
//
|
|
|
|
// state = FailureState(errorMsg);
|
|
|
|
// } else {
|
2024-12-14 00:31:10 +01:00
|
|
|
state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));
|
2024-10-23 17:38:31 +02:00
|
|
|
// }
|
2020-08-25 19:32:40 +03:00
|
|
|
}
|
2024-04-01 15:31:14 +02:00
|
|
|
return null;
|
2020-08-25 19:32:40 +03:00
|
|
|
}
|
|
|
|
|
2024-04-08 17:54:58 +03:00
|
|
|
@action
|
2024-08-23 16:19:42 +03:00
|
|
|
Future<void> replaceByFee(TransactionInfo tx, String newFee) async {
|
2024-04-08 17:54:58 +03:00
|
|
|
state = IsExecutingState();
|
|
|
|
|
2024-08-23 16:19:42 +03:00
|
|
|
try {
|
|
|
|
final isSufficient = await bitcoin!.isChangeSufficientForFee(wallet, tx.id, newFee);
|
|
|
|
|
|
|
|
if (!isSufficient) {
|
|
|
|
state = AwaitingConfirmationState(
|
|
|
|
title: S.current.confirm_fee_deduction,
|
|
|
|
message: S.current.confirm_fee_deduction_content,
|
|
|
|
onConfirm: () async => await _executeReplaceByFee(tx, newFee),
|
|
|
|
onCancel: () => state = FailureState('Insufficient change for fee'));
|
|
|
|
} else {
|
|
|
|
await _executeReplaceByFee(tx, newFee);
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
state = FailureState(e.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> _executeReplaceByFee(TransactionInfo tx, String newFee) async {
|
|
|
|
clearOutputs();
|
|
|
|
final output = outputs.first;
|
|
|
|
output.address = tx.outputAddresses?.first ?? '';
|
|
|
|
|
|
|
|
try {
|
|
|
|
pendingTransaction = await bitcoin!.replaceByFee(wallet, tx.id, newFee);
|
2024-04-08 17:54:58 +03:00
|
|
|
state = ExecutedSuccessfullyState();
|
2024-08-23 16:19:42 +03:00
|
|
|
} catch (e) {
|
|
|
|
state = FailureState(e.toString());
|
2024-04-08 17:54:58 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
@action
|
2024-11-09 19:59:47 +01:00
|
|
|
Future<void> commitTransaction(BuildContext context) async {
|
2022-10-12 13:09:57 -04:00
|
|
|
if (pendingTransaction == null) {
|
|
|
|
throw Exception("Pending transaction doesn't exist. It should not be happened.");
|
|
|
|
}
|
|
|
|
|
2021-08-10 17:52:35 +03:00
|
|
|
String address = outputs.fold('', (acc, value) {
|
2021-10-04 17:25:27 +03:00
|
|
|
return value.isParsedAddress
|
2024-05-04 20:44:50 -05:00
|
|
|
? '$acc${value.address}\n${value.extractedAddress}\n\n'
|
|
|
|
: '$acc${value.address}\n\n';
|
2021-07-20 18:03:49 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
address = address.trim();
|
|
|
|
|
2024-05-04 20:44:50 -05:00
|
|
|
String note = outputs.fold('', (acc, value) => '$acc${value.note}\n');
|
2021-07-20 18:03:49 +03:00
|
|
|
|
|
|
|
note = note.trim();
|
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
try {
|
|
|
|
state = TransactionCommitting();
|
2024-12-14 00:31:10 +01:00
|
|
|
|
2024-11-09 19:59:47 +01:00
|
|
|
if (pendingTransaction!.shouldCommitUR()) {
|
|
|
|
final urstr = await pendingTransaction!.commitUR();
|
2024-12-14 00:31:10 +01:00
|
|
|
final result =
|
|
|
|
await Navigator.of(context).pushNamed(Routes.urqrAnimatedPage, arguments: urstr);
|
2024-11-09 19:59:47 +01:00
|
|
|
if (result == null) {
|
|
|
|
state = FailureState("Canceled by user");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
await pendingTransaction!.commit();
|
|
|
|
}
|
2020-11-06 20:54:00 +02:00
|
|
|
|
2023-10-04 21:09:07 -04:00
|
|
|
if (walletType == WalletType.nano) {
|
|
|
|
nano!.updateTransactions(wallet);
|
|
|
|
}
|
|
|
|
|
2022-11-25 22:51:07 +02:00
|
|
|
if (pendingTransaction!.id.isNotEmpty) {
|
2024-10-18 05:58:57 +03:00
|
|
|
final descriptionKey = '${pendingTransaction!.id}_${wallet.walletAddresses.primaryAddress}';
|
2020-12-24 12:04:23 +02:00
|
|
|
_settingsStore.shouldSaveRecipientAddress
|
2021-01-11 19:15:27 +02:00
|
|
|
? await transactionDescriptionBox.add(TransactionDescription(
|
2024-12-14 00:31:10 +01:00
|
|
|
id: descriptionKey, recipientAddress: address, transactionNote: note))
|
|
|
|
: await transactionDescriptionBox
|
|
|
|
.add(TransactionDescription(id: descriptionKey, transactionNote: note));
|
2020-11-06 20:54:00 +02:00
|
|
|
}
|
|
|
|
|
2020-08-25 19:32:40 +03:00
|
|
|
state = TransactionCommitted();
|
|
|
|
} catch (e) {
|
2024-03-29 15:51:34 -03:00
|
|
|
state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));
|
2020-08-25 19:32:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-01-03 08:53:15 +02:00
|
|
|
Object _credentials([ExchangeProvider? provider]) {
|
2023-10-13 01:50:16 +03:00
|
|
|
final priority = _settingsStore.priority[wallet.type];
|
2020-09-21 14:50:26 +03:00
|
|
|
|
2024-05-06 20:11:18 +01:00
|
|
|
if (priority == null &&
|
|
|
|
wallet.type != WalletType.nano &&
|
|
|
|
wallet.type != WalletType.banano &&
|
|
|
|
wallet.type != WalletType.solana &&
|
CW-525-Add-Tron-Wallet (#1327)
* chore: Initial setup for Tron Wallet
* feat: Create Tron Wallet base flow implemented, keys, address, receive, restore and proxy classes all setup
* feat: Display seed and key within the app
* feat: Activate restore from key and seed for Tron wallet
* feat: Add icon for tron wallet in wallet listing page
* feat: Activate display of receive address for tron
* feat: Fetch and display tron balance, sending transaction flow setup, fee limit calculation setup
* feat: Implement sending of native tron, setup sending of trc20 tokens
* chore: Rename function
* Delete lib/tron/tron.dart
* feat: Activate exchange for tron and its tokens, implement balance display for trc20 tokens and setup secrets configuration for tron
* feat: Implement tron token management, add, remove, delete, and get tokens in home settings view, also minor cleanup
* feat: Activate buy and sell for tron
* feat: Implement restore from QR, transactions history listing for both native transactions and trc20 transactions
* feat: Activate send all and do some minor cleanups
* chore: Fix some lint infos and warnings
* chore: Adjust configurations
* ci: Modify CI to create and add secrets for node
* fix: Fixes made while self reviewing the PR for this feature
* feat: Add guide for adding new wallet types, and add fixes to requested changes
* fix: Handle exceptions gracefully
* fix: Alternative for trc20 estimated fee
* fix: Fixes to display of amount and fee, removing clashes
* fix: Fee calculation WIP
* fix: Fix issue with handling of send all flow and display of amount and fee values before broadcasting transaction
* fix: PR review fixes and fix merge conflicts
* fix: Modify fetching assetOfTransaction [skip ci]
* fix: Move tron settings migration to 33
2024-05-03 19:00:05 +01:00
|
|
|
wallet.type != WalletType.tron) {
|
2023-10-17 11:59:41 -04:00
|
|
|
throw Exception('Priority is null for wallet type: ${wallet.type}');
|
|
|
|
}
|
2022-10-12 13:09:57 -04:00
|
|
|
|
2023-10-13 01:50:16 +03:00
|
|
|
switch (wallet.type) {
|
|
|
|
case WalletType.bitcoin:
|
|
|
|
case WalletType.bitcoinCash:
|
2024-10-15 00:28:38 +03:00
|
|
|
return bitcoin!.createBitcoinTransactionCredentials(
|
|
|
|
outputs,
|
|
|
|
priority: priority!,
|
2025-03-14 17:31:31 +01:00
|
|
|
feeRate:feesViewModel. customBitcoinFeeRate,
|
2024-10-15 00:28:38 +03:00
|
|
|
coinTypeToSpendFrom: coinTypeToSpendFrom,
|
|
|
|
);
|
2025-01-03 08:53:15 +02:00
|
|
|
case WalletType.litecoin:
|
|
|
|
return bitcoin!.createBitcoinTransactionCredentials(
|
|
|
|
outputs,
|
|
|
|
priority: priority!,
|
2025-03-14 17:31:31 +01:00
|
|
|
feeRate:feesViewModel. customBitcoinFeeRate,
|
2025-01-03 08:53:15 +02:00
|
|
|
// if it's an exchange flow then disable sending from mweb coins
|
|
|
|
coinTypeToSpendFrom: provider != null ? UnspentCoinType.nonMweb : coinTypeToSpendFrom,
|
|
|
|
);
|
2022-10-12 13:09:57 -04:00
|
|
|
|
2023-10-13 01:50:16 +03:00
|
|
|
case WalletType.monero:
|
2023-08-04 14:49:26 +01:00
|
|
|
return monero!
|
2023-10-17 11:59:41 -04:00
|
|
|
.createMoneroTransactionCreationCredentials(outputs: outputs, priority: priority!);
|
2023-08-04 14:49:26 +01:00
|
|
|
|
Wownero (#1485)
* fix: scanning issues
* fix: sync, storing silent unspents
* chore: deps
* fix: label issues, clear spent utxo
* chore: deps
* fix: build
* fix: missing types
* feat: new electrs API & changes, fixes for last block scanning
* feat: Scan Silent Payments homepage toggle
* chore: build configure
* feat: generic fixes, testnet UI improvements, useSSL on bitcoin nodes
* fix: invalid Object in sendData
* feat: improve addresses page & address book displays
* feat: silent payments labeled addresses disclaimer
* fix: missing i18n
* chore: print
* feat: single block scan, rescan by date working for btc mainnet
* feat: new cake features page replace market page, move sp scan toggle, auto switch node pop up alert
* feat: delete silent addresses
* fix: red dot in non ssl nodes
* fix: inconsistent connection states, fix tx history
* fix: tx & balance displays, cpfp sending
* feat: new rust lib
* chore: node path
* fix: check node based on network
* fix: missing txcount from addresses
* style: padding in feature page cards
* fix: restore not getting all wallet addresses by type
* fix: auto switch node broken
* fix: silent payment txs not being restored
* feat: change scanning to subscription model, sync improvements
* fix: scan re-subscription
* fix: default nodes
* fix: improve scanning by date, fix single block scan
* refactor: common function for input tx selection
* various fixes for build issues
* initial monero.dart implementation
* ...
* multiple wallets
new lib
minor fixes
* other fixes from monero.dart and monero_c
* fix: nodes & build
* update build scripts
fix polyseed
* remove unnecessary code
* Add windows app, build scripts and build guide for it.
* Minor fix in generated monero configs
* fix: send all with multiple outs
* add missing monero_c command
* add android build script
* Merge and fix main
* undo android ndk removal
* Fix modified exception_handler.dart
* Temporarily remove haven
* fix build issues
* fix pr script
* Fixes for build monero.dart (monero_c) for windows.
* monero build script
* wip: ios build script
* refactor: unchanged file
* Added build guides for iOS and macOS. Replaced nproc call on macOS. Added macOS configuration for configure_cake_wallet.sh script.
* Update monero.dart and monero_c versions.
* Add missed windows build scripts
* Update the application configuration for windows build script.
* Update cw_monero pubspec lock file for monero.dart
* Update pr_test_build.yml
* chore: upgrade
* chore: merge changes
* refactor: unchanged files [skip ci]
* Fix conflicts with main
* fix for multiple wallets
* Add tron to windows application configuration.
* Add macOS option for description message in configure_cake_wallet.sh
* Include missed monero dll for windows.
* fix conflicts with main
* Disable haven configuration for iOS as default. Add ability to configure cakewallet for iOS with for configuration script. Remove cw_shared configuration for cw_monero.
* fix: scan fixes, add date, allow sending while scanning
* add missing nano secrets file [skip ci]
* ios library
* don't pull prebuilds android
* Add auto generation of manifest file for android project even for iOS, macOS, Windows.
* feat: sync fixes, sp settings
* feat: fix resyncing
* store crash fix
* make init async so it won't lag
disable print starts
* fix monero_c build issues
* libstdc++
* Fix MacOS saving wallet file issue
Fix Secure Storage issue (somehow)
* update pubspec.lock
* fix build script
* Use dylib as iOS framework. Use custom path for loading of iOS framework for monero.dart. Add script for generate iOS framework for monero wallet.
* fix: date from height logic, status disconnected & chain tip get
* fix: params
* feat: electrum migration if using cake electrum
* fix nodes
update versions
* re-enable tron
* update sp_scanner to work on iOS [skip ci]
* bump monero_c hash
* bump monero_c commit
* bump moneroc version
* bump monero_c commit
* Add ability to build monero wallet lib as universal lib. Update macOS build guide. Change default arch for macOS project to .
* fix: wrong socket for old electrum nodes
* Fix unchecked wallet type call
* get App Dir correctly in default_settings_migration.dart
* handle previous issue with fetching linux documents directory [skip ci]
* backup fix
* fix NTFS issues
* Close the wallet when the wallet gets changed
* fix: double balance
* feat: node domain
* fix: menu name
* bump monero_c commit
* fix: update tip on set scanning
* fix: connection switching back and forth
* feat: check if node is electrs, and supports sp
* chore: fix build
* minor enhancements
* fixes and enhancements
* solve conflicts with main
* Only stop wallet on rename and delete
* fix: status toggle
* minor enhancement
* Monero.com fixes
* bump monero_c commit
* update sp_scanner to include windows and linux
* Update macOS build guide. Change brew dependencies for build unbound locally.
* fix conflicts and update macos build guide
* remove build cache when on gh actions
* update secure storage
* free up even more storage
* free up more storage
* Add initial wownero
* fix conflicts
* fix workflow issue
* build wownero
* ios and windows changes
* macos
* complete wownero flow (app side)
* add keychain group entitlement and update script for RunnerBase on macos
* update secure_storage version to 8.1.0 in configure.dart
* add wownero framework
* update ios builds
* proper path for wownero and monero
* finalizing wownero
* finalizing wownero
* free up even more storage
* revert commenting of build gradle configs
* revert commenting of secrets [skip ci]
* free more storage
* minor fixes
* link android wownero libraries
* bump monero_c commit
* wownero fixes
* rename target
* build_single.sh using clean env
* bump monero_c commit
* minor fix
* Add wownero polyseed
* fix conflicts with main
* fix: wallet seed display
fix: wownero not refreshing
* fix: wallet seed display
fix: wownero not refreshing
* bump monero_c commit
* minor fixes
* fix: incorrectly displaying XMR instead of WOW
* fix: incorrect restore height in wownero
* bump monero_c commit
* Add Inno Setup Script for windows exe installer
* drop libc++_shared.so
* fixes from comments
* Fix CMake for windows
* Merge latest monero dart changes [skip ci]
* bump monero_c commit
* add wownero to build scripts for macos [skip ci]
* add 14 word seed support to wownero
* UI fixes for wownero seed restore
* minor fixes
* reformat code to pass lints
* wownero: fixes
haven: removal popup
* minor iOS fix [skip ci]
* fix: wownero confirmation count (it is spendable after 3 confirms)
fix: transaction history not displaying in WOW and XMR
when tx has 0 confirms,
This is more of a workaround, because I have no idea
why would the cpp code not return pending transaction.
* Update preferences_key.dart [skip ci]
* minor fixes
---------
Co-authored-by: Rafael Saes <git@rafael.saes.dev>
Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
Co-authored-by: M <m@cakewallet.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Matthew Fosse <matt@fosse.co>
2024-07-04 22:43:17 +03:00
|
|
|
case WalletType.wownero:
|
|
|
|
return wownero!
|
|
|
|
.createWowneroTransactionCreationCredentials(outputs: outputs, priority: priority!);
|
|
|
|
|
2023-08-04 20:01:49 +03:00
|
|
|
case WalletType.ethereum:
|
2023-09-01 18:06:18 +03:00
|
|
|
return ethereum!.createEthereumTransactionCredentials(outputs,
|
2023-10-17 11:59:41 -04:00
|
|
|
priority: priority!, currency: selectedCryptoCurrency);
|
2023-10-04 21:09:07 -04:00
|
|
|
case WalletType.nano:
|
2023-10-13 01:50:16 +03:00
|
|
|
return nano!.createNanoTransactionCredentials(outputs);
|
2023-12-02 03:26:43 +01:00
|
|
|
case WalletType.polygon:
|
|
|
|
return polygon!.createPolygonTransactionCredentials(outputs,
|
|
|
|
priority: priority!, currency: selectedCryptoCurrency);
|
CW-555-Add-Solana-Wallet (#1272)
* chore: Create cw_solana package and clean up files
* feat: Add Solana Wallet - Create, Restore form seed, restore from Key, Restore from QR, Send, Receive, transaction history, spl tokens
* fix: Make transactions file specific to solana only for solana transactions
* chore: Revert inject app details script
* fix: Fix issue with node and switch current node to main beta instead of testnet
* fix: Fix merge conflicts and adjust migration version
* fix: Fetch spl token error
Signed-off-by: Blazebrain <davidadegoke16@gmail.com>
* fix: Diplay and activate spl tokens bug
* fix: Review and fixes
* fix: reverted formatting for cryptocurrency class
* fix: Review comments, split sending flow into signing and sending separately, fix issues
* fix: Revert throwing unimplenented error
* chore: Fix comment
* chore: Fix comment
* fix: Errors in flow
* Update provider_types.dart [skip ci]
* fix: Issues with solana wallet
* Update solana_wallet.dart [skip ci]
* fix: Review comments
* fix: Date time config
* fix: Revert bash script for app details
* fix: Error with balance, displaying fees, fixing sent or received identifier bug, displaying token symbol with token transaction item in transactions list
* fix: Issues with address validation when sending spl tokens and walletconnect initial setup
* fix: Issues with sending, fetching transactions history, almost wrapping up walletconnect
* fix: Adjust imports that would affect monerocom building successfully
* fix: Refine transaction direction and continue work on walletconnect
* feat: Display SPL token transfers in the transaction history and finally settle the transaction direction
* fix: Delay in transactions history dispaly, show native token transactions first, then process spl token transactions
* feat: Switch node and revert solana chain id to previous id
* fix: Remove print statement
* fix: Remove await for transactions, fetch all transaction histories instantly and adjust solana send success message
* chore: Code refactoring and streamlined wallet type check for solana send success message
* fix: Make timeout error for node silent and add spl token images
---------
Signed-off-by: Blazebrain <davidadegoke16@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-02-23 14:39:19 +01:00
|
|
|
case WalletType.solana:
|
|
|
|
return solana!
|
|
|
|
.createSolanaTransactionCredentials(outputs, currency: selectedCryptoCurrency);
|
CW-525-Add-Tron-Wallet (#1327)
* chore: Initial setup for Tron Wallet
* feat: Create Tron Wallet base flow implemented, keys, address, receive, restore and proxy classes all setup
* feat: Display seed and key within the app
* feat: Activate restore from key and seed for Tron wallet
* feat: Add icon for tron wallet in wallet listing page
* feat: Activate display of receive address for tron
* feat: Fetch and display tron balance, sending transaction flow setup, fee limit calculation setup
* feat: Implement sending of native tron, setup sending of trc20 tokens
* chore: Rename function
* Delete lib/tron/tron.dart
* feat: Activate exchange for tron and its tokens, implement balance display for trc20 tokens and setup secrets configuration for tron
* feat: Implement tron token management, add, remove, delete, and get tokens in home settings view, also minor cleanup
* feat: Activate buy and sell for tron
* feat: Implement restore from QR, transactions history listing for both native transactions and trc20 transactions
* feat: Activate send all and do some minor cleanups
* chore: Fix some lint infos and warnings
* chore: Adjust configurations
* ci: Modify CI to create and add secrets for node
* fix: Fixes made while self reviewing the PR for this feature
* feat: Add guide for adding new wallet types, and add fixes to requested changes
* fix: Handle exceptions gracefully
* fix: Alternative for trc20 estimated fee
* fix: Fixes to display of amount and fee, removing clashes
* fix: Fee calculation WIP
* fix: Fix issue with handling of send all flow and display of amount and fee values before broadcasting transaction
* fix: PR review fixes and fix merge conflicts
* fix: Modify fetching assetOfTransaction [skip ci]
* fix: Move tron settings migration to 33
2024-05-03 19:00:05 +01:00
|
|
|
case WalletType.tron:
|
|
|
|
return tron!.createTronTransactionCredentials(outputs, currency: selectedCryptoCurrency);
|
Zano with passphrase (#1971)
* CW-685 Add passphrase restore for xmr/wow (#1552)
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* fix build issues
* fix build errors
* fix configure script
* print -> printV
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* reuse existing passphrase field
* remove unused passphrase field
* make workflow run on pullrequests only [skip ci] [skip slack]
---------
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* Zano (#1793)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* fix parameter issue
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* - Add Zano Aliases
- Enable simpleswap [skip ci]
- Fix settings migration versions
* push missing file [skip ci]
* Zano pr with CW-685 passphrase (#1969)
* my experiments
* Inital code for Zano integration
* Added missing android log lib
* added dummy wallet & some zano implementation
* fixing api for zano
* fixed zano build script
* attempt tp fix namespace problem
* added copy script for Zano files
* changes for zano wallet
* last updates
* zano.dart test app
* wallet recovery
* added pending transfer, some cleanup of unused
* some cleanup
* send + receive qr code
* last upd
* updated build_zano.sh
* updated zano ApiCalls, removed dummy
* updated zano ApiCalls, removed dummy
* added logging for get status/get info
* restored old wallet.dart
* restoring original versions of files
* restoring original versions of files
* restored get_height_by_date.dart, removed unnecessary calls for zano get height
* restoring original versions
* added multiple destinations, send all flag; some refactoring
* logging
* removed the duplicate
* fixed syncing sync status, decimal division, safe null json parsing
* some fixes after merge
* added multibalance/asset support for zano (ui)
* adding/removing from whitelist
* transfers in different assets
* transfers for multiple destinations and send all, some refactoring
* whitelists, some refactoring
* added different digits (decimal points) for formatters, some refactoring
* open, create, restore wallet refactoring; whitelists
* whitelists
* getting and updating transaction list; restoring a wallet from QR code
* several attempts to close wallet
* some refactoring
* added seed phrase
* CW-685 Add passphrase restore for xmr/wow
* add support for polyseed passphrase
* disable 14 word seed passphrase (not supported in wownero-seed)
fix: Getting grayed screen on latest passphrase build after having restored a 14-word wownero seed (+passphrase) and attempting to restore a XMR seed, legacy or otherwise.
* fix pointer when restoring depracated wownero seed
* Fix polyseed encryption
* changed fields to BigInt, some fixes
* modified build scripts for android
* build scripts
* restored accidently removed cw_haven.dart
* inital ios integration(zano libs built)
* update in script
* latest changes
* changes from review
* remove unused code
* add passphrase back to the screen
add passphrase to qr code backup export
* fix settings leaking through currencies on seed restore
* fix monero.com builds, make passphrase a getter on WalletBase
* add support for weird polyseed
* store passphrase for weird polyseed
* show encrypted seed only when passphrase is not empty
* force set restore height
* Applied a patch for iOS build (Boost and Zano scripts)
* Removed zano.dart (script-generated) and some unnecessary files
* Revert "Removed zano.dart (script-generated) and some unnecessary files"
This reverts commit 367c86398ef2616006a2cbd2339ef2f30ed2800e.
* Removed zano.dart (generated by scripts), some files restored to initial versions
* fix build issues
* fix build errors
* added timer library
* changed paths in build_zano.sh
* build_zano.sh
* edit_token_page.dart - removed flag skipZanoAddressValidation
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
* lib/core/address_validator.dart - updated zano address regex
lib/src/screens/dashboard/edit_token_page.dart - using AddressValidator().call
* fix zano build issues on android
* remove contrib/depends to save space
* move async call to a synchronouse one
* call sync call in isolate to make it async
generate framework for iOS as well
fix UR issues
* zano changes from monero_c repo
* update monero_c hash
* fix invalid zano imports, add support for linux, speed up CI builds
* update monero_c hash
* bump monero_c commit (yes, again, I know)
* fix wallet resttore, fix hardcoded IP
* fix regex, don't throw error when opening wallet, fix tx history, fix async calls, move stuff to isolate
* fix api calls in async transaction creation
* fix configure script
* update build scripts
* fix some build issues
* update dependencies
* fix dependencies
* update ci scripts
* Improve multithread use of zano api
* Fix build issue
* fix zano node selection, move other zano calls to separate isolate
* update moneroc hash
WIP fixes for zano
* update monero_c
* fix monero.com builds
* sync wallet after connecting
* update monero_c
* Fix windows builds
* update monero_c
* print -> printV
* update monero_c
* unshallow submodule
* cherry pick CW-867 Wownero fixes (#1881)
* fix wownero syntax error
* remove print statements in zano
* update zano node URL
* [PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)
* drop env -i to fix cmake build errors on newer system
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update lib/view_model/wallet_keys_view_model.dart [skip ci]
* Update tool/configure.dart [skip ci]
* Update lib/view_model/wallet_new_vm.dart
* [skip ci] Revert "[PATCH] Apply new CI script (https://github.com/cake-tech/cake_wallet/pull/1948)"
This reverts commit 5acb5bfe57c4b2aeb7aa40bd684a3319a68f98bc.
* [run tests] [skip slack] Fix env in build
* Dynamically detect number of cores used to build monero_c, since it appears that zano requires more memory to link (and it reliably fails for first couple builds due to OOM on CI/VM with memory constrains).
Drop unshallowing of all modules
[run tests]
* Changes from review [run tests]
* drop zano on linux (missing symbols)
fix wownero on linux
add aarch64-linux-gnu
[run tests]
* - remove duplicate entry in addToken()
- use walletPassword in createZanoNewWalletCredentials
- remove createZanoRestoreWalletFromKeysCredentials
[run tests]
* [skip ci] update dockerfile
* reuse existing passphrase field
* add passphrase support for zano
* Drop aarch64-linux-gnu for now.
* fix passphrase display, fix gray screen
* catch errors in polyseed encryption, encrypt only polyseed, fix coin in wownero
* update monero_c
update wownero to 0.11.3.0
* Show passphrase only when non-empty, fix passphrase being displayed as view key private.
* fix NanoAccountListPage showing up instead of MoneroAccountListPage for wownero
* build zano dependencies on android
* fix parameter issue
* minor merge leftover [skip ci]
* minor cleanup [skip ci]
* fix zano alias
update eth url for ens lookup
change $MAKE_JOB_COUNT to $NPROC
* minor cleanup [skip ci]
* fix zano alias
* Disable passphrase for creation of xmr/wow/zano
minor fixes
* fix zano on iOS
* - Fix get token data
- Enable unavailable balance
- Enable confirmations count
- Adjust explorer link
---------
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
---------
Co-authored-by: cyan <cyjan@mrcyjanek.net>
Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
Co-authored-by: leo <leonid.ivanov@gmail.com>
Co-authored-by: cr.zoidberg <crypto.zoidberg@gmail.com>
2025-01-24 20:33:24 +02:00
|
|
|
case WalletType.zano:
|
|
|
|
return zano!.createZanoTransactionCredentials(
|
|
|
|
outputs: outputs, priority: priority!, currency: selectedCryptoCurrency);
|
2025-03-21 04:18:47 +02:00
|
|
|
case WalletType.decred:
|
|
|
|
this.coinTypeToSpendFrom = UnspentCoinType.any;
|
|
|
|
return decred!.createDecredTransactionCredentials(outputs, priority!);
|
2020-08-25 19:32:40 +03:00
|
|
|
default:
|
2023-09-01 18:06:18 +03:00
|
|
|
throw Exception('Unexpected wallet type: ${wallet.type}');
|
2021-07-20 18:03:49 +03:00
|
|
|
}
|
2020-09-21 14:50:26 +03:00
|
|
|
}
|
2020-10-07 08:58:22 +03:00
|
|
|
|
2023-08-04 14:49:26 +01:00
|
|
|
bool _isEqualCurrency(String currency) =>
|
2023-09-01 18:06:18 +03:00
|
|
|
wallet.balance.keys.any((e) => currency.toLowerCase() == e.title.toLowerCase());
|
2022-11-25 22:51:07 +02:00
|
|
|
|
2023-08-04 14:49:26 +01:00
|
|
|
void onClose() => _settingsStore.fiatCurrency = fiatFromSettings;
|
2022-12-12 15:41:16 +02:00
|
|
|
|
2022-11-25 22:51:07 +02:00
|
|
|
@action
|
2023-09-01 18:06:18 +03:00
|
|
|
void setFiatCurrency(FiatCurrency fiat) => _settingsStore.fiatCurrency = fiat;
|
2023-08-04 20:01:49 +03:00
|
|
|
|
|
|
|
@action
|
|
|
|
void setSelectedCryptoCurrency(String cryptoCurrency) {
|
|
|
|
try {
|
2023-09-01 18:06:18 +03:00
|
|
|
selectedCryptoCurrency = wallet.balance.keys
|
2023-08-04 20:01:49 +03:00
|
|
|
.firstWhere((e) => cryptoCurrency.toLowerCase() == e.title.toLowerCase());
|
|
|
|
} catch (e) {
|
2023-09-01 18:06:18 +03:00
|
|
|
selectedCryptoCurrency = wallet.currency;
|
2023-08-04 20:01:49 +03:00
|
|
|
}
|
|
|
|
}
|
2023-09-25 15:20:11 +03:00
|
|
|
|
2024-03-29 15:51:34 -03:00
|
|
|
ContactRecord? newContactAddress() {
|
2024-03-20 00:44:00 +02:00
|
|
|
final Set<String> contactAddresses =
|
2024-03-29 15:51:34 -03:00
|
|
|
Set.from(contactListViewModel.contacts.map((contact) => contact.address))
|
|
|
|
..addAll(contactListViewModel.walletContacts.map((contact) => contact.address));
|
2024-03-20 00:44:00 +02:00
|
|
|
|
|
|
|
for (var output in outputs) {
|
|
|
|
String address;
|
|
|
|
if (output.isParsedAddress) {
|
|
|
|
address = output.parsedAddress.addresses.first;
|
|
|
|
} else {
|
|
|
|
address = output.address;
|
|
|
|
}
|
|
|
|
|
2024-04-12 16:01:21 +02:00
|
|
|
if (address.isNotEmpty &&
|
|
|
|
!contactAddresses.contains(address) &&
|
|
|
|
selectedCryptoCurrency.raw != -1) {
|
2024-03-20 00:44:00 +02:00
|
|
|
return ContactRecord(
|
|
|
|
contactListViewModel.contactSource,
|
|
|
|
Contact(
|
|
|
|
name: '',
|
|
|
|
address: address,
|
|
|
|
type: selectedCryptoCurrency,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-10-09 18:18:59 +03:00
|
|
|
String translateErrorMessage(
|
2024-03-29 15:51:34 -03:00
|
|
|
Object error,
|
2023-10-09 18:18:59 +03:00
|
|
|
WalletType walletType,
|
|
|
|
CryptoCurrency currency,
|
|
|
|
) {
|
2024-03-29 15:51:34 -03:00
|
|
|
String errorMessage = error.toString();
|
|
|
|
|
2024-08-10 00:02:47 +01:00
|
|
|
if (walletType == WalletType.solana) {
|
2024-08-16 23:21:03 +01:00
|
|
|
if (errorMessage.contains('insufficient lamports')) {
|
|
|
|
double solValueNeeded = 0.0;
|
|
|
|
|
|
|
|
// Regular expression to match the number after "need". This shows the exact lamports the user needs to perform the transaction.
|
|
|
|
RegExp regExp = RegExp(r'need (\d+)');
|
|
|
|
|
|
|
|
// Find the match
|
|
|
|
Match? match = regExp.firstMatch(errorMessage);
|
|
|
|
|
|
|
|
if (match != null) {
|
|
|
|
String neededAmount = match.group(1)!;
|
|
|
|
final lamportsNeeded = int.tryParse(neededAmount);
|
|
|
|
|
|
|
|
// 5000 lamport used here is the constant for sending a transaction on solana
|
|
|
|
int lamportsPerSol = 1000000000;
|
|
|
|
|
|
|
|
solValueNeeded =
|
|
|
|
lamportsNeeded != null ? ((lamportsNeeded + 5000) / lamportsPerSol) : 0.0;
|
|
|
|
return S.current.insufficient_lamports(solValueNeeded.toString());
|
|
|
|
} else {
|
|
|
|
return S.current.insufficient_lamport_for_tx;
|
|
|
|
}
|
|
|
|
}
|
2024-12-14 00:31:10 +01:00
|
|
|
|
2024-12-19 18:41:59 +01:00
|
|
|
if (error is SignNativeTokenTransactionRentException) {
|
2024-12-14 00:31:10 +01:00
|
|
|
return S.current.solana_sign_native_transaction_rent_exception;
|
|
|
|
}
|
|
|
|
|
2024-12-19 18:41:59 +01:00
|
|
|
if (error is CreateAssociatedTokenAccountException) {
|
2024-12-27 00:42:36 +02:00
|
|
|
return "${S.current.solana_create_associated_token_account_exception}\n\n${error.errorMessage}";
|
2024-12-14 00:31:10 +01:00
|
|
|
}
|
|
|
|
|
2024-12-19 18:41:59 +01:00
|
|
|
if (error is SignSPLTokenTransactionRentException) {
|
2024-12-14 00:31:10 +01:00
|
|
|
return S.current.solana_sign_spl_token_transaction_rent_exception;
|
|
|
|
}
|
|
|
|
|
2024-12-19 18:41:59 +01:00
|
|
|
if (error is NoAssociatedTokenAccountException) {
|
2024-12-14 00:31:10 +01:00
|
|
|
return S.current.solana_no_associated_token_account_exception;
|
|
|
|
}
|
|
|
|
|
2024-08-10 00:02:47 +01:00
|
|
|
if (errorMessage.contains('insufficient funds for rent')) {
|
|
|
|
return S.current.insufficientFundsForRentError;
|
|
|
|
}
|
|
|
|
|
|
|
|
return errorMessage;
|
|
|
|
}
|
2023-12-02 03:26:43 +01:00
|
|
|
if (walletType == WalletType.ethereum ||
|
|
|
|
walletType == WalletType.polygon ||
|
|
|
|
walletType == WalletType.haven) {
|
2024-12-11 15:45:15 +01:00
|
|
|
if (errorMessage.contains('gas required exceeds allowance')) {
|
|
|
|
return S.current.gas_exceeds_allowance;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (errorMessage.contains('insufficient funds')) {
|
|
|
|
final parsedErrorMessageResult =
|
|
|
|
EVMTransactionErrorFeesHandler.parseEthereumFeesErrorMessage(
|
|
|
|
errorMessage,
|
|
|
|
_fiatConversationStore.prices[currency]!,
|
|
|
|
);
|
|
|
|
|
|
|
|
if (parsedErrorMessageResult.error != null) {
|
|
|
|
return S.current.insufficient_funds_for_tx;
|
|
|
|
}
|
|
|
|
|
2025-03-03 17:38:00 -08:00
|
|
|
return '''${S.current.insufficient_funds_for_tx} \n\n'''
|
|
|
|
'''${S.current.balance}: ${parsedErrorMessageResult.balanceEth} ${walletType == WalletType.polygon ? "POL" : "ETH"} (${parsedErrorMessageResult.balanceUsd} ${fiatFromSettings.name})\n\n'''
|
|
|
|
'''${S.current.transaction_cost}: ${parsedErrorMessageResult.txCostEth} ${walletType == WalletType.polygon ? "POL" : "ETH"} (${parsedErrorMessageResult.txCostUsd} ${fiatFromSettings.name})\n\n'''
|
|
|
|
'''${S.current.overshot}: ${parsedErrorMessageResult.overshotEth} ${walletType == WalletType.polygon ? "POL" : "ETH"} (${parsedErrorMessageResult.overshotUsd} ${fiatFromSettings.name})''';
|
2023-09-25 15:20:11 +03:00
|
|
|
}
|
2023-12-02 03:26:43 +01:00
|
|
|
|
2024-03-29 15:51:34 -03:00
|
|
|
return errorMessage;
|
|
|
|
}
|
|
|
|
|
2024-05-06 20:11:18 +01:00
|
|
|
if (walletType == WalletType.tron) {
|
|
|
|
if (errorMessage.contains('balance is not sufficient')) {
|
|
|
|
return S.current.do_not_have_enough_gas_asset(currency.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (errorMessage.contains('Transaction expired')) {
|
2024-05-10 21:34:28 +03:00
|
|
|
return 'An error occurred while processing the transaction. Please retry the transaction';
|
2024-05-06 20:11:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-03-21 04:18:47 +02:00
|
|
|
if (error is TransactionWrongBalanceException) {
|
|
|
|
if (error.amount != null)
|
|
|
|
return S.current
|
|
|
|
.tx_wrong_balance_with_amount_exception(currency.toString(), error.amount.toString());
|
Cw 453 (#1306)
* feat: rebase btc-addr-types, migrate to bitcoin_base
* feat: allow scanning elect-rs using get_tweaks
* feat: scanning and adding addresses working with getTweaks, add btc SP address type
* chore: pubspec.lock
* chore: pubspec.lock
* fix: scan when switching, fix multiple unspents in same tx
* fix: initial scan
* fix: initial scan
* fix: scanning issues
* fix: sync, storing silent unspents
* chore: deps
* fix: label issues, clear spent utxo
* chore: deps
* fix: build
* fix: missing types
* feat: new electrs API & changes, fixes for last block scanning
* feat: Scan Silent Payments homepage toggle
* chore: build configure
* feat: generic fixes, testnet UI improvements, useSSL on bitcoin nodes
* fix: invalid Object in sendData
* feat: improve addresses page & address book displays
* feat: silent payments labeled addresses disclaimer
* fix: missing i18n
* chore: print
* feat: single block scan, rescan by date working for btc mainnet
* feat: new cake features page replace market page, move sp scan toggle, auto switch node pop up alert
* feat: delete silent addresses
* fix: red dot in non ssl nodes
* fix: inconsistent connection states, fix tx history
* fix: tx & balance displays, cpfp sending
* feat: new rust lib
* chore: node path
* fix: check node based on network
* fix: missing txcount from addresses
* style: padding in feature page cards
* fix: restore not getting all wallet addresses by type
* fix: auto switch node broken
* fix: silent payment txs not being restored
* feat: change scanning to subscription model, sync improvements
* fix: scan re-subscription
* fix: default nodes
* fix: improve scanning by date, fix single block scan
* refactor: common function for input tx selection
* fix: nodes & build
* fix: send all with multiple outs
* refactor: unchanged file
* Update pr_test_build.yml
* chore: upgrade
* chore: merge changes
* refactor: unchanged files [skip ci]
* fix: scan fixes, add date, allow sending while scanning
* feat: sync fixes, sp settings
* feat: fix resyncing
* fix: date from height logic, status disconnected & chain tip get
* fix: params
* feat: electrum migration if using cake electrum
* fix nodes
update versions
* re-enable tron
* update sp_scanner to work on iOS [skip ci]
* fix: wrong socket for old electrum nodes
* Fix unchecked wallet type call
* fix: double balance
* feat: node domain
* fix: menu name
* fix: update tip on set scanning
* fix: connection switching back and forth
* feat: check if node is electrs, and supports sp
* chore: fix build
* minor enhancements
* fixes and enhancements
* solve conflicts with main
* fix: status toggle
* minor enhancement
* Monero.com fixes
* update sp_scanner to include windows and linux
---------
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-05-29 11:43:48 -03:00
|
|
|
|
2025-03-21 04:18:47 +02:00
|
|
|
return S.current.tx_wrong_balance_exception(currency.toString());
|
|
|
|
}
|
|
|
|
if (error is TransactionNoInputsException) {
|
|
|
|
return S.current.tx_not_enough_inputs_exception;
|
|
|
|
}
|
|
|
|
if (error is TransactionNoFeeException) {
|
|
|
|
return S.current.tx_zero_fee_exception;
|
|
|
|
}
|
|
|
|
if (error is TransactionNoDustException) {
|
|
|
|
return S.current.tx_no_dust_exception;
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailed) {
|
|
|
|
if (error.errorMessage != null && error.errorMessage!.contains("no peers replied")) {
|
|
|
|
return S.current.tx_commit_failed_no_peers;
|
Cw 453 (#1306)
* feat: rebase btc-addr-types, migrate to bitcoin_base
* feat: allow scanning elect-rs using get_tweaks
* feat: scanning and adding addresses working with getTweaks, add btc SP address type
* chore: pubspec.lock
* chore: pubspec.lock
* fix: scan when switching, fix multiple unspents in same tx
* fix: initial scan
* fix: initial scan
* fix: scanning issues
* fix: sync, storing silent unspents
* chore: deps
* fix: label issues, clear spent utxo
* chore: deps
* fix: build
* fix: missing types
* feat: new electrs API & changes, fixes for last block scanning
* feat: Scan Silent Payments homepage toggle
* chore: build configure
* feat: generic fixes, testnet UI improvements, useSSL on bitcoin nodes
* fix: invalid Object in sendData
* feat: improve addresses page & address book displays
* feat: silent payments labeled addresses disclaimer
* fix: missing i18n
* chore: print
* feat: single block scan, rescan by date working for btc mainnet
* feat: new cake features page replace market page, move sp scan toggle, auto switch node pop up alert
* feat: delete silent addresses
* fix: red dot in non ssl nodes
* fix: inconsistent connection states, fix tx history
* fix: tx & balance displays, cpfp sending
* feat: new rust lib
* chore: node path
* fix: check node based on network
* fix: missing txcount from addresses
* style: padding in feature page cards
* fix: restore not getting all wallet addresses by type
* fix: auto switch node broken
* fix: silent payment txs not being restored
* feat: change scanning to subscription model, sync improvements
* fix: scan re-subscription
* fix: default nodes
* fix: improve scanning by date, fix single block scan
* refactor: common function for input tx selection
* fix: nodes & build
* fix: send all with multiple outs
* refactor: unchanged file
* Update pr_test_build.yml
* chore: upgrade
* chore: merge changes
* refactor: unchanged files [skip ci]
* fix: scan fixes, add date, allow sending while scanning
* feat: sync fixes, sp settings
* feat: fix resyncing
* fix: date from height logic, status disconnected & chain tip get
* fix: params
* feat: electrum migration if using cake electrum
* fix nodes
update versions
* re-enable tron
* update sp_scanner to work on iOS [skip ci]
* fix: wrong socket for old electrum nodes
* Fix unchecked wallet type call
* fix: double balance
* feat: node domain
* fix: menu name
* fix: update tip on set scanning
* fix: connection switching back and forth
* feat: check if node is electrs, and supports sp
* chore: fix build
* minor enhancements
* fixes and enhancements
* solve conflicts with main
* fix: status toggle
* minor enhancement
* Monero.com fixes
* update sp_scanner to include windows and linux
---------
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-05-29 11:43:48 -03:00
|
|
|
}
|
2025-03-21 04:18:47 +02:00
|
|
|
return "${S.current.tx_commit_failed}${error.errorMessage != null ? "\n\n${error.errorMessage}" : ""}";
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailedDustChange) {
|
|
|
|
return S.current.tx_rejected_dust_change;
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailedDustOutput) {
|
|
|
|
return S.current.tx_rejected_dust_output;
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailedDustOutputSendAll) {
|
|
|
|
return S.current.tx_rejected_dust_output_send_all;
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailedVoutNegative) {
|
|
|
|
return S.current.tx_rejected_vout_negative;
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailedBIP68Final) {
|
|
|
|
return S.current.tx_rejected_bip68_final;
|
|
|
|
}
|
|
|
|
if (error is TransactionCommitFailedLessThanMin) {
|
|
|
|
return S.current.fee_less_than_min;
|
|
|
|
}
|
|
|
|
if (error is TransactionNoDustOnChangeException) {
|
|
|
|
return S.current.tx_commit_exception_no_dust_on_change(error.min, error.max);
|
|
|
|
}
|
|
|
|
if (error is TransactionInputNotSupported) {
|
|
|
|
return S.current.tx_invalid_input;
|
2023-09-25 15:20:11 +03:00
|
|
|
}
|
|
|
|
|
2024-03-29 15:51:34 -03:00
|
|
|
return errorMessage;
|
2023-09-25 15:20:11 +03:00
|
|
|
}
|
2024-04-01 15:31:14 +02:00
|
|
|
|
|
|
|
bool _hasTaprootInput(PendingTransaction? pendingTransaction) {
|
|
|
|
if (walletType == WalletType.bitcoin && pendingTransaction != null) {
|
|
|
|
return bitcoin!.hasTaprootInput(pendingTransaction);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2025-03-03 17:38:00 -08:00
|
|
|
}
|