-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wallet implicit account creation address (#1556)
* Add implicit_account_creation_address method * Add it to CLI * Use localhost for now * Add to bindings core * Nodejs bindings * Python binding * Nit * Remove stronghold required feature * Docs * Example doc
- Loading branch information
1 parent
8e8f61f
commit 4ced6c2
Showing
14 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2023 IOTA Stiftung | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//! In this example, we create an implicit account creation address. | ||
//! | ||
//! Rename `.env.example` to `.env` first, then run the command: | ||
//! ```sh | ||
//! cargo run --release --all-features --example implicit_account_creation | ||
//! ``` | ||
|
||
use iota_sdk::{ | ||
client::{constants::SHIMMER_COIN_TYPE, secret::SecretManager}, | ||
crypto::keys::bip44::Bip44, | ||
wallet::{ClientOptions, Result, Wallet}, | ||
}; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
// This example uses secrets in environment variables for simplicity which should not be done in production. | ||
dotenvy::dotenv().ok(); | ||
|
||
let secret_manager = SecretManager::try_from_mnemonic(std::env::var("MNEMONIC").unwrap())?; | ||
let client_options = ClientOptions::new().with_node("https://api.testnet.shimmer.network")?; | ||
|
||
let wallet = Wallet::builder() | ||
.with_secret_manager(secret_manager) | ||
.with_client_options(client_options) | ||
.with_storage_path("implicit_account_creation") | ||
.with_bip_path(Bip44::new(SHIMMER_COIN_TYPE)) | ||
.finish() | ||
.await?; | ||
|
||
let implicit_account_creation_address = wallet.implicit_account_creation_address().await?; | ||
|
||
println!("{implicit_account_creation_address}"); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters