An unofficial implementation of the IOTA api in rust.

Build Status Windows Build status Version Documentation License

This library requires nightly rust until async becomes stable

This is a port of the IOTA Java/JS API into Rust. It works, but I wouldn't trust it with real money yet. Having said that, please let me know if you have any suggestions or run into any issues.

Here are some reasons you might want to use this library: 1. It has a very fast implementation of local PoW (1-2s with MwM = 14, 4-6ms with MwM = 9 on my laptop) 2. You'll benefit from Rust's very nice type system 3. This library is more actively maintained than Jota 4. Now that the library is working, I'm going to be obsessively going over it to improve safety, performance, and usability 5. It would make me personally happy :)

Documentation

https://docs.rs/iota-lib-rs

This library currently requires nightly rust to build.

Things that are done:

Here's an example of how to send a transaction: (Note that we're using the address as the seed in send_transfer()...don't do this) ```rust extern crate iotalibrs; extern crate futures;

use iotalibrs::iotaapi; use iotalibrs::iotaapi::SendTransferOptions; use iotalibrs::utils::trytesconverter; use iotalib_rs::model::*;

use futures::executor::block_on;

fn main() { let trytes = "HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD"; let message = trytesconverter::totrytes("Hello World").unwrap(); let mut transfer = Transfer::default(); *transfer.valuemut() = 0; *transfer.addressmut() = trytes.tostring(); *transfer.messagemut() = message; let api = iotaapi::API::new("https://pow3.iota.community"); let options = SendTransferOptions{ seed: trytes.tostring(), depth: 3, minweightmagnitude: 14, localpow: true, threads: None, inputs: None, reference: None, remainderaddress: None, security: None, hmackey: None, }; let tx = blockon(api.send_transfers(vec![transfer], options)).unwrap(); println!("{:?}", tx); } ```

Donations:

If you feel so inclined, you can find my address for donations at:

https://ecosystem.iota.org/projects/iota-lib-rs