From 5fa0905552ec65409ca459dd73687e6ab63abb0b Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Tue, 28 Oct 2025 14:54:58 +0100 Subject: [PATCH 1/3] Update monero-cpp submodule to v0.8.16 --- external/monero-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/monero-cpp b/external/monero-cpp index 42786b1..4e22908 160000 --- a/external/monero-cpp +++ b/external/monero-cpp @@ -1 +1 @@ -Subproject commit 42786b1c838209a9d8d2c4c500e72fd6502f0654 +Subproject commit 4e22908e511a531ec58bc04dc9b262187b7f8051 From 4fa39f8277e31cebe0a218432aa0b54c6f1f5cf3 Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Tue, 28 Oct 2025 14:56:30 +0100 Subject: [PATCH 2/3] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77d7444..4717c7e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Python library for using Monero -A Python library for creating Monero applications using RPC and Python bindings to [monero v0.18.4.0 'Fluorine Fermi'](https://github.com/monero-project/monero/tree/v0.18.4.0). +A Python library for creating Monero applications using RPC and Python bindings to [monero v0.18.4.3 'Fluorine Fermi'](https://github.com/monero-project/monero/tree/v0.18.4.3). * Supports wallet and daemon RPC clients. * Supports client-side wallets using Python bindings. From 1ee557cc20b032f1628c85a065f0c43acc8733de Mon Sep 17 00:00:00 2001 From: everoddandeven Date: Tue, 28 Oct 2025 15:37:34 +0100 Subject: [PATCH 3/3] Update new set_daemon_connection api --- src/cpp/daemon/py_monero_daemon.h | 10 ++++++---- src/cpp/py_monero.cpp | 17 ++++------------- src/cpp/wallet/py_monero_wallet.h | 13 ++----------- src/python/monero_rpc_connection.pyi | 6 ++++-- src/python/monero_wallet.pyi | 10 ++-------- 5 files changed, 18 insertions(+), 38 deletions(-) diff --git a/src/cpp/daemon/py_monero_daemon.h b/src/cpp/daemon/py_monero_daemon.h index 8f5986e..8d7db95 100644 --- a/src/cpp/daemon/py_monero_daemon.h +++ b/src/cpp/daemon/py_monero_daemon.h @@ -1668,7 +1668,6 @@ class PyMoneroIsKeyImageSpentParams : public PyMoneroRequestParams { class PyMoneroRpcConnection : public monero_rpc_connection { public: boost::optional m_zmq_uri; - boost::optional m_proxy; int m_priority; uint64_t m_timeout; boost::optional m_response_time; @@ -1693,13 +1692,14 @@ class PyMoneroRpcConnection : public monero_rpc_connection { } } - PyMoneroRpcConnection(const std::string& uri = "", const std::string& username = "", const std::string& password = "", const std::string& zmq_uri = "", int priority = 0, uint64_t timeout = 0) { + PyMoneroRpcConnection(const std::string& uri = "", const std::string& username = "", const std::string& password = "", const std::string& proxy_uri, const std::string& zmq_uri = "", int priority = 0, uint64_t timeout = 0) { m_uri = uri; m_username = username; m_password = password; m_zmq_uri = zmq_uri; m_priority = priority; m_timeout = timeout; + m_proxy_uri = proxy_uri; auto factory = new net::http::client_factory(); m_http_client = factory->create(); } @@ -1711,6 +1711,7 @@ class PyMoneroRpcConnection : public monero_rpc_connection { m_zmq_uri = rpc.m_zmq_uri; m_priority = rpc.m_priority; m_timeout = rpc.m_timeout; + m_proxy_uri = rpc.m_proxy_uri; auto factory = new net::http::client_factory(); m_http_client = factory->create(); } @@ -1719,6 +1720,7 @@ class PyMoneroRpcConnection : public monero_rpc_connection { m_uri = rpc.m_uri; m_username = rpc.m_username; m_password = rpc.m_password; + m_proxy_uri = rpc.m_proxy_uri; m_zmq_uri = ""; m_priority = 0; m_timeout = 500; @@ -1790,8 +1792,8 @@ class PyMoneroRpcConnection : public monero_rpc_connection { m_http_client->disconnect(); } - if (m_proxy != boost::none) { - if(!m_http_client->set_proxy(m_proxy.get())) { + if (m_proxy_uri != boost::none) { + if(!m_http_client->set_proxy(m_proxy_uri.get())) { throw std::runtime_error("Could not set proxy"); } } diff --git a/src/cpp/py_monero.cpp b/src/cpp/py_monero.cpp index 6f37344..e44d82f 100644 --- a/src/cpp/py_monero.cpp +++ b/src/cpp/py_monero.cpp @@ -251,12 +251,7 @@ PYBIND11_MODULE(monero, m) { .def_readwrite("uri", &PyMoneroRpcConnection::m_uri) .def_readwrite("username", &PyMoneroRpcConnection::m_username) .def_readwrite("password", &PyMoneroRpcConnection::m_password) - .def_property("proxy", - [](const PyMoneroRpcConnection& self) { return self.m_proxy; }, - [](PyMoneroRpcConnection& self, std::optional val) { - if (val.has_value()) self.m_proxy = val.value(); - else self.m_proxy = boost::none; - }) + .def_readwrite("proxy_uri", &PyMoneroRpcConnection::m_proxy_uri) .def_property("zmq_uri", [](const PyMoneroRpcConnection& self) { return self.m_zmq_uri; }, [](PyMoneroRpcConnection& self, std::optional val) { @@ -1453,14 +1448,10 @@ PYBIND11_MODULE(monero, m) { assert_wallet_is_not_closed(&self); MONERO_CATCH_AND_RETHROW(self.set_daemon_connection(connection)); }, py::arg("connection")) - .def("set_daemon_connection", [](PyMoneroWallet& self, std::string uri, std::string username, std::string password) { - assert_wallet_is_not_closed(&self); - MONERO_CATCH_AND_RETHROW(self.set_daemon_connection(uri, username, password)); - }, py::arg("uri") = "", py::arg("username") = "", py::arg("password") = "") - .def("set_daemon_proxy", [](PyMoneroWallet& self, const std::string& uri) { + .def("set_daemon_connection", [](PyMoneroWallet& self, std::string uri, std::string username, std::string password, std::string proxy) { assert_wallet_is_not_closed(&self); - MONERO_CATCH_AND_RETHROW(self.set_daemon_proxy(uri)); - }, py::arg("uri") = "") + MONERO_CATCH_AND_RETHROW(self.set_daemon_connection(uri, username, password, proxy)); + }, py::arg("uri") = "", py::arg("username") = "", py::arg("password") = "", py::arg("proxy")) .def("get_daemon_connection", [](PyMoneroWallet& self) { assert_wallet_is_not_closed(&self); MONERO_CATCH_AND_RETHROW(self.get_daemon_connection()); diff --git a/src/cpp/wallet/py_monero_wallet.h b/src/cpp/wallet/py_monero_wallet.h index f9560e9..24d0f1c 100644 --- a/src/cpp/wallet/py_monero_wallet.h +++ b/src/cpp/wallet/py_monero_wallet.h @@ -2436,12 +2436,12 @@ class PyMoneroWallet : public monero::monero_wallet { ); } - void set_daemon_connection(const std::string& uri, const std::string& username = "", const std::string& password = "") override { + void set_daemon_connection(const std::string& uri, const std::string& username = "", const std::string& password = "", const std::string& proxy = "") override { PYBIND11_OVERRIDE( void, monero_wallet, set_daemon_connection, - uri, username, password + uri, username, password, proxy ); } @@ -2454,15 +2454,6 @@ class PyMoneroWallet : public monero::monero_wallet { ); } - void set_daemon_proxy(const std::string& uri = "") override { - PYBIND11_OVERRIDE( - void, - monero_wallet, - set_daemon_proxy, - uri - ); - } - boost::optional get_daemon_connection() const override { PYBIND11_OVERRIDE( boost::optional, diff --git a/src/python/monero_rpc_connection.pyi b/src/python/monero_rpc_connection.pyi index 79de1bf..c0ecb29 100644 --- a/src/python/monero_rpc_connection.pyi +++ b/src/python/monero_rpc_connection.pyi @@ -9,7 +9,7 @@ class MoneroRpcConnection: """Connection authentication password.""" priority: int """Connection priority.""" - proxy: str | None + proxy_uri: str | None """Connection proxy address.""" response_time: int | None """Connection response time.""" @@ -33,13 +33,15 @@ class MoneroRpcConnection: """ ... @typing.overload - def __init__(self, uri: str = '', username: str = '', password: str = '', zmq_uri: str = '', priority: int = 0, timeout: int = 0) -> None: + def __init__(self, uri: str = '', username: str = '', password: str = '', proxy_uri: str = '', zmq_uri: str = '', priority: int = 0, timeout: int = 0) -> None: """ Initialize a RPC connection. :param str uri: URI string :param str username: username used for authentication :param str password: password used for authentication + :param str proxy_uri: proxy uri + :param str zmq_uri: ZMQ uri :param int priority: priorioty of the connection :param int timeout: connection timeout in milliseconds """ diff --git a/src/python/monero_wallet.pyi b/src/python/monero_wallet.pyi index b5cce44..0e94c63 100644 --- a/src/python/monero_wallet.pyi +++ b/src/python/monero_wallet.pyi @@ -928,20 +928,14 @@ class MoneroWallet: """ ... @typing.overload - def set_daemon_connection(self, uri: str = '', username: str = '', password: str = '') -> None: + def set_daemon_connection(self, uri: str = '', username: str = '', password: str = '', proxy_uri: str = '') -> None: """ Set the wallet's daemon connection. :param str uri: is the connection to set. :param str username: is the username to authenticate with the daemon (optional). :param str password: is the password to authenticate with the daemon (optional). - """ - ... - def set_daemon_proxy(self, uri: str = '') -> None: - """ - Set the Tor proxy to the daemon. - - :param str uri: is the proxy uri to set. + :param str proxy_uri: proxy for the connection. """ ... def set_restore_height(self, restore_height: int) -> None: