#programs #clvm #chia #byte #processing #structures #clvmr

clvm-utils

Utility functions for processing clvm programs and structures

22 releases (12 breaking)

new 0.17.0 Dec 14, 2024
0.15.0 Oct 11, 2024
0.13.0 Aug 30, 2024
0.9.0 May 23, 2024
0.1.15 Nov 28, 2022

#648 in Magic Beans

Download history 397/week @ 2024-08-28 257/week @ 2024-09-04 88/week @ 2024-09-11 306/week @ 2024-09-18 156/week @ 2024-09-25 150/week @ 2024-10-02 421/week @ 2024-10-09 422/week @ 2024-10-16 254/week @ 2024-10-23 498/week @ 2024-10-30 538/week @ 2024-11-06 368/week @ 2024-11-13 246/week @ 2024-11-20 133/week @ 2024-11-27 142/week @ 2024-12-04 372/week @ 2024-12-11

961 downloads per month
Used in 17 crates (12 directly)

Apache-2.0

84KB
2K SLoC

CLVM Utils

This provides various commonly needed utilities for working with CLVM values.

Currying Example

use clvm_utils::CurriedProgram;
use clvm_traits::{ToClvm, clvm_curried_args};
use clvmr::{Allocator, serde::node_to_bytes};

let a = &mut Allocator::new();

let program = a.one();

let ptr = CurriedProgram {
    program,
    args: clvm_curried_args!(42, 75),
}
.to_clvm(a)
.unwrap();

let hex = hex::encode(node_to_bytes(a, ptr).unwrap());

// (a (q . 1) (c (q . 42) (c (q . 75) 1)))
assert_eq!(hex, "ff02ffff0101ffff04ffff012affff04ffff014bff01808080");

Dependencies

~11MB
~264K SLoC