Expand description
Native composed Alloy adapter for the CoW Protocol Rust SDK.
AlloyClient combines an Alloy HTTP provider with an Alloy local private
key signer through Alloy’s wallet-filler stack. It implements
cow_sdk_core::Provider, cow_sdk_core::LogProvider, and
cow_sdk_core::SigningProvider, while the handle returned by
create_signer implements cow_sdk_core::Signer.
use cow_sdk_alloy::AlloyClient;
use cow_sdk_core::SupportedChainId;
let client = AlloyClient::builder()
.http("https://example.invalid/rpc")?
.private_key("0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d")?
.chain_id(SupportedChainId::Sepolia)
.build_checked()
.await?;send_transaction submits through the wallet-filler provider and returns
cow_sdk_core::TransactionBroadcast with the broadcast transaction hash
from Alloy’s pending transaction handle. It does not wait for receipt
observation. Use cow_sdk_core::Provider::get_transaction_receipt
on the client when mined status, block, gas, sender, or recipient fields are
needed. Raw sign_transaction is intentionally not exposed by this release
because Alloy’s provider method routes to the remote JSON-RPC peer rather
than producing a local signed payload.
Re-exports§
pub use cow_sdk_alloy_provider as provider;pub use cow_sdk_alloy_signer as signer;
Structs§
- Alloy
Client - Native composed Alloy provider and signer client.
- Alloy
Client Builder - Typestate builder for
AlloyClient. - Alloy
Client Signer Handle - Owned async signer handle created from
crate::AlloyClient. - Chain
Set - Typestate marker indicating a chain id has been selected.
- Chain
Unset - Typestate marker indicating no chain id has been selected.
- Http
Transport - Typestate marker indicating HTTP transport has been selected.
- KeySource
Unset - Typestate marker indicating no key source has been selected.
- Private
KeySource - Typestate marker indicating a private-key source has been selected.
- Retry
Config - Opt-in retry policy for transient, rate-limited RPC reads.
- Transport
Unset - Typestate marker indicating no transport has been selected.
Enums§
- Alloy
Client Builder Error - Errors returned while constructing
AlloyClient. - Alloy
Client Error - Error returned by
crate::AlloyClientandcrate::AlloyClientSignerHandle.
Traits§
- Chain
State - Sealed marker trait for chain-id builder states.
- KeySource
State - Sealed marker trait for key-source builder states.
- Transport
State - Sealed marker trait for transport builder states.