#podcast #rss #bitcoin

v4v

Value-for-value helper utilities for Podcasting 2.0

35 releases (4 breaking)

0.5.22 Oct 18, 2024
0.5.21 Aug 31, 2024
0.4.6 Aug 19, 2024
0.3.1 Aug 17, 2024
0.1.0 Aug 16, 2024

#37 in #podcast

Download history 907/week @ 2024-08-13 1442/week @ 2024-08-20 942/week @ 2024-08-27 67/week @ 2024-09-03 9/week @ 2024-09-17 79/week @ 2024-09-24 116/week @ 2024-10-15 12/week @ 2024-10-22 2/week @ 2024-10-29 8/week @ 2024-11-05

138 downloads per month

MIT/Apache

90KB
1.5K SLoC

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.

Example

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]);

Install

cargo add v4v

Contribute

Please feel free to contribute by submitting a PR on GitHub.

Dependencies

~6–17MB
~227K SLoC