13 releases (breaking)

0.10.1 Feb 24, 2025
0.9.0 Dec 2, 2024
0.7.0 Oct 29, 2024
0.2.0 Apr 19, 2024
0.1.1 Jan 15, 2024

#1192 in Encoding

Download history 3240/week @ 2024-11-18 2689/week @ 2024-11-25 2896/week @ 2024-12-02 2735/week @ 2024-12-09 3000/week @ 2024-12-16 364/week @ 2024-12-23 1413/week @ 2024-12-30 3462/week @ 2025-01-06 3895/week @ 2025-01-13 2539/week @ 2025-01-20 1811/week @ 2025-01-27 1999/week @ 2025-02-03 2760/week @ 2025-02-10 2653/week @ 2025-02-17 1913/week @ 2025-02-24 4067/week @ 2025-03-03

11,414 downloads per month
Used in 9 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–23MB
~350K SLoC