Skip to content

Commit

Permalink
and more
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Oct 31, 2023
1 parent 73eecbc commit 4a1f95e
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 88 deletions.
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/account/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will create an account output.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example and that funds are available by running
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example and that funds are available by running
//! the `get_funds` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/account/destroy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will try to destroy the first account output there is in the account.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/how_tos/accounts_and_addresses/check_balance.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! In this example we sync the account and get the balance.
//! In this example we sync the wallet and get the balance.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! In this example we will consolidate basic outputs from an account with only an AddressUnlockCondition by sending
//! In this example we will consolidate basic outputs from a wallet with only an AddressUnlockCondition by sending
//! them to the same address again.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down Expand Up @@ -40,7 +40,7 @@ async fn main() -> Result<()> {
// List unspent outputs before consolidation.
// The output we created with example `03_get_funds` and the basic output from `09_mint_native_tokens` have only one
// unlock condition and it is an `AddressUnlockCondition`, and so they are valid for consolidation. They have the
// same `AddressUnlockCondition`(the first address of the account), so they will be consolidated into one
// same `AddressUnlockCondition`(the address of the wallet), so they will be consolidated into one
// output.
let outputs = wallet.unspent_outputs(None).await?;
println!("Outputs BEFORE consolidation:");
Expand Down
54 changes: 0 additions & 54 deletions sdk/examples/how_tos/accounts_and_addresses/create_address.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will send an amount below the minimum storage deposit.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
6 changes: 3 additions & 3 deletions sdk/examples/how_tos/native_tokens/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//! output that minted it.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! You may provide a TOKEN_ID that is available in the account. You can check this by running the
//! You may provide a TOKEN_ID that is available in the wallet. You can check this by running the
//! `get_balance` example. You can create a new native token by running the `create_native_token` example.
//!
//! Rename `.env.example` to `.env` first, then run the command:
Expand All @@ -22,7 +22,7 @@ use iota_sdk::{
Wallet, U256,
};

// The minimum available native token amount to search for in the account
// The minimum available native token amount to search for in the wallet
const MIN_AVAILABLE_AMOUNT: u64 = 11;
// The amount of the native token to burn
const BURN_AMOUNT: u64 = 1;
Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/how_tos/native_tokens/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will create a native token.
//!
//! Make sure that `example.stronghold` and `example.walletdb` already exist by
//! running the `create_account` example!
//! running the `create_wallet` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down Expand Up @@ -39,7 +39,7 @@ async fn main() -> Result<()> {
.set_stronghold_password(std::env::var("STRONGHOLD_PASSWORD").unwrap())
.await?;

// We can first check if we already have an account output in our account, because an account can have many foundry
// We can first check if we already have an account output in our wallet, because an account can have many foundry
// outputs and therefore we can reuse an existing one
if balance.accounts().is_empty() {
// If we don't have an account, we need to create one
Expand Down
6 changes: 3 additions & 3 deletions sdk/examples/how_tos/native_tokens/destroy_foundry.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! In this example we will try to destroy the first foundry there is in the account. This is only possible if its
//! In this example we will try to destroy the first foundry there is in the wallet. This is only possible if its
//! circulating supply is 0 and no native tokens were burned.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand All @@ -30,7 +30,7 @@ async fn main() -> Result<()> {
let foundry_count = balance.foundries().len();
println!("Foundries before destroying: {foundry_count}");

// We try to destroy the first foundry in the account
// We try to destroy the first foundry in the wallet
if let Some(foundry_id) = balance.foundries().first() {
let token_id = TokenId::from(*foundry_id);

Expand Down
6 changes: 3 additions & 3 deletions sdk/examples/how_tos/native_tokens/melt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//! In this example we will melt an existing native token with its foundry.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! You may provide a TOKEN_ID that is available in the account. The foundry
//! You may provide a TOKEN_ID that is available in the wallet. The foundry
//! output which minted it needs to be available as well. You can check this by
//! running the `get_balance` example. You can create a new native token by running
//! the `create_native_token` example.
Expand Down Expand Up @@ -48,7 +48,7 @@ async fn main() -> Result<()> {
let available_balance = native_token_balance.available();
println!("Balance before melting: {available_balance}");
} else {
println!("Couldn't find native token '{token_id}' in the account");
println!("Couldn't find native token '{token_id}' in the wallet");
return Ok(());
}

Expand Down
6 changes: 3 additions & 3 deletions sdk/examples/how_tos/native_tokens/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//! In this example we will mint an existing native token with its foundry.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! You may provide a TOKEN_ID that is available in the account. The foundry
//! You may provide a TOKEN_ID that is available in the wallet. The foundry
//! output which minted it needs to be available as well. You can check this by
//! running the `get_balance` example. You can create a new native token by running
//! the `create_native_token` example.
Expand Down Expand Up @@ -48,7 +48,7 @@ async fn main() -> Result<()> {
let available_balance = native_token_balance.available();
println!("Balance before minting: {available_balance}");
} else {
println!("Couldn't find native token '{token_id}' in the account");
println!("Couldn't find native token '{token_id}' in the wallet");
return Ok(());
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/native_tokens/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will send native tokens.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/nft_collection/00_mint_issuer_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will mint the issuer NFT for the NFT collection.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Make sure that the wallet already has some funds by running the
//! `./how_tos/simple_transaction/request_funds.rs` example!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will mint some collection NFTs with issuer feature.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example.
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example.
//!
//! You have to provide the ISSUER_NFT_ID that was created by first running the
//! `mint_issuer_nft` example!
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/nfts/burn_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will burn an existing nft output.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/nfts/mint_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will mint some NFTs.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/how_tos/nfts/send_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will send an NFT.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/how_tos/simple_transaction/request_funds.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! In this example we request funds from the faucet to the first address in the account.
//! In this example we request funds from the faucet to the first address in the wallet.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! In this example we will issue a simple base coin transaction.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
//! ```sh
Expand Down
4 changes: 2 additions & 2 deletions sdk/examples/wallet/17_check_unlock_conditions.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

//! In this example we check if an output has only an address unlock condition and that the address is from the account.
//! In this example we check if an output has only an address unlock condition and that the address is from the wallet.
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example!
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example!
//!
//! ```sh
//! cargo run --release --all-features --example check_unlock_conditions
Expand Down
2 changes: 1 addition & 1 deletion sdk/examples/wallet/participation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! * if a voting occurred, stops the voting and destroys the voting output
//!
//! Make sure that `STRONGHOLD_SNAPSHOT_PATH` and `WALLET_DB_PATH` already exist by
//! running the `./how_tos/accounts_and_addresses/create_account.rs` example and there are funds on the first address
//! running the `./how_tos/accounts_and_addresses/create_wallet.rs` example and there are funds on the first address
//! by running the `get_funds` example!
//!
//! Rename `.env.example` to `.env` first, then run the command:
Expand Down

0 comments on commit 4a1f95e

Please sign in to comment.