diff --git a/.github/workflows/pr_test_build.yml b/.github/workflows/pr_test_build.yml
index 7b2b611d3..5b2bb11d3 100644
--- a/.github/workflows/pr_test_build.yml
+++ b/.github/workflows/pr_test_build.yml
@@ -3,6 +3,12 @@ name: PR Test Build
on:
pull_request:
branches: [main]
+ workflow_dispatch:
+ inputs:
+ branch:
+ description: 'Branch name to build'
+ required: true
+ default: 'main'
jobs:
PR_test_build:
@@ -12,6 +18,14 @@ jobs:
KEY_PASS: test@cake_wallet
steps:
+ - name: is pr
+ if: github.event_name == 'pull_request'
+ run: echo "BRANCH_NAME=${GITHUB_HEAD_REF}" >> $GITHUB_ENV
+
+ - name: is not pr
+ 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
@@ -40,7 +54,7 @@ jobs:
cd /opt/android
-y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install cargo-ndk
- git clone https://github.com/cake-tech/cake_wallet.git --branch $GITHUB_HEAD_REF
+ git clone https://github.com/cake-tech/cake_wallet.git --branch ${{ env.BRANCH_NAME }}
cd cake_wallet/scripts/android/
./install_ndk.sh
source ./app_env.sh cakewallet
@@ -97,6 +111,7 @@ jobs:
cd cw_ethereum && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_bitcoin_cash && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cd cw_nano && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
+ cd cw_polygon && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Add secrets
@@ -131,6 +146,7 @@ jobs:
echo "const fiatApiKey = '${{ secrets.FIAT_API_KEY }}';" >> lib/.secrets.g.dart
echo "const payfuraApiKey = '${{ secrets.PAYFURA_API_KEY }}';" >> lib/.secrets.g.dart
echo "const etherScanApiKey = '${{ secrets.ETHER_SCAN_API_KEY }}';" >> cw_ethereum/lib/.secrets.g.dart
+ echo "const polygonScanApiKey = '${{ secrets.POLYGON_SCAN_API_KEY }}';" >> cw_ethereum/lib/.secrets.g.dart
echo "const chatwootWebsiteToken = '${{ secrets.CHATWOOT_WEBSITE_TOKEN }}';" >> lib/.secrets.g.dart
echo "const exolixApiKey = '${{ secrets.EXOLIX_API_KEY }}';" >> lib/.secrets.g.dart
echo "const robinhoodApplicationId = '${{ secrets.ROBINHOOD_APPLICATION_ID }}';" >> lib/.secrets.g.dart
@@ -139,7 +155,7 @@ jobs:
echo "const moralisApiKey = '${{ secrets.MORALIS_API_KEY }}';" >> lib/.secrets.g.dart
- name: Rename app
- run: echo -e "id=com.cakewallet.test\nname=$GITHUB_HEAD_REF" > /opt/android/cake_wallet/android/app.properties
+ run: echo -e "id=com.cakewallet.test\nname=${{ env.BRANCH_NAME }}" > /opt/android/cake_wallet/android/app.properties
- name: Build
run: |
@@ -154,7 +170,7 @@ jobs:
# appcenter distribute release \
# --group "Testers" \
# --file "/opt/android/cake_wallet/build/app/outputs/apk/release/app-release.apk" \
-# --release-notes ${GITHUB_HEAD_REF} \
+# --release-notes ${{ env.BRANCH_NAME }} \
# --app Cake-Labs/Cake-Wallet \
# --token ${{ secrets.APP_CENTER_TOKEN }} \
# --quiet
@@ -163,7 +179,7 @@ jobs:
run: |
cd /opt/android/cake_wallet/build/app/outputs/apk/release
mkdir test-apk
- cp app-release.apk test-apk/$GITHUB_HEAD_REF.apk
+ cp app-release.apk test-apk/${{env.BRANCH_NAME}}.apk
- name: Upload Artifact
uses: kittaakos/upload-artifact-as-is@v0
@@ -177,6 +193,6 @@ jobs:
token: ${{ secrets.SLACK_APP_TOKEN }}
path: /opt/android/cake_wallet/build/app/outputs/apk/release/app-release.apk
channel: ${{ secrets.SLACK_APK_CHANNEL }}
- title: "${{github.head_ref}}.apk"
- filename: ${{github.head_ref}}.apk
+ title: "${{ env.BRANCH_NAME }}.apk"
+ filename: ${{ env.BRANCH_NAME }}.apk
initial_comment: ${{ github.event.head_commit.message }}
diff --git a/.gitignore b/.gitignore
index c735d4058..0a883dd18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -126,6 +126,7 @@ lib/haven/haven.dart
lib/ethereum/ethereum.dart
lib/bitcoin_cash/bitcoin_cash.dart
lib/nano/nano.dart
+lib/polygon/polygon.dart
ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_180.png
ios/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_120.png
diff --git a/android/app/src/main/AndroidManifestBase.xml b/android/app/src/main/AndroidManifestBase.xml
index 910149f60..f32482e22 100644
--- a/android/app/src/main/AndroidManifestBase.xml
+++ b/android/app/src/main/AndroidManifestBase.xml
@@ -62,6 +62,9 @@
+
+
+
e).toList();
unspentCoins.forEach((coin) async {
final tx = await fetchTransactionInfo(hash: coin.hash, height: 0);
- coin.isChange = tx!.direction == TransactionDirection.outgoing;
+ coin.isChange = tx?.direction == TransactionDirection.outgoing;
});
if (unspentCoinsInfo.isEmpty) {
@@ -725,8 +725,7 @@ abstract class ElectrumWalletBase
final index = address != null
? walletAddresses.addresses.firstWhere((element) => element.address == address).index
: null;
- return index == null
- ? base64Encode(hd.sign(message))
- : base64Encode(hd.derive(index).sign(message));
+ final HD = index == null ? hd : hd.derive(index);
+ return base64Encode(HD.signMessage(message));
}
}
diff --git a/cw_bitcoin/lib/electrum_wallet_snapshot.dart b/cw_bitcoin/lib/electrum_wallet_snapshot.dart
index def991ebe..86d3e2fed 100644
--- a/cw_bitcoin/lib/electrum_wallet_snapshot.dart
+++ b/cw_bitcoin/lib/electrum_wallet_snapshot.dart
@@ -1,8 +1,8 @@
import 'dart:convert';
import 'package:cw_bitcoin/bitcoin_address_record.dart';
import 'package:cw_bitcoin/electrum_balance.dart';
-import 'package:cw_bitcoin/file.dart';
import 'package:cw_core/pathForWallet.dart';
+import 'package:cw_core/utils/file.dart';
import 'package:cw_core/wallet_type.dart';
class ElectrumWallletSnapshot {
@@ -56,4 +56,4 @@ class ElectrumWallletSnapshot {
regularAddressIndex: regularAddressIndex,
changeAddressIndex: changeAddressIndex);
}
-}
\ No newline at end of file
+}
diff --git a/cw_bitcoin/pubspec.yaml b/cw_bitcoin/pubspec.yaml
index 693d5af7a..a50ff68ad 100644
--- a/cw_bitcoin/pubspec.yaml
+++ b/cw_bitcoin/pubspec.yaml
@@ -22,7 +22,7 @@ dependencies:
bitcoin_flutter:
git:
url: https://github.com/cake-tech/bitcoin_flutter.git
- ref: cake-update-v3
+ ref: cake-update-v4
bitbox:
git:
url: https://github.com/cake-tech/bitbox-flutter.git
@@ -30,7 +30,6 @@ dependencies:
rxdart: ^0.27.5
unorm_dart: ^0.2.0
cryptography: ^2.0.5
- encrypt: ^5.0.1
dev_dependencies:
flutter_test:
diff --git a/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart b/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart
index 5f2a33ab6..fa41de767 100644
--- a/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart
+++ b/cw_bitcoin_cash/lib/src/bitcoin_cash_wallet.dart
@@ -302,10 +302,8 @@ abstract class BitcoinCashWalletBase extends ElectrumWallet with Store {
final index = address != null
? walletAddresses.addresses
.firstWhere((element) => element.address == AddressUtils.toLegacyAddress(address))
- .index
- : null;
- return index == null
- ? base64Encode(hd.sign(message))
- : base64Encode(hd.derive(index).sign(message));
+ .index : null;
+ final HD = index == null ? hd : hd.derive(index);
+ return base64Encode(HD.signMessage(message));
}
}
diff --git a/cw_bitcoin_cash/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/cw_bitcoin_cash/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
deleted file mode 120000
index 0ed52b295..000000000
--- a/cw_bitcoin_cash/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux
+++ /dev/null
@@ -1 +0,0 @@
-/Users/blazebrain/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
\ No newline at end of file
diff --git a/cw_bitcoin_cash/linux/flutter/ephemeral/.plugin_symlinks/tor b/cw_bitcoin_cash/linux/flutter/ephemeral/.plugin_symlinks/tor
deleted file mode 120000
index 7ee2b206d..000000000
--- a/cw_bitcoin_cash/linux/flutter/ephemeral/.plugin_symlinks/tor
+++ /dev/null
@@ -1 +0,0 @@
-/Users/blazebrain/.pub-cache/git/tor-09ba92cb11d4e3cacf97256e57863b805f79f2e5/
\ No newline at end of file
diff --git a/cw_bitcoin_cash/linux/flutter/generated_plugin_registrant.cc b/cw_bitcoin_cash/linux/flutter/generated_plugin_registrant.cc
deleted file mode 100644
index e71a16d23..000000000
--- a/cw_bitcoin_cash/linux/flutter/generated_plugin_registrant.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-// clang-format off
-
-#include "generated_plugin_registrant.h"
-
-
-void fl_register_plugins(FlPluginRegistry* registry) {
-}
diff --git a/cw_bitcoin_cash/linux/flutter/generated_plugin_registrant.h b/cw_bitcoin_cash/linux/flutter/generated_plugin_registrant.h
deleted file mode 100644
index e0f0a47bc..000000000
--- a/cw_bitcoin_cash/linux/flutter/generated_plugin_registrant.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-// clang-format off
-
-#ifndef GENERATED_PLUGIN_REGISTRANT_
-#define GENERATED_PLUGIN_REGISTRANT_
-
-#include
-
-// Registers Flutter plugins.
-void fl_register_plugins(FlPluginRegistry* registry);
-
-#endif // GENERATED_PLUGIN_REGISTRANT_
diff --git a/cw_bitcoin_cash/linux/flutter/generated_plugins.cmake b/cw_bitcoin_cash/linux/flutter/generated_plugins.cmake
deleted file mode 100644
index 3d57782b2..000000000
--- a/cw_bitcoin_cash/linux/flutter/generated_plugins.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Generated file, do not edit.
-#
-
-list(APPEND FLUTTER_PLUGIN_LIST
-)
-
-list(APPEND FLUTTER_FFI_PLUGIN_LIST
- tor
-)
-
-set(PLUGIN_BUNDLED_LIBRARIES)
-
-foreach(plugin ${FLUTTER_PLUGIN_LIST})
- add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
- target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
- list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
- list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
-endforeach(plugin)
-
-foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
- add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
- list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
-endforeach(ffi_plugin)
diff --git a/cw_bitcoin_cash/macos/Flutter/GeneratedPluginRegistrant.swift b/cw_bitcoin_cash/macos/Flutter/GeneratedPluginRegistrant.swift
deleted file mode 100644
index e777c67df..000000000
--- a/cw_bitcoin_cash/macos/Flutter/GeneratedPluginRegistrant.swift
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-import FlutterMacOS
-import Foundation
-
-import path_provider_foundation
-
-func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
- PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
-}
diff --git a/cw_bitcoin_cash/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/cw_bitcoin_cash/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
deleted file mode 100644
index 2f46994d3..000000000
--- a/cw_bitcoin_cash/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-// This is a generated file; do not edit or check into version control.
-FLUTTER_ROOT=C:\Users\borod\flutter
-FLUTTER_APPLICATION_PATH=C:\cake_wallet\cw_bitcoin_cash
-COCOAPODS_PARALLEL_CODE_SIGN=true
-FLUTTER_BUILD_DIR=build
-FLUTTER_BUILD_NAME=0.0.1
-FLUTTER_BUILD_NUMBER=0.0.1
-DART_OBFUSCATION=false
-TRACK_WIDGET_CREATION=true
-TREE_SHAKE_ICONS=false
-PACKAGE_CONFIG=.dart_tool/package_config.json
diff --git a/cw_bitcoin_cash/macos/Flutter/ephemeral/flutter_export_environment.sh b/cw_bitcoin_cash/macos/Flutter/ephemeral/flutter_export_environment.sh
deleted file mode 100644
index 2a3bcca5a..000000000
--- a/cw_bitcoin_cash/macos/Flutter/ephemeral/flutter_export_environment.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# This is a generated file; do not edit or check into version control.
-export "FLUTTER_ROOT=C:\Users\borod\flutter"
-export "FLUTTER_APPLICATION_PATH=C:\cake_wallet\cw_bitcoin_cash"
-export "COCOAPODS_PARALLEL_CODE_SIGN=true"
-export "FLUTTER_BUILD_DIR=build"
-export "FLUTTER_BUILD_NAME=0.0.1"
-export "FLUTTER_BUILD_NUMBER=0.0.1"
-export "DART_OBFUSCATION=false"
-export "TRACK_WIDGET_CREATION=true"
-export "TREE_SHAKE_ICONS=false"
-export "PACKAGE_CONFIG=.dart_tool/package_config.json"
diff --git a/cw_bitcoin_cash/pubspec.yaml b/cw_bitcoin_cash/pubspec.yaml
index 30ed49e80..eb1f057d8 100644
--- a/cw_bitcoin_cash/pubspec.yaml
+++ b/cw_bitcoin_cash/pubspec.yaml
@@ -24,7 +24,7 @@ dependencies:
bitcoin_flutter:
git:
url: https://github.com/cake-tech/bitcoin_flutter.git
- ref: cake-update-v3
+ ref: cake-update-v4
bitbox:
git:
url: https://github.com/cake-tech/bitbox-flutter.git
diff --git a/cw_bitcoin_cash/windows/flutter/generated_plugin_registrant.cc b/cw_bitcoin_cash/windows/flutter/generated_plugin_registrant.cc
deleted file mode 100644
index 8b6d4680a..000000000
--- a/cw_bitcoin_cash/windows/flutter/generated_plugin_registrant.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-// clang-format off
-
-#include "generated_plugin_registrant.h"
-
-
-void RegisterPlugins(flutter::PluginRegistry* registry) {
-}
diff --git a/cw_bitcoin_cash/windows/flutter/generated_plugin_registrant.h b/cw_bitcoin_cash/windows/flutter/generated_plugin_registrant.h
deleted file mode 100644
index dc139d85a..000000000
--- a/cw_bitcoin_cash/windows/flutter/generated_plugin_registrant.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// Generated file. Do not edit.
-//
-
-// clang-format off
-
-#ifndef GENERATED_PLUGIN_REGISTRANT_
-#define GENERATED_PLUGIN_REGISTRANT_
-
-#include
-
-// Registers Flutter plugins.
-void RegisterPlugins(flutter::PluginRegistry* registry);
-
-#endif // GENERATED_PLUGIN_REGISTRANT_
diff --git a/cw_bitcoin_cash/windows/flutter/generated_plugins.cmake b/cw_bitcoin_cash/windows/flutter/generated_plugins.cmake
deleted file mode 100644
index b93c4c30c..000000000
--- a/cw_bitcoin_cash/windows/flutter/generated_plugins.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Generated file, do not edit.
-#
-
-list(APPEND FLUTTER_PLUGIN_LIST
-)
-
-list(APPEND FLUTTER_FFI_PLUGIN_LIST
-)
-
-set(PLUGIN_BUNDLED_LIBRARIES)
-
-foreach(plugin ${FLUTTER_PLUGIN_LIST})
- add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
- target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
- list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
- list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
-endforeach(plugin)
-
-foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
- add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
- list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
-endforeach(ffi_plugin)
diff --git a/cw_core/lib/currency_for_wallet_type.dart b/cw_core/lib/currency_for_wallet_type.dart
index 4c330b073..ce0219f1f 100644
--- a/cw_core/lib/currency_for_wallet_type.dart
+++ b/cw_core/lib/currency_for_wallet_type.dart
@@ -19,6 +19,8 @@ CryptoCurrency currencyForWalletType(WalletType type) {
return CryptoCurrency.nano;
case WalletType.banano:
return CryptoCurrency.banano;
+ case WalletType.polygon:
+ return CryptoCurrency.maticpoly;
default:
throw Exception('Unexpected wallet type: ${type.toString()} for CryptoCurrency currencyForWalletType');
}
diff --git a/cw_core/lib/erc20_token.dart b/cw_core/lib/erc20_token.dart
index 011fdef1d..75bf1aad0 100644
--- a/cw_core/lib/erc20_token.dart
+++ b/cw_core/lib/erc20_token.dart
@@ -58,6 +58,7 @@ class Erc20Token extends CryptoCurrency with HiveObjectMixin {
static const typeId = ERC20_TOKEN_TYPE_ID;
static const boxName = 'Erc20Tokens';
+ static const polygonBoxName = ' PolygonErc20Tokens';
@override
bool operator ==(other) => (other is Erc20Token && other.contractAddress == contractAddress) ||
diff --git a/cw_core/lib/get_height_by_date.dart b/cw_core/lib/get_height_by_date.dart
index 819990e0a..6f3ccaf68 100644
--- a/cw_core/lib/get_height_by_date.dart
+++ b/cw_core/lib/get_height_by_date.dart
@@ -84,7 +84,44 @@ final dates = {
"2020-8": 2153983,
"2020-9": 2176466,
"2020-10": 2198453,
- "2020-11": 2220000
+ "2020-11": 2220000,
+ "2020-12": 2242240,
+ "2021-1": 2264584,
+ "2021-2": 2286892,
+ "2021-3": 2307079,
+ "2021-4": 2329385,
+ "2021-5": 2351004,
+ "2021-6": 2373306,
+ "2021-7": 2394882,
+ "2021-8": 2417162,
+ "2021-9": 2439490,
+ "2021-10": 2461020,
+ "2021-11": 2483377,
+ "2021-12": 2504932,
+ "2022-1": 2527316,
+ "2022-2": 2549605,
+ "2022-3": 2569711,
+ "2022-4": 2591995,
+ "2022-5": 2613603,
+ "2022-6": 2635840,
+ "2022-7": 2657395,
+ "2022-8": 2679705,
+ "2022-9": 2701991,
+ "2022-10": 2723607,
+ "2022-11": 2745899,
+ "2022-12": 2767427,
+ "2023-1": 2789763,
+ "2023-2": 2811996,
+ "2023-3": 2832118,
+ "2023-4": 2854365,
+ "2023-5": 2875972,
+ "2023-6": 2898234,
+ "2023-7": 2919771,
+ "2023-8": 2942045,
+ "2023-9": 2964280,
+ "2023-10": 2985937,
+ "2023-11": 3008178,
+ "2023-12": 3029759
};
int getMoneroHeigthByDate({required DateTime date}) {
diff --git a/cw_core/lib/node.dart b/cw_core/lib/node.dart
index 484325f91..bd96e1395 100644
--- a/cw_core/lib/node.dart
+++ b/cw_core/lib/node.dart
@@ -6,7 +6,7 @@ import 'package:hive/hive.dart';
import 'package:cw_core/hive_type_ids.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:http/io_client.dart' as ioc;
-import 'package:tor/tor.dart';
+// import 'package:tor/tor.dart';
part 'node.g.dart';
@@ -88,6 +88,8 @@ class Node extends HiveObject with Keyable {
} else {
return Uri.http(uriRaw, '');
}
+ case WalletType.polygon:
+ return Uri.https(uriRaw, '');
default:
throw Exception('Unexpected type ${type.toString()} for Node uri');
}
@@ -146,6 +148,8 @@ class Node extends HiveObject with Keyable {
case WalletType.nano:
case WalletType.banano:
return requestNanoNode();
+ case WalletType.polygon:
+ return requestElectrumServer();
default:
return false;
}
@@ -210,14 +214,17 @@ class Node extends HiveObject with Keyable {
}
Future requestNodeWithProxy() async {
- if (!isValidProxyAddress && !Tor.instance.enabled) {
+ if (!isValidProxyAddress/* && !Tor.instance.enabled*/) {
return false;
}
String? proxy = socksProxyAddress;
- if ((proxy?.isEmpty ?? true) && Tor.instance.enabled) {
- proxy = "${InternetAddress.loopbackIPv4.address}:${Tor.instance.port}";
+ // if ((proxy?.isEmpty ?? true) && Tor.instance.enabled) {
+ // proxy = "${InternetAddress.loopbackIPv4.address}:${Tor.instance.port}";
+ // }
+ if (proxy == null) {
+ return false;
}
final proxyAddress = proxy!.split(':')[0];
final proxyPort = int.parse(proxy.split(':')[1]);
diff --git a/cw_bitcoin/lib/file.dart b/cw_core/lib/utils/file.dart
similarity index 66%
rename from cw_bitcoin/lib/file.dart
rename to cw_core/lib/utils/file.dart
index 8fd236ec3..0b1c5cffd 100644
--- a/cw_bitcoin/lib/file.dart
+++ b/cw_core/lib/utils/file.dart
@@ -2,17 +2,8 @@ import 'dart:io';
import 'package:cw_core/key.dart';
import 'package:encrypt/encrypt.dart' as encrypt;
-Future write(
- {required String path,
- required String password,
- required String data}) async {
- final keys = extractKeys(password);
- final key = encrypt.Key.fromBase64(keys.first);
- final iv = encrypt.IV.fromBase64(keys.last);
- final encrypted = await encode(key: key, iv: iv, data: data);
- final f = File(path);
- f.writeAsStringSync(encrypted);
-}
+Future write({required String path, required String password, required String data}) async =>
+ writeData(path: path, password: password, data: data);
Future writeData(
{required String path,
diff --git a/cw_core/lib/wallet_base.dart b/cw_core/lib/wallet_base.dart
index d15ea42cd..09b423c14 100644
--- a/cw_core/lib/wallet_base.dart
+++ b/cw_core/lib/wallet_base.dart
@@ -44,6 +44,8 @@ abstract class WalletBase null;
+ String? get hexSeed => null;
+
Object get keys;
WalletAddresses get walletAddresses;
diff --git a/cw_core/lib/wallet_type.dart b/cw_core/lib/wallet_type.dart
index debf92e11..20f0bdb19 100644
--- a/cw_core/lib/wallet_type.dart
+++ b/cw_core/lib/wallet_type.dart
@@ -13,6 +13,7 @@ const walletTypes = [
WalletType.bitcoinCash,
WalletType.nano,
WalletType.banano,
+ WalletType.polygon,
];
@HiveType(typeId: WALLET_TYPE_TYPE_ID)
@@ -44,6 +45,8 @@ enum WalletType {
@HiveField(8)
bitcoinCash,
+ @HiveField(9)
+ polygon
}
int serializeToInt(WalletType type) {
@@ -64,6 +67,8 @@ int serializeToInt(WalletType type) {
return 6;
case WalletType.bitcoinCash:
return 7;
+ case WalletType.polygon:
+ return 8;
default:
return -1;
}
@@ -87,6 +92,8 @@ WalletType deserializeFromInt(int raw) {
return WalletType.banano;
case 7:
return WalletType.bitcoinCash;
+ case 8:
+ return WalletType.polygon;
default:
throw Exception('Unexpected token: $raw for WalletType deserializeFromInt');
}
@@ -110,6 +117,8 @@ String walletTypeToString(WalletType type) {
return 'Nano';
case WalletType.banano:
return 'Banano';
+ case WalletType.polygon:
+ return 'Polygon';
default:
return '';
}
@@ -133,6 +142,8 @@ String walletTypeToDisplayName(WalletType type) {
return 'Nano (XNO)';
case WalletType.banano:
return 'Banano (BAN)';
+ case WalletType.polygon:
+ return 'Polygon (MATIC)';
default:
return '';
}
@@ -156,7 +167,10 @@ CryptoCurrency walletTypeToCryptoCurrency(WalletType type) {
return CryptoCurrency.nano;
case WalletType.banano:
return CryptoCurrency.banano;
+ case WalletType.polygon:
+ return CryptoCurrency.maticpoly;
default:
- throw Exception('Unexpected wallet type: ${type.toString()} for CryptoCurrency walletTypeToCryptoCurrency');
+ throw Exception(
+ 'Unexpected wallet type: ${type.toString()} for CryptoCurrency walletTypeToCryptoCurrency');
}
}
diff --git a/cw_core/pubspec.lock b/cw_core/pubspec.lock
index 058f33ba4..f351759ed 100644
--- a/cw_core/pubspec.lock
+++ b/cw_core/pubspec.lock
@@ -271,10 +271,10 @@ packages:
dependency: "direct dev"
description:
name: hive_generator
- sha256: "81fd20125cb2ce8fd23623d7744ffbaf653aae93706c9bd3bf7019ea0ace3938"
+ sha256: "06cb8f58ace74de61f63500564931f9505368f45f98958bd7a6c35ba24159db4"
url: "https://pub.dev"
source: hosted
- version: "1.1.3"
+ version: "2.0.1"
http:
dependency: "direct main"
description:
diff --git a/cw_core/pubspec.yaml b/cw_core/pubspec.yaml
index 3763a7318..04a840d4e 100644
--- a/cw_core/pubspec.yaml
+++ b/cw_core/pubspec.yaml
@@ -20,10 +20,10 @@ dependencies:
intl: ^0.18.0
encrypt: ^5.0.1
socks5_proxy: ^1.0.4
- tor:
- git:
- url: https://github.com/cake-tech/tor.git
- ref: main
+# tor:
+# git:
+# url: https://github.com/cake-tech/tor.git
+# ref: main
dev_dependencies:
flutter_test:
@@ -31,7 +31,7 @@ dev_dependencies:
build_runner: ^2.1.11
build_resolvers: ^2.0.9
mobx_codegen: ^2.0.7
- hive_generator: ^1.1.3
+ hive_generator: ^2.0.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
diff --git a/cw_ethereum/lib/ethereum_client.dart b/cw_ethereum/lib/ethereum_client.dart
index f0c7381e8..5e408bb9e 100644
--- a/cw_ethereum/lib/ethereum_client.dart
+++ b/cw_ethereum/lib/ethereum_client.dart
@@ -15,12 +15,12 @@ import 'package:cw_ethereum/ethereum_transaction_priority.dart';
import 'package:cw_ethereum/.secrets.g.dart' as secrets;
class EthereumClient {
- final _httpClient = Client();
+ final httpClient = Client();
Web3Client? _client;
bool connect(Node node) {
try {
- _client = Web3Client(node.uri.toString(), _httpClient);
+ _client = Web3Client(node.uri.toString(), httpClient);
return true;
} catch (e) {
@@ -74,9 +74,11 @@ class EthereumClient {
required int exponent,
String? contractAddress,
}) async {
- assert(currency == CryptoCurrency.eth || contractAddress != null);
+ assert(currency == CryptoCurrency.eth ||
+ currency == CryptoCurrency.maticpoly ||
+ contractAddress != null);
- bool _isEthereum = currency == CryptoCurrency.eth;
+ bool _isEVMCompatibleChain = currency == CryptoCurrency.eth || currency == CryptoCurrency.maticpoly;
final price = _client!.getGasPrice();
@@ -84,19 +86,23 @@ class EthereumClient {
from: privateKey.address,
to: EthereumAddress.fromHex(toAddress),
maxPriorityFeePerGas: EtherAmount.fromInt(EtherUnit.gwei, priority.tip),
- value: _isEthereum ? EtherAmount.inWei(BigInt.parse(amount)) : EtherAmount.zero(),
+ value: _isEVMCompatibleChain ? EtherAmount.inWei(BigInt.parse(amount)) : EtherAmount.zero(),
);
- final signedTransaction = await _client!.signTransaction(privateKey, transaction);
+ final chainId = _getChainIdForCurrency(currency);
+
+ final signedTransaction =
+ await _client!.signTransaction(privateKey, transaction, chainId: chainId);
final Function _sendTransaction;
- if (_isEthereum) {
+ if (_isEVMCompatibleChain) {
_sendTransaction = () async => await sendTransaction(signedTransaction);
} else {
final erc20 = ERC20(
client: _client!,
address: EthereumAddress.fromHex(contractAddress!),
+ chainId: chainId,
);
_sendTransaction = () async {
@@ -118,6 +124,16 @@ class EthereumClient {
);
}
+ int _getChainIdForCurrency(CryptoCurrency currency) {
+ switch (currency) {
+ case CryptoCurrency.maticpoly:
+ return 137;
+ case CryptoCurrency.eth:
+ default:
+ return 1;
+ }
+ }
+
Future sendTransaction(Uint8List signedTransaction) async =>
await _client!.sendRawTransaction(prependTransactionType(0x02, signedTransaction));
@@ -198,7 +214,7 @@ I/flutter ( 4474): Gas Used: 53000
Future> fetchTransactions(String address,
{String? contractAddress}) async {
try {
- final response = await _httpClient.get(Uri.https("api.etherscan.io", "/api", {
+ final response = await httpClient.get(Uri.https("api.etherscan.io", "/api", {
"module": "account",
"action": contractAddress != null ? "tokentx" : "txlist",
if (contractAddress != null) "contractaddress": contractAddress,
diff --git a/cw_ethereum/lib/ethereum_transaction_info.dart b/cw_ethereum/lib/ethereum_transaction_info.dart
index a0649ba25..f0deae931 100644
--- a/cw_ethereum/lib/ethereum_transaction_info.dart
+++ b/cw_ethereum/lib/ethereum_transaction_info.dart
@@ -1,3 +1,5 @@
+import 'dart:math';
+
import 'package:cw_core/format_amount.dart';
import 'package:cw_core/transaction_direction.dart';
import 'package:cw_core/transaction_info.dart';
@@ -34,8 +36,10 @@ class EthereumTransactionInfo extends TransactionInfo {
final String? to;
@override
- String amountFormatted() =>
- '${formatAmount((ethAmount / BigInt.from(10).pow(exponent)).toString())} $tokenSymbol';
+ String amountFormatted() {
+ final amount = formatAmount((ethAmount / BigInt.from(10).pow(exponent)).toString());
+ return '${amount.substring(0, min(10, amount.length))} $tokenSymbol';
+ }
@override
String fiatAmount() => _fiatAmount ?? '';
@@ -44,7 +48,10 @@ class EthereumTransactionInfo extends TransactionInfo {
void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount);
@override
- String feeFormatted() => '${(ethFee / BigInt.from(10).pow(18)).toString()} ETH';
+ String feeFormatted() {
+ final amount = (ethFee / BigInt.from(10).pow(18)).toString();
+ return '${amount.substring(0, min(10, amount.length))} ETH';
+ }
factory EthereumTransactionInfo.fromJson(Map data) {
return EthereumTransactionInfo(
diff --git a/cw_ethereum/lib/ethereum_transaction_model.dart b/cw_ethereum/lib/ethereum_transaction_model.dart
index c1260795a..3b5f724fc 100644
--- a/cw_ethereum/lib/ethereum_transaction_model.dart
+++ b/cw_ethereum/lib/ethereum_transaction_model.dart
@@ -1,3 +1,4 @@
+//! Model used for in parsing transactions fetched using etherscan
class EthereumTransactionModel {
final DateTime date;
final String hash;
diff --git a/cw_ethereum/lib/pending_ethereum_transaction.dart b/cw_ethereum/lib/pending_ethereum_transaction.dart
index 35b0123cc..d47630fd6 100644
--- a/cw_ethereum/lib/pending_ethereum_transaction.dart
+++ b/cw_ethereum/lib/pending_ethereum_transaction.dart
@@ -21,8 +21,8 @@ class PendingEthereumTransaction with PendingTransaction {
@override
String get amountFormatted {
- final _amount = BigInt.parse(amount) / BigInt.from(pow(10, exponent));
- return _amount.toStringAsFixed(min(15, _amount.toString().length));
+ final _amount = (BigInt.parse(amount) / BigInt.from(pow(10, exponent))).toString();
+ return _amount.substring(0, min(10, _amount.length));
}
@override
@@ -30,8 +30,8 @@ class PendingEthereumTransaction with PendingTransaction {
@override
String get feeFormatted {
- final _fee = fee / BigInt.from(pow(10, 18));
- return _fee.toStringAsFixed(min(15, _fee.toString().length));
+ final _fee = (fee / BigInt.from(pow(10, 18))).toString();
+ return _fee.substring(0, min(10, _fee.length));
}
@override
diff --git a/cw_ethereum/pubspec.yaml b/cw_ethereum/pubspec.yaml
index 5d19589f3..6946a43a1 100644
--- a/cw_ethereum/pubspec.yaml
+++ b/cw_ethereum/pubspec.yaml
@@ -17,7 +17,6 @@ dependencies:
mobx: ^2.0.7+4
bip39: ^1.0.6
bip32: ^2.0.0
- ed25519_hd_key: ^2.2.0
hex: ^0.2.0
http: ^1.1.0
shared_preferences: ^2.0.15
diff --git a/cw_monero/example/pubspec.lock b/cw_monero/example/pubspec.lock
index 661341e96..3dd2b5b61 100644
--- a/cw_monero/example/pubspec.lock
+++ b/cw_monero/example/pubspec.lock
@@ -301,10 +301,19 @@ packages:
dependency: transitive
description:
name: pointycastle
- sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346
+ sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c"
url: "https://pub.dev"
source: hosted
- version: "3.6.2"
+ version: "3.7.3"
+ polyseed:
+ dependency: transitive
+ description:
+ path: "."
+ ref: HEAD
+ resolved-ref: "504d58a5b147fccd3bc85a25f2e72fb32771ddd7"
+ url: "https://github.com/cake-tech/polyseed_dart.git"
+ source: git
+ version: "0.0.1"
process:
dependency: transitive
description:
@@ -416,5 +425,5 @@ packages:
source: hosted
version: "0.2.0+3"
sdks:
- dart: ">=3.0.0 <4.0.0"
+ dart: ">=3.0.6 <4.0.0"
flutter: ">=3.7.0"
diff --git a/cw_monero/ios/Classes/monero_api.cpp b/cw_monero/ios/Classes/monero_api.cpp
index a0712255a..87be785ac 100644
--- a/cw_monero/ios/Classes/monero_api.cpp
+++ b/cw_monero/ios/Classes/monero_api.cpp
@@ -374,6 +374,35 @@ extern "C"
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);
@@ -438,6 +467,11 @@ extern "C"
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());
}
@@ -892,6 +926,8 @@ extern "C"
return m_wallet->trustedDaemon();
}
+ // Coin Control //
+
CoinsInfoRow* coin(int index)
{
if (index >= 0 && index < m_coins_info.size()) {
@@ -986,6 +1022,13 @@ extern "C"
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
index 74258ba4c..fa92a038d 100644
--- a/cw_monero/ios/Classes/monero_api.h
+++ b/cw_monero/ios/Classes/monero_api.h
@@ -32,7 +32,8 @@ void store(char *path);
void set_trusted_daemon(bool arg);
bool trusted_daemon();
+char *sign_message(char *message, char *address);
#ifdef __cplusplus
}
-#endif
\ No newline at end of file
+#endif
diff --git a/cw_monero/lib/api/signatures.dart b/cw_monero/lib/api/signatures.dart
index 9be828df0..bc4fc9d38 100644
--- a/cw_monero/lib/api/signatures.dart
+++ b/cw_monero/lib/api/signatures.dart
@@ -14,6 +14,9 @@ typedef restore_wallet_from_seed = Int8 Function(
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 is_wallet_exist = Int8 Function(Pointer);
typedef load_wallet = Int8 Function(Pointer, Pointer, Int8);
@@ -146,3 +149,5 @@ 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);
diff --git a/cw_monero/lib/api/types.dart b/cw_monero/lib/api/types.dart
index 4c0c980dc..40a1e0321 100644
--- a/cw_monero/lib/api/types.dart
+++ b/cw_monero/lib/api/types.dart
@@ -14,6 +14,9 @@ typedef RestoreWalletFromSeed = int Function(
typedef RestoreWalletFromKeys = int Function(Pointer, Pointer,
Pointer, Pointer, Pointer, Pointer, int, int, Pointer);
+typedef RestoreWalletFromSpendKey = int Function(Pointer, Pointer, Pointer,
+ Pointer, Pointer, int, int, Pointer);
+
typedef IsWalletExist = int Function(Pointer);
typedef LoadWallet = int Function(Pointer, Pointer, int);
@@ -146,3 +149,5 @@ typedef GetCoin = Pointer Function(int);
typedef FreezeCoin = void Function(int);
typedef ThawCoin = void Function(int);
+
+typedef SignMessage = Pointer Function(Pointer, Pointer);
diff --git a/cw_monero/lib/api/wallet.dart b/cw_monero/lib/api/wallet.dart
index 1680918e5..ffa5fe13b 100644
--- a/cw_monero/lib/api/wallet.dart
+++ b/cw_monero/lib/api/wallet.dart
@@ -8,7 +8,6 @@ import 'package:cw_monero/api/types.dart';
import 'package:cw_monero/api/monero_api.dart';
import 'package:cw_monero/api/exceptions/setup_wallet_exception.dart';
import 'package:flutter/foundation.dart';
-import 'package:flutter/services.dart';
int _boolToInt(bool value) => value ? 1 : 0;
@@ -128,6 +127,10 @@ final trustedDaemonNative = moneroApi
.lookup>('trusted_daemon')
.asFunction();
+final signMessageNative = moneroApi
+ .lookup>('sign_message')
+ .asFunction();
+
int getSyncingHeight() => getSyncingHeightNative();
bool isNeededToRefresh() => isNeededToRefreshNative() != 0;
@@ -296,7 +299,7 @@ class SyncListener {
final bchHeight = await getNodeHeightOrUpdate(syncHeight);
- if (_lastKnownBlockHeight == syncHeight || syncHeight == null) {
+ if (_lastKnownBlockHeight == syncHeight) {
return;
}
@@ -311,7 +314,7 @@ class SyncListener {
}
// 1. Actual new height; 2. Blocks left to finish; 3. Progress in percents;
- onNewBlock?.call(syncHeight, left, ptc);
+ onNewBlock.call(syncHeight, left, ptc);
});
}
@@ -382,4 +385,15 @@ String getSubaddressLabel(int accountIndex, int addressIndex) {
Future setTrustedDaemon(bool trusted) async => setTrustedDaemonNative(_boolToInt(trusted));
-Future trustedDaemon() async => trustedDaemonNative() != 0;
\ No newline at end of file
+Future trustedDaemon() async => trustedDaemonNative() != 0;
+
+String signMessage(String message, {String address = ""}) {
+ final messagePointer = message.toNativeUtf8();
+ final addressPointer = address.toNativeUtf8();
+
+ final signature = convertUTF8ToString(pointer: signMessageNative(messagePointer, addressPointer));
+ calloc.free(messagePointer);
+ calloc.free(addressPointer);
+
+ return signature;
+}
diff --git a/cw_monero/lib/api/wallet_manager.dart b/cw_monero/lib/api/wallet_manager.dart
index 093d7e63b..0aa694e9a 100644
--- a/cw_monero/lib/api/wallet_manager.dart
+++ b/cw_monero/lib/api/wallet_manager.dart
@@ -1,15 +1,16 @@
import 'dart:ffi';
-import 'package:ffi/ffi.dart';
-import 'package:flutter/foundation.dart';
+
import 'package:cw_monero/api/convert_utf8_to_string.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/wallet.dart';
-import 'package:cw_monero/api/exceptions/wallet_opening_exception.dart';
import 'package:cw_monero/api/exceptions/wallet_creation_exception.dart';
+import 'package:cw_monero/api/exceptions/wallet_opening_exception.dart';
import 'package:cw_monero/api/exceptions/wallet_restore_from_keys_exception.dart';
import 'package:cw_monero/api/exceptions/wallet_restore_from_seed_exception.dart';
+import 'package:cw_monero/api/monero_api.dart';
+import 'package:cw_monero/api/signatures.dart';
+import 'package:cw_monero/api/types.dart';
+import 'package:cw_monero/api/wallet.dart';
+import 'package:ffi/ffi.dart';
+import 'package:flutter/foundation.dart';
final createWalletNative = moneroApi
.lookup>('create_wallet')
@@ -25,6 +26,11 @@ final restoreWalletFromKeysNative = moneroApi
'restore_wallet_from_keys')
.asFunction();
+final restoreWalletFromSpendKeyNative = moneroApi
+ .lookup>(
+ 'restore_wallet_from_spend_key')
+ .asFunction();
+
final isWalletExistNative = moneroApi
.lookup>('is_wallet_exist')
.asFunction();
@@ -141,6 +147,44 @@ void restoreWalletFromKeysSync(
}
}
+void restoreWalletFromSpendKeySync(
+ {required String path,
+ required String password,
+ required String seed,
+ required String language,
+ required String spendKey,
+ int nettype = 0,
+ int restoreHeight = 0}) {
+ final pathPointer = path.toNativeUtf8();
+ final passwordPointer = password.toNativeUtf8();
+ final seedPointer = seed.toNativeUtf8();
+ final languagePointer = language.toNativeUtf8();
+ final spendKeyPointer = spendKey.toNativeUtf8();
+ final errorMessagePointer = ''.toNativeUtf8();
+ final isWalletRestored = restoreWalletFromSpendKeyNative(
+ pathPointer,
+ passwordPointer,
+ seedPointer,
+ languagePointer,
+ spendKeyPointer,
+ nettype,
+ restoreHeight,
+ errorMessagePointer) !=
+ 0;
+
+ calloc.free(pathPointer);
+ calloc.free(passwordPointer);
+ calloc.free(languagePointer);
+ calloc.free(spendKeyPointer);
+
+ storeSync();
+
+ if (!isWalletRestored) {
+ throw WalletRestoreFromKeysException(
+ message: convertUTF8ToString(pointer: errorMessagePointer));
+ }
+}
+
void loadWallet({
required String path,
required String password,
@@ -194,6 +238,23 @@ void _restoreFromKeys(Map args) {
spendKey: spendKey);
}
+void _restoreFromSpendKey(Map args) {
+ final path = args['path'] as String;
+ final password = args['password'] as String;
+ final seed = args['seed'] as String;
+ final language = args['language'] as String;
+ final spendKey = args['spendKey'] as String;
+ final restoreHeight = args['restoreHeight'] as int;
+
+ restoreWalletFromSpendKeySync(
+ path: path,
+ password: password,
+ seed: seed,
+ language: language,
+ restoreHeight: restoreHeight,
+ spendKey: spendKey);
+}
+
Future _openWallet(Map args) async =>
loadWallet(path: args['path'] as String, password: args['password'] as String);
@@ -251,4 +312,22 @@ Future restoreFromKeys(
'restoreHeight': restoreHeight
});
+Future restoreFromSpendKey(
+ {required String path,
+ required String password,
+ required String seed,
+ required String language,
+ required String spendKey,
+ int nettype = 0,
+ int restoreHeight = 0}) async =>
+ compute