diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml
index 7ed9efb6c..047d3abdc 100644
--- a/.github/workflows/build-linux.yml
+++ b/.github/workflows/build-linux.yml
@@ -50,9 +50,9 @@ jobs:
# IMPORTANT: don't pre-write any of the tool/.*secrets-config.json
# files. The generator at tool/generate_secrets_config.dart has an
# early-return if tool/.secrets-config.json already exists (lines
- # 57-63), which then ALSO skips creating the per-module configs (evm,
- # solana, nano, tron, bitcoin) — every cw_* module then fails to
- # compile with "Undefined name secrets.xxx" for dozens of keys.
+ # 57-63), which then ALSO skips creating the per-module configs
+ # (evm, nano, bitcoin) — every cw_* module then fails to compile
+ # with "Undefined name secrets.xxx" for dozens of keys.
#
# Instead: run the generator first so it creates all configs from the
# full SecretKey list (with empty defaults), then sed-inject Trocador
@@ -93,7 +93,8 @@ jobs:
# ---- Native crypto cores (monero_c prebuilt bundle) ------------------
# Skips the full simplybs toolchain bootstrap. The bundle has libmonero,
# libwownero, AND libzano .so files; CMake only installs the ones we
- # ship (monero + wownero).
+ # ship (monero + wownero) — libzano is dropped at install time even
+ # though monero_c builds it.
- name: Fetch prebuilt monero_c .so bundle
run: |
set -x -e
diff --git a/cw_decred/.gitignore b/cw_decred/.gitignore
deleted file mode 100644
index d8452de53..000000000
--- a/cw_decred/.gitignore
+++ /dev/null
@@ -1,39 +0,0 @@
-# Miscellaneous
-*.class
-*.log
-*.pyc
-*.swp
-.DS_Store
-.atom/
-.buildlog/
-.history
-.svn/
-migrate_working_dir/
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
-
-# The .vscode folder contains launch configuration and tasks you configure in
-# VS Code which you may wish to be included in version control, so this line
-# is commented out by default.
-#.vscode/
-
-# Flutter/Dart/Pub related
-# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
-/pubspec.lock
-**/doc/api/
-.dart_tool/
-.packages
-build/
-
-android/.externalNativeBuild/
-android/.cxx/
-android/libs
-ios/External/
-macos/External/
-
-*libdcrwallet.h
-libdcrwallet_bindings.dart
diff --git a/cw_decred/.metadata b/cw_decred/.metadata
deleted file mode 100644
index fa060de4b..000000000
--- a/cw_decred/.metadata
+++ /dev/null
@@ -1,36 +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.
-
-version:
- revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- channel: unknown
-
-project_type: plugin
-
-# Tracks metadata for the flutter migrate command
-migration:
- platforms:
- - platform: root
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: android
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: ios
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: macos
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
-
- # User provided section
-
- # List of Local paths (relative to this file) that should be
- # ignored by the migrate tool.
- #
- # Files that are not part of the templates will be ignored by default.
- unmanaged_files:
- - 'lib/main.dart'
- - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/cw_decred/CHANGELOG.md b/cw_decred/CHANGELOG.md
deleted file mode 100644
index ac071598e..000000000
--- a/cw_decred/CHANGELOG.md
+++ /dev/null
@@ -1,3 +0,0 @@
-## [0.0.1] - TODO: Add release date.
-
-* TODO: Describe initial release.
diff --git a/cw_decred/LICENSE b/cw_decred/LICENSE
deleted file mode 100644
index ba75c69f7..000000000
--- a/cw_decred/LICENSE
+++ /dev/null
@@ -1 +0,0 @@
-TODO: Add your license here.
diff --git a/cw_decred/README.md b/cw_decred/README.md
deleted file mode 100644
index c43032f7a..000000000
--- a/cw_decred/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# cw_decred
-
-Decred wallet module that bridges to the native `libdcrwallet` via FFI. Provides high‑level methods to create/load wallets, sync, query balances/transactions, build and broadcast transactions, and sign/verify messages.
-
-## Features
-
-- FFI bindings to `libdcrwallet` with an isolate‑based request/response model.
-- Initialize, create, load, close wallets; watch‑only creation.
-- Start sync with optional peer list; query sync status and best block.
-- Query balances, list transactions and unspents, rescan from height.
-- Create signed transactions and broadcast raw transactions.
-- Export wallet seed; change wallet password.
-- Address management (new external address, default pubkey, address lists).
-- Message signing and verification.
-
-## Getting started
-
-Ensure the platform library is available:
-
-- Android/Linux: `libdcrwallet.so`
-- Apple: embedded `cw_decred.framework/cw_decred`
-
-Initialize and load a wallet:
-
-```dart
-final lib = await Libwallet.spawn();
-await lib.initLibdcrwallet('', 'info');
-await lib.loadWallet(jsonEncode({ /* libdcrwallet config */ }));
-await lib.startSync('wallet.db', '');
-final status = await lib.syncStatus('wallet.db');
-```
-
-## Usage
-
-Create, sign, and broadcast a transaction:
-
-```dart
-final signed = await lib.createSignedTransaction('wallet.db', jsonEncode({
- // inputs/outputs and policy for libdcrwallet
-}));
-final txid = await lib.sendRawTransaction('wallet.db', signed);
-```
-
-## Additional information
-
-- See `lib/api/` for the isolate wrapper (`libdcrwallet.dart`) and low‑level bindings.
-- Errors are surfaced via the `PayloadResult` struct; some calls support `throwOnError` in higher‑level wrappers.
diff --git a/cw_decred/analysis_options.yaml b/cw_decred/analysis_options.yaml
deleted file mode 100644
index a5744c1cf..000000000
--- a/cw_decred/analysis_options.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-include: package:flutter_lints/flutter.yaml
-
-# Additional information about this file can be found at
-# https://dart.dev/guides/language/analysis-options
diff --git a/cw_decred/android/.gitignore b/cw_decred/android/.gitignore
deleted file mode 100644
index 161bdcdaf..000000000
--- a/cw_decred/android/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.cxx
diff --git a/cw_decred/android/build.gradle b/cw_decred/android/build.gradle
deleted file mode 100644
index 0fb2f3cb8..000000000
--- a/cw_decred/android/build.gradle
+++ /dev/null
@@ -1,59 +0,0 @@
-group 'com.cakewallet.cw_decred'
-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_decred'
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
-
- kotlinOptions {
- jvmTarget = '17'
- }
- sourceSets {
- main {
- java.srcDirs += 'src/main/kotlin'
- jniLibs.srcDirs 'libs' // contains libdcrwallet.so shared libraries
- }
- }
- defaultConfig {
- minSdkVersion 21
- }
- externalNativeBuild {
- cmake {
- }
- }
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
diff --git a/cw_decred/android/settings.gradle b/cw_decred/android/settings.gradle
deleted file mode 100644
index 1c81706ad..000000000
--- a/cw_decred/android/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = 'cw_decred'
diff --git a/cw_decred/android/src/main/AndroidManifest.xml b/cw_decred/android/src/main/AndroidManifest.xml
deleted file mode 100644
index ea58d3c72..000000000
--- a/cw_decred/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
diff --git a/cw_decred/android/src/main/kotlin/com/cakewallet/cw_decred/CwDecredPlugin.kt b/cw_decred/android/src/main/kotlin/com/cakewallet/cw_decred/CwDecredPlugin.kt
deleted file mode 100644
index 4bd6f3395..000000000
--- a/cw_decred/android/src/main/kotlin/com/cakewallet/cw_decred/CwDecredPlugin.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.cakewallet.cw_decred
-
-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
-
-/** CwDecredPlugin */
-class CwDecredPlugin: 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_decred")
- 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_decred/devtools_options.yaml b/cw_decred/devtools_options.yaml
deleted file mode 100644
index fa0b357c4..000000000
--- a/cw_decred/devtools_options.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-description: This file stores settings for Dart & Flutter DevTools.
-documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
-extensions:
diff --git a/cw_decred/ios/.gitignore b/cw_decred/ios/.gitignore
deleted file mode 100644
index 0c885071e..000000000
--- a/cw_decred/ios/.gitignore
+++ /dev/null
@@ -1,38 +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/ephemeral/
-/Flutter/flutter_export_environment.sh
\ No newline at end of file
diff --git a/cw_decred/ios/Assets/.gitkeep b/cw_decred/ios/Assets/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/cw_decred/ios/Classes/CwDecredPlugin.swift b/cw_decred/ios/Classes/CwDecredPlugin.swift
deleted file mode 100644
index c38d15516..000000000
--- a/cw_decred/ios/Classes/CwDecredPlugin.swift
+++ /dev/null
@@ -1,19 +0,0 @@
-import Flutter
-import UIKit
-
-public class CwDecredPlugin: NSObject, FlutterPlugin {
- public static func register(with registrar: FlutterPluginRegistrar) {
- let channel = FlutterMethodChannel(name: "cw_decred", binaryMessenger: registrar.messenger())
- let instance = CwDecredPlugin()
- registrar.addMethodCallDelegate(instance, channel: channel)
- }
-
- public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
- switch call.method {
- case "getPlatformVersion":
- result("iOS " + UIDevice.current.systemVersion)
- default:
- result(FlutterMethodNotImplemented)
- }
- }
-}
diff --git a/cw_decred/ios/cw_decred.podspec b/cw_decred/ios/cw_decred.podspec
deleted file mode 100644
index b36789e08..000000000
--- a/cw_decred/ios/cw_decred.podspec
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint cw_decred.podspec` to validate before publishing.
-#
-Pod::Spec.new do |s|
- s.name = 'cw_decred'
- s.version = '0.0.1'
- s.summary = 'Cake Wallet Decred'
- s.description = 'Cake Wallet wrapper over Decred 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.dependency 'Flutter'
- s.platform = :ios, '11.0'
-
- s.vendored_libraries = 'External/lib/libdcrwallet.a'
- # Flutter.framework does not contain a i386 slice.
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386', "OTHER_LDFLAGS" => "-force_load $(PODS_TARGET_SRCROOT)/External/lib/libdcrwallet.a -lstdc++" }
- s.swift_version = '5.0'
-end
diff --git a/cw_decred/lib/amount_format.dart b/cw_decred/lib/amount_format.dart
deleted file mode 100644
index c09f76b3b..000000000
--- a/cw_decred/lib/amount_format.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-import 'package:intl/intl.dart';
-import 'package:cw_core/crypto_amount_format.dart';
-
-const decredAmountLength = 8;
-const decredAmountDivider = 100000000;
-final decredAmountFormat = NumberFormat()
- ..maximumFractionDigits = decredAmountLength
- ..minimumFractionDigits = 1;
-
-String decredAmountToString({required int amount}) =>
- decredAmountFormat.format(cryptoAmountToDouble(amount: amount, divider: decredAmountDivider));
-
-double decredAmountToDouble({required int amount}) =>
- cryptoAmountToDouble(amount: amount, divider: decredAmountDivider);
-
-int stringDoubleToDecredAmount(String amount) {
- int result = 0;
-
- try {
- result = (double.parse(amount) * decredAmountDivider).round();
- } catch (e) {
- result = 0;
- }
-
- return result;
-}
diff --git a/cw_decred/lib/api/libdcrwallet.dart b/cw_decred/lib/api/libdcrwallet.dart
deleted file mode 100644
index a6d1e1017..000000000
--- a/cw_decred/lib/api/libdcrwallet.dart
+++ /dev/null
@@ -1,702 +0,0 @@
-import 'dart:convert';
-import 'dart:ffi';
-import 'dart:io';
-import 'dart:async';
-import 'dart:isolate';
-import 'package:cw_core/utils/print_verbose.dart';
-import 'package:cw_decred/api/libdcrwallet_bindings.dart';
-import 'package:cw_decred/api/util.dart';
-
-final int ErrCodeNotSynced = 1;
-
-final String libraryName = Platform.isAndroid || Platform.isLinux // TODO: Linux.
- ? 'libdcrwallet.so'
- : 'cw_decred.framework/cw_decred';
-
-class Libwallet {
- final SendPort _commands;
- final ReceivePort _responses;
- final Map> _activeRequests = {};
- int _idCounter = 0;
- bool _closed = false;
-
- static Future spawn() async {
- // Create a receive port and add its initial message handler.
- final initPort = RawReceivePort();
- final connection = Completer<(ReceivePort, SendPort)>.sync();
- initPort.handler = (initialMessage) {
- final commandPort = initialMessage as SendPort;
- connection.complete((
- ReceivePort.fromRawReceivePort(initPort),
- commandPort,
- ));
- };
- // Spawn the isolate.
- try {
- await Isolate.spawn(_startRemoteIsolate, (initPort.sendPort));
- } on Object {
- initPort.close();
- rethrow;
- }
-
- final (ReceivePort receivePort, SendPort sendPort) = await connection.future;
-
- return Libwallet._(receivePort, sendPort);
- }
-
- Libwallet._(this._responses, this._commands) {
- _responses.listen(_handleResponsesFromIsolate);
- }
-
- void _handleResponsesFromIsolate(dynamic message) {
- final (int id, Object? response) = message as (int, Object?);
- final completer = _activeRequests.remove(id)!;
-
- if (response is RemoteError) {
- completer.completeError(response);
- } else {
- completer.complete(response);
- }
-
- if (_closed && _activeRequests.isEmpty) _responses.close();
- }
-
- static void _handleCommandsToIsolate(
- ReceivePort receivePort,
- SendPort sendPort,
- ) {
- final dcrwalletApi = libdcrwallet(DynamicLibrary.open(libraryName));
- receivePort.listen((message) {
- if (message == 'shutdown') {
- receivePort.close();
- return;
- }
- final (int id, Map args) = message as (int, Map);
- var res = PayloadResult("", "", 0);
- final method = args["method"] ?? "";
- try {
- switch (method) {
- case "initlibdcrwallet":
- final logDir = args["logdir"] ?? "";
- final level = args["level"] ?? "";
- final cLogDir = logDir.toCString();
- final cLevel = level.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.initialize(cLogDir, cLevel),
- ptrsToFree: [cLogDir, cLevel],
- );
- break;
- case "createwallet":
- final config = args["config"] ?? "";
- final cConfig = config.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.createWallet(cConfig),
- ptrsToFree: [cConfig],
- );
- break;
- case "createwatchonlywallet":
- final config = args["config"] ?? "";
- final cConfig = config.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.createWatchOnlyWallet(cConfig),
- ptrsToFree: [cConfig],
- );
- break;
- case "loadwallet":
- final config = args["config"] ?? "";
- final cConfig = config.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.loadWallet(cConfig),
- ptrsToFree: [cConfig],
- );
- break;
- case "startsync":
- final name = args["name"] ?? "";
- final peers = args["peers"] ?? "";
- final cName = name.toCString();
- final cPeers = peers.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.syncWallet(cName, cPeers),
- ptrsToFree: [cName, cPeers],
- );
- break;
- case "closewallet":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.closeWallet(cName),
- ptrsToFree: [cName],
- );
- break;
- case "changewalletpassword":
- final name = args["name"] ?? "";
- final oldPass = args["oldpass"] ?? "";
- final newPass = args["newpass"] ?? "";
- final cName = name.toCString();
- final cOldPass = oldPass.toCString();
- final cNewPass = newPass.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.changePassphrase(cName, cOldPass, cNewPass),
- ptrsToFree: [cName, cOldPass, cNewPass],
- );
- break;
- case "walletseed":
- final name = args["name"] ?? "";
- final pass = args["pass"] ?? "";
- final cName = name.toCString();
- final cPass = pass.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.walletSeed(cName, cPass),
- ptrsToFree: [cName, cPass],
- );
- break;
- case "syncstatus":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.syncWalletStatus(cName),
- ptrsToFree: [cName],
- );
- break;
- case "balance":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.walletBalance(cName),
- ptrsToFree: [cName],
- );
- break;
- case "estimatefee":
- final name = args["name"] ?? "";
- final numBlocks = args["numblocks"] ?? "";
- final cName = name.toCString();
- final cNumBlocks = numBlocks.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.estimateFee(cName, cNumBlocks),
- ptrsToFree: [cName, cNumBlocks],
- );
- break;
- case "createsignedtransaction":
- final name = args["name"] ?? "";
- final signReq = args["signreq"] ?? "";
- final cName = name.toCString();
- final cSignReq = signReq.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.createSignedTransaction(cName, cSignReq),
- ptrsToFree: [cName, cSignReq],
- );
- break;
- case "sendrawtransaction":
- final name = args["name"] ?? "";
- final txHex = args["txhex"] ?? "";
- final cName = name.toCString();
- final cTxHex = txHex.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.sendRawTransaction(cName, cTxHex),
- ptrsToFree: [cName, cTxHex],
- );
- break;
- case "listtransactions":
- final name = args["name"] ?? "";
- final from = args["from"] ?? "";
- final count = args["count"] ?? "";
- final cName = name.toCString();
- final cFrom = from.toCString();
- final cCount = count.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.listTransactions(cName, cFrom, cCount),
- ptrsToFree: [cName, cFrom, cCount],
- );
- break;
- case "bestblock":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.bestBlock(cName),
- ptrsToFree: [cName],
- );
- break;
- case "listunspents":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.listUnspents(cName),
- ptrsToFree: [cName],
- );
- break;
- case "rescanfromheight":
- final name = args["name"] ?? "";
- final height = args["height"] ?? "";
- final cName = name.toCString();
- final cHeight = height.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.rescanFromHeight(cName, cHeight),
- ptrsToFree: [cName, cHeight],
- );
- break;
- case "signmessage":
- final name = args["name"] ?? "";
- final message = args["message"] ?? "";
- final address = args["address"] ?? "";
- final pass = args["pass"] ?? "";
- final cName = name.toCString();
- final cMessage = message.toCString();
- final cAddress = address.toCString();
- final cPass = pass.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.signMessage(cName, cMessage, cAddress, cPass),
- ptrsToFree: [cName, cMessage, cAddress, cPass],
- );
- break;
- case "verifymessage":
- final name = args["name"] ?? "";
- final message = args["message"] ?? "";
- final address = args["address"] ?? "";
- final sig = args["sig"] ?? "";
- final cName = name.toCString();
- final cMessage = message.toCString();
- final cAddress = address.toCString();
- final cSig = sig.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.verifyMessage(cName, cMessage, cAddress, cSig),
- ptrsToFree: [cName, cMessage, cAddress, cSig],
- );
- break;
- case "newexternaladdress":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.newExternalAddress(cName),
- ptrsToFree: [cName],
- skipErrorCheck: true,
- );
- break;
- case "defaultpubkey":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.defaultPubkey(cName),
- ptrsToFree: [cName],
- );
- break;
- case "addresses":
- final name = args["name"] ?? "";
- final nUsed = args["nused"] ?? "";
- final nUnused = args["nunused"] ?? "";
- final cName = name.toCString();
- final cNUsed = nUsed.toCString();
- final cNUnused = nUnused.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.addresses(cName, cNUsed, cNUnused),
- ptrsToFree: [cName, cNUsed, cNUnused],
- );
- break;
- case "birthstate":
- final name = args["name"] ?? "";
- final cName = name.toCString();
- res = executePayloadFn(
- fn: () => dcrwalletApi.birthState(cName),
- ptrsToFree: [cName],
- );
- break;
- case "shutdown":
- final name = args["name"] ?? "";
- // final cName = name.toCString();
- executePayloadFn(
- fn: () => dcrwalletApi.shutdown(),
- ptrsToFree: [],
- );
- break;
- default:
- res = PayloadResult("", "unknown libwallet method ${method}", 0);
- }
- sendPort.send((id, res));
- } catch (e) {
- final errMsg = e.toString();
- printV("decred libwallet returned an error for method ${method}: ${errMsg}");
- sendPort.send((id, PayloadResult("", errMsg, 0)));
- }
- });
- }
-
- static void _startRemoteIsolate(SendPort sendPort) {
- final receivePort = ReceivePort();
- sendPort.send(receivePort.sendPort);
- _handleCommandsToIsolate(receivePort, sendPort);
- }
-
- // initLibdcrwallet initializes libdcrwallet using the provided logDir and gets
- // it ready for use. This must be done before attempting to create, load or use
- // a wallet. An empty string can be used to log to stdout and create no log files.
- Future initLibdcrwallet(String logDir, String level) async {
- if (_closed) throw StateError('Closed');
- final completer = Completer