dti

A library to handle digital token identifiers as defined in ISO 24165

3 releases

0.1.2 Aug 4, 2023
0.1.1 Jul 2, 2023
0.1.0 Jul 1, 2023

#217 in Finance

AGPL-3.0

115KB
583 lines

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.

Dependencies

~5–17MB
~236K SLoC