Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions crates/iota-sdk/examples/address_from_mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
// SPDX-License-Identifier: Apache-2.0

use base64ct::{Base64, Encoding};
use iota_crypto::{
DERIVATION_PATH_COIN_TYPE, DERIVATION_PATH_PURPOSE_SECP256R1, FromMnemonic, ToFromBech32,
ed25519::Ed25519PrivateKey, secp256k1::Secp256k1PrivateKey, secp256r1::Secp256r1PrivateKey,
use iota_sdk::{
crypto::{
DERIVATION_PATH_COIN_TYPE, DERIVATION_PATH_PURPOSE_SECP256R1, FromMnemonic, ToFromBech32,
ed25519::Ed25519PrivateKey, secp256k1::Secp256k1PrivateKey, secp256r1::Secp256r1PrivateKey,
},
types::PublicKeyExt,
};
use iota_types::PublicKeyExt;

const MNEMONIC: &str = "round attack kitchen wink winter music trip tiny nephew hire orange what";

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/chain_id.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_graphql_client::{Client, error::Result};
use iota_sdk::graphql_client::{Client, error::Result};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/coin_balances.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_graphql_client::{Client, error::Result};
use iota_sdk::graphql_client::{Client, error::Result};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/custom_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use cynic::QueryBuilder;
use eyre::Result;
use iota_graphql_client::{
use iota_sdk::graphql_client::{
Client,
query_types::{BigInt, schema},
};
Expand Down
8 changes: 5 additions & 3 deletions crates/iota-sdk/examples/dev_inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::{SharedMut, TransactionBuilder, res};
use iota_types::{Address, Identifier, ObjectId, StructTag, TypeTag};
use iota_sdk::{
graphql_client::Client,
transaction_builder::{SharedMut, TransactionBuilder, res},
types::{Address, Identifier, ObjectId, StructTag, TypeTag},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
3 changes: 1 addition & 2 deletions crates/iota-sdk/examples/dry_run_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_graphql_client::Client;
use iota_types::Transaction;
use iota_sdk::{graphql_client::Client, types::Transaction};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/dynamic_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_graphql_client::Client;
use iota_sdk::graphql_client::Client;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/epoch.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_graphql_client::{Client, error::Result};
use iota_sdk::graphql_client::{Client, error::Result};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
3 changes: 1 addition & 2 deletions crates/iota-sdk/examples/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_graphql_client::faucet::FaucetClient;
use iota_types::Address;
use iota_sdk::{graphql_client::faucet::FaucetClient, types::Address};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
4 changes: 1 addition & 3 deletions crates/iota-sdk/examples/gas_sponsor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::Address;
use iota_sdk::{graphql_client::Client, transaction_builder::TransactionBuilder, types::Address};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-sdk/examples/gas_station.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_crypto::ed25519::Ed25519PrivateKey;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::Address;
use iota_sdk::{
crypto::ed25519::Ed25519PrivateKey, graphql_client::Client,
transaction_builder::TransactionBuilder, types::Address,
};
use reqwest::header::HeaderValue;

#[tokio::main]
Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk/examples/generate_ed25519_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

use base64ct::{Base64, Encoding};
use iota_crypto::{ToFromBech32, ed25519::Ed25519PrivateKey};
use iota_types::PublicKeyExt;
use iota_sdk::{
crypto::{ToFromBech32, ed25519::Ed25519PrivateKey},
types::PublicKeyExt,
};
use rand::rngs::OsRng;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/generate_mnemonic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_crypto::mnemonic::{MnemonicLength, generate_mnemonic};
use iota_sdk::crypto::mnemonic::{MnemonicLength, generate_mnemonic};

fn main() {
let mnemonic = generate_mnemonic(None);
Expand Down
4 changes: 1 addition & 3 deletions crates/iota-sdk/examples/generic_move_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
use core::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::Address;
use iota_sdk::{graphql_client::Client, transaction_builder::TransactionBuilder, types::Address};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
3 changes: 1 addition & 2 deletions crates/iota-sdk/examples/get_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use std::str::FromStr;

use eyre::{OptionExt, Result};
use iota_graphql_client::Client;
use iota_types::ObjectId;
use iota_sdk::{graphql_client::Client, types::ObjectId};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk/examples/get_transaction.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_graphql_client::{Client, error::Result};
use iota_types::Digest;
use iota_sdk::{
graphql_client::{Client, error::Result},
types::Digest,
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/json_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_graphql_client::Client;
use iota_sdk::graphql_client::Client;

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
3 changes: 1 addition & 2 deletions crates/iota-sdk/examples/move_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_types::Address;
use iota_sdk::{graphql_client::Client, types::Address};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/objects_by_type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_graphql_client::{Client, error::Result, query_types::ObjectFilter};
use iota_sdk::graphql_client::{Client, error::Result, query_types::ObjectFilter};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk/examples/owned_objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_graphql_client::{Client, pagination::PaginationFilter, query_types::ObjectFilter};
use iota_types::Address;
use iota_sdk::{
graphql_client::{Client, pagination::PaginationFilter, query_types::ObjectFilter},
types::Address,
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-sdk/examples/package_events.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2025 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use iota_graphql_client::{
use iota_sdk::graphql_client::{
Client, error::Result, pagination::PaginationFilter, query_types::EventFilter,
};

Expand Down
6 changes: 4 additions & 2 deletions crates/iota-sdk/examples/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_graphql_client::{Client, pagination::PaginationFilter, query_types::ObjectFilter};
use iota_types::Address;
use iota_sdk::{
graphql_client::{Client, pagination::PaginationFilter, query_types::ObjectFilter},
types::Address,
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
8 changes: 5 additions & 3 deletions crates/iota-sdk/examples/prepare_merge_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::{Address, ObjectId};
use iota_sdk::{
graphql_client::Client,
transaction_builder::TransactionBuilder,
types::{Address, ObjectId},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
8 changes: 5 additions & 3 deletions crates/iota-sdk/examples/prepare_send_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::{Address, ObjectId};
use iota_sdk::{
graphql_client::Client,
transaction_builder::TransactionBuilder,
types::{Address, ObjectId},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
4 changes: 1 addition & 3 deletions crates/iota-sdk/examples/prepare_send_iota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::Address;
use iota_sdk::{graphql_client::Client, transaction_builder::TransactionBuilder, types::Address};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
8 changes: 5 additions & 3 deletions crates/iota-sdk/examples/prepare_send_iota_multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::{TransactionBuilder, res};
use iota_types::{Address, ObjectId};
use iota_sdk::{
graphql_client::Client,
transaction_builder::{TransactionBuilder, res},
types::{Address, ObjectId},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
8 changes: 5 additions & 3 deletions crates/iota-sdk/examples/prepare_split_coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::{TransactionBuilder, res};
use iota_types::{Address, ObjectId};
use iota_sdk::{
graphql_client::Client,
transaction_builder::{TransactionBuilder, res},
types::{Address, ObjectId},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
8 changes: 5 additions & 3 deletions crates/iota-sdk/examples/prepare_transfer_objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::Result;
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::{Address, ObjectId};
use iota_sdk::{
graphql_client::Client,
transaction_builder::TransactionBuilder,
types::{Address, ObjectId},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use std::str::FromStr;

use eyre::{OptionExt, Result};
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::{Address, ObjectId};
use iota_sdk::{
graphql_client::Client,
transaction_builder::TransactionBuilder,
types::{Address, ObjectId},
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
10 changes: 6 additions & 4 deletions crates/iota-sdk/examples/publish_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
use std::env::var;

use eyre::{Result, bail};
use iota_crypto::{IotaSigner, ed25519::Ed25519PrivateKey};
use iota_graphql_client::{Client, WaitForTx, faucet::FaucetClient};
use iota_transaction_builder::{TransactionBuilder, res};
use iota_types::{Address, MovePackageData, ObjectId, ObjectOut, StructTag, UpgradePolicy};
use iota_sdk::{
crypto::{IotaSigner, ed25519::Ed25519PrivateKey},
graphql_client::{Client, WaitForTx, faucet::FaucetClient},
transaction_builder::{TransactionBuilder, res},
types::{Address, MovePackageData, ObjectId, ObjectOut, StructTag, UpgradePolicy},
};
use rand::rngs::OsRng;

#[tokio::main]
Expand Down
10 changes: 6 additions & 4 deletions crates/iota-sdk/examples/sign_send_iota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// SPDX-License-Identifier: Apache-2.0

use eyre::Result;
use iota_crypto::{IotaSigner, ed25519::Ed25519PrivateKey};
use iota_graphql_client::{Client, faucet::FaucetClient};
use iota_transaction_builder::TransactionBuilder;
use iota_types::Address;
use iota_sdk::{
crypto::{IotaSigner, ed25519::Ed25519PrivateKey},
graphql_client::{Client, faucet::FaucetClient},
transaction_builder::TransactionBuilder,
types::Address,
};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
4 changes: 1 addition & 3 deletions crates/iota-sdk/examples/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
use std::str::FromStr;

use eyre::{OptionExt, Result};
use iota_graphql_client::Client;
use iota_transaction_builder::TransactionBuilder;
use iota_types::Address;
use iota_sdk::{graphql_client::Client, transaction_builder::TransactionBuilder, types::Address};

#[tokio::main]
async fn main() -> Result<()> {
Expand Down
Loading