Crate unc_token

source ·
Expand description

A UncToken type to represent a value of Near.

Each UncTokens is composed of a floating point number of tokens where each integer unit is equal to one atto-Near. UncToken is implementing the common trait FromStr. Also, have utils function to parse from str into u128.

§Examples

use unc_token::UncToken;

let one_unc = UncToken::from_attounc(10_u128.pow(24));
assert_eq!(one_unc, UncToken::from_unc(1));
assert_eq!(one_unc, UncToken::from_milliunc(1000));

§Crate features

  • borsh (optional) - When enabled allows UncToken to serialized and deserialized by borsh.

  • serde (optional) - When enabled allows UncToken to serialized and deserialized by serde.

  • schemars (optional) - Implements schemars::JsonSchema for UncToken.

  • interactive-clap (optional) - Implements interactive_clap::ToCli for UncToken.

Structs§

Enums§