Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions impls/monero.dart/lib/monero.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,18 @@ bool Wallet_setProxy(wallet ptr, {required String address}) {
return s;
}

@Deprecated("TODO")
bool Wallet_setCaFilePath(wallet wm_ptr, String path) {
debugStart?.call('MONERO_WalletManager_setCaFilePath');
lib ??= MoneroC(DynamicLibrary.open(libPath));

final path_ = path.toNativeUtf8().cast<Char>();
final result = lib!.MONERO_Wallet_setCaFilePath(wm_ptr, path_);
calloc.free(path_);
debugEnd?.call('MONERO_WalletManager_setCaFilePath');
return result;
}

@Deprecated("TODO")
int Wallet_balance(wallet ptr, {required int accountIndex}) {
debugStart?.call('MONERO_Wallet_balance');
Expand Down
18 changes: 18 additions & 0 deletions impls/monero.dart/lib/src/generated_bindings_monero.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,24 @@ class MoneroC {
late final _MONERO_Wallet_setProxy = _MONERO_Wallet_setProxyPtr.asFunction<
bool Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Char>)>();

bool MONERO_Wallet_setCaFilePath(
ffi.Pointer<ffi.Void> wallet_ptr,
ffi.Pointer<ffi.Char> path,
) {
return _MONERO_Wallet_setCaFilePath(
wallet_ptr,
path,
);
}

late final _MONERO_Wallet_setCaFilePathPtr = _lookup<
ffi.NativeFunction<
ffi.Bool Function(ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.Char>)>>('MONERO_Wallet_setCaFilePath');
late final _MONERO_Wallet_setCaFilePath =
_MONERO_Wallet_setCaFilePathPtr.asFunction<
bool Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Char>)>();

int MONERO_Wallet_balance(
ffi.Pointer<ffi.Void> wallet_ptr,
int accountIndex,
Expand Down
5 changes: 5 additions & 0 deletions impls/monero.dart/lib/src/monero.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,11 @@ class MoneroWallet implements Wallet2Wallet {
void setProxy({required String address}) {
monero.Wallet_setProxy(walletPtr, address: address);
}

@override
bool setCaFilePath(String path) {
return monero.Wallet_setCaFilePath(walletPtr, path);
}

@override
void setRecoveringFromDevice({required bool recoveringFromDevice}) {
Expand Down
1 change: 1 addition & 0 deletions impls/monero.dart/lib/src/wallet2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ abstract class Wallet2Wallet {
void setTrustedDaemon({required bool arg});
bool trustedDaemon();
void setProxy({required String address});
bool setCaFilePath(String path);
int balance({required int accountIndex});
int unlockedBalance({required int accountIndex});
int viewOnlyBalance({required int accountIndex});
Expand Down
12 changes: 12 additions & 0 deletions monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <thread>
#include "../../../../monero/src/wallet/api/wallet2_api.h"
#include "../../../../lwsf/include/lws_frontend.h"
#include "../../../../lwsf/src/wallet.h"
#include "monero_checksum.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -1344,6 +1345,17 @@ bool MONERO_Wallet_setProxy(void* wallet_ptr, const char* address) {
DEBUG_END()
}

bool MONERO_Wallet_setCaFilePath(void* wallet_ptr, const char* path) {
DEBUG_START()
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
lwsf::internal::wallet *lwsf_wallet = dynamic_cast<lwsf::internal::wallet*>(wallet);
if (!lwsf_wallet)
return false;
lwsf_wallet->setCaFilePath(std::string(path));
return true;
DEBUG_END()
}

uint64_t MONERO_Wallet_balance(void* wallet_ptr, uint32_t accountIndex) {
DEBUG_START()
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
Expand Down
2 changes: 2 additions & 0 deletions monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ extern ADDAPI void MONERO_Wallet_setTrustedDaemon(void* wallet_ptr, bool arg);
extern ADDAPI bool MONERO_Wallet_trustedDaemon(void* wallet_ptr);
// virtual bool setProxy(const std::string &address) = 0;
extern ADDAPI bool MONERO_Wallet_setProxy(void* wallet_ptr, const char* address);
// virtual bool setCaFilePath(const std::string &path) = 0;
extern ADDAPI bool MONERO_Wallet_setCaFilePath(void* wallet_ptr, const char* path);
// virtual uint64_t balance(uint32_t accountIndex = 0) const = 0;
extern ADDAPI uint64_t MONERO_Wallet_balance(void* wallet_ptr, uint32_t accountIndex);
// uint64_t balanceAll() const {
Expand Down