diff --git a/cw_haven/.gitignore b/cw_haven/.gitignore
deleted file mode 100644
index e9dc58d3d..000000000
--- a/cw_haven/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-.DS_Store
-.dart_tool/
-
-.packages
-.pub/
-
-build/
diff --git a/cw_haven/.metadata b/cw_haven/.metadata
deleted file mode 100644
index cb1a29e7c..000000000
--- a/cw_haven/.metadata
+++ /dev/null
@@ -1,10 +0,0 @@
-# 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 and should not be manually edited.
-
-version:
- revision: 4d7946a68d26794349189cf21b3f68cc6fe61dcb
- channel: stable
-
-project_type: plugin
diff --git a/cw_haven/CHANGELOG.md b/cw_haven/CHANGELOG.md
deleted file mode 100644
index 41cc7d819..000000000
--- a/cw_haven/CHANGELOG.md
+++ /dev/null
@@ -1,3 +0,0 @@
-## 0.0.1
-
-* TODO: Describe initial release.
diff --git a/cw_haven/LICENSE b/cw_haven/LICENSE
deleted file mode 100644
index ba75c69f7..000000000
--- a/cw_haven/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-TODO: Add your license here.
diff --git a/cw_haven/README.md b/cw_haven/README.md
deleted file mode 100644
index 150aebc42..000000000
--- a/cw_haven/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# cw_haven
-
-A new flutter plugin project.
-
-## Getting Started
-
-This project is a starting point for a Flutter
-[plug-in package](https://flutter.dev/developing-packages/),
-a specialized package that includes platform-specific implementation code for
-Android and/or iOS.
-
-For help getting started with Flutter, view our
-[online documentation](https://flutter.dev/docs), which offers tutorials,
-samples, guidance on mobile development, and a full API reference.
-
diff --git a/cw_haven/android/.gitignore b/cw_haven/android/.gitignore
deleted file mode 100644
index c6cbe562a..000000000
--- a/cw_haven/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_haven/android/CMakeLists.txt b/cw_haven/android/CMakeLists.txt
deleted file mode 100644
index 04faca0e6..000000000
--- a/cw_haven/android/CMakeLists.txt
+++ /dev/null
@@ -1,220 +0,0 @@
-cmake_minimum_required(VERSION 3.4.1)
-
-add_library( cw_haven
- SHARED
- ../ios/Classes/haven_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)
-
-#############
-# Haven
-#############
-
-add_library(wallet_api STATIC IMPORTED)
-set_target_properties(wallet_api PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libwallet_api.a)
-
-add_library(wallet STATIC IMPORTED)
-set_target_properties(wallet PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libwallet.a)
-
-add_library(cryptonote_core STATIC IMPORTED)
-set_target_properties(cryptonote_core PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libcryptonote_core.a)
-
-add_library(cryptonote_basic STATIC IMPORTED)
-set_target_properties(cryptonote_basic PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libcryptonote_basic.a)
-
-add_library(mnemonics STATIC IMPORTED)
-set_target_properties(mnemonics PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libmnemonics.a)
-
-add_library(common STATIC IMPORTED)
-set_target_properties(common PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libcommon.a)
-
-add_library(cncrypto STATIC IMPORTED)
-set_target_properties(cncrypto PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libcncrypto.a)
-
-add_library(ringct STATIC IMPORTED)
-set_target_properties(ringct PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libringct.a)
-
-add_library(ringct_basic STATIC IMPORTED)
-set_target_properties(ringct_basic PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libringct_basic.a)
-
-add_library(blockchain_db STATIC IMPORTED)
-set_target_properties(blockchain_db PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libblockchain_db.a)
-
-add_library(lmdb STATIC IMPORTED)
-set_target_properties(lmdb PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/liblmdb.a)
-
-add_library(easylogging STATIC IMPORTED)
-set_target_properties(easylogging PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libeasylogging.a)
-
-add_library(unbound STATIC IMPORTED)
-set_target_properties(unbound PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libunbound.a)
-
-add_library(epee STATIC IMPORTED)
-set_target_properties(epee PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libepee.a)
-
-add_library(checkpoints STATIC IMPORTED)
-set_target_properties(checkpoints PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libcheckpoints.a)
-
-add_library(device STATIC IMPORTED)
-set_target_properties(device PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libdevice.a)
-
-add_library(device_trezor STATIC IMPORTED)
-set_target_properties(device_trezor PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libdevice_trezor.a)
-
-add_library(multisig STATIC IMPORTED)
-set_target_properties(multisig PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libmultisig.a)
-
-add_library(version STATIC IMPORTED)
-set_target_properties(version PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libversion.a)
-
-add_library(net STATIC IMPORTED)
-set_target_properties(net PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libnet.a)
-
-add_library(hardforks STATIC IMPORTED)
-set_target_properties(hardforks PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libhardforks.a)
-
-add_library(randomx STATIC IMPORTED)
-set_target_properties(randomx PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/librandomx.a)
-
-add_library(offshore STATIC IMPORTED)
-set_target_properties(offshore PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/liboffshore.a)
-
-
-add_library(rpc_base STATIC IMPORTED)
-set_target_properties(rpc_base PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/librpc_base.a)
-
-add_library(wallet-crypto STATIC IMPORTED)
-set_target_properties(wallet-crypto PROPERTIES IMPORTED_LOCATION
- ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/lib/haven/libwallet-crypto.a)
-
-include_directories( ${EXTERNAL_LIBS_DIR}/${ANDROID_ABI}/include )
-
-target_link_libraries( cw_haven
-
- wallet_api
- wallet
- cryptonote_core
- cryptonote_basic
- mnemonics
- ringct
- ringct_basic
- net
- common
- cncrypto
- blockchain_db
- lmdb
- easylogging
- unbound
- epee
- checkpoints
- device
- device_trezor
- multisig
- version
- randomx
- offshore
- hardforks
- rpc_base
-
- 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_haven/android/build.gradle b/cw_haven/android/build.gradle
deleted file mode 100644
index 8eb728a67..000000000
--- a/cw_haven/android/build.gradle
+++ /dev/null
@@ -1,56 +0,0 @@
-group 'com.cakewallet.cw_haven'
-version '1.0-SNAPSHOT'
-
-buildscript {
- ext.kotlin_version = '2.0.21'
- repositories {
- google()
- mavenCentral()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:8.7.1'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-
-rootProject.allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android'
-
-android {
- compileSdkVersion 33
-
- if (project.android.hasProperty("namespace")) {
- namespace 'com.cakewallet.cw_haven'
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlinOptions {
- jvmTarget = '17'
- }
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
- defaultConfig {
- minSdkVersion 21
- }
- externalNativeBuild {
- cmake {
- }
- }
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
diff --git a/cw_haven/android/gradle.properties b/cw_haven/android/gradle.properties
deleted file mode 100644
index 94adc3a3f..000000000
--- a/cw_haven/android/gradle.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-org.gradle.jvmargs=-Xmx1536M
-android.useAndroidX=true
-android.enableJetifier=true
diff --git a/cw_haven/android/gradle/wrapper/gradle-wrapper.properties b/cw_haven/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 3c9d0852b..000000000
--- a/cw_haven/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-6.7-all.zip
diff --git a/cw_haven/android/settings.gradle b/cw_haven/android/settings.gradle
deleted file mode 100644
index 2a0a2fea8..000000000
--- a/cw_haven/android/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = 'cw_haven'
diff --git a/cw_haven/android/src/main/AndroidManifest.xml b/cw_haven/android/src/main/AndroidManifest.xml
deleted file mode 100644
index b72b21d5d..000000000
--- a/cw_haven/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/cw_haven/android/src/main/kotlin/com/cakewallet/cw_haven/CwHavenPlugin.kt b/cw_haven/android/src/main/kotlin/com/cakewallet/cw_haven/CwHavenPlugin.kt
deleted file mode 100644
index b31493c6e..000000000
--- a/cw_haven/android/src/main/kotlin/com/cakewallet/cw_haven/CwHavenPlugin.kt
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.cakewallet.cw_haven
-
-import androidx.annotation.NonNull
-
-import io.flutter.embedding.engine.plugins.FlutterPlugin
-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
-
-/** CwHavenPlugin */
-class CwHavenPlugin: FlutterPlugin, MethodCallHandler {
- /// The MethodChannel that will the communication between Flutter and native Android
- ///
- /// This local reference serves to register the plugin with the Flutter Engine and unregister it
- /// when the Flutter Engine is detached from the Activity
- private lateinit var channel : MethodChannel
-
- override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
- channel = MethodChannel(flutterPluginBinding.binaryMessenger, "cw_haven")
- channel.setMethodCallHandler(this)
- }
-
- override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
- if (call.method == "getPlatformVersion") {
- result.success("Android ${android.os.Build.VERSION.RELEASE}")
- } else {
- result.notImplemented()
- }
- }
-
- override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
- channel.setMethodCallHandler(null)
- }
-}
diff --git a/cw_haven/ios/.gitignore b/cw_haven/ios/.gitignore
deleted file mode 100644
index aa479fd3c..000000000
--- a/cw_haven/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_haven/ios/Assets/.gitkeep b/cw_haven/ios/Assets/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/cw_haven/ios/Classes/CwHavenPlugin.h b/cw_haven/ios/Classes/CwHavenPlugin.h
deleted file mode 100644
index 8a4195232..000000000
--- a/cw_haven/ios/Classes/CwHavenPlugin.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#import
-
-@interface CwHavenPlugin : NSObject
-@end
diff --git a/cw_haven/ios/Classes/CwHavenPlugin.m b/cw_haven/ios/Classes/CwHavenPlugin.m
deleted file mode 100644
index 4683f4b68..000000000
--- a/cw_haven/ios/Classes/CwHavenPlugin.m
+++ /dev/null
@@ -1,15 +0,0 @@
-#import "CwHavenPlugin.h"
-#if __has_include()
-#import
-#else
-// Support project import fallback if the generated compatibility header
-// is not copied when this plugin is created as a library.
-// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
-#import "cw_haven-Swift.h"
-#endif
-
-@implementation CwHavenPlugin
-+ (void)registerWithRegistrar:(NSObject*)registrar {
- [SwiftCwHavenPlugin registerWithRegistrar:registrar];
-}
-@end
diff --git a/cw_haven/ios/Classes/SwiftCwHavenPlugin.swift b/cw_haven/ios/Classes/SwiftCwHavenPlugin.swift
deleted file mode 100644
index ddee88ae7..000000000
--- a/cw_haven/ios/Classes/SwiftCwHavenPlugin.swift
+++ /dev/null
@@ -1,14 +0,0 @@
-import Flutter
-import UIKit
-
-public class SwiftCwHavenPlugin: NSObject, FlutterPlugin {
- public static func register(with registrar: FlutterPluginRegistrar) {
- let channel = FlutterMethodChannel(name: "cw_haven", binaryMessenger: registrar.messenger())
- let instance = SwiftCwHavenPlugin()
- registrar.addMethodCallDelegate(instance, channel: channel)
- }
-
- public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
- result("iOS " + UIDevice.current.systemVersion)
- }
-}
diff --git a/cw_haven/ios/Classes/haven_api.cpp b/cw_haven/ios/Classes/haven_api.cpp
deleted file mode 100644
index aecaf0016..000000000
--- a/cw_haven/ios/Classes/haven_api.cpp
+++ /dev/null
@@ -1,942 +0,0 @@
-#include
-#include "cstdlib"
-#include
-#include
-#include
-#include
-#include
-#include "thread"
-#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 HavenBalance
- {
- uint64_t amount;
- char *assetType;
-
- HavenBalance(char *_assetType, uint64_t _amount)
- {
- amount = _amount;
- assetType = _assetType;
- }
- };
-
- struct HavenRate
- {
- uint64_t rate;
- char *assetType;
-
- HavenRate(char *_assetType, uint64_t _rate)
- {
- rate = _rate;
- assetType = _assetType;
- }
- };
-
- 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, std::string assetType)
- {
- m_new_transaction = true;
- }
-
- void moneyReceived(const std::string &txId, uint64_t amount, std::string assetType)
- {
- 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;
- char *assetType;
-
- 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());
- assetType = strdup(transaction->assetType().c_str());
- }
- };
-
- struct PendingTransactionRaw
- {
- uint64_t amount;
- uint64_t fee;
- char *hash;
- Monero::PendingTransaction *transaction;
-
- PendingTransactionRaw(Monero::PendingTransaction *_transaction)
- {
- transaction = _transaction;
- amount = _transaction->amount();
- fee = _transaction->fee();
- hash = strdup(_transaction->txid()[0].c_str());
- }
- };
-
- 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::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;
- }
- }
-
- Monero::Wallet *get_current_wallet()
- {
- return m_wallet;
- }
-
- bool create_wallet(char *path, char *password, char *language, int32_t networkType, char *error)
- {
- Monero::WalletManagerFactory::setLogLevel(4);
-
- 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 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());
- }
-
-
- const char *seed()
- {
- return strdup(get_current_wallet()->seed().c_str());
- }
-
- int64_t *get_full_balance(uint32_t account_index)
- {
- std::map accountBalance;
- std::map> balanceSubaddresses = get_current_wallet()->balance(account_index);
- std::vector assetList = Monero::Assets::list();
- //prefill balances
- for (const auto &asset_type : assetList) {
-
- accountBalance[asset_type] = 0;
- }
- // balances are mapped to their subaddress
- // we compute total balances of account
- for (auto const& balanceSubaddress : balanceSubaddresses)
- {
-
- std::map balanceOfSubaddress = balanceSubaddress.second;
-
- for (auto const& balance : balanceOfSubaddress)
- {
-
- const std::string &assetType = balance.first;
- const uint64_t &amount = balance.second;
- accountBalance[assetType] +=amount;
- }
- }
-
- size_t size = accountBalance.size();
- int64_t *balanceAddresses = (int64_t *)malloc(size * sizeof(int64_t));
- int i = 0;
-
- for (auto const& balance : accountBalance)
- {
- char *assetType = strdup(balance.first.c_str());
- HavenBalance *hb = new HavenBalance(assetType, balance.second);
- balanceAddresses[i] = reinterpret_cast(hb);
- i++;
- }
- return balanceAddresses;
- }
-
- int64_t *get_unlocked_balance(uint32_t account_index)
- {
- std::map accountBalance;
- std::map> balanceSubaddresses = get_current_wallet()->unlockedBalance(account_index);
- std::vector assetList = Monero::Assets::list();
-
- //prefill balances
- for (const auto &asset_type : assetList) {
-
- accountBalance[asset_type] = 0;
- }
- // balances are mapped to their subaddress
- // we compute total balances of account
- for (auto const& balanceSubaddress : balanceSubaddresses)
- {
-
- std::map balanceOfSubaddress = balanceSubaddress.second;
-
- for (auto const& balance : balanceOfSubaddress)
- {
-
- const std::string &assetType = balance.first;
- const uint64_t &amount = balance.second;
- accountBalance[assetType] +=amount;
- }
- }
-
- size_t size = accountBalance.size();
- int64_t *balanceAddresses = (int64_t *)malloc(size * sizeof(int64_t));
- int i = 0;
-
- for (auto const& balance : accountBalance)
- {
- char *assetType = strdup(balance.first.c_str());
- HavenBalance *hb = new HavenBalance(assetType, balance.second);
- balanceAddresses[i] = reinterpret_cast(hb);
- i++;
- }
- return balanceAddresses;
- }
-
- 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 *error)
- {
- nice(19);
- Monero::Wallet *wallet = get_current_wallet();
-
- std::string _login = "";
- std::string _password = "";
-
- if (login != nullptr)
- {
- _login = std::string(login);
- }
-
- if (password != nullptr)
- {
- _password = std::string(password);
- }
-
- bool inited = wallet->init(std::string(address), 0, _login, _password, use_ssl, is_light_wallet);
-
- 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 *asset_type, char *payment_id, char *amount,
- uint8_t priority_raw, uint32_t subaddr_account, Utf8Box &error, PendingTransactionRaw &pendingTransaction)
- {
- nice(19);
-
- 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, std::string(asset_type), std::string(asset_type), m_wallet->defaultMixin(), priority, subaddr_account, {});
- }
- else
- {
- transaction = m_wallet->createTransaction(std::string(address), _payment_id, Monero::optional(),std::string(asset_type), std::string(asset_type), 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_create_mult_dest(char **addresses, char *asset_type, char *payment_id, char **amounts, uint32_t size,
- uint8_t priority_raw, uint32_t subaddr_account, 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++;
- }
-
- 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,
- std::string(asset_type), std::string(asset_type), 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();
- }
-
- 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(4);
- }
-
- void rescan_blockchain()
- {
- m_wallet->rescanBlockchainAsync();
- }
-
- char * get_tx_key(char * txId)
- {
- return strdup(m_wallet->getTxKey(std::string(txId)).c_str());
- }
-
- int32_t asset_types_size()
- {
- return Monero::Assets::list().size();
- }
-
- char **asset_types()
- {
- size_t size = Monero::Assets::list().size();
- std::vector assetList = Monero::Assets::list();
- char **assetTypesPts;
- assetTypesPts = (char **) malloc( size * sizeof(char*));
-
- for (int i = 0; i < size; i++)
- {
-
- std::string asset = assetList[i];
- //assetTypes[i] = (char *)malloc( 5 * sizeof(char));
- assetTypesPts[i] = strdup(asset.c_str());
- }
-
- return assetTypesPts;
- }
-
- std::map rates;
-
- void update_rate()
- {
- rates = get_current_wallet()->oracleRates();
- }
-
- int64_t *get_rate()
- {
- size_t size = rates.size();
- int64_t *havenRates = (int64_t *)malloc(size * sizeof(int64_t));
- int i = 0;
-
- for (auto const& rate : rates)
- {
- char *assetType = strdup(rate.first.c_str());
- HavenRate *havenRate = new HavenRate(assetType, rate.second);
- havenRates[i] = reinterpret_cast(havenRate);
- i++;
- }
-
- return havenRates;
- }
-
- int32_t size_of_rate()
- {
- return static_cast(rates.size());
- }
-
- void set_trusted_daemon(bool arg)
- {
- m_wallet->setTrustedDaemon(arg);
- }
-
- bool trusted_daemon()
- {
- return m_wallet->trustedDaemon();
- }
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/cw_haven/ios/cw_haven.podspec b/cw_haven/ios/cw_haven.podspec
deleted file mode 100644
index 4a9267d15..000000000
--- a/cw_haven/ios/cw_haven.podspec
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint cw_haven.podspec` to validate before publishing.
-#
-Pod::Spec.new do |s|
- s.name = 'cw_haven'
- s.version = '0.0.1'
- s.summary = 'Cake Wallet Haven'
- s.description = 'Cake Wallet wrapper over Haven project'
- s.homepage = 'http://cakewallet.com'
- s.license = { :file => '../LICENSE' }
- s.author = { 'Cake Wallet' => 'support@cakewallet.com' }
- s.source = { :path => '.' }
- s.source_files = 'Classes/**/*'
- s.public_header_files = 'Classes/**/*.h, Classes/*.h, ../shared_external/ios/libs/monero/include/src/**/*.h, ../shared_external/ios/libs/monero/include/contrib/**/*.h, ../shared_external/ios/libs/monero/include/../shared_external/ios/**/*.h'
- s.dependency 'Flutter'
- s.dependency 'cw_shared_external'
- s.platform = :ios, '10.0'
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'arm64', 'ENABLE_BITCODE' => 'NO' }
- s.swift_version = '5.0'
- 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 '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 'Haven' do |haven|
- haven.preserve_paths = 'External/ios/include/**/*.h'
- haven.vendored_libraries = 'External/ios/lib/libhaven.a'
- haven.libraries = 'haven'
- haven.xcconfig = { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/External/ios/include" }
- end
-end
diff --git a/cw_haven/lib/api/account_list.dart b/cw_haven/lib/api/account_list.dart
deleted file mode 100644
index 87f036206..000000000
--- a/cw_haven/lib/api/account_list.dart
+++ /dev/null
@@ -1,81 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-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:cw_haven/api/wallet.dart';
-
-final accountSizeNative = havenApi
- .lookup>('account_size')
- .asFunction();
-
-final accountRefreshNative = havenApi
- .lookup>('account_refresh')
- .asFunction();
-
-final accountGetAllNative = havenApi
- .lookup>('account_get_all')
- .asFunction();
-
-final accountAddNewNative = havenApi
- .lookup>('account_add_row')
- .asFunction();
-
-final accountSetLabelNative = havenApi
- .lookup>('account_set_label_row')
- .asFunction();
-
-bool isUpdating = false;
-
-void refreshAccounts() {
- try {
- isUpdating = true;
- accountRefreshNative();
- isUpdating = false;
- } catch (e) {
- isUpdating = false;
- rethrow;
- }
-}
-
-List getAllAccount() {
- final size = accountSizeNative();
- final accountAddressesPointer = accountGetAllNative();
- final accountAddresses = accountAddressesPointer.asTypedList(size);
-
- return accountAddresses
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
-}
-
-void addAccountSync({required String label}) {
- final labelPointer = label.toNativeUtf8();
- accountAddNewNative(labelPointer);
- calloc.free(labelPointer);
-}
-
-void setLabelForAccountSync({required int accountIndex, required String label}) {
- final labelPointer = label.toNativeUtf8();
- accountSetLabelNative(accountIndex, labelPointer);
- calloc.free(labelPointer);
-}
-
-void _addAccount(String label) => addAccountSync(label: label);
-
-void _setLabelForAccount(Map args) {
- final label = args['label'] as String;
- final accountIndex = args['accountIndex'] as int;
-
- setLabelForAccountSync(label: label, accountIndex: accountIndex);
-}
-
-Future addAccount({required String label}) async {
- _addAccount(label);
- await store();
-}
-
-Future setLabelForAccount({required int accountIndex, required String label}) async {
- _setLabelForAccount({'accountIndex': accountIndex, 'label': label});
- await store();
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/asset_types.dart b/cw_haven/lib/api/asset_types.dart
deleted file mode 100644
index f57b10f78..000000000
--- a/cw_haven/lib/api/asset_types.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-import 'dart:ffi';
-import 'package:cw_haven/api/convert_utf8_to_string.dart';
-import 'package:cw_haven/api/signatures.dart';
-import 'package:cw_haven/api/types.dart';
-import 'package:cw_haven/api/haven_api.dart';
-import 'package:ffi/ffi.dart';
-
-final assetTypesSizeNative = havenApi
- .lookup>('asset_types_size')
- .asFunction();
-
-final getAssetTypesNative = havenApi
- .lookup>('asset_types')
- .asFunction();
-
-List getAssetTypes() {
- List assetTypes = [];
- Pointer> assetTypePointers = getAssetTypesNative();
- Pointer assetpointer = assetTypePointers.elementAt(0)[0];
- String asset = convertUTF8ToString(pointer: assetpointer);
-
- return assetTypes;
-}
diff --git a/cw_haven/lib/api/balance_list.dart b/cw_haven/lib/api/balance_list.dart
deleted file mode 100644
index 3488a6583..000000000
--- a/cw_haven/lib/api/balance_list.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-import 'dart:ffi';
-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/haven_balance_row.dart';
-import 'package:cw_haven/api/structs/haven_rate.dart';
-import 'asset_types.dart';
-
-List getHavenFullBalance({int accountIndex = 0}) {
- final size = assetTypesSizeNative();
- final balanceAddressesPointer = getHavenFullBalanceNative(accountIndex);
- final balanceAddresses = balanceAddressesPointer.asTypedList(size);
-
- return balanceAddresses
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
-}
-
-List getHavenUnlockedBalance({int accountIndex = 0}) {
- final size = assetTypesSizeNative();
- final balanceAddressesPointer = getHavenUnlockedBalanceNative(accountIndex);
- final balanceAddresses = balanceAddressesPointer.asTypedList(size);
-
- return balanceAddresses
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
-}
-
-List getRate() {
- updateRateNative();
- final size = sizeOfRateNative();
- final ratePointer = getRateNative();
- final rate = ratePointer.asTypedList(size);
-
- return rate
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
-}
-
-final getHavenFullBalanceNative = havenApi
- .lookup>('get_full_balance')
- .asFunction();
-
-final getHavenUnlockedBalanceNative = havenApi
- .lookup>('get_unlocked_balance')
- .asFunction();
-
-final getRateNative = havenApi
- .lookup>('get_rate')
- .asFunction();
-
-final sizeOfRateNative = havenApi
- .lookup>('size_of_rate')
- .asFunction();
-
-final updateRateNative = havenApi
- .lookup>('update_rate')
- .asFunction();
\ No newline at end of file
diff --git a/cw_haven/lib/api/convert_utf8_to_string.dart b/cw_haven/lib/api/convert_utf8_to_string.dart
deleted file mode 100644
index 41a6b648a..000000000
--- a/cw_haven/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_haven/lib/api/cw_haven.dart b/cw_haven/lib/api/cw_haven.dart
deleted file mode 100644
index 0e48276d9..000000000
--- a/cw_haven/lib/api/cw_haven.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-
-import 'dart:async';
-
-import 'package:flutter/services.dart';
-
-class CwHaven {
- static const MethodChannel _channel =
- const MethodChannel('cw_haven');
-
- static Future get platformVersion async {
- final String version = await _channel.invokeMethod('getPlatformVersion') ?? '';
- return version;
- }
-}
diff --git a/cw_haven/lib/api/exceptions/connection_to_node_exception.dart b/cw_haven/lib/api/exceptions/connection_to_node_exception.dart
deleted file mode 100644
index 483b0a174..000000000
--- a/cw_haven/lib/api/exceptions/connection_to_node_exception.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-class ConnectionToNodeException implements Exception {
- ConnectionToNodeException({required this.message});
-
- final String message;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/exceptions/creation_transaction_exception.dart b/cw_haven/lib/api/exceptions/creation_transaction_exception.dart
deleted file mode 100644
index 7b55ec074..000000000
--- a/cw_haven/lib/api/exceptions/creation_transaction_exception.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-class CreationTransactionException implements Exception {
- CreationTransactionException({required this.message});
-
- final String message;
-
- @override
- String toString() => message;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/exceptions/setup_wallet_exception.dart b/cw_haven/lib/api/exceptions/setup_wallet_exception.dart
deleted file mode 100644
index 9d985665b..000000000
--- a/cw_haven/lib/api/exceptions/setup_wallet_exception.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-class SetupWalletException implements Exception {
- SetupWalletException({required this.message});
-
- final String message;
-
- @override
- String toString() {
- return message;
- }
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/exceptions/wallet_creation_exception.dart b/cw_haven/lib/api/exceptions/wallet_creation_exception.dart
deleted file mode 100644
index 6052366b9..000000000
--- a/cw_haven/lib/api/exceptions/wallet_creation_exception.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-class WalletCreationException implements Exception {
- WalletCreationException({required this.message});
-
- final String message;
-
- @override
- String toString() => message;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/exceptions/wallet_opening_exception.dart b/cw_haven/lib/api/exceptions/wallet_opening_exception.dart
deleted file mode 100644
index df7a850a4..000000000
--- a/cw_haven/lib/api/exceptions/wallet_opening_exception.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-class WalletOpeningException implements Exception {
- WalletOpeningException({required this.message});
-
- final String message;
-
- @override
- String toString() => message;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/exceptions/wallet_restore_from_keys_exception.dart b/cw_haven/lib/api/exceptions/wallet_restore_from_keys_exception.dart
deleted file mode 100644
index 3ff5f2438..000000000
--- a/cw_haven/lib/api/exceptions/wallet_restore_from_keys_exception.dart
+++ /dev/null
@@ -1,10 +0,0 @@
-class WalletRestoreFromKeysException implements Exception {
- WalletRestoreFromKeysException({required this.message});
-
- final String message;
-
- @override
- String toString() {
- return message;
- }
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/exceptions/wallet_restore_from_seed_exception.dart b/cw_haven/lib/api/exceptions/wallet_restore_from_seed_exception.dart
deleted file mode 100644
index 004cd7958..000000000
--- a/cw_haven/lib/api/exceptions/wallet_restore_from_seed_exception.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-class WalletRestoreFromSeedException implements Exception {
- WalletRestoreFromSeedException({required this.message});
-
- final String message;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/haven_api.dart b/cw_haven/lib/api/haven_api.dart
deleted file mode 100644
index 41b50d9bc..000000000
--- a/cw_haven/lib/api/haven_api.dart
+++ /dev/null
@@ -1,6 +0,0 @@
-import 'dart:ffi';
-import 'dart:io';
-
-final DynamicLibrary havenApi = Platform.isAndroid
- ? DynamicLibrary.open("libcw_haven.so")
- : DynamicLibrary.open("cw_haven.framework/cw_haven");
\ No newline at end of file
diff --git a/cw_haven/lib/api/monero_output.dart b/cw_haven/lib/api/monero_output.dart
deleted file mode 100644
index a6d735bd3..000000000
--- a/cw_haven/lib/api/monero_output.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-import 'package:flutter/foundation.dart';
-
-class MoneroOutput {
- MoneroOutput({required this.address, required this.amount});
-
- final String address;
- final String amount;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/signatures.dart b/cw_haven/lib/api/signatures.dart
deleted file mode 100644
index ae95b62dd..000000000
--- a/cw_haven/lib/api/signatures.dart
+++ /dev/null
@@ -1,144 +0,0 @@
-import 'dart:ffi';
-import 'package:cw_haven/api/structs/pending_transaction.dart';
-import 'package:cw_haven/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 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_balance = Pointer Function(Int32);
-
-typedef get_unlocked_balance = Pointer Function(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_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 assetType,
- Pointer paymentId,
- Pointer amount,
- Int8 priorityRaw,
- Int32 subaddrAccount,
- Pointer error,
- Pointer pendingTransaction);
-
-typedef transaction_create_mult_dest = Int8 Function(
- Pointer> addresses,
- Pointer assetType,
- Pointer paymentId,
- Pointer> amounts,
- Int32 size,
- Int8 priorityRaw,
- Int32 subaddrAccount,
- 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 asset_types = Pointer> Function();
-
-typedef asset_types_size = Int32 Function();
-
-typedef get_rate = Pointer Function();
-
-typedef size_of_rate = Int32 Function();
-
-typedef update_rate = Void Function();
-
-typedef set_trusted_daemon = Void Function(Int8 trusted);
-
-typedef trusted_daemon = Int8 Function();
\ No newline at end of file
diff --git a/cw_haven/lib/api/structs/account_row.dart b/cw_haven/lib/api/structs/account_row.dart
deleted file mode 100644
index aa492ee0f..000000000
--- a/cw_haven/lib/api/structs/account_row.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class AccountRow extends Struct {
- @Int64()
- external int id;
-
- external Pointer label;
-
- String getLabel() => label.toDartString();
- int getId() => id;
-}
diff --git a/cw_haven/lib/api/structs/haven_balance_row.dart b/cw_haven/lib/api/structs/haven_balance_row.dart
deleted file mode 100644
index b0f657bca..000000000
--- a/cw_haven/lib/api/structs/haven_balance_row.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class HavenBalanceRow extends Struct {
- @Int64()
- external int amount;
-
- external Pointer assetType;
-
- int getAmount() => amount;
- String getAssetType() => assetType.toDartString();
-}
diff --git a/cw_haven/lib/api/structs/haven_rate.dart b/cw_haven/lib/api/structs/haven_rate.dart
deleted file mode 100644
index 48f188135..000000000
--- a/cw_haven/lib/api/structs/haven_rate.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class HavenRate extends Struct {
- @Int64()
- external int rate;
-
- external Pointer assetType;
-
- int getRate() => rate;
- String getAssetType() => assetType.toDartString();
-}
diff --git a/cw_haven/lib/api/structs/pending_transaction.dart b/cw_haven/lib/api/structs/pending_transaction.dart
deleted file mode 100644
index 12e5233f1..000000000
--- a/cw_haven/lib/api/structs/pending_transaction.dart
+++ /dev/null
@@ -1,27 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class PendingTransactionRaw extends Struct {
- @Int64()
- external int amount;
-
- @Int64()
- external int fee;
-
- external Pointer hash;
-
- String getHash() => hash.toDartString();
-}
-
-class PendingTransactionDescription {
- PendingTransactionDescription({
- required this.amount,
- required this.fee,
- required this.hash,
- required this.pointerAddress});
-
- final int amount;
- final int fee;
- final String hash;
- final int pointerAddress;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/structs/subaddress_row.dart b/cw_haven/lib/api/structs/subaddress_row.dart
deleted file mode 100644
index d593a793d..000000000
--- a/cw_haven/lib/api/structs/subaddress_row.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class SubaddressRow extends Struct {
- @Int64()
- external int id;
-
- external Pointer address;
-
- external Pointer label;
-
- String getLabel() => label.toDartString();
- String getAddress() => address.toDartString();
- int getId() => id;
-}
\ No newline at end of file
diff --git a/cw_haven/lib/api/structs/transaction_info_row.dart b/cw_haven/lib/api/structs/transaction_info_row.dart
deleted file mode 100644
index 177cdfde7..000000000
--- a/cw_haven/lib/api/structs/transaction_info_row.dart
+++ /dev/null
@@ -1,44 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class TransactionInfoRow extends Struct {
- @Uint64()
- external int amount;
-
- @Uint64()
- external int fee;
-
- @Uint64()
- external int blockHeight;
-
- @Uint64()
- external int confirmations;
-
- @Uint32()
- external int subaddrAccount;
-
- @Int8()
- external int direction;
-
- @Int8()
- external int isPending;
-
- @Uint32()
- external int subaddrIndex;
-
- external Pointer hash;
-
- external Pointer paymentId;
-
- external Pointer assetType;
-
- @Int64()
- external int datetime;
-
- int getDatetime() => datetime;
- int getAmount() => amount >= 0 ? amount : amount * -1;
- bool getIsPending() => isPending != 0;
- String getHash() => hash.toDartString();
- String getPaymentId() => paymentId.toDartString();
- String getAssetType() => assetType.toDartString();
-}
diff --git a/cw_haven/lib/api/structs/ut8_box.dart b/cw_haven/lib/api/structs/ut8_box.dart
deleted file mode 100644
index 53e678c88..000000000
--- a/cw_haven/lib/api/structs/ut8_box.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-
-class Utf8Box extends Struct {
- external Pointer value;
-
- String getValue() => value.toDartString();
-}
diff --git a/cw_haven/lib/api/subaddress_list.dart b/cw_haven/lib/api/subaddress_list.dart
deleted file mode 100644
index 39dbeab78..000000000
--- a/cw_haven/lib/api/subaddress_list.dart
+++ /dev/null
@@ -1,97 +0,0 @@
-import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-import 'package:flutter/foundation.dart';
-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/subaddress_row.dart';
-import 'package:cw_haven/api/wallet.dart';
-
-final subaddressSizeNative = havenApi
- .lookup>('subaddrress_size')
- .asFunction();
-
-final subaddressRefreshNative = havenApi
- .lookup>('subaddress_refresh')
- .asFunction();
-
-final subaddrressGetAllNative = havenApi
- .lookup>('subaddrress_get_all')
- .asFunction();
-
-final subaddrressAddNewNative = havenApi
- .lookup>('subaddress_add_row')
- .asFunction();
-
-final subaddrressSetLabelNative = havenApi
- .lookup>('subaddress_set_label')
- .asFunction();
-
-bool isUpdating = false;
-
-void refreshSubaddresses({required int accountIndex}) {
- try {
- isUpdating = true;
- subaddressRefreshNative(accountIndex);
- isUpdating = false;
- } catch (e) {
- isUpdating = false;
- rethrow;
- }
-}
-
-List getAllSubaddresses() {
- final size = subaddressSizeNative();
- final subaddressAddressesPointer = subaddrressGetAllNative();
- final subaddressAddresses = subaddressAddressesPointer.asTypedList(size);
-
- return subaddressAddresses
- .map((addr) => Pointer.fromAddress(addr).ref)
- .toList();
-}
-
-void addSubaddressSync({required int accountIndex, required String label}) {
- final labelPointer = label.toNativeUtf8();
- subaddrressAddNewNative(accountIndex, labelPointer);
- calloc.free(labelPointer);
-}
-
-void setLabelForSubaddressSync(
- {required int accountIndex, required int addressIndex, required String label}) {
- final labelPointer = label.toNativeUtf8();
-
- subaddrressSetLabelNative(accountIndex, addressIndex, labelPointer);
- calloc.free(labelPointer);
-}
-
-void _addSubaddress(Map args) {
- final label = args['label'] as String;
- final accountIndex = args['accountIndex'] as int;
-
- addSubaddressSync(accountIndex: accountIndex, label: label);
-}
-
-void _setLabelForSubaddress(Map args) {
- final label = args['label'] as String;
- final accountIndex = args['accountIndex'] as int;
- final addressIndex = args['addressIndex'] as int;
-
- setLabelForSubaddressSync(
- accountIndex: accountIndex, addressIndex: addressIndex, label: label);
-}
-
-Future addSubaddress({required int accountIndex, required String label}) async {
- await compute