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

clvm-utils

Utility functions for processing clvm programs and structures

28 releases (16 breaking)

new 0.21.1 Mar 6, 2025
0.20.0 Feb 14, 2025
0.17.0 Dec 14, 2024
0.15.0 Oct 11, 2024
0.1.15 Nov 28, 2022

#633 in Magic Beans

Download history 285/week @ 2024-11-17 195/week @ 2024-11-24 117/week @ 2024-12-01 323/week @ 2024-12-08 378/week @ 2024-12-15 399/week @ 2024-12-22 548/week @ 2024-12-29 427/week @ 2025-01-05 615/week @ 2025-01-12 812/week @ 2025-01-19 250/week @ 2025-01-26 498/week @ 2025-02-02 680/week @ 2025-02-09 497/week @ 2025-02-16 1031/week @ 2025-02-23 1237/week @ 2025-03-02

3,498 downloads per month
Used in 21 crates (15 directly)

Apache-2.0

85KB
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

~13MB
~310K SLoC