Sitelet https://github.com/zerosnacks/examples/commit/dd1428d98ec447dff57475a8a5025ee0e8a96b0b
Skip to content

Commit dd1428d

Browse files
committed
use alloy namespace
1 parent fbf851e commit dd1428d

15 files changed

Lines changed: 81 additions & 87 deletions

‎Cargo.toml‎

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,42 @@ repository = "https://github.com/alloy-rs/examples"
1313
publish = false
1414

1515
[workspace.dependencies]
16-
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
17-
alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
18-
alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
19-
alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
20-
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
21-
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
22-
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
23-
alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
24-
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
25-
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
26-
alloy-rpc-engine-types = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
27-
alloy-rpc-trace-types = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
28-
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
29-
alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
30-
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
31-
alloy-signer-aws = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
32-
alloy-signer-gcp = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
33-
alloy-signer-ledger = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
34-
alloy-signer-trezor = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
35-
alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
36-
alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
37-
alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
38-
alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
39-
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", default-features = false }
40-
41-
alloy-core = { version = "0.6.4", default-features = false, features = ["std"] }
42-
alloy-dyn-abi = { version = "0.6.4", default-features = false, features = [
43-
"std",
44-
] }
45-
alloy-json-abi = { version = "0.6.4", default-features = false, features = [
46-
"std",
47-
] }
48-
alloy-primitives = { version = "0.6.4", default-features = false, features = [
49-
"std",
16+
alloy = { git = "https://github.com/alloy-rs/alloy", rev = "fd8f065", features = [
17+
# "dyn-abi",
18+
# "json-abi",
19+
# "json",
20+
# "sol-types",
21+
# "rlp",
22+
# "serde",
23+
"contract",
24+
# "consensus",
25+
# "eips",
26+
"network",
27+
# "genesis",
28+
"node-bindings",
29+
"providers",
30+
"rpc",
31+
# "json-rpc",
32+
"rpc-client",
33+
# "rpc-types",
34+
"rpc-types-eth",
35+
# "rpc-types-engine",
36+
# "rpc-types-trace",
37+
"signers",
38+
# "signer-aws",
39+
# "signer-gcp",
40+
"signer-ledger",
41+
"signer-trezor",
42+
"signer-wallet",
43+
"signer-mnemonic",
44+
"signer-yubihsm",
45+
# "transports",
46+
"transport-http",
47+
# "transport-ipc",
48+
# "transport-ws",
49+
# "pubsub",
5050
] }
51+
# TODO: sol! macro somehow requires this to be present
5152
alloy-sol-types = { version = "0.6.4", default-features = false, features = [
5253
"std",
5354
] }

‎examples/big-numbers/Cargo.toml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ homepage.workspace = true
1111
repository.workspace = true
1212

1313
[dev-dependencies]
14-
alloy-core.workspace = true
15-
alloy-primitives.workspace = true
16-
alloy-serde.workspace = true
14+
alloy.workspace = true
1715

1816
eyre.workspace = true

‎examples/big-numbers/examples/comparison_equivalence.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Example of comparison and equivalence of `U256` instances.
22
3-
use alloy_primitives::U256;
3+
use alloy::primitives::U256;
44

55
/// `U256` implements traits in `std::cmp`, that means `U256` instances
66
/// can be easily compared using standard Rust operators.

‎examples/big-numbers/examples/conversion.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Example of converting `U256` to native Rust types.
22
3-
use alloy_primitives::{utils::format_units, U256};
3+
use alloy::primitives::{utils::format_units, U256};
44
use eyre::Result;
55

66
/// `U256` provides useful conversion functions to enable transformation into native Rust types.

‎examples/big-numbers/examples/create_instances.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Example of creating instances of `U256` from strings and numbers.
22
3-
use alloy_primitives::{
3+
use alloy::primitives::{
44
utils::{parse_units, ParseUnits},
55
U256,
66
};

‎examples/big-numbers/examples/math_operations.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Example of performing arithmetic operations with `U256`.
22
3-
use alloy_primitives::{utils::format_units, U256};
3+
use alloy::primitives::{utils::format_units, U256};
44
use eyre::Result;
55
use std::ops::{Div, Mul};
66

‎examples/big-numbers/examples/math_utilities.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Example of using math utilities to handle big numbers in 'wei' units.
22
3-
use alloy_primitives::{
3+
use alloy::primitives::{
44
utils::{format_units, parse_units},
55
U256,
66
};

‎examples/wallets/Cargo.toml‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ homepage.workspace = true
1111
repository.workspace = true
1212

1313
[dev-dependencies]
14-
alloy-network.workspace = true
15-
alloy-node-bindings.workspace = true
16-
alloy-primitives.workspace = true
17-
alloy-provider.workspace = true
18-
alloy-rpc-client.workspace = true
19-
alloy-rpc-types.workspace = true
20-
alloy-signer = { workspace = true, features = ["eip712"] }
21-
alloy-signer-ledger.workspace = true
22-
alloy-signer-trezor.workspace = true
23-
alloy-signer-wallet = { workspace = true, features = ["mnemonic", "yubihsm"] }
14+
alloy.workspace = true
2415
alloy-sol-types.workspace = true
2516

2617
eyre.workspace = true

‎examples/wallets/examples/ledger_signer.rs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
//! Example of signing and sending a transaction using a Ledger device.
22
3-
use alloy_network::EthereumSigner;
4-
use alloy_primitives::{address, U256};
5-
use alloy_provider::{Provider, ProviderBuilder};
6-
use alloy_rpc_client::RpcClient;
7-
use alloy_rpc_types::request::TransactionRequest;
8-
use alloy_signer_ledger::{HDPath, LedgerSigner};
3+
use alloy::{
4+
network::EthereumSigner,
5+
primitives::{address, U256},
6+
providers::{Provider, ProviderBuilder},
7+
rpc::{client::RpcClient, types::eth::request::TransactionRequest},
8+
signers::ledger::{HDPath, LedgerSigner},
9+
};
910
use eyre::Result;
1011

1112
#[tokio::main]

‎examples/wallets/examples/mnemonic_signer.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Example of using `MnemonicBuilder` to access a wallet from a mnemonic phrase.
22
3-
use alloy_signer_wallet::{coins_bip39::English, MnemonicBuilder};
3+
use alloy::signers::wallet::{coins_bip39::English, MnemonicBuilder};
44
use eyre::Result;
55

66
#[tokio::main]

0 commit comments

Comments
 (0)