3 releases (breaking)

✓ Uses Rust 2018 edition

new 0.4.0 Oct 9, 2019
0.3.0 Oct 14, 2019
0.2.0 Jun 24, 2019
0.1.0 Jun 20, 2019

#111 in Cryptography

47 downloads per month
Used in 7 crates (6 directly)

MIT license

72KB
1.5K SLoC

This library is a Work in Progress. Don't use in production.

This is an Iota library written in rust.

Build Status Windows Build status Version Documentation License

Documentation

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

This library currently requires nightly rust to build.

Things that are done:

  • Stateful Accounts
    • Plugins
    • Storage
    • Events
    • Conditional Deposit Addresses
  • Crypto
    • Curl
    • Kerl
    • PearlDiver
    • ISS
    • HMAC
    • Signing
  • Model
    • Bundle
    • Input
    • Inputs
    • Neighbor
    • Signature
    • Transaction
    • Transfer
  • Utils
    • Checksum
    • Constants
    • Converter
    • InputValidator
    • IotaAPIUtils
    • IotaUnitConversion
    • IotaUnits
    • Multisig
    • SeedRandomGenerator
    • StopWatch
    • TrytesConverter
  • API
    • IRI API calls and responses
      • add neighbors
      • attach_to_tangle
      • find_transactions
      • get_balances
      • broadcastTransactions
      • storeTransactions
      • get_inclusion_states
      • get_neighbors
      • get_node_info
      • get_tips
      • get_transactions_to_approve
      • get_trytes
      • remove_neighbor
      • were_addresses_spent_from
      • check_consistency
    • Ease of use wrappers/helpers
      • new_address
      • get_new_address
      • send_trytes
      • store_and_broadcast
      • get_inputs
      • prepare_transfers
      • traverse_bundle
      • send_transfer
      • get_bundle

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)

use iota_api::options::SendTransferOptions;
use iota_lib_rs::prelude::*;
use iota_model::Transfer;
use iota_conversion::trytes_converter;

fn main() {
    let trytes =
        "HELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDHELLOWORLDD";
    let message = trytes_converter::to_trytes("Hello World").unwrap();
    let transfer = Transfer {
        address: trytes.to_string(),
        // Don't need to specify the field 
        // because the field and variable
        // have the same name
        message,
        // Populate the rest of the fields with default values
        ..Transfer::default()
    };
    let mut api = iota_api::API::new("https://node01.iotatoken.nl");
    let tx = api
        .send_transfers(
            transfer,
            &trytes,
            SendTransferOptions {
                local_pow: true,
                threads: 2,
                ..SendTransferOptions::default()
            },
        )
        .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

Dependencies

~70KB