Skip to content
/ v4v Public

V4V calculations and transactions for Podcasting 2.0

Notifications You must be signed in to change notification settings

rssblue/v4v

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A set of helper functions for dealing with value-for-value (V4V) calculations and transactions.

Modules include

  • [pc20] for Podcasting 2.0-specific functions, including those related to sat calculations, V4V payments, and sat forwarding.
  • [alby] for interacting with Alby's API.

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.

About

V4V calculations and transactions for Podcasting 2.0

Topics

Resources

Stars

Watchers

Forks

Languages