Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ed25519 address generation from wallet #1586

Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
8fd2992
rm ed25519 address generation from wallet
Alex6323 Nov 7, 2023
a3826bf
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Dec 6, 2023
008c863
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Dec 6, 2023
565a28b
rename fn
Alex6323 Dec 7, 2023
e8e05fc
rm with_address
Alex6323 Dec 7, 2023
456c5e5
update bindings
Alex6323 Dec 7, 2023
4b683d2
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Dec 7, 2023
9900a5d
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Thoralf-M Dec 11, 2023
5aee8e9
handle builder address cases
Alex6323 Dec 11, 2023
f84767d
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Dec 11, 2023
847785f
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Jan 23, 2024
b528ed8
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Jan 31, 2024
2f1dd63
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 1, 2024
e5fd7d9
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 12, 2024
a3cc197
unused import
Alex6323 Feb 12, 2024
f1182d8
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 16, 2024
6f2b916
re-add address to wallet options
Alex6323 Feb 16, 2024
31e04ff
fix tests
Alex6323 Feb 18, 2024
1d23230
re-enable placeholder test
Alex6323 Feb 18, 2024
f707397
move tests
Alex6323 Feb 18, 2024
35da3bb
nodejs: address to wallet options
Alex6323 Feb 19, 2024
e0e8ba2
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 19, 2024
dc5533a
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 19, 2024
2532bbd
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 20, 2024
916306a
revert going through json file for address
Alex6323 Feb 20, 2024
37308ae
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 20, 2024
61324e6
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 21, 2024
0d9d0f0
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 21, 2024
137edeb
revert unrelated change
Alex6323 Feb 21, 2024
f9e3f68
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 23, 2024
b98ba06
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 23, 2024
cbae7f8
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 23, 2024
2a61956
Update sdk/tests/client/secret_manager/address_generation.rs
thibault-martinez Feb 27, 2024
fad9849
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 29, 2024
9cdfe39
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Feb 29, 2024
79ff6ae
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 1, 2024
1f0da78
recipient
Alex6323 Mar 1, 2024
40dc8c3
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 4, 2024
1c02b2a
bad wildcards
Alex6323 Mar 4, 2024
ad69324
PR suggestion
Alex6323 Mar 4, 2024
ec1915f
import
Alex6323 Mar 4, 2024
0d957c1
example doc
Alex6323 Mar 4, 2024
f80d2ce
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 5, 2024
e8e450b
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
thibault-martinez Mar 5, 2024
0ae1791
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 5, 2024
077f4aa
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 5, 2024
623cd8b
fix example
Alex6323 Mar 5, 2024
2fb4b53
rename generate methods
Alex6323 Mar 6, 2024
beb50b4
Core: add SecretManager:GenerateEd25519AddressAsBech32 method
Alex6323 Mar 6, 2024
f056d0a
update examples and tests
Alex6323 Mar 6, 2024
d015eac
Core: simplify SecretManager:GenerateEd25519AddressAsBech32 method
Alex6323 Mar 6, 2024
89e6ac3
Python: update binding
Alex6323 Mar 6, 2024
c20b755
nit
Alex6323 Mar 6, 2024
d586235
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 6, 2024
da0a295
core: undo rename; update docs
Alex6323 Mar 7, 2024
80dd4f4
add todo
Alex6323 Mar 7, 2024
0348aa6
Python: nits
Alex6323 Mar 7, 2024
eb70061
NodeJs: add binding method
Alex6323 Mar 7, 2024
602457a
nit
Alex6323 Mar 7, 2024
82078b7
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 7, 2024
0804101
sdk: undo rename; format
Alex6323 Mar 7, 2024
b53e401
core: import
Alex6323 Mar 7, 2024
cce3be4
NodeJs: method suffix
Alex6323 Mar 7, 2024
4170fa6
fix test
Alex6323 Mar 7, 2024
20fb18f
nit
Alex6323 Mar 7, 2024
fbad591
remove single address generation binding
Alex6323 Mar 7, 2024
853bcb0
Python: small fix
Alex6323 Mar 7, 2024
1a02e15
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 7, 2024
73b576f
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
thibault-martinez Mar 7, 2024
aca3007
Merge branch '2.0' into refactor/wallet/remove-ed25519-address-genera…
Alex6323 Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions bindings/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use fern_logger::{logger_init, LoggerConfig, LoggerOutputConfigBuilder};
pub use iota_sdk;
use iota_sdk::{
client::secret::{SecretManager, SecretManagerDto},
types::block::address::Bech32Address,
utils::serde::bip44::option_bip44,
wallet::{ClientOptions, Wallet},
};
Expand All @@ -44,7 +43,6 @@ pub fn init_logger(config: String) -> std::result::Result<(), fern_logger::Error
#[derivative(Debug)]
#[serde(rename_all = "camelCase")]
pub struct WalletOptions {
pub address: Option<Bech32Address>,
Thoralf-M marked this conversation as resolved.
Show resolved Hide resolved
pub alias: Option<String>,
#[serde(with = "option_bip44", default)]
pub bip_path: Option<Bip44>,
Expand All @@ -55,11 +53,6 @@ pub struct WalletOptions {
}

impl WalletOptions {
pub fn with_address(mut self, address: impl Into<Option<Bech32Address>>) -> Self {
self.address = address.into();
self
}

pub fn with_alias(mut self, alias: impl Into<Option<String>>) -> Self {
self.alias = alias.into();
self
Expand Down Expand Up @@ -89,7 +82,6 @@ impl WalletOptions {
pub async fn build(self) -> iota_sdk::wallet::Result<Wallet> {
log::debug!("wallet options: {self:?}");
let mut builder = Wallet::builder()
.with_address(self.address)
.with_alias(self.alias)
.with_bip_path(self.bip_path)
.with_client_options(self.client_options);
Expand Down
17 changes: 0 additions & 17 deletions bindings/core/src/method/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use iota_sdk::{
client::{
api::{input_selection::Burn, PreparedTransactionDataDto, SignedTransactionDataDto},
node_manager::node::NodeAuth,
secret::GenerateAddressOptions,
},
types::block::{
address::{Bech32Address, Hrp},
Expand Down Expand Up @@ -419,27 +418,11 @@ pub enum WalletMethod {
/// Expected response: [`OutputsData`](crate::Response::OutputsData)
#[serde(rename_all = "camelCase")]
UnspentOutputs { filter_options: Option<FilterOptions> },

/// Emits an event for testing if the event system is working
/// Expected response: [`Ok`](crate::Response::Ok)
#[cfg(feature = "events")]
#[cfg_attr(docsrs, doc(cfg(feature = "events")))]
EmitTestEvent { event: WalletEvent },

// TODO: reconsider whether to have the following methods on the wallet
/// Generate an address without storing it
/// Expected response: [`Bech32Address`](crate::Response::Bech32Address)
#[serde(rename_all = "camelCase")]
GenerateEd25519Address {
/// Account index
account_index: u32,
/// Account index
address_index: u32,
/// Options
options: Option<GenerateAddressOptions>,
/// Bech32 HRP
bech32_hrp: Option<Hrp>,
},
/// Get the ledger nano status
/// Expected response: [`LedgerNanoStatus`](crate::Response::LedgerNanoStatus)
#[cfg(feature = "ledger_nano")]
Expand Down
22 changes: 1 addition & 21 deletions bindings/core/src/method_handler/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ use iota_sdk::{
client::api::{
PreparedTransactionData, PreparedTransactionDataDto, SignedTransactionData, SignedTransactionDataDto,
},
types::{
block::{address::ToBech32Ext, output::feature::BlockIssuerKeySource},
TryFromDto,
},
types::{block::output::feature::BlockIssuerKeySource, TryFromDto},
wallet::{types::TransactionWithMetadataDto, PreparedCreateNativeTokenTransactionDto, Wallet},
};

Expand Down Expand Up @@ -72,23 +69,6 @@ pub(crate) async fn call_wallet_method_internal(wallet: &Wallet, method: WalletM
let ledger_nano_status = wallet.get_ledger_nano_status().await?;
Response::LedgerNanoStatus(ledger_nano_status)
}
WalletMethod::GenerateEd25519Address {
account_index,
address_index,
options,
bech32_hrp,
} => {
let address = wallet
.generate_ed25519_address(account_index, address_index, options)
.await?;

let bech32_hrp = match bech32_hrp {
Some(bech32_hrp) => bech32_hrp,
None => *wallet.address().await.hrp(),
};

Response::Bech32Address(address.to_bech32(bech32_hrp))
}
#[cfg(feature = "stronghold")]
WalletMethod::SetStrongholdPassword { password } => {
wallet.set_stronghold_password(password).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,7 @@ async function run() {
// The mnemonic can't be retrieved from the Stronghold file, so make a backup in a secure place!
await secretManager.storeMnemonic(process.env.MNEMONIC as string);

const walletAddress = await secretManager.generateEd25519Addresses({
coinType: CoinType.IOTA,
accountIndex: 0,
range: {
start: 0,
end: 1,
},
bech32Hrp: 'tst',
});

const walletOptions: WalletOptions = {
address: walletAddress[0],
storagePath: process.env.WALLET_DB_PATH,
clientOptions: {
nodes: [process.env.NODE_URL as string],
Expand Down
11 changes: 0 additions & 11 deletions bindings/nodejs/examples/wallet/getting-started.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,7 @@ async function run() {
// The mnemonic can't be retrieved from the Stronghold file, so make a backup in a secure place!
await secretManager.storeMnemonic(mnemonic);

const wallet_address = await secretManager.generateEd25519Addresses({
coinType: CoinType.IOTA,
accountIndex: 0,
range: {
start: 0,
end: 1,
},
bech32Hrp: 'tst',
});

const walletOptions: WalletOptions = {
address: wallet_address[0],
storagePath: WALLET_DB_PATH,
clientOptions: {
nodes: [NODE_URL as string],
Expand Down
2 changes: 0 additions & 2 deletions bindings/nodejs/lib/types/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
import { DecayedMana, u256, u64 } from '../utils';
import { IClientOptions } from '../client';
import { Bip44, SecretManagerType } from '../secret_manager/secret-manager';
import { Bech32Address, OutputId } from '../block';

Check warning on line 14 in bindings/nodejs/lib/types/wallet/wallet.ts

View workflow job for this annotation

GitHub Actions / Lint

'Bech32Address' is defined but never used

/** Options for the Wallet builder. */
export interface WalletOptions {
/** The wallet address. */
address?: Bech32Address;
Alex6323 marked this conversation as resolved.
Show resolved Hide resolved
/** The alias of the wallet. */
alias?: string;
/** The the BIP44 path of the wallet. */
Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub async fn get_client(wallet: External<WalletMethodHandler>) -> Result<Externa
#[napi(js_name = "getSecretManager")]
pub async fn get_secret_manager(wallet: External<WalletMethodHandler>) -> Result<External<SecretManagerMethodHandler>> {
if let Some(wallet) = &**wallet.as_ref().read().await {
Ok(External::new(wallet.get_secret_manager().clone()))
Ok(External::new(wallet.secret_manager().clone()))
} else {
Err(destroyed_err("Wallet"))
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub fn get_secret_manager_from_wallet(wallet: &Wallet) -> Result<SecretManager>
.read()
.await
.as_ref()
.map(|w| w.get_secret_manager().clone())
.map(|w| w.secret_manager().clone())
.ok_or_else(|| {
Error::from(
serde_json::to_string(&Response::Panic("wallet was destroyed".into()))
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn get_client(method_handler: &WalletMethodHandler) -> Result<ClientMe
#[wasm_bindgen(js_name = getSecretManager)]
pub async fn get_secret_manager(method_handler: &WalletMethodHandler) -> Result<SecretManagerMethodHandler, JsError> {
if let Some(wallet) = &*method_handler.0.read().await {
Ok(SecretManagerMethodHandler::new(wallet.get_secret_manager().clone()))
Ok(SecretManagerMethodHandler::new(wallet.secret_manager().clone()))
} else {
// Notify that the wallet was destroyed
Err(destroyed_err("Wallet"))
Expand Down
10 changes: 0 additions & 10 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ pub struct InitParameters {
/// Set the BIP path, `4219/0/0/0` if not provided.
#[arg(short, long, value_parser = parse_bip_path, default_value = "4219/0/0/0")]
pub bip_path: Option<Bip44>,
/// Set the Bech32-encoded wallet address.
#[arg(short, long)]
pub address: Option<String>,
}

impl Default for InitParameters {
Expand All @@ -77,7 +74,6 @@ impl Default for InitParameters {
mnemonic_file_path: None,
node_url: DEFAULT_NODE_URL.to_string(),
bip_path: Some(Bip44::new(SHIMMER_COIN_TYPE)),
address: None,
}
}
}
Expand Down Expand Up @@ -280,17 +276,11 @@ pub async fn init_command(
None
};

let address = init_params
.address
.map(|addr| Bech32Address::from_str(&addr))
.transpose()?;

Ok(Wallet::builder()
.with_secret_manager(secret_manager)
.with_client_options(ClientOptions::new().with_node(init_params.node_url.as_str())?)
.with_storage_path(storage_path.to_str().expect("invalid unicode"))
.with_bip_path(init_params.bip_path)
.with_address(address)
.with_alias(alias)
.finish()
.await?)
Expand Down
18 changes: 6 additions & 12 deletions sdk/examples/wallet/ledger_nano.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ use iota_sdk::{
wallet::{ClientOptions, Result, Wallet},
};

// The address to send coins to
const RECV_ADDRESS: &str = "rms1qpszqzadsym6wpppd6z037dvlejmjuke7s24hm95s9fg9vpua7vluaw60xu";
// The amount of base coins we'll send
const SEND_AMOUNT: u64 = 1_000_000;

Expand All @@ -38,32 +36,28 @@ async fn main() -> Result<()> {
}

let client_options = ClientOptions::new().with_node(&std::env::var("NODE_URL").unwrap())?;
let secret_manager = LedgerSecretManager::new(true);
let secret_manager = SecretManager::LedgerNano(LedgerSecretManager::new(true));

let wallet = Wallet::builder()
.with_secret_manager(SecretManager::LedgerNano(secret_manager))
.with_secret_manager(secret_manager)
.with_storage_path(&std::env::var("WALLET_DB_PATH").unwrap())
.with_client_options(client_options)
.with_bip_path(Bip44::new(SHIMMER_COIN_TYPE))
.finish()
.await?;

let recv_address = wallet.address().await;
println!("receive address: {recv_address}");
Alex6323 marked this conversation as resolved.
Show resolved Hide resolved
println!("{:?}", wallet.get_ledger_nano_status().await?);

println!("Generating address...");
let now = tokio::time::Instant::now();
let address = wallet.generate_ed25519_address(0, 0, None).await?;
println!("took: {:.2?}", now.elapsed());

println!("ADDRESS:\n{address:#?}");

let now = tokio::time::Instant::now();
let balance = wallet.sync(None).await?;
println!("Wallet synced in: {:.2?}", now.elapsed());

println!("Balance BEFORE:\n{:?}", balance.base_coin());

println!("Sending the coin-transfer transaction...");
let transaction = wallet.send(SEND_AMOUNT, RECV_ADDRESS, None).await?;
let transaction = wallet.send(SEND_AMOUNT, recv_address, None).await?;
println!("Transaction sent: {}", transaction.transaction_id);

let block_id = wallet
Expand Down
12 changes: 6 additions & 6 deletions sdk/examples/wallet/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use iota_sdk::{
client::{
api::GetAddressesOptions,
constants::SHIMMER_COIN_TYPE,
secret::{mnemonic::MnemonicSecretManager, SecretManager},
},
Expand Down Expand Up @@ -38,18 +39,17 @@ async fn main() -> Result<()> {

// Restore a wallet
let client_options = ClientOptions::new().with_node(&std::env::var("NODE_URL").unwrap())?;
let secret_manager = MnemonicSecretManager::try_from_mnemonic(std::env::var("MNEMONIC").unwrap())?;
let wallet = Wallet::builder()
.with_secret_manager(SecretManager::Mnemonic(secret_manager))
Thoralf-M marked this conversation as resolved.
Show resolved Hide resolved
let secret_manager = SecretManager::Mnemonic(MnemonicSecretManager::try_from_mnemonic(
std::env::var("MNEMONIC").unwrap(),
)?);

let wallet = Wallet::<MnemonicSecretManager>::builder()
.with_storage_path(&std::env::var("WALLET_DB_PATH").unwrap())
.with_client_options(client_options)
.with_bip_path(Bip44::new(SHIMMER_COIN_TYPE))
.finish()
.await?;

println!("Generating address...");
let _ = wallet.generate_ed25519_address(0, 0, None).await?;

println!("Syncing wallet");
wallet.sync(None).await?;

Expand Down
15 changes: 1 addition & 14 deletions sdk/examples/wallet/offline_signing/0_generate_address.rs
Thoralf-M marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use iota_sdk::{

const OFFLINE_WALLET_DB_PATH: &str = "./examples/wallet/offline_signing/example-offline-walletdb";
const STRONGHOLD_SNAPSHOT_PATH: &str = "./examples/wallet/offline_signing/example.stronghold";
const ADDRESS_FILE_PATH: &str = "./examples/wallet/offline_signing/example.address.json";

#[tokio::main]
async fn main() -> Result<()> {
Expand All @@ -43,7 +42,7 @@ async fn main() -> Result<()> {
secret_manager.store_mnemonic(mnemonic).await?;

// Create the wallet with the secret_manager and client options
let wallet = Wallet::builder()
Wallet::builder()
.with_secret_manager(SecretManager::Stronghold(secret_manager))
.with_storage_path(OFFLINE_WALLET_DB_PATH)
.with_client_options(offline_client)
Expand All @@ -53,17 +52,5 @@ async fn main() -> Result<()> {

println!("Generated a new wallet");

write_wallet_address_to_file(&wallet).await
}

async fn write_wallet_address_to_file(wallet: &Wallet) -> Result<()> {
use tokio::io::AsyncWriteExt;

let wallet_address = wallet.address().await;
let json = serde_json::to_string_pretty(&wallet_address)?;
let mut file = tokio::io::BufWriter::new(tokio::fs::File::create(ADDRESS_FILE_PATH).await?);
println!("example.address.json:\n{json}");
file.write_all(json.as_bytes()).await?;
file.flush().await?;
Ok(())
}
17 changes: 1 addition & 16 deletions sdk/examples/wallet/offline_signing/1_prepare_transaction.rs
Thoralf-M marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
use iota_sdk::{
client::{api::PreparedTransactionDataDto, constants::SHIMMER_COIN_TYPE, secret::SecretManager},
crypto::keys::bip44::Bip44,
wallet::{types::Bip44Address, ClientOptions, Result, SendParams, Wallet},
wallet::{ClientOptions, Result, SendParams, Wallet},
};

const ONLINE_WALLET_DB_PATH: &str = "./examples/wallet/offline_signing/example-online-walletdb";
const ADDRESS_FILE_PATH: &str = "./examples/wallet/offline_signing/example.address.json";
const PREPARED_TRANSACTION_FILE_PATH: &str = "./examples/wallet/offline_signing/example.prepared_transaction.json";
const PROTOCOL_PARAMETERS_FILE_PATH: &str = "./examples/wallet/offline_signing/example.protocol_parameters.json";
// Address to which we want to send the amount.
Expand All @@ -35,9 +34,6 @@ async fn main() -> Result<()> {

let params = [SendParams::new(SEND_AMOUNT, RECV_ADDRESS)?];

// Recovers addresses from example `0_address_generation`.
let address = read_address_from_file().await?.into_bech32();

let client_options = ClientOptions::new().with_node(&std::env::var("NODE_URL").unwrap())?;

// Create the wallet with the secret_manager and client options
Expand All @@ -46,7 +42,6 @@ async fn main() -> Result<()> {
.with_storage_path(ONLINE_WALLET_DB_PATH)
.with_client_options(client_options.clone())
.with_bip_path(Bip44::new(SHIMMER_COIN_TYPE))
.with_address(address)
.finish()
.await?;

Expand All @@ -72,16 +67,6 @@ async fn main() -> Result<()> {
Ok(())
}

async fn read_address_from_file() -> Result<Bip44Address> {
use tokio::io::AsyncReadExt;

let mut file = tokio::io::BufReader::new(tokio::fs::File::open(ADDRESS_FILE_PATH).await?);
let mut json = String::new();
file.read_to_string(&mut json).await?;

Ok(serde_json::from_str(&json)?)
}

async fn write_data_to_file(data: impl serde::Serialize, path: &str) -> Result<()> {
use tokio::io::AsyncWriteExt;

Expand Down
Loading
Loading