dti

Crates.iodti
lib.rsdti
version0.1.2
sourcesrc
created_at2023-07-01 18:47:57.699045
updated_at2023-08-04 13:02:07.633807
descriptionA library to handle digital token identifiers as defined in ISO 24165
homepagehttps://21analytics.ch
repositoryhttps://gitlab.com/21analytics/dti
max_upload_size
id905638
size841,225
Lucas Betschart (lclc)

documentation

https://docs.rs/dti/

README

DTI Rust library

Crates.io Documentation

dti is a Rust library to handle digital token identifiers as defined in ISO 24165.

To learn more about DTI visit Digital Token Identifier Foundation.

Example

fn main() {
    let data = dti::DTIData::new().unwrap();
    let r: &dti::Record = dti::by_dti(&data, "4H95J0R2X").unwrap();
    assert_eq!(
        r.normative
            .as_ref()
            .unwrap()
            .genesis_block_hash
            .clone()
            .unwrap_or_default(),
        "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
    );
}

Usage

Add dti to your Cargo.toml:

cargo add dti

ToDos

  • Implement auxiliary_mechanism as enum
  • Implement genesis_block_hash_algorithm as enum
  • Implement underlying_asset_external_identifier_type as enum
  • Implement DTIExternalIdentifiers (this is currently not used in any token definition)
  • Implement test for OrigLangLongName -> Currently there is no asset with a OrigLangLongName
  • underlying_asset_external_identifiers -> Currently there is no asset with more than one UnderlyingAssetExternalIdentifier

Authors

This crate is developed and maintained by 21 Analytics.

License

This project is licensed under the GNU Affero General Public license.

Commit count: 10

cargo fmt