xavax-avalanche

Test Status

A Rust implementation of the Avalanche Virtual Machine transaction format, including serialization.

xavax-avalanche in a nutshell:

All that is missing is signing transactions and keychain management, and all that is taken care of by the xavax-crypto crate! (see the xavax-api crate for a full avalanche network SDK)


Some things to point out

I recommend using this library for research purposes only.


Documentation

xavax-avalanche 'n' friends will have quite a lot of documentation and examples, this includes the Metro wallet itself as an example (although the early wallet will have a lot of spaghetti code).

That being said, there are many examples that you can read about and try here:

ps, this crate is very early and I am lazy so I'm future-proofing this README, some of these links may be temporarily invalid as a result...


Usage

At first, add this to your Cargo.toml file: toml [dependencies] xavax-avalanche = "0.1.0-beta"

You could create a base transaction, among other transactions: ```rust use xavaxavalanche::avm::txformat::*;

//Create a base tx let mut tx: BaseTx = BaseTx::default(); //Manually set the values tx.typeid = 0; tx.networkid = 5;

//Turn the tx into a serialized byte payload let payload = tx.to_bytes();

//Or parse a byte-payload into a base_tx: let mut tx: BaseTx = BaseTx::default();

let txbytes: Vec = [0, 0, 0, 0, 0, 0, 0, 0, 0,].tovec(); tx.frombytes(&txbytes); ``` ps: the xavax-api which might still be upcoming will automatically generate different transactions types

Then go read some examples, maybe watch the tutorial videos that I might make some day, and experiment!

Although I heavily recommend checking out the full xavax-api crate, as this crate alone simple handles transaction formats for the Avalanche virtual machine!


## Changes, Roadmap & Info The entire xavax-api with its dependencies such as xavax-avalanche are very, very early, while I will try to keep the main API fairly consistent and stable, the back-end will get a lot of optimizations in the future. Not to mention the addition of better docs.

More information about the future as well as a roadmap of the api can be found at the xavax

### Temorary note: The API is unfinished at the current time, if you want more information about what the full API will be you can follow me at twitter, or look at the xavax introduction blog.


## License xavax-avalanche is distributed with the Apache 2.0 License.