9 releases (breaking)

new 0.7.0 Oct 29, 2024
0.6.1 Oct 11, 2024
0.5.0 Sep 24, 2024
0.4.0 Aug 23, 2024
0.1.1 Jan 15, 2024

#1245 in Encoding

Download history 954/week @ 2024-07-09 1189/week @ 2024-07-16 1370/week @ 2024-07-23 1627/week @ 2024-07-30 1697/week @ 2024-08-06 2834/week @ 2024-08-13 2167/week @ 2024-08-20 1524/week @ 2024-08-27 2845/week @ 2024-09-03 2863/week @ 2024-09-10 2475/week @ 2024-09-17 3234/week @ 2024-09-24 3674/week @ 2024-10-01 3736/week @ 2024-10-08 4015/week @ 2024-10-15 3337/week @ 2024-10-22

15,399 downloads per month
Used in 4 crates

Apache-2.0

400KB
7K 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

~9–19MB
~267K SLoC