near-gas 0.2.4

a small crate to work with NEAR Gas unit values ergonomically and efficiently (NEAR Protocol)
Documentation

near-gas

near-gas is crate for work with gas data in near-protocol.

The crate includes NearGas type and constructors for converting data as NearGas and as u64 type values.

near-gas examples

use near_gas::{NearGas};

fn main() {
    
  let data = "12.657 TGas";
  
  let near_gas = NearGas::from_str(data);
  
  let gas = near_gas.as_gas();
  assert_eq!(gas, 12657000000000);

  let giga_gas = near_gas.as_ggas();
  assert_eq!(giga_gas, 12657);
}

NearGas information

On every transaction you send to the network NEAR charges you a fee (aka gas fee). This fee is used to indirectly pay the people that keep the network infrastructure, and to incentivize developers of smart contracts. For more information.

Gas usege in Near Protocol

License

This project is licensed under the MIT license and Apache-2.0 license.