updated to support asset() and type() functionality

This commit is contained in:
Some Random Crypto Guy
2025-08-08 10:04:46 +01:00
parent 1831f243ff
commit 7e278fac3d
10 changed files with 9468 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ then
function sha256sum() { shasum -a 256 "$@" ; } && export -f sha256sum
fi
for coin in monero wownero zano;
for coin in monero wownero zano salvium;
do
submodule_hash=$(git ls-tree HEAD ${coin} | xargs | awk '{ print $3 }')
COIN=$(echo "$coin" | tr a-z A-Z)

View File

@@ -0,0 +1,11 @@
name: SalviumC
description: monero_c salvium bindings
output: 'lib/src/generated_bindings_salvium.g.dart'
headers:
entry-points:
- '../../salvium_libwallet2_api_c/src/main/cpp/wallet2_api_c.h'
exclude-all-by-default: true
functions:
include:
- "SALVIUM_.+"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
// ignore_for_file: constant_identifier_names
const String wallet2_api_c_h_sha256 = "d6a6d49046e67051e6ee8409d025587a8fcfe16515346139c0723ec9031ba9bf";
const String wallet2_api_c_cpp_sha256 = "a426ea10242ec51646cd8f27c1baecac1796035f518b66163ed3ed00255f6247-1f49c178ee19f55088c85be40215a12183b4ef02";
const String wallet2_api_c_exp_sha256 = "e2d945d4c9e635008d23cbe936be5bb3e8f03addf54945827aed951e911f9784";

File diff suppressed because it is too large Load Diff

View File

@@ -7,3 +7,4 @@ cd "$(realpath $(dirname $0))"
dart run ffigen --config ffigen_wownero.yaml
dart run ffigen --config ffigen_monero.yaml
dart run ffigen --config ffigen_zano.yaml
dart run ffigen --config ffigen_salvium.yaml

View File

@@ -0,0 +1,5 @@
export const salviumChecksum = {
wallet2_api_c_h_sha256: "d6a6d49046e67051e6ee8409d025587a8fcfe16515346139c0723ec9031ba9bf",
wallet2_api_c_cpp_sha256: "a426ea10242ec51646cd8f27c1baecac1796035f518b66163ed3ed00255f6247-1f49c178ee19f55088c85be40215a12183b4ef02",
wallet2_api_c_exp_sha256: "e2d945d4c9e635008d23cbe936be5bb3e8f03addf54945827aed951e911f9784",
}

View File

@@ -1,6 +1,6 @@
#ifndef SALVIUMC_CHECKSUMS
#define SALVIUMC_CHECKSUMS
const char * SALVIUM_wallet2_api_c_h_sha256 = "9e80c4b59a0509aa02fbf01e8df2881b89f82225d1765bfa7856cbdbaf7af116";
const char * SALVIUM_wallet2_api_c_cpp_sha256 = "d229507db508e574bd2badf4819a38dbead8c16a84311ad32c22c887a6003439-0232839913b13cf0ab0bb7ad25fff0c05f37d2fe";
const char * SALVIUM_wallet2_api_c_exp_sha256 = "d0f95f1f3bc49f1f59fe4eb0b61826128d7d3bb75405d5a01a252d02db03097d";
#ifndef MONEROC_CHECKSUMS
#define MONEROC_CHECKSUMS
const char * SALVIUM_wallet2_api_c_h_sha256 = "d6a6d49046e67051e6ee8409d025587a8fcfe16515346139c0723ec9031ba9bf";
const char * SALVIUM_wallet2_api_c_cpp_sha256 = "a426ea10242ec51646cd8f27c1baecac1796035f518b66163ed3ed00255f6247-1f49c178ee19f55088c85be40215a12183b4ef02";
const char * SALVIUM_wallet2_api_c_exp_sha256 = "e2d945d4c9e635008d23cbe936be5bb3e8f03addf54945827aed951e911f9784";
#endif

View File

@@ -290,6 +290,12 @@ bool SALVIUM_TransactionInfo_isCoinbase(void* txInfo_ptr) {
return txInfo->isCoinbase();
DEBUG_END()
}
uint8_t SALVIUM_TransactionInfo_type(void* txInfo_ptr) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
return txInfo->type();
DEBUG_END()
}
uint64_t SALVIUM_TransactionInfo_amount(void* txInfo_ptr) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
@@ -308,6 +314,16 @@ uint64_t SALVIUM_TransactionInfo_blockHeight(void* txInfo_ptr) {
return txInfo->blockHeight();
DEBUG_END()
}
const char* SALVIUM_TransactionInfo_asset(void* txInfo_ptr) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);
std::string str = txInfo->asset();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
DEBUG_END()
}
const char* SALVIUM_TransactionInfo_description(void* txInfo_ptr) {
DEBUG_START()
Monero::TransactionInfo *txInfo = reinterpret_cast<Monero::TransactionInfo*>(txInfo_ptr);

View File

@@ -162,12 +162,16 @@ extern ADDAPI bool SALVIUM_TransactionInfo_isPending(void* txInfo_ptr);
extern ADDAPI bool SALVIUM_TransactionInfo_isFailed(void* txInfo_ptr);
// virtual bool isCoinbase() const = 0;
extern ADDAPI bool SALVIUM_TransactionInfo_isCoinbase(void* txInfo_ptr);
// virtual uint8_t type() const = 0;
extern ADDAPI uint8_t SALVIUM_TransactionInfo_type(void* txInfo_ptr);
// virtual uint64_t amount() const = 0;
extern ADDAPI uint64_t SALVIUM_TransactionInfo_amount(void* txInfo_ptr);
// virtual uint64_t fee() const = 0;
extern ADDAPI uint64_t SALVIUM_TransactionInfo_fee(void* txInfo_ptr);
// virtual uint64_t blockHeight() const = 0;
extern ADDAPI uint64_t SALVIUM_TransactionInfo_blockHeight(void* txInfo_ptr);
// virtual std::string asset() const = 0;
extern ADDAPI const char* SALVIUM_TransactionInfo_asset(void* txInfo_ptr);
// virtual std::string description() const = 0;
extern ADDAPI const char* SALVIUM_TransactionInfo_description(void* txInfo_ptr);
// virtual std::set<uint32_t> subaddrIndex() const = 0;