summaryrefslogtreecommitdiff
path: root/impls/monero.rs/src/lib.rs
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2025-01-05 13:56:28 +0100
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2025-01-05 13:56:36 +0100
commit64d5d9b6f8d8bfc9b6b7781860bd2f7d042e247a (patch)
treeb504fb99017176075294252f0b00fd8d8ab4593f /impls/monero.rs/src/lib.rs
parent085d74b37b478be77bc873d66876247a751aa957 (diff)
enable logging
fix build
Diffstat (limited to 'impls/monero.rs/src/lib.rs')
-rw-r--r--impls/monero.rs/src/lib.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/impls/monero.rs/src/lib.rs b/impls/monero.rs/src/lib.rs
index 56373da..b40cb94 100644
--- a/impls/monero.rs/src/lib.rs
+++ b/impls/monero.rs/src/lib.rs
@@ -136,6 +136,7 @@ impl WalletManager {
/// ```
pub fn new() -> WalletResult<Arc<Self>> {
unsafe {
+ bindings::MONERO_WalletManagerFactory_setLogLevel(4);
let ptr = bindings::MONERO_WalletManagerFactory_getWalletManager();
let ptr = NonNull::new(ptr).ok_or(WalletError::NullPointer)?;
Ok(Arc::new(WalletManager { ptr }))
@@ -1032,6 +1033,16 @@ impl Wallet {
.map_err(|_| WalletError::FfiError("Invalid proxy address".to_string()))?;
unsafe {
+ let c_empty = CString::new("").unwrap();
+ let c_log_tag = CString::new("moneroc").unwrap();
+ bindings::MONERO_Wallet_init3(
+ self.ptr.as_ptr(),
+ c_empty.as_ptr(),
+ c_log_tag.as_ptr(),
+ c_empty.as_ptr(),
+ true,
+ );
+
let result = bindings::MONERO_Wallet_init(
self.ptr.as_ptr(),
c_daemon_address.as_ptr(),
@@ -1042,7 +1053,7 @@ impl Wallet {
config.light_wallet,
c_proxy_address.as_ptr(),
);
-
+
if result {
Ok(())
} else {
@@ -1117,6 +1128,13 @@ impl Wallet {
}
}
+ pub fn refresh_async(&self) -> WalletResult<Refreshed> {
+ unsafe {
+ bindings::MONERO_Wallet_refreshAsync(self.ptr.as_ptr());
+ return Ok(Refreshed)
+ }
+ }
+
/// Initiates a transfer from the wallet to the specified destinations.
///
/// # Returns