GithubHelp home page GithubHelp logo

eduardo-anosa-evardonie-jr / wallet.rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iotaledger/wallet.rs

0.0 1.0 0.0 918 KB

Build wallets and other applications involving IOTA value transfer.

License: Apache License 2.0

Rust 98.82% JavaScript 1.18%

wallet.rs's Introduction

IOTA Wallet Library

status

Introduction

The wallet library is a stateful package with a standardised interface for developers to build applications involving IOTA value transactions. It offers abstractions to handle IOTA payments and can optionally interact with IOTA Stronghold for seed handling, seed storage and state backup. Alternatively you can use the EnvMnemonic SignerType and a SQLite database. See the full specification here.

Warning

This library is in active development. The library targets the Chrysalis testnet and does not work with current IOTA mainnet.

The Stronghold integration is not complete. We recommend you use SQLite and the EnvMnemonic SignerType (allowing you to store your mnemonic as an environment variable).

Prerequisites

Rust and Cargo are required. Install them here.

We recommend you update Rust to the latest stable version rustup update stable. Nightly should be fine but there's a chance some changes are not compatible.

no_std is not supported currently, but we are working on it, and will provide it as a feature once the new implementation is ready.

Dependencies

cmake and openssl are required. In order to run the build process succesfully using Cargo you might need install additional build tools on your system.

Windows

cmake can be downloaded on the official website and openssl can be installed with vcpkg or chocolatey.

  • Installing openssl with vcpkg:
$ ./vcpkg.exe install openssl:x64-windows
$ ./vcpkg.exe integrate install
# you may want to add this to the system environment variables since you'll need it to compile the crate
$ set VCPKGRS_DYNAMIC=1
  • Installing openssl with chocolatey:
$ choco install openssl
# you may need to set the OPENSSL_ROOT_DIR environment variable
$ set OPENSSL_ROOT_DIR="C:\Program Files\OpenSSL-Win64"

macOS

cmake and openssl can be installed with Homebrew:

$ brew install cmake
$ brew install [email protected]
# you may want to add this to your .zshrc or .bashrc since you'll need it to compile the crate
$ OPENSSL_ROOT_DIR=$(brew --prefix [email protected])

Linux

Install cmake and openssl with your distro's package manager or download from their websites. On Debian and Ubuntu you will also need build-essential.

Usage

To use the library, add this to your Cargo.toml:

[dependencies]
iota-wallet = { git = "https://github.com/iotaledger/wallet.rs" }

Initialisation

In order to use the library you first need to create an AccountManager:

use iota_wallet::{
    account_manager::AccountManager, client::ClientOptionsBuilder, signing::SignerType,
    storage::sqlite::SqliteStorageAdapter,
};
use std::path::PathBuf;
#[tokio::main]
async fn main() -> iota_wallet::Result<()> {
    let storage_folder: PathBuf = "./my-db".into();
    let manager =
        AccountManager::with_storage_adapter(&storage_folder, SqliteStorageAdapter::new(&storage_folder, "accounts")?)?;
    let client_options = ClientOptionsBuilder::node("http://api.lb-0.testnet.chrysalis2.com")?.build();
    let account = manager
        .create_account(client_options)
        .signer_type(SignerType::EnvMnemonic)
        .initialise()?;
    Ok(())
}

API reference

If you'd like to explore the implementation in more depth, the following command generates docs for the whole crate:

cargo doc --document-private-items --no-deps --open

Other Examples

You can see the examples in the examples directory and try them with:

cargo run --example # lists the available examples
cargo run --example transfer # execute the `transfer` example

Joining the discussion

If you want to get involved in discussions about this library, or you're looking for support, go to the #clients-discussion channel on Discord.

wallet.rs's People

Contributors

lucasfernog avatar cvarley100 avatar rajivshah3 avatar laumair avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.