summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild_single.sh2
-rw-r--r--contrib/depends/Makefile4
-rwxr-xr-xcontrib/depends/gen_toolchain.cmake.sh4
-rw-r--r--impls/monero.dart/lib/monero.dart49
-rw-r--r--impls/monero.dart/lib/src/generated_bindings_monero.g.dart38
-rw-r--r--impls/monero.dart/lib/src/monero.dart1041
-rw-r--r--impls/monero.dart/lib/src/wallet2.dart249
-rw-r--r--impls/monero.dart/lib/src/wownero.dart1009
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.cpp18
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.h2
-rw-r--r--patches/monero/0021-trezor-import-export-sign-functions.patch1115
11 files changed, 2710 insertions, 821 deletions
diff --git a/build_single.sh b/build_single.sh
index ebc30e3..ec2d760 100755
--- a/build_single.sh
+++ b/build_single.sh
@@ -78,7 +78,7 @@ do
EXTRA_CMAKE_FLAGS="-DCAKEWALLET=ON"
fi
pushd build/${HOST_ABI}_${OUTPUT_MODE}
- cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../../contrib/depends/${HOST_ABI}/share/toolchain.cmake $EXTRA_CMAKE_FLAGS -DUSE_DEVICE_TREZOR=OFF -DMONERO_FLAVOR=$repo -DCMAKE_BUILD_TYPE=Debug -DHOST_ABI=${HOST_ABI} -DOUTPUT_MODE=${OUTPUT_MODE} ../..
+ cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../../contrib/depends/${HOST_ABI}/share/toolchain.cmake $EXTRA_CMAKE_FLAGS -DMONERO_FLAVOR=$repo -DCMAKE_BUILD_TYPE=Debug -DHOST_ABI=${HOST_ABI} -DOUTPUT_MODE=${OUTPUT_MODE} ../..
make $NPROC
popd
popd
diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile
index 92e9036..34dc333 100644
--- a/contrib/depends/Makefile
+++ b/contrib/depends/Makefile
@@ -3,8 +3,8 @@
HOST ?=
BOOST_VERSION ?= 1_90_0
-PACKAGES = native/cmake,native/python@3.14,native/git,native/_,native/make,native/cmake-toolchain,icu4c,boost@$(BOOST_VERSION),zeromq,unbound,sodium,openssl,libiconv,zlib
-SIMPLYBS_HASH = 0ea74cb120b06156ce16118f86dc5b7d23a93c46
+PACKAGES = native/protobuf,native/cmake,native/python@3.14,native/git,native/_,native/make,native/cmake-toolchain,icu4c,boost@$(BOOST_VERSION),zeromq,unbound,sodium,openssl,libiconv,zlib,protobuf
+SIMPLYBS_HASH = 2091e0883265ad13cc9506ec1e7c0fb3c09ca646
all: simplybs $(if $(HOST),sbs-build-$(HOST),)
@if [ -z "$(HOST)" ]; then \
diff --git a/contrib/depends/gen_toolchain.cmake.sh b/contrib/depends/gen_toolchain.cmake.sh
index 9ed2621..5d48edd 100755
--- a/contrib/depends/gen_toolchain.cmake.sh
+++ b/contrib/depends/gen_toolchain.cmake.sh
@@ -155,7 +155,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(LLVM_ENABLE_PIC OFF)
SET(LLVM_ENABLE_PIE OFF)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
- add_definitions(-DUSE_DEVICE_TREZOR=OFF)
+ add_definitions(-DUSE_DEVICE_TREZOR=ON)
SET(ANDROID TRUE)
if(ARCHITECTURE STREQUAL "armv7a")
SET(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a")
@@ -181,7 +181,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
SET(CMAKE_C_COMPILER @CC@)
SET(CMAKE_CXX_COMPILER @CXX@)
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
- set(USE_DEVICE_TREZOR OFF)
+ set(USE_DEVICE_TREZOR ON)
add_definitions(-DUSE_DEVICE_LEDGER=ON)
SET(CMAKE_C_COMPILER @CC@)
SET(CMAKE_CXX_COMPILER @CXX@)
diff --git a/impls/monero.dart/lib/monero.dart b/impls/monero.dart/lib/monero.dart
index a7f026e..10317b6 100644
--- a/impls/monero.dart/lib/monero.dart
+++ b/impls/monero.dart/lib/monero.dart
@@ -569,6 +569,38 @@ String UnsignedTransaction_signUR(
}
}
+@Deprecated("TODO")
+String PendingTransaction_commitTrezor(PendingTransaction ptr, int tx_index) {
+ debugStart?.call('MONERO_PendingTransaction_commitTrezor');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+ final txid = lib!.MONERO_PendingTransaction_commitTrezor(ptr, tx_index);
+ debugEnd?.call('MONERO_PendingTransaction_commitTrezor');
+ try {
+ final strPtr = txid.cast<Utf8>();
+ final str = strPtr.toDartString();
+ MONERO_free(strPtr.cast());
+ debugEnd?.call('MONERO_PendingTransaction_commitTrezor');
+ return str;
+ } catch (e) {
+ errorHandler?.call('MONERO_PendingTransaction_commitTrezor', e);
+ debugEnd?.call('MONERO_PendingTransaction_commitTrezor');
+ return "";
+ }
+}
+
+@Deprecated("TODO")
+bool PendingTransaction_commitTrezorNext(
+ PendingTransaction ptr, String response_json, int tx_index) {
+ debugStart?.call('MONERO_PendingTransaction_commitTrezorNext');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+ final response_jsonC = response_json.toNativeUtf8();
+ final result = lib!.MONERO_PendingTransaction_commitTrezorNext(
+ ptr, response_jsonC.cast(), tx_index);
+ calloc.free(response_jsonC);
+ debugEnd?.call('MONERO_PendingTransaction_commitTrezorNext');
+ return result;
+}
+
// TransactionInfo
typedef TransactionInfo = Pointer<Void>;
@@ -3596,7 +3628,9 @@ void Wallet_setDeviceSendData(Pointer<UnsignedChar> data, int len) {
}
@Deprecated("TODO")
-void Wallet_setLedgerCallback(Pointer<NativeFunction<Void Function(Pointer<UnsignedChar>, UnsignedInt)>> callback) {
+void Wallet_setLedgerCallback(
+ Pointer<NativeFunction<Void Function(Pointer<UnsignedChar>, UnsignedInt)>>
+ callback) {
debugStart?.call('MONERO_Wallet_setDeviceSendData');
lib ??= MoneroC(DynamicLibrary.open(libPath));
final ret = lib!.MONERO_Wallet_setLedgerCallback(callback);
@@ -3620,7 +3654,8 @@ bool Wallet_importTrezorEncryptedKeyImagesJson(wallet ptr, String json) {
debugStart?.call('MONERO_Wallet_importTrezorEncryptedKeyImagesJson');
lib ??= MoneroC(DynamicLibrary.open(libPath));
final jsonStr = json.toNativeUtf8();
- final ret = lib!.MONERO_Wallet_importTrezorEncryptedKeyImagesJson(ptr, jsonStr.cast());
+ final ret = lib!
+ .MONERO_Wallet_importTrezorEncryptedKeyImagesJson(ptr, jsonStr.cast());
malloc.free(jsonStr);
debugEnd?.call('MONERO_Wallet_importTrezorEncryptedKeyImagesJson');
return ret;
@@ -3904,11 +3939,11 @@ bool WalletManager_verifyWalletPassword(
@Deprecated("TODO")
int WalletManager_queryWalletDevice(
- WalletManager wm_ptr, {
- required String keysFileName,
- required String password,
- required int kdfRounds,
- }) {
+ WalletManager wm_ptr, {
+ required String keysFileName,
+ required String password,
+ required int kdfRounds,
+}) {
debugStart?.call('MONERO_WalletManager_queryWalletDevice');
lib ??= MoneroC(DynamicLibrary.open(libPath));
final keysFileName_ = keysFileName.toNativeUtf8().cast<Char>();
diff --git a/impls/monero.dart/lib/src/generated_bindings_monero.g.dart b/impls/monero.dart/lib/src/generated_bindings_monero.g.dart
index 0cd6bb5..7c709ec 100644
--- a/impls/monero.dart/lib/src/generated_bindings_monero.g.dart
+++ b/impls/monero.dart/lib/src/generated_bindings_monero.g.dart
@@ -88,6 +88,44 @@ class MoneroC {
_MONERO_PendingTransaction_commitURPtr.asFunction<
ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Void>, int)>();
+ ffi.Pointer<ffi.Char> MONERO_PendingTransaction_commitTrezor(
+ ffi.Pointer<ffi.Void> pendingTx_ptr,
+ int tx_index,
+ ) {
+ return _MONERO_PendingTransaction_commitTrezor(
+ pendingTx_ptr,
+ tx_index,
+ );
+ }
+
+ late final _MONERO_PendingTransaction_commitTrezorPtr = _lookup<
+ ffi.NativeFunction<
+ ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Void>,
+ ffi.Int)>>('MONERO_PendingTransaction_commitTrezor');
+ late final _MONERO_PendingTransaction_commitTrezor =
+ _MONERO_PendingTransaction_commitTrezorPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function(ffi.Pointer<ffi.Void>, int)>();
+
+ bool MONERO_PendingTransaction_commitTrezorNext(
+ ffi.Pointer<ffi.Void> pendingTx_ptr,
+ ffi.Pointer<ffi.Char> response_json,
+ int tx_index,
+ ) {
+ return _MONERO_PendingTransaction_commitTrezorNext(
+ pendingTx_ptr,
+ response_json,
+ tx_index,
+ );
+ }
+
+ late final _MONERO_PendingTransaction_commitTrezorNextPtr = _lookup<
+ ffi.NativeFunction<
+ ffi.Bool Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Char>,
+ ffi.Int)>>('MONERO_PendingTransaction_commitTrezorNext');
+ late final _MONERO_PendingTransaction_commitTrezorNext =
+ _MONERO_PendingTransaction_commitTrezorNextPtr.asFunction<
+ bool Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Char>, int)>();
+
int MONERO_PendingTransaction_amount(
ffi.Pointer<ffi.Void> pendingTx_ptr,
) {
diff --git a/impls/monero.dart/lib/src/monero.dart b/impls/monero.dart/lib/src/monero.dart
index abecee0..780f0fc 100644
--- a/impls/monero.dart/lib/src/monero.dart
+++ b/impls/monero.dart/lib/src/monero.dart
@@ -11,7 +11,7 @@ class Monero implements Wallet2 {
Wallet2WalletManagerFactory walletManagerFactory() {
return MoneroWalletManagerFactory();
}
-
+
@override
int ffiAddress() => 0;
}
@@ -20,48 +20,54 @@ class MoneroAddressBook implements Wallet2AddressBook {
MoneroAddressBook(this.addressBookPtr);
final monero.AddressBook addressBookPtr;
-
+
@override
- bool addRow({required String dstAddr, required String paymentId, required String description}) {
- return monero.AddressBook_addRow(addressBookPtr, dstAddr: dstAddr, paymentId: paymentId, description: description);
+ bool addRow(
+ {required String dstAddr,
+ required String paymentId,
+ required String description}) {
+ return monero.AddressBook_addRow(addressBookPtr,
+ dstAddr: dstAddr, paymentId: paymentId, description: description);
}
-
+
@override
bool deleteRow({required int rowId}) {
return monero.AddressBook_deleteRow(addressBookPtr, rowId: rowId);
}
-
+
@override
int errorCode() {
return monero.AddressBook_errorCode(addressBookPtr);
}
-
+
@override
Wallet2AddressBookRow getAll_byIndex(int index) {
final row = monero.AddressBook_getAll_byIndex(addressBookPtr, index: index);
return MoneroAddressBookRow(row);
}
-
+
@override
int getAll_size() {
return monero.AddressBook_getAll_size(addressBookPtr);
}
-
+
@override
int lookupPaymentID({required String paymentId}) {
- return monero.AddressBook_lookupPaymentID(addressBookPtr, paymentId: paymentId);
+ return monero.AddressBook_lookupPaymentID(addressBookPtr,
+ paymentId: paymentId);
}
-
+
@override
void refresh() {
monero.AddressBook_refresh(addressBookPtr);
}
-
+
@override
bool setDescription({required int rowId, required String description}) {
- return monero.AddressBook_setDescription(addressBookPtr, rowId: rowId, description: description);
+ return monero.AddressBook_setDescription(addressBookPtr,
+ rowId: rowId, description: description);
}
-
+
@override
int ffiAddress() => addressBookPtr.address;
}
@@ -70,27 +76,27 @@ class MoneroAddressBookRow implements Wallet2AddressBookRow {
MoneroAddressBookRow(this.addressBookRowPtr);
final monero.AddressBookRow addressBookRowPtr;
-
+
@override
String extra() {
return monero.AddressBookRow_extra(addressBookRowPtr);
}
-
+
@override
String getAddress() {
return monero.AddressBookRow_getAddress(addressBookRowPtr);
}
-
+
@override
String getDescription() {
return monero.AddressBookRow_getDescription(addressBookRowPtr);
}
-
+
@override
String getPaymentId() {
return monero.AddressBookRow_getPaymentId(addressBookRowPtr);
}
-
+
@override
int getRowId() {
return monero.AddressBookRow_getRowId(addressBookRowPtr);
@@ -104,54 +110,55 @@ class MoneroCoins implements Wallet2Coins {
MoneroCoins(this.coinsPtr);
final monero.Coins coinsPtr;
-
+
@override
Wallet2CoinsInfo coin(int index) {
final coin = monero.Coins_coin(coinsPtr, index);
return MoneroCoinsInfo(coin);
}
-
+
@override
int count() {
return monero.Coins_count(coinsPtr);
}
-
+
@override
Wallet2CoinsInfo getAll_byIndex(int index) {
final coin = monero.Coins_getAll_byIndex(coinsPtr, index);
return MoneroCoinsInfo(coin);
}
-
+
@override
int getAll_size() {
return monero.Coins_getAll_size(coinsPtr);
}
-
+
@override
bool isTransferUnlocked({required int unlockTime, required int blockHeight}) {
- return monero.Coins_isTransferUnlocked(coinsPtr, unlockTime: unlockTime, blockHeight: blockHeight);
+ return monero.Coins_isTransferUnlocked(coinsPtr,
+ unlockTime: unlockTime, blockHeight: blockHeight);
}
-
+
@override
void refresh() {
monero.Coins_refresh(coinsPtr);
}
-
+
@override
void setFrozen({required int index}) {
monero.Coins_setFrozen(coinsPtr, index: index);
}
-
+
@override
void setFrozenByPublicKey({required String publicKey}) {
monero.Coins_setFrozenByPublicKey(coinsPtr, publicKey: publicKey);
}
-
+
@override
void thaw({required int index}) {
monero.Coins_thaw(coinsPtr, index: index);
}
-
+
@override
void thawByPublicKey({required String publicKey}) {
monero.Coins_thawByPublicKey(coinsPtr, publicKey: publicKey);
@@ -165,107 +172,107 @@ class MoneroCoinsInfo implements Wallet2CoinsInfo {
MoneroCoinsInfo(this.coinsInfoPtr);
final monero.CoinsInfo coinsInfoPtr;
-
+
@override
String address() {
return monero.CoinsInfo_address(coinsInfoPtr);
}
-
+
@override
String addressLabel() {
return monero.CoinsInfo_addressLabel(coinsInfoPtr);
}
-
+
@override
int amount() {
return monero.CoinsInfo_amount(coinsInfoPtr);
}
-
+
@override
int blockHeight() {
return monero.CoinsInfo_blockHeight(coinsInfoPtr);
}
-
+
@override
bool coinbase() {
return monero.CoinsInfo_coinbase(coinsInfoPtr);
}
-
+
@override
String description() {
return monero.CoinsInfo_description(coinsInfoPtr);
}
-
+
@override
bool frozen() {
return monero.CoinsInfo_frozen(coinsInfoPtr);
}
-
+
@override
int globalOutputIndex() {
return monero.CoinsInfo_globalOutputIndex(coinsInfoPtr);
}
-
+
@override
String hash() {
return monero.CoinsInfo_hash(coinsInfoPtr);
}
-
+
@override
int internalOutputIndex() {
return monero.CoinsInfo_internalOutputIndex(coinsInfoPtr);
}
-
+
@override
String keyImage() {
return monero.CoinsInfo_keyImage(coinsInfoPtr);
}
-
+
@override
bool keyImageKnown() {
return monero.CoinsInfo_keyImageKnown(coinsInfoPtr);
}
-
+
@override
int pkIndex() {
return monero.CoinsInfo_pkIndex(coinsInfoPtr);
}
-
+
@override
String pubKey() {
return monero.CoinsInfo_pubKey(coinsInfoPtr);
}
-
+
@override
bool rct() {
return monero.CoinsInfo_rct(coinsInfoPtr);
}
-
+
@override
bool spent() {
return monero.CoinsInfo_spent(coinsInfoPtr);
}
-
+
@override
int spentHeight() {
return monero.CoinsInfo_spentHeight(coinsInfoPtr);
}
-
+
@override
int subaddrAccount() {
return monero.CoinsInfo_subaddrAccount(coinsInfoPtr);
}
-
+
@override
int subaddrIndex() {
return monero.CoinsInfo_subaddrIndex(coinsInfoPtr);
}
-
+
@override
int unlockTime() {
return monero.CoinsInfo_unlockTime(coinsInfoPtr);
}
-
+
@override
bool unlocked() {
return monero.CoinsInfo_unlocked(coinsInfoPtr);
@@ -279,12 +286,12 @@ class MoneroDeviceProgress implements Wallet2DeviceProgress {
MoneroDeviceProgress(this.deviceProgressPtr);
final monero.DeviceProgress deviceProgressPtr;
-
+
@override
bool indeterminate() {
return monero.DeviceProgress_indeterminate(deviceProgressPtr);
}
-
+
@override
bool progress() {
return monero.DeviceProgress_progress(deviceProgressPtr);
@@ -298,27 +305,29 @@ class MoneroWalletListener implements Wallet2WalletListener {
MoneroWalletListener(this.walletListenerPtr);
final monero.WalletListener walletListenerPtr;
-
+
@override
int height() {
return monero.MONERO_cw_WalletListener_height(walletListenerPtr);
}
-
+
@override
bool isNeedToRefresh() {
return monero.MONERO_cw_WalletListener_isNeedToRefresh(walletListenerPtr);
}
-
+
@override
bool isNewTransactionExist() {
- return monero.MONERO_cw_WalletListener_isNewTransactionExist(walletListenerPtr);
+ return monero.MONERO_cw_WalletListener_isNewTransactionExist(
+ walletListenerPtr);
}
-
+
@override
void resetIsNewTransactionExist() {
- monero.MONERO_cw_WalletListener_resetIsNewTransactionExist(walletListenerPtr);
+ monero.MONERO_cw_WalletListener_resetIsNewTransactionExist(
+ walletListenerPtr);
}
-
+
@override
void resetNeedToRefresh() {
monero.MONERO_cw_WalletListener_resetNeedToRefresh(walletListenerPtr);
@@ -335,12 +344,12 @@ class MoneroWalletChecksum implements Wallet2Checksum {
String checksum_wallet2_api_c_cpp() {
return monero.MONERO_checksum_wallet2_api_c_cpp();
}
-
+
@override
String checksum_wallet2_api_c_exp() {
return monero.MONERO_checksum_wallet2_api_c_exp();
}
-
+
@override
String checksum_wallet2_api_c_h() {
return monero.MONERO_checksum_wallet2_api_c_h();
@@ -366,22 +375,22 @@ class MoneroMultisigState implements Wallet2MultisigState {
MoneroMultisigState(this.multisigStatePtr);
final monero.MultisigState multisigStatePtr;
-
+
@override
bool isMultisig(Pointer<Void> ptr) {
return monero.MultisigState_isMultisig(multisigStatePtr);
}
-
+
@override
bool isReady(Pointer<Void> ptr) {
return monero.MultisigState_isReady(multisigStatePtr);
}
-
+
@override
int threshold(Pointer<Void> ptr) {
return monero.MultisigState_threshold(multisigStatePtr);
}
-
+
@override
int total(Pointer<Void> ptr) {
return monero.MultisigState_total(multisigStatePtr);
@@ -395,77 +404,94 @@ class MoneroPendingTransaction implements Wallet2PendingTransaction {
MoneroPendingTransaction(this.pendingTransactionPtr);
final monero.PendingTransaction pendingTransactionPtr;
-
+
@override
int amount() {
return monero.PendingTransaction_amount(pendingTransactionPtr);
}
-
+
@override
bool commit({required String filename, required bool overwrite}) {
- return monero.PendingTransaction_commit(pendingTransactionPtr, filename: filename, overwrite: overwrite);
+ return monero.PendingTransaction_commit(pendingTransactionPtr,
+ filename: filename, overwrite: overwrite);
}
-
+
@override
String commitUR(int max_fragment_length) {
- return monero.PendingTransaction_commitUR(pendingTransactionPtr, max_fragment_length);
+ return monero.PendingTransaction_commitUR(
+ pendingTransactionPtr, max_fragment_length);
}
-
+
+ @override
+ String commitTrezor(int tx_index) {
+ return monero.PendingTransaction_commitTrezor(
+ pendingTransactionPtr, tx_index);
+ }
+
+ @override
+ bool commitTrezorNext(String response_json, int tx_index) {
+ return monero.PendingTransaction_commitTrezorNext(
+ pendingTransactionPtr, response_json, tx_index);
+ }
+
@override
int dust() {
return monero.PendingTransaction_dust(pendingTransactionPtr);
}
-
+
@override
String errorString() {
return monero.PendingTransaction_errorString(pendingTransactionPtr);
}
-
+
@override
int fee() {
return monero.PendingTransaction_fee(pendingTransactionPtr);
}
-
+
@override
String hex(String separator) {
return monero.PendingTransaction_hex(pendingTransactionPtr, separator);
}
-
+
@override
String multisigSignData() {
return monero.PendingTransaction_multisigSignData(pendingTransactionPtr);
}
-
+
@override
void signMultisigTx() {
monero.PendingTransaction_signMultisigTx(pendingTransactionPtr);
}
-
+
@override
String signersKeys(String separator) {
- return monero.PendingTransaction_signersKeys(pendingTransactionPtr, separator);
+ return monero.PendingTransaction_signersKeys(
+ pendingTransactionPtr, separator);
}
-
+
@override
int status() {
return monero.PendingTransaction_status(pendingTransactionPtr);
}
-
+
@override
String subaddrAccount(String separator) {
- return monero.PendingTransaction_subaddrAccount(pendingTransactionPtr, separator);
+ return monero.PendingTransaction_subaddrAccount(
+ pendingTransactionPtr, separator);
}
-
+
@override
String subaddrIndices(String separator) {
- return monero.PendingTransaction_subaddrIndices(pendingTransactionPtr, separator);
+ return monero.PendingTransaction_subaddrIndices(
+ pendingTransactionPtr, separator);
}
-
+
@override
int txCount() {
return monero.PendingTransaction_txCount(pendingTransactionPtr);
}
-
+
@override
String txid(String separator) {
return monero.PendingTransaction_txid(pendingTransactionPtr, separator);
@@ -479,31 +505,37 @@ class MoneroSubaddress implements Wallet2Subaddress {
MoneroSubaddress(this.subaddressPtr);
final monero.Subaddress subaddressPtr;
-
+
@override
void addRow({required int accountIndex, required String label}) {
- monero.Subaddress_addRow(subaddressPtr, accountIndex: accountIndex, label: label);
+ monero.Subaddress_addRow(subaddressPtr,
+ accountIndex: accountIndex, label: label);
}
-
+
@override
Wallet2SubaddressRow getAll_byIndex(int index) {
final row = monero.Subaddress_getAll_byIndex(subaddressPtr, index: index);
return MoneroSubaddressRow(row);
}
-
+
@override
int getAll_size() {
return monero.Subaddress_getAll_size(subaddressPtr);
}
-
+
@override
void refresh({required int accountIndex, required String label}) {
- monero.Subaddress_refresh(subaddressPtr, accountIndex: accountIndex, label: label);
+ monero.Subaddress_refresh(subaddressPtr,
+ accountIndex: accountIndex, label: label);
}
-
+
@override
- void setLabel({required int accountIndex, required int addressIndex, required String label}) {
- monero.Subaddress_setLabel(subaddressPtr, accountIndex: accountIndex, addressIndex: addressIndex, label: label);
+ void setLabel(
+ {required int accountIndex,
+ required int addressIndex,
+ required String label}) {
+ monero.Subaddress_setLabel(subaddressPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex, label: label);
}
@override
@@ -514,31 +546,33 @@ class MoneroSubaddressAccount implements Wallet2SubaddressAccount {
MoneroSubaddressAccount(this.subaddressAccountPtr);
final monero.SubaddressAccount subaddressAccountPtr;
-
+
@override
void addRow({required String label}) {
monero.SubaddressAccount_addRow(subaddressAccountPtr, label: label);
}
-
+
@override
Wallet2SubaddressAccountRow getAll_byIndex(int index) {
- final row = monero.SubaddressAccount_getAll_byIndex(subaddressAccountPtr, index: index);
+ final row = monero.SubaddressAccount_getAll_byIndex(subaddressAccountPtr,
+ index: index);
return MoneroSubaddressAccountRow(row);
}
-
+
@override
int getAll_size() {
return monero.SubaddressAccount_getAll_size(subaddressAccountPtr);
}
-
+
@override
void refresh() {
monero.SubaddressAccount_refresh(subaddressAccountPtr);
}
-
+
@override
void setLabel({required int accountIndex, required String label}) {
- monero.SubaddressAccount_setLabel(subaddressAccountPtr, accountIndex: accountIndex, label: label);
+ monero.SubaddressAccount_setLabel(subaddressAccountPtr,
+ accountIndex: accountIndex, label: label);
}
@override
@@ -549,35 +583,36 @@ class MoneroSubaddressAccountRow implements Wallet2SubaddressAccountRow {
MoneroSubaddressAccountRow(this.subaddressAccountRowPtr);
final monero.SubaddressAccountRow subaddressAccountRowPtr;
-
+
@override
String extra() {
return monero.SubaddressAccountRow_extra(subaddressAccountRowPtr);
}
-
+
@override
String getAddress() {
return monero.SubaddressAccountRow_getAddress(subaddressAccountRowPtr);
}
-
+
@override
String getBalance() {
return monero.SubaddressAccountRow_getBalance(subaddressAccountRowPtr);
}
-
+
@override
String getLabel() {
return monero.SubaddressAccountRow_getLabel(subaddressAccountRowPtr);
}
-
+
@override
int getRowId() {
return monero.SubaddressAccountRow_getRowId(subaddressAccountRowPtr);
}
-
+
@override
String getUnlockedBalance() {
- return monero.SubaddressAccountRow_getUnlockedBalance(subaddressAccountRowPtr);
+ return monero.SubaddressAccountRow_getUnlockedBalance(
+ subaddressAccountRowPtr);
}
@override
@@ -588,22 +623,22 @@ class MoneroSubaddressRow implements Wallet2SubaddressRow {
MoneroSubaddressRow(this.subaddressRowPtr);
final monero.SubaddressRow subaddressRowPtr;
-
+
@override
String extra() {
return monero.SubaddressRow_extra(subaddressRowPtr);
}
-
+
@override
String getAddress() {
return monero.SubaddressRow_getAddress(subaddressRowPtr);
}
-
+
@override
String getLabel() {
return monero.SubaddressRow_getLabel(subaddressRowPtr);
}
-
+
@override
int getRowId() {
return monero.SubaddressRow_getRowId(subaddressRowPtr);
@@ -617,31 +652,34 @@ class MoneroTransactionHistory implements Wallet2TransactionHistory {
MoneroTransactionHistory(this.transactionHistoryPtr);
final monero.TransactionHistory transactionHistoryPtr;
-
+
@override
int count() {
return monero.TransactionHistory_count(transactionHistoryPtr);
}
-
+
@override
void refresh() {
monero.TransactionHistory_refresh(transactionHistoryPtr);
}
-
+
@override
void setTxNote({required String txid, required String note}) {
- monero.TransactionHistory_setTxNote(transactionHistoryPtr, txid: txid, note: note);
+ monero.TransactionHistory_setTxNote(transactionHistoryPtr,
+ txid: txid, note: note);
}
-
+
@override
Wallet2TransactionInfo transaction(int index) {
- final tx = monero.TransactionHistory_transaction(transactionHistoryPtr, index: index);
+ final tx = monero.TransactionHistory_transaction(transactionHistoryPtr,
+ index: index);
return MoneroTransactionInfo(tx);
}
-
+
@override
Wallet2TransactionInfo transactionById(String txid) {
- final tx = monero.TransactionHistory_transactionById(transactionHistoryPtr, txid: txid);
+ final tx = monero.TransactionHistory_transactionById(transactionHistoryPtr,
+ txid: txid);
return MoneroTransactionInfo(tx);
}
@@ -653,102 +691,102 @@ class MoneroTransactionInfo implements Wallet2TransactionInfo {
MoneroTransactionInfo(this.transactionInfoPtr);
final monero.TransactionInfo transactionInfoPtr;
-
+
@override
int amount() {
return monero.TransactionInfo_amount(transactionInfoPtr);
}
-
+
@override
int blockHeight() {
return monero.TransactionInfo_blockHeight(transactionInfoPtr);
}
-
+
@override
int confirmations() {
return monero.TransactionInfo_confirmations(transactionInfoPtr);
}
-
+
@override
String description() {
return monero.TransactionInfo_description(transactionInfoPtr);
}
-
+
@override
int direction() {
return monero.TransactionInfo_direction(transactionInfoPtr).index;
}
-
+
@override
int fee() {
return monero.TransactionInfo_fee(transactionInfoPtr);
}
-
+
@override
String hash() {
return monero.TransactionInfo_hash(transactionInfoPtr);
}
-
+
@override
bool isCoinbase() {
return monero.TransactionInfo_isCoinbase(transactionInfoPtr);
}
-
+
@override
bool isFailed() {
return monero.TransactionInfo_isFailed(transactionInfoPtr);
}
-
+
@override
bool isPending() {
return monero.TransactionInfo_isPending(transactionInfoPtr);
}
-
+
@override
String label() {
return monero.TransactionInfo_label(transactionInfoPtr);
}
-
+
@override
String paymentId() {
return monero.TransactionInfo_paymentId(transactionInfoPtr);
}
-
+
@override
int subaddrAccount() {
return monero.TransactionInfo_subaddrAccount(transactionInfoPtr);
}
-
+
@override
String subaddrIndex() {
return monero.TransactionInfo_subaddrIndex(transactionInfoPtr);
}
-
+
@override
int timestamp() {
return monero.TransactionInfo_timestamp(transactionInfoPtr);
}
-
+
@override
String transfers_address(int index) {
return monero.TransactionInfo_transfers_address(transactionInfoPtr, index);
}
-
+
@override
int transfers_amount(int index) {
return monero.TransactionInfo_transfers_amount(transactionInfoPtr, index);
}
-
+
@override
int transfers_count() {
return monero.TransactionInfo_transfers_count(transactionInfoPtr);
}
-
+
@override
int unlockTime() {
return monero.TransactionInfo_unlockTime(transactionInfoPtr);
}
-
+
@override
int ffiAddress() => transactionInfoPtr.address;
}
@@ -757,67 +795,70 @@ class MoneroUnsignedTransaction implements Wallet2UnsignedTransaction {
MoneroUnsignedTransaction(this.unsignedTransactionPtr);
final monero.UnsignedTransaction unsignedTransactionPtr;
-
+
@override
String amount() {
return monero.UnsignedTransaction_amount(unsignedTransactionPtr);
}
-
+
@override
String confirmationMessage() {
- return monero.UnsignedTransaction_confirmationMessage(unsignedTransactionPtr);
+ return monero.UnsignedTransaction_confirmationMessage(
+ unsignedTransactionPtr);
}
-
+
@override
String errorString() {
return monero.UnsignedTransaction_errorString(unsignedTransactionPtr);
}
-
+
@override
String fee() {
return monero.UnsignedTransaction_fee(unsignedTransactionPtr);
}
-
+
@override
int minMixinCount() {
return monero.UnsignedTransaction_minMixinCount(unsignedTransactionPtr);
}
-
+
@override
String mixin() {
return monero.UnsignedTransaction_mixin(unsignedTransactionPtr);
}
-
+
@override
String paymentId() {
return monero.UnsignedTransaction_paymentId(unsignedTransactionPtr);
}
-
+
@override
String recipientAddress() {
return monero.UnsignedTransaction_recipientAddress(unsignedTransactionPtr);
}
-
+
@override
bool sign(String signedFileName) {
- return monero.UnsignedTransaction_sign(unsignedTransactionPtr, signedFileName);
+ return monero.UnsignedTransaction_sign(
+ unsignedTransactionPtr, signedFileName);
}
-
+
@override
String signUR(int max_fragment_length) {
- return monero.UnsignedTransaction_signUR(unsignedTransactionPtr, max_fragment_length);
+ return monero.UnsignedTransaction_signUR(
+ unsignedTransactionPtr, max_fragment_length);
}
-
+
@override
int status() {
return monero.UnsignedTransaction_status(unsignedTransactionPtr);
}
-
+
@override
int txCount() {
return monero.UnsignedTransaction_txCount(unsignedTransactionPtr);
}
-
+
@override
int ffiAddress() => unsignedTransactionPtr.address;
}
@@ -826,227 +867,273 @@ class MoneroWallet implements Wallet2Wallet {
MoneroWallet(this.walletPtr);
final monero.wallet walletPtr;
-
+
@override
void addSubaddress({required int accountIndex, String label = ""}) {
- monero.Wallet_addSubaddress(walletPtr, accountIndex: accountIndex, label: label);
+ monero.Wallet_addSubaddress(walletPtr,
+ accountIndex: accountIndex, label: label);
}
-
+
@override
void addSubaddressAccount({String label = ""}) {
monero.Wallet_addSubaddressAccount(walletPtr, label: label);
}
-
+
@override
String address({int accountIndex = 0, int addressIndex = 0}) {
- return monero.Wallet_address(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex);
+ return monero.Wallet_address(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex);
}
-
+
@override
Wallet2AddressBook addressBook() {
return MoneroAddressBook(monero.Wallet_addressBook(walletPtr));
}
-
+
@override
bool addressValid(String address, int networkType) {
return monero.Wallet_addressValid(address, networkType);
}
-
+
@override
int amountFromDouble(double amount) {
return monero.Wallet_amountFromDouble(amount);
}
-
+
@override
int amountFromString(String amount) {
return monero.Wallet_amountFromString(amount);
}
-
+
@override
int approximateBlockChainHeight() {
return monero.Wallet_approximateBlockChainHeight(walletPtr);
}
-
+
@override
int autoRefreshInterval() {
return monero.Wallet_autoRefreshInterval(walletPtr);
}
-
+
@override
int balance({required int accountIndex}) {
return monero.Wallet_balance(walletPtr, accountIndex: accountIndex);
}
-
+
@override
int blockChainHeight() {
return monero.Wallet_blockChainHeight(walletPtr);
}
-
+
@override
Wallet2Coins coins() {
return MoneroCoins(monero.Wallet_coins(walletPtr));
}
-
+
@override
int coldKeyImageSync({required int spent, required int unspent}) {
- return monero.Wallet_coldKeyImageSync(walletPtr, spent: spent, unspent: unspent);
+ return monero.Wallet_coldKeyImageSync(walletPtr,
+ spent: spent, unspent: unspent);
}
-
+
@override
bool connectToDaemon() {
return monero.Wallet_connectToDaemon(walletPtr);
}
-
+
@override
int connected() {
return monero.Wallet_connected(walletPtr);
}
-
+
@override
String createPolyseed({String language = "English"}) {
return monero.Wallet_createPolyseed(language: language);
}
-
+
@override
- Wallet2PendingTransaction createTransaction({required String dst_addr, required String payment_id, required int amount, required int mixin_count, required int pendingTransactionPriority, required int subaddr_account, List<String> preferredInputs = const []}) {
- final transaction = monero.Wallet_createTransaction(walletPtr, dst_addr: dst_addr, payment_id: payment_id, amount: amount, mixin_count: mixin_count, pendingTransactionPriority: pendingTransactionPriority, subaddr_account: subaddr_account, preferredInputs: preferredInputs);
+ Wallet2PendingTransaction createTransaction(
+ {required String dst_addr,
+ required String payment_id,
+ required int amount,
+ required int mixin_count,
+ required int pendingTransactionPriority,
+ required int subaddr_account,
+ List<String> preferredInputs = const []}) {
+ final transaction = monero.Wallet_createTransaction(walletPtr,
+ dst_addr: dst_addr,
+ payment_id: payment_id,
+ amount: amount,
+ mixin_count: mixin_count,
+ pendingTransactionPriority: pendingTransactionPriority,
+ subaddr_account: subaddr_account,
+ preferredInputs: preferredInputs);
return MoneroPendingTransaction(transaction);
}
-
+
@override
- Wallet2PendingTransaction createTransactionMultDest({required List<String> dstAddr, String paymentId = "", required bool isSweepAll, required List<int> amounts, required int mixinCount, required int pendingTransactionPriority, required int subaddr_account, List<String> preferredInputs = const []}) {
- final transaction = monero.Wallet_createTransactionMultDest(walletPtr, dstAddr: dstAddr, paymentId: paymentId, isSweepAll: isSweepAll, amounts: amounts, mixinCount: mixinCount, pendingTransactionPriority: pendingTransactionPriority, subaddr_account: subaddr_account, preferredInputs: preferredInputs);
+ Wallet2PendingTransaction createTransactionMultDest(
+ {required List<String> dstAddr,
+ String paymentId = "",
+ required bool isSweepAll,
+ required List<int> amounts,
+ required int mixinCount,
+ required int pendingTransactionPriority,
+ required int subaddr_account,
+ List<String> preferredInputs = const []}) {
+ final transaction = monero.Wallet_createTransactionMultDest(walletPtr,
+ dstAddr: dstAddr,
+ paymentId: paymentId,
+ isSweepAll: isSweepAll,
+ amounts: amounts,
+ mixinCount: mixinCount,
+ pendingTransactionPriority: pendingTransactionPriority,
+ subaddr_account: subaddr_account,
+ preferredInputs: preferredInputs);
return MoneroPendingTransaction(transaction);
}
-
+
@override
- bool createWatchOnly({required String path, required String password, required String language}) {
- return monero.Wallet_createWatchOnly(walletPtr, path: path, password: password, language: language);
+ bool createWatchOnly(
+ {required String path,
+ required String password,
+ required String language}) {
+ return monero.Wallet_createWatchOnly(walletPtr,
+ path: path, password: password, language: language);
}
-
+
@override
int daemonBlockChainHeight() {
return monero.Wallet_daemonBlockChainHeight(walletPtr);
}
-
+
@override
int defaultMixin() {
return monero.Wallet_defaultMixin(walletPtr);
}
-
+
@override
- String deviceShowAddress({required int accountIndex, required int addressIndex}) {
- return monero.Wallet_deviceShowAddress(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex);
+ String deviceShowAddress(
+ {required int accountIndex, required int addressIndex}) {
+ return monero.Wallet_deviceShowAddress(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex);
}
-
+
@override
String displayAmount(int amount) {
return monero.Wallet_displayAmount(amount);
}
-
+
@override
String errorString() {
return monero.Wallet_errorString(walletPtr);
}
-
+
@override
int estimateBlockChainHeight() {
return monero.Wallet_estimateBlockChainHeight(walletPtr);
}
-
+
@override
- String exchangeMultisigKeys({required List<String> info, required bool force_update_use_with_caution}) {
- return monero.Wallet_exchangeMultisigKeys(walletPtr, info: info, force_update_use_with_caution: force_update_use_with_caution);
+ String exchangeMultisigKeys(
+ {required List<String> info,
+ required bool force_update_use_with_caution}) {
+ return monero.Wallet_exchangeMultisigKeys(walletPtr,
+ info: info,
+ force_update_use_with_caution: force_update_use_with_caution);
}
-
+
@override
bool exportKeyImages(String filename, {required bool all}) {
return monero.Wallet_exportKeyImages(walletPtr, filename, all: all);
}
-
+
@override
String exportKeyImagesUR({int max_fragment_length = 130, bool all = false}) {
- return monero.Wallet_exportKeyImagesUR(walletPtr, max_fragment_length: max_fragment_length, all: all);
+ return monero.Wallet_exportKeyImagesUR(walletPtr,
+ max_fragment_length: max_fragment_length, all: all);
}
-
+
@override
List<String> exportMultisigImages({required List<String> info}) {
- return monero.Wallet_exportMultisigImages(walletPtr, info: info, force_update_use_with_caution: false);
+ return monero.Wallet_exportMultisigImages(walletPtr,
+ info: info, force_update_use_with_caution: false);
}
-
+
@override
bool exportOutputs(String filename, {required bool all}) {
return monero.Wallet_exportOutputs(walletPtr, filename, all: all);
}
-
+
@override
String exportOutputsUR({int max_fragment_length = 130, bool all = false}) {
- return monero.Wallet_exportOutputsUR(walletPtr, max_fragment_length: max_fragment_length, all: all);
+ return monero.Wallet_exportOutputsUR(walletPtr,
+ max_fragment_length: max_fragment_length, all: all);
}
-
+
@override
String filename() {
return monero.Wallet_filename(walletPtr);
}
-
+
@override
String genPaymentId() {
return monero.Wallet_genPaymentId();
}
-
+
@override
int getBackgroundSyncType() {
return monero.Wallet_getBackgroundSyncType(walletPtr);
}
-
+
@override
int getBytesReceived() {
return monero.Wallet_getBytesReceived(walletPtr);
}
-
+
@override
int getBytesSent() {
throw UnimplementedError();
}
-
+
@override
String getCacheAttribute({required String key}) {
return monero.Wallet_getCacheAttribute(walletPtr, key: key);
}
-
+
@override
int getDeviceType() {
return monero.Wallet_getDeviceType(walletPtr);
}
-
+
@override
String getMultisigInfo() {
return monero.Wallet_getMultisigInfo(walletPtr);
}
-
+
@override
String getPassword() {
return monero.Wallet_getPassword(walletPtr);
}
-
+
@override
String getPolyseed({required String passphrase}) {
return monero.Wallet_getPolyseed(walletPtr, passphrase: passphrase);
}
-
+
static Pointer<UnsignedChar> getReceivedFromDevice() {
return monero.Wallet_getReceivedFromDevice();
}
-
+
static int getReceivedFromDeviceLength() {
return monero.Wallet_getReceivedFromDeviceLength();
}
-
+
@override
int getRefreshFromBlockHeight() {
return monero.Wallet_getRefreshFromBlockHeight(walletPtr);
}
-
+
@override
String getSeedLanguage() {
return monero.Wallet_getSeedLanguage(walletPtr);
@@ -1055,464 +1142,530 @@ class MoneroWallet implements Wallet2Wallet {
static Pointer<UnsignedChar> getSendToDevice() {
return monero.Wallet_getSendToDevice();
}
-
+
static int getSendToDeviceLength() {
return monero.Wallet_getSendToDeviceLength();
}
-
+
static bool getStateIsConnected() {
return monero.Wallet_getStateIsConnected();
}
-
+
@override
- String getSubaddressLabel({required int accountIndex, required int addressIndex}) {
- return monero.Wallet_getSubaddressLabel(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex);
+ String getSubaddressLabel(
+ {required int accountIndex, required int addressIndex}) {
+ return monero.Wallet_getSubaddressLabel(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex);
}
-
+
@override
String getTxKey({required String txid}) {
return monero.Wallet_getTxKey(walletPtr, txid: txid);
}
-
+
@override
String getUserNote({required String txid}) {
return monero.Wallet_getUserNote(walletPtr, txid: txid);
}
-
+
static bool getWaitsForDeviceReceive() {
return monero.Wallet_getWaitsForDeviceReceive();
}
-
+
static bool getWaitsForDeviceSend() {
return monero.Wallet_getWaitsForDeviceSend();
}
-
+
@override
Wallet2WalletListener getWalletListener() {
final listener = monero.MONERO_cw_getWalletListener(walletPtr);
return MoneroWalletListener(listener);
}
-
+
@override
int hasMultisigPartialKeyImages() {
return monero.Wallet_hasMultisigPartialKeyImages(walletPtr);
}
-
+
@override
bool hasUnknownKeyImages() {
return monero.Wallet_hasUnknownKeyImages(walletPtr);
}
-
+
@override
Wallet2TransactionHistory history() {
return MoneroTransactionHistory(monero.Wallet_history(walletPtr));
}
-
+
@override
bool importKeyImages(String filename) {
return monero.Wallet_importKeyImages(walletPtr, filename);
}
-
+
@override
bool importKeyImagesUR(String input) {
return monero.Wallet_importKeyImagesUR(walletPtr, input);
}
-
+
@override
int importMultisigImages({required List<String> info}) {
return monero.Wallet_importMultisigImages(walletPtr, info: info);
}
-
+
@override
bool importOutputs(String filename) {
return monero.Wallet_importOutputs(walletPtr, filename);
}
-
+
@override
bool importOutputsUR(String input) {
return monero.Wallet_importOutputsUR(walletPtr, input);
}
-
+
@override
- bool init({required String daemonAddress, int upperTransacationSizeLimit = 0, String daemonUsername = "", String daemonPassword = "", bool useSsl = false, bool lightWallet = false, String proxyAddress = ""}) {
- return monero.Wallet_init(walletPtr, daemonAddress: daemonAddress, upperTransacationSizeLimit: upperTransacationSizeLimit, daemonUsername: daemonUsername, daemonPassword: daemonPassword, useSsl: useSsl, lightWallet: lightWallet, proxyAddress: proxyAddress);
+ bool init(
+ {required String daemonAddress,
+ int upperTransacationSizeLimit = 0,
+ String daemonUsername = "",
+ String daemonPassword = "",
+ bool useSsl = false,
+ bool lightWallet = false,
+ String proxyAddress = ""}) {
+ return monero.Wallet_init(walletPtr,
+ daemonAddress: daemonAddress,
+ upperTransacationSizeLimit: upperTransacationSizeLimit,
+ daemonUsername: daemonUsername,
+ daemonPassword: daemonPassword,
+ useSsl: useSsl,
+ lightWallet: lightWallet,
+ proxyAddress: proxyAddress);
}
-
+
@override
- void init3({required String argv0, required String defaultLogBaseName, required String logPath, required bool console}) {
- return monero.Wallet_init3(walletPtr, argv0: argv0, defaultLogBaseName: defaultLogBaseName, logPath: logPath, console: console);
+ void init3(
+ {required String argv0,
+ required String defaultLogBaseName,
+ required String logPath,
+ required bool console}) {
+ return monero.Wallet_init3(walletPtr,
+ argv0: argv0,
+ defaultLogBaseName: defaultLogBaseName,
+ logPath: logPath,
+ console: console);
}
-
+
@override
String integratedAddress({required String paymentId}) {
return monero.Wallet_integratedAddress(walletPtr, paymentId: paymentId);
}
-
+
@override
bool isBackgroundSyncing() {
return monero.Wallet_isBackgroundSyncing(walletPtr);
}
-
+
@override
bool isBackgroundWallet() {
return monero.Wallet_isBackgroundWallet(walletPtr);
}
-
+
@override
bool isKeysFileLocked() {
return monero.Wallet_isKeysFileLocked(walletPtr);
}
-
+
@override
bool isOffline() {
return monero.Wallet_isOffline(walletPtr);
}
-
+
@override
void keyReuseMitigation2({required bool mitigation}) {
monero.Wallet_keyReuseMitigation2(walletPtr, mitigation: mitigation);
}
-
+
@override
- bool keyValid({required String secret_key_string, required String address_string, required bool isViewKey, required int nettype}) {
- return monero.Wallet_keyValid(secret_key_string: secret_key_string, address_string: address_string, isViewKey: isViewKey, nettype: nettype);
+ bool keyValid(
+ {required String secret_key_string,
+ required String address_string,
+ required bool isViewKey,
+ required int nettype}) {
+ return monero.Wallet_keyValid(
+ secret_key_string: secret_key_string,
+ address_string: address_string,
+ isViewKey: isViewKey,
+ nettype: nettype);
}
-
+
@override
- String keyValid_error({required String secret_key_string, required String address_string, required bool isViewKey, required int nettype}) {
- return monero.Wallet_keyValid_error(secret_key_string: secret_key_string, address_string: address_string, isViewKey: isViewKey, nettype: nettype);
+ String keyValid_error(
+ {required String secret_key_string,
+ required String address_string,
+ required bool isViewKey,
+ required int nettype}) {
+ return monero.Wallet_keyValid_error(
+ secret_key_string: secret_key_string,
+ address_string: address_string,
+ isViewKey: isViewKey,
+ nettype: nettype);
}
-
+
@override
String keysFilename() {
return monero.Wallet_keysFilename(walletPtr);
}
-
+
@override
- Wallet2UnsignedTransaction loadUnsignedTx({required String unsigned_filename}) {
- final tx = monero.Wallet_loadUnsignedTx(walletPtr, unsigned_filename: unsigned_filename);
+ Wallet2UnsignedTransaction loadUnsignedTx(
+ {required String unsigned_filename}) {
+ final tx = monero.Wallet_loadUnsignedTx(walletPtr,
+ unsigned_filename: unsigned_filename);
return MoneroUnsignedTransaction(tx);
}
-
+
@override
Wallet2UnsignedTransaction loadUnsignedTxUR({required String input}) {
final tx = monero.Wallet_loadUnsignedTxUR(walletPtr, input: input);
return MoneroUnsignedTransaction(tx);
}
-
+
@override
bool lockKeysFile() {
return monero.Wallet_lockKeysFile(walletPtr);
}
-
+
@override
String makeMultisig({required List<String> info, required int threshold}) {
- return monero.Wallet_makeMultisig(walletPtr, info: info, threshold: threshold);
+ return monero.Wallet_makeMultisig(walletPtr,
+ info: info, threshold: threshold);
}
-
+
@override
int maximumAllowedAmount() {
return monero.Wallet_maximumAllowedAmount();
}
-
+
@override
Wallet2MultisigState multisig() {
return MoneroMultisigState(monero.Wallet_multisig(walletPtr));
}
-
+
@override
int nettype() {
return monero.Wallet_nettype(walletPtr);
}
-
+
@override
int numSubaddressAccounts() {
return monero.Wallet_numSubaddressAccounts(walletPtr);
}
-
+
@override
int numSubaddresses({required int accountIndex}) {
return monero.Wallet_numSubaddresses(walletPtr, accountIndex: accountIndex);
}
-
+
@override
String path() {
return monero.Wallet_path(walletPtr);
}
-
+
@override
void pauseRefresh() {
monero.Wallet_pauseRefresh(walletPtr);
}
-
+
@override
String paymentIdFromAddress({required String strarg, required int nettype}) {
return monero.Wallet_paymentIdFromAddress(nettype: nettype, strarg: strarg);
}
-
+
@override
bool paymentIdValid(String paymentId) {
return monero.Wallet_paymentIdValid(paymentId);
}
-
+
@override
String publicMultisigSignerKey() {
return monero.Wallet_publicMultisigSignerKey(walletPtr);
}
-
+
@override
String publicSpendKey() {
return monero.Wallet_publicSpendKey(walletPtr);
}
-
+
@override
String publicViewKey() {
return monero.Wallet_publicViewKey(walletPtr);
}
-
+
@override
bool reconnectDevice() {
return monero.Wallet_reconnectDevice(walletPtr);
}
-
+
@override
bool refresh() {
return monero.Wallet_refresh(walletPtr);
}
-
+
@override
void refreshAsync() {
monero.Wallet_refreshAsync(walletPtr);
}
-
+
@override
bool rescanBlockchain() {
return monero.Wallet_rescanBlockchain(walletPtr);
}
-
+
@override
void rescanBlockchainAsync() {
monero.Wallet_rescanBlockchainAsync(walletPtr);
}
-
+
@override
bool rescanSpent() {
return monero.Wallet_rescanSpent(walletPtr);
}
-
+
@override
- Wallet2PendingTransaction restoreMultisigTransaction({required String signData}) {
- final tx = monero.Wallet_restoreMultisigTransaction(walletPtr, signData: signData);
+ Wallet2PendingTransaction restoreMultisigTransaction(
+ {required String signData}) {
+ final tx =
+ monero.Wallet_restoreMultisigTransaction(walletPtr, signData: signData);
return MoneroPendingTransaction(tx);
}
-
+
@override
String secretSpendKey() {
return monero.Wallet_secretSpendKey(walletPtr);
}
-
+
@override
String secretViewKey() {
return monero.Wallet_secretViewKey(walletPtr);
}
-
+
@override
String seed({required String seedOffset}) {
return monero.Wallet_seed(walletPtr, seedOffset: seedOffset);
}
-
+
@override
void segregatePreForkOutputs({required bool segregate}) {
monero.Wallet_segregatePreForkOutputs(walletPtr, segregate: segregate);
}
-
+
@override
void segregationHeight({required int height}) {
monero.Wallet_segregationHeight(walletPtr, height: height);
}
-
+
@override
void setAutoRefreshInterval({required int millis}) {
monero.Wallet_setAutoRefreshInterval(walletPtr, millis: millis);
}
-
+
@override
bool setCacheAttribute({required String key, required String value}) {
return monero.Wallet_setCacheAttribute(walletPtr, key: key, value: value);
}
-
+
@override
void setDefaultMixin(int arg) {
monero.Wallet_setDefaultMixin(walletPtr, arg);
}
-
+
@override
bool setDevicePin({required String passphrase}) {
return monero.Wallet_setDevicePin(walletPtr, passphrase: passphrase);
}
-
+
static void setDeviceReceivedData(Pointer<UnsignedChar> data, int len) {
monero.Wallet_setDeviceReceivedData(data, len);
}
-
+
static void setDeviceSendData(Pointer<UnsignedChar> data, int len) {
monero.Wallet_setDeviceSendData(data, len);
}
- static void setLedgerCallback(Pointer<NativeFunction<Void Function(Pointer<UnsignedChar>, UnsignedInt)>> callback) {
+ static void setLedgerCallback(
+ Pointer<NativeFunction<Void Function(Pointer<UnsignedChar>, UnsignedInt)>>
+ callback) {
monero.Wallet_setLedgerCallback(callback);
}
-
+
@override
void setOffline({required bool offline}) {
monero.Wallet_setOffline(walletPtr, offline: offline);
}
-
+
@override
bool setPassword({required String password}) {
return monero.Wallet_setPassword(walletPtr, password: password);
}
-
+
@override
void setProxy({required String address}) {
monero.Wallet_setProxy(walletPtr, address: address);
}
-
+
@override
void setRecoveringFromDevice({required bool recoveringFromDevice}) {
- monero.Wallet_setRecoveringFromDevice(walletPtr, recoveringFromDevice: recoveringFromDevice);
+ monero.Wallet_setRecoveringFromDevice(walletPtr,
+ recoveringFromDevice: recoveringFromDevice);
}
-
+
@override
void setRecoveringFromSeed({required bool recoveringFromSeed}) {
- monero.Wallet_setRecoveringFromSeed(walletPtr, recoveringFromSeed: recoveringFromSeed);
+ monero.Wallet_setRecoveringFromSeed(walletPtr,
+ recoveringFromSeed: recoveringFromSeed);
}
-
+
@override
void setRefreshFromBlockHeight({required int refresh_from_block_height}) {
- monero.Wallet_setRefreshFromBlockHeight(walletPtr, refresh_from_block_height: refresh_from_block_height);
+ monero.Wallet_setRefreshFromBlockHeight(walletPtr,
+ refresh_from_block_height: refresh_from_block_height);
}
-
+
@override
void setSeedLanguage({required String language}) {
monero.Wallet_setSeedLanguage(walletPtr, language: language);
}
-
+
@override
- void setSubaddressLabel({required int accountIndex, required int addressIndex, required String label}) {
- monero.Wallet_setSubaddressLabel(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex, label: label);
+ void setSubaddressLabel(
+ {required int accountIndex,
+ required int addressIndex,
+ required String label}) {
+ monero.Wallet_setSubaddressLabel(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex, label: label);
}
-
+
@override
void setSubaddressLookahead({required int major, required int minor}) {
monero.Wallet_setSubaddressLookahead(walletPtr, major: major, minor: minor);
}
-
+
@override
void setTrustedDaemon({required bool arg}) {
monero.Wallet_setTrustedDaemon(walletPtr, arg: arg);
}
-
+
@override
bool setUserNote({required String txid, required String note}) {
return monero.Wallet_setUserNote(walletPtr, txid: txid, note: note);
}
-
+
@override
- bool setupBackgroundSync({required int backgroundSyncType, required String walletPassword, required String backgroundCachePassword}) {
- return monero.Wallet_setupBackgroundSync(walletPtr, backgroundSyncType: backgroundSyncType, walletPassword: walletPassword, backgroundCachePassword: backgroundCachePassword);
+ bool setupBackgroundSync(
+ {required int backgroundSyncType,
+ required String walletPassword,
+ required String backgroundCachePassword}) {
+ return monero.Wallet_setupBackgroundSync(walletPtr,
+ backgroundSyncType: backgroundSyncType,
+ walletPassword: walletPassword,
+ backgroundCachePassword: backgroundCachePassword);
}
-
+
@override
String signMessage({required String message, required String address}) {
- return monero.Wallet_signMessage(walletPtr, message: message, address: address);
+ return monero.Wallet_signMessage(walletPtr,
+ message: message, address: address);
}
-
+
@override
bool startBackgroundSync() {
return monero.Wallet_startBackgroundSync(walletPtr);
}
-
+
@override
void startRefresh() {
monero.Wallet_startRefresh(walletPtr);
}
-
+
@override
int status() {
return monero.Wallet_status(walletPtr);
}
-
+
@override
void stop() {
monero.Wallet_stop(walletPtr);
}
-
+
@override
bool stopBackgroundSync(String walletPassword) {
return monero.Wallet_stopBackgroundSync(walletPtr, walletPassword);
}
-
+
@override
bool store({String path = ""}) {
return monero.Wallet_store(walletPtr, path: path);
}
-
+
@override
Wallet2Subaddress subaddress() {
return MoneroSubaddress(monero.Wallet_subaddress(walletPtr));
}
-
+
@override
Wallet2SubaddressAccount subaddressAccount() {
return MoneroSubaddressAccount(monero.Wallet_subaddressAccount(walletPtr));
}
-
+
@override
bool submitTransaction(String filename) {
return monero.Wallet_submitTransaction(walletPtr, filename);
}
-
+
@override
bool submitTransactionUR(String input) {
return monero.Wallet_submitTransactionUR(walletPtr, input);
}
-
+
@override
bool synchronized() {
return monero.Wallet_synchronized(walletPtr);
}
-
+
@override
bool trustedDaemon() {
return monero.Wallet_trustedDaemon(walletPtr);
}
-
+
@override
bool unlockKeysFile() {
return monero.Wallet_unlockKeysFile(walletPtr);
}
-
+
@override
int unlockedBalance({required int accountIndex}) {
return monero.Wallet_unlockedBalance(walletPtr, accountIndex: accountIndex);
}
-
+
@override
int useForkRules({required int version, required int earlyBlocks}) {
- return monero.Wallet_useForkRules(walletPtr, version: version, earlyBlocks: earlyBlocks);
+ return monero.Wallet_useForkRules(walletPtr,
+ version: version, earlyBlocks: earlyBlocks);
}
-
+
@override
- bool verifySignedMessage({required String message, required String address, required String signature}) {
- return monero.Wallet_verifySignedMessage(walletPtr, message: message, address: address, signature: signature);
+ bool verifySignedMessage(
+ {required String message,
+ required String address,
+ required String signature}) {
+ return monero.Wallet_verifySignedMessage(walletPtr,
+ message: message, address: address, signature: signature);
}
-
+
@override
int viewOnlyBalance({required int accountIndex}) {
return monero.Wallet_viewOnlyBalance(walletPtr, accountIndex: accountIndex);
}
-
+
@override
bool watchOnly() {
return monero.Wallet_watchOnly(walletPtr);
@@ -1523,7 +1676,7 @@ class MoneroWallet implements Wallet2Wallet {
final l = parseTrezorTdis(res);
return l;
}
-
+
@override
int ffiAddress() => walletPtr.address;
}
@@ -1548,8 +1701,8 @@ class TrezorTdi {
factory TrezorTdi.fromJson(Map<String, dynamic> j) => TrezorTdi(
outKey: j['out_key'] as String,
txPubKey: j['tx_pub_key'] as String,
- additionalTxPubKeys: (j['additional_tx_pub_keys'] as List?)
- ?.cast<String>(),
+ additionalTxPubKeys:
+ (j['additional_tx_pub_keys'] as List?)?.cast<String>(),
internalOutputIndex: (j['internal_output_index'] as num).toInt(),
subAddrMajor: (j['sub_addr_major'] as num).toInt(),
subAddrMinor: (j['sub_addr_minor'] as num).toInt(),
@@ -1567,124 +1720,233 @@ class MoneroWalletManager implements Wallet2WalletManager {
MoneroWalletManager(this.wmPtr);
final monero.WalletManager wmPtr;
-
+
@override
Future<int> blockTarget() async {
return monero.WalletManager_blockTarget(wmPtr);
}
-
+
@override
Future<int> blockchainHeight() async {
return monero.WalletManager_blockchainHeight(wmPtr);
}
-
+
@override
Future<int> blockchainTargetHeight() async {
return monero.WalletManager_blockchainTargetHeight(wmPtr);
}
-
+
@override
- Wallet2Wallet createDeterministicWalletFromSpendKey({required String path, required String password, String language = "English", int networkType = 0, required String spendKeyString, required bool newWallet, required int restoreHeight, int kdfRounds = 1}) {
- final wallet = monero.WalletManager_createDeterministicWalletFromSpendKey(wmPtr, path: path, password: password, language: language, networkType: networkType, spendKeyString: spendKeyString, newWallet: newWallet, restoreHeight: restoreHeight, kdfRounds: kdfRounds);
+ Wallet2Wallet createDeterministicWalletFromSpendKey(
+ {required String path,
+ required String password,
+ String language = "English",
+ int networkType = 0,
+ required String spendKeyString,
+ required bool newWallet,
+ required int restoreHeight,
+ int kdfRounds = 1}) {
+ final wallet = monero.WalletManager_createDeterministicWalletFromSpendKey(
+ wmPtr,
+ path: path,
+ password: password,
+ language: language,
+ networkType: networkType,
+ spendKeyString: spendKeyString,
+ newWallet: newWallet,
+ restoreHeight: restoreHeight,
+ kdfRounds: kdfRounds);
return MoneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWallet({required String path, required String password, String language = "English", int networkType = 0}) {
- final wallet = monero.WalletManager_createWallet(wmPtr, path: path, password: password, language: language, networkType: networkType);
+ Wallet2Wallet createWallet(
+ {required String path,
+ required String password,
+ String language = "English",
+ int networkType = 0}) {
+ final wallet = monero.WalletManager_createWallet(wmPtr,
+ path: path,
+ password: password,
+ language: language,
+ networkType: networkType);
return MoneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWalletFromDevice({required String path, required String password, int networkType = 0, required String deviceName, int restoreHeight = 0, String subaddressLookahead = "", int kdfRounds = 1}) {
- final wallet = monero.WalletManager_createWalletFromDevice(wmPtr, path: path, password: password, deviceName: deviceName, restoreHeight: restoreHeight, subaddressLookahead: subaddressLookahead, kdfRounds: kdfRounds);
+ Wallet2Wallet createWalletFromDevice(
+ {required String path,
+ required String password,
+ int networkType = 0,
+ required String deviceName,
+ int restoreHeight = 0,
+ String subaddressLookahead = "",
+ int kdfRounds = 1}) {
+ final wallet = monero.WalletManager_createWalletFromDevice(wmPtr,
+ path: path,
+ password: password,
+ deviceName: deviceName,
+ restoreHeight: restoreHeight,
+ subaddressLookahead: subaddressLookahead,
+ kdfRounds: kdfRounds);
return MoneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWalletFromKeys({required String path, required String password, String language = "English", int nettype = 1, required int restoreHeight, required String addressString, required String viewKeyString, required String spendKeyString, int kdf_rounds = 1}) {
- final wallet = monero.WalletManager_createWalletFromKeys(wmPtr, path: path, password: password, language: language, nettype: nettype, restoreHeight: restoreHeight, addressString: addressString, viewKeyString: viewKeyString, spendKeyString: spendKeyString);
+ Wallet2Wallet createWalletFromKeys(
+ {required String path,
+ required String password,
+ String language = "English",
+ int nettype = 1,
+ required int restoreHeight,
+ required String addressString,
+ required String viewKeyString,
+ required String spendKeyString,
+ int kdf_rounds = 1}) {
+ final wallet = monero.WalletManager_createWalletFromKeys(wmPtr,
+ path: path,
+ password: password,
+ language: language,
+ nettype: nettype,
+ restoreHeight: restoreHeight,
+ addressString: addressString,
+ viewKeyString: viewKeyString,
+ spendKeyString: spendKeyString);
return MoneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWalletFromPolyseed({required String path, required String password, int networkType = 0, required String mnemonic, required String seedOffset, required bool newWallet, required int restoreHeight, required int kdfRounds}) {
- final wallet = monero.WalletManager_createWalletFromPolyseed(wmPtr, path: path, password: password, networkType: networkType, mnemonic: mnemonic, seedOffset: seedOffset, newWallet: newWallet, restoreHeight: restoreHeight, kdfRounds: kdfRounds);
+ Wallet2Wallet createWalletFromPolyseed(
+ {required String path,
+ required String password,
+ int networkType = 0,
+ required String mnemonic,
+ required String seedOffset,
+ required bool newWallet,
+ required int restoreHeight,
+ required int kdfRounds}) {
+ final wallet = monero.WalletManager_createWalletFromPolyseed(wmPtr,
+ path: path,
+ password: password,
+ networkType: networkType,
+ mnemonic: mnemonic,
+ seedOffset: seedOffset,
+ newWallet: newWallet,
+ restoreHeight: restoreHeight,
+ kdfRounds: kdfRounds);
return MoneroWallet(wallet);
}
-
+
@override
String errorString() {
return monero.WalletManager_errorString(wmPtr);
}
-
+
@override
List<String> findWallets({required String path}) {
return monero.WalletManager_findWallets(wmPtr, path: path);
}
-
+
@override
bool isMining() {
return monero.WalletManager_isMining(wmPtr);
}
-
+
@override
double miningHashRate() {
return monero.WalletManager_miningHashRate(wmPtr);
}
-
+
@override
int networkDifficulty() {
return monero.WalletManager_networkDifficulty(wmPtr);
}
-
+
@override
- Wallet2Wallet openWallet({required String path, required String password, int networkType = 0}) {
- final wallet = monero.WalletManager_openWallet(wmPtr, path: path, password: password, networkType: networkType);
+ Wallet2Wallet openWallet(
+ {required String path, required String password, int networkType = 0}) {
+ final wallet = monero.WalletManager_openWallet(wmPtr,
+ path: path, password: password, networkType: networkType);
return MoneroWallet(wallet);
}
-
- @override
- int queryWalletDevice({required String keysFileName, required String password, required int kdfRounds}) {
- return monero.WalletManager_queryWalletDevice(wmPtr, keysFileName: keysFileName, password: password, kdfRounds: kdfRounds);
- }
-
+
@override
- Wallet2Wallet recoveryWallet({required String path, required String password, required String mnemonic, int networkType = 0, required int restoreHeight, int kdfRounds = 0, required String seedOffset}) {
- final wallet = monero.WalletManager_recoveryWallet(wmPtr, path: path, password: password, mnemonic: mnemonic, networkType: networkType, restoreHeight: restoreHeight, kdfRounds: kdfRounds, seedOffset: seedOffset);
+ int queryWalletDevice(
+ {required String keysFileName,
+ required String password,
+ required int kdfRounds}) {
+ return monero.WalletManager_queryWalletDevice(wmPtr,
+ keysFileName: keysFileName, password: password, kdfRounds: kdfRounds);
+ }
+
+ @override
+ Wallet2Wallet recoveryWallet(
+ {required String path,
+ required String password,
+ required String mnemonic,
+ int networkType = 0,
+ required int restoreHeight,
+ int kdfRounds = 0,
+ required String seedOffset}) {
+ final wallet = monero.WalletManager_recoveryWallet(wmPtr,
+ path: path,
+ password: password,
+ mnemonic: mnemonic,
+ networkType: networkType,
+ restoreHeight: restoreHeight,
+ kdfRounds: kdfRounds,
+ seedOffset: seedOffset);
return MoneroWallet(wallet);
}
-
+
@override
- String resolveOpenAlias({required String address, required bool dnssecValid}) {
- return monero.WalletManager_resolveOpenAlias(wmPtr, address: address, dnssecValid: dnssecValid);
+ String resolveOpenAlias(
+ {required String address, required bool dnssecValid}) {
+ return monero.WalletManager_resolveOpenAlias(wmPtr,
+ address: address, dnssecValid: dnssecValid);
}
-
+
@override
void setDaemonAddress(String address) {
monero.WalletManager_setDaemonAddress(wmPtr, address);
}
-
+
@override
bool setProxy(String address) {
return monero.WalletManager_setProxy(wmPtr, address);
}
-
+
@override
- bool startMining({required String address, required int threads, required bool backgroundMining, required bool ignoreBattery}) {
- return monero.WalletManager_startMining(wmPtr, address: address, threads: threads, backgroundMining: backgroundMining, ignoreBattery: ignoreBattery);
+ bool startMining(
+ {required String address,
+ required int threads,
+ required bool backgroundMining,
+ required bool ignoreBattery}) {
+ return monero.WalletManager_startMining(wmPtr,
+ address: address,
+ threads: threads,
+ backgroundMining: backgroundMining,
+ ignoreBattery: ignoreBattery);
}
-
+
@override
bool stopMining(String address) {
return monero.WalletManager_stopMining(wmPtr, address);
}
-
+
@override
- bool verifyWalletPassword({required String keysFileName, required String password, required bool noSpendKey, required int kdfRounds}) {
- return monero.WalletManager_verifyWalletPassword(wmPtr, keysFileName: keysFileName, password: password, noSpendKey: noSpendKey, kdfRounds: kdfRounds);
+ bool verifyWalletPassword(
+ {required String keysFileName,
+ required String password,
+ required bool noSpendKey,
+ required int kdfRounds}) {
+ return monero.WalletManager_verifyWalletPassword(wmPtr,
+ keysFileName: keysFileName,
+ password: password,
+ noSpendKey: noSpendKey,
+ kdfRounds: kdfRounds);
}
-
+
@override
bool walletExists(String path) {
return monero.WalletManager_walletExists(wmPtr, path);
@@ -1692,10 +1954,11 @@ class MoneroWalletManager implements Wallet2WalletManager {
@override
int ffiAddress() => wmPtr.address;
-
+
@override
void closeWallet(Wallet2Wallet wallet, bool store) {
- monero.WalletManager_closeWallet(wmPtr, Pointer.fromAddress(wallet.ffiAddress()), store);
+ monero.WalletManager_closeWallet(
+ wmPtr, Pointer.fromAddress(wallet.ffiAddress()), store);
}
}
diff --git a/impls/monero.dart/lib/src/wallet2.dart b/impls/monero.dart/lib/src/wallet2.dart
index 8c41ffa..23e12ff 100644
--- a/impls/monero.dart/lib/src/wallet2.dart
+++ b/impls/monero.dart/lib/src/wallet2.dart
@@ -2,9 +2,10 @@
import 'dart:ffi';
import 'dart:io';
+
abstract class Wallet2 {
Wallet2WalletManagerFactory walletManagerFactory();
-
+
static String get libPath {
if (Platform.isWindows) return 'unknown_libwallet2_api_c.dll';
if (Platform.isMacOS) return 'unknown_libwallet2_api_c.dylib';
@@ -12,10 +13,12 @@ abstract class Wallet2 {
if (Platform.isAndroid) return 'libunknown_libwallet2_api_c.so';
return 'unknown_libwallet2_api_c.so';
}
+
static set libPath(String path) {
- throw Exception('libPath is read-only, as isolates cannot be made aware of changes to this variable');
+ throw Exception(
+ 'libPath is read-only, as isolates cannot be made aware of changes to this variable');
}
-
+
int ffiAddress();
}
@@ -24,9 +27,16 @@ abstract class Wallet2AddressBook {
int getAll_size();
Wallet2AddressBookRow getAll_byIndex(int index);
- bool addRow({required String dstAddr, required String paymentId, required String description, });
+ bool addRow({
+ required String dstAddr,
+ required String paymentId,
+ required String description,
+ });
bool deleteRow({required int rowId});
- bool setDescription({required int rowId, required String description, });
+ bool setDescription({
+ required int rowId,
+ required String description,
+ });
void refresh();
int errorCode();
int lookupPaymentID({required String paymentId});
@@ -141,6 +151,8 @@ abstract class Wallet2PendingTransaction {
void signMultisigTx();
String signersKeys(String separator);
String hex(String separator);
+ String commitTrezor(int tx_index);
+ bool commitTrezorNext(String response_json, int tx_index);
}
abstract class Wallet2Subaddress {
@@ -149,7 +161,10 @@ abstract class Wallet2Subaddress {
int getAll_size();
Wallet2SubaddressRow getAll_byIndex(int index);
void addRow({required int accountIndex, required String label});
- void setLabel({required int accountIndex, required int addressIndex, required String label});
+ void setLabel(
+ {required int accountIndex,
+ required int addressIndex,
+ required String label});
void refresh({required int accountIndex, required String label});
}
@@ -248,7 +263,10 @@ abstract class Wallet2Wallet {
String address({int accountIndex = 0, int addressIndex = 0});
String path();
int nettype();
- int useForkRules({required int version, required int earlyBlocks, });
+ int useForkRules({
+ required int version,
+ required int earlyBlocks,
+ });
String integratedAddress({required String paymentId});
String secretViewKey();
String publicViewKey();
@@ -259,8 +277,20 @@ abstract class Wallet2Wallet {
bool store({String path = ""});
String filename();
String keysFilename();
- bool init({ required String daemonAddress, int upperTransacationSizeLimit = 0, String daemonUsername = "", String daemonPassword = "", bool useSsl = false, bool lightWallet = false, String proxyAddress = "", });
- bool createWatchOnly({ required String path, required String password, required String language, });
+ bool init({
+ required String daemonAddress,
+ int upperTransacationSizeLimit = 0,
+ String daemonUsername = "",
+ String daemonPassword = "",
+ bool useSsl = false,
+ bool lightWallet = false,
+ String proxyAddress = "",
+ });
+ bool createWatchOnly({
+ required String path,
+ required String password,
+ required String language,
+ });
void setRefreshFromBlockHeight({required int refresh_from_block_height});
int getRefreshFromBlockHeight();
void setRecoveringFromSeed({required bool recoveringFromSeed});
@@ -286,13 +316,28 @@ abstract class Wallet2Wallet {
String genPaymentId();
bool paymentIdValid(String paymentId);
bool addressValid(String address, int networkType);
- bool keyValid({required String secret_key_string, required String address_string, required bool isViewKey, required int nettype});
- String keyValid_error({required String secret_key_string, required String address_string, required bool isViewKey, required int nettype});
+ bool keyValid(
+ {required String secret_key_string,
+ required String address_string,
+ required bool isViewKey,
+ required int nettype});
+ String keyValid_error(
+ {required String secret_key_string,
+ required String address_string,
+ required bool isViewKey,
+ required int nettype});
String paymentIdFromAddress({required String strarg, required int nettype});
int maximumAllowedAmount();
- void init3({ required String argv0, required String defaultLogBaseName, required String logPath, required bool console, });
+ void init3({
+ required String argv0,
+ required String defaultLogBaseName,
+ required String logPath,
+ required bool console,
+ });
String getPolyseed({required String passphrase});
- String createPolyseed({ String language = "English", });
+ String createPolyseed({
+ String language = "English",
+ });
void startRefresh();
void pauseRefresh();
bool refresh();
@@ -305,32 +350,76 @@ abstract class Wallet2Wallet {
void addSubaddressAccount({String label = ""});
int numSubaddressAccounts();
int numSubaddresses({required int accountIndex});
- String getSubaddressLabel({required int accountIndex, required int addressIndex});
- void setSubaddressLabel({required int accountIndex, required int addressIndex, required String label});
+ String getSubaddressLabel(
+ {required int accountIndex, required int addressIndex});
+ void setSubaddressLabel(
+ {required int accountIndex,
+ required int addressIndex,
+ required String label});
Wallet2MultisigState multisig();
String getMultisigInfo();
- String makeMultisig({ required List<String> info, required int threshold, });
- String exchangeMultisigKeys({ required List<String> info, required bool force_update_use_with_caution, });
- List<String> exportMultisigImages({ required List<String> info, });
- int importMultisigImages({ required List<String> info, });
+ String makeMultisig({
+ required List<String> info,
+ required int threshold,
+ });
+ String exchangeMultisigKeys({
+ required List<String> info,
+ required bool force_update_use_with_caution,
+ });
+ List<String> exportMultisigImages({
+ required List<String> info,
+ });
+ int importMultisigImages({
+ required List<String> info,
+ });
int hasMultisigPartialKeyImages();
- Wallet2PendingTransaction restoreMultisigTransaction({ required String signData, });
- Wallet2PendingTransaction createTransactionMultDest({ required List<String> dstAddr, String paymentId = "", required bool isSweepAll, required List<int> amounts, required int mixinCount, required int pendingTransactionPriority, required int subaddr_account, List<String> preferredInputs = const [], });
- Wallet2PendingTransaction createTransaction({required String dst_addr, required String payment_id, required int amount, required int mixin_count, required int pendingTransactionPriority, required int subaddr_account, List<String> preferredInputs = const [],});
- Wallet2UnsignedTransaction loadUnsignedTx({required String unsigned_filename});
+ Wallet2PendingTransaction restoreMultisigTransaction({
+ required String signData,
+ });
+ Wallet2PendingTransaction createTransactionMultDest({
+ required List<String> dstAddr,
+ String paymentId = "",
+ required bool isSweepAll,
+ required List<int> amounts,
+ required int mixinCount,
+ required int pendingTransactionPriority,
+ required int subaddr_account,
+ List<String> preferredInputs = const [],
+ });
+ Wallet2PendingTransaction createTransaction({
+ required String dst_addr,
+ required String payment_id,
+ required int amount,
+ required int mixin_count,
+ required int pendingTransactionPriority,
+ required int subaddr_account,
+ List<String> preferredInputs = const [],
+ });
+ Wallet2UnsignedTransaction loadUnsignedTx(
+ {required String unsigned_filename});
Wallet2UnsignedTransaction loadUnsignedTxUR({required String input});
bool submitTransaction(String filename);
bool submitTransactionUR(String input);
bool hasUnknownKeyImages();
bool exportKeyImages(String filename, {required bool all});
- String exportKeyImagesUR({ int max_fragment_length = 130, bool all = false, });
+ String exportKeyImagesUR({
+ int max_fragment_length = 130,
+ bool all = false,
+ });
bool importKeyImages(String filename);
bool importKeyImagesUR(String input);
bool exportOutputs(String filename, {required bool all});
- String exportOutputsUR({ int max_fragment_length = 130, bool all = false, });
+ String exportOutputsUR({
+ int max_fragment_length = 130,
+ bool all = false,
+ });
bool importOutputs(String filename);
bool importOutputsUR(String input);
- bool setupBackgroundSync({ required int backgroundSyncType, required String walletPassword, required String backgroundCachePassword, });
+ bool setupBackgroundSync({
+ required int backgroundSyncType,
+ required String walletPassword,
+ required String backgroundCachePassword,
+ });
int getBackgroundSyncType();
bool startBackgroundSync();
bool stopBackgroundSync(String walletPassword);
@@ -348,8 +437,15 @@ abstract class Wallet2Wallet {
bool setUserNote({required String txid, required String note});
String getUserNote({required String txid});
String getTxKey({required String txid});
- String signMessage({ required String message, required String address, });
- bool verifySignedMessage({ required String message, required String address, required String signature, });
+ String signMessage({
+ required String message,
+ required String address,
+ });
+ bool verifySignedMessage({
+ required String message,
+ required String address,
+ required String signature,
+ });
bool rescanSpent();
void setOffline({required bool offline});
bool isOffline();
@@ -361,7 +457,8 @@ abstract class Wallet2Wallet {
bool isKeysFileLocked();
int getDeviceType();
int coldKeyImageSync({required int spent, required int unspent});
- String deviceShowAddress({required int accountIndex, required int addressIndex});
+ String deviceShowAddress(
+ {required int accountIndex, required int addressIndex});
bool reconnectDevice();
int getBytesReceived();
int getBytesSent();
@@ -371,17 +468,79 @@ abstract class Wallet2Wallet {
abstract class Wallet2WalletManager {
int ffiAddress();
- Wallet2Wallet createWallet({ required String path, required String password, String language = "English", int networkType = 0, });
- Wallet2Wallet openWallet({ required String path, required String password, int networkType = 0, });
+ Wallet2Wallet createWallet({
+ required String path,
+ required String password,
+ String language = "English",
+ int networkType = 0,
+ });
+ Wallet2Wallet openWallet({
+ required String path,
+ required String password,
+ int networkType = 0,
+ });
void closeWallet(Wallet2Wallet wallet, bool store);
- Wallet2Wallet recoveryWallet({ required String path, required String password, required String mnemonic, int networkType = 0, required int restoreHeight, int kdfRounds = 0, required String seedOffset, });
- Wallet2Wallet createWalletFromKeys({ required String path, required String password, String language = "English", int nettype = 1, required int restoreHeight, required String addressString, required String viewKeyString, required String spendKeyString, int kdf_rounds = 1, });
- Wallet2Wallet createDeterministicWalletFromSpendKey({ required String path, required String password, String language = "English", int networkType = 0, required String spendKeyString, required bool newWallet, required int restoreHeight, int kdfRounds = 1, });
- Wallet2Wallet createWalletFromDevice({ required String path, required String password, int networkType = 0, required String deviceName, int restoreHeight = 0, String subaddressLookahead = "", int kdfRounds = 1, });
- Wallet2Wallet createWalletFromPolyseed({ required String path, required String password, int networkType = 0, required String mnemonic, required String seedOffset, required bool newWallet, required int restoreHeight, required int kdfRounds, });
+ Wallet2Wallet recoveryWallet({
+ required String path,
+ required String password,
+ required String mnemonic,
+ int networkType = 0,
+ required int restoreHeight,
+ int kdfRounds = 0,
+ required String seedOffset,
+ });
+ Wallet2Wallet createWalletFromKeys({
+ required String path,
+ required String password,
+ String language = "English",
+ int nettype = 1,
+ required int restoreHeight,
+ required String addressString,
+ required String viewKeyString,
+ required String spendKeyString,
+ int kdf_rounds = 1,
+ });
+ Wallet2Wallet createDeterministicWalletFromSpendKey({
+ required String path,
+ required String password,
+ String language = "English",
+ int networkType = 0,
+ required String spendKeyString,
+ required bool newWallet,
+ required int restoreHeight,
+ int kdfRounds = 1,
+ });
+ Wallet2Wallet createWalletFromDevice({
+ required String path,
+ required String password,
+ int networkType = 0,
+ required String deviceName,
+ int restoreHeight = 0,
+ String subaddressLookahead = "",
+ int kdfRounds = 1,
+ });
+ Wallet2Wallet createWalletFromPolyseed({
+ required String path,
+ required String password,
+ int networkType = 0,
+ required String mnemonic,
+ required String seedOffset,
+ required bool newWallet,
+ required int restoreHeight,
+ required int kdfRounds,
+ });
bool walletExists(String path);
- bool verifyWalletPassword({ required String keysFileName, required String password, required bool noSpendKey, required int kdfRounds, });
- int queryWalletDevice({ required String keysFileName, required String password, required int kdfRounds, });
+ bool verifyWalletPassword({
+ required String keysFileName,
+ required String password,
+ required bool noSpendKey,
+ required int kdfRounds,
+ });
+ int queryWalletDevice({
+ required String keysFileName,
+ required String password,
+ required int kdfRounds,
+ });
List<String> findWallets({required String path});
String errorString();
void setDaemonAddress(String address);
@@ -391,9 +550,17 @@ abstract class Wallet2WalletManager {
double miningHashRate();
Future<int> blockTarget();
bool isMining();
- bool startMining({ required String address, required int threads, required bool backgroundMining, required bool ignoreBattery, });
+ bool startMining({
+ required String address,
+ required int threads,
+ required bool backgroundMining,
+ required bool ignoreBattery,
+ });
bool stopMining(String address);
- String resolveOpenAlias({ required String address, required bool dnssecValid, });
+ String resolveOpenAlias({
+ required String address,
+ required bool dnssecValid,
+ });
bool setProxy(String address);
}
@@ -403,4 +570,4 @@ abstract class Wallet2WalletManagerFactory {
void setLogLevel(int level);
void setLogCategories(String categories);
Wallet2WalletManager getWalletManager();
-} \ No newline at end of file
+}
diff --git a/impls/monero.dart/lib/src/wownero.dart b/impls/monero.dart/lib/src/wownero.dart
index c1ef9eb..189176b 100644
--- a/impls/monero.dart/lib/src/wownero.dart
+++ b/impls/monero.dart/lib/src/wownero.dart
@@ -19,46 +19,53 @@ class WowneroAddressBook implements Wallet2AddressBook {
WowneroAddressBook(this.addressBookPtr);
final wownero.AddressBook addressBookPtr;
-
+
@override
- bool addRow({required String dstAddr, required String paymentId, required String description}) {
- return wownero.AddressBook_addRow(addressBookPtr, dstAddr: dstAddr, paymentId: paymentId, description: description);
+ bool addRow(
+ {required String dstAddr,
+ required String paymentId,
+ required String description}) {
+ return wownero.AddressBook_addRow(addressBookPtr,
+ dstAddr: dstAddr, paymentId: paymentId, description: description);
}
-
+
@override
bool deleteRow({required int rowId}) {
return wownero.AddressBook_deleteRow(addressBookPtr, rowId: rowId);
}
-
+
@override
int errorCode() {
return wownero.AddressBook_errorCode(addressBookPtr);
}
-
+
@override
Wallet2AddressBookRow getAll_byIndex(int index) {
- final row = wownero.AddressBook_getAll_byIndex(addressBookPtr, index: index);
+ final row =
+ wownero.AddressBook_getAll_byIndex(addressBookPtr, index: index);
return WowneroAddressBookRow(row);
}
-
+
@override
int getAll_size() {
return wownero.AddressBook_getAll_size(addressBookPtr);
}
-
+
@override
int lookupPaymentID({required String paymentId}) {
- return wownero.AddressBook_lookupPaymentID(addressBookPtr, paymentId: paymentId);
+ return wownero.AddressBook_lookupPaymentID(addressBookPtr,
+ paymentId: paymentId);
}
-
+
@override
void refresh() {
wownero.AddressBook_refresh(addressBookPtr);
}
-
+
@override
bool setDescription({required int rowId, required String description}) {
- return wownero.AddressBook_setDescription(addressBookPtr, rowId: rowId, description: description);
+ return wownero.AddressBook_setDescription(addressBookPtr,
+ rowId: rowId, description: description);
}
@override
@@ -69,27 +76,27 @@ class WowneroAddressBookRow implements Wallet2AddressBookRow {
WowneroAddressBookRow(this.addressBookRowPtr);
final wownero.AddressBookRow addressBookRowPtr;
-
+
@override
String extra() {
return wownero.AddressBookRow_extra(addressBookRowPtr);
}
-
+
@override
String getAddress() {
return wownero.AddressBookRow_getAddress(addressBookRowPtr);
}
-
+
@override
String getDescription() {
return wownero.AddressBookRow_getDescription(addressBookRowPtr);
}
-
+
@override
String getPaymentId() {
return wownero.AddressBookRow_getPaymentId(addressBookRowPtr);
}
-
+
@override
int getRowId() {
return wownero.AddressBookRow_getRowId(addressBookRowPtr);
@@ -103,54 +110,55 @@ class WowneroCoins implements Wallet2Coins {
WowneroCoins(this.coinsPtr);
final wownero.Coins coinsPtr;
-
+
@override
Wallet2CoinsInfo coin(int index) {
final coin = wownero.Coins_coin(coinsPtr, index);
return WowneroCoinsInfo(coin);
}
-
+
@override
int count() {
return wownero.Coins_count(coinsPtr);
}
-
+
@override
Wallet2CoinsInfo getAll_byIndex(int index) {
final coin = wownero.Coins_getAll_byIndex(coinsPtr, index);
return WowneroCoinsInfo(coin);
}
-
+
@override
int getAll_size() {
return wownero.Coins_getAll_size(coinsPtr);
}
-
+
@override
bool isTransferUnlocked({required int unlockTime, required int blockHeight}) {
- return wownero.Coins_isTransferUnlocked(coinsPtr, unlockTime: unlockTime, blockHeight: blockHeight);
+ return wownero.Coins_isTransferUnlocked(coinsPtr,
+ unlockTime: unlockTime, blockHeight: blockHeight);
}
-
+
@override
void refresh() {
wownero.Coins_refresh(coinsPtr);
}
-
+
@override
void setFrozen({required int index}) {
wownero.Coins_setFrozen(coinsPtr, index: index);
}
-
+
@override
void setFrozenByPublicKey({required String publicKey}) {
wownero.Coins_setFrozenByPublicKey(coinsPtr, publicKey: publicKey);
}
-
+
@override
void thaw({required int index}) {
wownero.Coins_thaw(coinsPtr, index: index);
}
-
+
@override
void thawByPublicKey({required String publicKey}) {
wownero.Coins_thawByPublicKey(coinsPtr, publicKey: publicKey);
@@ -164,107 +172,107 @@ class WowneroCoinsInfo implements Wallet2CoinsInfo {
WowneroCoinsInfo(this.coinsInfoPtr);
final wownero.CoinsInfo coinsInfoPtr;
-
+
@override
String address() {
return wownero.CoinsInfo_address(coinsInfoPtr);
}
-
+
@override
String addressLabel() {
return wownero.CoinsInfo_addressLabel(coinsInfoPtr);
}
-
+
@override
int amount() {
return wownero.CoinsInfo_amount(coinsInfoPtr);
}
-
+
@override
int blockHeight() {
return wownero.CoinsInfo_blockHeight(coinsInfoPtr);
}
-
+
@override
bool coinbase() {
return wownero.CoinsInfo_coinbase(coinsInfoPtr);
}
-
+
@override
String description() {
return wownero.CoinsInfo_description(coinsInfoPtr);
}
-
+
@override
bool frozen() {
return wownero.CoinsInfo_frozen(coinsInfoPtr);
}
-
+
@override
int globalOutputIndex() {
return wownero.CoinsInfo_globalOutputIndex(coinsInfoPtr);
}
-
+
@override
String hash() {
return wownero.CoinsInfo_hash(coinsInfoPtr);
}
-
+
@override
int internalOutputIndex() {
return wownero.CoinsInfo_internalOutputIndex(coinsInfoPtr);
}
-
+
@override
String keyImage() {
return wownero.CoinsInfo_keyImage(coinsInfoPtr);
}
-
+
@override
bool keyImageKnown() {
return wownero.CoinsInfo_keyImageKnown(coinsInfoPtr);
}
-
+
@override
int pkIndex() {
return wownero.CoinsInfo_pkIndex(coinsInfoPtr);
}
-
+
@override
String pubKey() {
return wownero.CoinsInfo_pubKey(coinsInfoPtr);
}
-
+
@override
bool rct() {
return wownero.CoinsInfo_rct(coinsInfoPtr);
}
-
+
@override
bool spent() {
return wownero.CoinsInfo_spent(coinsInfoPtr);
}
-
+
@override
int spentHeight() {
return wownero.CoinsInfo_spentHeight(coinsInfoPtr);
}
-
+
@override
int subaddrAccount() {
return wownero.CoinsInfo_subaddrAccount(coinsInfoPtr);
}
-
+
@override
int subaddrIndex() {
return wownero.CoinsInfo_subaddrIndex(coinsInfoPtr);
}
-
+
@override
int unlockTime() {
return wownero.CoinsInfo_unlockTime(coinsInfoPtr);
}
-
+
@override
bool unlocked() {
return wownero.CoinsInfo_unlocked(coinsInfoPtr);
@@ -278,12 +286,12 @@ class WowneroDeviceProgress implements Wallet2DeviceProgress {
WowneroDeviceProgress(this.deviceProgressPtr);
final wownero.DeviceProgress deviceProgressPtr;
-
+
@override
bool indeterminate() {
return wownero.DeviceProgress_indeterminate(deviceProgressPtr);
}
-
+
@override
bool progress() {
return wownero.DeviceProgress_progress(deviceProgressPtr);
@@ -297,27 +305,29 @@ class WowneroWalletListener implements Wallet2WalletListener {
WowneroWalletListener(this.walletListenerPtr);
final wownero.WalletListener walletListenerPtr;
-
+
@override
int height() {
return wownero.WOWNERO_cw_WalletListener_height(walletListenerPtr);
}
-
+
@override
bool isNeedToRefresh() {
return wownero.WOWNERO_cw_WalletListener_isNeedToRefresh(walletListenerPtr);
}
-
+
@override
bool isNewTransactionExist() {
- return wownero.WOWNERO_cw_WalletListener_isNewTransactionExist(walletListenerPtr);
+ return wownero.WOWNERO_cw_WalletListener_isNewTransactionExist(
+ walletListenerPtr);
}
-
+
@override
void resetIsNewTransactionExist() {
- wownero.WOWNERO_cw_WalletListener_resetIsNewTransactionExist(walletListenerPtr);
+ wownero.WOWNERO_cw_WalletListener_resetIsNewTransactionExist(
+ walletListenerPtr);
}
-
+
@override
void resetNeedToRefresh() {
wownero.WOWNERO_cw_WalletListener_resetNeedToRefresh(walletListenerPtr);
@@ -334,12 +344,12 @@ class WowneroWalletChecksum implements Wallet2Checksum {
String checksum_wallet2_api_c_cpp() {
return wownero.WOWNERO_checksum_wallet2_api_c_cpp();
}
-
+
@override
String checksum_wallet2_api_c_exp() {
return wownero.WOWNERO_checksum_wallet2_api_c_exp();
}
-
+
@override
String checksum_wallet2_api_c_h() {
return wownero.WOWNERO_checksum_wallet2_api_c_h();
@@ -365,22 +375,22 @@ class WowneroMultisigState implements Wallet2MultisigState {
WowneroMultisigState(this.multisigStatePtr);
final wownero.MultisigState multisigStatePtr;
-
+
@override
bool isMultisig(Pointer<Void> ptr) {
return wownero.MultisigState_isMultisig(multisigStatePtr);
}
-
+
@override
bool isReady(Pointer<Void> ptr) {
return wownero.MultisigState_isReady(multisigStatePtr);
}
-
+
@override
int threshold(Pointer<Void> ptr) {
return wownero.MultisigState_threshold(multisigStatePtr);
}
-
+
@override
int total(Pointer<Void> ptr) {
return wownero.MultisigState_total(multisigStatePtr);
@@ -394,77 +404,81 @@ class WowneroPendingTransaction implements Wallet2PendingTransaction {
WowneroPendingTransaction(this.pendingTransactionPtr);
final wownero.PendingTransaction pendingTransactionPtr;
-
+
@override
int amount() {
return wownero.PendingTransaction_amount(pendingTransactionPtr);
}
-
+
@override
bool commit({required String filename, required bool overwrite}) {
- return wownero.PendingTransaction_commit(pendingTransactionPtr, filename: filename, overwrite: overwrite);
+ return wownero.PendingTransaction_commit(pendingTransactionPtr,
+ filename: filename, overwrite: overwrite);
}
-
+
@override
String commitUR(int max_fragment_length) {
throw UnimplementedError();
}
-
+
@override
int dust() {
return wownero.PendingTransaction_dust(pendingTransactionPtr);
}
-
+
@override
String errorString() {
return wownero.PendingTransaction_errorString(pendingTransactionPtr);
}
-
+
@override
int fee() {
return wownero.PendingTransaction_fee(pendingTransactionPtr);
}
-
+
@override
String hex(String separator) {
return wownero.PendingTransaction_hex(pendingTransactionPtr, separator);
}
-
+
@override
String multisigSignData() {
return wownero.PendingTransaction_multisigSignData(pendingTransactionPtr);
}
-
+
@override
void signMultisigTx() {
wownero.PendingTransaction_signMultisigTx(pendingTransactionPtr);
}
-
+
@override
String signersKeys(String separator) {
- return wownero.PendingTransaction_signersKeys(pendingTransactionPtr, separator);
+ return wownero.PendingTransaction_signersKeys(
+ pendingTransactionPtr, separator);
}
-
+
@override
int status() {
return wownero.PendingTransaction_status(pendingTransactionPtr);
}
-
+
@override
String subaddrAccount(String separator) {
- return wownero.PendingTransaction_subaddrAccount(pendingTransactionPtr, separator);
+ return wownero.PendingTransaction_subaddrAccount(
+ pendingTransactionPtr, separator);
}
-
+
@override
String subaddrIndices(String separator) {
- return wownero.PendingTransaction_subaddrIndices(pendingTransactionPtr, separator);
+ return wownero.PendingTransaction_subaddrIndices(
+ pendingTransactionPtr, separator);
}
-
+
@override
int txCount() {
return wownero.PendingTransaction_txCount(pendingTransactionPtr);
}
-
+
@override
String txid(String separator) {
return wownero.PendingTransaction_txid(pendingTransactionPtr, separator);
@@ -472,37 +486,50 @@ class WowneroPendingTransaction implements Wallet2PendingTransaction {
@override
int ffiAddress() => pendingTransactionPtr.address;
+
+ @override
+ String commitTrezor(int tx_index) => throw UnimplementedError();
+
+ @override
+ bool commitTrezorNext(String response_json, int tx_index) =>
+ throw UnimplementedError();
}
class WowneroSubaddress implements Wallet2Subaddress {
WowneroSubaddress(this.subaddressPtr);
final wownero.Subaddress subaddressPtr;
-
+
@override
void addRow({required int accountIndex, required String label}) {
- wownero.Subaddress_addRow(subaddressPtr, accountIndex: accountIndex, label: label);
+ wownero.Subaddress_addRow(subaddressPtr,
+ accountIndex: accountIndex, label: label);
}
-
+
@override
Wallet2SubaddressRow getAll_byIndex(int index) {
final row = wownero.Subaddress_getAll_byIndex(subaddressPtr, index: index);
return WowneroSubaddressRow(row);
}
-
+
@override
int getAll_size() {
return wownero.Subaddress_getAll_size(subaddressPtr);
}
-
+
@override
void refresh({required int accountIndex, required String label}) {
- wownero.Subaddress_refresh(subaddressPtr, accountIndex: accountIndex, label: label);
+ wownero.Subaddress_refresh(subaddressPtr,
+ accountIndex: accountIndex, label: label);
}
-
+
@override
- void setLabel({required int accountIndex, required int addressIndex, required String label}) {
- wownero.Subaddress_setLabel(subaddressPtr, accountIndex: accountIndex, addressIndex: addressIndex, label: label);
+ void setLabel(
+ {required int accountIndex,
+ required int addressIndex,
+ required String label}) {
+ wownero.Subaddress_setLabel(subaddressPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex, label: label);
}
@override
@@ -513,31 +540,33 @@ class WowneroSubaddressAccount implements Wallet2SubaddressAccount {
WowneroSubaddressAccount(this.subaddressAccountPtr);
final wownero.SubaddressAccount subaddressAccountPtr;
-
+
@override
void addRow({required String label}) {
wownero.SubaddressAccount_addRow(subaddressAccountPtr, label: label);
}
-
+
@override
Wallet2SubaddressAccountRow getAll_byIndex(int index) {
- final row = wownero.SubaddressAccount_getAll_byIndex(subaddressAccountPtr, index: index);
+ final row = wownero.SubaddressAccount_getAll_byIndex(subaddressAccountPtr,
+ index: index);
return WowneroSubaddressAccountRow(row);
}
-
+
@override
int getAll_size() {
return wownero.SubaddressAccount_getAll_size(subaddressAccountPtr);
}
-
+
@override
void refresh() {
wownero.SubaddressAccount_refresh(subaddressAccountPtr);
}
-
+
@override
void setLabel({required int accountIndex, required String label}) {
- wownero.SubaddressAccount_setLabel(subaddressAccountPtr, accountIndex: accountIndex, label: label);
+ wownero.SubaddressAccount_setLabel(subaddressAccountPtr,
+ accountIndex: accountIndex, label: label);
}
@override
@@ -548,35 +577,36 @@ class WowneroSubaddressAccountRow implements Wallet2SubaddressAccountRow {
WowneroSubaddressAccountRow(this.subaddressAccountRowPtr);
final wownero.SubaddressAccountRow subaddressAccountRowPtr;
-
+
@override
String extra() {
return wownero.SubaddressAccountRow_extra(subaddressAccountRowPtr);
}
-
+
@override
String getAddress() {
return wownero.SubaddressAccountRow_getAddress(subaddressAccountRowPtr);
}
-
+
@override
String getBalance() {
return wownero.SubaddressAccountRow_getBalance(subaddressAccountRowPtr);
}
-
+
@override
String getLabel() {
return wownero.SubaddressAccountRow_getLabel(subaddressAccountRowPtr);
}
-
+
@override
int getRowId() {
return wownero.SubaddressAccountRow_getRowId(subaddressAccountRowPtr);
}
-
+
@override
String getUnlockedBalance() {
- return wownero.SubaddressAccountRow_getUnlockedBalance(subaddressAccountRowPtr);
+ return wownero.SubaddressAccountRow_getUnlockedBalance(
+ subaddressAccountRowPtr);
}
@override
@@ -587,22 +617,22 @@ class WowneroSubaddressRow implements Wallet2SubaddressRow {
WowneroSubaddressRow(this.subaddressRowPtr);
final wownero.SubaddressRow subaddressRowPtr;
-
+
@override
String extra() {
return wownero.SubaddressRow_extra(subaddressRowPtr);
}
-
+
@override
String getAddress() {
return wownero.SubaddressRow_getAddress(subaddressRowPtr);
}
-
+
@override
String getLabel() {
return wownero.SubaddressRow_getLabel(subaddressRowPtr);
}
-
+
@override
int getRowId() {
return wownero.SubaddressRow_getRowId(subaddressRowPtr);
@@ -616,31 +646,34 @@ class WowneroTransactionHistory implements Wallet2TransactionHistory {
WowneroTransactionHistory(this.transactionHistoryPtr);
final wownero.TransactionHistory transactionHistoryPtr;
-
+
@override
int count() {
return wownero.TransactionHistory_count(transactionHistoryPtr);
}
-
+
@override
void refresh() {
wownero.TransactionHistory_refresh(transactionHistoryPtr);
}
-
+
@override
void setTxNote({required String txid, required String note}) {
- wownero.TransactionHistory_setTxNote(transactionHistoryPtr, txid: txid, note: note);
+ wownero.TransactionHistory_setTxNote(transactionHistoryPtr,
+ txid: txid, note: note);
}
-
+
@override
Wallet2TransactionInfo transaction(int index) {
- final tx = wownero.TransactionHistory_transaction(transactionHistoryPtr, index: index);
+ final tx = wownero.TransactionHistory_transaction(transactionHistoryPtr,
+ index: index);
return WowneroTransactionInfo(tx);
}
-
+
@override
Wallet2TransactionInfo transactionById(String txid) {
- final tx = wownero.TransactionHistory_transactionById(transactionHistoryPtr, txid: txid);
+ final tx = wownero.TransactionHistory_transactionById(transactionHistoryPtr,
+ txid: txid);
return WowneroTransactionInfo(tx);
}
@@ -652,97 +685,97 @@ class WowneroTransactionInfo implements Wallet2TransactionInfo {
WowneroTransactionInfo(this.transactionInfoPtr);
final wownero.TransactionInfo transactionInfoPtr;
-
+
@override
int amount() {
return wownero.TransactionInfo_amount(transactionInfoPtr);
}
-
+
@override
int blockHeight() {
return wownero.TransactionInfo_blockHeight(transactionInfoPtr);
}
-
+
@override
int confirmations() {
return wownero.TransactionInfo_confirmations(transactionInfoPtr);
}
-
+
@override
String description() {
return wownero.TransactionInfo_description(transactionInfoPtr);
}
-
+
@override
int direction() {
return wownero.TransactionInfo_direction(transactionInfoPtr).index;
}
-
+
@override
int fee() {
return wownero.TransactionInfo_fee(transactionInfoPtr);
}
-
+
@override
String hash() {
return wownero.TransactionInfo_hash(transactionInfoPtr);
}
-
+
@override
bool isCoinbase() {
return wownero.TransactionInfo_isCoinbase(transactionInfoPtr);
}
-
+
@override
bool isFailed() {
return wownero.TransactionInfo_isFailed(transactionInfoPtr);
}
-
+
@override
bool isPending() {
return wownero.TransactionInfo_isPending(transactionInfoPtr);
}
-
+
@override
String label() {
return wownero.TransactionInfo_label(transactionInfoPtr);
}
-
+
@override
String paymentId() {
return wownero.TransactionInfo_paymentId(transactionInfoPtr);
}
-
+
@override
int subaddrAccount() {
return wownero.TransactionInfo_subaddrAccount(transactionInfoPtr);
}
-
+
@override
String subaddrIndex() {
return wownero.TransactionInfo_subaddrIndex(transactionInfoPtr);
}
-
+
@override
int timestamp() {
return wownero.TransactionInfo_timestamp(transactionInfoPtr);
}
-
+
@override
String transfers_address(int index) {
return wownero.TransactionInfo_transfers_address(transactionInfoPtr, index);
}
-
+
@override
int transfers_amount(int index) {
return wownero.TransactionInfo_transfers_amount(transactionInfoPtr, index);
}
-
+
@override
int transfers_count() {
return wownero.TransactionInfo_transfers_count(transactionInfoPtr);
}
-
+
@override
int unlockTime() {
return wownero.TransactionInfo_unlockTime(transactionInfoPtr);
@@ -756,765 +789,879 @@ class WowneroUnsignedTransaction implements Wallet2UnsignedTransaction {
WowneroUnsignedTransaction(this.unsignedTransactionPtr);
final wownero.UnsignedTransaction unsignedTransactionPtr;
-
+
@override
String amount() {
return wownero.UnsignedTransaction_amount(unsignedTransactionPtr);
}
-
+
@override
String confirmationMessage() {
- return wownero.UnsignedTransaction_confirmationMessage(unsignedTransactionPtr);
+ return wownero.UnsignedTransaction_confirmationMessage(
+ unsignedTransactionPtr);
}
-
+
@override
String errorString() {
return wownero.UnsignedTransaction_errorString(unsignedTransactionPtr);
}
-
+
@override
String fee() {
return wownero.UnsignedTransaction_fee(unsignedTransactionPtr);
}
-
+
@override
int minMixinCount() {
return wownero.UnsignedTransaction_minMixinCount(unsignedTransactionPtr);
}
-
+
@override
String mixin() {
return wownero.UnsignedTransaction_mixin(unsignedTransactionPtr);
}
-
+
@override
String paymentId() {
return wownero.UnsignedTransaction_paymentId(unsignedTransactionPtr);
}
-
+
@override
String recipientAddress() {
return wownero.UnsignedTransaction_recipientAddress(unsignedTransactionPtr);
}
-
+
@override
bool sign(String signedFileName) {
- return wownero.UnsignedTransaction_sign(unsignedTransactionPtr, signedFileName);
+ return wownero.UnsignedTransaction_sign(
+ unsignedTransactionPtr, signedFileName);
}
-
+
@override
String signUR(int max_fragment_length) {
throw UnimplementedError();
}
-
+
@override
int status() {
return wownero.UnsignedTransaction_status(unsignedTransactionPtr);
}
-
+
@override
int txCount() {
return wownero.UnsignedTransaction_txCount(unsignedTransactionPtr);
}
-
+
@override
int ffiAddress() => unsignedTransactionPtr.address;
+
+ @override
+ String commitTrezor(int tx_index) => throw UnimplementedError();
}
class WowneroWallet implements Wallet2Wallet {
WowneroWallet(this.walletPtr);
final wownero.wallet walletPtr;
-
+
@override
void addSubaddress({required int accountIndex, String label = ""}) {
- wownero.Wallet_addSubaddress(walletPtr, accountIndex: accountIndex, label: label);
+ wownero.Wallet_addSubaddress(walletPtr,
+ accountIndex: accountIndex, label: label);
}
-
+
@override
void addSubaddressAccount({String label = ""}) {
wownero.Wallet_addSubaddressAccount(walletPtr, label: label);
}
-
+
@override
String address({int accountIndex = 0, int addressIndex = 0}) {
- return wownero.Wallet_address(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex);
+ return wownero.Wallet_address(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex);
}
-
+
@override
Wallet2AddressBook addressBook() {
return WowneroAddressBook(wownero.Wallet_addressBook(walletPtr));
}
-
+
@override
bool addressValid(String address, int networkType) {
return wownero.Wallet_addressValid(address, networkType);
}
-
+
@override
int amountFromDouble(double amount) {
return wownero.Wallet_amountFromDouble(amount);
}
-
+
@override
int amountFromString(String amount) {
return wownero.Wallet_amountFromString(amount);
}
-
+
@override
int approximateBlockChainHeight() {
return wownero.Wallet_approximateBlockChainHeight(walletPtr);
}
-
+
@override
int autoRefreshInterval() {
return wownero.Wallet_autoRefreshInterval(walletPtr);
}
-
+
@override
int balance({required int accountIndex}) {
return wownero.Wallet_balance(walletPtr, accountIndex: accountIndex);
}
-
+
@override
int blockChainHeight() {
return wownero.Wallet_blockChainHeight(walletPtr);
}
-
+
@override
Wallet2Coins coins() {
return WowneroCoins(wownero.Wallet_coins(walletPtr));
}
-
+
@override
int coldKeyImageSync({required int spent, required int unspent}) {
- return wownero.Wallet_coldKeyImageSync(walletPtr, spent: spent, unspent: unspent);
+ return wownero.Wallet_coldKeyImageSync(walletPtr,
+ spent: spent, unspent: unspent);
}
-
+
@override
bool connectToDaemon() {
return wownero.Wallet_connectToDaemon(walletPtr);
}
-
+
@override
int connected() {
return wownero.Wallet_connected(walletPtr);
}
-
+
@override
String createPolyseed({String language = "English"}) {
return wownero.Wallet_createPolyseed(language: language);
}
-
+
@override
- Wallet2PendingTransaction createTransaction({required String dst_addr, required String payment_id, required int amount, required int mixin_count, required int pendingTransactionPriority, required int subaddr_account, List<String> preferredInputs = const []}) {
- final transaction = wownero.Wallet_createTransaction(walletPtr, dst_addr: dst_addr, payment_id: payment_id, amount: amount, mixin_count: mixin_count, pendingTransactionPriority: pendingTransactionPriority, subaddr_account: subaddr_account, preferredInputs: preferredInputs);
+ Wallet2PendingTransaction createTransaction(
+ {required String dst_addr,
+ required String payment_id,
+ required int amount,
+ required int mixin_count,
+ required int pendingTransactionPriority,
+ required int subaddr_account,
+ List<String> preferredInputs = const []}) {
+ final transaction = wownero.Wallet_createTransaction(walletPtr,
+ dst_addr: dst_addr,
+ payment_id: payment_id,
+ amount: amount,
+ mixin_count: mixin_count,
+ pendingTransactionPriority: pendingTransactionPriority,
+ subaddr_account: subaddr_account,
+ preferredInputs: preferredInputs);
return WowneroPendingTransaction(transaction);
}
-
+
@override
- Wallet2PendingTransaction createTransactionMultDest({required List<String> dstAddr, String paymentId = "", required bool isSweepAll, required List<int> amounts, required int mixinCount, required int pendingTransactionPriority, required int subaddr_account, List<String> preferredInputs = const []}) {
- final transaction = wownero.Wallet_createTransactionMultDest(walletPtr, dstAddr: dstAddr, paymentId: paymentId, isSweepAll: isSweepAll, amounts: amounts, mixinCount: mixinCount, pendingTransactionPriority: pendingTransactionPriority, subaddr_account: subaddr_account, preferredInputs: preferredInputs);
+ Wallet2PendingTransaction createTransactionMultDest(
+ {required List<String> dstAddr,
+ String paymentId = "",
+ required bool isSweepAll,
+ required List<int> amounts,
+ required int mixinCount,
+ required int pendingTransactionPriority,
+ required int subaddr_account,
+ List<String> preferredInputs = const []}) {
+ final transaction = wownero.Wallet_createTransactionMultDest(walletPtr,
+ dstAddr: dstAddr,
+ paymentId: paymentId,
+ isSweepAll: isSweepAll,
+ amounts: amounts,
+ mixinCount: mixinCount,
+ pendingTransactionPriority: pendingTransactionPriority,
+ subaddr_account: subaddr_account,
+ preferredInputs: preferredInputs);
return WowneroPendingTransaction(transaction);
}
-
+
@override
- bool createWatchOnly({required String path, required String password, required String language}) {
- return wownero.Wallet_createWatchOnly(walletPtr, path: path, password: password, language: language);
+ bool createWatchOnly(
+ {required String path,
+ required String password,
+ required String language}) {
+ return wownero.Wallet_createWatchOnly(walletPtr,
+ path: path, password: password, language: language);
}
-
+
@override
int daemonBlockChainHeight() {
return wownero.Wallet_daemonBlockChainHeight(walletPtr);
}
-
+
@override
int defaultMixin() {
return wownero.Wallet_defaultMixin(walletPtr);
}
-
+
@override
- String deviceShowAddress({required int accountIndex, required int addressIndex}) {
- return wownero.Wallet_deviceShowAddress(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex);
+ String deviceShowAddress(
+ {required int accountIndex, required int addressIndex}) {
+ return wownero.Wallet_deviceShowAddress(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex);
}
-
+
@override
String displayAmount(int amount) {
return wownero.Wallet_displayAmount(amount);
}
-
+
@override
String errorString() {
return wownero.Wallet_errorString(walletPtr);
}
-
+
@override
int estimateBlockChainHeight() {
return wownero.Wallet_estimateBlockChainHeight(walletPtr);
}
-
+
@override
- String exchangeMultisigKeys({required List<String> info, required bool force_update_use_with_caution}) {
+ String exchangeMultisigKeys(
+ {required List<String> info,
+ required bool force_update_use_with_caution}) {
throw UnimplementedError();
}
-
+
@override
bool exportKeyImages(String filename, {required bool all}) {
return wownero.Wallet_exportKeyImages(walletPtr, filename, all: all);
}
-
+
@override
String exportKeyImagesUR({int max_fragment_length = 130, bool all = false}) {
throw UnimplementedError();
}
-
+
@override
List<String> exportMultisigImages({required List<String> info}) {
throw UnimplementedError();
}
-
+
@override
bool exportOutputs(String filename, {required bool all}) {
return wownero.Wallet_exportOutputs(walletPtr, filename, all: all);
}
-
+
@override
String exportOutputsUR({int max_fragment_length = 130, bool all = false}) {
throw UnimplementedError();
}
-
+
@override
String filename() {
return wownero.Wallet_filename(walletPtr);
}
-
+
@override
String genPaymentId() {
return wownero.Wallet_genPaymentId();
}
-
+
@override
int getBackgroundSyncType() {
return wownero.Wallet_getBackgroundSyncType(walletPtr);
}
-
+
@override
int getBytesReceived() {
return wownero.Wallet_getBytesReceived(walletPtr);
}
-
+
@override
int getBytesSent() {
throw UnimplementedError();
}
-
+
@override
String getCacheAttribute({required String key}) {
return wownero.Wallet_getCacheAttribute(walletPtr, key: key);
}
-
+
@override
int getDeviceType() {
return wownero.Wallet_getDeviceType(walletPtr);
}
-
+
@override
String getMultisigInfo() {
return wownero.Wallet_getMultisigInfo(walletPtr);
}
-
+
@override
String getPassword() {
return wownero.Wallet_getPassword(walletPtr);
}
-
+
@override
String getPolyseed({required String passphrase}) {
return wownero.Wallet_getPolyseed(walletPtr, passphrase: passphrase);
}
-
+
@override
Pointer<UnsignedChar> getReceivedFromDevice() {
throw UnimplementedError();
}
-
+
@override
int getReceivedFromDeviceLength() {
throw UnimplementedError();
}
-
+
@override
int getRefreshFromBlockHeight() {
return wownero.Wallet_getRefreshFromBlockHeight(walletPtr);
}
-
+
@override
String getSeedLanguage() {
return wownero.Wallet_getSeedLanguage(walletPtr);
}
-
+
@override
Pointer<UnsignedChar> getSendToDevice() {
throw UnimplementedError();
}
-
+
@override
int getSendToDeviceLength() {
throw UnimplementedError();
}
-
+
@override
bool getStateIsConnected() {
throw UnimplementedError();
}
-
+
@override
- String getSubaddressLabel({required int accountIndex, required int addressIndex}) {
- return wownero.Wallet_getSubaddressLabel(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex);
+ String getSubaddressLabel(
+ {required int accountIndex, required int addressIndex}) {
+ return wownero.Wallet_getSubaddressLabel(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex);
}
-
+
@override
String getTxKey({required String txid}) {
return wownero.Wallet_getTxKey(walletPtr, txid: txid);
}
-
+
@override
String getUserNote({required String txid}) {
return wownero.Wallet_getUserNote(walletPtr, txid: txid);
}
-
+
@override
bool getWaitsForDeviceReceive() {
throw UnimplementedError();
}
-
+
@override
bool getWaitsForDeviceSend() {
throw UnimplementedError();
}
-
+
@override
Wallet2WalletListener getWalletListener() {
final listener = wownero.WOWNERO_cw_getWalletListener(walletPtr);
return WowneroWalletListener(listener);
}
-
+
@override
int hasMultisigPartialKeyImages() {
throw UnimplementedError();
}
-
+
@override
bool hasUnknownKeyImages() {
return wownero.Wallet_hasUnknownKeyImages(walletPtr);
}
-
+
@override
Wallet2TransactionHistory history() {
return WowneroTransactionHistory(wownero.Wallet_history(walletPtr));
}
-
+
@override
bool importKeyImages(String filename) {
return wownero.Wallet_importKeyImages(walletPtr, filename);
}
-
+
@override
bool importKeyImagesUR(String input) {
throw UnimplementedError();
}
-
+
@override
int importMultisigImages({required List<String> info}) {
throw UnimplementedError();
}
-
+
@override
bool importOutputs(String filename) {
return wownero.Wallet_importOutputs(walletPtr, filename);
}
-
+
@override
bool importOutputsUR(String input) {
throw UnimplementedError();
}
-
+
@override
- bool init({required String daemonAddress, int upperTransacationSizeLimit = 0, String daemonUsername = "", String daemonPassword = "", bool useSsl = false, bool lightWallet = false, String proxyAddress = ""}) {
- return wownero.Wallet_init(walletPtr, daemonAddress: daemonAddress, upperTransacationSizeLimit: upperTransacationSizeLimit, daemonUsername: daemonUsername, daemonPassword: daemonPassword, useSsl: useSsl, lightWallet: lightWallet, proxyAddress: proxyAddress);
+ bool init(
+ {required String daemonAddress,
+ int upperTransacationSizeLimit = 0,
+ String daemonUsername = "",
+ String daemonPassword = "",
+ bool useSsl = false,
+ bool lightWallet = false,
+ String proxyAddress = ""}) {
+ return wownero.Wallet_init(walletPtr,
+ daemonAddress: daemonAddress,
+ upperTransacationSizeLimit: upperTransacationSizeLimit,
+ daemonUsername: daemonUsername,
+ daemonPassword: daemonPassword,
+ useSsl: useSsl,
+ lightWallet: lightWallet,
+ proxyAddress: proxyAddress);
}
-
+
@override
- void init3({required String argv0, required String defaultLogBaseName, required String logPath, required bool console}) {
- return wownero.Wallet_init3(walletPtr, argv0: argv0, defaultLogBaseName: defaultLogBaseName, logPath: logPath, console: console);
+ void init3(
+ {required String argv0,
+ required String defaultLogBaseName,
+ required String logPath,
+ required bool console}) {
+ return wownero.Wallet_init3(walletPtr,
+ argv0: argv0,
+ defaultLogBaseName: defaultLogBaseName,
+ logPath: logPath,
+ console: console);
}
-
+
@override
String integratedAddress({required String paymentId}) {
return wownero.Wallet_integratedAddress(walletPtr, paymentId: paymentId);
}
-
+
@override
bool isBackgroundSyncing() {
return wownero.Wallet_isBackgroundSyncing(walletPtr);
}
-
+
@override
bool isBackgroundWallet() {
return wownero.Wallet_isBackgroundWallet(walletPtr);
}
-
+
@override
bool isKeysFileLocked() {
return wownero.Wallet_isKeysFileLocked(walletPtr);
}
-
+
@override
bool isOffline() {
return wownero.Wallet_isOffline(walletPtr);
}
-
+
@override
void keyReuseMitigation2({required bool mitigation}) {
wownero.Wallet_keyReuseMitigation2(walletPtr, mitigation: mitigation);
}
-
+
@override
- bool keyValid({required String secret_key_string, required String address_string, required bool isViewKey, required int nettype}) {
- return wownero.Wallet_keyValid(secret_key_string: secret_key_string, address_string: address_string, isViewKey: isViewKey, nettype: nettype);
+ bool keyValid(
+ {required String secret_key_string,
+ required String address_string,
+ required bool isViewKey,
+ required int nettype}) {
+ return wownero.Wallet_keyValid(
+ secret_key_string: secret_key_string,
+ address_string: address_string,
+ isViewKey: isViewKey,
+ nettype: nettype);
}
-
+
@override
- String keyValid_error({required String secret_key_string, required String address_string, required bool isViewKey, required int nettype}) {
- return wownero.Wallet_keyValid_error(secret_key_string: secret_key_string, address_string: address_string, isViewKey: isViewKey, nettype: nettype);
+ String keyValid_error(
+ {required String secret_key_string,
+ required String address_string,
+ required bool isViewKey,
+ required int nettype}) {
+ return wownero.Wallet_keyValid_error(
+ secret_key_string: secret_key_string,
+ address_string: address_string,
+ isViewKey: isViewKey,
+ nettype: nettype);
}
-
+
@override
String keysFilename() {
return wownero.Wallet_keysFilename(walletPtr);
}
-
+
@override
- Wallet2UnsignedTransaction loadUnsignedTx({required String unsigned_filename}) {
- final tx = wownero.Wallet_loadUnsignedTx(walletPtr, unsigned_filename: unsigned_filename);
+ Wallet2UnsignedTransaction loadUnsignedTx(
+ {required String unsigned_filename}) {
+ final tx = wownero.Wallet_loadUnsignedTx(walletPtr,
+ unsigned_filename: unsigned_filename);
return WowneroUnsignedTransaction(tx);
}
-
+
@override
Wallet2UnsignedTransaction loadUnsignedTxUR({required String input}) {
throw UnimplementedError();
}
-
+
@override
bool lockKeysFile() {
return wownero.Wallet_lockKeysFile(walletPtr);
}
-
+
@override
String makeMultisig({required List<String> info, required int threshold}) {
throw UnimplementedError();
}
-
+
@override
int maximumAllowedAmount() {
return wownero.Wallet_maximumAllowedAmount();
}
-
+
@override
Wallet2MultisigState multisig() {
throw UnimplementedError();
}
-
+
@override
int nettype() {
return wownero.Wallet_nettype(walletPtr);
}
-
+
@override
int numSubaddressAccounts() {
return wownero.Wallet_numSubaddressAccounts(walletPtr);
}
-
+
@override
int numSubaddresses({required int accountIndex}) {
- return wownero.Wallet_numSubaddresses(walletPtr, accountIndex: accountIndex);
+ return wownero.Wallet_numSubaddresses(walletPtr,
+ accountIndex: accountIndex);
}
-
+
@override
String path() {
return wownero.Wallet_path(walletPtr);
}
-
+
@override
void pauseRefresh() {
wownero.Wallet_pauseRefresh(walletPtr);
}
-
+
@override
String paymentIdFromAddress({required String strarg, required int nettype}) {
- return wownero.Wallet_paymentIdFromAddress(nettype: nettype, strarg: strarg);
+ return wownero.Wallet_paymentIdFromAddress(
+ nettype: nettype, strarg: strarg);
}
-
+
@override
bool paymentIdValid(String paymentId) {
return wownero.Wallet_paymentIdValid(paymentId);
}
-
+
@override
String publicMultisigSignerKey() {
return wownero.Wallet_publicMultisigSignerKey(walletPtr);
}
-
+
@override
String publicSpendKey() {
return wownero.Wallet_publicSpendKey(walletPtr);
}
-
+
@override
String publicViewKey() {
return wownero.Wallet_publicViewKey(walletPtr);
}
-
+
@override
bool reconnectDevice() {
return wownero.Wallet_reconnectDevice(walletPtr);
}
-
+
@override
bool refresh() {
return wownero.Wallet_refresh(walletPtr);
}
-
+
@override
void refreshAsync() {
wownero.Wallet_refreshAsync(walletPtr);
}
-
+
@override
bool rescanBlockchain() {
return wownero.Wallet_rescanBlockchain(walletPtr);
}
-
+
@override
void rescanBlockchainAsync() {
wownero.Wallet_rescanBlockchainAsync(walletPtr);
}
-
+
@override
bool rescanSpent() {
return wownero.Wallet_rescanSpent(walletPtr);
}
-
+
@override
- Wallet2PendingTransaction restoreMultisigTransaction({required String signData}) {
+ Wallet2PendingTransaction restoreMultisigTransaction(
+ {required String signData}) {
throw UnimplementedError();
}
-
+
@override
String secretSpendKey() {
return wownero.Wallet_secretSpendKey(walletPtr);
}
-
+
@override
String secretViewKey() {
return wownero.Wallet_secretViewKey(walletPtr);
}
-
+
@override
String seed({required String seedOffset}) {
return wownero.Wallet_seed(walletPtr, seedOffset: seedOffset);
}
-
+
@override
void segregatePreForkOutputs({required bool segregate}) {
wownero.Wallet_segregatePreForkOutputs(walletPtr, segregate: segregate);
}
-
+
@override
void segregationHeight({required int height}) {
wownero.Wallet_segregationHeight(walletPtr, height: height);
}
-
+
@override
void setAutoRefreshInterval({required int millis}) {
wownero.Wallet_setAutoRefreshInterval(walletPtr, millis: millis);
}
-
+
@override
bool setCacheAttribute({required String key, required String value}) {
return wownero.Wallet_setCacheAttribute(walletPtr, key: key, value: value);
}
-
+
@override
void setDefaultMixin(int arg) {
wownero.Wallet_setDefaultMixin(walletPtr, arg);
}
-
+
@override
bool setDevicePin({required String passphrase}) {
return wownero.Wallet_setDevicePin(walletPtr, passphrase: passphrase);
}
-
+
@override
void setDeviceReceivedData(Pointer<UnsignedChar> data, int len) {
throw UnimplementedError();
}
-
+
@override
void setDeviceSendData(Pointer<UnsignedChar> data, int len) {
throw UnimplementedError();
}
-
+
@override
void setOffline({required bool offline}) {
wownero.Wallet_setOffline(walletPtr, offline: offline);
}
-
+
@override
bool setPassword({required String password}) {
return wownero.Wallet_setPassword(walletPtr, password: password);
}
-
+
@override
void setProxy({required String address}) {
wownero.Wallet_setProxy(walletPtr, address: address);
}
-
+
@override
void setRecoveringFromDevice({required bool recoveringFromDevice}) {
- wownero.Wallet_setRecoveringFromDevice(walletPtr, recoveringFromDevice: recoveringFromDevice);
+ wownero.Wallet_setRecoveringFromDevice(walletPtr,
+ recoveringFromDevice: recoveringFromDevice);
}
-
+
@override
void setRecoveringFromSeed({required bool recoveringFromSeed}) {
- wownero.Wallet_setRecoveringFromSeed(walletPtr, recoveringFromSeed: recoveringFromSeed);
+ wownero.Wallet_setRecoveringFromSeed(walletPtr,
+ recoveringFromSeed: recoveringFromSeed);
}
-
+
@override
void setRefreshFromBlockHeight({required int refresh_from_block_height}) {
- wownero.Wallet_setRefreshFromBlockHeight(walletPtr, refresh_from_block_height: refresh_from_block_height);
+ wownero.Wallet_setRefreshFromBlockHeight(walletPtr,
+ refresh_from_block_height: refresh_from_block_height);
}
-
+
@override
void setSeedLanguage({required String language}) {
wownero.Wallet_setSeedLanguage(walletPtr, language: language);
}
-
+
@override
- void setSubaddressLabel({required int accountIndex, required int addressIndex, required String label}) {
- wownero.Wallet_setSubaddressLabel(walletPtr, accountIndex: accountIndex, addressIndex: addressIndex, label: label);
+ void setSubaddressLabel(
+ {required int accountIndex,
+ required int addressIndex,
+ required String label}) {
+ wownero.Wallet_setSubaddressLabel(walletPtr,
+ accountIndex: accountIndex, addressIndex: addressIndex, label: label);
}
-
+
@override
void setSubaddressLookahead({required int major, required int minor}) {
- wownero.Wallet_setSubaddressLookahead(walletPtr, major: major, minor: minor);
+ wownero.Wallet_setSubaddressLookahead(walletPtr,
+ major: major, minor: minor);
}
-
+
@override
void setTrustedDaemon({required bool arg}) {
wownero.Wallet_setTrustedDaemon(walletPtr, arg: arg);
}
-
+
@override
bool setUserNote({required String txid, required String note}) {
return wownero.Wallet_setUserNote(walletPtr, txid: txid, note: note);
}
-
+
@override
- bool setupBackgroundSync({required int backgroundSyncType, required String walletPassword, required String backgroundCachePassword}) {
- return wownero.Wallet_setupBackgroundSync(walletPtr, backgroundSyncType: backgroundSyncType, walletPassword: walletPassword, backgroundCachePassword: backgroundCachePassword);
+ bool setupBackgroundSync(
+ {required int backgroundSyncType,
+ required String walletPassword,
+ required String backgroundCachePassword}) {
+ return wownero.Wallet_setupBackgroundSync(walletPtr,
+ backgroundSyncType: backgroundSyncType,
+ walletPassword: walletPassword,
+ backgroundCachePassword: backgroundCachePassword);
}
-
+
@override
String signMessage({required String message, required String address}) {
- return wownero.Wallet_signMessage(walletPtr, message: message, address: address);
+ return wownero.Wallet_signMessage(walletPtr,
+ message: message, address: address);
}
-
+
@override
bool startBackgroundSync() {
return wownero.Wallet_startBackgroundSync(walletPtr);
}
-
+
@override
void startRefresh() {
wownero.Wallet_startRefresh(walletPtr);
}
-
+
@override
int status() {
return wownero.Wallet_status(walletPtr);
}
-
+
@override
void stop() {
wownero.Wallet_stop(walletPtr);
}
-
+
@override
bool stopBackgroundSync(String walletPassword) {
return wownero.Wallet_stopBackgroundSync(walletPtr, walletPassword);
}
-
+
@override
bool store({String path = ""}) {
return wownero.Wallet_store(walletPtr, path: path);
}
-
+
@override
Wallet2Subaddress subaddress() {
return WowneroSubaddress(wownero.Wallet_subaddress(walletPtr));
}
-
+
@override
Wallet2SubaddressAccount subaddressAccount() {
- return WowneroSubaddressAccount(wownero.Wallet_subaddressAccount(walletPtr));
+ return WowneroSubaddressAccount(
+ wownero.Wallet_subaddressAccount(walletPtr));
}
-
+
@override
bool submitTransaction(String filename) {
return wownero.Wallet_submitTransaction(walletPtr, filename);
}
-
+
@override
bool submitTransactionUR(String input) {
throw UnimplementedError();
}
-
+
@override
bool synchronized() {
return wownero.Wallet_synchronized(walletPtr);
}
-
+
@override
bool trustedDaemon() {
return wownero.Wallet_trustedDaemon(walletPtr);
}
-
+
@override
bool unlockKeysFile() {
return wownero.Wallet_unlockKeysFile(walletPtr);
}
-
+
@override
int unlockedBalance({required int accountIndex}) {
- return wownero.Wallet_unlockedBalance(walletPtr, accountIndex: accountIndex);
+ return wownero.Wallet_unlockedBalance(walletPtr,
+ accountIndex: accountIndex);
}
-
+
@override
int useForkRules({required int version, required int earlyBlocks}) {
- return wownero.Wallet_useForkRules(walletPtr, version: version, earlyBlocks: earlyBlocks);
+ return wownero.Wallet_useForkRules(walletPtr,
+ version: version, earlyBlocks: earlyBlocks);
}
-
+
@override
- bool verifySignedMessage({required String message, required String address, required String signature}) {
- return wownero.Wallet_verifySignedMessage(walletPtr, message: message, address: address, signature: signature);
+ bool verifySignedMessage(
+ {required String message,
+ required String address,
+ required String signature}) {
+ return wownero.Wallet_verifySignedMessage(walletPtr,
+ message: message, address: address, signature: signature);
}
-
+
@override
int viewOnlyBalance({required int accountIndex}) {
- return wownero.Wallet_viewOnlyBalance(walletPtr, accountIndex: accountIndex);
+ return wownero.Wallet_viewOnlyBalance(walletPtr,
+ accountIndex: accountIndex);
}
-
+
@override
bool watchOnly() {
return wownero.Wallet_watchOnly(walletPtr);
@@ -1528,131 +1675,234 @@ class WowneroWalletManager implements Wallet2WalletManager {
WowneroWalletManager(this.wmPtr);
final wownero.WalletManager wmPtr;
-
+
@override
Future<int> blockTarget() async {
return wownero.WalletManager_blockTarget(wmPtr);
}
-
+
@override
Future<int> blockchainHeight() async {
return wownero.WalletManager_blockchainHeight(wmPtr);
}
-
+
@override
Future<int> blockchainTargetHeight() async {
return wownero.WalletManager_blockchainTargetHeight(wmPtr);
}
-
+
@override
- Wallet2Wallet createDeterministicWalletFromSpendKey({required String path, required String password, String language = "English", int networkType = 0, required String spendKeyString, required bool newWallet, required int restoreHeight, int kdfRounds = 1}) {
- final wallet = wownero.WalletManager_createDeterministicWalletFromSpendKey(wmPtr, path: path, password: password, language: language, networkType: networkType, spendKeyString: spendKeyString, newWallet: newWallet, restoreHeight: restoreHeight, kdfRounds: kdfRounds);
+ Wallet2Wallet createDeterministicWalletFromSpendKey(
+ {required String path,
+ required String password,
+ String language = "English",
+ int networkType = 0,
+ required String spendKeyString,
+ required bool newWallet,
+ required int restoreHeight,
+ int kdfRounds = 1}) {
+ final wallet = wownero.WalletManager_createDeterministicWalletFromSpendKey(
+ wmPtr,
+ path: path,
+ password: password,
+ language: language,
+ networkType: networkType,
+ spendKeyString: spendKeyString,
+ newWallet: newWallet,
+ restoreHeight: restoreHeight,
+ kdfRounds: kdfRounds);
return WowneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWallet({required String path, required String password, String language = "English", int networkType = 0}) {
- final wallet = wownero.WalletManager_createWallet(wmPtr, path: path, password: password, language: language, networkType: networkType);
+ Wallet2Wallet createWallet(
+ {required String path,
+ required String password,
+ String language = "English",
+ int networkType = 0}) {
+ final wallet = wownero.WalletManager_createWallet(wmPtr,
+ path: path,
+ password: password,
+ language: language,
+ networkType: networkType);
return WowneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWalletFromDevice({required String path, required String password, int networkType = 0, required String deviceName, int restoreHeight = 0, String subaddressLookahead = "", int kdfRounds = 1}) {
+ Wallet2Wallet createWalletFromDevice(
+ {required String path,
+ required String password,
+ int networkType = 0,
+ required String deviceName,
+ int restoreHeight = 0,
+ String subaddressLookahead = "",
+ int kdfRounds = 1}) {
throw UnimplementedError();
}
-
+
@override
- Wallet2Wallet createWalletFromKeys({required String path, required String password, String language = "English", int nettype = 1, required int restoreHeight, required String addressString, required String viewKeyString, required String spendKeyString, int kdf_rounds = 1}) {
- final wallet = wownero.WalletManager_createWalletFromKeys(wmPtr, path: path, password: password, language: language, nettype: nettype, restoreHeight: restoreHeight, addressString: addressString, viewKeyString: viewKeyString, spendKeyString: spendKeyString);
+ Wallet2Wallet createWalletFromKeys(
+ {required String path,
+ required String password,
+ String language = "English",
+ int nettype = 1,
+ required int restoreHeight,
+ required String addressString,
+ required String viewKeyString,
+ required String spendKeyString,
+ int kdf_rounds = 1}) {
+ final wallet = wownero.WalletManager_createWalletFromKeys(wmPtr,
+ path: path,
+ password: password,
+ language: language,
+ nettype: nettype,
+ restoreHeight: restoreHeight,
+ addressString: addressString,
+ viewKeyString: viewKeyString,
+ spendKeyString: spendKeyString);
return WowneroWallet(wallet);
}
-
+
@override
- Wallet2Wallet createWalletFromPolyseed({required String path, required String password, int networkType = 0, required String mnemonic, required String seedOffset, required bool newWallet, required int restoreHeight, required int kdfRounds}) {
- final wallet = wownero.WalletManager_createWalletFromPolyseed(wmPtr, path: path, password: password, networkType: networkType, mnemonic: mnemonic, seedOffset: seedOffset, newWallet: newWallet, restoreHeight: restoreHeight, kdfRounds: kdfRounds);
+ Wallet2Wallet createWalletFromPolyseed(
+ {required String path,
+ required String password,
+ int networkType = 0,
+ required String mnemonic,
+ required String seedOffset,
+ required bool newWallet,
+ required int restoreHeight,
+ required int kdfRounds}) {
+ final wallet = wownero.WalletManager_createWalletFromPolyseed(wmPtr,
+ path: path,
+ password: password,
+ networkType: networkType,
+ mnemonic: mnemonic,
+ seedOffset: seedOffset,
+ newWallet: newWallet,
+ restoreHeight: restoreHeight,
+ kdfRounds: kdfRounds);
return WowneroWallet(wallet);
}
-
+
@override
String errorString() {
return wownero.WalletManager_errorString(wmPtr);
}
-
+
@override
List<String> findWallets({required String path}) {
return wownero.WalletManager_findWallets(wmPtr, path: path);
}
-
+
@override
bool isMining() {
return wownero.WalletManager_isMining(wmPtr);
}
-
+
@override
double miningHashRate() {
return wownero.WalletManager_miningHashRate(wmPtr);
}
-
+
@override
int networkDifficulty() {
return wownero.WalletManager_networkDifficulty(wmPtr);
}
-
+
@override
- Wallet2Wallet openWallet({required String path, required String password, int networkType = 0}) {
- final wallet = wownero.WalletManager_openWallet(wmPtr, path: path, password: password, networkType: networkType);
+ Wallet2Wallet openWallet(
+ {required String path, required String password, int networkType = 0}) {
+ final wallet = wownero.WalletManager_openWallet(wmPtr,
+ path: path, password: password, networkType: networkType);
return WowneroWallet(wallet);
}
-
+
@override
- int queryWalletDevice({required String keysFileName, required String password, required int kdfRounds}) {
+ int queryWalletDevice(
+ {required String keysFileName,
+ required String password,
+ required int kdfRounds}) {
throw UnimplementedError();
}
-
+
@override
- Wallet2Wallet recoveryWallet({required String path, required String password, required String mnemonic, int networkType = 0, required int restoreHeight, int kdfRounds = 0, required String seedOffset}) {
- final wallet = wownero.WalletManager_recoveryWallet(wmPtr, path: path, password: password, mnemonic: mnemonic, networkType: networkType, restoreHeight: restoreHeight, kdfRounds: kdfRounds, seedOffset: seedOffset);
+ Wallet2Wallet recoveryWallet(
+ {required String path,
+ required String password,
+ required String mnemonic,
+ int networkType = 0,
+ required int restoreHeight,
+ int kdfRounds = 0,
+ required String seedOffset}) {
+ final wallet = wownero.WalletManager_recoveryWallet(wmPtr,
+ path: path,
+ password: password,
+ mnemonic: mnemonic,
+ networkType: networkType,
+ restoreHeight: restoreHeight,
+ kdfRounds: kdfRounds,
+ seedOffset: seedOffset);
return WowneroWallet(wallet);
}
-
+
@override
- String resolveOpenAlias({required String address, required bool dnssecValid}) {
- return wownero.WalletManager_resolveOpenAlias(wmPtr, address: address, dnssecValid: dnssecValid);
+ String resolveOpenAlias(
+ {required String address, required bool dnssecValid}) {
+ return wownero.WalletManager_resolveOpenAlias(wmPtr,
+ address: address, dnssecValid: dnssecValid);
}
-
+
@override
void setDaemonAddress(String address) {
wownero.WalletManager_setDaemonAddress(wmPtr, address);
}
-
+
@override
bool setProxy(String address) {
return wownero.WalletManager_setProxy(wmPtr, address);
}
-
+
@override
- bool startMining({required String address, required int threads, required bool backgroundMining, required bool ignoreBattery}) {
- return wownero.WalletManager_startMining(wmPtr, address: address, threads: threads, backgroundMining: backgroundMining, ignoreBattery: ignoreBattery);
+ bool startMining(
+ {required String address,
+ required int threads,
+ required bool backgroundMining,
+ required bool ignoreBattery}) {
+ return wownero.WalletManager_startMining(wmPtr,
+ address: address,
+ threads: threads,
+ backgroundMining: backgroundMining,
+ ignoreBattery: ignoreBattery);
}
-
+
@override
bool stopMining(String address) {
return wownero.WalletManager_stopMining(wmPtr, address);
}
-
+
@override
- bool verifyWalletPassword({required String keysFileName, required String password, required bool noSpendKey, required int kdfRounds}) {
- return wownero.WalletManager_verifyWalletPassword(wmPtr, keysFileName: keysFileName, password: password, noSpendKey: noSpendKey, kdfRounds: kdfRounds);
+ bool verifyWalletPassword(
+ {required String keysFileName,
+ required String password,
+ required bool noSpendKey,
+ required int kdfRounds}) {
+ return wownero.WalletManager_verifyWalletPassword(wmPtr,
+ keysFileName: keysFileName,
+ password: password,
+ noSpendKey: noSpendKey,
+ kdfRounds: kdfRounds);
}
-
+
@override
bool walletExists(String path) {
return wownero.WalletManager_walletExists(wmPtr, path);
}
-
+
@override
void closeWallet(Wallet2Wallet wallet, bool store) {
- wownero.WalletManager_closeWallet(wmPtr, Pointer.fromAddress(wallet.ffiAddress()), store);
+ wownero.WalletManager_closeWallet(
+ wmPtr, Pointer.fromAddress(wallet.ffiAddress()), store);
}
@override
@@ -1662,7 +1912,8 @@ class WowneroWalletManager implements Wallet2WalletManager {
class WowneroWalletManagerFactory implements Wallet2WalletManagerFactory {
@override
Wallet2WalletManager getWalletManager() {
- return WowneroWalletManager(wownero.WalletManagerFactory_getWalletManager());
+ return WowneroWalletManager(
+ wownero.WalletManagerFactory_getWalletManager());
}
@override
diff --git a/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.cpp b/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.cpp
index db56643..e41b20b 100644
--- a/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.cpp
+++ b/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.cpp
@@ -101,6 +101,23 @@ const char* MONERO_PendingTransaction_commitUR(void* pendingTx_ptr, int max_frag
return strdup(str.c_str());
DEBUG_END()
}
+
+const char* MONERO_PendingTransaction_commitTrezor(void* pendingTx_ptr, int tx_index) {
+ DEBUG_START()
+ Monero::PendingTransaction *pendingTx = reinterpret_cast<Monero::PendingTransaction*>(pendingTx_ptr);
+ std::string str = pendingTx->commitTrezor(tx_index);
+ return strdup(str.c_str());
+ DEBUG_END()
+}
+
+bool MONERO_PendingTransaction_commitTrezorNext(void* pendingTx_ptr, const char* response_json, int tx_index) {
+ DEBUG_START()
+ Monero::PendingTransaction *pendingTx = reinterpret_cast<Monero::PendingTransaction*>(pendingTx_ptr);
+ bool success = pendingTx->commitTrezorNext(std::string(response_json), tx_index);
+ return success;
+ DEBUG_END()
+}
+
uint64_t MONERO_PendingTransaction_amount(void* pendingTx_ptr) {
DEBUG_START()
Monero::PendingTransaction *pendingTx = reinterpret_cast<Monero::PendingTransaction*>(pendingTx_ptr);
@@ -264,6 +281,7 @@ const char* MONERO_UnsignedTransaction_signUR(void* unsignedTx_ptr, int max_frag
return strdup(str.c_str());
DEBUG_END()
}
+
// TransactionInfo
const int MONERO_TransactionInfoDirection_In = 0;
diff --git a/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.h b/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.h
index f3cfdee..4b4c8ad 100644
--- a/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.h
+++ b/monero_libwallet2_api_c/src/main/cpp/monero_wallet2_api_c.h
@@ -84,6 +84,8 @@ extern ADDAPI const char* MONERO_PendingTransaction_errorString(void* pendingTx_
// virtual bool commit(const std::string &filename = "", bool overwrite = false) = 0;
extern ADDAPI bool MONERO_PendingTransaction_commit(void* pendingTx_ptr, const char* filename, bool overwrite);
extern ADDAPI const char* MONERO_PendingTransaction_commitUR(void* pendingTx_ptr, int max_fragment_length);
+extern ADDAPI const char* MONERO_PendingTransaction_commitTrezor(void* pendingTx_ptr, int tx_index);
+extern ADDAPI bool MONERO_PendingTransaction_commitTrezorNext(void* pendingTx_ptr, const char* response_json, int tx_index);
// virtual uint64_t amount() const = 0;
extern ADDAPI uint64_t MONERO_PendingTransaction_amount(void* pendingTx_ptr);
// virtual uint64_t dust() const = 0;
diff --git a/patches/monero/0021-trezor-import-export-sign-functions.patch b/patches/monero/0021-trezor-import-export-sign-functions.patch
new file mode 100644
index 0000000..b9b76b5
--- /dev/null
+++ b/patches/monero/0021-trezor-import-export-sign-functions.patch
@@ -0,0 +1,1115 @@
+From fc7c14b26225627c74b23467bb442247ca35d010 Mon Sep 17 00:00:00 2001
+From: Czarek Nakamoto <cyjan@mrcyjanek.net>
+Date: Mon, 18 May 2026 08:48:12 -0400
+Subject: [PATCH] trezor import export sign broadcast functions
+
+---
+ cmake/CheckTrezor.cmake | 28 +-
+ src/device_trezor/trezor/protocol.cpp | 453 ++++++++++++++++++++++++
+ src/device_trezor/trezor/protocol.hpp | 27 ++
+ src/wallet/api/pending_transaction.cpp | 143 ++++++++
+ src/wallet/api/pending_transaction.h | 18 +
+ src/wallet/api/unsigned_transaction.cpp | 2 +
+ src/wallet/api/wallet.cpp | 31 +-
+ src/wallet/api/wallet.h | 2 +
+ src/wallet/api/wallet2_api.h | 15 +
+ src/wallet/wallet2.cpp | 158 +++++++++
+ src/wallet/wallet2.h | 5 +-
+ 11 files changed, 853 insertions(+), 29 deletions(-)
+
+diff --git a/cmake/CheckTrezor.cmake b/cmake/CheckTrezor.cmake
+index 4fae15fad..57e3d4866 100644
+--- a/cmake/CheckTrezor.cmake
++++ b/cmake/CheckTrezor.cmake
+@@ -40,9 +40,6 @@ if (USE_DEVICE_TREZOR)
+ # Protobuf handling the cache variables set in docker.
+ if(NOT Protobuf_FOUND AND NOT Protobuf_LIBRARY AND NOT Protobuf_PROTOC_EXECUTABLE AND NOT Protobuf_INCLUDE_DIR)
+ message(STATUS "Could not find Protobuf")
+- elseif(NOT Protobuf_LIBRARY OR NOT EXISTS "${Protobuf_LIBRARY}")
+- message(STATUS "Protobuf library not found: ${Protobuf_LIBRARY}")
+- unset(Protobuf_FOUND)
+ elseif(NOT Protobuf_PROTOC_EXECUTABLE OR NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
+ message(STATUS "Protobuf executable not found: ${Protobuf_PROTOC_EXECUTABLE}")
+ unset(Protobuf_FOUND)
+@@ -93,31 +90,8 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR)
+ endif()
+ endif()
+
+-# Protobuf compilation test
+-if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
+- execute_process(COMMAND ${Protobuf_PROTOC_EXECUTABLE} -I "${CMAKE_CURRENT_LIST_DIR}" -I "${Protobuf_INCLUDE_DIR}" "${CMAKE_CURRENT_LIST_DIR}/test-protobuf.proto" --cpp_out ${CMAKE_BINARY_DIR} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
+- if(RET)
+- message(STATUS "Protobuf test generation failed: ${OUT} ${ERR}")
+- endif()
+-
+- try_compile(Protobuf_COMPILE_TEST_PASSED
+- "${CMAKE_BINARY_DIR}"
+- SOURCES
+- "${CMAKE_BINARY_DIR}/test-protobuf.pb.cc"
+- "${CMAKE_CURRENT_LIST_DIR}/test-protobuf.cpp"
+- CMAKE_FLAGS
+- "-DINCLUDE_DIRECTORIES=${Protobuf_INCLUDE_DIR};${CMAKE_BINARY_DIR}"
+- "-DCMAKE_CXX_STANDARD=11"
+- LINK_LIBRARIES ${Protobuf_LIBRARY}
+- OUTPUT_VARIABLE OUTPUT
+- )
+- if(NOT Protobuf_COMPILE_TEST_PASSED)
+- message(STATUS "Protobuf Compilation test failed: ${OUTPUT}.")
+- endif()
+-endif()
+-
+ # Try to build protobuf messages
+-if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_TEST_PASSED)
++if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
+ set(ENV{PROTOBUF_INCLUDE_DIRS} "${Protobuf_INCLUDE_DIR}")
+ set(ENV{PROTOBUF_PROTOC_EXECUTABLE} "${Protobuf_PROTOC_EXECUTABLE}")
+ set(TREZOR_PROTOBUF_PARAMS "")
+diff --git a/src/device_trezor/trezor/protocol.cpp b/src/device_trezor/trezor/protocol.cpp
+index 0e59a16ba..acbc5ac76 100644
+--- a/src/device_trezor/trezor/protocol.cpp
++++ b/src/device_trezor/trezor/protocol.cpp
+@@ -29,12 +29,19 @@
+
+ #include "version.h"
+ #include "protocol.hpp"
++#include "string_tools.h"
++#include "cryptonote_basic/cryptonote_format_utils.h"
++#include <boost/lexical_cast.hpp>
+ #include <unordered_map>
+ #include <set>
++#include <sstream>
+ #include <utility>
+ #include <boost/endian/conversion.hpp>
+ #include <common/apply_permutation.h>
+ #include <common/json_util.h>
++#include <rapidjson/document.h>
++#include <rapidjson/stringbuffer.h>
++#include <rapidjson/writer.h>
+ #include <crypto/hmac-keccak.h>
+ #include <ringct/rctSigs.h>
+ #include <ringct/bulletproofs.h>
+@@ -450,6 +457,10 @@ namespace tx {
+ }
+ }
+
++ void Signer::export_source_entry(MoneroTransactionSourceEntry *dst, size_t idx, bool need_ring_keys, bool need_ring_indices){
++ set_tx_input(dst, idx, need_ring_keys, need_ring_indices);
++ }
++
+ void Signer::set_tx_input(MoneroTransactionSourceEntry * dst, size_t idx, bool need_ring_keys, bool need_ring_indices){
+ const cryptonote::tx_source_entry & src = cur_tx().sources[idx];
+ const tools::wallet2::transfer_details & transfer = get_source_transfer(idx);
+@@ -1096,6 +1107,448 @@ namespace tx {
+ memwipe(plaintext.get(), keys_len);
+ }
+
++ namespace {
++
++ std::string bin_to_hex_lower(const std::string &bin)
++ {
++ return epee::string_tools::buff_to_hex_nodelimer(bin);
++ }
++
++ rapidjson::Value dest_entry_to_json(const messages::monero::MoneroTransactionDestinationEntry &e, rapidjson::Document::AllocatorType &a)
++ {
++ rapidjson::Value o(rapidjson::kObjectType);
++ if (e.has_amount())
++ o.AddMember("amount", e.amount(), a);
++ if (e.has_addr())
++ {
++ rapidjson::Value addr(rapidjson::kObjectType);
++ const auto &ad = e.addr();
++ if (ad.has_spend_public_key())
++ {
++ const std::string h = bin_to_hex_lower(ad.spend_public_key());
++ addr.AddMember("spend_public_key", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ if (ad.has_view_public_key())
++ {
++ const std::string h = bin_to_hex_lower(ad.view_public_key());
++ addr.AddMember("view_public_key", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ o.AddMember("addr", addr, a);
++ }
++ if (e.has_is_subaddress())
++ o.AddMember("is_subaddress", e.is_subaddress(), a);
++ if (e.has_original())
++ o.AddMember("original", rapidjson::Value(e.original().c_str(), static_cast<rapidjson::SizeType>(e.original().size()), a), a);
++ if (e.has_is_integrated())
++ o.AddMember("is_integrated", e.is_integrated(), a);
++ return o;
++ }
++
++ rapidjson::Value source_entry_to_json(const messages::monero::MoneroTransactionSourceEntry &e, rapidjson::Document::AllocatorType &a)
++ {
++ rapidjson::Value o(rapidjson::kObjectType);
++ rapidjson::Value ring(rapidjson::kArrayType);
++ for (int i = 0; i < e.outputs_size(); ++i)
++ {
++ const auto &out = e.outputs(i);
++ rapidjson::Value ring_m(rapidjson::kObjectType);
++ if (out.has_idx())
++ ring_m.AddMember("idx", out.idx(), a);
++ if (out.has_key())
++ {
++ rapidjson::Value key(rapidjson::kObjectType);
++ const auto &k = out.key();
++ if (k.has_dest())
++ {
++ const std::string h = bin_to_hex_lower(k.dest());
++ key.AddMember("dest", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ if (k.has_commitment())
++ {
++ const std::string h = bin_to_hex_lower(k.commitment());
++ key.AddMember("commitment", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ ring_m.AddMember("key", key, a);
++ }
++ ring.PushBack(ring_m, a);
++ }
++ o.AddMember("outputs", ring, a);
++ if (e.has_real_output())
++ o.AddMember("real_output", e.real_output(), a);
++ if (e.has_real_out_tx_key())
++ {
++ const std::string h = bin_to_hex_lower(e.real_out_tx_key());
++ o.AddMember("real_out_tx_key", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ rapidjson::Value add_keys(rapidjson::kArrayType);
++ for (int i = 0; i < e.real_out_additional_tx_keys_size(); ++i)
++ {
++ const std::string h = bin_to_hex_lower(e.real_out_additional_tx_keys(i));
++ add_keys.PushBack(rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ o.AddMember("real_out_additional_tx_keys", add_keys, a);
++ if (e.has_real_output_in_tx_index())
++ o.AddMember("real_output_in_tx_index", e.real_output_in_tx_index(), a);
++ if (e.has_amount())
++ o.AddMember("amount", e.amount(), a);
++ if (e.has_rct())
++ o.AddMember("rct", e.rct(), a);
++ if (e.has_mask())
++ {
++ const std::string h = bin_to_hex_lower(e.mask());
++ o.AddMember("mask", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), a), a);
++ }
++ if (e.has_subaddr_minor())
++ o.AddMember("subaddr_minor", e.subaddr_minor(), a);
++ return o;
++ }
++
++ std::string monero_default_bip44_path(uint32_t subaddr_account)
++ {
++ std::ostringstream oss;
++ oss << "m/44'/128'/" << subaddr_account << "'";
++ return oss.str();
++ }
++
++ } // namespace
++
++
++ std::string trezor_connect_monero_sign_transaction_to_json(
++ wallet_shim *wallet,
++ const unsigned_tx_set *utx,
++ size_t tx_idx,
++ hw::tx_aux_data *aux_data,
++ cryptonote::network_type network_type)
++ {
++ CHECK_AND_ASSERT_THROW_MES(utx && aux_data, "null argument");
++ CHECK_AND_ASSERT_THROW_MES(std::get<0>(utx->transfers) == 0, "Unsupported non zero offset");
++ CHECK_AND_ASSERT_THROW_MES(tx_idx < utx->txes.size(), "Invalid transaction index");
++
++ Signer signer(wallet, utx, tx_idx, aux_data);
++ auto init_req = signer.step_init();
++ const auto &tsx = init_req->tsx_data();
++
++ rapidjson::Document doc;
++ doc.SetObject();
++ auto &alloc = doc.GetAllocator();
++
++ const std::string path_str = monero_default_bip44_path(utx->txes[tx_idx].subaddr_account);
++ doc.AddMember("path", rapidjson::Value(path_str.c_str(), static_cast<rapidjson::SizeType>(path_str.size()), alloc), alloc);
++ doc.AddMember("networkType", static_cast<uint32_t>(network_type), alloc);
++
++ rapidjson::Value tsx_data(rapidjson::kObjectType);
++ tsx_data.AddMember("version", tsx.version(), alloc);
++ if (tsx.has_payment_id() && !tsx.payment_id().empty())
++ {
++ const std::string h = bin_to_hex_lower(tsx.payment_id());
++ tsx_data.AddMember("payment_id", rapidjson::Value(h.c_str(), static_cast<rapidjson::SizeType>(h.size()), alloc), alloc);
++ }
++ tsx_data.AddMember("unlock_time", static_cast<uint64_t>(tsx.unlock_time()), alloc);
++
++ rapidjson::Value outputs(rapidjson::kArrayType);
++ for (int i = 0; i < tsx.outputs_size(); ++i)
++ outputs.PushBack(dest_entry_to_json(tsx.outputs(i), alloc), alloc);
++ tsx_data.AddMember("outputs", outputs, alloc);
++
++ if (tsx.has_change_dts())
++ tsx_data.AddMember("change_dts", dest_entry_to_json(tsx.change_dts(), alloc), alloc);
++
++ if (tsx.has_num_inputs())
++ tsx_data.AddMember("num_inputs", tsx.num_inputs(), alloc);
++ if (tsx.has_mixin())
++ tsx_data.AddMember("mixin", tsx.mixin(), alloc);
++ if (tsx.has_fee())
++ tsx_data.AddMember("fee", tsx.fee(), alloc);
++ if (tsx.has_account())
++ tsx_data.AddMember("account", tsx.account(), alloc);
++
++ if (tsx.minor_indices_size() > 0)
++ {
++ rapidjson::Value minors(rapidjson::kArrayType);
++ for (int i = 0; i < tsx.minor_indices_size(); ++i)
++ minors.PushBack(tsx.minor_indices(i), alloc);
++ tsx_data.AddMember("minor_indices", minors, alloc);
++ }
++
++ if (tsx.has_rsig_data())
++ {
++ const auto &rd = tsx.rsig_data();
++ rapidjson::Value rj(rapidjson::kObjectType);
++ if (rd.has_rsig_type())
++ rj.AddMember("rsig_type", rd.rsig_type(), alloc);
++ if (rd.has_bp_version())
++ rj.AddMember("bp_version", rd.bp_version(), alloc);
++ rapidjson::Value grp(rapidjson::kArrayType);
++ for (int i = 0; i < rd.grouping_size(); ++i)
++ grp.PushBack(static_cast<uint64_t>(rd.grouping(i)), alloc);
++ rj.AddMember("grouping", grp, alloc);
++ tsx_data.AddMember("rsig_data", rj, alloc);
++ }
++
++ if (tsx.integrated_indices_size() > 0)
++ {
++ rapidjson::Value ii(rapidjson::kArrayType);
++ for (int i = 0; i < tsx.integrated_indices_size(); ++i)
++ ii.PushBack(tsx.integrated_indices(i), alloc);
++ tsx_data.AddMember("integrated_indices", ii, alloc);
++ }
++
++ if (tsx.has_client_version())
++ tsx_data.AddMember("client_version", tsx.client_version(), alloc);
++ if (tsx.has_hard_fork())
++ tsx_data.AddMember("hard_fork", tsx.hard_fork(), alloc);
++ if (tsx.has_monero_version())
++ tsx_data.AddMember("monero_version", rapidjson::Value(tsx.monero_version().c_str(), static_cast<rapidjson::SizeType>(tsx.monero_version().size()), alloc), alloc);
++
++ doc.AddMember("tsx_data", tsx_data, alloc);
++
++ rapidjson::Value inputs(rapidjson::kArrayType);
++ const size_t n_in = utx->txes[tx_idx].sources.size();
++ for (size_t i = 0; i < n_in; ++i)
++ {
++ messages::monero::MoneroTransactionSourceEntry src_pb;
++ signer.export_source_entry(&src_pb, i, true, true);
++ inputs.PushBack(source_entry_to_json(src_pb, alloc), alloc);
++ }
++ doc.AddMember("inputs", inputs, alloc);
++
++ rapidjson::StringBuffer buffer;
++ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
++ doc.Accept(writer);
++ return std::string(buffer.GetString(), buffer.GetSize());
++ }
++
++ namespace {
++
++ std::string hex_to_bin(const std::string &hex)
++ {
++ std::string stripped = hex;
++ if (stripped.size() >= 2 && stripped[0] == '0' && (stripped[1] == 'x' || stripped[1] == 'X'))
++ stripped = stripped.substr(2);
++ std::string bin;
++ if (!epee::string_tools::parse_hexstr_to_binbuff(stripped, bin))
++ throw std::invalid_argument("Invalid hex string");
++ return bin;
++ }
++
++ const rapidjson::Value & parse_connect_response(const std::string &response_json, rapidjson::Document &doc)
++ {
++ if (doc.Parse(response_json.c_str()).HasParseError())
++ throw std::invalid_argument("Trezor Connect response: JSON parse error");
++ if (!doc.IsObject())
++ throw std::invalid_argument("Trezor Connect response: expected JSON object");
++
++ if (doc.HasMember("payload") && doc["payload"].IsObject()) {
++ if (doc.HasMember("success") && doc["success"].IsBool() && !doc["success"].GetBool())
++ throw std::invalid_argument("Trezor Connect response: success is false");
++ return doc["payload"];
++ }
++
++ return doc;
++ }
++
++ std::string get_hex_field(const rapidjson::Value &obj, const char *name, bool required = true)
++ {
++ if (!obj.HasMember(name) || !obj[name].IsString()) {
++ if (required)
++ throw std::invalid_argument(std::string("Trezor Connect response: missing field ") + name);
++ return {};
++ }
++ return hex_to_bin(std::string(obj[name].GetString(), obj[name].GetStringLength()));
++ }
++
++ const rapidjson::Value * get_array_field(const rapidjson::Value &obj, const char *name)
++ {
++ if (!obj.HasMember(name) || !obj[name].IsArray())
++ return nullptr;
++ return &obj[name];
++ }
++
++ void prepare_connect_signing_state(
++ Signer &signer,
++ const rapidjson::Value &payload,
++ const cryptonote::transaction &prefix_tx)
++ {
++ TData &ct = signer.tdata();
++ signer.step_init();
++ ct.tx = prefix_tx;
++
++ CHECK_AND_ASSERT_THROW_MES(
++ payload.HasMember("tx_prefix_hash") && payload["tx_prefix_hash"].IsString(),
++ "Trezor Connect response: missing tx_prefix_hash");
++
++ ::crypto::hash computed{};
++ cryptonote::get_transaction_prefix_hash(ct.tx, computed);
++ const std::string expected = hex_to_bin(
++ std::string(payload["tx_prefix_hash"].GetString(), payload["tx_prefix_hash"].GetStringLength()));
++ if (expected.size() != sizeof(computed) ||
++ crypto_verify_32(
++ reinterpret_cast<const unsigned char *>(computed.data),
++ reinterpret_cast<const unsigned char *>(expected.data()))) {
++ throw exc::proto::SecurityException("Transaction prefix hash does not match");
++ }
++
++ ct.tx_prefix_hash = expected;
++
++ ct.rv = std::make_shared<rct::rctSig>();
++ if (prefix_tx.version > 1) {
++ const auto &src_rct = prefix_tx.rct_signatures;
++ ct.rv->type = src_rct.type;
++ ct.rv->txnFee = src_rct.txnFee;
++ ct.rv->message = src_rct.message;
++ ct.rv->outPk = src_rct.outPk;
++ ct.rv->ecdhInfo = src_rct.ecdhInfo;
++ if (rct::is_rct_bulletproof_plus(src_rct.type))
++ ct.rv->p.bulletproofs_plus = src_rct.p.bulletproofs_plus;
++ else if (rct::is_rct_bulletproof(src_rct.type))
++ ct.rv->p.bulletproofs = src_rct.p.bulletproofs;
++ }
++
++ if (payload.HasMember("rv") && payload["rv"].IsObject()) {
++ const auto &rvj = payload["rv"];
++ if (rvj.HasMember("txn_fee") && rvj["txn_fee"].IsUint64())
++ ct.rv->txnFee = rvj["txn_fee"].GetUint64();
++ if (rvj.HasMember("rv_type") && rvj["rv_type"].IsUint())
++ ct.rv->type = static_cast<uint8_t>(rvj["rv_type"].GetUint());
++ if (rvj.HasMember("message") && rvj["message"].IsString())
++ string_to_key(ct.rv->message, hex_to_bin(std::string(rvj["message"].GetString(), rvj["message"].GetStringLength())));
++ }
++
++ if (payload.HasMember("extra") && payload["extra"].IsString()) {
++ const std::string extra_bin = hex_to_bin(
++ std::string(payload["extra"].GetString(), payload["extra"].GetStringLength()));
++ ct.tx.extra.assign(extra_bin.begin(), extra_bin.end());
++ }
++
++ const rapidjson::Value *pseudo_outs = get_array_field(payload, "pseudo_outs");
++ if (pseudo_outs) {
++ ct.pseudo_outs.clear();
++ ct.rv->p.pseudoOuts.clear();
++ for (rapidjson::SizeType i = 0; i < pseudo_outs->Size(); ++i) {
++ if (!(*pseudo_outs)[i].IsString())
++ throw std::invalid_argument("Trezor Connect response: invalid pseudo_out entry");
++ const std::string po = hex_to_bin(
++ std::string((*pseudo_outs)[i].GetString(), (*pseudo_outs)[i].GetStringLength()));
++ ct.pseudo_outs.push_back(po);
++ rct::key k{};
++ string_to_key(k, po);
++ ct.rv->p.pseudoOuts.push_back(k);
++ }
++ }
++
++ ct.rv->mixRing.resize(signer.num_inputs());
++ }
++
++ tools::wallet2::pending_tx build_pending_tx_from_tdata(const TData &cdata)
++ {
++ tools::wallet2::pending_tx cpend;
++ cpend.tx = cdata.tx;
++ cpend.dust = 0;
++ cpend.fee = cpend.tx.rct_signatures.txnFee;
++ cpend.dust_added_to_fee = false;
++ cpend.change_dts = cdata.tx_data.change_dts;
++ cpend.selected_transfers = cdata.tx_data.selected_transfers;
++ cpend.key_images = "";
++ cpend.dests = cdata.tx_data.dests;
++ cpend.construction_data = cdata.tx_data;
++
++ std::string key_images;
++ const bool all_are_txin_to_key = std::all_of(cdata.tx.vin.begin(), cdata.tx.vin.end(), [&](const cryptonote::txin_v &s_e) -> bool {
++ CHECKED_GET_SPECIFIC_VARIANT(s_e, const cryptonote::txin_to_key, in, false);
++ key_images += boost::lexical_cast<std::string>(in.k_image) + " ";
++ return true;
++ });
++ if (!all_are_txin_to_key)
++ throw std::invalid_argument("Not all are txin_to_key");
++ cpend.key_images = key_images;
++
++ return cpend;
++ }
++
++ void fill_key_images_from_signed_tx(
++ std::vector<::crypto::key_image> &key_images,
++ const TData &cdata,
++ const unsigned_tx_set &utx)
++ {
++ key_images.clear();
++ key_images.resize(std::get<2>(utx.transfers).size());
++ for (size_t cidx = 0; cidx < key_images.size(); ++cidx)
++ key_images[cidx] = std::get<2>(utx.transfers)[cidx].m_key_image;
++
++ const size_t num_sources = cdata.tx_data.sources.size();
++ CHECK_AND_ASSERT_THROW_MES(num_sources == cdata.tx.vin.size(), "Invalid tx.vin size");
++
++ for (size_t src_idx = 0; src_idx < num_sources; ++src_idx) {
++ CHECK_AND_ASSERT_THROW_MES(src_idx < cdata.tx_data.selected_transfers.size(), "Invalid source index");
++ size_t idx_map_src = cdata.tx_data.selected_transfers[src_idx];
++ CHECK_AND_ASSERT_THROW_MES(idx_map_src >= std::get<0>(utx.transfers), "Invalid offset");
++ idx_map_src -= std::get<0>(utx.transfers);
++ CHECK_AND_ASSERT_THROW_MES(idx_map_src < key_images.size(), "Invalid key image index");
++
++ const auto vini = boost::get<cryptonote::txin_to_key>(cdata.tx.vin[src_idx]);
++ key_images[idx_map_src] = vini.k_image;
++ }
++ }
++
++ } // namespace
++
++ trezor_connect_signed_tx trezor_connect_monero_apply_sign_response(
++ wallet_shim *wallet,
++ const unsigned_tx_set *utx,
++ size_t tx_idx,
++ hw::tx_aux_data *aux_data,
++ const std::string &response_json,
++ const cryptonote::transaction *prefix_tx)
++ {
++ CHECK_AND_ASSERT_THROW_MES(wallet && utx && aux_data, "null argument");
++ CHECK_AND_ASSERT_THROW_MES(prefix_tx, "Trezor Connect: call commitTrezor first (unsigned transaction missing)");
++ CHECK_AND_ASSERT_THROW_MES(std::get<0>(utx->transfers) == 0, "Unsupported non zero offset");
++ CHECK_AND_ASSERT_THROW_MES(tx_idx < utx->txes.size(), "Invalid transaction index");
++
++ rapidjson::Document doc;
++ const rapidjson::Value &payload = parse_connect_response(response_json, doc);
++
++ Signer signer(wallet, utx, tx_idx, aux_data);
++ prepare_connect_signing_state(signer, payload, *prefix_tx);
++
++ const size_t num_sources = signer.num_inputs();
++
++ const rapidjson::Value *signatures = get_array_field(payload, "signatures");
++ if (!signatures)
++ throw std::invalid_argument("Trezor Connect response: missing signatures array");
++ if (signatures->Size() != num_sources)
++ throw std::invalid_argument("Trezor Connect response: signatures count mismatch");
++
++ const rapidjson::Value *pseudo_outs = get_array_field(payload, "pseudo_outs");
++
++ for (rapidjson::SizeType i = 0; i < signatures->Size(); ++i) {
++ if (!(*signatures)[i].IsString())
++ throw std::invalid_argument("Trezor Connect response: invalid signature entry");
++ auto ack = std::make_shared<messages::monero::MoneroTransactionSignInputAck>();
++ ack->set_signature(hex_to_bin(
++ std::string((*signatures)[i].GetString(), (*signatures)[i].GetStringLength())));
++ if (pseudo_outs && i < pseudo_outs->Size() && (*pseudo_outs)[i].IsString())
++ ack->set_pseudo_out(hex_to_bin(
++ std::string((*pseudo_outs)[i].GetString(), (*pseudo_outs)[i].GetStringLength())));
++ signer.step_sign_input_ack(ack);
++ }
++
++ auto final_ack = std::make_shared<messages::monero::MoneroTransactionFinalAck>();
++ final_ack->set_salt(get_hex_field(payload, "salt", false));
++ final_ack->set_rand_mult(get_hex_field(payload, "rand_mult", false));
++ final_ack->set_tx_enc_keys(get_hex_field(payload, "tx_enc_keys", false));
++ final_ack->set_cout_key(get_hex_field(payload, "cout_key", false));
++ final_ack->set_opening_key(get_hex_field(payload, "opening_key", true));
++
++ signer.step_final_ack(final_ack);
++
++ trezor_connect_signed_tx result;
++ result.ptx = build_pending_tx_from_tdata(signer.tdata());
++ result.tx_device_aux = signer.store_tx_aux_info();
++ fill_key_images_from_signed_tx(result.key_images, signer.tdata(), *utx);
++ return result;
++ }
++
+ }
+ }
+ }
+diff --git a/src/device_trezor/trezor/protocol.hpp b/src/device_trezor/trezor/protocol.hpp
+index 7ffadd9aa..987c95eb5 100644
+--- a/src/device_trezor/trezor/protocol.hpp
++++ b/src/device_trezor/trezor/protocol.hpp
+@@ -340,8 +340,35 @@ namespace tx {
+ const TData & tdata() const {
+ return m_ct;
+ }
++
++ TData & tdata() {
++ return m_ct;
++ }
++
++ void export_source_entry(MoneroTransactionSourceEntry *dst, size_t idx, bool need_ring_keys, bool need_ring_indices);
+ };
+
++ struct trezor_connect_signed_tx {
++ tools::wallet2::pending_tx ptx;
++ std::string tx_device_aux;
++ std::vector<::crypto::key_image> key_images;
++ };
++
++ std::string trezor_connect_monero_sign_transaction_to_json(
++ wallet_shim *wallet,
++ const unsigned_tx_set *utx,
++ size_t tx_idx,
++ hw::tx_aux_data *aux_data,
++ cryptonote::network_type network_type);
++
++ trezor_connect_signed_tx trezor_connect_monero_apply_sign_response(
++ wallet_shim *wallet,
++ const unsigned_tx_set *utx,
++ size_t tx_idx,
++ hw::tx_aux_data *aux_data,
++ const std::string &response_json,
++ const cryptonote::transaction *prefix_tx);
++
+ // TX Key decryption
+ void load_tx_key_data(hw::device_cold::tx_key_data_t & res, const std::string & data);
+
+diff --git a/src/wallet/api/pending_transaction.cpp b/src/wallet/api/pending_transaction.cpp
+index 1f714d229..548e24352 100644
+--- a/src/wallet/api/pending_transaction.cpp
++++ b/src/wallet/api/pending_transaction.cpp
+@@ -44,6 +44,11 @@
+
+ #include "bc-ur/src/bc-ur.hpp"
+
++#if defined(DEVICE_TREZOR_READY) && DEVICE_TREZOR_READY
++#include "device/device_cold.hpp"
++#include "device_trezor/trezor/protocol.hpp"
++#endif
++
+ using namespace std;
+
+ namespace Monero {
+@@ -210,6 +215,144 @@ std::string PendingTransactionImpl::commitUR(int max_fragment_length) {
+ }
+ }
+
++std::string PendingTransactionImpl::commitTrezor(uint64_t tx_index)
++{
++#if !defined(DEVICE_TREZOR_READY) || !DEVICE_TREZOR_READY
++ (void)tx_index;
++ m_errorString = tr("This build was compiled without Trezor support");
++ m_status = Status_Error;
++ return "";
++#else
++ if (tx_index >= m_pending_tx.size())
++ {
++ m_errorString = tr("Invalid transaction index");
++ m_status = Status_Error;
++ return "";
++ }
++ try
++ {
++ tools::wallet2 *w = m_wallet.m_wallet.get();
++ tools::wallet2::unsigned_tx_set utx;
++ w->construct_unsigned_tx_set_for_signing(m_pending_tx, utx);
++ if (std::get<0>(utx.transfers) != 0)
++ {
++ m_errorString = tr("Unsupported unsigned transaction transfer offset");
++ m_status = Status_Error;
++ return "";
++ }
++ hw::tx_aux_data aux_data;
++ const int bpv = w->use_fork_rules(HF_VERSION_BULLETPROOF_PLUS, -10) ? 4
++ : (w->use_fork_rules(HF_VERSION_CLSAG, -10) ? 3
++ : (w->use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1));
++ aux_data.bp_version = bpv;
++ aux_data.hard_fork = w->get_current_hard_fork();
++ aux_data.client_version = static_cast<unsigned>(bpv >= 4 ? 4u : 3u);
++
++ hw::wallet_shim shim;
++ shim.get_tx_pub_key_from_received_outs = std::bind(&tools::wallet2::get_tx_pub_key_from_received_outs, w, std::placeholders::_1);
++
++ const std::string json = hw::trezor::protocol::tx::trezor_connect_monero_sign_transaction_to_json(
++ &shim,
++ &utx,
++ static_cast<size_t>(tx_index),
++ &aux_data,
++ w->nettype());
++
++ m_trezor_connect_session = std::make_unique<TrezorConnectSession>();
++ m_trezor_connect_session->utx = std::move(utx);
++ m_trezor_connect_session->aux = aux_data;
++ m_trezor_connect_session->shim = shim;
++ m_trezor_connect_session->prefix_tx = m_pending_tx[tx_index].tx;
++ m_trezor_connect_session->tx_idx = tx_index;
++
++ m_errorString.clear();
++ m_status = Status_Ok;
++ return json;
++ }
++ catch (const std::exception &e)
++ {
++ m_errorString = e.what();
++ m_status = Status_Error;
++ return "";
++ }
++#endif
++}
++
++bool PendingTransactionImpl::commitTrezorNext(const std::string &response_json, uint64_t tx_index)
++{
++#if !defined(DEVICE_TREZOR_READY) || !DEVICE_TREZOR_READY
++ (void)response_json;
++ (void)tx_index;
++ m_errorString = tr("This build was compiled without Trezor support");
++ m_status = Status_Error;
++ return false;
++#else
++ if (tx_index >= m_pending_tx.size())
++ {
++ m_errorString = tr("Invalid transaction index");
++ m_status = Status_Error;
++ return false;
++ }
++ try
++ {
++ tools::wallet2 *w = m_wallet.m_wallet.get();
++ std::unique_ptr<TrezorConnectSession> session = std::move(m_trezor_connect_session);
++ std::unique_ptr<TrezorConnectSession> fallback_session;
++
++ if (!session || session->tx_idx != tx_index)
++ {
++ fallback_session = std::make_unique<TrezorConnectSession>();
++ session = std::move(fallback_session);
++ w->construct_unsigned_tx_set_for_signing(m_pending_tx, session->utx);
++ if (std::get<0>(session->utx.transfers) != 0)
++ {
++ m_errorString = tr("Unsupported unsigned transaction transfer offset");
++ m_status = Status_Error;
++ return false;
++ }
++ const int bpv = w->use_fork_rules(HF_VERSION_BULLETPROOF_PLUS, -10) ? 4
++ : (w->use_fork_rules(HF_VERSION_CLSAG, -10) ? 3
++ : (w->use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1));
++ session->aux.bp_version = bpv;
++ session->aux.hard_fork = w->get_current_hard_fork();
++ session->aux.client_version = static_cast<unsigned>(bpv >= 4 ? 4u : 3u);
++ session->shim.get_tx_pub_key_from_received_outs = std::bind(
++ &tools::wallet2::get_tx_pub_key_from_received_outs, w, std::placeholders::_1);
++ session->prefix_tx = m_pending_tx[tx_index].tx;
++ session->tx_idx = tx_index;
++ }
++
++ const auto signed_tx = hw::trezor::protocol::tx::trezor_connect_monero_apply_sign_response(
++ &session->shim,
++ &session->utx,
++ static_cast<size_t>(tx_index),
++ &session->aux,
++ response_json,
++ &session->prefix_tx);
++
++ m_pending_tx[tx_index] = signed_tx.ptx;
++ m_key_images = signed_tx.key_images;
++
++ if (!signed_tx.tx_device_aux.empty())
++ {
++ if (m_tx_device_aux.size() <= tx_index)
++ m_tx_device_aux.resize(tx_index + 1);
++ m_tx_device_aux[tx_index] = signed_tx.tx_device_aux;
++ }
++
++ m_errorString.clear();
++ m_status = Status_Ok;
++ return commit();
++ }
++ catch (const std::exception &e)
++ {
++ m_errorString = e.what();
++ m_status = Status_Error;
++ return false;
++ }
++#endif
++}
++
+
+ uint64_t PendingTransactionImpl::amount() const
+ {
+diff --git a/src/wallet/api/pending_transaction.h b/src/wallet/api/pending_transaction.h
+index 0cc6c58e9..32a7a296f 100644
+--- a/src/wallet/api/pending_transaction.h
++++ b/src/wallet/api/pending_transaction.h
+@@ -31,9 +31,14 @@
+ #include "wallet/api/wallet2_api.h"
+ #include "wallet/wallet2.h"
+
++#include <memory>
+ #include <string>
+ #include <vector>
+
++#if defined(DEVICE_TREZOR_READY) && DEVICE_TREZOR_READY
++#include "device/device_cold.hpp"
++#endif
++
+
+ namespace Monero {
+
+@@ -47,6 +52,8 @@ public:
+ std::string errorString() const override;
+ bool commit(const std::string &filename = "", bool overwrite = false) override;
+ std::string commitUR(int max_fragment_length = 130) override;
++ std::string commitTrezor(uint64_t tx_index = 0) override;
++ bool commitTrezorNext(const std::string &response_json, uint64_t tx_index = 0) override;
+ uint64_t amount() const override;
+ uint64_t dust() const override;
+ uint64_t fee() const override;
+@@ -72,6 +79,17 @@ private:
+ std::unordered_set<crypto::public_key> m_signers;
+ std::vector<std::string> m_tx_device_aux;
+ std::vector<crypto::key_image> m_key_images;
++
++#if defined(DEVICE_TREZOR_READY) && DEVICE_TREZOR_READY
++ struct TrezorConnectSession {
++ tools::wallet2::unsigned_tx_set utx;
++ hw::tx_aux_data aux;
++ hw::wallet_shim shim;
++ cryptonote::transaction prefix_tx;
++ size_t tx_idx{0};
++ };
++ std::unique_ptr<TrezorConnectSession> m_trezor_connect_session;
++#endif
+ };
+
+
+diff --git a/src/wallet/api/unsigned_transaction.cpp b/src/wallet/api/unsigned_transaction.cpp
+index fd03e959d..7232e518f 100644
+--- a/src/wallet/api/unsigned_transaction.cpp
++++ b/src/wallet/api/unsigned_transaction.cpp
+@@ -34,11 +34,13 @@
+
+ #include "cryptonote_basic/cryptonote_format_utils.h"
+ #include "cryptonote_basic/cryptonote_basic_impl.h"
++#include "cryptonote_config.h"
+
+ #include <memory>
+ #include <vector>
+ #include <sstream>
+ #include <boost/format.hpp>
++#include <functional>
+
+ #include "bc-ur/src/bc-ur.hpp"
+
+diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
+index c24b4a97d..cc85398ca 100644
+--- a/src/wallet/api/wallet.cpp
++++ b/src/wallet/api/wallet.cpp
+@@ -1545,7 +1545,7 @@ bool WalletImpl::importKeyImages(const string &filename)
+ return false;
+ }
+
+- return true;
++ return true;
+ }
+
+
+@@ -3479,4 +3479,33 @@ std::string WalletImpl::serializeCacheToJson() const
+ return std::string(m_wallet->serialize_cache_to_json());
+ }
+
++std::string WalletImpl::exportTrezorTdis() const
++{
++ return m_wallet->export_trezor_tdis();
++}
++
++bool WalletImpl::importTrezorEncryptedKeyImagesJson(const string &json)
++{
++ if (checkBackgroundSync("cannot import key images"))
++ return false;
++ if (!trustedDaemon()) {
++ setStatusError(tr("Key images can only be imported with a trusted daemon"));
++ return false;
++ }
++ try
++ {
++ uint64_t spent = 0, unspent = 0;
++ uint64_t height = m_wallet->import_trezor_encrypted_key_images_json(json, spent, unspent);
++ LOG_PRINT_L2("Trezor encrypted key images imported to height " << height << ", "
++ << print_money(spent) << " spent, " << print_money(unspent) << " unspent");
++ }
++ catch (const std::exception &e)
++ {
++ LOG_ERROR("Error importing Trezor encrypted key images: " << e.what());
++ setStatusError(string(tr("Failed to import key images: ")) + e.what());
++ return false;
++ }
++ return true;
++}
++
+ } // namespace
+diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
+index 98c03b9c1..5248badb8 100644
+--- a/src/wallet/api/wallet.h
++++ b/src/wallet/api/wallet.h
+@@ -337,6 +337,8 @@ private:
+ bool getWaitsForDeviceReceive();
+
+ virtual std::string serializeCacheToJson() const override;
++ virtual std::string exportTrezorTdis() const override;
++ bool importTrezorEncryptedKeyImagesJson(const std::string &json) override;
+ };
+
+
+diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
+index 3d11929f9..760fc8859 100644
+--- a/src/wallet/api/wallet2_api.h
++++ b/src/wallet/api/wallet2_api.h
+@@ -92,6 +92,8 @@ struct PendingTransaction
+ // commit transaction or save to file if filename is provided.
+ virtual bool commit(const std::string &filename = "", bool overwrite = false) = 0;
+ virtual std::string commitUR(int max_fragment_length = 130) = 0;
++ virtual std::string commitTrezor(uint64_t tx_index = 0) = 0;
++ virtual bool commitTrezorNext(const std::string &response_json, uint64_t tx_index = 0) = 0;
+ virtual uint64_t amount() const = 0;
+ virtual uint64_t dust() const = 0;
+ virtual uint64_t fee() const = 0;
+@@ -1220,6 +1222,19 @@ struct Wallet
+
+ //! serialize wallet cache to JSON
+ virtual std::string serializeCacheToJson() const = 0;
++
++
++ /*!
++ * \brief exportTrezorTdis — export transfer details for Trezor cold key-image sync as JSON
++ *
++ * Returns an object `{ "tdis": [ ... ] }` with hex pubkeys and indices per output.
++ */
++ virtual std::string exportTrezorTdis() const = 0;
++
++ /*!
++ * \brief importTrezorEncryptedKeyImagesJson — import key images from Trezor-style encrypted JSON
++ */
++ virtual bool importTrezorEncryptedKeyImagesJson(const std::string &json) = 0;
+ };
+
+ /**
+diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
+index a7532d7ec..bb0ada04d 100644
+--- a/src/wallet/wallet2.cpp
++++ b/src/wallet/wallet2.cpp
+@@ -98,6 +98,7 @@ extern "C"
+ {
+ #include "crypto/keccak.h"
+ #include "crypto/crypto-ops.h"
++#include <sodium/crypto_aead_chacha20poly1305.h>
+ }
+ using namespace std;
+ using namespace crypto;
+@@ -7838,6 +7839,20 @@ std::string wallet2::dump_tx_to_str(const std::vector<pending_tx> &ptx_vector) c
+ return std::string(UNSIGNED_TX_PREFIX) + ciphertext;
+ }
+ //----------------------------------------------------------------------------------------------------
++void wallet2::construct_unsigned_tx_set_for_signing(const std::vector<pending_tx>& ptx_vector, unsigned_tx_set &utx) const
++{
++ utx.txes.clear();
++ utx.txes.reserve(ptx_vector.size());
++ for (const auto &tx : ptx_vector)
++ utx.txes.push_back(get_construction_data_with_decrypted_short_payment_id(tx, m_account.get_device()));
++
++ utx.new_transfers = std::make_tuple(static_cast<uint64_t>(0), static_cast<uint64_t>(0), std::vector<exported_transfer_details>());
++
++ transfer_container transfers_copy;
++ get_transfers(transfers_copy);
++ utx.transfers = std::make_tuple(static_cast<uint64_t>(0), static_cast<uint64_t>(transfers_copy.size()), std::move(transfers_copy));
++}
++//----------------------------------------------------------------------------------------------------
+ bool wallet2::load_unsigned_tx(const std::string &unsigned_filename, unsigned_tx_set &exported_txs) const
+ {
+ std::string s;
+@@ -16384,4 +16399,147 @@ std::pair<size_t, uint64_t> wallet2::estimate_tx_size_and_weight(bool use_rct, i
+ return std::make_pair(size, weight);
+ }
+ //----------------------------------------------------------------------------------------------------
++// Returns JSON: { "tdis": [ { "out_key", "tx_pub_key", optional "additional_tx_pub_keys", indices }, ... ] }
++// Hex fields are 64-char lower-case pubkeys; additional_tx_pub_keys matches protocol::ki::key_image_data
++// (subset of txn additional pubkeys for this transfer — currently 0 or 1 entry).
++std::string wallet2::export_trezor_tdis() const
++{
++ rapidjson::Document doc;
++ doc.SetObject();
++ auto &alloc = doc.GetAllocator();
++
++ rapidjson::Value tdis(rapidjson::kArrayType);
++ tdis.Reserve(static_cast<rapidjson::SizeType>(m_transfers.size()), alloc);
++
++ for (const auto &td : m_transfers)
++ {
++ const crypto::public_key out_key = td.get_public_key();
++ const crypto::public_key tx_pub_key = get_tx_pub_key_from_received_outs(td);
++ const std::vector<crypto::public_key> additional_tx_pub_keys = cryptonote::get_additional_tx_pub_keys_from_extra(td.m_tx);
++
++ std::vector<crypto::public_key> additional_for_tdi;
++ if (!additional_tx_pub_keys.empty() && additional_tx_pub_keys.size() > td.m_internal_output_index)
++ additional_for_tdi.push_back(additional_tx_pub_keys[td.m_internal_output_index]);
++
++ rapidjson::Value obj(rapidjson::kObjectType);
++ const std::string out_hex = epee::string_tools::pod_to_hex(out_key);
++ const std::string tx_pub_hex = epee::string_tools::pod_to_hex(tx_pub_key);
++ obj.AddMember("out_key", rapidjson::Value(out_hex.c_str(), static_cast<rapidjson::SizeType>(out_hex.size()), alloc), alloc);
++ obj.AddMember("tx_pub_key", rapidjson::Value(tx_pub_hex.c_str(), static_cast<rapidjson::SizeType>(tx_pub_hex.size()), alloc), alloc);
++ if (!additional_for_tdi.empty())
++ {
++ rapidjson::Value aux(rapidjson::kArrayType);
++ aux.Reserve(static_cast<rapidjson::SizeType>(additional_for_tdi.size()), alloc);
++ for (const auto &apk : additional_for_tdi)
++ {
++ const std::string ah = epee::string_tools::pod_to_hex(apk);
++ aux.PushBack(rapidjson::Value(ah.c_str(), static_cast<rapidjson::SizeType>(ah.size()), alloc), alloc);
++ }
++ obj.AddMember("additional_tx_pub_keys", aux, alloc);
++ }
++ obj.AddMember("internal_output_index", rapidjson::Value(static_cast<uint64_t>(td.m_internal_output_index)), alloc);
++ obj.AddMember("sub_addr_major", rapidjson::Value(td.m_subaddr_index.major), alloc);
++ obj.AddMember("sub_addr_minor", rapidjson::Value(td.m_subaddr_index.minor), alloc);
++ tdis.PushBack(obj, alloc);
++ }
++
++ doc.AddMember("tdis", tdis, alloc);
++
++ rapidjson::StringBuffer buffer;
++ rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
++ doc.Accept(writer);
++ return std::string(buffer.GetString(), buffer.GetSize());
++}
++//----------------------------------------------------------------------------------------------------
++namespace
++{
++ static void decrypt_trezor_exported_ki_blob(const std::string &cipher, const std::string &iv, const std::string &key32, crypto::key_image &ki, crypto::signature &sig)
++ {
++ THROW_WALLET_EXCEPTION_IF(iv.size() != crypto_aead_chacha20poly1305_ietf_NPUBBYTES,
++ error::wallet_internal_error, "Trezor KI JSON: IV must be 12 bytes");
++ THROW_WALLET_EXCEPTION_IF(key32.size() != 32,
++ error::wallet_internal_error, "Trezor KI JSON: encryption key must be 32 bytes");
++ THROW_WALLET_EXCEPTION_IF(cipher.size() < crypto_aead_chacha20poly1305_ietf_ABYTES,
++ error::wallet_internal_error, "Trezor KI JSON: key_image ciphertext too short");
++ char buf[96];
++ unsigned long long out_len = 0;
++ const int r = crypto_aead_chacha20poly1305_ietf_decrypt(
++ reinterpret_cast<unsigned char *>(buf), &out_len, nullptr,
++ reinterpret_cast<const unsigned char *>(cipher.data()), cipher.size(),
++ nullptr, 0,
++ reinterpret_cast<const unsigned char *>(iv.data()),
++ reinterpret_cast<const unsigned char *>(key32.data()));
++ THROW_WALLET_EXCEPTION_IF(r != 0,
++ error::wallet_internal_error, "Trezor KI JSON: decryption failed (wrong key or corrupt ciphertext)");
++ THROW_WALLET_EXCEPTION_IF(out_len != 96,
++ error::wallet_internal_error, "Trezor KI JSON: unexpected plaintext length");
++ memcpy(ki.data, buf, 32);
++ memcpy(sig.c.data, buf + 32, 32);
++ memcpy(sig.r.data, buf + 64, 32);
++ memwipe(buf, sizeof(buf));
++ }
++}
++
++//----------------------------------------------------------------------------------------------------
++uint64_t wallet2::import_trezor_encrypted_key_images_json(const std::string &json, uint64_t &spent, uint64_t &unspent, bool check_spent)
++{
++ rapidjson::Document doc;
++ doc.Parse(json.c_str());
++ THROW_WALLET_EXCEPTION_IF(doc.HasParseError(), error::wallet_internal_error,
++ std::string("Trezor KI JSON: parse error at offset ") + std::to_string(doc.GetErrorOffset()));
++
++ const rapidjson::Value *proot = &doc;
++ if (doc.IsObject() && doc.HasMember("payload") && doc["payload"].IsObject())
++ proot = &doc["payload"];
++
++ THROW_WALLET_EXCEPTION_IF(!proot->IsObject(), error::wallet_internal_error, "Trezor KI JSON: expected JSON object");
++ const rapidjson::Value &root = *proot;
++
++ THROW_WALLET_EXCEPTION_IF(!root.HasMember("key_images") || !root["key_images"].IsArray(),
++ error::wallet_internal_error, "Trezor KI JSON: missing or invalid key_images array");
++
++ std::string enc_key_bin;
++ if (root.HasMember("signature") && root["signature"].IsString())
++ {
++ THROW_WALLET_EXCEPTION_IF(!epee::string_tools::parse_hexstr_to_binbuff(root["signature"].GetString(), enc_key_bin),
++ error::wallet_internal_error, "Trezor KI JSON: invalid hex in signature");
++ }
++ else if (root.HasMember("enc_key") && root["enc_key"].IsString())
++ {
++ THROW_WALLET_EXCEPTION_IF(!epee::string_tools::parse_hexstr_to_binbuff(root["enc_key"].GetString(), enc_key_bin),
++ error::wallet_internal_error, "Trezor KI JSON: invalid hex in enc_key");
++ }
++ else
++ {
++ THROW_WALLET_EXCEPTION(error::wallet_internal_error, "Trezor KI JSON: need signature or enc_key (32-byte hex)");
++ }
++ THROW_WALLET_EXCEPTION_IF(enc_key_bin.size() != 32,
++ error::wallet_internal_error, "Trezor KI JSON: encryption key must decode to 32 bytes");
++
++ const rapidjson::Value &arr = root["key_images"];
++ std::vector<std::pair<crypto::key_image, crypto::signature>> ski;
++ ski.reserve(arr.Size());
++
++ for (rapidjson::SizeType i = 0; i < arr.Size(); ++i)
++ {
++ const rapidjson::Value &el = arr[i];
++ THROW_WALLET_EXCEPTION_IF(!el.IsObject(), error::wallet_internal_error, "Trezor KI JSON: key_images entry must be object");
++ THROW_WALLET_EXCEPTION_IF(!el.HasMember("iv") || !el["iv"].IsString(), error::wallet_internal_error, "Trezor KI JSON: missing iv");
++ THROW_WALLET_EXCEPTION_IF(!el.HasMember("key_image") || !el["key_image"].IsString(), error::wallet_internal_error, "Trezor KI JSON: missing key_image");
++
++ std::string iv_bin, blob_bin;
++ THROW_WALLET_EXCEPTION_IF(!epee::string_tools::parse_hexstr_to_binbuff(el["iv"].GetString(), iv_bin),
++ error::wallet_internal_error, "Trezor KI JSON: invalid hex in iv");
++ THROW_WALLET_EXCEPTION_IF(!epee::string_tools::parse_hexstr_to_binbuff(el["key_image"].GetString(), blob_bin),
++ error::wallet_internal_error, "Trezor KI JSON: invalid hex in key_image");
++
++ crypto::key_image ki{};
++ crypto::signature sig{};
++ decrypt_trezor_exported_ki_blob(blob_bin, iv_bin, enc_key_bin, ki, sig);
++ ski.emplace_back(std::move(ki), std::move(sig));
++ }
++
++ return import_key_images(ski, 0, spent, unspent, check_spent);
++}
++//----------------------------------------------------------------------------------------------------
+ }
+diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
+index 37a2447d2..a1ca49e90 100644
+--- a/src/wallet/wallet2.h
++++ b/src/wallet/wallet2.h
+@@ -1207,6 +1207,8 @@ private:
+ void commit_tx(std::vector<pending_tx>& ptx_vector);
+ bool save_tx(const std::vector<pending_tx>& ptx_vector, const std::string &filename) const;
+ std::string dump_tx_to_str(const std::vector<pending_tx> &ptx_vector) const;
++ //! Populate \p utx from pending txs for cold/device signing (uses live transfer indices).
++ void construct_unsigned_tx_set_for_signing(const std::vector<pending_tx>& ptx_vector, unsigned_tx_set &utx) const;
+ std::string save_multisig_tx(multisig_tx_set txs);
+ bool save_multisig_tx(const multisig_tx_set &txs, const std::string &filename);
+ std::string save_multisig_tx(const std::vector<pending_tx>& ptx_vector);
+@@ -1717,7 +1719,8 @@ private:
+ bool is_unattended() const { return m_unattended; }
+
+ std::pair<size_t, uint64_t> estimate_tx_size_and_weight(bool use_rct, int n_inputs, int ring_size, int n_outputs, size_t extra_size);
+-
++ std::string export_trezor_tdis() const;
++ uint64_t import_trezor_encrypted_key_images_json(const std::string &json, uint64_t &spent, uint64_t &unspent, bool check_spent = true);
+ bool get_rpc_payment_info(bool mining, bool &payment_required, uint64_t &credits, uint64_t &diff, uint64_t &credits_per_hash_found, cryptonote::blobdata &hashing_blob, uint64_t &height, uint64_t &seed_height, crypto::hash &seed_hash, crypto::hash &next_seed_hash, uint32_t &cookie);
+ bool daemon_requires_payment();
+ bool make_rpc_payment(uint32_t nonce, uint32_t cookie, uint64_t &credits, uint64_t &balance);
+--
+2.50.1 (Apple Git-155)
+