Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rssblue/v4v
V4V calculations and transactions for Podcasting 2.0
https://github.com/rssblue/v4v
podcasting20 rss v4v
Last synced: 6 days ago
JSON representation
V4V calculations and transactions for Podcasting 2.0
- Host: GitHub
- URL: https://github.com/rssblue/v4v
- Owner: rssblue
- Created: 2024-08-12T09:23:01.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-08-30T12:37:29.000Z (3 months ago)
- Last Synced: 2024-08-30T14:24:58.236Z (3 months ago)
- Topics: podcasting20, rss, v4v
- Language: Rust
- Homepage: https://crates.io/crates/v4v
- Size: 129 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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](pc20::calc), [V4V payments](pc20::payments), and [sat forwarding](pc20::forwarding).
- [alby] for interacting with [Alby](https://getalby.com)'s API.Check out [docs.rs](https://docs.rs/v4v) for all available functions.
## Example
```rust
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
```text
cargo add v4v
```## Contribute
Please feel free to contribute by submitting a PR on [GitHub](https://github.com/rssblue/v4v).