Skip to main content

Crate cow_sdk_alloy

Crate cow_sdk_alloy 

Source
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§

AlloyClient
Native composed Alloy provider and signer client.
AlloyClientBuilder
Typestate builder for AlloyClient.
AlloyClientSignerHandle
Owned async signer handle created from crate::AlloyClient.
ChainSet
Typestate marker indicating a chain id has been selected.
ChainUnset
Typestate marker indicating no chain id has been selected.
HttpTransport
Typestate marker indicating HTTP transport has been selected.
KeySourceUnset
Typestate marker indicating no key source has been selected.
PrivateKeySource
Typestate marker indicating a private-key source has been selected.
RetryConfig
Opt-in retry policy for transient, rate-limited RPC reads.
TransportUnset
Typestate marker indicating no transport has been selected.

Enums§

AlloyClientBuilderError
Errors returned while constructing AlloyClient.
AlloyClientError
Error returned by crate::AlloyClient and crate::AlloyClientSignerHandle.

Traits§

ChainState
Sealed marker trait for chain-id builder states.
KeySourceState
Sealed marker trait for key-source builder states.
TransportState
Sealed marker trait for transport builder states.