near-token
near-token is crate for work with tokens in near-protocol.
The crate includes NearToken type and constructors for converting data as NearToken and as u128 type values.
Examples
Basic
Add near-token to your dependencies:
Here is the basic usage of near-token crate:
use NearToken;
serde support
In order to use NearToken in serde
-serializable structs, enable serde
feature:
Here is the basic usage of near-token crate with serde:
// When `serde` feature is enabled, NearToken can be used in serde-serializable structs.
// NearToken will be serialized to a token-precision u128 value encoded as string.
borsh support
In order to use NearToken in borsh
-serializable structs, enable borsh
feature:
Here is the basic usage of near-token crate with borsh:
use ;
use NearToken;
NearToken information
NEAR is used to price computation and storage on the NEAR infrastructure. The network charges transaction fees in NEAR to process changes and transactions.
License
This project is licensed under the MIT license and Apache-2.0 license.