11 releases (breaking)

0.9.0 Dec 2, 2024
0.7.0 Oct 29, 2024
0.2.0 Apr 19, 2024
0.1.1 Jan 15, 2024

#1178 in Encoding

Download history 2239/week @ 2024-08-30 2518/week @ 2024-09-06 3199/week @ 2024-09-13 2776/week @ 2024-09-20 3562/week @ 2024-09-27 3888/week @ 2024-10-04 3338/week @ 2024-10-11 4242/week @ 2024-10-18 6985/week @ 2024-10-25 5973/week @ 2024-11-01 5714/week @ 2024-11-08 3830/week @ 2024-11-15 2792/week @ 2024-11-22 3033/week @ 2024-11-29 2546/week @ 2024-12-06 2037/week @ 2024-12-13

10,885 downloads per month
Used in 5 crates

Apache-2.0

445KB
8K SLoC

Celestia types

Core types, traits and constants you may encounter when working with the Celestia ecosystem.

Most of the types are built on top of the celestia-tendermint-rs and celestia-proto and support the serialization and deserialization using protobuf and serde to the format understood by nodes in celestia network.

use celestia_types::{AppVersion, Blob, nmt::Namespace};

let my_namespace = Namespace::new_v0(&[1, 2, 3, 4, 5]).expect("Invalid namespace");
let blob = Blob::new(my_namespace, b"some data to store on blockchain".to_vec(), AppVersion::V2)
    .expect("Failed to create a blob");

assert_eq!(
    &serde_json::to_string_pretty(&blob).unwrap(), 
    indoc::indoc! {r#"{
      "namespace": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQIDBAU=",
      "data": "c29tZSBkYXRhIHRvIHN0b3JlIG9uIGJsb2NrY2hhaW4=",
      "share_version": 0,
      "commitment": "m0A4feU6Fqd5Zy9td3M7lntG8A3PKqe6YdugmAsWz28=",
      "index": -1
    }"#},
);

Dependencies

~13–21MB
~317K SLoC