WASM library for hashing Stellar transaction history archive entries. Provides functions to hash TransactionHistoryEntry and TransactionHistoryResultEntry XDR data.
npm:
npm install @withobsrvr/stellar-history-archive-hasherCargo:
cargo add stellar-history-archive-hasherconst {
hash_transaction_history_entry,
hash_transaction_history_result_entry
} = require('@withobsrvr/stellar-history-archive-hasher');
const xdrBytes = new Uint8Array(Buffer.from(base64String, 'base64'));
const hash = hash_transaction_history_entry(xdrBytes);use stellar_history_archive_hasher::internal::{
hash_transaction_history_entry,
hash_transaction_history_result_entry,
};
let hash = hash_transaction_history_entry(&xdr_bytes).unwrap();- Rust toolchain (
rustup) - wasm-pack
wasm-pack build --target nodejs --scope withobsrvrwasm-pack build --target bundler --scope withobsrvrOutput goes to the pkg/ directory.
# Rust unit tests
cargo test
# Manual smoke test (requires Node.js build)
node index.jsrustup update
cargo update# npm (requires npm login to @withobsrvr org)
wasm-pack build --target nodejs --scope withobsrvr
wasm-pack publish --access public
# crates.io
cargo publish