summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorcyan <cyjan@mrcyjanek.net>2025-05-19 12:09:32 +0200
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2025-05-19 12:16:22 +0200
commit4868eb9220962a4176a7ed0fc7c809c6200e71a0 (patch)
tree0407d44c8919072b8b464192ce3de9d2a3fa9bbe /patches
parenta479a569bc25dd1e9701436404a46f0f509096a4 (diff)
feat: callback-based ledger connection (#137)
* feat: callback-based ledger connection * int -> void use sendToLedgerDeviceCallback only when needed * fix(ledger): fix binds, make functions static * update ledger patch * monero.dart: add ledger callback api
Diffstat (limited to 'patches')
-rw-r--r--patches/monero/0001-fix-missing-___clear_cache-when-targetting-iOS.patch6
-rw-r--r--patches/monero/0002-store-crash-fix.patch6
-rw-r--r--patches/monero/0003-uint64_t-missing-definition-fix.patch6
-rw-r--r--patches/monero/0004-use-proper-error-handling-in-get_seed.patch6
-rw-r--r--patches/monero/0005-UR-functions.patch6
-rw-r--r--patches/monero/0006-add-dummy-device-for-ledger.patch176
-rw-r--r--patches/monero/0007-polyseed.patch14
-rw-r--r--patches/monero/0008-coin-control.patch12
-rw-r--r--patches/monero/0009-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch8
-rw-r--r--patches/monero/0010-Add-recoverDeterministicWalletFromSpendKey.patch14
-rw-r--r--patches/monero/0011-add-monero-submodule-support.patch6
-rw-r--r--patches/monero/0012-fix-iOS-depends-build.patch6
-rw-r--r--patches/monero/0013-include-locale-only-when-targeting-WIN32.patch11
-rw-r--r--patches/monero/0014-change-earliest-fork-height-message.patch6
-rw-r--r--patches/monero/0015-remove-trivially_copyable-assert.patch6
-rw-r--r--patches/monero/0016-pr-9880.patch6
-rw-r--r--patches/monero/0017-fix-unary_function-__unary_function.patch6
17 files changed, 170 insertions, 131 deletions
diff --git a/patches/monero/0001-fix-missing-___clear_cache-when-targetting-iOS.patch b/patches/monero/0001-fix-missing-___clear_cache-when-targetting-iOS.patch
index d8d3dca..4dc4e8f 100644
--- a/patches/monero/0001-fix-missing-___clear_cache-when-targetting-iOS.patch
+++ b/patches/monero/0001-fix-missing-___clear_cache-when-targetting-iOS.patch
@@ -1,7 +1,7 @@
-From 6e284a2ef552f1f47e8ca9edcf8651312c9e37dd Mon Sep 17 00:00:00 2001
+From 36259ba9f88bc135b243329400bec9290abb04c6 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 2 Apr 2024 16:51:56 +0200
-Subject: [PATCH 01/14] fix missing ___clear_cache when targetting iOS
+Subject: [PATCH 01/17] fix missing ___clear_cache when targetting iOS
---
.gitmodules | 3 ++-
@@ -30,5 +30,5 @@ index 102f8acf9..ce72c9bb9 160000
-Subproject commit 102f8acf90a7649ada410de5499a7ec62e49e1da
+Subproject commit ce72c9bb9cb799e0d9171094b9abb009e04c5bfc
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0002-store-crash-fix.patch b/patches/monero/0002-store-crash-fix.patch
index 5a2c16a..a09dcf1 100644
--- a/patches/monero/0002-store-crash-fix.patch
+++ b/patches/monero/0002-store-crash-fix.patch
@@ -1,7 +1,7 @@
-From b4f4b38af1ab974872862fc20735e41941b955e9 Mon Sep 17 00:00:00 2001
+From 459ac9f7a64cc527528a41dc45ed4cefe83091cb Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Sat, 11 May 2024 16:25:10 +0200
-Subject: [PATCH 02/14] store crash fix
+Subject: [PATCH 02/17] store crash fix
Monero wallet crashes (sometimes) when it is syncing,
while the proper solution (that can be seen in feather)
@@ -204,5 +204,5 @@ index 2f4ad52f1..daad1e940 100644
i_wallet2_callback* m_callback;
hw::device::device_type m_key_device_type;
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0003-uint64_t-missing-definition-fix.patch b/patches/monero/0003-uint64_t-missing-definition-fix.patch
index 1b6e305..70ce8bf 100644
--- a/patches/monero/0003-uint64_t-missing-definition-fix.patch
+++ b/patches/monero/0003-uint64_t-missing-definition-fix.patch
@@ -1,7 +1,7 @@
-From a74f616e3c1671a883182b0db1c6fc11a1242c01 Mon Sep 17 00:00:00 2001
+From c51ee39835aaac64da39b1c10bc068182f6e28cb Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Mon, 2 Sep 2024 16:40:31 +0200
-Subject: [PATCH 03/14] uint64_t missing definition fix
+Subject: [PATCH 03/17] uint64_t missing definition fix
---
contrib/epee/include/net/http_base.h | 2 +-
@@ -21,5 +21,5 @@ index 4af4da790..ae4c0d05e 100644
#include <string>
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0004-use-proper-error-handling-in-get_seed.patch b/patches/monero/0004-use-proper-error-handling-in-get_seed.patch
index 33207f3..aa30e4f 100644
--- a/patches/monero/0004-use-proper-error-handling-in-get_seed.patch
+++ b/patches/monero/0004-use-proper-error-handling-in-get_seed.patch
@@ -1,7 +1,7 @@
-From f9b222f1611d7cfbaf0ac52cd6194724c7554def Mon Sep 17 00:00:00 2001
+From 0c1524dd9a4f6b4450b277623ffa620f69931102 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Mon, 24 Jun 2024 10:49:12 +0200
-Subject: [PATCH 04/14] use proper error handling in get_seed
+Subject: [PATCH 04/17] use proper error handling in get_seed
---
src/wallet/api/wallet.cpp | 17 ++++++++++++-----
@@ -67,5 +67,5 @@ index c9c2dbc82..b827b826f 100644
return true;
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0005-UR-functions.patch b/patches/monero/0005-UR-functions.patch
index c3cca26..0ba79b7 100644
--- a/patches/monero/0005-UR-functions.patch
+++ b/patches/monero/0005-UR-functions.patch
@@ -1,7 +1,7 @@
-From ff70c74c8b331758ace1f14df0ca107731dda49d Mon Sep 17 00:00:00 2001
+From 467ee9154b5c1b903559bf1dbe848cbabc62ba7d Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 10:09:50 +0100
-Subject: [PATCH 05/14] UR functions
+Subject: [PATCH 05/17] UR functions
This commit adds UR functions for UR tasks,
I believe that the right place to get
@@ -1006,5 +1006,5 @@ index daad1e940..a752f15b9 100644
bool import_key_images(signed_tx_set & signed_tx, size_t offset=0, bool only_selected_transfers=false);
crypto::public_key get_tx_pub_key_from_received_outs(const tools::wallet2::transfer_details &td) const;
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0006-add-dummy-device-for-ledger.patch b/patches/monero/0006-add-dummy-device-for-ledger.patch
index 22ee249..6098565 100644
--- a/patches/monero/0006-add-dummy-device-for-ledger.patch
+++ b/patches/monero/0006-add-dummy-device-for-ledger.patch
@@ -1,22 +1,23 @@
-From 904fe95204ba02d1a8c81fc46c1423ba1685c94f Mon Sep 17 00:00:00 2001
+From 11ddba5ab1470fb46a87ea9b702bf11f88763ecc Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
-Date: Wed, 26 Jun 2024 15:04:38 +0200
-Subject: [PATCH 06/14] add dummy device for ledger
+Date: Thu, 8 May 2025 13:14:23 +0200
+Subject: [PATCH 06/17] add dummy device for ledger
---
CMakeLists.txt | 6 +-
+ external/randomx | 2 +-
src/device/CMakeLists.txt | 6 +-
- src/device/device.cpp | 10 ++-
+ src/device/device.cpp | 10 +-
src/device/device.hpp | 12 +--
- src/device/device_io_dummy.cpp | 133 ++++++++++++++++++++++++++++++
- src/device/device_io_dummy.hpp | 74 +++++++++++++++++
+ src/device/device_io_dummy.cpp | 161 ++++++++++++++++++++++++++++++
+ src/device/device_io_dummy.hpp | 82 +++++++++++++++
src/device/device_ledger.cpp | 6 +-
src/device/device_ledger.hpp | 7 +-
- src/wallet/api/wallet.cpp | 94 +++++++++++++++++++++
- src/wallet/api/wallet.h | 18 ++++
- src/wallet/api/wallet2_api.h | 12 +++
+ src/wallet/api/wallet.cpp | 100 +++++++++++++++++++
+ src/wallet/api/wallet.h | 14 +++
+ src/wallet/api/wallet2_api.h | 13 +++
src/wallet/api/wallet_manager.cpp | 12 ++-
- 12 files changed, 365 insertions(+), 25 deletions(-)
+ 13 files changed, 405 insertions(+), 26 deletions(-)
create mode 100644 src/device/device_io_dummy.cpp
create mode 100644 src/device/device_io_dummy.hpp
@@ -131,10 +132,10 @@ index 392703a24..ffd419779 100644
diff --git a/src/device/device_io_dummy.cpp b/src/device/device_io_dummy.cpp
new file mode 100644
-index 000000000..edb4beea3
+index 000000000..01e6fc7b7
--- /dev/null
+++ b/src/device/device_io_dummy.cpp
-@@ -0,0 +1,133 @@
+@@ -0,0 +1,161 @@
+// Copyright (c) 2017-2022, The Monero Project
+//
+// All rights reserved.
@@ -189,6 +190,10 @@ index 000000000..edb4beea3
+size_t hw::io::device_io_dummy::receivedFromDeviceLength = 0;
+bool hw::io::device_io_dummy::waitsForDeviceSend = false;
+bool hw::io::device_io_dummy::waitsForDeviceReceive = false;
++void (*hw::io::device_io_dummy::sendToLedgerDeviceCallback)(unsigned char *command, unsigned int cmd_len) = nullptr;
++std::mutex hw::io::device_io_dummy::mutex;
++std::condition_variable hw::io::device_io_dummy::cv_send;
++std::condition_variable hw::io::device_io_dummy::cv_receive;
+
+namespace hw {
+ namespace io {
@@ -227,22 +232,29 @@ index 000000000..edb4beea3
+
+ int device_io_dummy::exchange(unsigned char *command, unsigned int cmd_len, unsigned char *response, unsigned int max_resp_len, bool user_input) {
+ MDEBUG("exchange(): locking mutex");
-+ boost::unique_lock<boost::mutex> lock(mutex);
++ std::unique_lock<std::mutex> lock(mutex);
+ sendToDevice = command;
+ sendToDeviceLength = cmd_len;
+ waitsForDeviceSend = true;
+ waitsForDeviceReceive = true;
++
++ // Call the callback if it's set
++ if (sendToLedgerDeviceCallback != nullptr) {
++ MDEBUG("exchange(): calling sendToLedgerDeviceCallback");
++ sendToLedgerDeviceCallback(command, cmd_len);
++ }
+ MDEBUG("exchange(): waitsForDeviceSend");
-+ // NOTE: waitsForDeviceSend should be changed by external code
++ // Wait for the send flag to be cleared by external code
+ while (waitsForDeviceSend) {
-+ usleep(1000);
-+ MDEBUG("exchange(): waitsForDeviceSend (still)");
++ cv_send.wait(lock);
++ MDEBUG("exchange(): waitsForDeviceSend notified");
+ }
+
+ MDEBUG("exchange(): waitsForDeviceReceive");
++ // Wait for the receive flag to be cleared by external code
+ while (waitsForDeviceReceive) {
-+ usleep(1000);
-+ MDEBUG("exchange(): waitsForDeviceReceive (still)");
++ cv_receive.wait(lock);
++ MDEBUG("exchange(): waitsForDeviceReceive notified");
+ }
+
+ if (receivedFromDeviceLength > max_resp_len) {
@@ -250,7 +262,8 @@ index 000000000..edb4beea3
+ return 1;
+ }
+
-+ memset(response,0,max_resp_len);
++
++ memset(response, 0, max_resp_len);
+ memcpy(response, receivedFromDevice, receivedFromDeviceLength);
+ return receivedFromDeviceLength;
+ }
@@ -263,18 +276,34 @@ index 000000000..edb4beea3
+ MDEBUG("release()");
+ }
+
++ void device_io_dummy::setLedgerCallback(void (*sendToLedgerDevice)(unsigned char *command, unsigned int cmd_len)) {
++ MDEBUG("setLedgerCallback()");
++ sendToLedgerDeviceCallback = sendToLedgerDevice;
++ }
++
++ void device_io_dummy::setDeviceReceivedData(unsigned char* data, size_t len) {
++ MDEBUG("setDeviceReceivedData(len: " << len << ")");
++ std::unique_lock<std::mutex> lock(mutex);
+
++ receivedFromDevice = data;
++ receivedFromDeviceLength = len;
+
++ waitsForDeviceSend = false;
++ waitsForDeviceReceive = false;
++
++ cv_send.notify_all();
++ cv_receive.notify_all();
++ }
+ }
+}
+#endif // HAVE_HIDAPI
\ No newline at end of file
diff --git a/src/device/device_io_dummy.hpp b/src/device/device_io_dummy.hpp
new file mode 100644
-index 000000000..a1733616d
+index 000000000..1128b9c1d
--- /dev/null
+++ b/src/device/device_io_dummy.hpp
-@@ -0,0 +1,74 @@
+@@ -0,0 +1,82 @@
+// Copyright (c) 2017-2022, The Monero Project
+//
+// All rights reserved.
@@ -309,6 +338,8 @@ index 000000000..a1733616d
+
+#include "device_io.hpp"
+#include "device_io_hid.hpp"
++#include <mutex>
++#include <condition_variable>
+
+namespace hw {
+ namespace io {
@@ -320,9 +351,11 @@ index 000000000..a1733616d
+ };
+ class device_io_dummy : device_io {
+ private:
-+ boost::mutex mutex;
++ static std::mutex mutex;
+
+ public:
++ static std::condition_variable cv_send;
++ static std::condition_variable cv_receive;
+ static bool stateIsConnected;
+ static unsigned char* sendToDevice;
+ static size_t sendToDeviceLength;
@@ -330,6 +363,7 @@ index 000000000..a1733616d
+ static size_t receivedFromDeviceLength;
+ static bool waitsForDeviceSend;
+ static bool waitsForDeviceReceive;
++ static void (*sendToLedgerDeviceCallback)(unsigned char *command, unsigned int cmd_len);
+
+ device_io_dummy() = default;
+ device_io_dummy(int a, int b, int c, int d);
@@ -343,7 +377,10 @@ index 000000000..a1733616d
+ void disconnect();
+ bool connected() const;
+
-+ int exchange(unsigned char *command, unsigned int cmd_len, unsigned char *response, unsigned int max_resp_len, bool user_input);
++ int exchange(unsigned char *command, unsigned int cmd_len, unsigned char *response, unsigned int max_resp_len, bool user_input);
++
++ static void setLedgerCallback(void (*sendToLedgerDevice)(unsigned char *command, unsigned int cmd_len));
++ static void setDeviceReceivedData(unsigned char* data, size_t len);
+ };
+ };
+};
@@ -415,7 +452,7 @@ index 03058c4f1..39454ca6d 100644
unsigned char buffer_send[BUFFER_SEND_SIZE];
unsigned int length_recv;
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 3fcd6f332..25ade04a7 100644
+index 3fcd6f332..844a1c451 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -48,6 +48,9 @@
@@ -428,91 +465,87 @@ index 3fcd6f332..25ade04a7 100644
using namespace std;
using namespace cryptonote;
-@@ -3178,4 +3181,95 @@ uint64_t WalletImpl::getBytesSent()
+@@ -3178,4 +3181,101 @@ uint64_t WalletImpl::getBytesSent()
return m_wallet->get_bytes_sent();
}
+
+// HIDAPI_DUMMY
-+bool WalletImpl::getStateIsConnected() {
++bool Wallet::getStateIsConnected() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return false;
+ #else
+ return hw::io::device_io_dummy::stateIsConnected;
+ #endif
+}
+
-+unsigned char* WalletImpl::getSendToDevice() {
++unsigned char* Wallet::getSendToDevice() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return {};
+ #else
+ return hw::io::device_io_dummy::sendToDevice;
+ #endif
+}
+
-+size_t WalletImpl::getSendToDeviceLength() {
++size_t Wallet::getSendToDeviceLength() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return -1;
+ #else
+ return hw::io::device_io_dummy::sendToDeviceLength;
+ #endif
+}
+
-+unsigned char* WalletImpl::getReceivedFromDevice() {
++unsigned char* Wallet::getReceivedFromDevice() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return {};
+ #else
+ return hw::io::device_io_dummy::receivedFromDevice;
+ #endif
+}
+
-+size_t WalletImpl::getReceivedFromDeviceLength() {
++size_t Wallet::getReceivedFromDeviceLength() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return -1;
+ #else
+ return hw::io::device_io_dummy::receivedFromDeviceLength;
+ #endif
+}
+
-+bool WalletImpl::getWaitsForDeviceSend() {
++bool Wallet::getWaitsForDeviceSend() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return false;
+ #else
-+ return hw::io::device_io_dummy::receivedFromDeviceLength;
++ return hw::io::device_io_dummy::waitsForDeviceSend;
+ #endif
+}
+
-+bool WalletImpl::getWaitsForDeviceReceive() {
++bool Wallet::getWaitsForDeviceReceive() {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return false;
+ #else
+ return hw::io::device_io_dummy::waitsForDeviceReceive;
+ #endif
+}
+
-+void WalletImpl::setDeviceReceivedData(unsigned char* data, size_t len) {
++void Wallet::setDeviceReceivedData(unsigned char* data, size_t len) {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return;
+ #else
-+ hw::io::device_io_dummy::receivedFromDevice = static_cast<unsigned char *>(malloc(len));
-+ hw::io::device_io_dummy::receivedFromDeviceLength = len;
-+ memset(hw::io::device_io_dummy::receivedFromDevice, 0, len);
-+ memcpy(hw::io::device_io_dummy::receivedFromDevice, data, len);
-+ hw::io::device_io_dummy::waitsForDeviceReceive = false;
++ hw::io::device_io_dummy::setDeviceReceivedData(data, len);
+ #endif
+}
+
-+void WalletImpl::setDeviceSendData(unsigned char* data, size_t len) {
++void Wallet::setDeviceSendData(unsigned char* data, size_t len) {
+ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
-+ setStatusError("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
+ return;
+ #else
+ hw::io::device_io_dummy::sendToDevice = static_cast<unsigned char *>(malloc(len));
@@ -520,15 +553,25 @@ index 3fcd6f332..25ade04a7 100644
+ memset(hw::io::device_io_dummy::sendToDevice, 0, len);
+ memcpy(hw::io::device_io_dummy::sendToDevice, data, len);
+ hw::io::device_io_dummy::waitsForDeviceSend = false;
++ hw::io::device_io_dummy::cv_send.notify_all();
++ #endif
++}
++
++void Wallet::setLedgerCallback(void (*sendToLedgerDevice)(unsigned char *command, unsigned int cmd_len)) {
++ #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))
++ MERROR("MONERO compiled with #if !(defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI))");
++ return;
++ #else
++ hw::io::device_io_dummy::setLedgerCallback(sendToLedgerDevice);
+ #endif
+}
+
} // namespace
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
-index edf8bb8ce..4e9c21ecb 100644
+index edf8bb8ce..6bfb61cb8 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
-@@ -301,6 +301,24 @@ private:
+@@ -301,6 +301,20 @@ private:
// cache connection status to avoid unnecessary RPC calls
mutable std::atomic<bool> m_is_connected;
boost::optional<epee::net_utils::http::login> m_daemon_login{};
@@ -546,33 +589,30 @@ index edf8bb8ce..4e9c21ecb 100644
+ bool getWaitsForDeviceSend();
+
+ bool getWaitsForDeviceReceive();
-+
-+ void setDeviceReceivedData(unsigned char *data, size_t len);
-+
-+ void setDeviceSendData(unsigned char *data, size_t len);
};
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index 764adbfbf..53ec4abfc 100644
+index 764adbfbf..a48a6be54 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
-@@ -1150,6 +1150,18 @@ struct Wallet
+@@ -1150,6 +1150,19 @@ struct Wallet
//! get bytes sent
virtual uint64_t getBytesSent() = 0;
+
+ // HIDAPI_DUMMY
-+ virtual bool getStateIsConnected() = 0;
-+ virtual unsigned char* getSendToDevice() = 0;
-+ virtual size_t getSendToDeviceLength() = 0;
-+ virtual unsigned char* getReceivedFromDevice() = 0;
-+ virtual size_t getReceivedFromDeviceLength() = 0;
-+ virtual bool getWaitsForDeviceSend() = 0;
-+ virtual bool getWaitsForDeviceReceive() = 0;
-+
-+ virtual void setDeviceReceivedData(unsigned char* data, size_t len) = 0;
-+ virtual void setDeviceSendData(unsigned char* data, size_t len) = 0;
++ static bool getStateIsConnected();
++ static unsigned char* getSendToDevice();
++ static size_t getSendToDeviceLength();
++ static unsigned char* getReceivedFromDevice();
++ static size_t getReceivedFromDeviceLength();
++ static bool getWaitsForDeviceSend();
++ static bool getWaitsForDeviceReceive();
++
++ static void setDeviceReceivedData(unsigned char* data, size_t len);
++ static void setDeviceSendData(unsigned char* data, size_t len);
++ static void setLedgerCallback(void (*sendToLedgerDevice)(unsigned char *command, unsigned int cmd_len));
};
/**
@@ -600,5 +640,5 @@ index e81b8f83a..277be6ac9 100644
std::vector<std::string> WalletManagerImpl::findWallets(const std::string &path)
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0007-polyseed.patch b/patches/monero/0007-polyseed.patch
index b590a33..e83678e 100644
--- a/patches/monero/0007-polyseed.patch
+++ b/patches/monero/0007-polyseed.patch
@@ -1,7 +1,7 @@
-From c54ab3f0984159bd47c63b78074caaaac082727a Mon Sep 17 00:00:00 2001
+From 3c3d441cabcaae9eb5d3db2f5cd6c506feb97168 Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 09:42:37 +0100
-Subject: [PATCH 07/14] polyseed
+Subject: [PATCH 07/17] polyseed
Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
---
@@ -814,7 +814,7 @@ index 000000000..2c8c777a7
+#endif //POLYSEED_HPP
\ No newline at end of file
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 25ade04a7..51911bf99 100644
+index 844a1c451..050212ff7 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -728,6 +728,28 @@ bool WalletImpl::recoverFromDevice(const std::string &path, const std::string &p
@@ -902,7 +902,7 @@ index 25ade04a7..51911bf99 100644
{
return m_wallet->get_seed_language();
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
-index 4e9c21ecb..32e12284b 100644
+index 6bfb61cb8..e7873dd78 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -79,9 +79,19 @@ public:
@@ -926,7 +926,7 @@ index 4e9c21ecb..32e12284b 100644
void setSeedLanguage(const std::string &arg) override;
// void setListener(Listener *) {}
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index 53ec4abfc..be1c3704e 100644
+index a48a6be54..8fa0bbd42 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
@@ -709,6 +709,10 @@ struct Wallet
@@ -940,7 +940,7 @@ index 53ec4abfc..be1c3704e 100644
/**
* @brief StartRefresh - Start/resume refresh thread (refresh every 10 seconds)
*/
-@@ -1320,6 +1324,27 @@ struct WalletManager
+@@ -1321,6 +1325,27 @@ struct WalletManager
uint64_t kdf_rounds = 1,
WalletListener * listener = nullptr) = 0;
@@ -1282,5 +1282,5 @@ index a752f15b9..a619bdd15 100644
uint32_t m_multisig_threshold;
std::vector<crypto::public_key> m_multisig_signers;
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0008-coin-control.patch b/patches/monero/0008-coin-control.patch
index 442921d..d0f2811 100644
--- a/patches/monero/0008-coin-control.patch
+++ b/patches/monero/0008-coin-control.patch
@@ -1,7 +1,7 @@
-From 753d7eee48d8e9ab5950e48dc984cc1038c11dd1 Mon Sep 17 00:00:00 2001
+From 722abaf1f84d8444d40e277f8b97e54250195856 Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Tue, 12 Mar 2024 11:07:57 +0100
-Subject: [PATCH 08/14] coin control
+Subject: [PATCH 08/17] coin control
---
src/simplewallet/simplewallet.cpp | 2 +-
@@ -504,7 +504,7 @@ index 000000000..c43e45abd
+
+#endif //FEATHER_COINS_INFO_H
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 51911bf99..933cc2531 100644
+index 050212ff7..b259528ef 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -35,6 +35,7 @@
@@ -760,7 +760,7 @@ index 51911bf99..933cc2531 100644
{
return m_subaddress.get();
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
-index 32e12284b..a82f270e4 100644
+index e7873dd78..bc782dd4a 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -46,6 +46,7 @@ class PendingTransactionImpl;
@@ -813,7 +813,7 @@ index 32e12284b..a82f270e4 100644
// multi-threaded refresh stuff
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index be1c3704e..013b5bcba 100644
+index 8fa0bbd42..7e67f02fd 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
@@ -263,6 +263,51 @@ struct AddressBook
@@ -1095,5 +1095,5 @@ index a619bdd15..4f324c238 100644
void set_unspent(size_t idx);
bool is_spent(const transfer_details &td, bool strict = true) const;
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0009-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch b/patches/monero/0009-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch
index 9e04787..9741055 100644
--- a/patches/monero/0009-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch
+++ b/patches/monero/0009-Add-hex-encoding-and-tx-key-getter-for-PendingTransc.patch
@@ -1,7 +1,7 @@
-From 0ba0339b11d8f7f66f2d5cd27075d438a76351b4 Mon Sep 17 00:00:00 2001
+From f386189cf3c5b433251b2cf493ba264a1a79fb7e Mon Sep 17 00:00:00 2001
From: M <m@cakewallet.com>
Date: Fri, 21 Apr 2023 15:43:47 -0400
-Subject: [PATCH 09/14] Add hex encoding and tx key getter for
+Subject: [PATCH 09/17] Add hex encoding and tx key getter for
PendingTransction in wallet api.
---
@@ -51,7 +51,7 @@ index 403bfe281..0cc6c58e9 100644
private:
friend class WalletImpl;
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index 013b5bcba..f421fdc05 100644
+index 7e67f02fd..7f1462a44 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
@@ -127,6 +127,8 @@ struct PendingTransaction
@@ -64,5 +64,5 @@ index 013b5bcba..f421fdc05 100644
/**
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0010-Add-recoverDeterministicWalletFromSpendKey.patch b/patches/monero/0010-Add-recoverDeterministicWalletFromSpendKey.patch
index 022604d..8d939f8 100644
--- a/patches/monero/0010-Add-recoverDeterministicWalletFromSpendKey.patch
+++ b/patches/monero/0010-Add-recoverDeterministicWalletFromSpendKey.patch
@@ -1,7 +1,7 @@
-From cb02355313d504e6a44f8f70b8eb2be64167ffd4 Mon Sep 17 00:00:00 2001
+From 55f5311122fb9d19e870fa4a330c59d76ca92aac Mon Sep 17 00:00:00 2001
From: Konstantin Ullrich <konstantinullrich12@gmail.com>
Date: Wed, 11 Oct 2023 16:47:59 +0200
-Subject: [PATCH 10/14] Add recoverDeterministicWalletFromSpendKey
+Subject: [PATCH 10/17] Add recoverDeterministicWalletFromSpendKey
This function is used by Cake Wallet to enable polyseed (dart implementation)
support.
@@ -19,7 +19,7 @@ Co-authored-by: Godwin Asuquo <godilite@gmail.com>
5 files changed, 75 insertions(+)
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index 933cc2531..d8fe108b4 100644
+index b259528ef..20ccbfb35 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -824,6 +824,35 @@ bool WalletImpl::recover(const std::string &path, const std::string &password, c
@@ -59,7 +59,7 @@ index 933cc2531..d8fe108b4 100644
{
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
-index a82f270e4..9e1fbb40b 100644
+index bc782dd4a..bfe81c590 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -77,6 +77,10 @@ public:
@@ -74,10 +74,10 @@ index a82f270e4..9e1fbb40b 100644
const std::string &password,
const std::string &device_name);
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h
-index f421fdc05..c8d6bb179 100644
+index 7f1462a44..27e8b1426 100644
--- a/src/wallet/api/wallet2_api.h
+++ b/src/wallet/api/wallet2_api.h
-@@ -1323,6 +1323,25 @@ struct WalletManager
+@@ -1324,6 +1324,25 @@ struct WalletManager
return createWalletFromKeys(path, password, language, testnet ? TESTNET : MAINNET, restoreHeight, addressString, viewKeyString, spendKeyString);
}
@@ -149,5 +149,5 @@ index 28fcd36c9..be3ff8184 100644
const std::string &password,
NetworkType nettype,
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0011-add-monero-submodule-support.patch b/patches/monero/0011-add-monero-submodule-support.patch
index cbe6f35..413aaba 100644
--- a/patches/monero/0011-add-monero-submodule-support.patch
+++ b/patches/monero/0011-add-monero-submodule-support.patch
@@ -1,7 +1,7 @@
-From 846d3f60093add6653d9102d841288066fc08311 Mon Sep 17 00:00:00 2001
+From ec93b6bf725eeff0999fdd9d603c4578cb19ae07 Mon Sep 17 00:00:00 2001
From: cyan <cyjan@mrcyjanek.net>
Date: Thu, 7 Nov 2024 16:46:24 +0000
-Subject: [PATCH 11/14] add monero submodule support
+Subject: [PATCH 11/17] add monero submodule support
---
CMakeLists.txt | 6 +++---
@@ -61,5 +61,5 @@ index 3188c88db..9fbdb3c05 100644
if (ptx_vector.empty())
{
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0012-fix-iOS-depends-build.patch b/patches/monero/0012-fix-iOS-depends-build.patch
index dcf7c86..5d75424 100644
--- a/patches/monero/0012-fix-iOS-depends-build.patch
+++ b/patches/monero/0012-fix-iOS-depends-build.patch
@@ -1,7 +1,7 @@
-From 53cc0482e55a39b5dbf2261fea11fcb160778800 Mon Sep 17 00:00:00 2001
+From 73d6ad9d513f776afb1c1f5f2d74e3b06fad7eeb Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Thu, 21 Nov 2024 06:05:03 -0500
-Subject: [PATCH 12/14] fix iOS depends build
+Subject: [PATCH 12/17] fix iOS depends build
---
CMakeLists.txt | 4 ----
@@ -100,5 +100,5 @@ index 71b8f78cc..0f53f024e 100644
#if TARGET_OS_MAC && (!defined(MAC_OS_X_VERSION_MIN_REQUIRED) || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
return boost::logic::tribool(IOPSGetTimeRemainingEstimate() != kIOPSTimeRemainingUnlimited);
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0013-include-locale-only-when-targeting-WIN32.patch b/patches/monero/0013-include-locale-only-when-targeting-WIN32.patch
index 64ef6aa..453d651 100644
--- a/patches/monero/0013-include-locale-only-when-targeting-WIN32.patch
+++ b/patches/monero/0013-include-locale-only-when-targeting-WIN32.patch
@@ -1,8 +1,7 @@
-From 1eacd30724559749be5adeb31d763f44c3f221f9 Mon Sep 17 00:00:00 2001
+From db52bcebe23b29b35ae538f01e72ed4f7f66f931 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Mon, 18 Nov 2024 10:57:37 -0500
-Subject: [PATCH 13/14] include locale only when targeting WIN32
-
+Subject: [PATCH 13/17] include locale only when targeting WIN32
---
CMakeLists.txt | 6 +++++-
@@ -10,7 +9,7 @@ Subject: [PATCH 13/14] include locale only when targeting WIN32
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 1eac121db..3a4e8f7e1 100644
+index 1eac121db..5938be622 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1089,7 +1089,11 @@ if(NOT Boost_FOUND)
@@ -27,7 +26,7 @@ index 1eac121db..3a4e8f7e1 100644
# Boost System is header-only since 1.69
if (Boost_VERSION_STRING VERSION_LESS 1.69.0)
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
-index d8fe108b4..e3e838b13 100644
+index 20ccbfb35..c43803033 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -46,7 +46,9 @@
@@ -41,5 +40,5 @@ index d8fe108b4..e3e838b13 100644
#include "bc-ur/src/bc-ur.hpp"
#if defined(HIDAPI_DUMMY) && !defined(HAVE_HIDAPI)
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0014-change-earliest-fork-height-message.patch b/patches/monero/0014-change-earliest-fork-height-message.patch
index e73f776..c097694 100644
--- a/patches/monero/0014-change-earliest-fork-height-message.patch
+++ b/patches/monero/0014-change-earliest-fork-height-message.patch
@@ -1,7 +1,7 @@
-From 2d31234e859bff817d30d91b21d9412375668aae Mon Sep 17 00:00:00 2001
+From be01eac2724d22cd7225bb17fba7a443efe8d8d6 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Wed, 29 Jan 2025 16:13:28 +0100
-Subject: [PATCH 14/14] change earliest fork height message
+Subject: [PATCH 14/17] change earliest fork height message
---
src/wallet/wallet2.cpp | 2 +-
@@ -21,5 +21,5 @@ index 8720e18b1..69da11d9c 100644
bool close_enough = (int64_t)height >= (int64_t)earliest_height - early_blocks && earliest_height != std::numeric_limits<uint64_t>::max(); // start using the rules that many blocks beforehand
if (close_enough)
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0015-remove-trivially_copyable-assert.patch b/patches/monero/0015-remove-trivially_copyable-assert.patch
index d78268f..4f22f32 100644
--- a/patches/monero/0015-remove-trivially_copyable-assert.patch
+++ b/patches/monero/0015-remove-trivially_copyable-assert.patch
@@ -1,7 +1,7 @@
-From 71cf45cfbd571ec58e8b2a1d408ff74804bf7e1d Mon Sep 17 00:00:00 2001
+From b62446750e904978cd1a8f90d5f2d1437a3db5a9 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Thu, 20 Feb 2025 08:36:28 +0100
-Subject: [PATCH] remove trivially_copyable assert
+Subject: [PATCH 15/17] remove trivially_copyable assert
---
contrib/epee/include/span.h | 1 -
@@ -20,5 +20,5 @@ index 01dc387d6..2ad733a2f 100644
return {reinterpret_cast<const std::uint8_t*>(std::addressof(src)), sizeof(T)};
}
--
-2.48.1
+2.49.0
diff --git a/patches/monero/0016-pr-9880.patch b/patches/monero/0016-pr-9880.patch
index dbf604f..22d1825 100644
--- a/patches/monero/0016-pr-9880.patch
+++ b/patches/monero/0016-pr-9880.patch
@@ -1,14 +1,14 @@
-From 31ef09596a9d8d547905577823ff52d33e10a3d2 Mon Sep 17 00:00:00 2001
+From ab4e853571329b3ccb745c393220c047b03f2b2c Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Tue, 1 Apr 2025 11:30:45 +0200
-Subject: [PATCH] pr-9880
+Subject: [PATCH 16/17] pr-9880
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 5938be6..1c47285 100644
+index 5938be622..1c4728578 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,7 +216,7 @@ function(forbid_undefined_symbols)
diff --git a/patches/monero/0017-fix-unary_function-__unary_function.patch b/patches/monero/0017-fix-unary_function-__unary_function.patch
index 22e5275..b964dbe 100644
--- a/patches/monero/0017-fix-unary_function-__unary_function.patch
+++ b/patches/monero/0017-fix-unary_function-__unary_function.patch
@@ -1,14 +1,14 @@
-From 0a3a2df040e177b5741706e0a0c76fac585f0356 Mon Sep 17 00:00:00 2001
+From 32f2e6cc2e184bfdaa92a5d45a15983c896f6816 Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Thu, 10 Apr 2025 13:28:05 +0200
-Subject: [PATCH] fix: unary_function -> __unary_function
+Subject: [PATCH 17/17] fix: unary_function -> __unary_function
---
src/cryptonote_basic/cryptonote_basic_impl.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/cryptonote_basic/cryptonote_basic_impl.h b/src/cryptonote_basic/cryptonote_basic_impl.h
-index b423573..a9aef7a 100644
+index b423573c5..a9aef7a2a 100644
--- a/src/cryptonote_basic/cryptonote_basic_impl.h
+++ b/src/cryptonote_basic/cryptonote_basic_impl.h
@@ -40,7 +40,11 @@ namespace cryptonote {