Skip to content

🦀 ⚡️ The ultimate package for Areon Network.

License

Notifications You must be signed in to change notification settings

alperencantez/areoxide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Areoxide

Areoxide is a lightweight and efficient library designed to wrap RPC methods for the Areon Network. It simplifies the process of interacting with Areon Network's RPC endpoints, enabling developers to build robust applications with ease.


Features

  • Simplified API: Intuitive functions to interact with Areon Network RPC endpoints.
  • Lightweight: Minimal dependencies for easy integration.
  • Flexible: Supports various use cases, including querying network data and more.
  • Extensible: Easily extendable to include additional Areon RPC methods.

Getting Started

Importing the Library

To use Areoxide, first, include it in your Rust project:

use areoxide::prelude::{rpc::RpcClient};

Initialization

Create an instance of the AreonClient by providing the RPC endpoint URL:

const RPC_URL: &str = "https://mainnet-rpc.areon.network";
let client: RpcClient = RpcClient::init(RPC_URL);

Example Usage

You will probably need areoxide::prelude::util and areoxide::prelude::constants modules in order to make conversions from hexadecimal to decimal and vice versa. You can import it with:

use areoxide::prelude::{util, constants};

Onchain balance control

   match client.get_balance("0x".to_string()).await {
        Ok(balance) => {
            println!("Balance: {:#?}", util::hexadecimal_str_to_decimal_str(balance).unwrap())
        }
        Err(e) => eprintln!("Error fetching balance: {}", e),
    }

Get contract code

    match client.get_code("0x".to_string(), constants::BLOCK_STATE_LATEST.to_string()).await {
        Ok(code) => println!("Address code: {:#?}", code),
        Err(e) => eprintln!("Error fetching code: {}", e),
    }

Transaction Receipt

 match client.get_transaction_receipt("0x".to_string()).await {
        Ok(receipt) => println!("TX receipt: {:#?}", receipt),
        Err(e) => eprintln!("Error fetching tx receipt: {}", e),
}

Contributing

We welcome contributions to improve Areoxide! Feel free to submit issues, feature requests, or pull requests to the GitHub repository.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature-name)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature-name)
  5. Open a pull request

License

Areoxide is licensed under the MIT License.

About

🦀 ⚡️ The ultimate package for Areon Network.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages