2 Commits

Author SHA1 Message Date
Some Random Crypto Guy
bb00145095 updated to support asset() and type() functionality 2025-08-08 10:04:46 +01:00
Some Random Crypto Guy
d4aa0b6bfa fixed iOS RandomX issue (thanks Julian & Cypher Stack) 2025-08-08 08:50:46 +01:00
11 changed files with 9509 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

@@ -0,0 +1,41 @@
Subject: [PATCH] ios no randomx JIT
From: julian <julian@cypherstack.com>
---
Index: src/cryptonote_core/cryptonote_tx_utils.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp
--- a/src/cryptonote_core/cryptonote_tx_utils.cpp (revision f9f0a43b1f5d9ec9f444bafa88073f1ddaf6e344)
+++ b/src/cryptonote_core/cryptonote_tx_utils.cpp (date 1752524175340)
@@ -1296,16 +1296,24 @@
bool get_block_longhash(const Blockchain *pbc, const blobdata& bd, crypto::hash& res, const uint64_t height, const int major_version, const crypto::hash *seed_hash, const int miners)
{
- crypto::hash hash;
if (pbc != NULL)
{
+ crypto::hash hash;
const uint64_t seed_height = rx_seedheight(height);
hash = seed_hash ? *seed_hash : pbc->get_pending_block_id_by_height(seed_height);
- } else
- {
- memset(&hash, 0, sizeof(hash)); // only happens when generating genesis block
- }
- rx_slow_hash(hash.data, bd.data(), bd.size(), res.data);
+ rx_slow_hash(hash.data, bd.data(), bd.size(), res.data);
+ } else
+ {
+ // only happens when generating genesis block
+ // Hardcoded genesis for ios compat
+ const char* hex = "4ade63d5ccb8cfae075e8b882514c471f35da95f85dd1b20fdcd6f3a95caabc5";
+ char bytes[32];
+ for (int i = 0; i < 32; i++) {
+ char byte_str[3] = { hex[i * 2], hex[i * 2 + 1], '\0' };
+ bytes[i] = (char)strtol(byte_str, NULL, 16);
+ }
+ memcpy(res.data, bytes, sizeof(bytes));
+ }
return true;
}

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;