12 releases (breaking)

0.10.0 Jan 29, 2025
0.9.0 Dec 2, 2024
0.8.0 Dec 2, 2024
0.7.0 Oct 29, 2024
0.1.1 Jan 15, 2024

#1187 in Encoding

Download history 7864/week @ 2024-10-26 5903/week @ 2024-11-02 5548/week @ 2024-11-09 3324/week @ 2024-11-16 2780/week @ 2024-11-23 2845/week @ 2024-11-30 2766/week @ 2024-12-07 2973/week @ 2024-12-14 458/week @ 2024-12-21 1293/week @ 2024-12-28 3117/week @ 2025-01-04 3852/week @ 2025-01-11 3025/week @ 2025-01-18 1809/week @ 2025-01-25 1998/week @ 2025-02-01 2697/week @ 2025-02-08

10,620 downloads per month
Used in 6 crates

Apache-2.0

480KB
9K 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–22MB
~342K SLoC