Crates.io | v4v |
lib.rs | v4v |
version | 0.5.22 |
source | src |
created_at | 2024-08-16 14:18:31.215152 |
updated_at | 2024-10-18 18:02:44.54628 |
description | Value-for-value helper utilities for Podcasting 2.0 |
homepage | |
repository | https://github.com/rssblue/v4v |
max_upload_size | |
id | 1340373 |
size | 112,501 |
A set of helper functions for dealing with value-for-value (V4V) calculations and transactions.
Modules include
Check out docs.rs for all available functions.
let splits = vec![1, 98, 1];
let total_sats = 10;
// The crate ensures that
// - even after rounding, the total number of sats is preserved
// - if possible, everyone gets at least 1 sat (and thus their own TLV record)
assert_eq!(v4v::pc20::calc::compute_sat_recipients(&splits, total_sats), vec![1, 8, 1]);
cargo add v4v
Please feel free to contribute by submitting a PR on GitHub.