From a2ef1040df905f00482597b50eaec62f4f7b99b1 Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 5 Jan 2024 14:59:45 +0100 Subject: [PATCH] coins update --- .github/workflows/linux.yml | 6 ++++-- libbridge/src/main/cpp/wallet2_api_c.cpp | 10 ++++++++++ libbridge/src/main/cpp/wallet2_api_c.h | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0455f8f..0630b8b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,7 +1,9 @@ name: Linux Release run-name: Building monero_c for linux -on: push - +on: + push: + tags: + - '*' # cat envs.txt | sed 's/ //g' | sed 's/: /=/g' | grep -v '#' > .env # export $(cat .env | xargs) env: diff --git a/libbridge/src/main/cpp/wallet2_api_c.cpp b/libbridge/src/main/cpp/wallet2_api_c.cpp index 388c0b0..3e56263 100644 --- a/libbridge/src/main/cpp/wallet2_api_c.cpp +++ b/libbridge/src/main/cpp/wallet2_api_c.cpp @@ -499,6 +499,16 @@ void* MONERO_Coins_coin(void* coins_ptr, int index) { Monero::Coins *coins = reinterpret_cast(coins_ptr); return coins->coin(index); } + +int MONERO_Coins_getAll_size(void* coins_ptr) { + Monero::Coins *coins = reinterpret_cast(coins_ptr); + return coins->getAll().size(); +} +void* MONERO_Coins_getAll_byIndex(void* coins_ptr, int index) { + Monero::Coins *coins = reinterpret_cast(coins_ptr); + return coins->getAll()[index]; +} + // virtual std::vector getAll() const = 0; // virtual void refresh() = 0; void MONERO_Coins_refresh(void* coins_ptr) { diff --git a/libbridge/src/main/cpp/wallet2_api_c.h b/libbridge/src/main/cpp/wallet2_api_c.h index 53b75f2..27aa2e3 100644 --- a/libbridge/src/main/cpp/wallet2_api_c.h +++ b/libbridge/src/main/cpp/wallet2_api_c.h @@ -304,6 +304,8 @@ int MONERO_Coins_count(void* coins_ptr); // virtual CoinsInfo * coin(int index) const = 0; void* MONERO_Coins_coin(void* coins_ptr, int index); // virtual std::vector getAll() const = 0; +int MONERO_Coins_getAll_size(void* coins_ptr); +void* MONERO_Coins_getAll_byIndex(void* coins_ptr, int index); // virtual void refresh() = 0; void MONERO_Coins_refresh(void* coins_ptr); // virtual void setFrozen(std::string public_key) = 0;