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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
alloy = { version = "0.6", default-features = false, features = ["json-abi", "network", "provider-http", "rpc-types-eth", "signer-local", "serde", "hyper"] }
alloy = { version = "0.6", default-features = false, features = ["json-abi", "network", "provider-http", "rpc-types-eth", "signer-local", "serde", "hyper", "reqwest-rustls-tls"] }
alloy-eip7702 = { version = "0.4", features = ["k256", "serde"] }
alloy-rlp = "0.3"
anyhow = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/methods/fee_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ pub async fn build_fee_data_response(
.ok_or_else(unsupported_chain_error)?;

async fn eth_call_bytes(rpc_url: &str, to_address: &str, calldata: &[u8]) -> Option<Vec<u8>> {
let provider = ProviderBuilder::new().on_hyper_http(Url::parse(rpc_url).ok()?);
let to: Address = to_address.parse().ok()?;
let provider = ProviderBuilder::new().on_http(Url::parse(rpc_url).unwrap());
let to: Address = to_address.parse().unwrap();
let tx = TransactionRequest::default()
.to(to)
.input(Bytes::from(calldata.to_vec()).into());
Expand Down
2 changes: 1 addition & 1 deletion src/methods/send_tx/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub async fn process_single_transaction(

if let Some(rpc_url) = cfg.rpc_url_for_chain(&chain_id.to_string()) {
if let Ok(endpoint) = Url::parse(&rpc_url) {
let provider = ProviderBuilder::new().on_hyper_http(endpoint);
let provider = ProviderBuilder::new().on_http(endpoint);
if let Ok(balance) = provider.get_balance(wallet_address).await {
if balance < required {
return Err(insufficient_balance_error());
Expand Down
6 changes: 3 additions & 3 deletions src/provider/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub async fn fetch_receipt_for_status(
}

let rpc_url = cfg.rpc_url_for_chain(&chain_id.to_string())?;
let provider = ProviderBuilder::new().on_hyper_http(Url::parse(&rpc_url).ok()?);
let provider = ProviderBuilder::new().on_http(Url::parse(&rpc_url).ok()?);

let hash_hex = tx_hash.strip_prefix("0x").unwrap_or(tx_hash);
let hash_bytes = hex::decode(hash_hex).ok()?;
Expand Down Expand Up @@ -70,7 +70,7 @@ pub async fn fetch_gas_fees(chain_id: u64, cfg: &Config) -> Result<GasFees, Stri
.ok_or_else(|| format!("No RPC URL configured for chain {}", chain_id))?;

let rpc_endpoint = Url::parse(&rpc_url).map_err(|e| format!("Invalid RPC URL: {}", e))?;
let provider = ProviderBuilder::new().on_hyper_http(rpc_endpoint);
let provider = ProviderBuilder::new().on_http(rpc_endpoint);

let gas_price = match provider.get_gas_price().await {
Ok(p) => format!("0x{:x}", p),
Expand Down Expand Up @@ -115,7 +115,7 @@ pub async fn fetch_and_store_receipt(
}

let rpc_url = cfg.rpc_url_for_chain(&req.chain_id.to_string())?;
let provider = ProviderBuilder::new().on_hyper_http(Url::parse(&rpc_url).ok()?);
let provider = ProviderBuilder::new().on_http(Url::parse(&rpc_url).ok()?);

let hash_hex = tx_hash.strip_prefix("0x").unwrap_or(tx_hash);
let hash_bytes = hex::decode(hash_hex).ok()?;
Expand Down
2 changes: 1 addition & 1 deletion src/provider/simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub async fn simulate_transaction(
}

let rpc_endpoint = Url::parse(&rpc_url).map_err(|e| format!("Invalid RPC URL: {}", e))?;
let provider = ProviderBuilder::new().on_hyper_http(rpc_endpoint);
let provider = ProviderBuilder::new().on_http(rpc_endpoint);

let tx = TransactionRequest::default()
.to(wallet_addr)
Expand Down
2 changes: 1 addition & 1 deletion src/provider/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub async fn send_relay_transaction(
let provider = ProviderBuilder::new()
.with_recommended_fillers()
.wallet(wallet)
.on_hyper_http(rpc_endpoint);
.on_http(rpc_endpoint);

let to_address: Address = wallet_address
.parse()
Expand Down
Loading