Crates.io | iota-lib-rs-preview |
lib.rs | iota-lib-rs-preview |
version | 0.1.6 |
source | src |
created_at | 2018-07-22 15:09:08.594835 |
updated_at | 2018-08-18 21:48:45.262505 |
description | A rust implementation of the IOTA API |
homepage | https://github.com/njaremko/iota-lib-rs |
repository | https://github.com/njaremko/iota-lib-rs |
max_upload_size | |
id | 75511 |
size | 240,948 |
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:
https://docs.rs/iota-lib-rs-preview
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)
extern crate iota_lib_rs;
extern crate futures;
use iota_lib_rs::iota_api;
use iota_lib_rs::iota_api::SendTransferOptions;
use iota_lib_rs::utils::trytes_converter;
use iota_lib_rs::model::*;
use futures::executor::block_on;
fn main() {
let trytes = "HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD";
let message = trytes_converter::to_trytes("Hello World").unwrap();
let mut transfer = Transfer::default();
*transfer.value_mut() = 0;
*transfer.address_mut() = trytes.to_string();
*transfer.message_mut() = message;
let api = iota_api::API::new("https://trinity.iota.fm");
let options = SendTransferOptions{
seed: trytes.to_string(),
depth: 3,
min_weight_magnitude: 14,
local_pow: true,
threads: None,
inputs: None,
reference: None,
remainder_address: None,
security: None,
hmac_key: None,
};
// This line is commented out because travis CI can't handle it,
// but you should uncomment it
let tx = block_on(api.send_transfers(vec![transfer], options)).unwrap();
println!("{:?}", tx);
}
If you feel so inclined, you can find my address for donations at: