Skip to content

frolvanya/near-gas

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crates.io (downloads) Docs.rs Rust Version

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 usage in Near Protocol]

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%