├── documentation ├── .yarnrc.yml ├── static │ └── img │ │ └── cli-wallet.gif ├── .gitignore ├── package.json ├── docusaurus.config.js ├── docs │ ├── 00_welcome.md │ ├── 01_installation.md │ ├── 04_step_by_step.md │ ├── 02_account_manager.md │ └── 03_account.md ├── README.md └── sidebars.js ├── .gitignore ├── .license_template ├── src ├── command │ ├── mod.rs │ ├── account_manager.rs │ └── account.rs ├── error.rs ├── helper.rs ├── main.rs ├── account_manager.rs └── account.rs ├── rustfmt.toml ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── workflows │ ├── test-docs-build.yml │ ├── build_and_test.yml │ └── publish.yml └── pull_request_template.md ├── gon-config.json ├── Cargo.toml ├── README.md ├── LICENSE └── Cargo.lock /documentation/.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-3.2.0.cjs 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /stardust-cli-wallet-db 3 | *.stronghold 4 | archive.log 5 | mnemonic.txt 6 | wallet -------------------------------------------------------------------------------- /.license_template: -------------------------------------------------------------------------------- 1 | // Copyright {20\d{2}(-20\d{2})?} IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 -------------------------------------------------------------------------------- /documentation/static/img/cli-wallet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iotaledger-archive/cli-wallet/HEAD/documentation/static/img/cli-wallet.gif -------------------------------------------------------------------------------- /src/command/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | pub mod account; 5 | pub mod account_manager; 6 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | version = "Two" 2 | comment_width = 120 3 | edition = "2021" 4 | format_code_in_doc_comments = true 5 | group_imports = "StdExternalCrate" 6 | imports_granularity = "Crate" 7 | max_width = 120 8 | normalize_comments = true 9 | normalize_doc_attributes = true 10 | wrap_comments = true 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Discord 4 | url: https://discord.iota.org/ 5 | about: Please ask and answer questions here. 6 | - name: Security vulnerabilities 7 | url: security@iota.org 8 | about: Please report security vulnerabilities here. 9 | -------------------------------------------------------------------------------- /gon-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": ["./target/production/wallet"], 3 | "bundle_id": "org.iota.cli-wallet", 4 | "apple_id": { 5 | "password": "@env:AC_PASSWORD" 6 | }, 7 | "sign": { 8 | "application_identity": "Developer ID Application: IOTA Stiftung (UG77RJKZHH)" 9 | }, 10 | "zip": { 11 | "output_path": "./wallet.zip" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /documentation/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | node_modules 3 | 4 | # Yarn 5 | .pnp.* 6 | .yarn/* 7 | !.yarn/patches 8 | !.yarn/plugins 9 | !.yarn/releases 10 | !.yarn/sdks 11 | !.yarn/versions 12 | 13 | # Production 14 | /build 15 | 16 | # Generated files 17 | .docusaurus 18 | .cache-loader 19 | 20 | # Misc 21 | .DS_Store 22 | .env.local 23 | .env.development.local 24 | .env.test.local 25 | .env.production.local 26 | 27 | npm-debug.log* 28 | yarn-debug.log* 29 | yarn-error.log* 30 | -------------------------------------------------------------------------------- /documentation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cli-wallet", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "iota-wiki start", 7 | "build": "iota-wiki build" 8 | }, 9 | "license": "UNLICENSED", 10 | "engines": { 11 | "node": ">=14.14.0" 12 | }, 13 | "devDependencies": { 14 | "@iota-community/iota-wiki-cli": "iota-community/iota-wiki-cli#v2" 15 | }, 16 | "packageManager": "yarn@3.2.0" 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/test-docs-build.yml: -------------------------------------------------------------------------------- 1 | name: Test Docs Build 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - develop 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | checks: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | - name: Test Build 18 | run: | 19 | cd documentation 20 | yarn install --immutable 21 | yarn build 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Request a feature for cli-wallet 3 | about: Request a feature 4 | --- 5 | 6 | ## Description 7 | 8 | Briefly describe the feature that you are requesting. 9 | 10 | ## Motivation 11 | 12 | Explain why this feature is needed. 13 | 14 | ## Requirements 15 | 16 | Write a list of what you want this feature to do. 17 | 18 | 1. 19 | 2. 20 | 3. 21 | 22 | ## Open questions (optional) 23 | 24 | Use this section to ask any questions that are related to the feature. 25 | 26 | ## Are you planning to do it yourself in a pull request? 27 | 28 | Yes/No. 29 | -------------------------------------------------------------------------------- /documentation/docusaurus.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | plugins: [ 5 | [ 6 | '@docusaurus/plugin-content-docs', 7 | { 8 | id: 'cli-wallet', 9 | path: path.resolve(__dirname, 'docs'), 10 | routeBasePath: 'cli-wallet', 11 | sidebarPath: path.resolve(__dirname, 'sidebars.js'), 12 | editUrl: 'https://github.com/iotaledger/cli-wallet/edit/develop/documentation', 13 | } 14 | ], 15 | ], 16 | staticDirectories: [path.resolve(__dirname, 'static')], 17 | }; 18 | -------------------------------------------------------------------------------- /documentation/docs/00_welcome.md: -------------------------------------------------------------------------------- 1 | # Welcome 2 | 3 | ![cli-wallet](/img/cli-wallet.gif) 4 | 5 | The [cli-wallet](https://github.com/iotaledger/cli-wallet) is a stateful Command Line Interface wrapper around 6 | [wallet.rs](https://github.com/iotaledger/wallet.rs). 7 | 8 | Directly from your terminal, it allows you to: 9 | - Create a wallet; 10 | - Create, maintain and consult accounts; 11 | - Send and receive SMR tokens; 12 | - Mint, melt, burn, send and receive native tokens; 13 | - Mint, burn, send and receive NFTs; 14 | 15 | This documentation explains how to install the `cli-wallet`, describes its Account Manager Interface and Account 16 | Interface and provides detailed step by step examples. 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Report a bug in cli-wallet 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: c-bug 6 | --- 7 | 8 | ## Bug description 9 | 10 | Briefly describe the bug. 11 | 12 | ## Rust version 13 | 14 | Which version of Rust are you running? 15 | 16 | - Rust version: 17 | 18 | ## Version 19 | 20 | Which version of the CLI are you using? 21 | 22 | - Version number, commit, or branch: 23 | 24 | ## Hardware specification 25 | 26 | What hardware are you using? 27 | 28 | - Operating system: 29 | - RAM: 30 | - Cores: 31 | - Device: 32 | 33 | ## Steps To reproduce the bug 34 | 35 | Explain how the maintainer can reproduce the bug. 36 | 37 | 1. 38 | 2. 39 | 3. 40 | 41 | ## Expected behaviour 42 | 43 | Describe what you expect to happen. 44 | 45 | ## Actual behaviour 46 | 47 | Describe what actually happens. 48 | 49 | ## Errors 50 | 51 | Paste any errors that you see, including logs, errors, or screenshots. 52 | -------------------------------------------------------------------------------- /documentation/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | The documentation is built using [Docusaurus 2](https://docusaurus.io/). The deployment is done through a centralized build from [IOTA WIKI](https://github.com/iota-community/iota-wiki). To run a local instance the [IOTA WIKI CLI](https://github.com/iota-community/iota-wiki-cli) is used. 4 | 5 | ## Prerequisites 6 | 7 | - [Node.js v14.14+](https://nodejs.org/en/) 8 | - [yarn](https://yarnpkg.com/getting-started/install) 9 | 10 | ## Installation 11 | 12 | ```console 13 | yarn 14 | ``` 15 | 16 | This command installs all necessary dependencies. 17 | 18 | ## Local Development 19 | 20 | ```console 21 | yarn start 22 | ``` 23 | 24 | This command starts a local, wiki themed development server and opens up a browser window. Most changes are reflected live without having to restart the server. 25 | 26 | ## Including .md file 27 | 28 | ```console 29 | {@import } 30 | ``` 31 | 32 | Example: 33 | 34 | ```console 35 | {@import ../README.md} 36 | ``` 37 | -------------------------------------------------------------------------------- /documentation/docs/01_installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | ## From release 4 | 5 | ### 1. Download 6 | 7 | Go to https://github.com/iotaledger/cli-wallet/releases and download the latest release binary for your platform. 8 | 9 | `cli-wallet` is available on `linux`, `macos` and `windows`. 10 | 11 | ### 2. Verify checksum 12 | 13 | Compare the checksum from the release with a checksum locally produced. 14 | 15 | You can use the following command to produce the checksum. 16 | ```sh 17 | shasum -a 256 [PATH TO BINARY] 18 | ``` 19 | 20 | ### 3. Rename 21 | 22 | For convenience, rename the binary to simply `wallet`. 23 | 24 | ```sh 25 | mv [PATH TO BINARY] wallet 26 | ``` 27 | 28 | ## From source 29 | 30 | ### 1. Install Rust 31 | 32 | https://www.rust-lang.org/tools/install 33 | 34 | ### 2. Compile 35 | 36 | ```sh 37 | git clone https://github.com/iotaledger/cli-wallet -b develop 38 | cd cli-wallet 39 | cargo build --profile production 40 | ``` 41 | 42 | Resulting binary will be located at `./target/production/wallet`. 43 | -------------------------------------------------------------------------------- /documentation/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | tutorialSidebar: [ 17 | { 18 | type: 'doc', 19 | id: 'welcome', 20 | label: 'Welcome' 21 | }, 22 | { 23 | type: 'doc', 24 | id: 'installation', 25 | label: 'Installation' 26 | }, 27 | { 28 | type: 'doc', 29 | id: 'account_manager', 30 | label: 'Account manager' 31 | }, 32 | { 33 | type: 'doc', 34 | id: 'account', 35 | label: 'Account' 36 | }, 37 | { 38 | type: 'doc', 39 | id: 'step_by_step', 40 | label: 'Step by step' 41 | }, 42 | ], 43 | }; 44 | 45 | module.exports = sidebars; 46 | -------------------------------------------------------------------------------- /src/error.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use fern_logger::Error as LoggerError; 5 | use iota_wallet::{ 6 | error::Error as WalletError, 7 | iota_client::{block::Error as BlockError, error::Error as ClientError}, 8 | }; 9 | use serde_json::Error as SerdeJsonError; 10 | 11 | #[derive(Debug, thiserror::Error)] 12 | pub enum Error { 13 | #[error("block error: {0}")] 14 | Block(#[from] BlockError), 15 | #[error("client error: {0}")] 16 | Client(Box), 17 | #[error("io error: {0}")] 18 | Io(#[from] std::io::Error), 19 | #[error("logger error: {0}")] 20 | Logger(#[from] LoggerError), 21 | #[error("{0}")] 22 | Miscellaneous(String), 23 | #[error("generate at least one address before using the faucet")] 24 | NoAddressForFaucet, 25 | #[error("serde_json error: {0}")] 26 | SerdeJson(#[from] SerdeJsonError), 27 | #[error("wallet error: {0}")] 28 | Wallet(#[from] WalletError), 29 | } 30 | 31 | impl From for Error { 32 | fn from(error: ClientError) -> Self { 33 | Error::Client(Box::new(error)) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cli-wallet" 3 | version = "1.0.0-rc.2" 4 | authors = [ "IOTA Stiftung" ] 5 | edition = "2021" 6 | homepage = "https://iota.org" 7 | description = "Command line interface application for the IOTA wallet library." 8 | license = "Apache-2.0" 9 | 10 | [[bin]] 11 | name = "wallet" 12 | path = "src/main.rs" 13 | 14 | [dependencies] 15 | clap = { version = "3.2.23", default-features = false, features = [ "derive", "std" ] } 16 | dialoguer = { version = "0.10.3", default-features = false, features = [ "password" ] } 17 | fern-logger = { version = "0.5.0", default-features = false } 18 | iota-wallet = { git = "https://github.com/iotaledger/wallet.rs", rev = "9ebfa3355af46be72ffbac62a465be122b8c325e", default-features = false, features = [ "storage", "stronghold", "participation" ] } 19 | log = { version = "0.4.17", default-features = false } 20 | prefix-hex = { version = "0.5.0", default-features = false, features = [ "std" ] } 21 | serde_json = { version = "1.0.93", default-features = false } 22 | thiserror = { version = "1.0.38", default-features = false } 23 | tokio = { version = "1.25.0", default-features = false, features = [ "fs" ] } 24 | 25 | [profile.release] 26 | panic = "abort" 27 | 28 | [profile.production] 29 | codegen-units = 1 30 | inherits = "release" 31 | lto = true 32 | strip = "symbols" 33 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description of change 2 | 3 | Please write a summary of your changes and why you made them. 4 | 5 | ## Links to any relevant issues 6 | 7 | Be sure to reference any related issues by adding `fixes issue #`. 8 | 9 | ## Type of change 10 | 11 | Choose a type of change, and delete any options that are not relevant. 12 | 13 | - Bug fix (a non-breaking change which fixes an issue) 14 | - Enhancement (a non-breaking change which adds functionality) 15 | - Breaking change (fix or feature that would cause existing functionality to not work as expected) 16 | - Documentation Fix 17 | 18 | ## How the change has been tested 19 | 20 | Describe the tests that you ran to verify your changes. 21 | 22 | Make sure to provide instructions for the maintainer as well as any relevant configurations. 23 | 24 | ## Change checklist 25 | 26 | Tick the boxes that are relevant to your changes, and delete any items that are not. 27 | 28 | - [ ] I have followed the contribution guidelines for this project 29 | - [ ] I have performed a self-review of my own code 30 | - [ ] I have commented my code, particularly in hard-to-understand areas 31 | - [ ] I have made corresponding changes to the documentation 32 | - [ ] I have added tests that prove my fix is effective or that my feature works 33 | - [ ] I have checked that new and existing unit tests pass locally with my changes 34 | -------------------------------------------------------------------------------- /src/helper.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use dialoguer::{console::Term, theme::ColorfulTheme, Password, Select}; 5 | use iota_wallet::account_manager::AccountManager; 6 | 7 | use crate::error::Error; 8 | 9 | pub fn get_password(prompt: &str, confirmation: bool) -> Result { 10 | let mut password = Password::new(); 11 | 12 | password.with_prompt(prompt); 13 | 14 | if confirmation { 15 | password.with_confirmation("Confirm password", "Password mismatch"); 16 | } 17 | 18 | Ok(password.interact()?) 19 | } 20 | 21 | pub async fn pick_account(manager: &AccountManager) -> Result, Error> { 22 | let accounts = manager.get_accounts().await?; 23 | 24 | match accounts.len() { 25 | 0 => Ok(None), 26 | 1 => Ok(Some(0)), 27 | _ => { 28 | let mut items = Vec::new(); 29 | 30 | for account_handle in accounts { 31 | items.push(account_handle.read().await.alias().clone()); 32 | } 33 | 34 | let index = Select::with_theme(&ColorfulTheme::default()) 35 | .with_prompt("Select an account:") 36 | .items(&items) 37 | .default(0) 38 | .interact_on(&Term::stderr())?; 39 | 40 | Ok(Some(index as u32)) 41 | } 42 | } 43 | } 44 | 45 | pub async fn bytes_from_hex_or_file(hex: Option, file: Option) -> Result>, Error> { 46 | Ok(if let Some(hex) = hex { 47 | Some(prefix_hex::decode(&hex).map_err(|e| Error::Miscellaneous(e.to_string()))?) 48 | } else if let Some(file) = file { 49 | Some(tokio::fs::read(file).await?) 50 | } else { 51 | None 52 | }) 53 | } 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > **Warning** 2 | > Archived - The CLI wallet has been moved to [wallet.rs](https://github.com/iotaledger/wallet.rs) 3 | 4 | # IOTA Stardust CLI Wallet 5 | 6 | ![cli-wallet](./documentation/static/img/cli-wallet.gif) 7 | 8 | Command line interface application for the [IOTA wallet library](https://github.com/iotaledger/wallet.rs). 9 | 10 | ## Usage 11 | 12 | After downloading the CLI, initialize the signer for the wallet. On Mac and Linux you will first need to `chmod +x ./wallet`. 13 | 14 | ``` 15 | ./wallet init --node http://node.url:port --mnemonic MNEMONIC 16 | // Example: 17 | ./wallet init --node "http://localhost:14265" --mnemonic "giant dynamic museum toddler six deny defense ostrich bomb access mercy 18 | blood explain muscle shoot shallow glad autumn author calm heavy hawk abuse rally" 19 | ``` 20 | 21 | Then create a new account 22 | 23 | ``` 24 | ./wallet new ALIAS 25 | // Example: 26 | ./wallet new Alice 27 | ``` 28 | 29 | If you already created an account, you can just run the CLI without args to get to the account selector: 30 | 31 | ``` 32 | ./wallet 33 | ``` 34 | 35 | Alternatively, you can select an existing account by it's alias, to use with the `account` command: 36 | 37 | ``` 38 | ./wallet account Alice 39 | ``` 40 | 41 | ## Commands 42 | 43 | To see the full list of available commands look at the documentation [here](./documentation/docs). 44 | 45 | ## Caveats 46 | 47 | ### Database path 48 | 49 | By default the database path is `./wallet-cli-database` but you can change this with the `WALLET_DATABASE_PATH` environment variable: 50 | 51 | ``` 52 | export WALLET_DATABASE_PATH=/path/to/database # or add it to your .bashrc, .zshrc 53 | ./wallet [COMMAND] [OPTIONS] 54 | ``` 55 | 56 | ## Contributing 57 | 58 | To run the CLI from source, install Rust (usually through [Rustup](https://rustup.rs/)) and run the following commands: 59 | 60 | ``` 61 | git clone https://github.com/iotaledger/cli-wallet 62 | cargo run -- [COMMAND] [OPTIONS] 63 | ``` 64 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | mod account; 5 | mod account_manager; 6 | mod command; 7 | mod error; 8 | mod helper; 9 | 10 | use clap::Parser; 11 | use fern_logger::{LoggerConfigBuilder, LoggerOutputConfigBuilder}; 12 | use log::LevelFilter; 13 | 14 | use self::{ 15 | account_manager::new_account_manager, command::account_manager::AccountManagerCli, error::Error, 16 | helper::pick_account, 17 | }; 18 | 19 | fn logger_init(cli: &AccountManagerCli) -> Result<(), Error> { 20 | let stdout_level_filter = if let Some(log_level) = cli.log_level { 21 | log_level 22 | } else { 23 | LevelFilter::Info 24 | }; 25 | let stdout = LoggerOutputConfigBuilder::default() 26 | .name("stdout") 27 | .level_filter(stdout_level_filter) 28 | .target_exclusions(&["rustls"]) 29 | .color_enabled(true); 30 | let archive = LoggerOutputConfigBuilder::default() 31 | .name("archive.log") 32 | .level_filter(LevelFilter::Debug) 33 | .target_exclusions(&["rustls"]) 34 | .color_enabled(false); 35 | let config = LoggerConfigBuilder::default() 36 | .with_output(stdout) 37 | .with_output(archive) 38 | .finish(); 39 | 40 | fern_logger::logger_init(config)?; 41 | 42 | Ok(()) 43 | } 44 | 45 | async fn run(cli: AccountManagerCli) -> Result<(), Error> { 46 | let (account_manager, account) = new_account_manager(cli.clone()).await?; 47 | 48 | if let Some(account_manager) = account_manager { 49 | match cli.account.or(account) { 50 | Some(account) => account::account_prompt(account_manager.get_account(account).await?).await?, 51 | None => { 52 | if let Some(account) = pick_account(&account_manager).await? { 53 | account::account_prompt(account_manager.get_account(account).await?).await?; 54 | } 55 | } 56 | } 57 | } 58 | 59 | Ok(()) 60 | } 61 | 62 | #[tokio::main] 63 | async fn main() { 64 | let cli = match AccountManagerCli::try_parse() { 65 | Ok(cli) => cli, 66 | Err(e) => { 67 | println!("{e}"); 68 | return; 69 | } 70 | }; 71 | 72 | if let Err(e) = logger_init(&cli) { 73 | println!("{e}"); 74 | return; 75 | } 76 | 77 | if let Err(e) = run(cli).await { 78 | log::error!("{e}"); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /.github/workflows/build_and_test.yml: -------------------------------------------------------------------------------- 1 | name: Build and run tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - develop 10 | 11 | jobs: 12 | build-and-test: 13 | runs-on: ${{ matrix.os }} 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | os: [ubuntu-latest, macos-latest, windows-latest] 18 | 19 | steps: 20 | - uses: actions/checkout@v2 21 | 22 | - name: Install stable toolchain 23 | uses: actions-rs/toolchain@v1 24 | with: 25 | toolchain: stable 26 | override: true 27 | 28 | - name: Install required packages (Ubuntu) 29 | if: matrix.os == 'ubuntu-latest' 30 | run: | 31 | sudo apt-get update 32 | sudo apt-get install libudev-dev libusb-1.0-0-dev 33 | 34 | - name: Get current date 35 | run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV 36 | if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' 37 | 38 | - name: Install LLVM and Clang (Windows) # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797 39 | uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd 40 | if: matrix.os == 'windows-latest' 41 | with: 42 | version: "11.0" 43 | directory: ${{ runner.temp }}/llvm 44 | 45 | - name: Set LIBCLANG_PATH (Windows) 46 | run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV 47 | if: matrix.os == 'windows-latest' 48 | 49 | - name: Get current date 50 | if: matrix.os == 'windows-latest' 51 | run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 52 | 53 | - name: Cache cargo registry 54 | uses: actions/cache@v2.1.4 55 | with: 56 | path: ~/.cargo/registry 57 | # Add date to the cache to keep it up to date 58 | key: ${{ matrix.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }} 59 | # Restore from outdated cache for speed 60 | restore-keys: | 61 | ${{ matrix.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} 62 | 63 | - name: Cache cargo index 64 | uses: actions/cache@v2.1.4 65 | with: 66 | path: ~/.cargo/git 67 | # Add date to the cache to keep it up to date 68 | key: ${{ matrix.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }} 69 | # Restore from outdated cache for speed 70 | restore-keys: | 71 | ${{ matrix.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} 72 | 73 | - name: Cache cargo target 74 | uses: actions/cache@v2.1.4 75 | with: 76 | path: target 77 | # Add date to the cache to keep it up to date 78 | key: ${{ matrix.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ env.CURRENT_DATE }} 79 | # Restore from outdated cache for speed 80 | restore-keys: | 81 | ${{ matrix.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} 82 | 83 | - name: Build 84 | uses: actions-rs/cargo@v1 85 | with: 86 | command: build 87 | args: --release 88 | 89 | - name: Run tests 90 | uses: actions-rs/cargo@v1 91 | with: 92 | command: test 93 | args: --release 94 | -------------------------------------------------------------------------------- /src/account_manager.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use std::env::var_os; 5 | 6 | use iota_wallet::{ 7 | account_manager::AccountManager, 8 | secret::{stronghold::StrongholdSecretManager, SecretManager}, 9 | }; 10 | 11 | use crate::{ 12 | command::account_manager::{ 13 | backup_command, change_password_command, init_command, mnemonic_command, new_command, restore_command, 14 | set_node_command, sync_command, AccountManagerCli, AccountManagerCommand, 15 | }, 16 | error::Error, 17 | helper::get_password, 18 | }; 19 | 20 | pub async fn new_account_manager(cli: AccountManagerCli) -> Result<(Option, Option), Error> { 21 | if let Some(AccountManagerCommand::Mnemonic) = cli.command { 22 | mnemonic_command().await?; 23 | return Ok((None, None)); 24 | } 25 | 26 | let storage_path = var_os("WALLET_DATABASE_PATH").map_or_else( 27 | || "./stardust-cli-wallet-db".to_string(), 28 | |os_str| os_str.into_string().expect("invalid WALLET_DATABASE_PATH"), 29 | ); 30 | let snapshot_path = std::path::Path::new("./stardust-cli-wallet.stronghold"); 31 | let password = if let Some(AccountManagerCommand::Restore { .. }) = &cli.command { 32 | get_password("Stronghold password", false)? 33 | } else { 34 | get_password("Stronghold password", !snapshot_path.exists())? 35 | }; 36 | let secret_manager = SecretManager::Stronghold( 37 | StrongholdSecretManager::builder() 38 | .password(&password) 39 | .build(snapshot_path)?, 40 | ); 41 | 42 | let (account_manager, account) = if let Some(command) = cli.command { 43 | if let AccountManagerCommand::Init(mnemonic_url) = command { 44 | (init_command(secret_manager, storage_path, mnemonic_url).await?, None) 45 | } else if let AccountManagerCommand::Restore { backup_path } = command { 46 | ( 47 | restore_command(secret_manager, storage_path, backup_path, password).await?, 48 | None, 49 | ) 50 | } else { 51 | let account_manager = AccountManager::builder() 52 | .with_secret_manager(secret_manager) 53 | .with_storage_path(&storage_path) 54 | .finish() 55 | .await?; 56 | let mut account = None; 57 | 58 | match command { 59 | AccountManagerCommand::Backup { path } => { 60 | backup_command(&account_manager, path, &password).await?; 61 | return Ok((None, None)); 62 | } 63 | AccountManagerCommand::ChangePassword => change_password_command(&account_manager, &password).await?, 64 | AccountManagerCommand::New { alias } => account = Some(new_command(&account_manager, alias).await?), 65 | AccountManagerCommand::SetNode { url } => set_node_command(&account_manager, url).await?, 66 | AccountManagerCommand::Sync => sync_command(&account_manager).await?, 67 | // PANIC: this will never happen because these variants have already been checked. 68 | AccountManagerCommand::Init(_) 69 | | AccountManagerCommand::Mnemonic 70 | | AccountManagerCommand::Restore { .. } => unreachable!(), 71 | }; 72 | 73 | (account_manager, account) 74 | } 75 | } else { 76 | ( 77 | AccountManager::builder() 78 | .with_secret_manager(secret_manager) 79 | .with_storage_path(&storage_path) 80 | .finish() 81 | .await?, 82 | None, 83 | ) 84 | }; 85 | 86 | Ok((Some(account_manager), account)) 87 | } 88 | -------------------------------------------------------------------------------- /documentation/docs/04_step_by_step.md: -------------------------------------------------------------------------------- 1 | # Step by step examples 2 | 3 | In these step by step examples, we present how to create a wallet and do some of the most common use cases. 4 | 5 | It is advised to do them all at least once in the given order to understand the workflow. 6 | 7 | ## Setup 8 | 9 | Initialise the wallet with a given node and a randomly generated mnemonic. 10 | ```sh 11 | ./wallet init --node [NODE API URL] 12 | > ... 13 | > INFO Mnemonic stored successfully 14 | ``` 15 | 16 | Create a main account. 17 | ```sh 18 | ./wallet new main 19 | > ... 20 | > INFO Created account "main" 21 | > Account "main": exit 22 | ``` 23 | 24 | Create a savings account. 25 | ```sh 26 | ./wallet new savings 27 | > ... 28 | > INFO Created account "savings" 29 | > Account "savings": exit 30 | ``` 31 | 32 | ## Tokens 33 | 34 | Get some funds from the faucet to the main account. 35 | ```sh 36 | ./wallet main 37 | > Account "main": faucet [FAUCET ENQUEUE API URL] 38 | > ... 39 | > Account "main": sync 40 | > ... 41 | > INFO Synced: AccountBalance ... 42 | > Account "main": exit 43 | ``` 44 | 45 | ### Send a regular amount 46 | 47 | Get an address from the savings account. 48 | ```sh 49 | ./wallet savings 50 | > Account "savings": addresses 51 | > INFO Address 0: [ADDRESS] 52 | > Account "savings": exit 53 | ``` 54 | 55 | Send a regular amount from the main account to the savings address. 56 | ```sh 57 | ./wallet main 58 | > Account "main": send [ADDRESS] 1000000 59 | > ... 60 | > INFO Transaction sent: 61 | > transaction id: 0x... 62 | > Some(BlockId(0x...)) 63 | > Account "main": exit 64 | ``` 65 | 66 | ### Send a micro amount 67 | 68 | Generate a new address from the savings account. 69 | ```sh 70 | ./wallet savings 71 | > Account "savings": new-address 72 | > ... 73 | > INFO Address 1: [ADDRESS] 74 | > Account "savings": exit 75 | ``` 76 | 77 | Send a micro amount from the main account to the savings address. 78 | ```sh 79 | ./wallet main 80 | > Account "main": send-micro [ADDRESS] 1 81 | > ... 82 | > INFO Micro transaction sent: 83 | > transaction id: 0x... 84 | > Some(BlockId(0x...)) 85 | > Account "main": exit 86 | ``` 87 | 88 | Check the savings balance. 89 | ```sh 90 | ./wallet savings 91 | > Account "savings": balance 92 | > ... 93 | > INFO AccountBalance ... 94 | > Account "savings": exit 95 | ``` 96 | 97 | ## Native tokens 98 | 99 | ### Mint 100 | 101 | Mint native tokens, with foundry metadata, from the main account. 102 | ```sh 103 | ./wallet main 104 | > Account "main": mint-native-token 1000 1000 --foundry-metadata-hex 0xabcdef 105 | > ... 106 | > INFO Native token minting transaction sent: 107 | > transaction id: 0x... 108 | > Some(BlockId(0x...)) 109 | > Account "main": exit 110 | ``` 111 | 112 | ### Send 113 | 114 | Generate a new address from the savings account. 115 | ```sh 116 | ./wallet savings 117 | > Account "savings": new-address 118 | > ... 119 | > INFO Address 2: [ADDRESS] 120 | > Account "savings": exit 121 | ``` 122 | 123 | Send native tokens to the savings address. 124 | ```sh 125 | ./wallet main 126 | > Account "main": sync 127 | > ... 128 | > INFO Synced: AccountBalance ...TokenId([TOKEN ID])... 129 | > Account "main": send-native-token [ADDRESS] [TOKEN ID] 100 130 | > INFO Native token transaction sent: 131 | > transaction id: 0x... 132 | > Some(BlockId(0x...)) 133 | > Account "main": exit 134 | ``` 135 | 136 | ## NFTs 137 | 138 | ### Mint 139 | 140 | Mint an NFT. 141 | ```sh 142 | ./wallet main 143 | > Account "main": mint-nft 144 | > ... 145 | > INFO NFT minting transaction sent: 146 | > transaction id: 0x... 147 | > Some(BlockId(0x...)) 148 | > Account "main": exit 149 | ``` 150 | 151 | ### Send 152 | 153 | Generate a new address from the savings account. 154 | ```sh 155 | ./wallet savings 156 | > Account "savings": new-address 157 | > ... 158 | > INFO Address 3: [ADDRESS] 159 | > Account "savings": exit 160 | ``` 161 | 162 | Send the NFT to the savings address. 163 | ```sh 164 | ./wallet main 165 | > Account "main": sync 166 | > ... 167 | > INFO Synced: AccountBalance ...NftId([NFT ID])... 168 | > Account "main": send-nft [ADDRESS] [NFT ID] 169 | > INFO Nft transaction sent: 170 | > transaction id: 0x... 171 | > Some(BlockId(0x...)) 172 | > Account "main": exit 173 | ``` 174 | 175 | ## Transactions 176 | 177 | List the transactions of the main account. 178 | ```sh 179 | ./wallet main 180 | > Account "main": transactions 181 | > ... 182 | > INFO Transaction... 183 | > Account "main": exit 184 | ``` 185 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | create-release: 11 | runs-on: ubuntu-latest 12 | outputs: 13 | RELEASE_UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }} 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: set version env variable 18 | run: echo "CRATE_VERSION=$(cat Cargo.toml | sed -n 's/.*version = "\([^"]*\)".*/\1/p' | head -1)" >> $GITHUB_ENV 19 | - name: create release 20 | id: create_release 21 | uses: actions/create-release@v1.1.0 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | with: 25 | tag_name: v${{ env.CRATE_VERSION }} 26 | release_name: "cli-wallet-${{ env.CRATE_VERSION }}" 27 | body: | 28 | # Changelog 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | # Checksums 41 | 42 | |Asset|SHA-256 checksum| 43 | |---|---| 44 | |wallet-linux|| 45 | |wallet-macos|| 46 | |wallet-windows.exe|| 47 | draft: true 48 | prerelease: false 49 | 50 | create-and-upload-assets: 51 | needs: create-release 52 | runs-on: ${{ matrix.os }} 53 | timeout-minutes: 90 54 | 55 | strategy: 56 | fail-fast: false 57 | matrix: 58 | os: [ubuntu-latest, macos-latest, windows-latest] 59 | include: 60 | - os: ubuntu-latest 61 | identifier: linux 62 | ext: '' 63 | - os: macos-latest 64 | identifier: macos 65 | ext: '' 66 | - os: windows-latest 67 | identifier: windows 68 | ext: .exe 69 | 70 | steps: 71 | - uses: actions/checkout@v2 72 | - name: install rust stable 73 | uses: actions-rs/toolchain@v1 74 | with: 75 | toolchain: stable 76 | profile: minimal 77 | 78 | - name: Install required packages (Ubuntu) 79 | if: matrix.os == 'ubuntu-latest' 80 | run: | 81 | sudo apt-get update 82 | sudo apt-get install libudev-dev libusb-1.0-0-dev 83 | 84 | - name: Install gon (macOS) 85 | # https://github.com/mitchellh/gon 86 | run: brew install mitchellh/gon/gon 87 | if: matrix.os == 'macos-latest' 88 | 89 | - name: Install LLVM and Clang (Windows) # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797 90 | uses: KyleMayes/install-llvm-action@32c4866ebb71e0949e8833eb49beeebed48532bd 91 | if: matrix.os == 'windows-latest' 92 | with: 93 | version: "11.0" 94 | directory: ${{ runner.temp }}/llvm 95 | 96 | - name: Set LIBCLANG_PATH (Windows) 97 | run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV 98 | if: matrix.os == 'windows-latest' 99 | 100 | # build the CLI 101 | - name: Build 102 | uses: actions-rs/cargo@v1 103 | with: 104 | command: build 105 | args: --profile production 106 | 107 | - name: Import code signing assets (macOS) 108 | # Based on https://github.com/Apple-Actions/import-codesign-certs/blob/master/src/security.ts 109 | run: | 110 | security create-keychain -p $KEYCHAIN_PASSWORD signing.keychain 111 | security set-keychain-settings -lut 3600 signing.keychain 112 | security unlock-keychain -p $KEYCHAIN_PASSWORD signing.keychain 113 | echo $MAC_CERT_BASE64 | base64 -D -o signing.p12 114 | security import signing.p12 -k signing.keychain -f pkcs12 -T "/usr/bin/codesign" -T "/usr/bin/security" -P $MAC_CERT_PASSWORD 115 | rm signing.p12 116 | security -q set-key-partition-list -S apple-tool:,apple: -k $KEYCHAIN_PASSWORD signing.keychain > /dev/null 117 | security -v list-keychains -s signing.keychain 118 | security find-identity -vp codesigning 119 | env: 120 | KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} 121 | MAC_CERT_BASE64: ${{ secrets.MAC_CERT_BASE64 }} 122 | MAC_CERT_PASSWORD: ${{ secrets.MAC_CERT_PASSWORD }} 123 | if: matrix.os == 'macos-latest' 124 | 125 | - name: Sign and notarize Wallet CLI binary (macOS) 126 | run: | 127 | gon gon-config.json 128 | unzip wallet.zip 129 | mv -f wallet target/production/wallet 130 | env: 131 | AC_USERNAME: ${{ secrets.ASC_APPLE_ID }} 132 | AC_PASSWORD: ${{ secrets.ASC_PASSWORD }} 133 | if: matrix.os == 'macos-latest' 134 | 135 | - name: Delete keychain (macOS) 136 | run: security delete-keychain signing.keychain 137 | # Run even if previous steps fail 138 | if: ${{ matrix.os == 'macos-latest' && always() }} 139 | 140 | # Computes SHA-256 checksum 141 | - name: SHA-256 checksum 142 | run: shasum -a 256 "./target/production/wallet${{ matrix.ext }}" 143 | 144 | # upload binary to the GH release 145 | - name: upload release asset 146 | id: upload-release-asset 147 | uses: actions/upload-release-asset@v1.0.2 148 | env: 149 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 150 | with: 151 | upload_url: ${{ needs.create-release.outputs.RELEASE_UPLOAD_URL }} 152 | asset_path: ${{ format('./target/production/wallet{0}', matrix.ext ) }} 153 | asset_name: ${{ format('wallet-{0}{1}', matrix.identifier, matrix.ext ) }} 154 | asset_content_type: application/octet-stream 155 | -------------------------------------------------------------------------------- /documentation/docs/02_account_manager.md: -------------------------------------------------------------------------------- 1 | # Account Manager Interface 2 | 3 | The Account Manager Interface is evaluated through the Command Line Interface of the `wallet` binary, once per 4 | execution. 5 | 6 | It is responsible for the creation and management of the wallet and its accounts. 7 | 8 | ## Commands 9 | 10 | ### `./wallet` 11 | 12 | Starts the wallet without a specified account: 13 | - If the wallet has only one account, it will be used; 14 | - If the wallet has more than one account, a selector will be shown to decide which account to use. 15 | 16 | The wallet needs to be initialised (`init` command) and with at least one account (`new` command). 17 | 18 | #### Example 19 | 20 | ```sh 21 | ./wallet 22 | ``` 23 | 24 | ### `./wallet [account]` 25 | 26 | Starts the wallet with a specified account; 27 | 28 | The wallet needs to be initialised (`init` command). 29 | 30 | #### Example 31 | 32 | ```sh 33 | ./wallet main 34 | ``` 35 | 36 | ### `./wallet backup` 37 | 38 | Creates a stronghold backup file. 39 | 40 | #### Parameters 41 | 42 | | Name | Optional | Example | 43 | | ------- | --------- | ----------------- | 44 | | `path` | ✘ | backup.stronghold | 45 | 46 | #### Example 47 | 48 | Create a stronghold backup file. 49 | ```sh 50 | ./wallet backup backup.stronghold 51 | ``` 52 | 53 | ### `./wallet change-password` 54 | 55 | Changes the stronghold password. 56 | 57 | #### Example 58 | 59 | Change the stronghold password. 60 | ```sh 61 | ./wallet change-password 62 | ``` 63 | 64 | ### `./wallet help` 65 | 66 | Displays the account manager interface usage and exits. 67 | 68 | #### Example 69 | 70 | ```sh 71 | ./wallet help 72 | ``` 73 | 74 | ### `./wallet init` 75 | 76 | Initialises the wallet by creating a [stronghold](https://github.com/iotaledger/stronghold.rs) file from a provided or generated mnemonic. 77 | 78 | The wallet can only be initialised once. 79 | 80 | When just initialised, the wallet has no account yet, use the `new` command to create one. 81 | 82 | #### Parameters 83 | 84 | | Name | Optional | Default | Example | 85 | | ----------- | ----------- |----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 86 | | `mnemonic` | ✓ | Randomly generated | "aunt middle impose faith ramp kid olive good practice motor grab ready group episode oven matrix silver rhythm avocado assume humble tiger shiver hurt" (DO NOT USE THIS MNEMONIC) | 87 | | `node` | ✓ | http://localhost:14265 | http://localhost:14265 | 88 | | `coin-type` | ✓ | 4219 (=Shimmer) | 4218 (=IOTA) | 89 | 90 | #### Examples 91 | 92 | Initialise the wallet with a randomly generated mnemonic and the default node. 93 | ```sh 94 | ./wallet init 95 | ``` 96 | 97 | Initialise the wallet with a given mnemonic and the default node. 98 | DO NOT USE THIS MNEMONIC. 99 | ```sh 100 | ./wallet init --mnemonic "aunt middle impose faith ramp kid olive good practice motor grab ready group episode oven matrix silver rhythm avocado assume humble tiger shiver hurt" 101 | ``` 102 | 103 | Initialise the wallet with a randomly generated mnemonic and a given node. 104 | ```sh 105 | ./wallet init --node http://localhost:14265 106 | ``` 107 | 108 | Initialise the wallet with a given coin type. 109 | See [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) for all registered coin types. 110 | ```sh 111 | ./wallet init --coin-type 4219 112 | ``` 113 | 114 | ### `./wallet mnemonic` 115 | 116 | Generates a new random mnemonic. 117 | 118 | #### Example 119 | 120 | Generate a new random mnemonic. 121 | ```sh 122 | ./wallet mnemonic 123 | ``` 124 | 125 | ### `./wallet new` 126 | 127 | Creates a new account. 128 | 129 | The wallet needs to be initialised (`init` command). 130 | 131 | #### Parameters 132 | 133 | | Name | Optional | Default | Example | 134 | | ------- | --------- | ------------- | ------- | 135 | | `alias` | ✓ | Account index | main | 136 | 137 | #### Examples 138 | 139 | Create a new account with the account index as alias. 140 | ```sh 141 | ./wallet new 142 | ``` 143 | 144 | Create a new account with a provided alias. 145 | ```sh 146 | ./wallet new main 147 | ``` 148 | 149 | ### `./wallet restore` 150 | 151 | Restores accounts from a stronghold backup file. 152 | 153 | #### Parameters 154 | 155 | | Name | Optional | Example | 156 | | ------- | --------- | ----------------- | 157 | | `path` | ✘ | backup.stronghold | 158 | 159 | #### Example 160 | 161 | Restore accounts from a stronghold backup file. 162 | ```sh 163 | ./wallet restore backup.stronghold 164 | ``` 165 | 166 | ### `./wallet set-node` 167 | 168 | Sets the node to be used for all requests. 169 | 170 | The new node URL is persisted to the storage and all future requests will use it. 171 | 172 | #### Parameters 173 | 174 | | Name | Optional | Example | 175 | | ----- | --------- | ---------------------- | 176 | | `url` | ✘ | http://localhost:14265 | 177 | 178 | #### Example 179 | 180 | ```sh 181 | ./wallet set-node http://localhost:14265 182 | ``` 183 | 184 | ### `./wallet sync` 185 | 186 | Synchronises all accounts. 187 | 188 | #### Example 189 | 190 | ```sh 191 | ./wallet sync 192 | ``` 193 | -------------------------------------------------------------------------------- /src/command/account_manager.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use std::{fs::File, io::prelude::*}; 5 | 6 | use clap::{Args, Parser, Subcommand}; 7 | use iota_wallet::{ 8 | account_manager::AccountManager, 9 | iota_client::{constants::SHIMMER_COIN_TYPE, secret::SecretManager, utils::generate_mnemonic}, 10 | ClientOptions, 11 | }; 12 | use log::LevelFilter; 13 | 14 | use crate::{error::Error, helper::get_password}; 15 | 16 | #[derive(Debug, Clone, Parser)] 17 | #[clap(version, long_about = None)] 18 | #[clap(propagate_version = true)] 19 | pub struct AccountManagerCli { 20 | #[clap(subcommand)] 21 | pub command: Option, 22 | pub account: Option, 23 | #[clap(short, long)] 24 | pub log_level: Option, 25 | } 26 | 27 | #[derive(Debug, Clone, Subcommand)] 28 | pub enum AccountManagerCommand { 29 | /// Create a stronghold backup file. 30 | Backup { path: String }, 31 | /// Change the stronghold password. 32 | ChangePassword, 33 | /// Parameters for the init command. 34 | Init(InitParameters), 35 | /// Generate a random mnemonic. 36 | Mnemonic, 37 | /// Create a new account with an optional alias. 38 | New { alias: Option }, 39 | /// Restore accounts from a stronghold backup file. 40 | Restore { backup_path: String }, 41 | /// Set the node to use. 42 | SetNode { url: String }, 43 | /// Sync all accounts. 44 | Sync, 45 | } 46 | 47 | #[derive(Debug, Clone, Args)] 48 | pub struct InitParameters { 49 | #[clap(short, long)] 50 | pub mnemonic: Option, 51 | #[clap(short, long)] 52 | pub node: Option, 53 | #[clap(short, long)] 54 | pub coin_type: Option, 55 | } 56 | 57 | pub async fn backup_command(manager: &AccountManager, path: String, password: &str) -> Result<(), Error> { 58 | manager.backup(path.clone().into(), password.into()).await?; 59 | 60 | log::info!("Wallet has been backed up to \"{path}\"."); 61 | 62 | Ok(()) 63 | } 64 | 65 | pub async fn change_password_command(manager: &AccountManager, current: &str) -> Result<(), Error> { 66 | let new = get_password("Stronghold new password", true)?; 67 | 68 | manager.change_stronghold_password(current, &new).await?; 69 | 70 | Ok(()) 71 | } 72 | 73 | pub async fn init_command( 74 | secret_manager: SecretManager, 75 | storage_path: String, 76 | parameters: InitParameters, 77 | ) -> Result { 78 | let account_manager = AccountManager::builder() 79 | .with_secret_manager(secret_manager) 80 | .with_client_options( 81 | ClientOptions::new().with_node(parameters.node.as_deref().unwrap_or("http://localhost:14265"))?, 82 | ) 83 | .with_storage_path(&storage_path) 84 | .with_coin_type(parameters.coin_type.unwrap_or(SHIMMER_COIN_TYPE)) 85 | .finish() 86 | .await?; 87 | 88 | let mnemonic = match parameters.mnemonic { 89 | Some(mnemonic) => mnemonic, 90 | None => generate_mnemonic()?, 91 | }; 92 | 93 | let mut file = File::options().create(true).append(true).open("mnemonic.txt")?; 94 | // Write mnemonic with new line 95 | file.write_all(format!("init_command: {mnemonic}\n").as_bytes())?; 96 | 97 | log::info!("IMPORTANT: mnemonic has been written to \"mnemonic.txt\", handle it safely."); 98 | log::info!( 99 | "It is the only way to recover your account if you ever forget your password and/or lose the stronghold file." 100 | ); 101 | 102 | if let SecretManager::Stronghold(secret_manager) = &mut *account_manager.get_secret_manager().write().await { 103 | secret_manager.store_mnemonic(mnemonic).await?; 104 | } else { 105 | panic!("cli-wallet only supports Stronghold-backed secret managers at the moment."); 106 | } 107 | log::info!("Mnemonic stored successfully"); 108 | 109 | Ok(account_manager) 110 | } 111 | 112 | pub async fn mnemonic_command() -> Result<(), Error> { 113 | let mnemonic = generate_mnemonic()?; 114 | 115 | let mut file = File::options().create(true).append(true).open("mnemonic.txt")?; 116 | // Write mnemonic with new line 117 | file.write_all(format!("mnemonic_command: {mnemonic}\n").as_bytes())?; 118 | 119 | log::info!("IMPORTANT: mnemonic has been written to \"mnemonic.txt\", handle it safely."); 120 | log::info!( 121 | "It is the only way to recover your account if you ever forget your password and/or lose the stronghold file." 122 | ); 123 | 124 | Ok(()) 125 | } 126 | 127 | pub async fn new_command(manager: &AccountManager, alias: Option) -> Result { 128 | let mut builder = manager.create_account(); 129 | 130 | if let Some(alias) = alias { 131 | builder = builder.with_alias(alias); 132 | } 133 | 134 | let account_handle = builder.finish().await?; 135 | let alias = account_handle.read().await.alias().to_string(); 136 | 137 | log::info!("Created account \"{alias}\""); 138 | 139 | Ok(alias) 140 | } 141 | 142 | pub async fn restore_command( 143 | secret_manager: SecretManager, 144 | storage_path: String, 145 | backup_path: String, 146 | password: String, 147 | ) -> Result { 148 | let account_manager = AccountManager::builder() 149 | .with_secret_manager(secret_manager) 150 | // Will be overwritten by the backup's value. 151 | .with_client_options( 152 | ClientOptions::new().with_node("http://localhost:14265")?, // .with_ignore_node_health(), 153 | ) 154 | .with_storage_path(&storage_path) 155 | // Will be overwritten by the backup's value. 156 | .with_coin_type(SHIMMER_COIN_TYPE) 157 | .finish() 158 | .await?; 159 | 160 | account_manager.restore_backup(backup_path.into(), password).await?; 161 | 162 | Ok(account_manager) 163 | } 164 | 165 | pub async fn set_node_command(manager: &AccountManager, url: String) -> Result<(), Error> { 166 | manager 167 | .set_client_options(ClientOptions::new().with_node(&url)?) 168 | .await?; 169 | 170 | Ok(()) 171 | } 172 | 173 | pub async fn sync_command(manager: &AccountManager) -> Result<(), Error> { 174 | let total_balance = manager.sync(None).await?; 175 | 176 | log::info!("Synchronized all accounts: {:?}", total_balance); 177 | 178 | Ok(()) 179 | } 180 | -------------------------------------------------------------------------------- /src/account.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use clap::Parser; 5 | use dialoguer::Input; 6 | use iota_wallet::account::AccountHandle; 7 | 8 | use crate::{ 9 | command::account::{ 10 | addresses_command, balance_command, burn_native_token_command, burn_nft_command, claim_command, 11 | consolidate_command, create_alias_outputs_command, decrease_native_token_command, 12 | decrease_voting_power_command, destroy_alias_command, destroy_foundry_command, faucet_command, 13 | increase_native_token_command, increase_voting_power_command, mint_native_token_command, mint_nft_command, 14 | new_address_command, output_command, outputs_command, participation_overview_command, send_command, 15 | send_micro_command, send_native_token_command, send_nft_command, stop_participating_command, sync_command, 16 | transactions_command, unspent_outputs_command, vote_command, voting_output_command, voting_power_command, 17 | AccountCli, AccountCommand, 18 | }, 19 | error::Error, 20 | helper::bytes_from_hex_or_file, 21 | }; 22 | 23 | // loop on the account prompt 24 | pub async fn account_prompt(account_handle: AccountHandle) -> Result<(), Error> { 25 | loop { 26 | match account_prompt_internal(account_handle.clone()).await { 27 | Ok(true) => { 28 | return Ok(()); 29 | } 30 | Err(e) => { 31 | log::error!("{e}"); 32 | } 33 | _ => {} 34 | } 35 | } 36 | } 37 | 38 | // loop on the account prompt 39 | pub async fn account_prompt_internal(account_handle: AccountHandle) -> Result { 40 | let alias = { 41 | let account = account_handle.read().await; 42 | account.alias().clone() 43 | }; 44 | let command: String = Input::new().with_prompt(format!("Account \"{alias}\"")).interact()?; 45 | 46 | match command.as_str() { 47 | "h" => { 48 | if let Err(err) = AccountCli::try_parse_from(vec!["Account:", "help"]) { 49 | println!("{err}"); 50 | } 51 | } 52 | "clear" => { 53 | // Clear console 54 | let _ = std::process::Command::new("clear").status(); 55 | } 56 | _ => { 57 | // Prepend `Account: ` so the parsing will be correct 58 | let command = format!("Account: {}", command.trim()); 59 | let account_cli = match AccountCli::try_parse_from(command.split(' ')) { 60 | Ok(account_cli) => account_cli, 61 | Err(err) => { 62 | println!("{err}"); 63 | return Ok(false); 64 | } 65 | }; 66 | if let Err(err) = match account_cli.command { 67 | AccountCommand::Addresses => addresses_command(&account_handle).await, 68 | AccountCommand::Balance => balance_command(&account_handle).await, 69 | AccountCommand::BurnNativeToken { token_id, amount } => { 70 | burn_native_token_command(&account_handle, token_id, amount).await 71 | } 72 | AccountCommand::BurnNft { nft_id } => burn_nft_command(&account_handle, nft_id).await, 73 | AccountCommand::Claim { output_id } => claim_command(&account_handle, output_id).await, 74 | AccountCommand::Consolidate => consolidate_command(&account_handle).await, 75 | AccountCommand::CreateAliasOutput => create_alias_outputs_command(&account_handle).await, 76 | AccountCommand::DecreaseNativeTokenSupply { token_id, amount } => { 77 | decrease_native_token_command(&account_handle, token_id, amount).await 78 | } 79 | AccountCommand::DestroyAlias { alias_id } => destroy_alias_command(&account_handle, alias_id).await, 80 | AccountCommand::DestroyFoundry { foundry_id } => { 81 | destroy_foundry_command(&account_handle, foundry_id).await 82 | } 83 | AccountCommand::Exit => { 84 | return Ok(true); 85 | } 86 | AccountCommand::Faucet { url, address } => faucet_command(&account_handle, url, address).await, 87 | AccountCommand::IncreaseNativeTokenSupply { token_id, amount } => { 88 | increase_native_token_command(&account_handle, token_id, amount).await 89 | } 90 | AccountCommand::MintNativeToken { 91 | circulating_supply, 92 | maximum_supply, 93 | foundry_metadata_hex, 94 | foundry_metadata_file, 95 | } => { 96 | mint_native_token_command( 97 | &account_handle, 98 | circulating_supply, 99 | maximum_supply, 100 | bytes_from_hex_or_file(foundry_metadata_hex, foundry_metadata_file).await?, 101 | ) 102 | .await 103 | } 104 | AccountCommand::MintNft { 105 | address, 106 | immutable_metadata_hex, 107 | immutable_metadata_file, 108 | metadata_hex, 109 | metadata_file, 110 | tag, 111 | sender, 112 | issuer, 113 | } => { 114 | mint_nft_command( 115 | &account_handle, 116 | address, 117 | bytes_from_hex_or_file(immutable_metadata_hex, immutable_metadata_file).await?, 118 | bytes_from_hex_or_file(metadata_hex, metadata_file).await?, 119 | tag, 120 | sender, 121 | issuer, 122 | ) 123 | .await 124 | } 125 | AccountCommand::NewAddress => new_address_command(&account_handle).await, 126 | AccountCommand::Output { output_id } => output_command(&account_handle, output_id).await, 127 | AccountCommand::Outputs => outputs_command(&account_handle).await, 128 | AccountCommand::Send { address, amount } => send_command(&account_handle, address, amount).await, 129 | AccountCommand::SendMicro { address, amount } => { 130 | send_micro_command(&account_handle, address, amount).await 131 | } 132 | AccountCommand::SendNativeToken { 133 | address, 134 | token_id, 135 | amount, 136 | gift_storage_deposit, 137 | } => send_native_token_command(&account_handle, address, token_id, amount, gift_storage_deposit).await, 138 | AccountCommand::SendNft { address, nft_id } => send_nft_command(&account_handle, address, nft_id).await, 139 | AccountCommand::Sync => sync_command(&account_handle).await, 140 | AccountCommand::Transactions => transactions_command(&account_handle).await, 141 | AccountCommand::UnspentOutputs => unspent_outputs_command(&account_handle).await, 142 | AccountCommand::Vote { event_id, answers } => vote_command(&account_handle, event_id, answers).await, 143 | AccountCommand::StopParticipating { event_id } => { 144 | stop_participating_command(&account_handle, event_id).await 145 | } 146 | AccountCommand::ParticipationOverview => participation_overview_command(&account_handle).await, 147 | AccountCommand::VotingPower => voting_power_command(&account_handle).await, 148 | AccountCommand::IncreaseVotingPower { amount } => { 149 | increase_voting_power_command(&account_handle, amount).await 150 | } 151 | AccountCommand::DecreaseVotingPower { amount } => { 152 | decrease_voting_power_command(&account_handle, amount).await 153 | } 154 | AccountCommand::VotingOutput => voting_output_command(&account_handle).await, 155 | } { 156 | log::error!("{}", err); 157 | } 158 | } 159 | } 160 | 161 | Ok(false) 162 | } 163 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | -------------------------------------------------------------------------------- /documentation/docs/03_account.md: -------------------------------------------------------------------------------- 1 | # Account Interface 2 | 3 | The Account Interface is evaluated, after the Account Manager Interface, repeatedly through a prompt within the `wallet` 4 | binary. 5 | 6 | It is responsible for the creation and management of account addresses and their outputs, tokens, native tokens, NFTs... 7 | 8 | ## Commands 9 | 10 | ### `addresses` 11 | 12 | Lists all account addresses. 13 | 14 | #### Example 15 | 16 | ```sh 17 | > Account "main": addresses 18 | ``` 19 | 20 | ### `balance` 21 | 22 | Prints the account balance. 23 | 24 | #### Example 25 | 26 | ```sh 27 | > Account "main": balance 28 | ``` 29 | 30 | ### `burn-native-token` 31 | 32 | Burns a native token. 33 | 34 | #### Parameters 35 | 36 | | Name | Optional | Default | Example | 37 | | ---------- | --------- | ------- | ------------------------------------------------------------------------------ | 38 | | `token_id` | ✘ | N/A | 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 | 39 | | `amount` | ✘ | N/A | 100 | 40 | 41 | #### Example 42 | 43 | Burn the provided amount of a native token. 44 | ```sh 45 | > Account "main": burn-native-token 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 100 46 | ``` 47 | 48 | ### `burn-nft` 49 | 50 | Burns an NFT. 51 | 52 | #### Parameters 53 | 54 | | Name | Optional | Default | Example | 55 | | -------- | --------- | ------- | ------------------------------------------------------------------ | 56 | | `nft_id` | ✘ | N/A | 0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c | 57 | 58 | #### Example 59 | 60 | Burn a provided NFT. 61 | ```sh 62 | > Account "main": burn-nft 0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c 63 | ``` 64 | 65 | ### `claim` 66 | 67 | Tries to claim outputs with storage deposit return, expiration or timelock unlock conditions. 68 | 69 | #### Parameters 70 | 71 | | Name | Optional | Default | Example | 72 | | ----------- | --------- | ------- | ---------------------------------------------------------------------- | 73 | | `output_id` | ✓ | N/A | 0xd5dff9ee869dfa7796d5132b220cb5c00146c36abba27d3562e2d726decb50850000 | 74 | 75 | #### Examples 76 | 77 | Try to claim all outputs with storage deposit return, expiration or timelock unlock conditions. 78 | ```sh 79 | > Account "main": claim 80 | ``` 81 | 82 | Try to claim a specific output. 83 | ```sh 84 | > Account "main": claim 0xd5dff9ee869dfa7796d5132b220cb5c00146c36abba27d3562e2d726decb50850000 85 | ``` 86 | 87 | ### `clear` 88 | 89 | Clears the terminal. 90 | 91 | #### Example 92 | 93 | ```sh 94 | > Account "main": clear 95 | ``` 96 | 97 | ### `consolidate` 98 | 99 | Tries to consolidate outputs into a single one. 100 | 101 | Note that only Basic Outputs with only an address unlock condition can be consolidated. 102 | 103 | #### Example 104 | 105 | ```sh 106 | > Account "main": consolidate 107 | ``` 108 | 109 | ### `create-alias-output` 110 | 111 | Create a new alias output. 112 | 113 | #### Example 114 | 115 | ```sh 116 | > Account "main": create-alias-output 117 | ``` 118 | 119 | ### `decrease-native-token-supply` 120 | 121 | Melts a native token. 122 | 123 | #### Parameters 124 | 125 | | Name | Optional | Default | Example | 126 | | ---------- | --------- | ------- | ------------------------------------------------------------------------------ | 127 | | `token_id` | ✘ | N/A | 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 | 128 | | `amount` | ✘ | N/A | 100 | 129 | 130 | #### Example 131 | 132 | Melt the provided amount of a native token. 133 | ```sh 134 | > Account "main": decrease-native-token-supply 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 100 135 | ``` 136 | 137 | ### `decrease-voting-power` 138 | 139 | Decreases the voting power of the account. 140 | 141 | #### Parameters 142 | 143 | | Name | Optional | Default | Example | 144 | | ---------- | --------- | ------- | -------- | 145 | | `amount` | ✘ | N/A | 100000 | 146 | 147 | #### Example 148 | 149 | Decrease the voting power of the account by 100000. 150 | ```sh 151 | > Account "main": decrease-voting-power 100000 152 | ``` 153 | 154 | ### `destroy-alias` 155 | 156 | Destroys an alias. 157 | 158 | #### Parameters 159 | 160 | | Name | Optional | Default | Example | 161 | | ---------- | --------- | ------- | ------------------------------------------------------------------ | 162 | | `alias_id` | ✘ | N/A | 0xb2bcba092bfb3fe3a12afcf21115016b27d833a7c456404fe2fe0921799f24dd | 163 | 164 | #### Example 165 | 166 | ```sh 167 | > Account "main": destroy-alias 0xb2bcba092bfb3fe3a12afcf21115016b27d833a7c456404fe2fe0921799f24dd 168 | ``` 169 | 170 | ### `destroy-foundry` 171 | 172 | Destroys a foundry. 173 | 174 | #### Parameters 175 | 176 | | Name | Optional | Default | Example | 177 | | ------------ | --------- | ------- | ------------------------------------------------------------------------------ | 178 | | `foundry_id` | ✘ | N/A | 0x08b2bcba092bfb3fe3a12afcf21115016b27d833a7c456404fe2fe0921799f24dd0100000000 | 179 | 180 | #### Example 181 | 182 | ```sh 183 | > Account "main": destroy-foundry 0x08b2bcba092bfb3fe3a12afcf21115016b27d833a7c456404fe2fe0921799f24dd0100000000 184 | ``` 185 | 186 | ### `exit` 187 | 188 | Exits the `cli-wallet`. 189 | 190 | #### Example 191 | 192 | ```sh 193 | > Account "main": exit 194 | ``` 195 | 196 | ### `faucet` 197 | 198 | Requests funds from a faucet. 199 | 200 | #### Parameters 201 | 202 | | Name | Optional | Default | Example | 203 | | --------- | --------- | --------------------------------- | --------------------------------------------------------------- | 204 | | `url` | ✓ | http://localhost:8091/api/enqueue | http://localhost:8091/api/enqueue | 205 | | `address` | ✓ | The latest address of the account | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 206 | 207 | #### Examples 208 | 209 | Request funds from a given faucet to the latest account address. 210 | ```sh 211 | > Account "main": faucet http://localhost:8091/api/enqueue 212 | ``` 213 | 214 | Request funds from a given faucet to a given address. 215 | ```sh 216 | > Account "main": faucet http://localhost:8091/api/enqueue rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 217 | ``` 218 | 219 | ### `help` 220 | 221 | Displays the account interface usage. 222 | 223 | #### Example 224 | 225 | ```sh 226 | > Account "main": help 227 | ``` 228 | 229 | ### `increase-native-token-supply` 230 | 231 | Mints more of a native token. 232 | 233 | #### Parameters 234 | 235 | | Name | Optional | Default | Example | 236 | | ---------- | --------- | ------- | ------------------------------------------------------------------------------ | 237 | | `token_id` | ✘ | N/A | 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 | 238 | | `amount` | ✘ | N/A | 10 | 239 | 240 | #### Example 241 | 242 | Mint 10 additional native tokens. 243 | ```sh 244 | > Account "main": increase-native-token-supply 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 10 245 | ``` 246 | 247 | ### `increase-voting-power` 248 | 249 | Increases the voting power of the account. 250 | 251 | #### Parameters 252 | 253 | | Name | Optional | Default | Example | 254 | | ---------- | --------- | ------- | -------- | 255 | | `amount` | ✘ | N/A | 100000 | 256 | 257 | #### Example 258 | 259 | Increase the voting power of the account by 100000. 260 | ```sh 261 | > Account "main": increase-voting-power 100000 262 | ``` 263 | 264 | ### `mint-native-token` 265 | 266 | Mints a native token. 267 | 268 | #### Parameters 269 | 270 | | Name | Optional | Default | Example | 271 | | ------------------------- | --------- | ------- | ------------- | 272 | | `circulating_supply` | ✘ | N/A | 1000 | 273 | | `maximum_supply` | ✘ | N/A | 1000 | 274 | | `foundry_metadata_hex` | ✓ | None | 0xabcdef | 275 | | `foundry_metadata_file` | ✓ | None | metadata.json | 276 | 277 | #### Examples 278 | 279 | Mint a native token with a maximum supply. 280 | ```sh 281 | > Account "main": mint-native-token 1000 1000 282 | ``` 283 | 284 | Mint a native token with a maximum supply and hexadecimal foundry metadata. 285 | ```sh 286 | > Account "main": mint-native-token 1000 1000 --foundry-metadata-hex 0xabcdef 287 | ``` 288 | 289 | Mint a native token with a maximum supply and foundry metadata from a file. 290 | ```sh 291 | > Account "main": mint-native-token 1000 1000 --foundry-metadata-file metadata.json 292 | ``` 293 | 294 | ### `mint-nft` 295 | 296 | Mints an NFT. 297 | 298 | #### Parameters 299 | 300 | | Name | Optional | Default | Example | 301 | | ------------------------- | --------- | --------------------------------- | --------------------------------------------------------------- | 302 | | `address` | ✓ | The first address of the account | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 303 | | `immutable_metadata_hex` | ✓ | None | 0xabcdef | 304 | | `immutable_metadata_file` | ✓ | None | metadata.json | 305 | | `metadata_hex` | ✓ | None | 0xabcdef | 306 | | `metadata_file` | ✓ | None | metadata.json | 307 | | `tag` | ✓ | None | 0xabcdef | 308 | | `sender` | ✓ | None | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 309 | | `issuer` | ✓ | None | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 310 | 311 | #### Examples 312 | 313 | Mint an NFT to the latest address of the account. 314 | ```sh 315 | > Account "main": mint-nft 316 | ``` 317 | 318 | Mint an NFT to a given address. 319 | ```sh 320 | > Account "main": mint-nft rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 321 | ``` 322 | 323 | Mint an NFT to a given address with hexadecimal immutable metadata and metadata from a file. 324 | ```sh 325 | > Account "main": mint-nft rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 --immutable-metadata-hex 0xabcdef --metadata-file metadata.json 326 | ``` 327 | 328 | Mint an NFT to a given address with hexadecimal tag and sender feature. 329 | ```sh 330 | > Account "main": mint-nft --tag 0xabcdef --sender rms1qq5k0ut6nl2vpyehdvg5k4ygyntd4r44t9lw2ksex280x60lc2fmcgdsmku 331 | ``` 332 | 333 | ### `new-address` 334 | 335 | Generates a new address. 336 | 337 | #### Example 338 | 339 | ```sh 340 | > Account "main": new-address 341 | ``` 342 | 343 | ### `output` 344 | 345 | Displays an output that is stored in the account. 346 | 347 | #### Parameters 348 | 349 | | Name | Optional | Default | Example | 350 | | ----------- | --------- | ------- | ---------------------------------------------------------------------- | 351 | | `output_id` | ✘ | N/A | 0x1c7a765db0c1f5eceb0ea5578585359c5b0c1ab8d958829f5990997b93f0ec7d0100 | 352 | 353 | #### Example 354 | 355 | ```sh 356 | > Account "main": output 0x1c7a765db0c1f5eceb0ea5578585359c5b0c1ab8d958829f5990997b93f0ec7d0100 357 | ``` 358 | 359 | ### `outputs` 360 | 361 | Displays all outputs that are stored in the account. 362 | 363 | #### Example 364 | 365 | ```sh 366 | > Account "main": outputs 367 | ``` 368 | 369 | ### `participation-overview` 370 | 371 | Calculates the participation overview of the account. 372 | 373 | #### Example 374 | 375 | ```sh 376 | > Account "main": participation-overview 377 | ``` 378 | 379 | ### `send` 380 | 381 | Sends an amount to an address. 382 | 383 | #### Parameters 384 | 385 | | Name | Optional | Default | Example | 386 | | --------- | --------- | ------- | --------------------------------------------------------------- | 387 | | `address` | ✘ | N/A | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 388 | | `amount` | ✘ | N/A | 1000000 | 389 | 390 | #### Example 391 | 392 | ```sh 393 | > Account "main": send rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 1000000 394 | ``` 395 | 396 | ### `send-micro` 397 | 398 | Sends a micro amount to an address with StorageDepositReturn and Expiration Unlock Conditions. 399 | 400 | #### Parameters 401 | 402 | | Name | Optional | Default | Example | 403 | | --------- | --------- | ------- | --------------------------------------------------------------- | 404 | | `address` | ✘ | N/A | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 405 | | `amount` | ✘ | N/A | 1 | 406 | 407 | #### Example 408 | 409 | ```sh 410 | > Account "main": send-micro rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 1 411 | ``` 412 | 413 | ### `send-native-token` 414 | 415 | Sends native tokens to an address with StorageDepositReturn and Expiration Unlock Condition. 416 | 417 | To send the native tokens together with the required storage deposit and without StorageDepositReturn and Expiration, provide `true` for `gift_storage_deposit`. 418 | 419 | #### Parameters 420 | 421 | | Name | Optional | Default | Example | 422 | | ---------------------- | --------- | ------- | ------------------------------------------------------------------------------- | 423 | | `address` | ✘ | N/A | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 424 | | `token_id` | ✘ | N/A | 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 | 425 | | `amount` | ✘ | N/A | 100 | 426 | | `gift_storage_deposit` | ✓ | false | true | 427 | 428 | #### Example 429 | 430 | Sending with storage deposit return and expiration: 431 | 432 | ```sh 433 | > Account "main": send-native-token rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 100 434 | ``` 435 | 436 | Sending without storage deposit return and expiration, gifting the required storage deposit: 437 | 438 | ```sh 439 | > Account "main": send-native-token rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 0x08860e1f3593ba86c597cf86f61d8b04d8a714c02c7c5da7132d45be9c2ce6445c0300000000 100 true 440 | ``` 441 | 442 | ### `send-nft` 443 | 444 | Sends an NFT to an address. 445 | 446 | #### Parameters 447 | 448 | | Name | Optional | Default | Example | 449 | | --------- | --------- | ------- | ------------------------------------------------------------------- | 450 | | `address` | ✘ | N/A | rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 | 451 | | `nft_id` | ✘ | N/A | 0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c | 452 | 453 | #### Example 454 | 455 | ```sh 456 | > Account "main": send-nft rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c 457 | ``` 458 | 459 | ### `stop-participating` 460 | 461 | Stops participating to a given event. 462 | 463 | #### Parameters 464 | 465 | | Name | Optional | Default | Example | 466 | | ------------- | --------- | ------- | ---------------------------------------------------------------------- | 467 | | `event_id` | ✘ | N/A | `0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c` | 468 | 469 | #### Example 470 | 471 | ```sh 472 | > Account "main": stop-participating 0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c 473 | ``` 474 | 475 | ### `sync` 476 | 477 | Synchronises the account. 478 | 479 | #### Example 480 | 481 | ```sh 482 | > Account "main": sync 483 | ``` 484 | 485 | ### `transactions` 486 | 487 | Lists all account transactions. 488 | 489 | #### Example 490 | 491 | ```sh 492 | > Account "main": transactions 493 | ``` 494 | 495 | ### `unspent-outputs` 496 | 497 | Displays all unspent outputs that are stored in the account. 498 | 499 | #### Example 500 | 501 | ```sh 502 | > Account "main": unspent-outputs 503 | ``` 504 | 505 | ### `vote` 506 | 507 | Casts given votes for a given event. 508 | 509 | #### Parameters 510 | 511 | | Name | Optional | Default | Example | 512 | | ------------- | ---------------- | ------- | ----------------------------------------------------------------------- | 513 | | `event_id` | ✘ | N/A | `0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c` | 514 | | `answers` | ✘ (at least one) | N/A | 0 1 1 0 | 515 | 516 | #### Example 517 | 518 | ```sh 519 | > Account "main": vote 0x397ae8552dcf0dc604a44c9d86a5005d09f95d67e2965ea3b1c1271f9a9ae44c 0 1 1 0 520 | ``` 521 | 522 | ### `voting-output` 523 | 524 | Gets the voting output of the account. 525 | 526 | #### Example 527 | 528 | ```sh 529 | > Account "main": voting-output 530 | ``` 531 | 532 | ### `voting-power` 533 | 534 | Gets the voting power of the account. 535 | 536 | #### Example 537 | 538 | ```sh 539 | > Account "main": voting-power 540 | ``` -------------------------------------------------------------------------------- /src/command/account.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2022 IOTA Stiftung 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | use std::str::FromStr; 5 | 6 | use clap::{Parser, Subcommand}; 7 | use iota_wallet::{ 8 | account::{ 9 | types::{AccountAddress, TransactionDto}, 10 | AccountHandle, OutputsToClaim, 11 | }, 12 | iota_client::{ 13 | api_types::plugins::participation::types::ParticipationEventId, 14 | block::{ 15 | address::Address, 16 | output::{ 17 | unlock_condition::AddressUnlockCondition, AliasId, BasicOutputBuilder, FoundryId, NativeToken, NftId, 18 | OutputId, TokenId, UnlockCondition, 19 | }, 20 | }, 21 | request_funds_from_faucet, 22 | }, 23 | AddressAndNftId, AddressNativeTokens, AddressWithAmount, AddressWithMicroAmount, NativeTokenOptions, NftOptions, 24 | U256, 25 | }; 26 | 27 | use crate::error::Error; 28 | 29 | #[derive(Debug, Parser)] 30 | #[clap(version, long_about = None)] 31 | #[clap(propagate_version = true)] 32 | pub struct AccountCli { 33 | #[clap(subcommand)] 34 | pub command: AccountCommand, 35 | } 36 | 37 | #[derive(Debug, Subcommand)] 38 | pub enum AccountCommand { 39 | /// List the account addresses. 40 | Addresses, 41 | /// Print the account balance. 42 | Balance, 43 | /// Burn a native token: `burn-native-token 0x... 100` 44 | BurnNativeToken { token_id: String, amount: String }, 45 | /// Burn an NFT: `burn-nft 0x...` 46 | BurnNft { nft_id: String }, 47 | /// Claim outputs with storage deposit return, expiration or timelock unlock conditions. 48 | Claim { output_id: Option }, 49 | /// Consolidate all basic outputs into one address. 50 | Consolidate, 51 | /// Create a new alias output. 52 | CreateAliasOutput, 53 | /// Melt a native token: `decrease-native-token-supply 0x... 100` 54 | DecreaseNativeTokenSupply { token_id: String, amount: String }, 55 | /// Destroy an alias: `destroy-alias 0x...` 56 | DestroyAlias { alias_id: String }, 57 | /// Destroy a foundry: `destroy-foundry 0x...` 58 | DestroyFoundry { foundry_id: String }, 59 | /// Exit from the account prompt. 60 | Exit, 61 | /// Request funds from the faucet to the latest address, `url` is optional, default is `http://localhost:8091/api/enqueue` 62 | Faucet { 63 | url: Option, 64 | address: Option, 65 | }, 66 | /// Mint more of a native token: `increase-native-token-supply 0x... 100` 67 | IncreaseNativeTokenSupply { token_id: String, amount: String }, 68 | /// Mint a native token: `mint-native-token 100 100 --foundry-metadata-hex 0x...` 69 | MintNativeToken { 70 | circulating_supply: String, 71 | maximum_supply: String, 72 | #[clap(long, group = "foundry_metadata")] 73 | foundry_metadata_hex: Option, 74 | #[clap(long, group = "foundry_metadata")] 75 | foundry_metadata_file: Option, 76 | }, 77 | /// Mint an NFT to an optional bech32 encoded address: `mint-nft 78 | /// rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 "immutable metadata" "metadata"` 79 | MintNft { 80 | address: Option, 81 | #[clap(long, group = "immutable_metadata")] 82 | immutable_metadata_hex: Option, 83 | #[clap(long, group = "immutable_metadata")] 84 | immutable_metadata_file: Option, 85 | #[clap(long, group = "metadata")] 86 | metadata_hex: Option, 87 | #[clap(long, group = "metadata")] 88 | metadata_file: Option, 89 | #[clap(long)] 90 | tag: Option, 91 | #[clap(long)] 92 | sender: Option, 93 | #[clap(long)] 94 | issuer: Option, 95 | }, 96 | /// Generate a new address. 97 | NewAddress, 98 | /// Display an output. 99 | Output { output_id: String }, 100 | /// List all outputs. 101 | Outputs, 102 | /// Send an amount to a bech32 encoded address: `send 103 | /// rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 1000000` 104 | Send { address: String, amount: u64 }, 105 | /// Send an amount below the storage deposit minimum to a bech32 address: `send 106 | /// rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 1` 107 | SendMicro { address: String, amount: u64 }, 108 | /// Send native tokens to a bech32 address: `send-native-token 109 | /// rms1qztwng6cty8cfm42nzvq099ev7udhrnk0rw8jt8vttf9kpqnxhpsx869vr3 110 | /// 0x08e3a2f76cc934bc0cc21575b4610c1d7d4eb589ae0100000000000000000000000000000000 10` 111 | /// This will create an output with an expiration and storage deposit return unlock condition. To gift the storage 112 | /// deposit for the output, add ` true`. 113 | SendNativeToken { 114 | address: String, 115 | token_id: String, 116 | amount: String, 117 | gift_storage_deposit: Option, 118 | }, 119 | /// Send an NFT to a bech32 encoded address 120 | SendNft { address: String, nft_id: String }, 121 | /// Sync the account with the Tangle. 122 | Sync, 123 | /// List the account transactions. 124 | Transactions, 125 | /// List the unspent outputs. 126 | UnspentOutputs, 127 | /// Cast given votes for a given event 128 | Vote { event_id: String, answers: Vec }, 129 | /// Stop participating to a given event 130 | StopParticipating { event_id: String }, 131 | /// Calculate the participation overview of the account 132 | ParticipationOverview, 133 | /// Get the voting power of the account 134 | VotingPower, 135 | /// Increase the voting power of the account 136 | IncreaseVotingPower { amount: u64 }, 137 | /// Decrease the voting power of the account 138 | DecreaseVotingPower { amount: u64 }, 139 | /// Get the voting output of the account 140 | VotingOutput, 141 | } 142 | 143 | /// `addresses` command 144 | pub async fn addresses_command(account_handle: &AccountHandle) -> Result<(), Error> { 145 | let addresses = account_handle.addresses().await?; 146 | 147 | if addresses.is_empty() { 148 | log::info!("No addresses found"); 149 | } else { 150 | for address in addresses { 151 | print_address(account_handle, &address).await?; 152 | } 153 | } 154 | 155 | Ok(()) 156 | } 157 | 158 | // `burn-native-token` command 159 | pub async fn burn_native_token_command( 160 | account_handle: &AccountHandle, 161 | token_id: String, 162 | amount: String, 163 | ) -> Result<(), Error> { 164 | log::info!("Burning native token {token_id} {amount}."); 165 | 166 | let transaction = account_handle 167 | .burn_native_token( 168 | TokenId::from_str(&token_id)?, 169 | U256::from_dec_str(&amount).map_err(|e| Error::Miscellaneous(e.to_string()))?, 170 | None, 171 | ) 172 | .await?; 173 | 174 | log::info!( 175 | "Burning transaction sent:\n{:?}\n{:?}", 176 | transaction.transaction_id, 177 | transaction.block_id 178 | ); 179 | 180 | Ok(()) 181 | } 182 | 183 | // `burn-nft` command 184 | pub async fn burn_nft_command(account_handle: &AccountHandle, nft_id: String) -> Result<(), Error> { 185 | log::info!("Burning nft {nft_id}."); 186 | 187 | let transaction = account_handle.burn_nft(NftId::from_str(&nft_id)?, None).await?; 188 | 189 | log::info!( 190 | "Burning transaction sent:\n{:?}\n{:?}", 191 | transaction.transaction_id, 192 | transaction.block_id 193 | ); 194 | 195 | Ok(()) 196 | } 197 | 198 | // `balance` command 199 | pub async fn balance_command(account_handle: &AccountHandle) -> Result<(), Error> { 200 | log::info!("{:?}", account_handle.balance().await?); 201 | 202 | Ok(()) 203 | } 204 | 205 | // `claim` command 206 | pub async fn claim_command(account_handle: &AccountHandle, output_id: Option) -> Result<(), Error> { 207 | if let Some(output_id) = output_id { 208 | log::info!("Claiming output {output_id}"); 209 | 210 | let transaction = account_handle 211 | .claim_outputs(vec![OutputId::from_str(&output_id)?]) 212 | .await?; 213 | 214 | log::info!( 215 | "Claiming transaction sent:\n{:?}\n{:?}", 216 | transaction.transaction_id, 217 | transaction.block_id 218 | ); 219 | } else { 220 | log::info!("Claiming outputs."); 221 | 222 | let output_ids = account_handle 223 | .get_unlockable_outputs_with_additional_unlock_conditions(OutputsToClaim::All) 224 | .await?; 225 | 226 | if output_ids.is_empty() { 227 | log::info!("No outputs available to claim."); 228 | } 229 | 230 | // Doing chunks of only 60, because we might need to create the double amount of outputs, because of potential 231 | // storage deposit return unlock conditions and also consider the remainder output. 232 | for output_ids_chunk in output_ids.chunks(60) { 233 | let transaction = account_handle.claim_outputs(output_ids_chunk.to_vec()).await?; 234 | log::info!( 235 | "Claiming transaction sent:\n{:?}\n{:?}", 236 | transaction.transaction_id, 237 | transaction.block_id 238 | ); 239 | } 240 | }; 241 | 242 | Ok(()) 243 | } 244 | 245 | // `consolidate` command 246 | pub async fn consolidate_command(account_handle: &AccountHandle) -> Result<(), Error> { 247 | log::info!("Consolidating outputs."); 248 | 249 | let transaction = account_handle.consolidate_outputs(true, None).await?; 250 | 251 | log::info!( 252 | "Consolidation transaction sent:\n{:?}\n{:?}", 253 | transaction.transaction_id, 254 | transaction.block_id 255 | ); 256 | 257 | Ok(()) 258 | } 259 | 260 | // `create-alias-output` command 261 | pub async fn create_alias_outputs_command(account_handle: &AccountHandle) -> Result<(), Error> { 262 | log::info!("Creating alias output."); 263 | 264 | let transaction = account_handle.create_alias_output(None, None).await?; 265 | 266 | log::info!( 267 | "Alias output creation transaction sent:\n{:?}\n{:?}", 268 | transaction.transaction_id, 269 | transaction.block_id 270 | ); 271 | 272 | Ok(()) 273 | } 274 | 275 | // `decrease-native-token-supply` command 276 | pub async fn decrease_native_token_command( 277 | account_handle: &AccountHandle, 278 | token_id: String, 279 | amount: String, 280 | ) -> Result<(), Error> { 281 | let transaction = account_handle 282 | .decrease_native_token_supply( 283 | TokenId::from_str(&token_id)?, 284 | U256::from_dec_str(&amount).map_err(|e| Error::Miscellaneous(e.to_string()))?, 285 | None, 286 | ) 287 | .await?; 288 | 289 | log::info!( 290 | "Native token melting transaction sent:\n{:?}\n{:?}", 291 | transaction.transaction_id, 292 | transaction.block_id 293 | ); 294 | 295 | Ok(()) 296 | } 297 | 298 | // `destroy-alias` command 299 | pub async fn destroy_alias_command(account_handle: &AccountHandle, alias_id: String) -> Result<(), Error> { 300 | log::info!("Destroying alias {alias_id}."); 301 | 302 | let transaction = account_handle 303 | .destroy_alias(AliasId::from_str(&alias_id)?, None) 304 | .await?; 305 | 306 | log::info!( 307 | "Destroying alias transaction sent:\n{:?}\n{:?}", 308 | transaction.transaction_id, 309 | transaction.block_id 310 | ); 311 | 312 | Ok(()) 313 | } 314 | 315 | // `destroy-foundry` command 316 | pub async fn destroy_foundry_command(account_handle: &AccountHandle, foundry_id: String) -> Result<(), Error> { 317 | log::info!("Destroying foundry {foundry_id}."); 318 | 319 | let transaction = account_handle 320 | .destroy_foundry(FoundryId::from_str(&foundry_id)?, None) 321 | .await?; 322 | 323 | log::info!( 324 | "Destroying foundry transaction sent:\n{:?}\n{:?}", 325 | transaction.transaction_id, 326 | transaction.block_id 327 | ); 328 | 329 | Ok(()) 330 | } 331 | 332 | // `faucet` command 333 | pub async fn faucet_command( 334 | account_handle: &AccountHandle, 335 | url: Option, 336 | address: Option, 337 | ) -> Result<(), Error> { 338 | let address = if let Some(address) = address { 339 | address 340 | } else { 341 | match account_handle.addresses().await?.last() { 342 | Some(address) => address.address().to_bech32(), 343 | None => return Err(Error::NoAddressForFaucet), 344 | } 345 | }; 346 | let faucet_url = match &url { 347 | Some(faucet_url) => faucet_url, 348 | None => "http://localhost:8091/api/enqueue", 349 | }; 350 | 351 | log::info!("{}", request_funds_from_faucet(faucet_url, &address).await?); 352 | 353 | Ok(()) 354 | } 355 | 356 | // `increase-native-token-supply` command 357 | pub async fn increase_native_token_command( 358 | account_handle: &AccountHandle, 359 | token_id: String, 360 | amount: String, 361 | ) -> Result<(), Error> { 362 | let mint_transaction = account_handle 363 | .increase_native_token_supply( 364 | TokenId::from_str(&token_id)?, 365 | U256::from_dec_str(&amount).map_err(|e| Error::Miscellaneous(e.to_string()))?, 366 | None, 367 | None, 368 | ) 369 | .await?; 370 | 371 | log::info!( 372 | "Minting more native token transaction sent:\n{:?}\n{:?}", 373 | mint_transaction.transaction.transaction_id, 374 | mint_transaction.transaction.block_id 375 | ); 376 | 377 | Ok(()) 378 | } 379 | 380 | // `mint-native-token` command 381 | pub async fn mint_native_token_command( 382 | account_handle: &AccountHandle, 383 | circulating_supply: String, 384 | maximum_supply: String, 385 | foundry_metadata: Option>, 386 | ) -> Result<(), Error> { 387 | let native_token_options = NativeTokenOptions { 388 | alias_id: None, 389 | circulating_supply: U256::from_dec_str(&circulating_supply).map_err(|e| Error::Miscellaneous(e.to_string()))?, 390 | maximum_supply: U256::from_dec_str(&maximum_supply).map_err(|e| Error::Miscellaneous(e.to_string()))?, 391 | foundry_metadata, 392 | }; 393 | 394 | let mint_transaction = account_handle.mint_native_token(native_token_options, None).await?; 395 | 396 | log::info!( 397 | "Native token minting transaction sent:\n{:?}\n{:?}", 398 | mint_transaction.transaction.transaction_id, 399 | mint_transaction.transaction.block_id 400 | ); 401 | 402 | Ok(()) 403 | } 404 | 405 | // `mint-nft` command 406 | pub async fn mint_nft_command( 407 | account_handle: &AccountHandle, 408 | address: Option, 409 | immutable_metadata: Option>, 410 | metadata: Option>, 411 | tag: Option, 412 | sender: Option, 413 | issuer: Option, 414 | ) -> Result<(), Error> { 415 | let tag = if let Some(hex) = tag { 416 | Some(prefix_hex::decode(&hex).map_err(|e| Error::Miscellaneous(e.to_string()))?) 417 | } else { 418 | None 419 | }; 420 | let nft_options = vec![NftOptions { 421 | issuer, 422 | sender, 423 | tag, 424 | address, 425 | immutable_metadata, 426 | metadata, 427 | }]; 428 | let transaction = account_handle.mint_nfts(nft_options, None).await?; 429 | 430 | log::info!( 431 | "NFT minting transaction sent:\n{:?}\n{:?}", 432 | transaction.transaction_id, 433 | transaction.block_id 434 | ); 435 | 436 | Ok(()) 437 | } 438 | 439 | // `new-address` command 440 | pub async fn new_address_command(account_handle: &AccountHandle) -> Result<(), Error> { 441 | let address = account_handle.generate_addresses(1, None).await?; 442 | 443 | print_address(account_handle, &address[0]).await?; 444 | 445 | Ok(()) 446 | } 447 | 448 | /// `output` command 449 | pub async fn output_command(account_handle: &AccountHandle, output_id: String) -> Result<(), Error> { 450 | let output = account_handle.get_output(&OutputId::from_str(&output_id)?).await; 451 | 452 | if let Some(output) = output { 453 | log::info!("{output:#?}"); 454 | } else { 455 | log::info!("Output not found"); 456 | } 457 | 458 | Ok(()) 459 | } 460 | 461 | /// `outputs` command 462 | pub async fn outputs_command(account_handle: &AccountHandle) -> Result<(), Error> { 463 | let outputs = account_handle.outputs(None).await?; 464 | 465 | if outputs.is_empty() { 466 | log::info!("No outputs found"); 467 | } else { 468 | let output_ids: Vec = outputs.iter().map(|o| o.output_id).collect(); 469 | log::info!("Outputs: {output_ids:#?}"); 470 | } 471 | 472 | Ok(()) 473 | } 474 | 475 | // `send` command 476 | pub async fn send_command(account_handle: &AccountHandle, address: String, amount: u64) -> Result<(), Error> { 477 | let outputs = vec![AddressWithAmount { address, amount }]; 478 | let transaction = account_handle.send_amount(outputs, None).await?; 479 | 480 | log::info!( 481 | "Transaction sent:\n{:?}\n{:?}", 482 | transaction.transaction_id, 483 | transaction.block_id 484 | ); 485 | 486 | Ok(()) 487 | } 488 | 489 | // `send-micro` command 490 | pub async fn send_micro_command(account_handle: &AccountHandle, address: String, amount: u64) -> Result<(), Error> { 491 | let outputs = vec![AddressWithMicroAmount { 492 | address, 493 | amount, 494 | return_address: None, 495 | expiration: None, 496 | }]; 497 | 498 | let transaction = account_handle.send_micro_transaction(outputs, None).await?; 499 | 500 | log::info!( 501 | "Micro transaction sent:\n{:?}\n{:?}", 502 | transaction.transaction_id, 503 | transaction.block_id 504 | ); 505 | 506 | Ok(()) 507 | } 508 | 509 | // `send-native-token` command 510 | pub async fn send_native_token_command( 511 | account_handle: &AccountHandle, 512 | address: String, 513 | token_id: String, 514 | amount: String, 515 | gift_storage_deposit: Option, 516 | ) -> Result<(), Error> { 517 | let transaction = if gift_storage_deposit.unwrap_or(false) { 518 | // Send native tokens together with the required storage deposit 519 | let rent_structure = account_handle.client().get_rent_structure().await?; 520 | let token_supply = account_handle.client().get_token_supply().await?; 521 | 522 | let outputs = vec![ 523 | BasicOutputBuilder::new_with_minimum_storage_deposit(rent_structure)? 524 | .add_unlock_condition(UnlockCondition::Address(AddressUnlockCondition::new( 525 | Address::try_from_bech32(address)?.1, 526 | ))) 527 | .with_native_tokens(vec![NativeToken::new( 528 | TokenId::from_str(&token_id)?, 529 | U256::from_dec_str(&amount).map_err(|e| Error::Miscellaneous(e.to_string()))?, 530 | )?]) 531 | .finish_output(token_supply)?, 532 | ]; 533 | 534 | account_handle.send(outputs, None).await? 535 | } else { 536 | // Send native tokens with storage deposit return and expiration 537 | let outputs = vec![AddressNativeTokens { 538 | address, 539 | native_tokens: vec![( 540 | TokenId::from_str(&token_id)?, 541 | U256::from_dec_str(&amount).map_err(|e| Error::Miscellaneous(e.to_string()))?, 542 | )], 543 | ..Default::default() 544 | }]; 545 | account_handle.send_native_tokens(outputs, None).await? 546 | }; 547 | 548 | log::info!( 549 | "Native token transaction sent:\n{:?}\n{:?}", 550 | transaction.transaction_id, 551 | transaction.block_id 552 | ); 553 | 554 | Ok(()) 555 | } 556 | 557 | // `send-nft` command 558 | pub async fn send_nft_command(account_handle: &AccountHandle, address: String, nft_id: String) -> Result<(), Error> { 559 | let outputs = vec![AddressAndNftId { 560 | address, 561 | nft_id: NftId::from_str(&nft_id)?, 562 | }]; 563 | let transaction = account_handle.send_nft(outputs, None).await?; 564 | 565 | log::info!( 566 | "Nft transaction sent:\n{:?}\n{:?}", 567 | transaction.transaction_id, 568 | transaction.block_id 569 | ); 570 | 571 | Ok(()) 572 | } 573 | 574 | // `sync` command 575 | pub async fn sync_command(account_handle: &AccountHandle) -> Result<(), Error> { 576 | let sync = account_handle.sync(None).await?; 577 | 578 | log::info!("Synced: {sync:?}"); 579 | 580 | Ok(()) 581 | } 582 | 583 | /// `transactions` command 584 | pub async fn transactions_command(account_handle: &AccountHandle) -> Result<(), Error> { 585 | let transactions = account_handle.transactions().await?; 586 | 587 | if transactions.is_empty() { 588 | log::info!("No transactions found"); 589 | } else { 590 | for tx in transactions { 591 | log::info!("{}", serde_json::to_string(&TransactionDto::from(&tx))?); 592 | } 593 | } 594 | 595 | Ok(()) 596 | } 597 | 598 | /// `unspent-outputs` command 599 | pub async fn unspent_outputs_command(account_handle: &AccountHandle) -> Result<(), Error> { 600 | let outputs = account_handle.unspent_outputs(None).await?; 601 | 602 | if outputs.is_empty() { 603 | log::info!("No outputs found"); 604 | } else { 605 | let output_ids: Vec = outputs.iter().map(|o| o.output_id).collect(); 606 | log::info!("Unspent outputs: {output_ids:#?}"); 607 | } 608 | 609 | Ok(()) 610 | } 611 | 612 | pub async fn vote_command(account_handle: &AccountHandle, event_id: String, answers: Vec) -> Result<(), Error> { 613 | let transaction = account_handle 614 | .vote(Some(ParticipationEventId::from_str(&event_id)?), Some(answers)) 615 | .await?; 616 | 617 | log::info!( 618 | "Voting transaction sent:\n{:?}\n{:?}", 619 | transaction.transaction_id, 620 | transaction.block_id 621 | ); 622 | 623 | Ok(()) 624 | } 625 | 626 | pub async fn stop_participating_command(account_handle: &AccountHandle, event_id: String) -> Result<(), Error> { 627 | let transaction = account_handle 628 | .stop_participating(ParticipationEventId::from_str(&event_id)?) 629 | .await?; 630 | 631 | log::info!( 632 | "Stop participating transaction sent:\n{:?}\n{:?}", 633 | transaction.transaction_id, 634 | transaction.block_id 635 | ); 636 | 637 | Ok(()) 638 | } 639 | 640 | pub async fn participation_overview_command(account_handle: &AccountHandle) -> Result<(), Error> { 641 | let participation_overview = account_handle.get_participation_overview().await?; 642 | 643 | log::info!("Participation overview: {participation_overview:?}"); 644 | 645 | Ok(()) 646 | } 647 | 648 | pub async fn voting_power_command(account_handle: &AccountHandle) -> Result<(), Error> { 649 | let voting_power = account_handle.get_voting_power().await?; 650 | 651 | log::info!("Voting power: {voting_power}"); 652 | 653 | Ok(()) 654 | } 655 | 656 | pub async fn increase_voting_power_command(account_handle: &AccountHandle, amount: u64) -> Result<(), Error> { 657 | let transaction = account_handle.increase_voting_power(amount).await?; 658 | 659 | log::info!( 660 | "Increase voting power transaction sent:\n{:?}\n{:?}", 661 | transaction.transaction_id, 662 | transaction.block_id 663 | ); 664 | 665 | Ok(()) 666 | } 667 | 668 | pub async fn decrease_voting_power_command(account_handle: &AccountHandle, amount: u64) -> Result<(), Error> { 669 | let transaction = account_handle.decrease_voting_power(amount).await?; 670 | 671 | log::info!( 672 | "Decrease voting power transaction sent:\n{:?}\n{:?}", 673 | transaction.transaction_id, 674 | transaction.block_id 675 | ); 676 | 677 | Ok(()) 678 | } 679 | 680 | pub async fn voting_output_command(account_handle: &AccountHandle) -> Result<(), Error> { 681 | let output = account_handle.get_voting_output().await?; 682 | 683 | log::info!("Voting output: {output:?}"); 684 | 685 | Ok(()) 686 | } 687 | 688 | async fn print_address(account_handle: &AccountHandle, address: &AccountAddress) -> Result<(), Error> { 689 | let mut log = format!("Address {}: {}", address.key_index(), address.address().to_bech32()); 690 | 691 | if *address.internal() { 692 | log = format!("{log}\nChange address"); 693 | } 694 | 695 | let addresses = account_handle.addresses_with_unspent_outputs().await?; 696 | 697 | if let Ok(index) = addresses.binary_search_by_key(&(address.key_index(), address.internal()), |a| { 698 | (a.key_index(), a.internal()) 699 | }) { 700 | log = format!("{log}\nOutputs: {:#?}", addresses[index].output_ids()); 701 | } 702 | 703 | log::info!("{log}"); 704 | 705 | Ok(()) 706 | } 707 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.19.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "aead" 22 | version = "0.4.3" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" 25 | dependencies = [ 26 | "generic-array", 27 | ] 28 | 29 | [[package]] 30 | name = "aes" 31 | version = "0.7.5" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" 34 | dependencies = [ 35 | "cfg-if", 36 | "cipher", 37 | "cpufeatures", 38 | "opaque-debug", 39 | ] 40 | 41 | [[package]] 42 | name = "aes-gcm" 43 | version = "0.9.4" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" 46 | dependencies = [ 47 | "aead", 48 | "aes", 49 | "cipher", 50 | "ctr", 51 | "ghash", 52 | "subtle", 53 | ] 54 | 55 | [[package]] 56 | name = "ahash" 57 | version = "0.7.6" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 60 | dependencies = [ 61 | "getrandom", 62 | "once_cell", 63 | "version_check", 64 | ] 65 | 66 | [[package]] 67 | name = "ahash" 68 | version = "0.8.2" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "bf6ccdb167abbf410dcb915cabd428929d7f6a04980b54a11f26a39f1c7f7107" 71 | dependencies = [ 72 | "cfg-if", 73 | "once_cell", 74 | "version_check", 75 | ] 76 | 77 | [[package]] 78 | name = "anyhow" 79 | version = "1.0.66" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" 82 | 83 | [[package]] 84 | name = "arrayref" 85 | version = "0.3.6" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" 88 | 89 | [[package]] 90 | name = "arrayvec" 91 | version = "0.7.2" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 94 | 95 | [[package]] 96 | name = "async-trait" 97 | version = "0.1.64" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" 100 | dependencies = [ 101 | "proc-macro2", 102 | "quote", 103 | "syn", 104 | ] 105 | 106 | [[package]] 107 | name = "atty" 108 | version = "0.2.14" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 111 | dependencies = [ 112 | "hermit-abi 0.1.19", 113 | "libc", 114 | "winapi", 115 | ] 116 | 117 | [[package]] 118 | name = "autocfg" 119 | version = "1.1.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 122 | 123 | [[package]] 124 | name = "backtrace" 125 | version = "0.3.67" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" 128 | dependencies = [ 129 | "addr2line", 130 | "cc", 131 | "cfg-if", 132 | "libc", 133 | "miniz_oxide", 134 | "object", 135 | "rustc-demangle", 136 | ] 137 | 138 | [[package]] 139 | name = "base64" 140 | version = "0.13.1" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 143 | 144 | [[package]] 145 | name = "base64" 146 | version = "0.21.0" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" 149 | 150 | [[package]] 151 | name = "bech32" 152 | version = "0.9.1" 153 | source = "registry+https://github.com/rust-lang/crates.io-index" 154 | checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" 155 | 156 | [[package]] 157 | name = "bincode" 158 | version = "1.3.3" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 161 | dependencies = [ 162 | "serde", 163 | ] 164 | 165 | [[package]] 166 | name = "bitflags" 167 | version = "1.3.2" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 170 | 171 | [[package]] 172 | name = "bitvec" 173 | version = "1.0.1" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" 176 | dependencies = [ 177 | "funty", 178 | "radium", 179 | "tap", 180 | "wyz", 181 | ] 182 | 183 | [[package]] 184 | name = "blake2" 185 | version = "0.10.5" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" 188 | dependencies = [ 189 | "digest 0.10.6", 190 | ] 191 | 192 | [[package]] 193 | name = "blake2b_simd" 194 | version = "1.0.0" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" 197 | dependencies = [ 198 | "arrayref", 199 | "arrayvec", 200 | "constant_time_eq", 201 | ] 202 | 203 | [[package]] 204 | name = "block-buffer" 205 | version = "0.9.0" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 208 | dependencies = [ 209 | "generic-array", 210 | ] 211 | 212 | [[package]] 213 | name = "block-buffer" 214 | version = "0.10.3" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" 217 | dependencies = [ 218 | "generic-array", 219 | ] 220 | 221 | [[package]] 222 | name = "bumpalo" 223 | version = "3.11.1" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" 226 | 227 | [[package]] 228 | name = "byte-slice-cast" 229 | version = "1.2.2" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" 232 | 233 | [[package]] 234 | name = "bytemuck" 235 | version = "1.13.0" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "c041d3eab048880cb0b86b256447da3f18859a163c3b8d8893f4e6368abe6393" 238 | 239 | [[package]] 240 | name = "byteorder" 241 | version = "1.4.3" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 244 | 245 | [[package]] 246 | name = "bytes" 247 | version = "1.3.0" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" 250 | 251 | [[package]] 252 | name = "cc" 253 | version = "1.0.77" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" 256 | 257 | [[package]] 258 | name = "cfg-if" 259 | version = "1.0.0" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 262 | 263 | [[package]] 264 | name = "chacha20" 265 | version = "0.8.2" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" 268 | dependencies = [ 269 | "cfg-if", 270 | "cipher", 271 | "cpufeatures", 272 | "zeroize", 273 | ] 274 | 275 | [[package]] 276 | name = "chacha20poly1305" 277 | version = "0.9.1" 278 | source = "registry+https://github.com/rust-lang/crates.io-index" 279 | checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" 280 | dependencies = [ 281 | "aead", 282 | "chacha20", 283 | "cipher", 284 | "poly1305", 285 | "zeroize", 286 | ] 287 | 288 | [[package]] 289 | name = "cipher" 290 | version = "0.3.0" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" 293 | dependencies = [ 294 | "generic-array", 295 | ] 296 | 297 | [[package]] 298 | name = "clap" 299 | version = "3.2.23" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" 302 | dependencies = [ 303 | "bitflags", 304 | "clap_derive", 305 | "clap_lex", 306 | "indexmap", 307 | "once_cell", 308 | "textwrap", 309 | ] 310 | 311 | [[package]] 312 | name = "clap_derive" 313 | version = "3.2.18" 314 | source = "registry+https://github.com/rust-lang/crates.io-index" 315 | checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" 316 | dependencies = [ 317 | "heck", 318 | "proc-macro-error", 319 | "proc-macro2", 320 | "quote", 321 | "syn", 322 | ] 323 | 324 | [[package]] 325 | name = "clap_lex" 326 | version = "0.2.4" 327 | source = "registry+https://github.com/rust-lang/crates.io-index" 328 | checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" 329 | dependencies = [ 330 | "os_str_bytes", 331 | ] 332 | 333 | [[package]] 334 | name = "cli-wallet" 335 | version = "1.0.0-rc.2" 336 | dependencies = [ 337 | "clap", 338 | "dialoguer", 339 | "fern-logger", 340 | "iota-wallet", 341 | "log", 342 | "prefix-hex", 343 | "serde_json", 344 | "thiserror", 345 | "tokio", 346 | ] 347 | 348 | [[package]] 349 | name = "colored" 350 | version = "1.9.3" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "f4ffc801dacf156c5854b9df4f425a626539c3a6ef7893cc0c5084a23f0b6c59" 353 | dependencies = [ 354 | "atty", 355 | "lazy_static", 356 | "winapi", 357 | ] 358 | 359 | [[package]] 360 | name = "console" 361 | version = "0.15.2" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c" 364 | dependencies = [ 365 | "encode_unicode", 366 | "lazy_static", 367 | "libc", 368 | "terminal_size", 369 | "unicode-width", 370 | "winapi", 371 | ] 372 | 373 | [[package]] 374 | name = "constant_time_eq" 375 | version = "0.1.5" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" 378 | 379 | [[package]] 380 | name = "cpufeatures" 381 | version = "0.2.5" 382 | source = "registry+https://github.com/rust-lang/crates.io-index" 383 | checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" 384 | dependencies = [ 385 | "libc", 386 | ] 387 | 388 | [[package]] 389 | name = "crossbeam-utils" 390 | version = "0.8.14" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" 393 | dependencies = [ 394 | "cfg-if", 395 | ] 396 | 397 | [[package]] 398 | name = "crunchy" 399 | version = "0.2.2" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 402 | 403 | [[package]] 404 | name = "crypto-common" 405 | version = "0.1.6" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 408 | dependencies = [ 409 | "generic-array", 410 | "typenum", 411 | ] 412 | 413 | [[package]] 414 | name = "ctr" 415 | version = "0.8.0" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" 418 | dependencies = [ 419 | "cipher", 420 | ] 421 | 422 | [[package]] 423 | name = "curve25519-dalek" 424 | version = "3.2.0" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" 427 | dependencies = [ 428 | "byteorder", 429 | "digest 0.9.0", 430 | "rand_core 0.5.1", 431 | "subtle", 432 | "zeroize", 433 | ] 434 | 435 | [[package]] 436 | name = "darling" 437 | version = "0.14.2" 438 | source = "registry+https://github.com/rust-lang/crates.io-index" 439 | checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" 440 | dependencies = [ 441 | "darling_core", 442 | "darling_macro", 443 | ] 444 | 445 | [[package]] 446 | name = "darling_core" 447 | version = "0.14.2" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" 450 | dependencies = [ 451 | "fnv", 452 | "ident_case", 453 | "proc-macro2", 454 | "quote", 455 | "strsim", 456 | "syn", 457 | ] 458 | 459 | [[package]] 460 | name = "darling_macro" 461 | version = "0.14.2" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" 464 | dependencies = [ 465 | "darling_core", 466 | "quote", 467 | "syn", 468 | ] 469 | 470 | [[package]] 471 | name = "derive_builder" 472 | version = "0.12.0" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" 475 | dependencies = [ 476 | "derive_builder_macro", 477 | ] 478 | 479 | [[package]] 480 | name = "derive_builder_core" 481 | version = "0.12.0" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" 484 | dependencies = [ 485 | "darling", 486 | "proc-macro2", 487 | "quote", 488 | "syn", 489 | ] 490 | 491 | [[package]] 492 | name = "derive_builder_macro" 493 | version = "0.12.0" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" 496 | dependencies = [ 497 | "derive_builder_core", 498 | "syn", 499 | ] 500 | 501 | [[package]] 502 | name = "derive_more" 503 | version = "0.99.17" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 506 | dependencies = [ 507 | "proc-macro2", 508 | "quote", 509 | "syn", 510 | ] 511 | 512 | [[package]] 513 | name = "dialoguer" 514 | version = "0.10.3" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "af3c796f3b0b408d9fd581611b47fa850821fcb84aa640b83a3c1a5be2d691f2" 517 | dependencies = [ 518 | "console", 519 | "shell-words", 520 | "zeroize", 521 | ] 522 | 523 | [[package]] 524 | name = "digest" 525 | version = "0.9.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 528 | dependencies = [ 529 | "generic-array", 530 | ] 531 | 532 | [[package]] 533 | name = "digest" 534 | version = "0.10.6" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 537 | dependencies = [ 538 | "block-buffer 0.10.3", 539 | "crypto-common", 540 | "subtle", 541 | ] 542 | 543 | [[package]] 544 | name = "dirs" 545 | version = "4.0.0" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 548 | dependencies = [ 549 | "dirs-sys", 550 | ] 551 | 552 | [[package]] 553 | name = "dirs-next" 554 | version = "2.0.0" 555 | source = "registry+https://github.com/rust-lang/crates.io-index" 556 | checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" 557 | dependencies = [ 558 | "cfg-if", 559 | "dirs-sys-next", 560 | ] 561 | 562 | [[package]] 563 | name = "dirs-sys" 564 | version = "0.3.7" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 567 | dependencies = [ 568 | "libc", 569 | "redox_users", 570 | "winapi", 571 | ] 572 | 573 | [[package]] 574 | name = "dirs-sys-next" 575 | version = "0.1.2" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" 578 | dependencies = [ 579 | "libc", 580 | "redox_users", 581 | "winapi", 582 | ] 583 | 584 | [[package]] 585 | name = "ed25519-zebra" 586 | version = "3.1.0" 587 | source = "registry+https://github.com/rust-lang/crates.io-index" 588 | checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" 589 | dependencies = [ 590 | "curve25519-dalek", 591 | "hashbrown 0.12.3", 592 | "hex", 593 | "rand_core 0.6.4", 594 | "sha2 0.9.9", 595 | "zeroize", 596 | ] 597 | 598 | [[package]] 599 | name = "encode_unicode" 600 | version = "0.3.6" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 603 | 604 | [[package]] 605 | name = "encoding_rs" 606 | version = "0.8.31" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" 609 | dependencies = [ 610 | "cfg-if", 611 | ] 612 | 613 | [[package]] 614 | name = "fern" 615 | version = "0.6.1" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" 618 | dependencies = [ 619 | "colored", 620 | "log", 621 | ] 622 | 623 | [[package]] 624 | name = "fern-logger" 625 | version = "0.5.0" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "d72fcbd7f804f2dcb89b295dfdfeff1a81338b1960387a45261f857ddc553a9f" 628 | dependencies = [ 629 | "fern", 630 | "log", 631 | "serde", 632 | "thiserror", 633 | "time-helper", 634 | ] 635 | 636 | [[package]] 637 | name = "fixed-hash" 638 | version = "0.8.0" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" 641 | dependencies = [ 642 | "byteorder", 643 | "rand", 644 | "rustc-hex", 645 | "static_assertions", 646 | ] 647 | 648 | [[package]] 649 | name = "fnv" 650 | version = "1.0.7" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 653 | 654 | [[package]] 655 | name = "form_urlencoded" 656 | version = "1.1.0" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 659 | dependencies = [ 660 | "percent-encoding", 661 | ] 662 | 663 | [[package]] 664 | name = "funty" 665 | version = "2.0.0" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" 668 | 669 | [[package]] 670 | name = "futures" 671 | version = "0.3.26" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" 674 | dependencies = [ 675 | "futures-channel", 676 | "futures-core", 677 | "futures-executor", 678 | "futures-io", 679 | "futures-sink", 680 | "futures-task", 681 | "futures-util", 682 | ] 683 | 684 | [[package]] 685 | name = "futures-channel" 686 | version = "0.3.26" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" 689 | dependencies = [ 690 | "futures-core", 691 | "futures-sink", 692 | ] 693 | 694 | [[package]] 695 | name = "futures-core" 696 | version = "0.3.26" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" 699 | 700 | [[package]] 701 | name = "futures-executor" 702 | version = "0.3.26" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" 705 | dependencies = [ 706 | "futures-core", 707 | "futures-task", 708 | "futures-util", 709 | "num_cpus", 710 | ] 711 | 712 | [[package]] 713 | name = "futures-io" 714 | version = "0.3.26" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" 717 | 718 | [[package]] 719 | name = "futures-sink" 720 | version = "0.3.26" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" 723 | 724 | [[package]] 725 | name = "futures-task" 726 | version = "0.3.26" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" 729 | 730 | [[package]] 731 | name = "futures-util" 732 | version = "0.3.26" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" 735 | dependencies = [ 736 | "futures-channel", 737 | "futures-core", 738 | "futures-io", 739 | "futures-sink", 740 | "futures-task", 741 | "memchr", 742 | "pin-project-lite", 743 | "pin-utils", 744 | "slab", 745 | ] 746 | 747 | [[package]] 748 | name = "generic-array" 749 | version = "0.14.6" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 752 | dependencies = [ 753 | "typenum", 754 | "version_check", 755 | ] 756 | 757 | [[package]] 758 | name = "getrandom" 759 | version = "0.2.8" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 762 | dependencies = [ 763 | "cfg-if", 764 | "js-sys", 765 | "libc", 766 | "wasi", 767 | "wasm-bindgen", 768 | ] 769 | 770 | [[package]] 771 | name = "getset" 772 | version = "0.1.2" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" 775 | dependencies = [ 776 | "proc-macro-error", 777 | "proc-macro2", 778 | "quote", 779 | "syn", 780 | ] 781 | 782 | [[package]] 783 | name = "ghash" 784 | version = "0.4.4" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" 787 | dependencies = [ 788 | "opaque-debug", 789 | "polyval", 790 | ] 791 | 792 | [[package]] 793 | name = "gimli" 794 | version = "0.27.1" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" 797 | 798 | [[package]] 799 | name = "gloo-storage" 800 | version = "0.2.2" 801 | source = "registry+https://github.com/rust-lang/crates.io-index" 802 | checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" 803 | dependencies = [ 804 | "gloo-utils", 805 | "js-sys", 806 | "serde", 807 | "serde_json", 808 | "thiserror", 809 | "wasm-bindgen", 810 | "web-sys", 811 | ] 812 | 813 | [[package]] 814 | name = "gloo-timers" 815 | version = "0.2.6" 816 | source = "registry+https://github.com/rust-lang/crates.io-index" 817 | checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" 818 | dependencies = [ 819 | "futures-channel", 820 | "futures-core", 821 | "js-sys", 822 | "wasm-bindgen", 823 | ] 824 | 825 | [[package]] 826 | name = "gloo-utils" 827 | version = "0.1.6" 828 | source = "registry+https://github.com/rust-lang/crates.io-index" 829 | checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" 830 | dependencies = [ 831 | "js-sys", 832 | "serde", 833 | "serde_json", 834 | "wasm-bindgen", 835 | "web-sys", 836 | ] 837 | 838 | [[package]] 839 | name = "h2" 840 | version = "0.3.15" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" 843 | dependencies = [ 844 | "bytes", 845 | "fnv", 846 | "futures-core", 847 | "futures-sink", 848 | "futures-util", 849 | "http", 850 | "indexmap", 851 | "slab", 852 | "tokio", 853 | "tokio-util", 854 | "tracing", 855 | ] 856 | 857 | [[package]] 858 | name = "hashbrown" 859 | version = "0.12.3" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 862 | dependencies = [ 863 | "ahash 0.7.6", 864 | ] 865 | 866 | [[package]] 867 | name = "hashbrown" 868 | version = "0.13.2" 869 | source = "registry+https://github.com/rust-lang/crates.io-index" 870 | checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" 871 | dependencies = [ 872 | "ahash 0.8.2", 873 | "serde", 874 | ] 875 | 876 | [[package]] 877 | name = "heck" 878 | version = "0.4.0" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 881 | 882 | [[package]] 883 | name = "hermit-abi" 884 | version = "0.1.19" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 887 | dependencies = [ 888 | "libc", 889 | ] 890 | 891 | [[package]] 892 | name = "hermit-abi" 893 | version = "0.2.6" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 896 | dependencies = [ 897 | "libc", 898 | ] 899 | 900 | [[package]] 901 | name = "hex" 902 | version = "0.4.3" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 905 | 906 | [[package]] 907 | name = "hkdf" 908 | version = "0.12.3" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" 911 | dependencies = [ 912 | "hmac", 913 | ] 914 | 915 | [[package]] 916 | name = "hmac" 917 | version = "0.12.1" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 920 | dependencies = [ 921 | "digest 0.10.6", 922 | ] 923 | 924 | [[package]] 925 | name = "http" 926 | version = "0.2.8" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 929 | dependencies = [ 930 | "bytes", 931 | "fnv", 932 | "itoa", 933 | ] 934 | 935 | [[package]] 936 | name = "http-body" 937 | version = "0.4.5" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 940 | dependencies = [ 941 | "bytes", 942 | "http", 943 | "pin-project-lite", 944 | ] 945 | 946 | [[package]] 947 | name = "httparse" 948 | version = "1.8.0" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 951 | 952 | [[package]] 953 | name = "httpdate" 954 | version = "1.0.2" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 957 | 958 | [[package]] 959 | name = "hyper" 960 | version = "0.14.23" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" 963 | dependencies = [ 964 | "bytes", 965 | "futures-channel", 966 | "futures-core", 967 | "futures-util", 968 | "h2", 969 | "http", 970 | "http-body", 971 | "httparse", 972 | "httpdate", 973 | "itoa", 974 | "pin-project-lite", 975 | "socket2", 976 | "tokio", 977 | "tower-service", 978 | "tracing", 979 | "want", 980 | ] 981 | 982 | [[package]] 983 | name = "hyper-rustls" 984 | version = "0.23.1" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" 987 | dependencies = [ 988 | "http", 989 | "hyper", 990 | "rustls", 991 | "tokio", 992 | "tokio-rustls", 993 | ] 994 | 995 | [[package]] 996 | name = "ident_case" 997 | version = "1.0.1" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 1000 | 1001 | [[package]] 1002 | name = "idna" 1003 | version = "0.3.0" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 1006 | dependencies = [ 1007 | "unicode-bidi", 1008 | "unicode-normalization", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "impl-codec" 1013 | version = "0.6.0" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" 1016 | dependencies = [ 1017 | "parity-scale-codec", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "impl-serde" 1022 | version = "0.4.0" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" 1025 | dependencies = [ 1026 | "serde", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "impl-trait-for-tuples" 1031 | version = "0.2.2" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" 1034 | dependencies = [ 1035 | "proc-macro2", 1036 | "quote", 1037 | "syn", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "indexmap" 1042 | version = "1.9.2" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" 1045 | dependencies = [ 1046 | "autocfg", 1047 | "hashbrown 0.12.3", 1048 | ] 1049 | 1050 | [[package]] 1051 | name = "instant" 1052 | version = "0.1.12" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 1055 | dependencies = [ 1056 | "cfg-if", 1057 | "js-sys", 1058 | "wasm-bindgen", 1059 | "web-sys", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "iota-client" 1064 | version = "2.0.1-rc.6" 1065 | source = "git+https://github.com/iotaledger/iota.rs?rev=3a491bc344ff097f3ca6e988e7c338bda748116b#3a491bc344ff097f3ca6e988e7c338bda748116b" 1066 | dependencies = [ 1067 | "async-trait", 1068 | "backtrace", 1069 | "derive_builder", 1070 | "derive_more", 1071 | "futures", 1072 | "gloo-timers", 1073 | "hashbrown 0.13.2", 1074 | "instant", 1075 | "iota-crypto", 1076 | "iota-pow", 1077 | "iota-types", 1078 | "iota_stronghold", 1079 | "log", 1080 | "num_cpus", 1081 | "packable", 1082 | "prefix-hex", 1083 | "primitive-types", 1084 | "reqwest", 1085 | "serde", 1086 | "serde_json", 1087 | "thiserror", 1088 | "tokio", 1089 | "url", 1090 | "zeroize", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "iota-crypto" 1095 | version = "0.15.3" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "4e04d492224bff6e97142f033d0a4383bcbc05918be1ff7b3abd2c1cc85205a2" 1098 | dependencies = [ 1099 | "aead", 1100 | "aes", 1101 | "aes-gcm", 1102 | "autocfg", 1103 | "blake2", 1104 | "chacha20poly1305", 1105 | "curve25519-dalek", 1106 | "digest 0.10.6", 1107 | "ed25519-zebra", 1108 | "generic-array", 1109 | "getrandom", 1110 | "hmac", 1111 | "num-traits", 1112 | "pbkdf2", 1113 | "serde", 1114 | "sha2 0.10.6", 1115 | "unicode-normalization", 1116 | "x25519-dalek", 1117 | "zeroize", 1118 | ] 1119 | 1120 | [[package]] 1121 | name = "iota-pow" 1122 | version = "1.0.0-rc.3" 1123 | source = "git+https://github.com/iotaledger/iota.rs?rev=3a491bc344ff097f3ca6e988e7c338bda748116b#3a491bc344ff097f3ca6e988e7c338bda748116b" 1124 | dependencies = [ 1125 | "instant", 1126 | "iota-crypto", 1127 | "num_cpus", 1128 | ] 1129 | 1130 | [[package]] 1131 | name = "iota-types" 1132 | version = "1.0.0-rc.6" 1133 | source = "git+https://github.com/iotaledger/iota.rs?rev=3a491bc344ff097f3ca6e988e7c338bda748116b#3a491bc344ff097f3ca6e988e7c338bda748116b" 1134 | dependencies = [ 1135 | "bech32", 1136 | "bitflags", 1137 | "bytemuck", 1138 | "derive_more", 1139 | "getset", 1140 | "hashbrown 0.13.2", 1141 | "hex", 1142 | "iota-crypto", 1143 | "iota-pow", 1144 | "iterator-sorted", 1145 | "packable", 1146 | "prefix-hex", 1147 | "primitive-types", 1148 | "serde", 1149 | "serde-big-array", 1150 | "serde_json", 1151 | "serde_repr", 1152 | ] 1153 | 1154 | [[package]] 1155 | name = "iota-wallet" 1156 | version = "1.0.0-rc.5" 1157 | source = "git+https://github.com/iotaledger/wallet.rs?rev=9ebfa3355af46be72ffbac62a465be122b8c325e#9ebfa3355af46be72ffbac62a465be122b8c325e" 1158 | dependencies = [ 1159 | "async-trait", 1160 | "backtrace", 1161 | "fern-logger", 1162 | "futures", 1163 | "getset", 1164 | "gloo-storage", 1165 | "gloo-timers", 1166 | "instant", 1167 | "iota-client", 1168 | "iota-crypto", 1169 | "log", 1170 | "packable", 1171 | "prefix-hex", 1172 | "primitive-types", 1173 | "serde", 1174 | "serde_json", 1175 | "thiserror", 1176 | "tokio", 1177 | "wasm-bindgen-futures", 1178 | "zeroize", 1179 | ] 1180 | 1181 | [[package]] 1182 | name = "iota_stronghold" 1183 | version = "1.0.5" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "6c5baaa2460627283f54b968db7a38c9c754dc6059157cae64550ed1b79c91aa" 1186 | dependencies = [ 1187 | "bincode", 1188 | "hkdf", 1189 | "iota-crypto", 1190 | "rust-argon2", 1191 | "serde", 1192 | "stronghold-derive", 1193 | "stronghold-utils", 1194 | "stronghold_engine", 1195 | "thiserror", 1196 | "zeroize", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "ipnet" 1201 | version = "2.5.1" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" 1204 | 1205 | [[package]] 1206 | name = "iterator-sorted" 1207 | version = "0.1.0" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "d101775d2bc8f99f4ac18bf29b9ed70c0dd138b9a1e88d7b80179470cbbe8bd2" 1210 | 1211 | [[package]] 1212 | name = "itoa" 1213 | version = "1.0.4" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" 1216 | 1217 | [[package]] 1218 | name = "js-sys" 1219 | version = "0.3.60" 1220 | source = "registry+https://github.com/rust-lang/crates.io-index" 1221 | checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" 1222 | dependencies = [ 1223 | "wasm-bindgen", 1224 | ] 1225 | 1226 | [[package]] 1227 | name = "lazy_static" 1228 | version = "1.4.0" 1229 | source = "registry+https://github.com/rust-lang/crates.io-index" 1230 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1231 | 1232 | [[package]] 1233 | name = "libc" 1234 | version = "0.2.137" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" 1237 | 1238 | [[package]] 1239 | name = "libsodium-sys" 1240 | version = "0.2.7" 1241 | source = "registry+https://github.com/rust-lang/crates.io-index" 1242 | checksum = "6b779387cd56adfbc02ea4a668e704f729be8d6a6abd2c27ca5ee537849a92fd" 1243 | dependencies = [ 1244 | "cc", 1245 | "libc", 1246 | "pkg-config", 1247 | "walkdir", 1248 | ] 1249 | 1250 | [[package]] 1251 | name = "log" 1252 | version = "0.4.17" 1253 | source = "registry+https://github.com/rust-lang/crates.io-index" 1254 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 1255 | dependencies = [ 1256 | "cfg-if", 1257 | "serde", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "memchr" 1262 | version = "2.5.0" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 1265 | 1266 | [[package]] 1267 | name = "memoffset" 1268 | version = "0.6.5" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 1271 | dependencies = [ 1272 | "autocfg", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "mime" 1277 | version = "0.3.16" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 1280 | 1281 | [[package]] 1282 | name = "miniz_oxide" 1283 | version = "0.6.2" 1284 | source = "registry+https://github.com/rust-lang/crates.io-index" 1285 | checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" 1286 | dependencies = [ 1287 | "adler", 1288 | ] 1289 | 1290 | [[package]] 1291 | name = "mio" 1292 | version = "0.8.5" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" 1295 | dependencies = [ 1296 | "libc", 1297 | "log", 1298 | "wasi", 1299 | "windows-sys", 1300 | ] 1301 | 1302 | [[package]] 1303 | name = "nix" 1304 | version = "0.24.2" 1305 | source = "registry+https://github.com/rust-lang/crates.io-index" 1306 | checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" 1307 | dependencies = [ 1308 | "bitflags", 1309 | "cfg-if", 1310 | "libc", 1311 | "memoffset", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "num-traits" 1316 | version = "0.2.15" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1319 | dependencies = [ 1320 | "autocfg", 1321 | ] 1322 | 1323 | [[package]] 1324 | name = "num_cpus" 1325 | version = "1.15.0" 1326 | source = "registry+https://github.com/rust-lang/crates.io-index" 1327 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 1328 | dependencies = [ 1329 | "hermit-abi 0.2.6", 1330 | "libc", 1331 | ] 1332 | 1333 | [[package]] 1334 | name = "num_threads" 1335 | version = "0.1.6" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" 1338 | dependencies = [ 1339 | "libc", 1340 | ] 1341 | 1342 | [[package]] 1343 | name = "object" 1344 | version = "0.30.3" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" 1347 | dependencies = [ 1348 | "memchr", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "once_cell" 1353 | version = "1.16.0" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" 1356 | 1357 | [[package]] 1358 | name = "opaque-debug" 1359 | version = "0.3.0" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 1362 | 1363 | [[package]] 1364 | name = "os_str_bytes" 1365 | version = "6.4.1" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" 1368 | 1369 | [[package]] 1370 | name = "packable" 1371 | version = "0.7.0" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "d8013e43f83d46fba11c27e96b3c9d152614e085756fad393c1501cc3ecc0cd5" 1374 | dependencies = [ 1375 | "autocfg", 1376 | "packable-derive", 1377 | "primitive-types", 1378 | "serde", 1379 | ] 1380 | 1381 | [[package]] 1382 | name = "packable-derive" 1383 | version = "0.7.0" 1384 | source = "registry+https://github.com/rust-lang/crates.io-index" 1385 | checksum = "e9567693dd2f9a4339cb0a54adfcc0cb431c0ac88b2e46c6ddfb5f5d11a1cc4f" 1386 | dependencies = [ 1387 | "proc-macro-crate", 1388 | "proc-macro-error", 1389 | "proc-macro2", 1390 | "quote", 1391 | "syn", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "parity-scale-codec" 1396 | version = "3.2.1" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" 1399 | dependencies = [ 1400 | "arrayvec", 1401 | "bitvec", 1402 | "byte-slice-cast", 1403 | "impl-trait-for-tuples", 1404 | "parity-scale-codec-derive", 1405 | "serde", 1406 | ] 1407 | 1408 | [[package]] 1409 | name = "parity-scale-codec-derive" 1410 | version = "3.1.3" 1411 | source = "registry+https://github.com/rust-lang/crates.io-index" 1412 | checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" 1413 | dependencies = [ 1414 | "proc-macro-crate", 1415 | "proc-macro2", 1416 | "quote", 1417 | "syn", 1418 | ] 1419 | 1420 | [[package]] 1421 | name = "paste" 1422 | version = "1.0.9" 1423 | source = "registry+https://github.com/rust-lang/crates.io-index" 1424 | checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" 1425 | 1426 | [[package]] 1427 | name = "pbkdf2" 1428 | version = "0.11.0" 1429 | source = "registry+https://github.com/rust-lang/crates.io-index" 1430 | checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" 1431 | dependencies = [ 1432 | "digest 0.10.6", 1433 | ] 1434 | 1435 | [[package]] 1436 | name = "percent-encoding" 1437 | version = "2.2.0" 1438 | source = "registry+https://github.com/rust-lang/crates.io-index" 1439 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 1440 | 1441 | [[package]] 1442 | name = "pin-project-lite" 1443 | version = "0.2.9" 1444 | source = "registry+https://github.com/rust-lang/crates.io-index" 1445 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1446 | 1447 | [[package]] 1448 | name = "pin-utils" 1449 | version = "0.1.0" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1452 | 1453 | [[package]] 1454 | name = "pkg-config" 1455 | version = "0.3.26" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 1458 | 1459 | [[package]] 1460 | name = "poly1305" 1461 | version = "0.7.2" 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" 1463 | checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" 1464 | dependencies = [ 1465 | "cpufeatures", 1466 | "opaque-debug", 1467 | "universal-hash", 1468 | ] 1469 | 1470 | [[package]] 1471 | name = "polyval" 1472 | version = "0.5.3" 1473 | source = "registry+https://github.com/rust-lang/crates.io-index" 1474 | checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" 1475 | dependencies = [ 1476 | "cfg-if", 1477 | "cpufeatures", 1478 | "opaque-debug", 1479 | "universal-hash", 1480 | ] 1481 | 1482 | [[package]] 1483 | name = "ppv-lite86" 1484 | version = "0.2.17" 1485 | source = "registry+https://github.com/rust-lang/crates.io-index" 1486 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1487 | 1488 | [[package]] 1489 | name = "prefix-hex" 1490 | version = "0.5.0" 1491 | source = "registry+https://github.com/rust-lang/crates.io-index" 1492 | checksum = "75e3396888185b76a6e4c8fc883b3f039e56d3c0bca279744d2df70b3662e784" 1493 | dependencies = [ 1494 | "hex", 1495 | "primitive-types", 1496 | "uint", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "primitive-types" 1501 | version = "0.12.1" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" 1504 | dependencies = [ 1505 | "fixed-hash", 1506 | "impl-codec", 1507 | "impl-serde", 1508 | "uint", 1509 | ] 1510 | 1511 | [[package]] 1512 | name = "proc-macro-crate" 1513 | version = "1.2.1" 1514 | source = "registry+https://github.com/rust-lang/crates.io-index" 1515 | checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" 1516 | dependencies = [ 1517 | "once_cell", 1518 | "thiserror", 1519 | "toml", 1520 | ] 1521 | 1522 | [[package]] 1523 | name = "proc-macro-error" 1524 | version = "1.0.4" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1527 | dependencies = [ 1528 | "proc-macro-error-attr", 1529 | "proc-macro2", 1530 | "quote", 1531 | "syn", 1532 | "version_check", 1533 | ] 1534 | 1535 | [[package]] 1536 | name = "proc-macro-error-attr" 1537 | version = "1.0.4" 1538 | source = "registry+https://github.com/rust-lang/crates.io-index" 1539 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1540 | dependencies = [ 1541 | "proc-macro2", 1542 | "quote", 1543 | "version_check", 1544 | ] 1545 | 1546 | [[package]] 1547 | name = "proc-macro2" 1548 | version = "1.0.47" 1549 | source = "registry+https://github.com/rust-lang/crates.io-index" 1550 | checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" 1551 | dependencies = [ 1552 | "unicode-ident", 1553 | ] 1554 | 1555 | [[package]] 1556 | name = "quote" 1557 | version = "1.0.21" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" 1560 | dependencies = [ 1561 | "proc-macro2", 1562 | ] 1563 | 1564 | [[package]] 1565 | name = "radium" 1566 | version = "0.7.0" 1567 | source = "registry+https://github.com/rust-lang/crates.io-index" 1568 | checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" 1569 | 1570 | [[package]] 1571 | name = "rand" 1572 | version = "0.8.5" 1573 | source = "registry+https://github.com/rust-lang/crates.io-index" 1574 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1575 | dependencies = [ 1576 | "libc", 1577 | "rand_chacha", 1578 | "rand_core 0.6.4", 1579 | ] 1580 | 1581 | [[package]] 1582 | name = "rand_chacha" 1583 | version = "0.3.1" 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" 1585 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1586 | dependencies = [ 1587 | "ppv-lite86", 1588 | "rand_core 0.6.4", 1589 | ] 1590 | 1591 | [[package]] 1592 | name = "rand_core" 1593 | version = "0.5.1" 1594 | source = "registry+https://github.com/rust-lang/crates.io-index" 1595 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1596 | 1597 | [[package]] 1598 | name = "rand_core" 1599 | version = "0.6.4" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1602 | dependencies = [ 1603 | "getrandom", 1604 | ] 1605 | 1606 | [[package]] 1607 | name = "redox_syscall" 1608 | version = "0.2.16" 1609 | source = "registry+https://github.com/rust-lang/crates.io-index" 1610 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1611 | dependencies = [ 1612 | "bitflags", 1613 | ] 1614 | 1615 | [[package]] 1616 | name = "redox_users" 1617 | version = "0.4.3" 1618 | source = "registry+https://github.com/rust-lang/crates.io-index" 1619 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1620 | dependencies = [ 1621 | "getrandom", 1622 | "redox_syscall", 1623 | "thiserror", 1624 | ] 1625 | 1626 | [[package]] 1627 | name = "reqwest" 1628 | version = "0.11.14" 1629 | source = "registry+https://github.com/rust-lang/crates.io-index" 1630 | checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" 1631 | dependencies = [ 1632 | "base64 0.21.0", 1633 | "bytes", 1634 | "encoding_rs", 1635 | "futures-core", 1636 | "futures-util", 1637 | "h2", 1638 | "http", 1639 | "http-body", 1640 | "hyper", 1641 | "hyper-rustls", 1642 | "ipnet", 1643 | "js-sys", 1644 | "log", 1645 | "mime", 1646 | "once_cell", 1647 | "percent-encoding", 1648 | "pin-project-lite", 1649 | "rustls", 1650 | "rustls-pemfile", 1651 | "serde", 1652 | "serde_json", 1653 | "serde_urlencoded", 1654 | "tokio", 1655 | "tokio-rustls", 1656 | "tower-service", 1657 | "url", 1658 | "wasm-bindgen", 1659 | "wasm-bindgen-futures", 1660 | "web-sys", 1661 | "webpki-roots", 1662 | "winreg", 1663 | ] 1664 | 1665 | [[package]] 1666 | name = "ring" 1667 | version = "0.16.20" 1668 | source = "registry+https://github.com/rust-lang/crates.io-index" 1669 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 1670 | dependencies = [ 1671 | "cc", 1672 | "libc", 1673 | "once_cell", 1674 | "spin", 1675 | "untrusted", 1676 | "web-sys", 1677 | "winapi", 1678 | ] 1679 | 1680 | [[package]] 1681 | name = "rust-argon2" 1682 | version = "1.0.0" 1683 | source = "registry+https://github.com/rust-lang/crates.io-index" 1684 | checksum = "b50162d19404029c1ceca6f6980fe40d45c8b369f6f44446fa14bb39573b5bb9" 1685 | dependencies = [ 1686 | "base64 0.13.1", 1687 | "blake2b_simd", 1688 | "constant_time_eq", 1689 | "crossbeam-utils", 1690 | ] 1691 | 1692 | [[package]] 1693 | name = "rustc-demangle" 1694 | version = "0.1.21" 1695 | source = "registry+https://github.com/rust-lang/crates.io-index" 1696 | checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 1697 | 1698 | [[package]] 1699 | name = "rustc-hex" 1700 | version = "2.1.0" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" 1703 | 1704 | [[package]] 1705 | name = "rustls" 1706 | version = "0.20.7" 1707 | source = "registry+https://github.com/rust-lang/crates.io-index" 1708 | checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" 1709 | dependencies = [ 1710 | "log", 1711 | "ring", 1712 | "sct", 1713 | "webpki", 1714 | ] 1715 | 1716 | [[package]] 1717 | name = "rustls-pemfile" 1718 | version = "1.0.1" 1719 | source = "registry+https://github.com/rust-lang/crates.io-index" 1720 | checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" 1721 | dependencies = [ 1722 | "base64 0.13.1", 1723 | ] 1724 | 1725 | [[package]] 1726 | name = "ryu" 1727 | version = "1.0.11" 1728 | source = "registry+https://github.com/rust-lang/crates.io-index" 1729 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" 1730 | 1731 | [[package]] 1732 | name = "same-file" 1733 | version = "1.0.6" 1734 | source = "registry+https://github.com/rust-lang/crates.io-index" 1735 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1736 | dependencies = [ 1737 | "winapi-util", 1738 | ] 1739 | 1740 | [[package]] 1741 | name = "sct" 1742 | version = "0.7.0" 1743 | source = "registry+https://github.com/rust-lang/crates.io-index" 1744 | checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" 1745 | dependencies = [ 1746 | "ring", 1747 | "untrusted", 1748 | ] 1749 | 1750 | [[package]] 1751 | name = "serde" 1752 | version = "1.0.152" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" 1755 | dependencies = [ 1756 | "serde_derive", 1757 | ] 1758 | 1759 | [[package]] 1760 | name = "serde-big-array" 1761 | version = "0.4.1" 1762 | source = "registry+https://github.com/rust-lang/crates.io-index" 1763 | checksum = "3323f09a748af288c3dc2474ea6803ee81f118321775bffa3ac8f7e65c5e90e7" 1764 | dependencies = [ 1765 | "serde", 1766 | ] 1767 | 1768 | [[package]] 1769 | name = "serde_derive" 1770 | version = "1.0.152" 1771 | source = "registry+https://github.com/rust-lang/crates.io-index" 1772 | checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" 1773 | dependencies = [ 1774 | "proc-macro2", 1775 | "quote", 1776 | "syn", 1777 | ] 1778 | 1779 | [[package]] 1780 | name = "serde_json" 1781 | version = "1.0.93" 1782 | source = "registry+https://github.com/rust-lang/crates.io-index" 1783 | checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" 1784 | dependencies = [ 1785 | "itoa", 1786 | "ryu", 1787 | "serde", 1788 | ] 1789 | 1790 | [[package]] 1791 | name = "serde_repr" 1792 | version = "0.1.10" 1793 | source = "registry+https://github.com/rust-lang/crates.io-index" 1794 | checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" 1795 | dependencies = [ 1796 | "proc-macro2", 1797 | "quote", 1798 | "syn", 1799 | ] 1800 | 1801 | [[package]] 1802 | name = "serde_urlencoded" 1803 | version = "0.7.1" 1804 | source = "registry+https://github.com/rust-lang/crates.io-index" 1805 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1806 | dependencies = [ 1807 | "form_urlencoded", 1808 | "itoa", 1809 | "ryu", 1810 | "serde", 1811 | ] 1812 | 1813 | [[package]] 1814 | name = "sha2" 1815 | version = "0.9.9" 1816 | source = "registry+https://github.com/rust-lang/crates.io-index" 1817 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 1818 | dependencies = [ 1819 | "block-buffer 0.9.0", 1820 | "cfg-if", 1821 | "cpufeatures", 1822 | "digest 0.9.0", 1823 | "opaque-debug", 1824 | ] 1825 | 1826 | [[package]] 1827 | name = "sha2" 1828 | version = "0.10.6" 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" 1830 | checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" 1831 | dependencies = [ 1832 | "cfg-if", 1833 | "cpufeatures", 1834 | "digest 0.10.6", 1835 | ] 1836 | 1837 | [[package]] 1838 | name = "shell-words" 1839 | version = "1.1.0" 1840 | source = "registry+https://github.com/rust-lang/crates.io-index" 1841 | checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" 1842 | 1843 | [[package]] 1844 | name = "slab" 1845 | version = "0.4.7" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" 1848 | dependencies = [ 1849 | "autocfg", 1850 | ] 1851 | 1852 | [[package]] 1853 | name = "socket2" 1854 | version = "0.4.7" 1855 | source = "registry+https://github.com/rust-lang/crates.io-index" 1856 | checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" 1857 | dependencies = [ 1858 | "libc", 1859 | "winapi", 1860 | ] 1861 | 1862 | [[package]] 1863 | name = "spin" 1864 | version = "0.5.2" 1865 | source = "registry+https://github.com/rust-lang/crates.io-index" 1866 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1867 | 1868 | [[package]] 1869 | name = "static_assertions" 1870 | version = "1.1.0" 1871 | source = "registry+https://github.com/rust-lang/crates.io-index" 1872 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1873 | 1874 | [[package]] 1875 | name = "stronghold-derive" 1876 | version = "1.0.0" 1877 | source = "registry+https://github.com/rust-lang/crates.io-index" 1878 | checksum = "2835db23c4724c05a2f85b81c4681f4aa8ea158edc8a7f4ad791c916fb766c2e" 1879 | dependencies = [ 1880 | "proc-macro2", 1881 | "quote", 1882 | "syn", 1883 | ] 1884 | 1885 | [[package]] 1886 | name = "stronghold-runtime" 1887 | version = "1.0.2" 1888 | source = "registry+https://github.com/rust-lang/crates.io-index" 1889 | checksum = "d93abb10fbd11335d31c33a70b2523c0caab348215caa2ce6da04a268c30afcb" 1890 | dependencies = [ 1891 | "dirs", 1892 | "iota-crypto", 1893 | "libc", 1894 | "libsodium-sys", 1895 | "log", 1896 | "nix", 1897 | "rand", 1898 | "serde", 1899 | "thiserror", 1900 | "windows", 1901 | "zeroize", 1902 | ] 1903 | 1904 | [[package]] 1905 | name = "stronghold-utils" 1906 | version = "1.0.0" 1907 | source = "registry+https://github.com/rust-lang/crates.io-index" 1908 | checksum = "8300214898af5e153e7f66e49dbd1c6a21585f2d592d9f24f58b969792475ed6" 1909 | dependencies = [ 1910 | "rand", 1911 | "stronghold-derive", 1912 | ] 1913 | 1914 | [[package]] 1915 | name = "stronghold_engine" 1916 | version = "1.0.2" 1917 | source = "registry+https://github.com/rust-lang/crates.io-index" 1918 | checksum = "96d68a609d0a4f05dbde8b704619faa7f861069bbc649e3abecb4d389f10236f" 1919 | dependencies = [ 1920 | "anyhow", 1921 | "dirs-next", 1922 | "hex", 1923 | "iota-crypto", 1924 | "once_cell", 1925 | "paste", 1926 | "serde", 1927 | "stronghold-runtime", 1928 | "thiserror", 1929 | "zeroize", 1930 | ] 1931 | 1932 | [[package]] 1933 | name = "strsim" 1934 | version = "0.10.0" 1935 | source = "registry+https://github.com/rust-lang/crates.io-index" 1936 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1937 | 1938 | [[package]] 1939 | name = "subtle" 1940 | version = "2.4.1" 1941 | source = "registry+https://github.com/rust-lang/crates.io-index" 1942 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 1943 | 1944 | [[package]] 1945 | name = "syn" 1946 | version = "1.0.104" 1947 | source = "registry+https://github.com/rust-lang/crates.io-index" 1948 | checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" 1949 | dependencies = [ 1950 | "proc-macro2", 1951 | "quote", 1952 | "unicode-ident", 1953 | ] 1954 | 1955 | [[package]] 1956 | name = "synstructure" 1957 | version = "0.12.6" 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" 1959 | checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" 1960 | dependencies = [ 1961 | "proc-macro2", 1962 | "quote", 1963 | "syn", 1964 | "unicode-xid", 1965 | ] 1966 | 1967 | [[package]] 1968 | name = "tap" 1969 | version = "1.0.1" 1970 | source = "registry+https://github.com/rust-lang/crates.io-index" 1971 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" 1972 | 1973 | [[package]] 1974 | name = "terminal_size" 1975 | version = "0.1.17" 1976 | source = "registry+https://github.com/rust-lang/crates.io-index" 1977 | checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" 1978 | dependencies = [ 1979 | "libc", 1980 | "winapi", 1981 | ] 1982 | 1983 | [[package]] 1984 | name = "textwrap" 1985 | version = "0.16.0" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" 1988 | 1989 | [[package]] 1990 | name = "thiserror" 1991 | version = "1.0.38" 1992 | source = "registry+https://github.com/rust-lang/crates.io-index" 1993 | checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" 1994 | dependencies = [ 1995 | "thiserror-impl", 1996 | ] 1997 | 1998 | [[package]] 1999 | name = "thiserror-impl" 2000 | version = "1.0.38" 2001 | source = "registry+https://github.com/rust-lang/crates.io-index" 2002 | checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" 2003 | dependencies = [ 2004 | "proc-macro2", 2005 | "quote", 2006 | "syn", 2007 | ] 2008 | 2009 | [[package]] 2010 | name = "time" 2011 | version = "0.3.17" 2012 | source = "registry+https://github.com/rust-lang/crates.io-index" 2013 | checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" 2014 | dependencies = [ 2015 | "itoa", 2016 | "libc", 2017 | "num_threads", 2018 | "serde", 2019 | "time-core", 2020 | "time-macros", 2021 | ] 2022 | 2023 | [[package]] 2024 | name = "time-core" 2025 | version = "0.1.0" 2026 | source = "registry+https://github.com/rust-lang/crates.io-index" 2027 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 2028 | 2029 | [[package]] 2030 | name = "time-helper" 2031 | version = "0.1.0" 2032 | source = "registry+https://github.com/rust-lang/crates.io-index" 2033 | checksum = "17c30f0091717eeeff0b556d830302d5563de8b72fd49127aa5899a06a369808" 2034 | dependencies = [ 2035 | "time", 2036 | ] 2037 | 2038 | [[package]] 2039 | name = "time-macros" 2040 | version = "0.2.6" 2041 | source = "registry+https://github.com/rust-lang/crates.io-index" 2042 | checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" 2043 | dependencies = [ 2044 | "time-core", 2045 | ] 2046 | 2047 | [[package]] 2048 | name = "tinyvec" 2049 | version = "1.6.0" 2050 | source = "registry+https://github.com/rust-lang/crates.io-index" 2051 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 2052 | dependencies = [ 2053 | "tinyvec_macros", 2054 | ] 2055 | 2056 | [[package]] 2057 | name = "tinyvec_macros" 2058 | version = "0.1.0" 2059 | source = "registry+https://github.com/rust-lang/crates.io-index" 2060 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 2061 | 2062 | [[package]] 2063 | name = "tokio" 2064 | version = "1.25.0" 2065 | source = "registry+https://github.com/rust-lang/crates.io-index" 2066 | checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" 2067 | dependencies = [ 2068 | "autocfg", 2069 | "bytes", 2070 | "libc", 2071 | "memchr", 2072 | "mio", 2073 | "num_cpus", 2074 | "pin-project-lite", 2075 | "socket2", 2076 | "tokio-macros", 2077 | "windows-sys", 2078 | ] 2079 | 2080 | [[package]] 2081 | name = "tokio-macros" 2082 | version = "1.8.0" 2083 | source = "registry+https://github.com/rust-lang/crates.io-index" 2084 | checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" 2085 | dependencies = [ 2086 | "proc-macro2", 2087 | "quote", 2088 | "syn", 2089 | ] 2090 | 2091 | [[package]] 2092 | name = "tokio-rustls" 2093 | version = "0.23.4" 2094 | source = "registry+https://github.com/rust-lang/crates.io-index" 2095 | checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" 2096 | dependencies = [ 2097 | "rustls", 2098 | "tokio", 2099 | "webpki", 2100 | ] 2101 | 2102 | [[package]] 2103 | name = "tokio-util" 2104 | version = "0.7.4" 2105 | source = "registry+https://github.com/rust-lang/crates.io-index" 2106 | checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" 2107 | dependencies = [ 2108 | "bytes", 2109 | "futures-core", 2110 | "futures-sink", 2111 | "pin-project-lite", 2112 | "tokio", 2113 | "tracing", 2114 | ] 2115 | 2116 | [[package]] 2117 | name = "toml" 2118 | version = "0.5.9" 2119 | source = "registry+https://github.com/rust-lang/crates.io-index" 2120 | checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" 2121 | dependencies = [ 2122 | "serde", 2123 | ] 2124 | 2125 | [[package]] 2126 | name = "tower-service" 2127 | version = "0.3.2" 2128 | source = "registry+https://github.com/rust-lang/crates.io-index" 2129 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 2130 | 2131 | [[package]] 2132 | name = "tracing" 2133 | version = "0.1.37" 2134 | source = "registry+https://github.com/rust-lang/crates.io-index" 2135 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 2136 | dependencies = [ 2137 | "cfg-if", 2138 | "pin-project-lite", 2139 | "tracing-core", 2140 | ] 2141 | 2142 | [[package]] 2143 | name = "tracing-core" 2144 | version = "0.1.30" 2145 | source = "registry+https://github.com/rust-lang/crates.io-index" 2146 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 2147 | dependencies = [ 2148 | "once_cell", 2149 | ] 2150 | 2151 | [[package]] 2152 | name = "try-lock" 2153 | version = "0.2.3" 2154 | source = "registry+https://github.com/rust-lang/crates.io-index" 2155 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 2156 | 2157 | [[package]] 2158 | name = "typenum" 2159 | version = "1.15.0" 2160 | source = "registry+https://github.com/rust-lang/crates.io-index" 2161 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 2162 | 2163 | [[package]] 2164 | name = "uint" 2165 | version = "0.9.4" 2166 | source = "registry+https://github.com/rust-lang/crates.io-index" 2167 | checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" 2168 | dependencies = [ 2169 | "byteorder", 2170 | "crunchy", 2171 | "hex", 2172 | "static_assertions", 2173 | ] 2174 | 2175 | [[package]] 2176 | name = "unicode-bidi" 2177 | version = "0.3.8" 2178 | source = "registry+https://github.com/rust-lang/crates.io-index" 2179 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 2180 | 2181 | [[package]] 2182 | name = "unicode-ident" 2183 | version = "1.0.5" 2184 | source = "registry+https://github.com/rust-lang/crates.io-index" 2185 | checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" 2186 | 2187 | [[package]] 2188 | name = "unicode-normalization" 2189 | version = "0.1.22" 2190 | source = "registry+https://github.com/rust-lang/crates.io-index" 2191 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 2192 | dependencies = [ 2193 | "tinyvec", 2194 | ] 2195 | 2196 | [[package]] 2197 | name = "unicode-width" 2198 | version = "0.1.10" 2199 | source = "registry+https://github.com/rust-lang/crates.io-index" 2200 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 2201 | 2202 | [[package]] 2203 | name = "unicode-xid" 2204 | version = "0.2.4" 2205 | source = "registry+https://github.com/rust-lang/crates.io-index" 2206 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 2207 | 2208 | [[package]] 2209 | name = "universal-hash" 2210 | version = "0.4.1" 2211 | source = "registry+https://github.com/rust-lang/crates.io-index" 2212 | checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" 2213 | dependencies = [ 2214 | "generic-array", 2215 | "subtle", 2216 | ] 2217 | 2218 | [[package]] 2219 | name = "untrusted" 2220 | version = "0.7.1" 2221 | source = "registry+https://github.com/rust-lang/crates.io-index" 2222 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 2223 | 2224 | [[package]] 2225 | name = "url" 2226 | version = "2.3.1" 2227 | source = "registry+https://github.com/rust-lang/crates.io-index" 2228 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 2229 | dependencies = [ 2230 | "form_urlencoded", 2231 | "idna", 2232 | "percent-encoding", 2233 | "serde", 2234 | ] 2235 | 2236 | [[package]] 2237 | name = "version_check" 2238 | version = "0.9.4" 2239 | source = "registry+https://github.com/rust-lang/crates.io-index" 2240 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2241 | 2242 | [[package]] 2243 | name = "walkdir" 2244 | version = "2.3.2" 2245 | source = "registry+https://github.com/rust-lang/crates.io-index" 2246 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 2247 | dependencies = [ 2248 | "same-file", 2249 | "winapi", 2250 | "winapi-util", 2251 | ] 2252 | 2253 | [[package]] 2254 | name = "want" 2255 | version = "0.3.0" 2256 | source = "registry+https://github.com/rust-lang/crates.io-index" 2257 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 2258 | dependencies = [ 2259 | "log", 2260 | "try-lock", 2261 | ] 2262 | 2263 | [[package]] 2264 | name = "wasi" 2265 | version = "0.11.0+wasi-snapshot-preview1" 2266 | source = "registry+https://github.com/rust-lang/crates.io-index" 2267 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2268 | 2269 | [[package]] 2270 | name = "wasm-bindgen" 2271 | version = "0.2.83" 2272 | source = "registry+https://github.com/rust-lang/crates.io-index" 2273 | checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" 2274 | dependencies = [ 2275 | "cfg-if", 2276 | "wasm-bindgen-macro", 2277 | ] 2278 | 2279 | [[package]] 2280 | name = "wasm-bindgen-backend" 2281 | version = "0.2.83" 2282 | source = "registry+https://github.com/rust-lang/crates.io-index" 2283 | checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" 2284 | dependencies = [ 2285 | "bumpalo", 2286 | "log", 2287 | "once_cell", 2288 | "proc-macro2", 2289 | "quote", 2290 | "syn", 2291 | "wasm-bindgen-shared", 2292 | ] 2293 | 2294 | [[package]] 2295 | name = "wasm-bindgen-futures" 2296 | version = "0.4.33" 2297 | source = "registry+https://github.com/rust-lang/crates.io-index" 2298 | checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" 2299 | dependencies = [ 2300 | "cfg-if", 2301 | "js-sys", 2302 | "wasm-bindgen", 2303 | "web-sys", 2304 | ] 2305 | 2306 | [[package]] 2307 | name = "wasm-bindgen-macro" 2308 | version = "0.2.83" 2309 | source = "registry+https://github.com/rust-lang/crates.io-index" 2310 | checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" 2311 | dependencies = [ 2312 | "quote", 2313 | "wasm-bindgen-macro-support", 2314 | ] 2315 | 2316 | [[package]] 2317 | name = "wasm-bindgen-macro-support" 2318 | version = "0.2.83" 2319 | source = "registry+https://github.com/rust-lang/crates.io-index" 2320 | checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" 2321 | dependencies = [ 2322 | "proc-macro2", 2323 | "quote", 2324 | "syn", 2325 | "wasm-bindgen-backend", 2326 | "wasm-bindgen-shared", 2327 | ] 2328 | 2329 | [[package]] 2330 | name = "wasm-bindgen-shared" 2331 | version = "0.2.83" 2332 | source = "registry+https://github.com/rust-lang/crates.io-index" 2333 | checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" 2334 | 2335 | [[package]] 2336 | name = "web-sys" 2337 | version = "0.3.60" 2338 | source = "registry+https://github.com/rust-lang/crates.io-index" 2339 | checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" 2340 | dependencies = [ 2341 | "js-sys", 2342 | "wasm-bindgen", 2343 | ] 2344 | 2345 | [[package]] 2346 | name = "webpki" 2347 | version = "0.22.0" 2348 | source = "registry+https://github.com/rust-lang/crates.io-index" 2349 | checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" 2350 | dependencies = [ 2351 | "ring", 2352 | "untrusted", 2353 | ] 2354 | 2355 | [[package]] 2356 | name = "webpki-roots" 2357 | version = "0.22.5" 2358 | source = "registry+https://github.com/rust-lang/crates.io-index" 2359 | checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" 2360 | dependencies = [ 2361 | "webpki", 2362 | ] 2363 | 2364 | [[package]] 2365 | name = "winapi" 2366 | version = "0.3.9" 2367 | source = "registry+https://github.com/rust-lang/crates.io-index" 2368 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2369 | dependencies = [ 2370 | "winapi-i686-pc-windows-gnu", 2371 | "winapi-x86_64-pc-windows-gnu", 2372 | ] 2373 | 2374 | [[package]] 2375 | name = "winapi-i686-pc-windows-gnu" 2376 | version = "0.4.0" 2377 | source = "registry+https://github.com/rust-lang/crates.io-index" 2378 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2379 | 2380 | [[package]] 2381 | name = "winapi-util" 2382 | version = "0.1.5" 2383 | source = "registry+https://github.com/rust-lang/crates.io-index" 2384 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2385 | dependencies = [ 2386 | "winapi", 2387 | ] 2388 | 2389 | [[package]] 2390 | name = "winapi-x86_64-pc-windows-gnu" 2391 | version = "0.4.0" 2392 | source = "registry+https://github.com/rust-lang/crates.io-index" 2393 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2394 | 2395 | [[package]] 2396 | name = "windows" 2397 | version = "0.36.1" 2398 | source = "registry+https://github.com/rust-lang/crates.io-index" 2399 | checksum = "e53b97a83176b369b0eb2fd8158d4ae215357d02df9d40c1e1bf1879c5482c80" 2400 | dependencies = [ 2401 | "windows_aarch64_msvc 0.36.1", 2402 | "windows_i686_gnu 0.36.1", 2403 | "windows_i686_msvc 0.36.1", 2404 | "windows_x86_64_gnu 0.36.1", 2405 | "windows_x86_64_msvc 0.36.1", 2406 | ] 2407 | 2408 | [[package]] 2409 | name = "windows-sys" 2410 | version = "0.42.0" 2411 | source = "registry+https://github.com/rust-lang/crates.io-index" 2412 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 2413 | dependencies = [ 2414 | "windows_aarch64_gnullvm", 2415 | "windows_aarch64_msvc 0.42.0", 2416 | "windows_i686_gnu 0.42.0", 2417 | "windows_i686_msvc 0.42.0", 2418 | "windows_x86_64_gnu 0.42.0", 2419 | "windows_x86_64_gnullvm", 2420 | "windows_x86_64_msvc 0.42.0", 2421 | ] 2422 | 2423 | [[package]] 2424 | name = "windows_aarch64_gnullvm" 2425 | version = "0.42.0" 2426 | source = "registry+https://github.com/rust-lang/crates.io-index" 2427 | checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" 2428 | 2429 | [[package]] 2430 | name = "windows_aarch64_msvc" 2431 | version = "0.36.1" 2432 | source = "registry+https://github.com/rust-lang/crates.io-index" 2433 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 2434 | 2435 | [[package]] 2436 | name = "windows_aarch64_msvc" 2437 | version = "0.42.0" 2438 | source = "registry+https://github.com/rust-lang/crates.io-index" 2439 | checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" 2440 | 2441 | [[package]] 2442 | name = "windows_i686_gnu" 2443 | version = "0.36.1" 2444 | source = "registry+https://github.com/rust-lang/crates.io-index" 2445 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 2446 | 2447 | [[package]] 2448 | name = "windows_i686_gnu" 2449 | version = "0.42.0" 2450 | source = "registry+https://github.com/rust-lang/crates.io-index" 2451 | checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" 2452 | 2453 | [[package]] 2454 | name = "windows_i686_msvc" 2455 | version = "0.36.1" 2456 | source = "registry+https://github.com/rust-lang/crates.io-index" 2457 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 2458 | 2459 | [[package]] 2460 | name = "windows_i686_msvc" 2461 | version = "0.42.0" 2462 | source = "registry+https://github.com/rust-lang/crates.io-index" 2463 | checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" 2464 | 2465 | [[package]] 2466 | name = "windows_x86_64_gnu" 2467 | version = "0.36.1" 2468 | source = "registry+https://github.com/rust-lang/crates.io-index" 2469 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 2470 | 2471 | [[package]] 2472 | name = "windows_x86_64_gnu" 2473 | version = "0.42.0" 2474 | source = "registry+https://github.com/rust-lang/crates.io-index" 2475 | checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" 2476 | 2477 | [[package]] 2478 | name = "windows_x86_64_gnullvm" 2479 | version = "0.42.0" 2480 | source = "registry+https://github.com/rust-lang/crates.io-index" 2481 | checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" 2482 | 2483 | [[package]] 2484 | name = "windows_x86_64_msvc" 2485 | version = "0.36.1" 2486 | source = "registry+https://github.com/rust-lang/crates.io-index" 2487 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 2488 | 2489 | [[package]] 2490 | name = "windows_x86_64_msvc" 2491 | version = "0.42.0" 2492 | source = "registry+https://github.com/rust-lang/crates.io-index" 2493 | checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" 2494 | 2495 | [[package]] 2496 | name = "winreg" 2497 | version = "0.10.1" 2498 | source = "registry+https://github.com/rust-lang/crates.io-index" 2499 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 2500 | dependencies = [ 2501 | "winapi", 2502 | ] 2503 | 2504 | [[package]] 2505 | name = "wyz" 2506 | version = "0.5.1" 2507 | source = "registry+https://github.com/rust-lang/crates.io-index" 2508 | checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" 2509 | dependencies = [ 2510 | "tap", 2511 | ] 2512 | 2513 | [[package]] 2514 | name = "x25519-dalek" 2515 | version = "1.1.1" 2516 | source = "registry+https://github.com/rust-lang/crates.io-index" 2517 | checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" 2518 | dependencies = [ 2519 | "curve25519-dalek", 2520 | "rand_core 0.5.1", 2521 | "zeroize", 2522 | ] 2523 | 2524 | [[package]] 2525 | name = "zeroize" 2526 | version = "1.5.7" 2527 | source = "registry+https://github.com/rust-lang/crates.io-index" 2528 | checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" 2529 | dependencies = [ 2530 | "zeroize_derive", 2531 | ] 2532 | 2533 | [[package]] 2534 | name = "zeroize_derive" 2535 | version = "1.3.2" 2536 | source = "registry+https://github.com/rust-lang/crates.io-index" 2537 | checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" 2538 | dependencies = [ 2539 | "proc-macro2", 2540 | "quote", 2541 | "syn", 2542 | "synstructure", 2543 | ] 2544 | --------------------------------------------------------------------------------