diff --git a/.github/workflows/cache_dependencies.yml b/.github/workflows/cache_dependencies.yml
index bf0d0f7bc..4654ac033 100644
--- a/.github/workflows/cache_dependencies.yml
+++ b/.github/workflows/cache_dependencies.yml
@@ -46,6 +46,7 @@ jobs:
/opt/android/cake_wallet/cw_monero/android/.cxx
/opt/android/cake_wallet/cw_monero/ios/External
/opt/android/cake_wallet/cw_shared_external/ios/External
+ /opt/android/cake_wallet/scripts/monero_c/release
key: ${{ hashFiles('**/build_monero.sh', '**/build_haven.sh', '**/monero_api.cpp') }}
- if: ${{ steps.cache-externals.outputs.cache-hit != 'true' }}
diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml
index 5c8ea82a7..99a45287f 100644
--- a/.github/workflows/pr_test_build.yml
+++ b/.github/workflows/pr_test_build.yml
@@ -27,18 +27,25 @@ jobs:
if: github.event_name != 'pull_request'
run: echo "BRANCH_NAME=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
- - name: Free Up GitHub Actions Ubuntu Runner Disk Space
- run: |
- sudo rm -rf /usr/share/dotnet
- sudo rm -rf /opt/ghc
- sudo rm -rf "/usr/local/share/boost"
- sudo rm -rf "$AGENT_TOOLSDIRECTORY"
+ - name: Free Disk Space (Ubuntu)
+ uses: insightsengineering/disk-space-reclaimer@v1
+ with:
+ tools-cache: true
+ android: false
+ dotnet: true
+ haskell: true
+ large-packages: true
+ swap-storage: true
+ docker-images: true
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "11.x"
-
+ - name: Configure placeholder git details
+ run: |
+ git config --global user.email "CI@cakewallet.com"
+ git config --global user.name "Cake Github Actions"
- name: Flutter action
uses: subosito/flutter-action@v1
with:
@@ -72,7 +79,8 @@ jobs:
/opt/android/cake_wallet/cw_monero/android/.cxx
/opt/android/cake_wallet/cw_monero/ios/External
/opt/android/cake_wallet/cw_shared_external/ios/External
- key: ${{ hashFiles('**/build_monero.sh', '**/build_haven.sh', '**/monero_api.cpp') }}
+ /opt/android/cake_wallet/scripts/monero_c/release
+ key: ${{ hashFiles('**/prepare_moneroc.sh' ,'**/build_monero_all.sh', '**/build_haven.sh', '**/monero_api.cpp') }}
- if: ${{ steps.cache-externals.outputs.cache-hit != 'true' }}
name: Generate Externals
diff --git a/.gitignore b/.gitignore
index d0952ca98..77441e66f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -136,6 +136,7 @@ lib/nano/nano.dart
lib/polygon/polygon.dart
lib/solana/solana.dart
lib/tron/tron.dart
+lib/wownero/wownero.dart
ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_180.png
ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_120.png
@@ -156,6 +157,7 @@ assets/images/app_logo.png
macos/Runner/Info.plist
macos/Runner/DebugProfile.entitlements
macos/Runner/Release.entitlements
+macos/Runner/Runner.entitlements
lib/core/secure_storage.dart
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
@@ -166,3 +168,9 @@ macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
macos/Runner/Configs/AppInfo.xcconfig
+
+# Monero.dart (Monero_C)
+scripts/monero_c
+# iOS generated framework bin
+ios/MoneroWallet.framework/MoneroWallet
+ios/WowneroWallet.framework/WowneroWallet
diff --git a/.metadata b/.metadata
index cdddb9350..7d00ca21a 100644
--- a/.metadata
+++ b/.metadata
@@ -1,11 +1,11 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
-# This file should be version controlled.
+# This file should be version controlled and should not be manually edited.
version:
- revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- channel: stable
+ revision: "367f9ea16bfae1ca451b9cc27c1366870b187ae2"
+ channel: "stable"
project_type: app
@@ -13,11 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
- create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- - platform: macos
- create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
+ create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
+ base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
+ - platform: windows
+ create_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
+ base_revision: 367f9ea16bfae1ca451b9cc27c1366870b187ae2
# User provided section
diff --git a/android/app/src/main/AndroidManifestBase.xml b/android/app/src/main/AndroidManifestBase.xml
index 57462099c..b03c8a925 100644
--- a/android/app/src/main/AndroidManifestBase.xml
+++ b/android/app/src/main/AndroidManifestBase.xml
@@ -38,7 +38,8 @@
android:fullBackupContent="false"
android:versionCode="__versionCode__"
android:versionName="__versionName__"
- android:requestLegacyExternalStorage="true">
+ android:requestLegacyExternalStorage="true"
+ android:extractNativeLibs="true">
+
+
+
diff --git a/cw_monero/ios/Assets/.gitkeep b/android/app/src/main/jniLibs/arm64-v8a/.gitkeep
similarity index 100%
rename from cw_monero/ios/Assets/.gitkeep
rename to android/app/src/main/jniLibs/arm64-v8a/.gitkeep
diff --git a/android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so b/android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so
new file mode 120000
index 000000000..6cdcd70a2
--- /dev/null
+++ b/android/app/src/main/jniLibs/arm64-v8a/libmonero_libwallet2_api_c.so
@@ -0,0 +1 @@
+../../../../../../scripts/monero_c/release/monero/aarch64-linux-android_libwallet2_api_c.so
\ No newline at end of file
diff --git a/android/app/src/main/jniLibs/arm64-v8a/libwownero_libwallet2_api_c.so b/android/app/src/main/jniLibs/arm64-v8a/libwownero_libwallet2_api_c.so
new file mode 120000
index 000000000..8f6150ee3
--- /dev/null
+++ b/android/app/src/main/jniLibs/arm64-v8a/libwownero_libwallet2_api_c.so
@@ -0,0 +1 @@
+../../../../../../scripts/monero_c/release/wownero/aarch64-linux-android_libwallet2_api_c.so
\ No newline at end of file
diff --git a/android/app/src/main/jniLibs/armeabi-v7a/.gitkeep b/android/app/src/main/jniLibs/armeabi-v7a/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so b/android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so
new file mode 120000
index 000000000..c0d56dd3b
--- /dev/null
+++ b/android/app/src/main/jniLibs/armeabi-v7a/libmonero_libwallet2_api_c.so
@@ -0,0 +1 @@
+../../../../../../scripts/monero_c/release/monero/armv7a-linux-androideabi_libwallet2_api_c.so
\ No newline at end of file
diff --git a/android/app/src/main/jniLibs/armeabi-v7a/libwownero_libwallet2_api_c.so b/android/app/src/main/jniLibs/armeabi-v7a/libwownero_libwallet2_api_c.so
new file mode 120000
index 000000000..5a71e87b1
--- /dev/null
+++ b/android/app/src/main/jniLibs/armeabi-v7a/libwownero_libwallet2_api_c.so
@@ -0,0 +1 @@
+../../../../../../scripts/monero_c/release/wownero/armv7a-linux-androideabi_libwallet2_api_c.so
\ No newline at end of file
diff --git a/android/app/src/main/jniLibs/x86/.gitkeep b/android/app/src/main/jniLibs/x86/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/android/app/src/main/jniLibs/x86_64/.gitkeep b/android/app/src/main/jniLibs/x86_64/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so b/android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so
new file mode 120000
index 000000000..654be50b9
--- /dev/null
+++ b/android/app/src/main/jniLibs/x86_64/libmonero_libwallet2_api_c.so
@@ -0,0 +1 @@
+../../../../../../scripts/monero_c/release/monero/x86_64-linux-android_libwallet2_api_c.so
\ No newline at end of file
diff --git a/android/app/src/main/jniLibs/x86_64/libwownero_libwallet2_api_c.so b/android/app/src/main/jniLibs/x86_64/libwownero_libwallet2_api_c.so
new file mode 120000
index 000000000..bb3da908f
--- /dev/null
+++ b/android/app/src/main/jniLibs/x86_64/libwownero_libwallet2_api_c.so
@@ -0,0 +1 @@
+../../../../../../scripts/monero_c/release/wownero/x86_64-linux-android_libwallet2_api_c.so
\ No newline at end of file
diff --git a/assets/bitcoin_electrum_server_list.yml b/assets/bitcoin_electrum_server_list.yml
index 2b6649271..8b734a7bb 100644
--- a/assets/bitcoin_electrum_server_list.yml
+++ b/assets/bitcoin_electrum_server_list.yml
@@ -1,2 +1,8 @@
-
- uri: electrum.cakewallet.com:50002
\ No newline at end of file
+ uri: electrum.cakewallet.com:50002
+ useSSL: true
+-
+ uri: btc-electrum.cakewallet.com:50002
+ isDefault: true
+-
+ uri: electrs.cakewallet.com:50001
diff --git a/assets/images/wownero_icon.png b/assets/images/wownero_icon.png
new file mode 100644
index 000000000..a3da77b9e
Binary files /dev/null and b/assets/images/wownero_icon.png differ
diff --git a/assets/images/wownero_menu.png b/assets/images/wownero_menu.png
new file mode 100644
index 000000000..a3da77b9e
Binary files /dev/null and b/assets/images/wownero_menu.png differ
diff --git a/assets/text/Monerocom_Release_Notes.txt b/assets/text/Monerocom_Release_Notes.txt
index 34f805b90..551d775ef 100644
--- a/assets/text/Monerocom_Release_Notes.txt
+++ b/assets/text/Monerocom_Release_Notes.txt
@@ -1,2 +1,2 @@
-In-app Cake Pay is Back
-Bug fixes and generic enhancements
\ No newline at end of file
+Monero enhancements
+Bug fixes
\ No newline at end of file
diff --git a/assets/text/Release_Notes.txt b/assets/text/Release_Notes.txt
index dcaf59665..551d775ef 100644
--- a/assets/text/Release_Notes.txt
+++ b/assets/text/Release_Notes.txt
@@ -1,3 +1,2 @@
-In-app Cake Pay is Back
-Bitcoin nodes stability enhancements
-Bug fixes and generic enhancements
\ No newline at end of file
+Monero enhancements
+Bug fixes
\ No newline at end of file
diff --git a/assets/wownero_node_list.yml b/assets/wownero_node_list.yml
new file mode 100644
index 000000000..a4873b3e4
--- /dev/null
+++ b/assets/wownero_node_list.yml
@@ -0,0 +1,12 @@
+-
+ uri: node3.monerodevs.org:34568
+ is_default: true
+ useSSL: false
+-
+ uri: node2.monerodevs.org:34568
+ is_default: false
+ useSSL: false
+-
+ uri: node.monerodevs.org:34568
+ is_default: false
+ useSSL: false
diff --git a/build-guide-win.md b/build-guide-win.md
new file mode 100644
index 000000000..6ace961af
--- /dev/null
+++ b/build-guide-win.md
@@ -0,0 +1,38 @@
+# Building CakeWallet for Windows
+
+## Requirements and Setup
+
+The following are the system requirements to build CakeWallet for your Windows PC.
+
+```
+Windows 10 or later (64-bit), x86-64 based
+Flutter 3 or above
+```
+
+## Building CakeWallet on Windows
+
+These steps will help you configure and execute a build of CakeWallet from its source code.
+
+### 1. Installing Package Dependencies
+
+For build CakeWallet windows application from sources you will be needed to have:
+> [Install Flutter]Follow installation guide (https://docs.flutter.dev/get-started/install/windows) and install do not miss to dev tools (install https://docs.flutter.dev/get-started/install/windows/desktop#development-tools) which are required for windows desktop development (need to install Git for Windows and Visual Studio 2022). Then install `Desktop development with C++` packages via GUI Visual Studio 2022, or Visual Studio Build Tools 2022 including: `C++ Build Tools core features`, `C++ 2022 Redistributable Update`, `C++ core desktop features`, `MVC v143 - VS 2022 C++ x64/x86 build tools`, `C++ CMake tools for Windwos`, `Testing tools core features - Build Tools`, `C++ AddressSanitizer`.
+> [Install WSL] for building monero dependencies need to install Windows WSL (https://learn.microsoft.com/en-us/windows/wsl/install) and required packages for WSL (Ubuntu):
+`$ sudo apt update `
+`$ sudo apt build-essential cmake gcc-mingw-w64 g++-mingw-w64 autoconf libtool pkg-config`
+
+### 2. Pull CakeWallet source code
+
+You can downlaod CakeWallet source code from our [GitHub repository](github.com/cake-tech/cake_wallet) via git by following next command:
+`$ git clone https://github.com/cake-tech/cake_wallet.git --branch MrCyjaneK-cyjan-monerodart`
+OR you can download it as [Zip archive](https://github.com/cake-tech/cake_wallet/archive/refs/heads/MrCyjaneK-cyjan-monerodart.zip)
+
+### 3. Build Monero, Monero_c and their dependencies
+
+For use monero in the application need to build Monero wrapper - Monero_C which will be used by monero.dart package. For that need to run shell (bash - typically same named utility should be available after WSL is enabled in your system) with previously installed WSL, then change current directory to the application project directory with your used shell and then change current directory to `scripts/windows`: `$ cd scripts/windows`. Run build script: `$ ./build_all.sh`.
+
+### 4. Configure and build CakeWallet application
+
+To configure the application open directory where you have downloaded or unarchived CakeWallet sources and run `cakewallet.bat`.
+Or if you used WSL and have active shell session you can run `$ ./cakewallet.sh` script in `scripts/windows` which will run `cakewallet.bat` in WSL.
+After execution of `cakewallet.bat` you should to get `Cake Wallet.zip` in project root directory which will contains `CakeWallet.exe` file and another needed files for run the application. Now you can extract files from `Cake Wallet.zip` archive and run the application.
diff --git a/cakewallet.bat b/cakewallet.bat
new file mode 100644
index 000000000..1904c5710
--- /dev/null
+++ b/cakewallet.bat
@@ -0,0 +1,51 @@
+@echo off
+set cw_win_app_config=--monero --bitcoin --ethereum --polygon --nano --bitcoinCash --solana --tron
+set cw_root=%cd%
+set cw_archive_name=Cake Wallet.zip
+set cw_archive_path=%cw_root%\%cw_archive_name%
+set secrets_file_path=lib\.secrets.g.dart
+set release_dir=build\windows\x64\runner\Release
+@REM Path could be different
+if [%~1]==[] (set tools_root=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.38.33135\x64\Microsoft.VC143.CRT) else (set tools_root=%1)
+@REM Generate android manifest file
+cd scripts
+bash.exe gen_android_manifest.sh
+cd /d %cw_root%
+echo === Generating pubspec.yaml ===
+copy /Y pubspec_description.yaml pubspec.yaml > nul
+call flutter pub get > nul
+call dart run tool\generate_pubspec.dart
+call flutter pub get > nul
+call dart run tool\configure.dart %cw_win_app_config%
+
+IF NOT EXIST "%secrets_file_path%" (
+ echo === Generating new secrets file ===
+ call dart run tool\generate_new_secrets.dart
+) ELSE (echo === Using previously/already generated secrets file: %secrets_file_path% ===)
+
+echo === Generating mobx models ===
+for /d %%i in (cw_core cw_monero cw_bitcoin cw_ethereum cw_evm cw_polygon cw_nano cw_bitcoin_cash cw_solana cw_tron .) do (
+ cd %%i
+ call flutter pub get > nul
+ call dart run build_runner build --delete-conflicting-outputs > nul
+ cd /d %cw_root%
+)
+
+echo === Generating localization files ===
+call dart run tool\generate_localization.dart
+
+echo === Building the application executable file ===
+call flutter build windows --dart-define-from-file=env.json --release
+
+echo === Prepare distribution actions. Copy needed files to the application bundle ===
+copy /Y "%tools_root%\msvcp140.dll" "%release_dir%\" > nul
+copy /Y "%tools_root%\vcruntime140.dll" "%release_dir%\" > nul
+copy /Y "%tools_root%\vcruntime140_1.dll" "%release_dir%\" > nul
+
+echo === Generate the application archive ===
+xcopy /s /e /v /Y "%release_dir%\*.*" "build\Cake Wallet\" > nul
+tar acf "%cw_archive_name%" -C build\ "Cake Wallet"
+
+echo === Open Explorer with the application archive ===
+echo Cake Wallet created archive at: %cw_archive_path%
+%SystemRoot%\explorer.exe /select, %cw_archive_path%
diff --git a/configure_cake_wallet.sh b/configure_cake_wallet.sh
index 837a002e9..0539221a3 100755
--- a/configure_cake_wallet.sh
+++ b/configure_cake_wallet.sh
@@ -1,11 +1,14 @@
+#!/bin/bash
+
IOS="ios"
ANDROID="android"
+MACOS="macos"
-PLATFORMS=($IOS $ANDROID)
+PLATFORMS=($IOS $ANDROID $MACOS)
PLATFORM=$1
if ! [[ " ${PLATFORMS[*]} " =~ " ${PLATFORM} " ]]; then
- echo "specify platform: ./configure_cake_wallet.sh ios|android"
+ echo "specify platform: ./configure_cake_wallet.sh ios|android|macos"
exit 1
fi
@@ -14,6 +17,11 @@ if [ "$PLATFORM" == "$IOS" ]; then
cd scripts/ios
fi
+if [ "$PLATFORM" == "$MACOS" ]; then
+ echo "Configuring for macOS"
+ cd scripts/macos
+fi
+
if [ "$PLATFORM" == "$ANDROID" ]; then
echo "Configuring for Android"
cd scripts/android
@@ -22,5 +30,6 @@ fi
source ./app_env.sh cakewallet
./app_config.sh
cd ../.. && flutter pub get
-flutter packages pub run tool/generate_localization.dart
+#flutter packages pub run tool/generate_localization.dart
./model_generator.sh
+#cd macos && pod install
\ No newline at end of file
diff --git a/cw_core/lib/amount_converter.dart b/cw_core/lib/amount_converter.dart
index 249b87bd3..1c5456b07 100644
--- a/cw_core/lib/amount_converter.dart
+++ b/cw_core/lib/amount_converter.dart
@@ -4,10 +4,8 @@ import 'package:cw_core/crypto_currency.dart';
class AmountConverter {
static const _moneroAmountLength = 12;
static const _moneroAmountDivider = 1000000000000;
- static const _litecoinAmountDivider = 100000000;
- static const _ethereumAmountDivider = 1000000000000000000;
- static const _dashAmountDivider = 100000000;
- static const _bitcoinCashAmountDivider = 100000000;
+ static const _wowneroAmountLength = 11;
+ static const _wowneroAmountDivider = 100000000000;
static const _bitcoinAmountDivider = 100000000;
static const _bitcoinAmountLength = 8;
static final _bitcoinAmountFormat = NumberFormat()
@@ -16,69 +14,16 @@ class AmountConverter {
static final _moneroAmountFormat = NumberFormat()
..maximumFractionDigits = _moneroAmountLength
..minimumFractionDigits = 1;
-
- static double amountIntToDouble(CryptoCurrency cryptoCurrency, int amount) {
- switch (cryptoCurrency) {
- case CryptoCurrency.xmr:
- return _moneroAmountToDouble(amount);
- case CryptoCurrency.btc:
- return _bitcoinAmountToDouble(amount);
- case CryptoCurrency.bch:
- return _bitcoinCashAmountToDouble(amount);
- case CryptoCurrency.dash:
- return _dashAmountToDouble(amount);
- case CryptoCurrency.eth:
- return _ethereumAmountToDouble(amount);
- case CryptoCurrency.ltc:
- return _litecoinAmountToDouble(amount);
- case CryptoCurrency.xhv:
- case CryptoCurrency.xag:
- case CryptoCurrency.xau:
- case CryptoCurrency.xaud:
- case CryptoCurrency.xbtc:
- case CryptoCurrency.xcad:
- case CryptoCurrency.xchf:
- case CryptoCurrency.xcny:
- case CryptoCurrency.xeur:
- case CryptoCurrency.xgbp:
- case CryptoCurrency.xjpy:
- case CryptoCurrency.xnok:
- case CryptoCurrency.xnzd:
- case CryptoCurrency.xusd:
- return _moneroAmountToDouble(amount);
- default:
- return 0.0;
- }
- }
-
- static int amountStringToInt(CryptoCurrency cryptoCurrency, String amount) {
- switch (cryptoCurrency) {
- case CryptoCurrency.xmr:
- return _moneroParseAmount(amount);
- case CryptoCurrency.xhv:
- case CryptoCurrency.xag:
- case CryptoCurrency.xau:
- case CryptoCurrency.xaud:
- case CryptoCurrency.xbtc:
- case CryptoCurrency.xcad:
- case CryptoCurrency.xchf:
- case CryptoCurrency.xcny:
- case CryptoCurrency.xeur:
- case CryptoCurrency.xgbp:
- case CryptoCurrency.xjpy:
- case CryptoCurrency.xnok:
- case CryptoCurrency.xnzd:
- case CryptoCurrency.xusd:
- return _moneroParseAmount(amount);
- default:
- return 0;
- }
- }
+ static final _wowneroAmountFormat = NumberFormat()
+ ..maximumFractionDigits = _wowneroAmountLength
+ ..minimumFractionDigits = 1;
static String amountIntToString(CryptoCurrency cryptoCurrency, int amount) {
switch (cryptoCurrency) {
case CryptoCurrency.xmr:
return _moneroAmountToString(amount);
+ case CryptoCurrency.wow:
+ return _wowneroAmountToString(amount);
case CryptoCurrency.btc:
case CryptoCurrency.bch:
case CryptoCurrency.ltc:
@@ -106,34 +51,12 @@ class AmountConverter {
static double cryptoAmountToDouble({required num amount, required num divider}) =>
amount / divider;
- static String _moneroAmountToString(int amount) => _moneroAmountFormat.format(
- cryptoAmountToDouble(amount: amount, divider: _moneroAmountDivider));
+ static String _moneroAmountToString(int amount) => _moneroAmountFormat
+ .format(cryptoAmountToDouble(amount: amount, divider: _moneroAmountDivider));
- static double _moneroAmountToDouble(int amount) =>
- cryptoAmountToDouble(amount: amount, divider: _moneroAmountDivider);
+ static String _bitcoinAmountToString(int amount) => _bitcoinAmountFormat
+ .format(cryptoAmountToDouble(amount: amount, divider: _bitcoinAmountDivider));
- static int _moneroParseAmount(String amount) =>
- _moneroAmountFormat.parse(amount).toInt();
-
- static String _bitcoinAmountToString(int amount) =>
- _bitcoinAmountFormat.format(
- cryptoAmountToDouble(amount: amount, divider: _bitcoinAmountDivider));
-
- static double _bitcoinAmountToDouble(int amount) =>
- cryptoAmountToDouble(amount: amount, divider: _bitcoinAmountDivider);
-
- static int _doubleToBitcoinAmount(double amount) =>
- (amount * _bitcoinAmountDivider).toInt();
-
- static double _bitcoinCashAmountToDouble(int amount) =>
- cryptoAmountToDouble(amount: amount, divider: _bitcoinCashAmountDivider);
-
- static double _dashAmountToDouble(int amount) =>
- cryptoAmountToDouble(amount: amount, divider: _dashAmountDivider);
-
- static double _ethereumAmountToDouble(num amount) =>
- cryptoAmountToDouble(amount: amount, divider: _ethereumAmountDivider);
-
- static double _litecoinAmountToDouble(int amount) =>
- cryptoAmountToDouble(amount: amount, divider: _litecoinAmountDivider);
+ static String _wowneroAmountToString(int amount) => _wowneroAmountFormat
+ .format(cryptoAmountToDouble(amount: amount, divider: _wowneroAmountDivider));
}
diff --git a/cw_core/lib/crypto_currency.dart b/cw_core/lib/crypto_currency.dart
index 2bd4eaf91..6881393ed 100644
--- a/cw_core/lib/crypto_currency.dart
+++ b/cw_core/lib/crypto_currency.dart
@@ -105,6 +105,7 @@ class CryptoCurrency extends EnumerableItem with Serializable implemen
CryptoCurrency.usdtSol,
CryptoCurrency.usdcTrc20,
CryptoCurrency.tbtc,
+ CryptoCurrency.wow,
];
static const havenCurrencies = [
@@ -221,6 +222,7 @@ class CryptoCurrency extends EnumerableItem with Serializable implemen
static const usdtSol = CryptoCurrency(title: 'USDT', tag: 'SOL', fullName: 'USDT Tether', raw: 91, name: 'usdtsol', iconPath: 'assets/images/usdt_icon.png', decimals: 6);
static const usdcTrc20 = CryptoCurrency(title: 'USDC', tag: 'TRX', fullName: 'USDC Coin', raw: 92, name: 'usdctrc20', iconPath: 'assets/images/usdc_icon.png', decimals: 6);
static const tbtc = CryptoCurrency(title: 'tBTC', fullName: 'Testnet Bitcoin', raw: 93, name: 'tbtc', iconPath: 'assets/images/tbtc.png', decimals: 8);
+ static const wow = CryptoCurrency(title: 'WOW', fullName: 'Wownero', raw: 94, name: 'wow', iconPath: 'assets/images/wownero_icon.png', decimals: 11);
static final Map _rawCurrencyMap =
diff --git a/cw_core/lib/currency_for_wallet_type.dart b/cw_core/lib/currency_for_wallet_type.dart
index 8cf438769..630078949 100644
--- a/cw_core/lib/currency_for_wallet_type.dart
+++ b/cw_core/lib/currency_for_wallet_type.dart
@@ -28,7 +28,9 @@ CryptoCurrency currencyForWalletType(WalletType type, {bool? isTestnet}) {
return CryptoCurrency.sol;
case WalletType.tron:
return CryptoCurrency.trx;
- default:
+ case WalletType.wownero:
+ return CryptoCurrency.wow;
+ case WalletType.none:
throw Exception(
'Unexpected wallet type: ${type.toString()} for CryptoCurrency currencyForWalletType');
}
diff --git a/cw_core/lib/get_height_by_date.dart b/cw_core/lib/get_height_by_date.dart
index d62a78468..6f1b4078b 100644
--- a/cw_core/lib/get_height_by_date.dart
+++ b/cw_core/lib/get_height_by_date.dart
@@ -297,3 +297,81 @@ DateTime getDateByBitcoinHeight(int height) {
return estimatedDate;
}
+
+// TODO: enhance all of this global const lists
+const wowDates = {
+ "2023-12": 583048,
+ "2023-11": 575048,
+ "2023-10": 566048,
+ "2023-09": 558048,
+ "2023-08": 549048,
+ "2023-07": 540048,
+ "2023-06": 532048,
+ "2023-05": 523048,
+ "2023-04": 514048,
+ "2023-03": 505048,
+ "2023-02": 497048,
+ "2023-01": 488048,
+ "2022-12": 479048,
+ "2022-11": 471048,
+ "2022-10": 462048,
+ "2022-09": 453048,
+ "2022-08": 444048,
+ "2022-07": 435048,
+ "2022-06": 427048,
+ "2022-05": 418048,
+ "2022-04": 410048,
+ "2022-03": 401048,
+ "2022-02": 393048,
+ "2022-01": 384048,
+ "2021-12": 375048,
+ "2021-11": 367048,
+ "2021-10": 358048,
+ "2021-09": 349048,
+ "2021-08": 340048,
+ "2021-07": 331048,
+ "2021-06": 322048,
+ "2021-05": 313048,
+ "2021-04": 305048,
+ "2021-03": 295048,
+ "2021-02": 287048,
+ "2021-01": 279148,
+ "2020-10": 252000,
+ "2020-09": 243000,
+ "2020-08": 234000,
+ "2020-07": 225000,
+ "2020-06": 217500,
+ "2020-05": 208500,
+ "2020-04": 199500,
+ "2020-03": 190500,
+ "2020-02": 183000,
+ "2020-01": 174000,
+ "2019-12": 165000,
+ "2019-11": 156000,
+ "2019-10": 147000,
+ "2019-09": 138000,
+ "2019-08": 129000,
+ "2019-07": 120000,
+ "2019-06": 112500,
+ "2019-05": 103500,
+ "2019-04": 94500,
+ "2019-03": 85500,
+ "2019-02": 79500,
+ "2019-01": 73500,
+ "2018-12": 67500,
+ "2018-11": 61500,
+ "2018-10": 52500,
+ "2018-09": 45000,
+ "2018-08": 36000,
+ "2018-07": 27000,
+ "2018-06": 18000,
+ "2018-05": 9000,
+ "2018-04": 1
+};
+
+int getWowneroHeightByDate({required DateTime date}) {
+ String closestKey =
+ wowDates.keys.firstWhere((key) => formatMapKey(key).isBefore(date), orElse: () => '');
+
+ return wowDates[closestKey] ?? 0;
+}
\ No newline at end of file
diff --git a/cw_core/lib/node.dart b/cw_core/lib/node.dart
index 00b2c51f1..3bbbf38de 100644
--- a/cw_core/lib/node.dart
+++ b/cw_core/lib/node.dart
@@ -79,6 +79,7 @@ class Node extends HiveObject with Keyable {
switch (type) {
case WalletType.monero:
case WalletType.haven:
+ case WalletType.wownero:
return Uri.http(uriRaw, '');
case WalletType.bitcoin:
case WalletType.litecoin:
@@ -96,7 +97,7 @@ class Node extends HiveObject with Keyable {
case WalletType.solana:
case WalletType.tron:
return Uri.https(uriRaw, path ?? '');
- default:
+ case WalletType.none:
throw Exception('Unexpected type ${type.toString()} for Node uri');
}
}
@@ -143,6 +144,7 @@ class Node extends HiveObject with Keyable {
switch (type) {
case WalletType.monero:
case WalletType.haven:
+ case WalletType.wownero:
return requestMoneroNode();
case WalletType.nano:
case WalletType.banano:
@@ -155,7 +157,7 @@ class Node extends HiveObject with Keyable {
case WalletType.solana:
case WalletType.tron:
return requestElectrumServer();
- default:
+ case WalletType.none:
return false;
}
} catch (_) {
diff --git a/cw_core/lib/pathForWallet.dart b/cw_core/lib/pathForWallet.dart
index cfc33ef21..9aa721923 100644
--- a/cw_core/lib/pathForWallet.dart
+++ b/cw_core/lib/pathForWallet.dart
@@ -1,9 +1,10 @@
import 'dart:io';
+import 'package:cw_core/root_dir.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:path_provider/path_provider.dart';
Future pathForWalletDir({required String name, required WalletType type}) async {
- final root = await getApplicationDocumentsDirectory();
+ final root = await getAppDir();
final prefix = walletTypeToString(type).toLowerCase();
final walletsDir = Directory('${root.path}/wallets');
final walletDire = Directory('${walletsDir.path}/$prefix/$name');
@@ -20,8 +21,8 @@ Future pathForWallet({required String name, required WalletType type}) a
.then((path) => path + '/$name');
Future outdatedAndroidPathForWalletDir({required String name}) async {
- final directory = await getApplicationDocumentsDirectory();
+ final directory = await getAppDir();
final pathDir = directory.path + '/$name';
return pathDir;
-}
\ No newline at end of file
+}
diff --git a/cw_core/lib/root_dir.dart b/cw_core/lib/root_dir.dart
new file mode 100644
index 000000000..c2a8170bc
--- /dev/null
+++ b/cw_core/lib/root_dir.dart
@@ -0,0 +1,35 @@
+import 'dart:io';
+import 'package:path_provider/path_provider.dart';
+
+String? _rootDirPath;
+
+void setRootDirFromEnv() => _rootDirPath = Platform.environment['CAKE_WALLET_DIR'];
+
+Future getAppDir({String appName = 'cake_wallet'}) async {
+ Directory dir;
+
+ if (_rootDirPath != null && _rootDirPath!.isNotEmpty) {
+ dir = Directory.fromUri(Uri.file(_rootDirPath!));
+ dir.create(recursive: true);
+ } else {
+ if (Platform.isWindows) {
+ dir = await getApplicationSupportDirectory();
+ } else if (Platform.isLinux) {
+ String appDirPath;
+
+ try {
+ dir = await getApplicationDocumentsDirectory();
+ appDirPath = '${dir.path}/$appName';
+ } catch (e) {
+ appDirPath = '/home/${Platform.environment['USER']}/.$appName';
+ }
+
+ dir = Directory.fromUri(Uri.file(appDirPath));
+ await dir.create(recursive: true);
+ } else {
+ dir = await getApplicationDocumentsDirectory();
+ }
+ }
+
+ return dir;
+}
diff --git a/cw_core/lib/sec_random_native.dart b/cw_core/lib/sec_random_native.dart
index ce251efc0..2011602bf 100644
--- a/cw_core/lib/sec_random_native.dart
+++ b/cw_core/lib/sec_random_native.dart
@@ -1,3 +1,5 @@
+import 'dart:io';
+import 'dart:math';
import 'dart:typed_data';
import 'package:flutter/services.dart';
@@ -6,6 +8,12 @@ const utils = const MethodChannel('com.cake_wallet/native_utils');
Future secRandom(int count) async {
try {
+ if (Platform.isWindows || Platform.isLinux) {
+ // Used method to get securely generated random bytes from cake backups
+ const byteSize = 256;
+ final rng = Random.secure();
+ return Uint8List.fromList(List.generate(count, (_) => rng.nextInt(byteSize)));
+ }
return await utils.invokeMethod('sec_random', {'count': count}) ?? Uint8List.fromList([]);
} on PlatformException catch (_) {
return Uint8List.fromList([]);
diff --git a/cw_core/lib/wallet_type.dart b/cw_core/lib/wallet_type.dart
index b3e41a989..e3957b4e7 100644
--- a/cw_core/lib/wallet_type.dart
+++ b/cw_core/lib/wallet_type.dart
@@ -54,7 +54,10 @@ enum WalletType {
solana,
@HiveField(11)
- tron
+ tron,
+
+ @HiveField(12)
+ wownero,
}
int serializeToInt(WalletType type) {
@@ -81,7 +84,9 @@ int serializeToInt(WalletType type) {
return 9;
case WalletType.tron:
return 10;
- default:
+ case WalletType.wownero:
+ return 11;
+ case WalletType.none:
return -1;
}
}
@@ -110,6 +115,8 @@ WalletType deserializeFromInt(int raw) {
return WalletType.solana;
case 10:
return WalletType.tron;
+ case 11:
+ return WalletType.wownero;
default:
throw Exception('Unexpected token: $raw for WalletType deserializeFromInt');
}
@@ -139,7 +146,9 @@ String walletTypeToString(WalletType type) {
return 'Solana';
case WalletType.tron:
return 'Tron';
- default:
+ case WalletType.wownero:
+ return 'Wownero';
+ case WalletType.none:
return '';
}
}
@@ -168,7 +177,9 @@ String walletTypeToDisplayName(WalletType type) {
return 'Solana (SOL)';
case WalletType.tron:
return 'Tron (TRX)';
- default:
+ case WalletType.wownero:
+ return 'Wownero (WOW)';
+ case WalletType.none:
return '';
}
}
@@ -200,7 +211,9 @@ CryptoCurrency walletTypeToCryptoCurrency(WalletType type, {bool isTestnet = fal
return CryptoCurrency.sol;
case WalletType.tron:
return CryptoCurrency.trx;
- default:
+ case WalletType.wownero:
+ return CryptoCurrency.wow;
+ case WalletType.none:
throw Exception(
'Unexpected wallet type: ${type.toString()} for CryptoCurrency walletTypeToCryptoCurrency');
}
diff --git a/cw_core/lib/wownero_amount_format.dart b/cw_core/lib/wownero_amount_format.dart
new file mode 100644
index 000000000..96d2797e8
--- /dev/null
+++ b/cw_core/lib/wownero_amount_format.dart
@@ -0,0 +1,18 @@
+import 'package:intl/intl.dart';
+import 'package:cw_core/crypto_amount_format.dart';
+
+const wowneroAmountLength = 11;
+const wowneroAmountDivider = 100000000000;
+final wowneroAmountFormat = NumberFormat()
+ ..maximumFractionDigits = wowneroAmountLength
+ ..minimumFractionDigits = 1;
+
+String wowneroAmountToString({required int amount}) => wowneroAmountFormat
+ .format(cryptoAmountToDouble(amount: amount, divider: wowneroAmountDivider))
+ .replaceAll(',', '');
+
+double wowneroAmountToDouble({required int amount}) =>
+ cryptoAmountToDouble(amount: amount, divider: wowneroAmountDivider);
+
+int wowneroParseAmount({required String amount}) =>
+ (double.parse(amount) * wowneroAmountDivider).round();
\ No newline at end of file
diff --git a/cw_core/lib/wownero_balance.dart b/cw_core/lib/wownero_balance.dart
new file mode 100644
index 000000000..2820659f2
--- /dev/null
+++ b/cw_core/lib/wownero_balance.dart
@@ -0,0 +1,38 @@
+import 'package:cw_core/balance.dart';
+import 'package:cw_core/wownero_amount_format.dart';
+
+class WowneroBalance extends Balance {
+ WowneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0})
+ : formattedFullBalance = wowneroAmountToString(amount: fullBalance),
+ formattedUnlockedBalance = wowneroAmountToString(amount: unlockedBalance - frozenBalance),
+ formattedLockedBalance =
+ wowneroAmountToString(amount: frozenBalance + fullBalance - unlockedBalance),
+ super(unlockedBalance, fullBalance);
+
+ WowneroBalance.fromString(
+ {required this.formattedFullBalance,
+ required this.formattedUnlockedBalance,
+ this.formattedLockedBalance = '0.0'})
+ : fullBalance = wowneroParseAmount(amount: formattedFullBalance),
+ unlockedBalance = wowneroParseAmount(amount: formattedUnlockedBalance),
+ frozenBalance = wowneroParseAmount(amount: formattedLockedBalance),
+ super(wowneroParseAmount(amount: formattedUnlockedBalance),
+ wowneroParseAmount(amount: formattedFullBalance));
+
+ final int fullBalance;
+ final int unlockedBalance;
+ final int frozenBalance;
+ final String formattedFullBalance;
+ final String formattedUnlockedBalance;
+ final String formattedLockedBalance;
+
+ @override
+ String get formattedUnAvailableBalance =>
+ formattedLockedBalance == '0.0' ? '' : formattedLockedBalance;
+
+ @override
+ String get formattedAvailableBalance => formattedUnlockedBalance;
+
+ @override
+ String get formattedAdditionalBalance => formattedFullBalance;
+}
\ No newline at end of file
diff --git a/cw_core/pubspec.lock b/cw_core/pubspec.lock
index 88fddae09..518c71b94 100644
--- a/cw_core/pubspec.lock
+++ b/cw_core/pubspec.lock
@@ -660,10 +660,10 @@ packages:
dependency: "direct main"
description:
name: unorm_dart
- sha256: "5b35bff83fce4d76467641438f9e867dc9bcfdb8c1694854f230579d68cd8f4b"
+ sha256: "23d8bf65605401a6a32cff99435fed66ef3dab3ddcad3454059165df46496a3b"
url: "https://pub.dev"
source: hosted
- version: "0.2.0"
+ version: "0.3.0"
vector_math:
dependency: transitive
description:
diff --git a/cw_haven/lib/api/account_list.dart b/cw_haven/lib/api/account_list.dart
index a05446c8e..87f036206 100644
--- a/cw_haven/lib/api/account_list.dart
+++ b/cw_haven/lib/api/account_list.dart
@@ -4,7 +4,6 @@ import 'package:cw_haven/api/signatures.dart';
import 'package:cw_haven/api/types.dart';
import 'package:cw_haven/api/haven_api.dart';
import 'package:cw_haven/api/structs/account_row.dart';
-import 'package:flutter/foundation.dart';
import 'package:cw_haven/api/wallet.dart';
final accountSizeNative = havenApi
@@ -72,12 +71,11 @@ void _setLabelForAccount(Map args) {
}
Future addAccount({required String label}) async {
- await compute(_addAccount, label);
+ _addAccount(label);
await store();
}
Future setLabelForAccount({required int accountIndex, required String label}) async {
- await compute(
- _setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
+ _setLabelForAccount({'accountIndex': accountIndex, 'label': label});
await store();
}
\ No newline at end of file
diff --git a/cw_monero/android/.classpath b/cw_monero/android/.classpath
deleted file mode 100644
index 4a04201ca..000000000
--- a/cw_monero/android/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/cw_monero/android/.gitignore b/cw_monero/android/.gitignore
deleted file mode 100644
index c6cbe562a..000000000
--- a/cw_monero/android/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
diff --git a/cw_monero/android/.project b/cw_monero/android/.project
deleted file mode 100644
index e0799208f..000000000
--- a/cw_monero/android/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- cw_monero
- Project android created by Buildship.
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.buildship.core.gradleprojectbuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.buildship.core.gradleprojectnature
-
-
diff --git a/cw_monero/android/.settings/org.eclipse.buildship.core.prefs b/cw_monero/android/.settings/org.eclipse.buildship.core.prefs
deleted file mode 100644
index a88c4d484..000000000
--- a/cw_monero/android/.settings/org.eclipse.buildship.core.prefs
+++ /dev/null
@@ -1,13 +0,0 @@
-arguments=
-auto.sync=false
-build.scans.enabled=false
-connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0-20191016123526+0000))
-connection.project.dir=../../android
-eclipse.preferences.version=1
-gradle.user.home=
-java.home=
-jvm.arguments=
-offline.mode=false
-override.workspace.settings=true
-show.console.view=true
-show.executions.view=true
diff --git a/cw_monero/android/CMakeLists.txt b/cw_monero/android/CMakeLists.txt
deleted file mode 100644
index f9f98927c..000000000
--- a/cw_monero/android/CMakeLists.txt
+++ /dev/null
@@ -1,232 +0,0 @@
-cmake_minimum_required(VERSION 3.4.1)
-
-add_library( cw_monero
- SHARED
- ./jni/monero_jni.cpp
- ../ios/Classes/monero_api.cpp)
-
- find_library( log-lib log )
-
-set(EXTERNAL_LIBS_DIR ${CMAKE_SOURCE_DIR}/../../cw_shared_external/ios/External/android)
-
-############
-# libsodium
-############
-
-add_library(sodium STATIC IMPORTED)
-set_target_properties(sodium PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libsodium.a)
-
-############
-# OpenSSL
-############
-
-add_library(crypto STATIC IMPORTED)
-set_target_properties(crypto PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libcrypto.a)
-
-add_library(ssl STATIC IMPORTED)
-set_target_properties(ssl PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libssl.a)
-
-############
-# Boost
-############
-
-add_library(boost_chrono STATIC IMPORTED)
-set_target_properties(boost_chrono PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_chrono.a)
-
-add_library(boost_date_time STATIC IMPORTED)
-set_target_properties(boost_date_time PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_date_time.a)
-
-add_library(boost_filesystem STATIC IMPORTED)
-set_target_properties(boost_filesystem PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_filesystem.a)
-
-add_library(boost_program_options STATIC IMPORTED)
-set_target_properties(boost_program_options PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_program_options.a)
-
-add_library(boost_regex STATIC IMPORTED)
-set_target_properties(boost_regex PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_regex.a)
-
-add_library(boost_serialization STATIC IMPORTED)
-set_target_properties(boost_serialization PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_serialization.a)
-
-add_library(boost_system STATIC IMPORTED)
-set_target_properties(boost_system PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_system.a)
-
-add_library(boost_thread STATIC IMPORTED)
-set_target_properties(boost_thread PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_thread.a)
-
-add_library(boost_wserialization STATIC IMPORTED)
-set_target_properties(boost_wserialization PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/libboost_wserialization.a)
-
-#############
-# Monero
-#############
-
-add_library(wallet_api STATIC IMPORTED)
-set_target_properties(wallet_api PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libwallet_api.a)
-
-add_library(wallet STATIC IMPORTED)
-set_target_properties(wallet PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libwallet.a)
-
-add_library(cryptonote_core STATIC IMPORTED)
-set_target_properties(cryptonote_core PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libcryptonote_core.a)
-
-add_library(cryptonote_basic STATIC IMPORTED)
-set_target_properties(cryptonote_basic PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libcryptonote_basic.a)
-
-add_library(cryptonote_format_utils_basic STATIC IMPORTED)
-set_target_properties(cryptonote_format_utils_basic PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libcryptonote_format_utils_basic.a)
-
-add_library(mnemonics STATIC IMPORTED)
-set_target_properties(mnemonics PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libmnemonics.a)
-
-add_library(common STATIC IMPORTED)
-set_target_properties(common PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libcommon.a)
-
-add_library(cncrypto STATIC IMPORTED)
-set_target_properties(cncrypto PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libcncrypto.a)
-
-add_library(ringct STATIC IMPORTED)
-set_target_properties(ringct PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libringct.a)
-
-add_library(ringct_basic STATIC IMPORTED)
-set_target_properties(ringct_basic PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libringct_basic.a)
-
-add_library(blockchain_db STATIC IMPORTED)
-set_target_properties(blockchain_db PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libblockchain_db.a)
-
-add_library(lmdb STATIC IMPORTED)
-set_target_properties(lmdb PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/liblmdb.a)
-
-add_library(easylogging STATIC IMPORTED)
-set_target_properties(easylogging PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libeasylogging.a)
-
-add_library(unbound STATIC IMPORTED)
-set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libunbound.a)
-
-add_library(epee STATIC IMPORTED)
-set_target_properties(epee PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libepee.a)
-
-add_library(blocks STATIC IMPORTED)
-set_target_properties(blocks PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libblocks.a)
-
-add_library(checkpoints STATIC IMPORTED)
-set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libcheckpoints.a)
-
-add_library(device STATIC IMPORTED)
-set_target_properties(device PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libdevice.a)
-
-add_library(device_trezor STATIC IMPORTED)
-set_target_properties(device_trezor PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libdevice_trezor.a)
-
-add_library(multisig STATIC IMPORTED)
-set_target_properties(multisig PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libmultisig.a)
-
-add_library(version STATIC IMPORTED)
-set_target_properties(version PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libversion.a)
-
-add_library(net STATIC IMPORTED)
-set_target_properties(net PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libnet.a)
-
-add_library(hardforks STATIC IMPORTED)
-set_target_properties(hardforks PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libhardforks.a)
-
-add_library(randomx STATIC IMPORTED)
-set_target_properties(randomx PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/librandomx.a)
-
-add_library(rpc_base STATIC IMPORTED)
-set_target_properties(rpc_base PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/librpc_base.a)
-
-add_library(wallet-crypto STATIC IMPORTED)
-set_target_properties(wallet-crypto PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/monero/libwallet-crypto.a)
-
-set(WALLET_CRYPTO "")
-
-if(${ANDROID_ABI} STREQUAL "x86_64")
- set(WALLET_CRYPTO "wallet-crypto")
-endif()
-
-include_directories( ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/include )
-
-target_link_libraries( cw_monero
-
- wallet_api
- wallet
- cryptonote_core
- cryptonote_basic
- cryptonote_format_utils_basic
- mnemonics
- ringct
- ringct_basic
- net
- common
- cncrypto
- blockchain_db
- lmdb
- easylogging
- unbound
- epee
- blocks
- checkpoints
- device
- device_trezor
- multisig
- version
- randomx
- hardforks
- rpc_base
- ${WALLET_CRYPTO}
-
- boost_chrono
- boost_date_time
- boost_filesystem
- boost_program_options
- boost_regex
- boost_serialization
- boost_system
- boost_thread
- boost_wserialization
-
- ssl
- crypto
-
- sodium
-
- ${log-lib} )
\ No newline at end of file
diff --git a/cw_monero/android/build.gradle b/cw_monero/android/build.gradle
deleted file mode 100644
index fc4835e81..000000000
--- a/cw_monero/android/build.gradle
+++ /dev/null
@@ -1,49 +0,0 @@
-group 'com.cakewallet.monero'
-version '1.0-SNAPSHOT'
-
-buildscript {
- ext.kotlin_version = '1.7.10'
- repositories {
- google()
- jcenter()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:7.3.0'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-
-rootProject.allprojects {
- repositories {
- google()
- jcenter()
- }
-}
-
-apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android'
-
-android {
- compileSdkVersion 28
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
- defaultConfig {
- minSdkVersion 21
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
- lintOptions {
- disable 'InvalidPackage'
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
diff --git a/cw_monero/android/gradle.properties b/cw_monero/android/gradle.properties
deleted file mode 100644
index 38c8d4544..000000000
--- a/cw_monero/android/gradle.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-org.gradle.jvmargs=-Xmx1536M
-android.enableR8=true
-android.useAndroidX=true
-android.enableJetifier=true
diff --git a/cw_monero/android/gradle/wrapper/gradle-wrapper.properties b/cw_monero/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 019065d1d..000000000
--- a/cw_monero/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
diff --git a/cw_monero/android/jni/monero_jni.cpp b/cw_monero/android/jni/monero_jni.cpp
deleted file mode 100644
index 83e06a41f..000000000
--- a/cw_monero/android/jni/monero_jni.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-#include
-#include
-#include "../../ios/Classes/monero_api.h"
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-JNIEXPORT void JNICALL
-Java_com_cakewallet_monero_MoneroApi_setNodeAddressJNI(
- JNIEnv *env,
- jobject inst,
- jstring uri,
- jstring login,
- jstring password,
- jboolean use_ssl,
- jboolean is_light_wallet) {
- const char *_uri = env->GetStringUTFChars(uri, 0);
- const char *_login = "";
- const char *_password = "";
- char *error;
-
- if (login != NULL) {
- _login = env->GetStringUTFChars(login, 0);
- }
-
- if (password != NULL) {
- _password = env->GetStringUTFChars(password, 0);
- }
- char *__uri = (char*) _uri;
- char *__login = (char*) _login;
- char *__password = (char*) _password;
- bool inited = setup_node(__uri, __login, __password, false, false, error);
-
- if (!inited) {
- env->ThrowNew(env->FindClass("java/lang/Exception"), error);
- }
-}
-
-JNIEXPORT void JNICALL
-Java_com_cakewallet_monero_MoneroApi_connectToNodeJNI(
- JNIEnv *env,
- jobject inst) {
- char *error;
- bool is_connected = connect_to_node(error);
-
- if (!is_connected) {
- env->ThrowNew(env->FindClass("java/lang/Exception"), error);
- }
-}
-
-JNIEXPORT void JNICALL
-Java_com_cakewallet_monero_MoneroApi_startSyncJNI(
- JNIEnv *env,
- jobject inst) {
- start_refresh();
-}
-
-JNIEXPORT void JNICALL
-Java_com_cakewallet_monero_MoneroApi_loadWalletJNI(
- JNIEnv *env,
- jobject inst,
- jstring path,
- jstring password) {
- char *_path = (char *) env->GetStringUTFChars(path, 0);
- char *_password = (char *) env->GetStringUTFChars(password, 0);
-
- load_wallet(_path, _password, 0);
-}
-
-#ifdef __cplusplus
-}
-#endif
\ No newline at end of file
diff --git a/cw_monero/android/settings.gradle b/cw_monero/android/settings.gradle
deleted file mode 100644
index 1f9e2a39d..000000000
--- a/cw_monero/android/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = 'cw_monero'
diff --git a/cw_monero/android/src/main/AndroidManifest.xml b/cw_monero/android/src/main/AndroidManifest.xml
deleted file mode 100644
index 8152415a2..000000000
--- a/cw_monero/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
diff --git a/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt b/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt
deleted file mode 100644
index 37684a16a..000000000
--- a/cw_monero/android/src/main/kotlin/com/cakewallet/monero/CwMoneroPlugin.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.cakewallet.monero
-
-import android.app.Activity
-import android.os.AsyncTask
-import android.os.Looper
-import android.os.Handler
-import android.os.Process
-
-import io.flutter.plugin.common.MethodCall
-import io.flutter.plugin.common.MethodChannel
-import io.flutter.plugin.common.MethodChannel.MethodCallHandler
-import io.flutter.plugin.common.MethodChannel.Result
-import io.flutter.plugin.common.PluginRegistry.Registrar
-
-class doAsync(val handler: () -> Unit) : AsyncTask() {
- override fun doInBackground(vararg params: Void?): Void? {
- Process.setThreadPriority(Process.THREAD_PRIORITY_AUDIO);
- handler()
- return null
- }
-}
-
-class CwMoneroPlugin: MethodCallHandler {
- companion object {
-// val moneroApi = MoneroApi()
- val main = Handler(Looper.getMainLooper());
-
- init {
- System.loadLibrary("cw_monero")
- }
-
- @JvmStatic
- fun registerWith(registrar: Registrar) {
- val channel = MethodChannel(registrar.messenger(), "cw_monero")
- channel.setMethodCallHandler(CwMoneroPlugin())
- }
- }
-
- override fun onMethodCall(call: MethodCall, result: Result) {
- if (call.method == "setupNode") {
- val uri = call.argument("address") ?: ""
- val login = call.argument("login") ?: ""
- val password = call.argument("password") ?: ""
- val useSSL = false
- val isLightWallet = false
-// doAsync {
-// try {
-// moneroApi.setNodeAddressJNI(uri, login, password, useSSL, isLightWallet)
-// main.post({
-// result.success(true)
-// });
-// } catch(e: Throwable) {
-// main.post({
-// result.error("CONNECTION_ERROR", e.message, null)
-// });
-// }
-// }.execute()
- }
- if (call.method == "startSync") {
-// doAsync {
-// moneroApi.startSyncJNI()
-// main.post({
-// result.success(true)
-// });
-// }.execute()
- }
- if (call.method == "loadWallet") {
- val path = call.argument("path") ?: ""
- val password = call.argument("password") ?: ""
-// moneroApi.loadWalletJNI(path, password)
- result.success(true)
- }
- }
-}
diff --git a/cw_monero/example/.gitignore b/cw_monero/example/.gitignore
deleted file mode 100644
index 24476c5d1..000000000
--- a/cw_monero/example/.gitignore
+++ /dev/null
@@ -1,44 +0,0 @@
-# Miscellaneous
-*.class
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.buildlog/
-.history
-.svn/
-migrate_working_dir/
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# The .vscode folder contains launch configuration and tasks you configure in
-# VS Code which you may wish to be included in version control, so this line
-# is commented out by default.
-#.vscode/
-
-# Flutter/Dart/Pub related
-**/doc/api/
-**/ios/Flutter/.last_build_id
-.dart_tool/
-.flutter-plugins
-.flutter-plugins-dependencies
-.packages
-.pub-cache/
-.pub/
-/build/
-
-# Symbolication related
-app.*.symbols
-
-# Obfuscation related
-app.*.map.json
-
-# Android Studio will place build artifacts here
-/android/app/debug
-/android/app/profile
-/android/app/release
diff --git a/cw_monero/example/README.md b/cw_monero/example/README.md
deleted file mode 100644
index 18cf6d109..000000000
--- a/cw_monero/example/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# cw_monero_example
-
-Demonstrates how to use the cw_monero plugin.
-
-## Getting Started
-
-This project is a starting point for a Flutter application.
-
-A few resources to get you started if this is your first Flutter project:
-
-- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
-- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
-
-For help getting started with Flutter development, view the
-[online documentation](https://docs.flutter.dev/), which offers tutorials,
-samples, guidance on mobile development, and a full API reference.
diff --git a/cw_monero/example/analysis_options.yaml b/cw_monero/example/analysis_options.yaml
deleted file mode 100644
index 61b6c4de1..000000000
--- a/cw_monero/example/analysis_options.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file configures the analyzer, which statically analyzes Dart code to
-# check for errors, warnings, and lints.
-#
-# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
-# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
-# invoked from the command line by running `flutter analyze`.
-
-# The following line activates a set of recommended lints for Flutter apps,
-# packages, and plugins designed to encourage good coding practices.
-include: package:flutter_lints/flutter.yaml
-
-linter:
- # The lint rules applied to this project can be customized in the
- # section below to disable rules from the `package:flutter_lints/flutter.yaml`
- # included above or to enable additional rules. A list of all available lints
- # and their documentation is published at
- # https://dart-lang.github.io/linter/lints/index.html.
- #
- # Instead of disabling a lint rule for the entire project in the
- # section below, it can also be suppressed for a single line of code
- # or a specific dart file by using the `// ignore: name_of_lint` and
- # `// ignore_for_file: name_of_lint` syntax on the line or in the file
- # producing the lint.
- rules:
- # avoid_print: false # Uncomment to disable the `avoid_print` rule
- # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
-# Additional information about this file can be found at
-# https://dart.dev/guides/language/analysis-options
diff --git a/cw_monero/example/lib/main.dart b/cw_monero/example/lib/main.dart
deleted file mode 100644
index e4374f097..000000000
--- a/cw_monero/example/lib/main.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-import 'package:flutter/material.dart';
-import 'dart:async';
-
-import 'package:flutter/services.dart';
-import 'package:cw_monero/cw_monero.dart';
-
-void main() {
- runApp(const MyApp());
-}
-
-class MyApp extends StatefulWidget {
- const MyApp({super.key});
-
- @override
- State createState() => _MyAppState();
-}
-
-class _MyAppState extends State {
- String _platformVersion = 'Unknown';
- final _cwMoneroPlugin = CwMonero();
-
- @override
- void initState() {
- super.initState();
- initPlatformState();
- }
-
- // Platform messages are asynchronous, so we initialize in an async method.
- Future initPlatformState() async {
- String platformVersion;
- // Platform messages may fail, so we use a try/catch PlatformException.
- // We also handle the message potentially returning null.
- try {
- platformVersion =
- await _cwMoneroPlugin.getPlatformVersion() ?? 'Unknown platform version';
- } on PlatformException {
- platformVersion = 'Failed to get platform version.';
- }
-
- // If the widget was removed from the tree while the asynchronous platform
- // message was in flight, we want to discard the reply rather than calling
- // setState to update our non-existent appearance.
- if (!mounted) return;
-
- setState(() {
- _platformVersion = platformVersion;
- });
- }
-
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- home: Scaffold(
- appBar: AppBar(
- title: const Text('Plugin example app'),
- ),
- body: Center(
- child: Text('Running on: $_platformVersion\n'),
- ),
- ),
- );
- }
-}
diff --git a/cw_monero/example/macos/.gitignore b/cw_monero/example/macos/.gitignore
deleted file mode 100644
index 746adbb6b..000000000
--- a/cw_monero/example/macos/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-# Flutter-related
-**/Flutter/ephemeral/
-**/Pods/
-
-# Xcode-related
-**/dgph
-**/xcuserdata/
diff --git a/cw_monero/example/macos/Flutter/Flutter-Debug.xcconfig b/cw_monero/example/macos/Flutter/Flutter-Debug.xcconfig
deleted file mode 100644
index 4b81f9b2d..000000000
--- a/cw_monero/example/macos/Flutter/Flutter-Debug.xcconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
-#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/cw_monero/example/macos/Flutter/Flutter-Release.xcconfig b/cw_monero/example/macos/Flutter/Flutter-Release.xcconfig
deleted file mode 100644
index 5caa9d157..000000000
--- a/cw_monero/example/macos/Flutter/Flutter-Release.xcconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
-#include "ephemeral/Flutter-Generated.xcconfig"
diff --git a/cw_monero/example/macos/Flutter/GeneratedPluginRegistrant.swift b/cw_monero/example/macos/Flutter/GeneratedPluginRegistrant.swift
deleted file mode 100644
index e25d64097..000000000
--- a/cw_monero/example/macos/Flutter/GeneratedPluginRegistrant.swift
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-import FlutterMacOS
-import Foundation
-
-import cw_monero
-import path_provider_foundation
-
-func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
- CwMoneroPlugin.register(with: registry.registrar(forPlugin: "CwMoneroPlugin"))
- PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
-}
diff --git a/cw_monero/example/macos/Podfile b/cw_monero/example/macos/Podfile
deleted file mode 100644
index dade8dfad..000000000
--- a/cw_monero/example/macos/Podfile
+++ /dev/null
@@ -1,40 +0,0 @@
-platform :osx, '10.11'
-
-# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
-ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-
-project 'Runner', {
- 'Debug' => :debug,
- 'Profile' => :release,
- 'Release' => :release,
-}
-
-def flutter_root
- generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
- unless File.exist?(generated_xcode_build_settings_path)
- raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
- end
-
- File.foreach(generated_xcode_build_settings_path) do |line|
- matches = line.match(/FLUTTER_ROOT\=(.*)/)
- return matches[1].strip if matches
- end
- raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
-end
-
-require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
-
-flutter_macos_podfile_setup
-
-target 'Runner' do
- use_frameworks!
- use_modular_headers!
-
- flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
-end
-
-post_install do |installer|
- installer.pods_project.targets.each do |target|
- flutter_additional_macos_build_settings(target)
- end
-end
diff --git a/cw_monero/example/macos/Podfile.lock b/cw_monero/example/macos/Podfile.lock
deleted file mode 100644
index 692176b30..000000000
--- a/cw_monero/example/macos/Podfile.lock
+++ /dev/null
@@ -1,22 +0,0 @@
-PODS:
- - FlutterMacOS (1.0.0)
- - path_provider_macos (0.0.1):
- - FlutterMacOS
-
-DEPENDENCIES:
- - FlutterMacOS (from `Flutter/ephemeral`)
- - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
-
-EXTERNAL SOURCES:
- FlutterMacOS:
- :path: Flutter/ephemeral
- path_provider_macos:
- :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
-
-SPEC CHECKSUMS:
- FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
- path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
-
-PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
-
-COCOAPODS: 1.11.2
diff --git a/cw_monero/example/macos/Runner.xcodeproj/project.pbxproj b/cw_monero/example/macos/Runner.xcodeproj/project.pbxproj
deleted file mode 100644
index 472859e8c..000000000
--- a/cw_monero/example/macos/Runner.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,632 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 51;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;
- buildPhases = (
- 33CC111E2044C6BF0003C045 /* ShellScript */,
- );
- dependencies = (
- );
- name = "Flutter Assemble";
- productName = FLX;
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
- 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
- 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
- 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
- 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
- 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
- 428E7496E2068D0AB138F295 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C29B2253BA962B7A415DBA77 /* Pods_Runner.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 33CC111A2044C6BA0003C045;
- remoteInfo = FLX;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 33CC110E2044A8840003C045 /* Bundle Framework */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- );
- name = "Bundle Framework";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; };
- 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; };
- 33CC10ED2044A3C60003C045 /* cw_monero_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cw_monero_example.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
- 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; };
- 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
- 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; };
- 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; };
- 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; };
- 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; };
- 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; };
- 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; };
- 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; };
- 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; };
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; };
- 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; };
- A9CDA1605413332AB9056C23 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
- C29B2253BA962B7A415DBA77 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- E434913D71DC2682EF8E9059 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
- EEF09839C86335F78056F812 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 33CC10EA2044A3C60003C045 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 428E7496E2068D0AB138F295 /* Pods_Runner.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 33BA886A226E78AF003329D5 /* Configs */ = {
- isa = PBXGroup;
- children = (
- 33E5194F232828860026EE4D /* AppInfo.xcconfig */,
- 9740EEB21CF90195004384FC /* Debug.xcconfig */,
- 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
- 333000ED22D3DE5D00554162 /* Warnings.xcconfig */,
- );
- path = Configs;
- sourceTree = "";
- };
- 33CC10E42044A3C60003C045 = {
- isa = PBXGroup;
- children = (
- 33FAB671232836740065AC1E /* Runner */,
- 33CEB47122A05771004F2AC0 /* Flutter */,
- 33CC10EE2044A3C60003C045 /* Products */,
- D73912EC22F37F3D000D13A0 /* Frameworks */,
- 77870A4C94A9AB6EEC2EE261 /* Pods */,
- );
- sourceTree = "";
- };
- 33CC10EE2044A3C60003C045 /* Products */ = {
- isa = PBXGroup;
- children = (
- 33CC10ED2044A3C60003C045 /* cw_monero_example.app */,
- );
- name = Products;
- sourceTree = "";
- };
- 33CC11242044D66E0003C045 /* Resources */ = {
- isa = PBXGroup;
- children = (
- 33CC10F22044A3C60003C045 /* Assets.xcassets */,
- 33CC10F42044A3C60003C045 /* MainMenu.xib */,
- 33CC10F72044A3C60003C045 /* Info.plist */,
- );
- name = Resources;
- path = ..;
- sourceTree = "";
- };
- 33CEB47122A05771004F2AC0 /* Flutter */ = {
- isa = PBXGroup;
- children = (
- 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
- 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
- 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
- 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
- );
- path = Flutter;
- sourceTree = "";
- };
- 33FAB671232836740065AC1E /* Runner */ = {
- isa = PBXGroup;
- children = (
- 33CC10F02044A3C60003C045 /* AppDelegate.swift */,
- 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
- 33E51913231747F40026EE4D /* DebugProfile.entitlements */,
- 33E51914231749380026EE4D /* Release.entitlements */,
- 33CC11242044D66E0003C045 /* Resources */,
- 33BA886A226E78AF003329D5 /* Configs */,
- );
- path = Runner;
- sourceTree = "";
- };
- 77870A4C94A9AB6EEC2EE261 /* Pods */ = {
- isa = PBXGroup;
- children = (
- EEF09839C86335F78056F812 /* Pods-Runner.debug.xcconfig */,
- A9CDA1605413332AB9056C23 /* Pods-Runner.release.xcconfig */,
- E434913D71DC2682EF8E9059 /* Pods-Runner.profile.xcconfig */,
- );
- name = Pods;
- path = Pods;
- sourceTree = "";
- };
- D73912EC22F37F3D000D13A0 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- C29B2253BA962B7A415DBA77 /* Pods_Runner.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 33CC10EC2044A3C60003C045 /* Runner */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
- buildPhases = (
- 0A239C1738C005E3F6E4DFC6 /* [CP] Check Pods Manifest.lock */,
- 33CC10E92044A3C60003C045 /* Sources */,
- 33CC10EA2044A3C60003C045 /* Frameworks */,
- 33CC10EB2044A3C60003C045 /* Resources */,
- 33CC110E2044A8840003C045 /* Bundle Framework */,
- 3399D490228B24CF009A79C7 /* ShellScript */,
- 0CEAA82AE8A029C31B39F234 /* [CP] Embed Pods Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 33CC11202044C79F0003C045 /* PBXTargetDependency */,
- );
- name = Runner;
- productName = Runner;
- productReference = 33CC10ED2044A3C60003C045 /* cw_monero_example.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 33CC10E52044A3C60003C045 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastSwiftUpdateCheck = 0920;
- LastUpgradeCheck = 1300;
- ORGANIZATIONNAME = "";
- TargetAttributes = {
- 33CC10EC2044A3C60003C045 = {
- CreatedOnToolsVersion = 9.2;
- LastSwiftMigration = 1100;
- ProvisioningStyle = Automatic;
- SystemCapabilities = {
- com.apple.Sandbox = {
- enabled = 1;
- };
- };
- };
- 33CC111A2044C6BA0003C045 = {
- CreatedOnToolsVersion = 9.2;
- ProvisioningStyle = Manual;
- };
- };
- };
- buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
- compatibilityVersion = "Xcode 9.3";
- developmentRegion = en;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 33CC10E42044A3C60003C045;
- productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 33CC10EC2044A3C60003C045 /* Runner */,
- 33CC111A2044C6BA0003C045 /* Flutter Assemble */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 33CC10EB2044A3C60003C045 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
- 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 0A239C1738C005E3F6E4DFC6 /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
- "${PODS_ROOT}/Manifest.lock",
- );
- name = "[CP] Check Pods Manifest.lock";
- outputFileListPaths = (
- );
- outputPaths = (
- "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
- showEnvVarsInLog = 0;
- };
- 0CEAA82AE8A029C31B39F234 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
- 3399D490228B24CF009A79C7 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- );
- outputFileListPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
- };
- 33CC111E2044C6BF0003C045 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- Flutter/ephemeral/FlutterInputs.xcfilelist,
- );
- inputPaths = (
- Flutter/ephemeral/tripwire,
- );
- outputFileListPaths = (
- Flutter/ephemeral/FlutterOutputs.xcfilelist,
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 33CC10E92044A3C60003C045 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
- 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
- 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
- targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
- 33CC10F42044A3C60003C045 /* MainMenu.xib */ = {
- isa = PBXVariantGroup;
- children = (
- 33CC10F52044A3C60003C045 /* Base */,
- );
- name = MainMenu.xib;
- path = Runner;
- sourceTree = "";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 338D0CE9231458BD00FA5F75 /* Profile */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CODE_SIGN_IDENTITY = "-";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.11;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = macosx;
- SWIFT_COMPILATION_MODE = wholemodule;
- SWIFT_OPTIMIZATION_LEVEL = "-O";
- };
- name = Profile;
- };
- 338D0CEA231458BD00FA5F75 /* Profile */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
- CODE_SIGN_STYLE = Automatic;
- COMBINE_HIDPI_IMAGES = YES;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/../Frameworks",
- );
- PROVISIONING_PROFILE_SPECIFIER = "";
- SWIFT_VERSION = 5.0;
- };
- name = Profile;
- };
- 338D0CEB231458BD00FA5F75 /* Profile */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Manual;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Profile;
- };
- 33CC10F92044A3C60003C045 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CODE_SIGN_IDENTITY = "-";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = dwarf;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.11;
- MTL_ENABLE_DEBUG_INFO = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx;
- SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- };
- name = Debug;
- };
- 33CC10FA2044A3C60003C045 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_ANALYZER_NONNULL = YES;
- CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CODE_SIGN_IDENTITY = "-";
- COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- ENABLE_NS_ASSERTIONS = NO;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = gnu11;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.11;
- MTL_ENABLE_DEBUG_INFO = NO;
- SDKROOT = macosx;
- SWIFT_COMPILATION_MODE = wholemodule;
- SWIFT_OPTIMIZATION_LEVEL = "-O";
- };
- name = Release;
- };
- 33CC10FC2044A3C60003C045 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
- CODE_SIGN_STYLE = Automatic;
- COMBINE_HIDPI_IMAGES = YES;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/../Frameworks",
- );
- PROVISIONING_PROFILE_SPECIFIER = "";
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 5.0;
- };
- name = Debug;
- };
- 33CC10FD2044A3C60003C045 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
- CODE_SIGN_STYLE = Automatic;
- COMBINE_HIDPI_IMAGES = YES;
- INFOPLIST_FILE = Runner/Info.plist;
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/../Frameworks",
- );
- PROVISIONING_PROFILE_SPECIFIER = "";
- SWIFT_VERSION = 5.0;
- };
- name = Release;
- };
- 33CC111C2044C6BA0003C045 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Manual;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Debug;
- };
- 33CC111D2044C6BA0003C045 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Automatic;
- PRODUCT_NAME = "$(TARGET_NAME)";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 33CC10F92044A3C60003C045 /* Debug */,
- 33CC10FA2044A3C60003C045 /* Release */,
- 338D0CE9231458BD00FA5F75 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 33CC10FC2044A3C60003C045 /* Debug */,
- 33CC10FD2044A3C60003C045 /* Release */,
- 338D0CEA231458BD00FA5F75 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 33CC111C2044C6BA0003C045 /* Debug */,
- 33CC111D2044C6BA0003C045 /* Release */,
- 338D0CEB231458BD00FA5F75 /* Profile */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 33CC10E52044A3C60003C045 /* Project object */;
-}
diff --git a/cw_monero/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cw_monero/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003..000000000
--- a/cw_monero/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/cw_monero/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/cw_monero/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
deleted file mode 100644
index 4e44b7ced..000000000
--- a/cw_monero/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cw_monero/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/cw_monero/example/macos/Runner.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index 21a3cc14c..000000000
--- a/cw_monero/example/macos/Runner.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
diff --git a/cw_monero/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cw_monero/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644
index 18d981003..000000000
--- a/cw_monero/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/cw_monero/example/macos/Runner/AppDelegate.swift b/cw_monero/example/macos/Runner/AppDelegate.swift
deleted file mode 100644
index d53ef6437..000000000
--- a/cw_monero/example/macos/Runner/AppDelegate.swift
+++ /dev/null
@@ -1,9 +0,0 @@
-import Cocoa
-import FlutterMacOS
-
-@NSApplicationMain
-class AppDelegate: FlutterAppDelegate {
- override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
- return true
- }
-}
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index a2ec33f19..000000000
--- a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "images" : [
- {
- "size" : "16x16",
- "idiom" : "mac",
- "filename" : "app_icon_16.png",
- "scale" : "1x"
- },
- {
- "size" : "16x16",
- "idiom" : "mac",
- "filename" : "app_icon_32.png",
- "scale" : "2x"
- },
- {
- "size" : "32x32",
- "idiom" : "mac",
- "filename" : "app_icon_32.png",
- "scale" : "1x"
- },
- {
- "size" : "32x32",
- "idiom" : "mac",
- "filename" : "app_icon_64.png",
- "scale" : "2x"
- },
- {
- "size" : "128x128",
- "idiom" : "mac",
- "filename" : "app_icon_128.png",
- "scale" : "1x"
- },
- {
- "size" : "128x128",
- "idiom" : "mac",
- "filename" : "app_icon_256.png",
- "scale" : "2x"
- },
- {
- "size" : "256x256",
- "idiom" : "mac",
- "filename" : "app_icon_256.png",
- "scale" : "1x"
- },
- {
- "size" : "256x256",
- "idiom" : "mac",
- "filename" : "app_icon_512.png",
- "scale" : "2x"
- },
- {
- "size" : "512x512",
- "idiom" : "mac",
- "filename" : "app_icon_512.png",
- "scale" : "1x"
- },
- {
- "size" : "512x512",
- "idiom" : "mac",
- "filename" : "app_icon_1024.png",
- "scale" : "2x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
deleted file mode 100644
index 82b6f9d9a..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
deleted file mode 100644
index 13b35eba5..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
deleted file mode 100644
index 0a3f5fa40..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
deleted file mode 100644
index bdb57226d..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
deleted file mode 100644
index f083318e0..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
deleted file mode 100644
index 326c0e72c..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
deleted file mode 100644
index 2f1632cfd..000000000
Binary files a/cw_monero/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ
diff --git a/cw_monero/example/macos/Runner/Base.lproj/MainMenu.xib b/cw_monero/example/macos/Runner/Base.lproj/MainMenu.xib
deleted file mode 100644
index 80e867a4e..000000000
--- a/cw_monero/example/macos/Runner/Base.lproj/MainMenu.xib
+++ /dev/null
@@ -1,343 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/cw_monero/example/macos/Runner/Configs/AppInfo.xcconfig b/cw_monero/example/macos/Runner/Configs/AppInfo.xcconfig
deleted file mode 100644
index a80a25602..000000000
--- a/cw_monero/example/macos/Runner/Configs/AppInfo.xcconfig
+++ /dev/null
@@ -1,14 +0,0 @@
-// Application-level settings for the Runner target.
-//
-// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
-// future. If not, the values below would default to using the project name when this becomes a
-// 'flutter create' template.
-
-// The application's name. By default this is also the title of the Flutter window.
-PRODUCT_NAME = cw_monero_example
-
-// The application's bundle identifier
-PRODUCT_BUNDLE_IDENTIFIER = com.cakewallet.cwMoneroExample
-
-// The copyright displayed in application information
-PRODUCT_COPYRIGHT = Copyright © 2022 com.cakewallet. All rights reserved.
diff --git a/cw_monero/example/macos/Runner/Configs/Debug.xcconfig b/cw_monero/example/macos/Runner/Configs/Debug.xcconfig
deleted file mode 100644
index 36b0fd946..000000000
--- a/cw_monero/example/macos/Runner/Configs/Debug.xcconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "../../Flutter/Flutter-Debug.xcconfig"
-#include "Warnings.xcconfig"
diff --git a/cw_monero/example/macos/Runner/Configs/Release.xcconfig b/cw_monero/example/macos/Runner/Configs/Release.xcconfig
deleted file mode 100644
index dff4f4956..000000000
--- a/cw_monero/example/macos/Runner/Configs/Release.xcconfig
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "../../Flutter/Flutter-Release.xcconfig"
-#include "Warnings.xcconfig"
diff --git a/cw_monero/example/macos/Runner/Configs/Warnings.xcconfig b/cw_monero/example/macos/Runner/Configs/Warnings.xcconfig
deleted file mode 100644
index 42bcbf478..000000000
--- a/cw_monero/example/macos/Runner/Configs/Warnings.xcconfig
+++ /dev/null
@@ -1,13 +0,0 @@
-WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
-GCC_WARN_UNDECLARED_SELECTOR = YES
-CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
-CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
-CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
-CLANG_WARN_PRAGMA_PACK = YES
-CLANG_WARN_STRICT_PROTOTYPES = YES
-CLANG_WARN_COMMA = YES
-GCC_WARN_STRICT_SELECTOR_MATCH = YES
-CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
-CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
-GCC_WARN_SHADOW = YES
-CLANG_WARN_UNREACHABLE_CODE = YES
diff --git a/cw_monero/example/macos/Runner/Info.plist b/cw_monero/example/macos/Runner/Info.plist
deleted file mode 100644
index 4789daa6a..000000000
--- a/cw_monero/example/macos/Runner/Info.plist
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- $(DEVELOPMENT_LANGUAGE)
- CFBundleExecutable
- $(EXECUTABLE_NAME)
- CFBundleIconFile
-
- CFBundleIdentifier
- $(PRODUCT_BUNDLE_IDENTIFIER)
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- $(PRODUCT_NAME)
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- $(FLUTTER_BUILD_NAME)
- CFBundleVersion
- $(FLUTTER_BUILD_NUMBER)
- LSMinimumSystemVersion
- $(MACOSX_DEPLOYMENT_TARGET)
- NSHumanReadableCopyright
- $(PRODUCT_COPYRIGHT)
- NSMainNibFile
- MainMenu
- NSPrincipalClass
- NSApplication
-
-
diff --git a/cw_monero/example/macos/Runner/MainFlutterWindow.swift b/cw_monero/example/macos/Runner/MainFlutterWindow.swift
deleted file mode 100644
index 2722837ec..000000000
--- a/cw_monero/example/macos/Runner/MainFlutterWindow.swift
+++ /dev/null
@@ -1,15 +0,0 @@
-import Cocoa
-import FlutterMacOS
-
-class MainFlutterWindow: NSWindow {
- override func awakeFromNib() {
- let flutterViewController = FlutterViewController.init()
- let windowFrame = self.frame
- self.contentViewController = flutterViewController
- self.setFrame(windowFrame, display: true)
-
- RegisterGeneratedPlugins(registry: flutterViewController)
-
- super.awakeFromNib()
- }
-}
diff --git a/cw_monero/example/macos/Runner/Release.entitlements b/cw_monero/example/macos/Runner/Release.entitlements
deleted file mode 100644
index 852fa1a47..000000000
--- a/cw_monero/example/macos/Runner/Release.entitlements
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- com.apple.security.app-sandbox
-
-
-
diff --git a/cw_monero/example/pubspec.yaml b/cw_monero/example/pubspec.yaml
deleted file mode 100644
index 2dee5337f..000000000
--- a/cw_monero/example/pubspec.yaml
+++ /dev/null
@@ -1,84 +0,0 @@
-name: cw_monero_example
-description: Demonstrates how to use the cw_monero plugin.
-
-# The following line prevents the package from being accidentally published to
-# pub.dev using `flutter pub publish`. This is preferred for private packages.
-publish_to: 'none' # Remove this line if you wish to publish to pub.dev
-
-environment:
- sdk: '>=2.18.1 <3.0.0'
-
-# Dependencies specify other packages that your package needs in order to work.
-# To automatically upgrade your package dependencies to the latest versions
-# consider running `flutter pub upgrade --major-versions`. Alternatively,
-# dependencies can be manually updated by changing the version numbers below to
-# the latest version available on pub.dev. To see which dependencies have newer
-# versions available, run `flutter pub outdated`.
-dependencies:
- flutter:
- sdk: flutter
-
- cw_monero:
- # When depending on this package from a real application you should use:
- # cw_monero: ^x.y.z
- # See https://dart.dev/tools/pub/dependencies#version-constraints
- # The example app is bundled with the plugin so we use a path dependency on
- # the parent directory to use the current plugin's version.
- path: ../
-
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^1.0.2
-
-dev_dependencies:
- flutter_test:
- sdk: flutter
-
- # The "flutter_lints" package below contains a set of recommended lints to
- # encourage good coding practices. The lint set provided by the package is
- # activated in the `analysis_options.yaml` file located at the root of your
- # package. See that file for information about deactivating specific lint
- # rules and activating additional ones.
- flutter_lints: ^2.0.0
-
-# For information on the generic Dart part of this file, see the
-# following page: https://dart.dev/tools/pub/pubspec
-
-# The following section is specific to Flutter packages.
-flutter:
-
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
- uses-material-design: true
-
- # To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
-
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.dev/assets-and-images/#resolution-aware
-
- # For details regarding adding assets from package dependencies, see
- # https://flutter.dev/assets-and-images/#from-packages
-
- # To add custom fonts to your application, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
- # fonts:
- # - family: Schyler
- # fonts:
- # - asset: fonts/Schyler-Regular.ttf
- # - asset: fonts/Schyler-Italic.ttf
- # style: italic
- # - family: Trajan Pro
- # fonts:
- # - asset: fonts/TrajanPro.ttf
- # - asset: fonts/TrajanPro_Bold.ttf
- # weight: 700
- #
- # For details regarding fonts from package dependencies,
- # see https://flutter.dev/custom-fonts/#from-packages
diff --git a/cw_monero/example/test/widget_test.dart b/cw_monero/example/test/widget_test.dart
deleted file mode 100644
index b37e6313d..000000000
--- a/cw_monero/example/test/widget_test.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-// This is a basic Flutter widget test.
-//
-// To perform an interaction with a widget in your test, use the WidgetTester
-// utility in the flutter_test package. For example, you can send tap and scroll
-// gestures. You can also use WidgetTester to find child widgets in the widget
-// tree, read text, and verify that the values of widget properties are correct.
-
-import 'package:flutter/material.dart';
-import 'package:flutter_test/flutter_test.dart';
-
-import 'package:cw_monero_example/main.dart';
-
-void main() {
- testWidgets('Verify Platform version', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.pumpWidget(const MyApp());
-
- // Verify that platform version is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) => widget is Text &&
- widget.data!.startsWith('Running on:'),
- ),
- findsOneWidget,
- );
- });
-}
diff --git a/cw_monero/ios/.gitignore b/cw_monero/ios/.gitignore
deleted file mode 100644
index aa479fd3c..000000000
--- a/cw_monero/ios/.gitignore
+++ /dev/null
@@ -1,37 +0,0 @@
-.idea/
-.vagrant/
-.sconsign.dblite
-.svn/
-
-.DS_Store
-*.swp
-profile
-
-DerivedData/
-build/
-GeneratedPluginRegistrant.h
-GeneratedPluginRegistrant.m
-
-.generated/
-
-*.pbxuser
-*.mode1v3
-*.mode2v3
-*.perspectivev3
-
-!default.pbxuser
-!default.mode1v3
-!default.mode2v3
-!default.perspectivev3
-
-xcuserdata
-
-*.moved-aside
-
-*.pyc
-*sync/
-Icon?
-.tags*
-
-/Flutter/Generated.xcconfig
-/Flutter/flutter_export_environment.sh
\ No newline at end of file
diff --git a/cw_monero/ios/Classes/CwMoneroPlugin.h b/cw_monero/ios/Classes/CwMoneroPlugin.h
deleted file mode 100644
index a42018098..000000000
--- a/cw_monero/ios/Classes/CwMoneroPlugin.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#import
-
-@interface CwMoneroPlugin : NSObject
-@end
diff --git a/cw_monero/ios/Classes/CwMoneroPlugin.m b/cw_monero/ios/Classes/CwMoneroPlugin.m
deleted file mode 100644
index eee251212..000000000
--- a/cw_monero/ios/Classes/CwMoneroPlugin.m
+++ /dev/null
@@ -1,8 +0,0 @@
-#import "CwMoneroPlugin.h"
-#import
-
-@implementation CwMoneroPlugin
-+ (void)registerWithRegistrar:(NSObject*)registrar {
- [SwiftCwMoneroPlugin registerWithRegistrar:registrar];
-}
-@end
diff --git a/cw_monero/ios/Classes/CwWalletListener.h b/cw_monero/ios/Classes/CwWalletListener.h
deleted file mode 100644
index cbfcb0c4e..000000000
--- a/cw_monero/ios/Classes/CwWalletListener.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#include
-
-struct CWMoneroWalletListener;
-
-typedef int8_t (*on_new_block_callback)(uint64_t height);
-typedef int8_t (*on_need_to_refresh_callback)();
-
-typedef struct CWMoneroWalletListener
-{
- // on_money_spent_callback *on_money_spent;
- // on_money_received_callback *on_money_received;
- // on_unconfirmed_money_received_callback *on_unconfirmed_money_received;
- // on_new_block_callback *on_new_block;
- // on_updated_callback *on_updated;
- // on_refreshed_callback *on_refreshed;
-
- on_new_block_callback on_new_block;
-} CWMoneroWalletListener;
-
-struct TestListener {
- // int8_t x;
- on_new_block_callback on_new_block;
-};
\ No newline at end of file
diff --git a/cw_monero/ios/Classes/SwiftCwMoneroPlugin.swift b/cw_monero/ios/Classes/SwiftCwMoneroPlugin.swift
deleted file mode 100644
index 4c03a3e44..000000000
--- a/cw_monero/ios/Classes/SwiftCwMoneroPlugin.swift
+++ /dev/null
@@ -1,14 +0,0 @@
-import Flutter
-import UIKit
-
-public class SwiftCwMoneroPlugin: NSObject, FlutterPlugin {
- public static func register(with registrar: FlutterPluginRegistrar) {
- let channel = FlutterMethodChannel(name: "cw_monero", binaryMessenger: registrar.messenger())
- let instance = SwiftCwMoneroPlugin()
- registrar.addMethodCallDelegate(instance, channel: channel)
- }
-
- public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
- result("iOS " + UIDevice.current.systemVersion)
- }
-}
diff --git a/cw_monero/ios/Classes/monero_api.cpp b/cw_monero/ios/Classes/monero_api.cpp
deleted file mode 100644
index a2a17bd5e..000000000
--- a/cw_monero/ios/Classes/monero_api.cpp
+++ /dev/null
@@ -1,1044 +0,0 @@
-#include
-#include "cstdlib"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "thread"
-#include "CwWalletListener.h"
-#if __APPLE__
-// Fix for randomx on ios
-void __clear_cache(void* start, void* end) { }
-#include "../External/ios/include/wallet2_api.h"
-#else
-#include "../External/android/include/wallet2_api.h"
-#endif
-
-using namespace std::chrono_literals;
-#ifdef __cplusplus
-extern "C"
-{
-#endif
- const uint64_t MONERO_BLOCK_SIZE = 1000;
-
- struct Utf8Box
- {
- char *value;
-
- Utf8Box(char *_value)
- {
- value = _value;
- }
- };
-
- struct SubaddressRow
- {
- uint64_t id;
- char *address;
- char *label;
-
- SubaddressRow(std::size_t _id, char *_address, char *_label)
- {
- id = static_cast(_id);
- address = _address;
- label = _label;
- }
- };
-
- struct AccountRow
- {
- uint64_t id;
- char *label;
-
- AccountRow(std::size_t _id, char *_label)
- {
- id = static_cast(_id);
- label = _label;
- }
- };
-
- struct MoneroWalletListener : Monero::WalletListener
- {
- uint64_t m_height;
- bool m_need_to_refresh;
- bool m_new_transaction;
-
- MoneroWalletListener()
- {
- m_height = 0;
- m_need_to_refresh = false;
- m_new_transaction = false;
- }
-
- void moneySpent(const std::string &txId, uint64_t amount)
- {
- m_new_transaction = true;
- }
-
- void moneyReceived(const std::string &txId, uint64_t amount)
- {
- m_new_transaction = true;
- }
-
- void unconfirmedMoneyReceived(const std::string &txId, uint64_t amount)
- {
- m_new_transaction = true;
- }
-
- void newBlock(uint64_t height)
- {
- m_height = height;
- }
-
- void updated()
- {
- m_new_transaction = true;
- }
-
- void refreshed()
- {
- m_need_to_refresh = true;
- }
-
- void resetNeedToRefresh()
- {
- m_need_to_refresh = false;
- }
-
- bool isNeedToRefresh()
- {
- return m_need_to_refresh;
- }
-
- bool isNewTransactionExist()
- {
- return m_new_transaction;
- }
-
- void resetIsNewTransactionExist()
- {
- m_new_transaction = false;
- }
-
- uint64_t height()
- {
- return m_height;
- }
- };
-
- struct TransactionInfoRow
- {
- uint64_t amount;
- uint64_t fee;
- uint64_t blockHeight;
- uint64_t confirmations;
- uint32_t subaddrAccount;
- int8_t direction;
- int8_t isPending;
- uint32_t subaddrIndex;
-
- char *hash;
- char *paymentId;
-
- int64_t datetime;
-
- TransactionInfoRow(Monero::TransactionInfo *transaction)
- {
- amount = transaction->amount();
- fee = transaction->fee();
- blockHeight = transaction->blockHeight();
- subaddrAccount = transaction->subaddrAccount();
- std::set::iterator it = transaction->subaddrIndex().begin();
- subaddrIndex = *it;
- confirmations = transaction->confirmations();
- datetime = static_cast(transaction->timestamp());
- direction = transaction->direction();
- isPending = static_cast(transaction->isPending());
- std::string *hash_str = new std::string(transaction->hash());
- hash = strdup(hash_str->c_str());
- paymentId = strdup(transaction->paymentId().c_str());
- }
- };
-
- struct PendingTransactionRaw
- {
- uint64_t amount;
- uint64_t fee;
- char *hash;
- char *hex;
- char *txKey;
- Monero::PendingTransaction *transaction;
-
- PendingTransactionRaw(Monero::PendingTransaction *_transaction)
- {
- transaction = _transaction;
- amount = _transaction->amount();
- fee = _transaction->fee();
- hash = strdup(_transaction->txid()[0].c_str());
- hex = strdup(_transaction->hex()[0].c_str());
- txKey = strdup(_transaction->txKey()[0].c_str());
- }
- };
-
- struct CoinsInfoRow
- {
- uint64_t blockHeight;
- char *hash;
- uint64_t internalOutputIndex;
- uint64_t globalOutputIndex;
- bool spent;
- bool frozen;
- uint64_t spentHeight;
- uint64_t amount;
- bool rct;
- bool keyImageKnown;
- uint64_t pkIndex;
- uint32_t subaddrIndex;
- uint32_t subaddrAccount;
- char *address;
- char *addressLabel;
- char *keyImage;
- uint64_t unlockTime;
- bool unlocked;
- char *pubKey;
- bool coinbase;
- char *description;
-
- CoinsInfoRow(Monero::CoinsInfo *coinsInfo)
- {
- blockHeight = coinsInfo->blockHeight();
- std::string *hash_str = new std::string(coinsInfo->hash());
- hash = strdup(hash_str->c_str());
- internalOutputIndex = coinsInfo->internalOutputIndex();
- globalOutputIndex = coinsInfo->globalOutputIndex();
- spent = coinsInfo->spent();
- frozen = coinsInfo->frozen();
- spentHeight = coinsInfo->spentHeight();
- amount = coinsInfo->amount();
- rct = coinsInfo->rct();
- keyImageKnown = coinsInfo->keyImageKnown();
- pkIndex = coinsInfo->pkIndex();
- subaddrIndex = coinsInfo->subaddrIndex();
- subaddrAccount = coinsInfo->subaddrAccount();
- address = strdup(coinsInfo->address().c_str()) ;
- addressLabel = strdup(coinsInfo->addressLabel().c_str());
- keyImage = strdup(coinsInfo->keyImage().c_str());
- unlockTime = coinsInfo->unlockTime();
- unlocked = coinsInfo->unlocked();
- pubKey = strdup(coinsInfo->pubKey().c_str());
- coinbase = coinsInfo->coinbase();
- description = strdup(coinsInfo->description().c_str());
- }
-
- void setUnlocked(bool unlocked);
- };
-
- Monero::Coins *m_coins;
-
- Monero::Wallet *m_wallet;
- Monero::TransactionHistory *m_transaction_history;
- MoneroWalletListener *m_listener;
- Monero::Subaddress *m_subaddress;
- Monero::SubaddressAccount *m_account;
- uint64_t m_last_known_wallet_height;
- uint64_t m_cached_syncing_blockchain_height = 0;
- std::list m_coins_info;
- std::mutex store_lock;
- bool is_storing = false;
-
- void change_current_wallet(Monero::Wallet *wallet)
- {
- m_wallet = wallet;
- m_listener = nullptr;
-
-
- if (wallet != nullptr)
- {
- m_transaction_history = wallet->history();
- }
- else
- {
- m_transaction_history = nullptr;
- }
-
- if (wallet != nullptr)
- {
- m_account = wallet->subaddressAccount();
- }
- else
- {
- m_account = nullptr;
- }
-
- if (wallet != nullptr)
- {
- m_subaddress = wallet->subaddress();
- }
- else
- {
- m_subaddress = nullptr;
- }
-
- m_coins_info = std::list();
-
- if (wallet != nullptr)
- {
- m_coins = wallet->coins();
- }
- else
- {
- m_coins = nullptr;
- }
- }
-
- Monero::Wallet *get_current_wallet()
- {
- return m_wallet;
- }
-
- bool create_wallet(char *path, char *password, char *language, int32_t networkType, char *error)
- {
- Monero::NetworkType _networkType = static_cast(networkType);
- Monero::WalletManager *walletManager = Monero::WalletManagerFactory::getWalletManager();
- Monero::Wallet *wallet = walletManager->createWallet(path, password, language, _networkType);
-
- int status;
- std::string errorString;
-
- wallet->statusWithErrorString(status, errorString);
-
- if (wallet->status() != Monero::Wallet::Status_Ok)
- {
- error = strdup(wallet->errorString().c_str());
- return false;
- }
-
- change_current_wallet(wallet);
-
- return true;
- }
-
- bool restore_wallet_from_seed(char *path, char *password, char *seed, int32_t networkType, uint64_t restoreHeight, char *error)
- {
- Monero::NetworkType _networkType = static_cast(networkType);
- Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->recoveryWallet(
- std::string(path),
- std::string(password),
- std::string(seed),
- _networkType,
- (uint64_t)restoreHeight);
-
- int status;
- std::string errorString;
-
- wallet->statusWithErrorString(status, errorString);
-
- if (status != Monero::Wallet::Status_Ok || !errorString.empty())
- {
- error = strdup(errorString.c_str());
- return false;
- }
-
- change_current_wallet(wallet);
- return true;
- }
-
- bool restore_wallet_from_keys(char *path, char *password, char *language, char *address, char *viewKey, char *spendKey, int32_t networkType, uint64_t restoreHeight, char *error)
- {
- Monero::NetworkType _networkType = static_cast(networkType);
- Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->createWalletFromKeys(
- std::string(path),
- std::string(password),
- std::string(language),
- _networkType,
- (uint64_t)restoreHeight,
- std::string(address),
- std::string(viewKey),
- std::string(spendKey));
-
- int status;
- std::string errorString;
-
- wallet->statusWithErrorString(status, errorString);
-
- if (status != Monero::Wallet::Status_Ok || !errorString.empty())
- {
- error = strdup(errorString.c_str());
- return false;
- }
-
- change_current_wallet(wallet);
- return true;
- }
-
- bool restore_wallet_from_spend_key(char *path, char *password, char *seed, char *language, char *spendKey, int32_t networkType, uint64_t restoreHeight, char *error)
- {
- Monero::NetworkType _networkType = static_cast(networkType);
- Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->createDeterministicWalletFromSpendKey(
- std::string(path),
- std::string(password),
- std::string(language),
- _networkType,
- (uint64_t)restoreHeight,
- std::string(spendKey));
-
- // Cache Raw to support Polyseed
- wallet->setCacheAttribute("cakewallet.seed", std::string(seed));
-
- int status;
- std::string errorString;
-
- wallet->statusWithErrorString(status, errorString);
-
- if (status != Monero::Wallet::Status_Ok || !errorString.empty())
- {
- error = strdup(errorString.c_str());
- return false;
- }
-
- change_current_wallet(wallet);
- return true;
- }
-
- bool load_wallet(char *path, char *password, int32_t nettype)
- {
- nice(19);
- Monero::NetworkType networkType = static_cast(nettype);
- Monero::WalletManager *walletManager = Monero::WalletManagerFactory::getWalletManager();
- Monero::Wallet *wallet = walletManager->openWallet(std::string(path), std::string(password), networkType);
- int status;
- std::string errorString;
-
- wallet->statusWithErrorString(status, errorString);
- change_current_wallet(wallet);
-
- return !(status != Monero::Wallet::Status_Ok || !errorString.empty());
- }
-
- char *error_string() {
- return strdup(get_current_wallet()->errorString().c_str());
- }
-
-
- bool is_wallet_exist(char *path)
- {
- return Monero::WalletManagerFactory::getWalletManager()->walletExists(std::string(path));
- }
-
- void close_current_wallet()
- {
- Monero::WalletManagerFactory::getWalletManager()->closeWallet(get_current_wallet());
- change_current_wallet(nullptr);
- }
-
- char *get_filename()
- {
- return strdup(get_current_wallet()->filename().c_str());
- }
-
- char *secret_view_key()
- {
- return strdup(get_current_wallet()->secretViewKey().c_str());
- }
-
- char *public_view_key()
- {
- return strdup(get_current_wallet()->publicViewKey().c_str());
- }
-
- char *secret_spend_key()
- {
- return strdup(get_current_wallet()->secretSpendKey().c_str());
- }
-
- char *public_spend_key()
- {
- return strdup(get_current_wallet()->publicSpendKey().c_str());
- }
-
- char *get_address(uint32_t account_index, uint32_t address_index)
- {
- return strdup(get_current_wallet()->address(account_index, address_index).c_str());
- }
-
- char *get_cache_attribute(char *name)
- {
- return strdup(get_current_wallet()->getCacheAttribute(std::string(name)).c_str());
- }
-
- bool set_cache_attribute(char *name, char *value)
- {
- get_current_wallet()->setCacheAttribute(std::string(name), std::string(value));
- return true;
- }
-
- const char *seed()
- {
- std::string _rawSeed = get_current_wallet()->getCacheAttribute("cakewallet.seed");
- if (!_rawSeed.empty())
- {
- return strdup(_rawSeed.c_str());
- }
- return strdup(get_current_wallet()->seed().c_str());
- }
-
- uint64_t get_full_balance(uint32_t account_index)
- {
- return get_current_wallet()->balance(account_index);
- }
-
- uint64_t get_unlocked_balance(uint32_t account_index)
- {
- return get_current_wallet()->unlockedBalance(account_index);
- }
-
- uint64_t get_current_height()
- {
- return get_current_wallet()->blockChainHeight();
- }
-
- uint64_t get_node_height()
- {
- return get_current_wallet()->daemonBlockChainHeight();
- }
-
- bool connect_to_node(char *error)
- {
- nice(19);
- bool is_connected = get_current_wallet()->connectToDaemon();
-
- if (!is_connected)
- {
- error = strdup(get_current_wallet()->errorString().c_str());
- }
-
- return is_connected;
- }
-
- bool setup_node(char *address, char *login, char *password, bool use_ssl, bool is_light_wallet, char *socksProxyAddress, char *error)
- {
- nice(19);
- Monero::Wallet *wallet = get_current_wallet();
-
- std::string _login = "";
- std::string _password = "";
- std::string _socksProxyAddress = "";
-
- if (login != nullptr)
- {
- _login = std::string(login);
- }
-
- if (password != nullptr)
- {
- _password = std::string(password);
- }
-
- if (socksProxyAddress != nullptr)
- {
- _socksProxyAddress = std::string(socksProxyAddress);
- }
-
- bool inited = wallet->init(std::string(address), 0, _login, _password, use_ssl, is_light_wallet, _socksProxyAddress);
-
- if (!inited)
- {
- error = strdup(wallet->errorString().c_str());
- } else if (!wallet->connectToDaemon()) {
- error = strdup(wallet->errorString().c_str());
- }
-
- return inited;
- }
-
- bool is_connected()
- {
- return get_current_wallet()->connected();
- }
-
- void start_refresh()
- {
- get_current_wallet()->refreshAsync();
- get_current_wallet()->startRefresh();
- }
-
- void set_refresh_from_block_height(uint64_t height)
- {
- get_current_wallet()->setRefreshFromBlockHeight(height);
- }
-
- void set_recovering_from_seed(bool is_recovery)
- {
- get_current_wallet()->setRecoveringFromSeed(is_recovery);
- }
-
- void store(char *path)
- {
- store_lock.lock();
- if (is_storing) {
- return;
- }
-
- is_storing = true;
- get_current_wallet()->store(std::string(path));
- is_storing = false;
- store_lock.unlock();
- }
-
- bool set_password(char *password, Utf8Box &error) {
- bool is_changed = get_current_wallet()->setPassword(std::string(password));
-
- if (!is_changed) {
- error = Utf8Box(strdup(get_current_wallet()->errorString().c_str()));
- }
-
- return is_changed;
- }
-
- bool transaction_create(char *address, char *payment_id, char *amount,
- uint8_t priority_raw, uint32_t subaddr_account,
- char **preferred_inputs, uint32_t preferred_inputs_size,
- Utf8Box &error, PendingTransactionRaw &pendingTransaction)
- {
- nice(19);
-
- std::set _preferred_inputs;
-
- for (int i = 0; i < preferred_inputs_size; i++) {
- _preferred_inputs.insert(std::string(*preferred_inputs));
- preferred_inputs++;
- }
-
- auto priority = static_cast(priority_raw);
- std::string _payment_id;
- Monero::PendingTransaction *transaction;
-
- if (payment_id != nullptr)
- {
- _payment_id = std::string(payment_id);
- }
-
- if (amount != nullptr)
- {
- uint64_t _amount = Monero::Wallet::amountFromString(std::string(amount));
- transaction = m_wallet->createTransaction(std::string(address), _payment_id, _amount, m_wallet->defaultMixin(), priority, subaddr_account, {}, _preferred_inputs);
- }
- else
- {
- transaction = m_wallet->createTransaction(std::string(address), _payment_id, Monero::optional(), m_wallet->defaultMixin(), priority, subaddr_account, {}, _preferred_inputs);
- }
-
- int status = transaction->status();
-
- if (status == Monero::PendingTransaction::Status::Status_Error || status == Monero::PendingTransaction::Status::Status_Critical)
- {
- error = Utf8Box(strdup(transaction->errorString().c_str()));
- return false;
- }
-
- if (m_listener != nullptr) {
- m_listener->m_new_transaction = true;
- }
-
- pendingTransaction = PendingTransactionRaw(transaction);
- return true;
- }
-
- bool transaction_create_mult_dest(char **addresses, char *payment_id, char **amounts, uint32_t size,
- uint8_t priority_raw, uint32_t subaddr_account,
- char **preferred_inputs, uint32_t preferred_inputs_size,
- Utf8Box &error, PendingTransactionRaw &pendingTransaction)
- {
- nice(19);
-
- std::vector _addresses;
- std::vector _amounts;
-
- for (int i = 0; i < size; i++) {
- _addresses.push_back(std::string(*addresses));
- _amounts.push_back(Monero::Wallet::amountFromString(std::string(*amounts)));
- addresses++;
- amounts++;
- }
-
- std::set _preferred_inputs;
-
- for (int i = 0; i < preferred_inputs_size; i++) {
- _preferred_inputs.insert(std::string(*preferred_inputs));
- preferred_inputs++;
- }
-
- auto priority = static_cast(priority_raw);
- std::string _payment_id;
- Monero::PendingTransaction *transaction;
-
- if (payment_id != nullptr)
- {
- _payment_id = std::string(payment_id);
- }
-
- transaction = m_wallet->createTransactionMultDest(_addresses, _payment_id, _amounts, m_wallet->defaultMixin(), priority, subaddr_account);
-
- int status = transaction->status();
-
- if (status == Monero::PendingTransaction::Status::Status_Error || status == Monero::PendingTransaction::Status::Status_Critical)
- {
- error = Utf8Box(strdup(transaction->errorString().c_str()));
- return false;
- }
-
- if (m_listener != nullptr) {
- m_listener->m_new_transaction = true;
- }
-
- pendingTransaction = PendingTransactionRaw(transaction);
- return true;
- }
-
- bool transaction_commit(PendingTransactionRaw *transaction, Utf8Box &error)
- {
- bool committed = transaction->transaction->commit();
-
- if (!committed)
- {
- error = Utf8Box(strdup(transaction->transaction->errorString().c_str()));
- } else if (m_listener != nullptr) {
- m_listener->m_new_transaction = true;
- }
-
- return committed;
- }
-
- uint64_t get_node_height_or_update(uint64_t base_eight)
- {
- if (m_cached_syncing_blockchain_height < base_eight) {
- m_cached_syncing_blockchain_height = base_eight;
- }
-
- return m_cached_syncing_blockchain_height;
- }
-
- uint64_t get_syncing_height()
- {
- if (m_listener == nullptr) {
- return 0;
- }
-
- uint64_t height = m_listener->height();
-
- if (height <= 1) {
- return 0;
- }
-
- if (height != m_last_known_wallet_height)
- {
- m_last_known_wallet_height = height;
- }
-
- return height;
- }
-
- uint64_t is_needed_to_refresh()
- {
- if (m_listener == nullptr) {
- return false;
- }
-
- bool should_refresh = m_listener->isNeedToRefresh();
-
- if (should_refresh) {
- m_listener->resetNeedToRefresh();
- }
-
- return should_refresh;
- }
-
- uint8_t is_new_transaction_exist()
- {
- if (m_listener == nullptr) {
- return false;
- }
-
- bool is_new_transaction_exist = m_listener->isNewTransactionExist();
-
- if (is_new_transaction_exist)
- {
- m_listener->resetIsNewTransactionExist();
- }
-
- return is_new_transaction_exist;
- }
-
- void set_listener()
- {
- m_last_known_wallet_height = 0;
-
- if (m_listener != nullptr)
- {
- free(m_listener);
- }
-
- m_listener = new MoneroWalletListener();
- get_current_wallet()->setListener(m_listener);
- }
-
- int64_t *subaddrress_get_all()
- {
- std::vector _subaddresses = m_subaddress->getAll();
- size_t size = _subaddresses.size();
- int64_t *subaddresses = (int64_t *)malloc(size * sizeof(int64_t));
-
- for (int i = 0; i < size; i++)
- {
- Monero::SubaddressRow *row = _subaddresses[i];
- SubaddressRow *_row = new SubaddressRow(row->getRowId(), strdup(row->getAddress().c_str()), strdup(row->getLabel().c_str()));
- subaddresses[i] = reinterpret_cast(_row);
- }
-
- return subaddresses;
- }
-
- int32_t subaddrress_size()
- {
- std::vector _subaddresses = m_subaddress->getAll();
- return _subaddresses.size();
- }
-
- void subaddress_add_row(uint32_t accountIndex, char *label)
- {
- m_subaddress->addRow(accountIndex, std::string(label));
- }
-
- void subaddress_set_label(uint32_t accountIndex, uint32_t addressIndex, char *label)
- {
- m_subaddress->setLabel(accountIndex, addressIndex, std::string(label));
- }
-
- void subaddress_refresh(uint32_t accountIndex)
- {
- m_subaddress->refresh(accountIndex);
- }
-
- int32_t account_size()
- {
- std::vector _accocunts = m_account->getAll();
- return _accocunts.size();
- }
-
- int64_t *account_get_all()
- {
- std::vector _accocunts = m_account->getAll();
- size_t size = _accocunts.size();
- int64_t *accocunts = (int64_t *)malloc(size * sizeof(int64_t));
-
- for (int i = 0; i < size; i++)
- {
- Monero::SubaddressAccountRow *row = _accocunts[i];
- AccountRow *_row = new AccountRow(row->getRowId(), strdup(row->getLabel().c_str()));
- accocunts[i] = reinterpret_cast(_row);
- }
-
- return accocunts;
- }
-
- void account_add_row(char *label)
- {
- m_account->addRow(std::string(label));
- }
-
- void account_set_label_row(uint32_t account_index, char *label)
- {
- m_account->setLabel(account_index, label);
- }
-
- void account_refresh()
- {
- m_account->refresh();
- }
-
- int64_t *transactions_get_all()
- {
- std::vector transactions = m_transaction_history->getAll();
- size_t size = transactions.size();
- int64_t *transactionAddresses = (int64_t *)malloc(size * sizeof(int64_t));
-
- for (int i = 0; i < size; i++)
- {
- Monero::TransactionInfo *row = transactions[i];
- TransactionInfoRow *tx = new TransactionInfoRow(row);
- transactionAddresses[i] = reinterpret_cast(tx);
- }
-
- return transactionAddresses;
- }
-
- void transactions_refresh()
- {
- m_transaction_history->refresh();
- }
-
- int64_t transactions_count()
- {
- return m_transaction_history->count();
- }
-
- TransactionInfoRow* get_transaction(char * txId)
- {
- Monero::TransactionInfo *row = m_transaction_history->transaction(std::string(txId));
- return new TransactionInfoRow(row);
- }
-
- int LedgerExchange(
- unsigned char *command,
- unsigned int cmd_len,
- unsigned char *response,
- unsigned int max_resp_len)
- {
- return -1;
- }
-
- int LedgerFind(char *buffer, size_t len)
- {
- return -1;
- }
-
- void on_startup()
- {
- Monero::Utils::onStartup();
- Monero::WalletManagerFactory::setLogLevel(0);
- }
-
- void rescan_blockchain()
- {
- m_wallet->rescanBlockchainAsync();
- }
-
- char * get_tx_key(char * txId)
- {
- return strdup(m_wallet->getTxKey(std::string(txId)).c_str());
- }
-
- char *get_subaddress_label(uint32_t accountIndex, uint32_t addressIndex)
- {
- return strdup(get_current_wallet()->getSubaddressLabel(accountIndex, addressIndex).c_str());
- }
-
- void set_trusted_daemon(bool arg)
- {
- m_wallet->setTrustedDaemon(arg);
- }
-
- bool trusted_daemon()
- {
- return m_wallet->trustedDaemon();
- }
-
- // Coin Control //
-
- CoinsInfoRow* coin(int index)
- {
- if (index >= 0 && index < m_coins_info.size()) {
- std::list::iterator it = m_coins_info.begin();
- std::advance(it, index);
- Monero::CoinsInfo* element = *it;
- std::cout << "Element at index " << index << ": " << element << std::endl;
- return new CoinsInfoRow(element);
- } else {
- std::cout << "Invalid index." << std::endl;
- return nullptr; // Return a default value (nullptr) for invalid index
- }
- }
-
- void refresh_coins(uint32_t accountIndex)
- {
- m_coins_info.clear();
-
- m_coins->refresh();
- for (const auto i : m_coins->getAll()) {
- if (i->subaddrAccount() == accountIndex && !(i->spent())) {
- m_coins_info.push_back(i);
- }
- }
- }
-
- uint64_t coins_count()
- {
- return m_coins_info.size();
- }
-
- CoinsInfoRow** coins_from_account(uint32_t accountIndex)
- {
- std::vector matchingCoins;
-
- for (int i = 0; i < coins_count(); i++) {
- CoinsInfoRow* coinInfo = coin(i);
- if (coinInfo->subaddrAccount == accountIndex) {
- matchingCoins.push_back(coinInfo);
- }
- }
-
- CoinsInfoRow** result = new CoinsInfoRow*[matchingCoins.size()];
- std::copy(matchingCoins.begin(), matchingCoins.end(), result);
- return result;
- }
-
- CoinsInfoRow** coins_from_txid(const char* txid, size_t* count)
- {
- std::vector matchingCoins;
-
- for (int i = 0; i < coins_count(); i++) {
- CoinsInfoRow* coinInfo = coin(i);
- if (std::string(coinInfo->hash) == txid) {
- matchingCoins.push_back(coinInfo);
- }
- }
-
- *count = matchingCoins.size();
- CoinsInfoRow** result = new CoinsInfoRow*[*count];
- std::copy(matchingCoins.begin(), matchingCoins.end(), result);
- return result;
- }
-
- CoinsInfoRow** coins_from_key_image(const char** keyimages, size_t keyimageCount, size_t* count)
- {
- std::vector matchingCoins;
-
- for (int i = 0; i < coins_count(); i++) {
- CoinsInfoRow* coinsInfoRow = coin(i);
- for (size_t j = 0; j < keyimageCount; j++) {
- if (coinsInfoRow->keyImageKnown && std::string(coinsInfoRow->keyImage) == keyimages[j]) {
- matchingCoins.push_back(coinsInfoRow);
- break;
- }
- }
- }
-
- *count = matchingCoins.size();
- CoinsInfoRow** result = new CoinsInfoRow*[*count];
- std::copy(matchingCoins.begin(), matchingCoins.end(), result);
- return result;
- }
-
- void freeze_coin(int index)
- {
- m_coins->setFrozen(index);
- }
-
- void thaw_coin(int index)
- {
- m_coins->thaw(index);
- }
-
- // Sign Messages //
-
- char *sign_message(char *message, char *address = "")
- {
- return strdup(get_current_wallet()->signMessage(std::string(message), std::string(address)).c_str());
- }
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/cw_monero/ios/Classes/monero_api.h b/cw_monero/ios/Classes/monero_api.h
deleted file mode 100644
index fa92a038d..000000000
--- a/cw_monero/ios/Classes/monero_api.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#include
-#include
-#include
-#include "CwWalletListener.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-bool create_wallet(char *path, char *password, char *language, int32_t networkType, char *error);
-bool restore_wallet_from_seed(char *path, char *password, char *seed, int32_t networkType, uint64_t restoreHeight, char *error);
-bool restore_wallet_from_keys(char *path, char *password, char *language, char *address, char *viewKey, char *spendKey, int32_t networkType, uint64_t restoreHeight, char *error);
-void load_wallet(char *path, char *password, int32_t nettype);
-bool is_wallet_exist(char *path);
-
-char *get_filename();
-const char *seed();
-char *get_address(uint32_t account_index, uint32_t address_index);
-uint64_t get_full_balance(uint32_t account_index);
-uint64_t get_unlocked_balance(uint32_t account_index);
-uint64_t get_current_height();
-uint64_t get_node_height();
-
-bool is_connected();
-
-bool setup_node(char *address, char *login, char *password, bool use_ssl, bool is_light_wallet, char *error);
-bool connect_to_node(char *error);
-void start_refresh();
-void set_refresh_from_block_height(uint64_t height);
-void set_recovering_from_seed(bool is_recovery);
-void store(char *path);
-
-void set_trusted_daemon(bool arg);
-bool trusted_daemon();
-char *sign_message(char *message, char *address);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/cw_monero/ios/cw_monero.podspec b/cw_monero/ios/cw_monero.podspec
deleted file mode 100644
index d99bba923..000000000
--- a/cw_monero/ios/cw_monero.podspec
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint cw_monero.podspec' to validate before publishing.
-#
-Pod::Spec.new do |s|
- s.name = 'cw_monero'
- s.version = '0.0.2'
- s.summary = 'CW Monero'
- s.description = 'Cake Wallet wrapper over Monero project.'
- s.homepage = 'http://cakewallet.com'
- s.license = { :file => '../LICENSE' }
- s.author = { 'CakeWallet' => 'support@cakewallet.com' }
- s.source = { :path => '.' }
- s.source_files = 'Classes/**/*'
- s.public_header_files = 'Classes/**/*.h, Classes/*.h, External/ios/libs/monero/include/External/ios/**/*.h'
- s.dependency 'Flutter'
- s.dependency 'cw_shared_external'
- s.platform = :ios, '10.0'
- s.swift_version = '4.0'
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'arm64', 'ENABLE_BITCODE' => 'NO' }
- s.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/Classes/*.h" }
-
- s.subspec 'OpenSSL' do |openssl|
- openssl.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h'
- openssl.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libcrypto.a', '../../../../../cw_shared_external/ios/External/ios/lib/libssl.a'
- openssl.libraries = 'ssl', 'crypto'
- openssl.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" }
- end
-
- s.subspec 'Sodium' do |sodium|
- sodium.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h'
- sodium.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libsodium.a'
- sodium.libraries = 'sodium'
- sodium.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" }
- end
-
- s.subspec 'Unbound' do |unbound|
- unbound.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h'
- unbound.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libunbound.a'
- unbound.libraries = 'unbound'
- unbound.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" }
- end
-
- s.subspec 'Boost' do |boost|
- boost.preserve_paths = '../../../../../cw_shared_external/ios/External/ios/include/**/*.h',
- boost.vendored_libraries = '../../../../../cw_shared_external/ios/External/ios/lib/libboost.a',
- boost.libraries = 'boost'
- boost.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include/**" }
- end
-
- s.subspec 'Monero' do |monero|
- monero.preserve_paths = 'External/ios/include/**/*.h'
- monero.vendored_libraries = 'External/ios/lib/libmonero.a'
- monero.libraries = 'monero'
- monero.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include" }
- end
-
- # s.subspec 'lmdb' do |lmdb|
- # lmdb.vendored_libraries = 'External/ios/lib/liblmdb.a'
- # lmdb.libraries = 'lmdb'
- # end
-end
diff --git a/cw_monero/lib/api/account_list.dart b/cw_monero/lib/api/account_list.dart
index 451ba5033..199896631 100644
--- a/cw_monero/lib/api/account_list.dart
+++ b/cw_monero/lib/api/account_list.dart
@@ -1,38 +1,28 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-import 'package:cw_monero/api/signatures.dart';
-import 'package:cw_monero/api/types.dart';
-import 'package:cw_monero/api/monero_api.dart';
-import 'package:cw_monero/api/structs/account_row.dart';
-import 'package:flutter/foundation.dart';
import 'package:cw_monero/api/wallet.dart';
+import 'package:monero/monero.dart' as monero;
-final accountSizeNative = moneroApi
- .lookup>('account_size')
- .asFunction();
+monero.wallet? wptr = null;
-final accountRefreshNative = moneroApi
- .lookup>('account_refresh')
- .asFunction();
+int _wlptrForW = 0;
+monero.WalletListener? _wlptr = null;
-final accountGetAllNative = moneroApi
- .lookup>('account_get_all')
- .asFunction();
+monero.WalletListener getWlptr() {
+ if (wptr!.address == _wlptrForW) return _wlptr!;
+ _wlptrForW = wptr!.address;
+ _wlptr = monero.MONERO_cw_getWalletListener(wptr!);
+ return _wlptr!;
+}
-final accountAddNewNative = moneroApi
- .lookup>('account_add_row')
- .asFunction();
-final accountSetLabelNative = moneroApi
- .lookup>('account_set_label_row')
- .asFunction();
+monero.SubaddressAccount? subaddressAccount;
bool isUpdating = false;
void refreshAccounts() {
try {
isUpdating = true;
- accountRefreshNative();
+ subaddressAccount = monero.Wallet_subaddressAccount(wptr!);
+ monero.SubaddressAccount_refresh(subaddressAccount!);
isUpdating = false;
} catch (e) {
isUpdating = false;
@@ -40,26 +30,27 @@ void refreshAccounts() {
}
}
-List getAllAccount() {
- final size = accountSizeNative();
- final accountAddressesPointer = accountGetAllNative();
- final accountAddresses = accountAddressesPointer.asTypedList(size);
-
- return accountAddresses
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
+List getAllAccount() {
+ // final size = monero.Wallet_numSubaddressAccounts(wptr!);
+ refreshAccounts();
+ int size = monero.SubaddressAccount_getAll_size(subaddressAccount!);
+ print("size: $size");
+ if (size == 0) {
+ monero.Wallet_addSubaddressAccount(wptr!);
+ return getAllAccount();
+ }
+ return List.generate(size, (index) {
+ return monero.SubaddressAccount_getAll_byIndex(subaddressAccount!, index: index);
+ });
}
void addAccountSync({required String label}) {
- final labelPointer = label.toNativeUtf8();
- accountAddNewNative(labelPointer);
- calloc.free(labelPointer);
+ monero.Wallet_addSubaddressAccount(wptr!, label: label);
}
void setLabelForAccountSync({required int accountIndex, required String label}) {
- final labelPointer = label.toNativeUtf8();
- accountSetLabelNative(accountIndex, labelPointer);
- calloc.free(labelPointer);
+ // TODO(mrcyjanek): this may be wrong function?
+ monero.Wallet_setSubaddressLabel(wptr!, accountIndex: accountIndex, addressIndex: 0, label: label);
}
void _addAccount(String label) => addAccountSync(label: label);
@@ -72,12 +63,11 @@ void _setLabelForAccount(Map args) {
}
Future addAccount({required String label}) async {
- await compute(_addAccount, label);
+ _addAccount(label);
await store();
}
Future setLabelForAccount({required int accountIndex, required String label}) async {
- await compute(
- _setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
+ _setLabelForAccount({'accountIndex': accountIndex, 'label': label});
await store();
}
\ No newline at end of file
diff --git a/cw_monero/lib/api/coins_info.dart b/cw_monero/lib/api/coins_info.dart
index d7350a6e2..c1b634cc6 100644
--- a/cw_monero/lib/api/coins_info.dart
+++ b/cw_monero/lib/api/coins_info.dart
@@ -1,35 +1,17 @@
-import 'dart:ffi';
-import 'package:cw_monero/api/signatures.dart';
-import 'package:cw_monero/api/structs/coins_info_row.dart';
-import 'package:cw_monero/api/types.dart';
-import 'package:cw_monero/api/monero_api.dart';
+import 'package:cw_monero/api/account_list.dart';
+import 'package:monero/monero.dart' as monero;
-final refreshCoinsNative = moneroApi
- .lookup>('refresh_coins')
- .asFunction();
+monero.Coins? coins = null;
-final coinsCountNative = moneroApi
- .lookup>('coins_count')
- .asFunction();
+void refreshCoins(int accountIndex) {
+ coins = monero.Wallet_coins(wptr!);
+ monero.Coins_refresh(coins!);
+}
-final coinNative = moneroApi
- .lookup>('coin')
- .asFunction();
+int countOfCoins() => monero.Coins_count(coins!);
-final freezeCoinNative = moneroApi
- .lookup>('freeze_coin')
- .asFunction();
+monero.CoinsInfo getCoin(int index) => monero.Coins_coin(coins!, index);
-final thawCoinNative = moneroApi
- .lookup>('thaw_coin')
- .asFunction();
+void freezeCoin(int index) => monero.Coins_setFrozen(coins!, index: index);
-void refreshCoins(int accountIndex) => refreshCoinsNative(accountIndex);
-
-int countOfCoins() => coinsCountNative();
-
-CoinsInfoRow getCoin(int index) => coinNative(index).ref;
-
-void freezeCoin(int index) => freezeCoinNative(index);
-
-void thawCoin(int index) => thawCoinNative(index);
+void thawCoin(int index) => monero.Coins_thaw(coins!, index: index);
diff --git a/cw_monero/lib/api/convert_utf8_to_string.dart b/cw_monero/lib/api/convert_utf8_to_string.dart
deleted file mode 100644
index 41a6b648a..000000000
--- a/cw_monero/lib/api/convert_utf8_to_string.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-String convertUTF8ToString({required Pointer pointer}) {
- final str = pointer.toDartString();
- calloc.free(pointer);
- return str;
-}
\ No newline at end of file
diff --git a/cw_monero/lib/api/monero_api.dart b/cw_monero/lib/api/monero_api.dart
deleted file mode 100644
index 398d737d1..000000000
--- a/cw_monero/lib/api/monero_api.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-import 'dart:ffi';
-import 'dart:io';
-
-final DynamicLibrary moneroApi = Platform.isAndroid
- ? DynamicLibrary.open("libcw_monero.so")
- : DynamicLibrary.open("cw_monero.framework/cw_monero");
\ No newline at end of file
diff --git a/cw_monero/lib/api/signatures.dart b/cw_monero/lib/api/signatures.dart
deleted file mode 100644
index 40f338c8c..000000000
--- a/cw_monero/lib/api/signatures.dart
+++ /dev/null
@@ -1,160 +0,0 @@
-import 'dart:ffi';
-import 'package:cw_monero/api/structs/coins_info_row.dart';
-import 'package:cw_monero/api/structs/pending_transaction.dart';
-import 'package:cw_monero/api/structs/transaction_info_row.dart';
-import 'package:cw_monero/api/structs/ut8_box.dart';
-import 'package:ffi/ffi.dart';
-
-typedef create_wallet = Int8 Function(
- Pointer, Pointer, Pointer, Int32, Pointer);
-
-typedef restore_wallet_from_seed = Int8 Function(
- Pointer, Pointer, Pointer, Int32, Int64, Pointer);
-
-typedef restore_wallet_from_keys = Int8 Function(Pointer, Pointer, Pointer,
- Pointer, Pointer, Pointer, Int32, Int64, Pointer);
-
-typedef restore_wallet_from_spend_key = Int8 Function(Pointer, Pointer, Pointer,
- Pointer, Pointer, Int32, Int64, Pointer);
-
-// typedef restore_wallet_from_device = Int8 Function(Pointer, Pointer, Pointer,
-// Int32, Int64, Pointer);
-
-typedef is_wallet_exist = Int8 Function(Pointer);
-
-typedef load_wallet = Int8 Function(Pointer, Pointer, Int8);
-
-typedef error_string = Pointer Function();
-
-typedef get_filename = Pointer Function();
-
-typedef get_seed = Pointer Function();
-
-typedef get_address = Pointer Function(Int32, Int32);
-
-typedef get_full_balanace = Int64 Function(Int32);
-
-typedef get_unlocked_balanace = Int64 Function(Int32);
-
-typedef get_current_height = Int64 Function();
-
-typedef get_node_height = Int64 Function();
-
-typedef is_connected = Int8 Function();
-
-typedef setup_node = Int8 Function(
- Pointer, Pointer?, Pointer?, Int8, Int8, Pointer?, Pointer);
-
-typedef start_refresh = Void Function();
-
-typedef connect_to_node = Int8 Function();
-
-typedef set_refresh_from_block_height = Void Function(Int64);
-
-typedef set_recovering_from_seed = Void Function(Int8);
-
-typedef store_c = Void Function(Pointer);
-
-typedef set_password = Int8 Function(Pointer password, Pointer error);
-
-typedef set_listener = Void Function();
-
-typedef get_syncing_height = Int64 Function();
-
-typedef is_needed_to_refresh = Int8 Function();
-
-typedef is_new_transaction_exist = Int8 Function();
-
-typedef subaddrress_size = Int32 Function();
-
-typedef subaddrress_refresh = Void Function(Int32);
-
-typedef subaddress_get_all = Pointer Function();
-
-typedef subaddress_add_new = Void Function(Int32 accountIndex, Pointer label);
-
-typedef subaddress_set_label = Void Function(
- Int32 accountIndex, Int32 addressIndex, Pointer label);
-
-typedef account_size = Int32 Function();
-
-typedef account_refresh = Void Function();
-
-typedef account_get_all = Pointer Function();
-
-typedef account_add_new = Void Function(Pointer label);
-
-typedef account_set_label = Void Function(Int32 accountIndex, Pointer label);
-
-typedef transactions_refresh = Void Function();
-
-typedef get_transaction = Pointer Function(Pointer txId);
-
-typedef get_tx_key = Pointer? Function(Pointer txId);
-
-typedef transactions_count = Int64 Function();
-
-typedef transactions_get_all = Pointer Function();
-
-typedef transaction_create = Int8 Function(
- Pointer address,
- Pointer paymentId,
- Pointer amount,
- Int8 priorityRaw,
- Int32 subaddrAccount,
- Pointer> preferredInputs,
- Int32 preferredInputsSize,
- Pointer error,
- Pointer pendingTransaction);
-
-typedef transaction_create_mult_dest = Int8 Function(
- Pointer> addresses,
- Pointer paymentId,
- Pointer> amounts,
- Int32 size,
- Int8 priorityRaw,
- Int32 subaddrAccount,
- Pointer> preferredInputs,
- Int32 preferredInputsSize,
- Pointer error,
- Pointer pendingTransaction);
-
-typedef transaction_commit = Int8 Function(Pointer, Pointer);
-
-typedef secret_view_key = Pointer Function();
-
-typedef public_view_key = Pointer Function();
-
-typedef secret_spend_key = Pointer Function();
-
-typedef public_spend_key = Pointer Function();
-
-typedef close_current_wallet = Void Function();
-
-typedef on_startup = Void Function();
-
-typedef rescan_blockchain = Void Function();
-
-typedef get_subaddress_label = Pointer Function(Int32 accountIndex, Int32 addressIndex);
-
-typedef set_trusted_daemon = Void Function(Int8 trusted);
-
-typedef trusted_daemon = Int8 Function();
-
-typedef refresh_coins = Void Function(Int32 accountIndex);
-
-typedef coins_count = Int64 Function();
-
-// typedef coins_from_txid = Pointer Function(Pointer txid);
-
-typedef coin = Pointer Function(Int32 index);
-
-typedef freeze_coin = Void Function(Int32 index);
-
-typedef thaw_coin = Void Function(Int32 index);
-
-typedef sign_message = Pointer Function(Pointer message, Pointer address);
-
-typedef get_cache_attribute = Pointer Function(Pointer name);
-
-typedef set_cache_attribute = Int8 Function(Pointer name, Pointer value);
diff --git a/cw_monero/lib/api/structs/pending_transaction.dart b/cw_monero/lib/api/structs/pending_transaction.dart
index 656ed333f..dc5fbddd0 100644
--- a/cw_monero/lib/api/structs/pending_transaction.dart
+++ b/cw_monero/lib/api/structs/pending_transaction.dart
@@ -1,25 +1,3 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class PendingTransactionRaw extends Struct {
- @Int64()
- external int amount;
-
- @Int64()
- external int fee;
-
- external Pointer hash;
-
- external Pointer hex;
-
- external Pointer txKey;
-
- String getHash() => hash.toDartString();
-
- String getHex() => hex.toDartString();
-
- String getKey() => txKey.toDartString();
-}
class PendingTransactionDescription {
PendingTransactionDescription({
diff --git a/cw_monero/lib/api/subaddress_list.dart b/cw_monero/lib/api/subaddress_list.dart
index 1c1f1253f..57edea76e 100644
--- a/cw_monero/lib/api/subaddress_list.dart
+++ b/cw_monero/lib/api/subaddress_list.dart
@@ -1,38 +1,23 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-import 'package:flutter/foundation.dart';
-import 'package:cw_monero/api/signatures.dart';
-import 'package:cw_monero/api/types.dart';
-import 'package:cw_monero/api/monero_api.dart';
-import 'package:cw_monero/api/structs/subaddress_row.dart';
+
+import 'package:cw_monero/api/account_list.dart';
import 'package:cw_monero/api/wallet.dart';
-
-final subaddressSizeNative = moneroApi
- .lookup>('subaddrress_size')
- .asFunction();
-
-final subaddressRefreshNative = moneroApi
- .lookup>('subaddress_refresh')
- .asFunction();
-
-final subaddrressGetAllNative = moneroApi
- .lookup>('subaddrress_get_all')
- .asFunction();
-
-final subaddrressAddNewNative = moneroApi
- .lookup>('subaddress_add_row')
- .asFunction();
-
-final subaddrressSetLabelNative = moneroApi
- .lookup>('subaddress_set_label')
- .asFunction();
+import 'package:monero/monero.dart' as monero;
bool isUpdating = false;
+class SubaddressInfoMetadata {
+ SubaddressInfoMetadata({
+ required this.accountIndex,
+ });
+ int accountIndex;
+}
+
+SubaddressInfoMetadata? subaddress = null;
+
void refreshSubaddresses({required int accountIndex}) {
try {
isUpdating = true;
- subaddressRefreshNative(accountIndex);
+ subaddress = SubaddressInfoMetadata(accountIndex: accountIndex);
isUpdating = false;
} catch (e) {
isUpdating = false;
@@ -40,28 +25,39 @@ void refreshSubaddresses({required int accountIndex}) {
}
}
-List getAllSubaddresses() {
- final size = subaddressSizeNative();
- final subaddressAddressesPointer = subaddrressGetAllNative();
- final subaddressAddresses = subaddressAddressesPointer.asTypedList(size);
+class Subaddress {
+ Subaddress({
+ required this.addressIndex,
+ required this.accountIndex,
+ });
+ String get address => monero.Wallet_address(
+ wptr!,
+ accountIndex: accountIndex,
+ addressIndex: addressIndex,
+ );
+ final int addressIndex;
+ final int accountIndex;
+ String get label => monero.Wallet_getSubaddressLabel(wptr!, accountIndex: accountIndex, addressIndex: addressIndex);
+}
- return subaddressAddresses
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
+List getAllSubaddresses() {
+ final size = monero.Wallet_numSubaddresses(wptr!, accountIndex: subaddress!.accountIndex);
+ return List.generate(size, (index) {
+ return Subaddress(
+ accountIndex: subaddress!.accountIndex,
+ addressIndex: index,
+ );
+ }).reversed.toList();
}
void addSubaddressSync({required int accountIndex, required String label}) {
- final labelPointer = label.toNativeUtf8();
- subaddrressAddNewNative(accountIndex, labelPointer);
- calloc.free(labelPointer);
+ monero.Wallet_addSubaddress(wptr!, accountIndex: accountIndex, label: label);
+ refreshSubaddresses(accountIndex: accountIndex);
}
void setLabelForSubaddressSync(
{required int accountIndex, required int addressIndex, required String label}) {
- final labelPointer = label.toNativeUtf8();
-
- subaddrressSetLabelNative(accountIndex, addressIndex, labelPointer);
- calloc.free(labelPointer);
+ monero.Wallet_setSubaddressLabel(wptr!, accountIndex: accountIndex, addressIndex: addressIndex, label: label);
}
void _addSubaddress(Map args) {
@@ -81,14 +77,13 @@ void _setLabelForSubaddress(Map args) {
}
Future addSubaddress({required int accountIndex, required String label}) async {
- await compute