From 8216d9e5f247c9cba8b5a52d5291fe0a459e62a1 Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Tue, 2 Sep 2025 18:05:51 +0530 Subject: [PATCH 1/8] ft: add convert to multisig --- Cargo.lock | 5 +- Cargo.toml | 5 + Makefile | 3 + src/bin/multi_sig.rs | 50 ++++++++ src/hl/actions.rs | 19 +++ src/hl/client.rs | 298 ++++++++++++++++++++++++++----------------- src/hl/exchange.rs | 32 ++++- src/signer/mod.rs | 17 +-- 8 files changed, 296 insertions(+), 133 deletions(-) create mode 100644 src/bin/multi_sig.rs diff --git a/Cargo.lock b/Cargo.lock index c7a1435..9df4b8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -870,9 +870,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.88" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", @@ -2907,6 +2907,7 @@ version = "0.1.5" dependencies = [ "alloy", "anyhow", + "async-trait", "axum", "env_logger", "envconfig", diff --git a/Cargo.toml b/Cargo.toml index 3a8758c..e50c6cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,9 +22,14 @@ path = "src/bin/perp_deployer.rs" name = "dex" path = "src/bin/perp_dex.rs" +[[bin]] +name = "multisig" +path = "src/bin/multi_sig.rs" + [dependencies] alloy = "1.0.9" anyhow = "1.0.98" +async-trait = "0.1.89" axum = "0.8.4" env_logger = "0.11.8" envconfig = "0.11.0" diff --git a/Makefile b/Makefile index 72b6bb9..1603a98 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ run-deployer: run-dex: cargo run --bin dex +run-multisig: + cargo run --bin multisig + debug: cargo build diff --git a/src/bin/multi_sig.rs b/src/bin/multi_sig.rs new file mode 100644 index 0000000..b674229 --- /dev/null +++ b/src/bin/multi_sig.rs @@ -0,0 +1,50 @@ +use alloy::primitives::Address; +use envconfig::Envconfig; +use hyperqit::*; +use tracing_subscriber::EnvFilter; + +#[derive(Envconfig)] +pub struct Config { + #[envconfig(from = "PRIVATE_KEY_OWNER")] + pub private_key_owner: String, + + #[envconfig(from = "PRIVATE_KEY_A")] + pub private_key_a: String, + + #[envconfig(from = "PRIVATE_KEY_B")] + pub private_key_b: String, + + #[envconfig(from = "RUST_LOG")] + pub log_level: String, + + #[envconfig(from = "USER_ADDRESS")] + pub user_address: String, +} + +#[tokio::main] +async fn main() { + tracing_subscriber::fmt() + .json() + .with_env_filter( + EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")), + ) + .init(); + let config = Config::init_from_env().unwrap(); + + let user_a = hyperqit::LocalWallet::signer(config.private_key_a); + let user_b = hyperqit::LocalWallet::signer(config.private_key_b); + + let user_a_addr = user_a.address(); + let user_b_addr = user_b.address(); + + let signer: Signers = Signers::Local(hyperqit::LocalWallet::signer(config.private_key_owner)); + + let user_address: Address = config.user_address.parse().unwrap(); + + let executor = crate::HyperliquidClient::new(Network::Testnet, signer, user_address); + + let _ = executor + .convert_to_multi_sig("0x01".to_string(), vec![user_a_addr, user_b_addr], 2) + .await + .unwrap(); +} diff --git a/src/hl/actions.rs b/src/hl/actions.rs index c5f0b92..fac848e 100644 --- a/src/hl/actions.rs +++ b/src/hl/actions.rs @@ -54,6 +54,7 @@ pub enum Actions { UpdateLeverage(UpdateLeverage), PerpDeploy(PerpDeployAction), SendAsset(SendAssetRequest), + ConvertToMultiSigUser(ConvertToMultiSigUserRequest), } #[derive(Serialize, Deserialize, Debug, Clone)] @@ -162,3 +163,21 @@ pub struct SendAssetRequest { #[serde(rename = "nonce")] pub nonce: u64, } + +#[derive(Serialize, Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct ConvertToMultiSigUserRequest { + #[serde(rename = "hyperliquidChain")] + pub chain: String, + #[serde(rename = "signatureChainId")] + pub sig_chain_id: String, + pub signers: String, + pub nonce: u64, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct MultiSigConfig { + pub authorized_users: Vec, + pub threshold: u64, +} diff --git a/src/hl/client.rs b/src/hl/client.rs index 064d38e..454ea9f 100644 --- a/src/hl/client.rs +++ b/src/hl/client.rs @@ -1,12 +1,15 @@ +use anyhow::Ok; +use async_trait::async_trait; +use ethers::middleware::signer; use std::time::SystemTime; use tracing::{debug, error, info}; -use alloy::primitives::{Address, FixedBytes}; +use alloy::primitives::{Address, FixedBytes, U256}; use crate::errors::{Errors, Result}; use crate::hl::exchange::{ - ExchangeRequest, ExchangeResponse, generate_action_params, generate_send_asset_params, - generate_transfer_params, + ExchangeRequest, ExchangeResponse, generate_action_params, + generate_convert_to_multi_sig_params, generate_send_asset_params, generate_transfer_params, }; use crate::hl::info::{GetInfoReq, PerpetualsInfo, SpotResponse}; use crate::hl::message::SignedMessage; @@ -17,11 +20,13 @@ use crate::hl::user_info::{ use crate::hl::utils::*; use crate::hl::{Actions, TransferRequest}; use crate::{ - BulkCancel, BulkOrder, CancelOrder, ExchangeOrderResponse, GetHistoricalOrders, GetUserFills, - GetUserOpenOrders, HyperLiquidSigningHash, Order, OrderRequest, PerpDeployAction, - SendAssetRequest, Signers, UserFillsResponse, UserOpenOrdersResponse, UserOrderHistoryResponse, + BulkCancel, BulkOrder, CancelOrder, ConvertToMultiSigUserRequest, ExchangeOrderResponse, + GetHistoricalOrders, GetUserFills, GetUserOpenOrders, HyperLiquidSigningHash, MultiSigConfig, + Order, OrderRequest, PerpDeployAction, SendAssetRequest, Signers, UserFillsResponse, + UserOpenOrdersResponse, UserOrderHistoryResponse, }; +#[async_trait] pub trait HlAgentWallet { async fn sign_order(&self, to_sign: FixedBytes<32>) -> Result; } @@ -164,6 +169,117 @@ impl HyperliquidClient { Ok(serde_json::from_str(body.as_str())?) } + pub async fn get_perp_info(&self, dex: Option) -> Result { + debug!("fetching perpetuals info"); + + let payload = GetInfoReq { + asset_type: "metaAndAssetCtxs".into(), + dex, + }; + + let resp = self + .client + .post(format!("{}/info", Into::::into(self.network))) + .header("Content-Type", "application/json") + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to get perp info: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + let out: PerpetualsInfo = serde_json::from_str(body.as_str())?; + Ok(out) + } + + pub async fn get_spot_info(&self, dex: Option) -> Result { + debug!("fetching spot info"); + + let payload = GetInfoReq { + asset_type: "spotMetaAndAssetCtxs".into(), + dex, + }; + + let resp = self + .client + .post(format!("{}/info", Into::::into(self.network))) + .header("Content-Type", "application/json") + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to get spot info: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + let out: SpotResponse = serde_json::from_str(body.as_str())?; + Ok(out) + } + + pub async fn get_user_spot_info(&self, dex: Option) -> Result { + debug!("fetching user spot positions for {}", self.user); + + let payload = GetUserInfoReq { + request_type: "spotClearinghouseState".into(), + user: self.user.to_string(), + dex, + }; + + let resp = self + .client + .post(format!("{}/info", Into::::into(self.network))) + .header("Content-Type", "application/json") + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to get user spot info: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + debug!("user spot response: {}", body); + let out: UserSpotPosition = serde_json::from_str(body.as_str())?; + + Ok(out) + } + + pub async fn get_user_perp_info(&self, dex: Option) -> Result { + debug!("fetching user perp positions for {}", self.user); + + let payload = GetUserInfoReq { + request_type: "clearinghouseState".into(), + user: self.user.to_string(), + dex, + }; + + let resp = self + .client + .post(format!("{}/info", Into::::into(self.network))) + .header("Content-Type", "application/json") + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to get user perp info: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + Ok(serde_json::from_str(body.as_str())?) + } + pub async fn update_leverage(&self, a: u32, is_cross: bool, leverage: u32) -> Result<()> { info!( "updating leverage for asset {} to {}x (cross: {})", @@ -447,117 +563,6 @@ impl HyperliquidClient { Ok(()) } - pub async fn get_perp_info(&self, dex: Option) -> Result { - debug!("fetching perpetuals info"); - - let payload = GetInfoReq { - asset_type: "metaAndAssetCtxs".into(), - dex, - }; - - let resp = self - .client - .post(format!("{}/info", Into::::into(self.network))) - .header("Content-Type", "application/json") - .json(&payload) - .send() - .await?; - - let status_code = resp.status().as_u16(); - let body = resp.text().await?; - if status_code != 200 { - error!("failed to get perp info: {} - {}", status_code, body); - return Err(Errors::HyperLiquidApiError(status_code, body).into()); - } - - let out: PerpetualsInfo = serde_json::from_str(body.as_str())?; - Ok(out) - } - - pub async fn get_spot_info(&self, dex: Option) -> Result { - debug!("fetching spot info"); - - let payload = GetInfoReq { - asset_type: "spotMetaAndAssetCtxs".into(), - dex, - }; - - let resp = self - .client - .post(format!("{}/info", Into::::into(self.network))) - .header("Content-Type", "application/json") - .json(&payload) - .send() - .await?; - - let status_code = resp.status().as_u16(); - let body = resp.text().await?; - if status_code != 200 { - error!("failed to get spot info: {} - {}", status_code, body); - return Err(Errors::HyperLiquidApiError(status_code, body).into()); - } - - let out: SpotResponse = serde_json::from_str(body.as_str())?; - Ok(out) - } - - pub async fn get_user_spot_info(&self, dex: Option) -> Result { - debug!("fetching user spot positions for {}", self.user); - - let payload = GetUserInfoReq { - request_type: "spotClearinghouseState".into(), - user: self.user.to_string(), - dex, - }; - - let resp = self - .client - .post(format!("{}/info", Into::::into(self.network))) - .header("Content-Type", "application/json") - .json(&payload) - .send() - .await?; - - let status_code = resp.status().as_u16(); - let body = resp.text().await?; - if status_code != 200 { - error!("failed to get user spot info: {} - {}", status_code, body); - return Err(Errors::HyperLiquidApiError(status_code, body).into()); - } - - debug!("user spot response: {}", body); - let out: UserSpotPosition = serde_json::from_str(body.as_str())?; - - Ok(out) - } - - pub async fn get_user_perp_info(&self, dex: Option) -> Result { - debug!("fetching user perp positions for {}", self.user); - - let payload = GetUserInfoReq { - request_type: "clearinghouseState".into(), - user: self.user.to_string(), - dex, - }; - - let resp = self - .client - .post(format!("{}/info", Into::::into(self.network))) - .header("Content-Type", "application/json") - .json(&payload) - .send() - .await?; - - let status_code = resp.status().as_u16(); - let body = resp.text().await?; - if status_code != 200 { - error!("failed to get user perp info: {} - {}", status_code, body); - return Err(Errors::HyperLiquidApiError(status_code, body).into()); - } - - Ok(serde_json::from_str(body.as_str())?) - } - pub async fn cancel_order(&self, oid: i64, a: u32) -> Result { debug!("cancelling order {} for asset {}", oid, a); @@ -654,4 +659,63 @@ impl HyperliquidClient { Ok(()) } + + pub async fn convert_to_multi_sig( + &self, + sig_chain_id: String, + mut signers: Vec
, + threshold: u64, + ) -> Result<()> { + let nonce = self.nonce_manager.get_next_nonce(); + signers.sort(); + + let config_str = serde_json::to_string(&MultiSigConfig { + authorized_users: signers.iter().map(|s| s.to_string()).collect(), + threshold, + })?; + + println!("config {}", config_str); + + let convert_action: ConvertToMultiSigUserRequest = ConvertToMultiSigUserRequest { + sig_chain_id: sig_chain_id, + chain: self.network.name(), + signers: config_str, + nonce, + }; + + let (to_sign, domain) = generate_convert_to_multi_sig_params(&convert_action)?; + + let hash = to_sign.hyperliquid_signing_hash(&domain); + let signature = self.signer.sign_order(hash).await?; + + let payload = ExchangeRequest { + nonce, + signature, + action: serde_json::to_value(Actions::ConvertToMultiSigUser(convert_action))?, + }; + + println!("{}", serde_json::to_string(&payload).unwrap()); + + let resp = self + .client + .post(format!("{}/exchange", Into::::into(self.network))) + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to convert to multisig: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + let out: ExchangeResponse = serde_json::from_str(body.as_str())?; + debug!("convert to multisig response: {:?}", out); + if out.status != "ok".to_string() { + return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); + } + + Ok(()) + } } diff --git a/src/hl/exchange.rs b/src/hl/exchange.rs index b4b21fc..30a1619 100644 --- a/src/hl/exchange.rs +++ b/src/hl/exchange.rs @@ -9,7 +9,7 @@ use alloy::{ use serde::{Deserialize, Serialize}; use crate::{ - HyperLiquidSigningHash, SendAssetRequest, + ConvertToMultiSigUserRequest, HyperLiquidSigningHash, SendAssetRequest, errors::{Errors, Result}, hl::{SignedMessage, TransferRequest}, }; @@ -48,6 +48,12 @@ sol! { uint64 nonce; } + #[derive(Serialize,Debug)] + struct ConvertUserToMultiSig { + string hyperliquidChain; + string signers; + uint64 nonce; + } #[derive(Serialize,Debug)] struct Agent { string source; @@ -150,6 +156,30 @@ pub fn generate_send_asset_params( )) } +pub fn generate_convert_to_multi_sig_params( + req: &ConvertToMultiSigUserRequest, +) -> Result<(TransferClass, Eip712Domain)> { + let hex_str = req.sig_chain_id.strip_prefix("0x").unwrap_or(&req.chain); + let chain_raw = hex::decode(hex_str)?; + let chain_id: u64 = U256::from_be_slice(chain_raw.as_slice()).try_into()?; + Ok(( + TransferClass { + type_string: "HyperliquidTransaction:ConvertToMultiSigUser(string hyperliquidChain,string signers,uint64 nonce)".to_owned(), + inner: ConvertUserToMultiSig { + hyperliquidChain: req.chain.clone(), + signers: req.signers.clone(), + nonce: req.nonce, + } + }, + eip712_domain! { + name : "HyperliquidSignTransaction", + version : "1", + chain_id : chain_id, + verifying_contract : address!("0x0000000000000000000000000000000000000000"), + }, + )) +} + pub fn generate_action_params( action: &crate::Actions, is_mainnet: bool, diff --git a/src/signer/mod.rs b/src/signer/mod.rs index 04deb4f..ffefab8 100644 --- a/src/signer/mod.rs +++ b/src/signer/mod.rs @@ -1,6 +1,6 @@ use crate::{errors::Result, hl::SignedMessage}; use alloy::{ - primitives::FixedBytes, + primitives::{Address, FixedBytes}, signers::{Signer, local::PrivateKeySigner}, sol_types::Eip712Domain, }; @@ -24,18 +24,8 @@ impl LocalWallet { wallet_key: pk.parse().unwrap(), } } - pub fn print_wallet(&self) { - let code = QrCode::new(format!( - "https://blockscan.com/address/{}", - self.wallet_key.address() - )) - .unwrap(); - let image = code - .render::() - .dark_color(unicode::Dense1x2::Light) - .light_color(unicode::Dense1x2::Dark) - .build(); - println!("{image}"); + pub fn address(&self) -> Address { + self.wallet_key.address() } pub async fn sign_hash(&self, hash: FixedBytes<32>) -> Result { @@ -43,6 +33,7 @@ impl LocalWallet { } } +#[async_trait::async_trait] impl crate::HlAgentWallet for Signers { async fn sign_order(&self, to_sign: FixedBytes<32>) -> Result { let signature = match self { From 69b367b2ea33fec0f0cfdbe8eaaaf9a84497163f Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Tue, 2 Sep 2025 18:08:09 +0530 Subject: [PATCH 2/8] ft: lint --- src/bin/dn_strat/main.rs | 2 +- src/bin/multi_sig.rs | 2 +- src/bin/perp_deployer.rs | 2 +- src/bin/perp_dex.rs | 2 +- src/hl/client.rs | 15 +++++++-------- src/hl/response.rs | 6 ++---- src/signer/mod.rs | 1 - 7 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/bin/dn_strat/main.rs b/src/bin/dn_strat/main.rs index a938e77..a82e76b 100644 --- a/src/bin/dn_strat/main.rs +++ b/src/bin/dn_strat/main.rs @@ -1,5 +1,5 @@ use std::time::Duration; -use std::{env, sync::Arc}; +use std::sync::Arc; use alloy::primitives::Address; use envconfig::Envconfig; diff --git a/src/bin/multi_sig.rs b/src/bin/multi_sig.rs index b674229..94efb6a 100644 --- a/src/bin/multi_sig.rs +++ b/src/bin/multi_sig.rs @@ -43,7 +43,7 @@ async fn main() { let executor = crate::HyperliquidClient::new(Network::Testnet, signer, user_address); - let _ = executor + executor .convert_to_multi_sig("0x01".to_string(), vec![user_a_addr, user_b_addr], 2) .await .unwrap(); diff --git a/src/bin/perp_deployer.rs b/src/bin/perp_deployer.rs index 2e5eba5..7d290d4 100644 --- a/src/bin/perp_deployer.rs +++ b/src/bin/perp_deployer.rs @@ -45,7 +45,7 @@ async fn main() { let executor = crate::HyperliquidClient::new(Network::Testnet, signer, user_address); let sz_decimals = 0; - let resp = executor + executor .perp_deploy_action(PerpDeployAction::RegisterAsset(RegisterAsset { max_gas: None, asset_request: RegisterAssetRequest { diff --git a/src/bin/perp_dex.rs b/src/bin/perp_dex.rs index e4a28fa..3306ae5 100644 --- a/src/bin/perp_dex.rs +++ b/src/bin/perp_dex.rs @@ -42,7 +42,7 @@ async fn main() { let executor = crate::HyperliquidClient::new(Network::Testnet, signer, user_address); - let _ = executor + executor .send_asset_to_dex(SendAssetRequest { chain: Network::Testnet.name(), sig_chain_id: "0xa4b1".to_string(), diff --git a/src/hl/client.rs b/src/hl/client.rs index 454ea9f..37825fc 100644 --- a/src/hl/client.rs +++ b/src/hl/client.rs @@ -1,10 +1,9 @@ use anyhow::Ok; use async_trait::async_trait; -use ethers::middleware::signer; use std::time::SystemTime; use tracing::{debug, error, info}; -use alloy::primitives::{Address, FixedBytes, U256}; +use alloy::primitives::{Address, FixedBytes}; use crate::errors::{Errors, Result}; use crate::hl::exchange::{ @@ -456,7 +455,7 @@ impl HyperliquidClient { let out: ExchangeResponse = serde_json::from_str(body.as_str())?; debug!("order response: {:?}", out); - if out.status != "ok".to_string() { + if out.status != *"ok" { return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); } @@ -473,7 +472,7 @@ impl HyperliquidClient { sig_chain_id: "0xa4b1".to_string(), amount: amount.to_string(), to_perp: false, - nonce: nonce, + nonce, }; debug!("transfer request: {:?}", transfer_req); @@ -508,7 +507,7 @@ impl HyperliquidClient { let out: ExchangeResponse = serde_json::from_str(body.as_str())?; debug!("transfer response: {:?}", out); - if out.status != "ok".to_string() { + if out.status != *"ok" { return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); } @@ -556,7 +555,7 @@ impl HyperliquidClient { let out: ExchangeResponse = serde_json::from_str(body.as_str())?; debug!("send asset response: {:?}", out); - if out.status != "ok".to_string() { + if out.status != *"ok" { return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); } @@ -677,7 +676,7 @@ impl HyperliquidClient { println!("config {}", config_str); let convert_action: ConvertToMultiSigUserRequest = ConvertToMultiSigUserRequest { - sig_chain_id: sig_chain_id, + sig_chain_id, chain: self.network.name(), signers: config_str, nonce, @@ -712,7 +711,7 @@ impl HyperliquidClient { let out: ExchangeResponse = serde_json::from_str(body.as_str())?; debug!("convert to multisig response: {:?}", out); - if out.status != "ok".to_string() { + if out.status != *"ok" { return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); } diff --git a/src/hl/response.rs b/src/hl/response.rs index a6a8868..1d1e447 100644 --- a/src/hl/response.rs +++ b/src/hl/response.rs @@ -45,8 +45,7 @@ mod test { #[test] fn test_all_exchange_responses() { - let test_cases = vec![ - r#"{ + let test_cases = [r#"{ "status":"ok", "response":{ "type":"order", @@ -115,8 +114,7 @@ mod test { } } }"#, - r#"{"status": "ok", "response": {"type": "default"}}"#, - ]; + r#"{"status": "ok", "response": {"type": "default"}}"#]; for (i, json_str) in test_cases.iter().enumerate() { println!("test case {}", i + 1,); diff --git a/src/signer/mod.rs b/src/signer/mod.rs index ffefab8..308acfa 100644 --- a/src/signer/mod.rs +++ b/src/signer/mod.rs @@ -5,7 +5,6 @@ use alloy::{ sol_types::Eip712Domain, }; use anyhow::Ok; -use qrcode::{QrCode, render::unicode}; pub trait HyperLiquidSigningHash { fn hyperliquid_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32>; From 90aae68b76738e0bfc69fb9905916c846948aae1 Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Wed, 3 Sep 2025 16:33:29 +0530 Subject: [PATCH 3/8] ft: init hl macro --- Cargo.lock | 169 +- Cargo.toml | 6 + hl_sol/Cargo.lock | 3996 +++++++++++++++++++++++++++++++++++++++++ hl_sol/Cargo.toml | 16 + hl_sol/src/lib.rs | 139 ++ src/bin/test_macro.rs | 16 + 6 files changed, 4273 insertions(+), 69 deletions(-) create mode 100644 hl_sol/Cargo.lock create mode 100644 hl_sol/Cargo.toml create mode 100644 hl_sol/src/lib.rs create mode 100644 src/bin/test_macro.rs diff --git a/Cargo.lock b/Cargo.lock index 9df4b8b..432803a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,9 +55,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0093d23bf026b580c1f66ed3a053d8209c104a446c5264d3ad99587f6edef24e" +checksum = "fa7413bbf62c40b5db916ad5a1c382df1affe42080e148d69932bb7f0a12f32e" dependencies = [ "alloy-consensus", "alloy-contract", @@ -73,6 +73,7 @@ dependencies = [ "alloy-signer-local", "alloy-transport", "alloy-transport-http", + "alloy-trie", ] [[package]] @@ -88,15 +89,16 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad451f9a70c341d951bca4e811d74dbe1e193897acd17e9dbac1353698cc430b" +checksum = "b7345077623aaa080fc06735ac13b8fa335125c8550f9c4f64135a5bf6f79967" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", "alloy-serde", "alloy-trie", + "alloy-tx-macros", "auto_impl", "c-kzg", "derive_more 2.0.1", @@ -112,9 +114,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142daffb15d5be1a2b20d2cd540edbcef03037b55d4ff69dc06beb4d06286dba" +checksum = "501f83565d28bdb9d6457dd3b5d646e19db37709d0f27608a26a1839052ddade" dependencies = [ "alloy-consensus", "alloy-eips", @@ -126,9 +128,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf25443920ecb9728cb087fe4dc04a0b290bd6ac85638c58fe94aba70f1a44e" +checksum = "e4c36bb4173892aeeba1c6b9e4eff923fa3fe8583f6d3e07afe1cbc5a96a853a" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -142,14 +144,15 @@ dependencies = [ "alloy-transport", "futures", "futures-util", + "serde_json", "thiserror 2.0.12", ] [[package]] name = "alloy-core" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c5a28f166629752f2e7246b813cdea3243cca59aab2d4264b1fd68392c10eb" +checksum = "bfe6c56d58fbfa9f0f6299376e8ce33091fc6494239466814c3f54b55743cb09" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -160,9 +163,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cc14d832bc3331ca22a1c7819de1ede99f58f61a7d123952af7dde8de124a6" +checksum = "a3f56873f3cac7a2c63d8e98a4314b8311aa96adb1a0f82ae923eb2119809d2c" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -212,9 +215,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3056872f6da48046913e76edb5ddced272861f6032f09461aea1a2497be5ae5d" +checksum = "c219a87fb386a75780ddbdbbced242477321887e426b0f946c05815ceabe5e09" dependencies = [ "alloy-eip2124", "alloy-eip2930", @@ -227,27 +230,30 @@ dependencies = [ "derive_more 2.0.1", "either", "serde", + "serde_with", "sha2", + "thiserror 2.0.12", ] [[package]] name = "alloy-genesis" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c98fb40f07997529235cc474de814cd7bd9de561e101716289095696c0e4639d" +checksum = "2dbf4c6b1b733ba0efaa6cc5f68786997a19ffcd88ff2ee2ba72fdd42594375e" dependencies = [ "alloy-eips", "alloy-primitives", "alloy-serde", "alloy-trie", "serde", + "serde_with", ] [[package]] name = "alloy-json-abi" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ccaa79753d7bf15f06399ea76922afbfaf8d18bebed9e8fc452984b4a90dcc9" +checksum = "125a1c373261b252e53e04d6e92c37d881833afc1315fceab53fd46045695640" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -257,12 +263,13 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc08b31ebf9273839bd9a01f9333cbb7a3abb4e820c312ade349dd18bdc79581" +checksum = "334555c323fa2bb98f1d4c242b62da9de8c715557a2ed680a76cefbcac19fefd" dependencies = [ "alloy-primitives", "alloy-sol-types", + "http 1.3.1", "serde", "serde_json", "thiserror 2.0.12", @@ -271,9 +278,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed117b08f0cc190312bf0c38c34cf4f0dabfb4ea8f330071c587cd7160a88cb2" +checksum = "c7ea377c9650203d7a7da9e8dee7f04906b49a9253f554b110edd7972e75ef34" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -297,9 +304,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7162ff7be8649c0c391f4e248d1273e85c62076703a1f3ec7daf76b283d886d" +checksum = "b9f9ab9a9e92c49a357edaee2d35deea0a32ac8f313cfa37448f04e7e029c9d9" dependencies = [ "alloy-consensus", "alloy-eips", @@ -310,9 +317,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c35fc4b03ace65001676358ffbbaefe2a2b27ee50fe777c345082c7c888be8" +checksum = "bc9485c56de23438127a731a6b4c87803d49faf1a7068dcd1d8768aca3a9edb9" dependencies = [ "alloy-rlp", "bytes", @@ -337,9 +344,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84eba1fd8b6fe8b02f2acd5dd7033d0f179e304bd722d11e817db570d1fa6c4" +checksum = "9a85361c88c16116defbd98053e3d267054d6b82729cdbef0236f7881590f924" dependencies = [ "alloy-chains", "alloy-consensus", @@ -398,15 +405,14 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518a699422a3eab800f3dac2130d8f2edba8e4fff267b27a9c7dc6a2b0d313ee" +checksum = "743fc964abb0106e454e9e8683fb0809fb32940270ef586a58e913531360b302" dependencies = [ "alloy-json-rpc", "alloy-primitives", "alloy-transport", "alloy-transport-http", - "async-stream", "futures", "pin-project", "reqwest 0.12.19", @@ -416,16 +422,15 @@ dependencies = [ "tokio-stream", "tower", "tracing", - "tracing-futures", "url", "wasmtimer", ] [[package]] name = "alloy-rpc-types" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c000cab4ec26a4b3e29d144e999e1c539c2fa0abed871bf90311eb3466187ca8" +checksum = "e6445ccdc73c8a97e1794e9f0f91af52fb2bbf9ff004339a801b0293c3928abb" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -435,9 +440,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508b2fbe66d952089aa694e53802327798806498cd29ff88c75135770ecaabfc" +checksum = "97372c51a14a804fb9c17010e3dd6c117f7866620b264e24b64d2259be44bcdf" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -446,9 +451,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf7dff0fdd756a714d58014f4f8354a1706ebf9fa2cf73431e0aeec3c9431e" +checksum = "672286c19528007df058bafd82c67e23247b4b3ebbc538cbddc705a82d8a930f" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -461,14 +466,15 @@ dependencies = [ "itertools 0.14.0", "serde", "serde_json", + "serde_with", "thiserror 2.0.12", ] [[package]] name = "alloy-serde" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "730e8f2edf2fc224cabd1c25d090e1655fa6137b2e409f92e5eec735903f1507" +checksum = "1aae653f049267ae7e040eab6c9b9a417064ca1a6cb21e3dd59b9f1131ef048f" dependencies = [ "alloy-primitives", "serde", @@ -477,9 +483,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b0d2428445ec13edc711909e023d7779618504c4800be055a5b940025dbafe3" +checksum = "d97cedce202f848592b96f7e891503d3adb33739c4e76904da73574290141b93" dependencies = [ "alloy-primitives", "async-trait", @@ -492,9 +498,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14fe6fedb7fe6e0dfae47fe020684f1d8e063274ef14bca387ddb7a6efa8ec1" +checksum = "83ae7d854db5b7cdd5b9ed7ad13d1e5e034cdd8be85ffef081f61dc6c9e18351" dependencies = [ "alloy-consensus", "alloy-network", @@ -508,9 +514,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8612e0658964d616344f199ab251a49d48113992d81b92dab93ed855faa66383" +checksum = "d20d867dcf42019d4779519a1ceb55eba8d7f3d0e4f0a89bcba82b8f9eb01e48" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -522,9 +528,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a384edac7283bc4c010a355fb648082860c04b826bb7a814c45263c8f304c74" +checksum = "b74e91b0b553c115d14bd0ed41898309356dc85d0e3d4b9014c4e7715e48c8ad" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", @@ -541,9 +547,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd588c2d516da7deb421b8c166dc60b7ae31bca5beea29ab6621fcfa53d6ca5" +checksum = "84194d31220803f5f62d0a00f583fd3a062b36382e2bea446f1af96727754565" dependencies = [ "alloy-json-abi", "const-hex", @@ -559,9 +565,9 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86ddeb70792c7ceaad23e57d52250107ebbb86733e52f4a25d8dc1abc931837" +checksum = "fe8c27b3cf6b2bb8361904732f955bc7c05e00be5f469cec7e2280b6167f3ff0" dependencies = [ "serde", "winnow", @@ -569,9 +575,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "584cb97bfc5746cb9dcc4def77da11694b5d6d7339be91b7480a6a68dc129387" +checksum = "f5383d34ea00079e6dd89c652bcbdb764db160cef84e6250926961a0b2295d04" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -581,12 +587,13 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a712bdfeff42401a7dd9518f72f617574c36226a9b5414537fedc34350b73bf9" +checksum = "c08b383bc903c927635e39e1dae7df2180877d93352d1abd389883665a598afc" dependencies = [ "alloy-json-rpc", "alloy-primitives", + "auto_impl", "base64 0.22.1", "derive_more 2.0.1", "futures", @@ -604,9 +611,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "1.0.9" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea5a76d7f2572174a382aedf36875bedf60bcc41116c9f031cf08040703a2dc" +checksum = "6e58dee1f7763ef302074b645fc4f25440637c09a60e8de234b62993f06c0ae3" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -619,9 +626,9 @@ dependencies = [ [[package]] name = "alloy-trie" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983d99aa81f586cef9dae38443245e585840fcf0fc58b09aee0b1f27aed1d500" +checksum = "e3412d52bb97c6c6cc27ccc28d4e6e8cf605469101193b50b0bd5813b1f990b5" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -633,6 +640,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "alloy-tx-macros" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14809f908822dbff0dc472c77ca4aa129ab12e22fd9bff2dd1ef54603e68e3d" +dependencies = [ + "alloy-primitives", + "darling", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -2667,6 +2687,17 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "hl_sol" +version = "0.1.0" +dependencies = [ + "alloy", + "heck", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "hmac" version = "0.12.1" @@ -2913,6 +2944,7 @@ dependencies = [ "envconfig", "ethers", "futures", + "hl_sol", "http-body-util", "httpclient", "hyper 1.6.0", @@ -3642,13 +3674,14 @@ dependencies = [ [[package]] name = "nybbles" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8983bb634df7248924ee0c4c3a749609b5abcb082c28fffe3254b3eb3602b307" +checksum = "63cb50036b1ad148038105af40aaa70ff24d8a14fbc44ae5c914e1348533d12e" dependencies = [ "alloy-rlp", - "const-hex", + "cfg-if", "proptest", + "ruint", "serde", "smallvec", ] @@ -4089,9 +4122,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] @@ -5277,9 +5310,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "1.1.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d879005cc1b5ba4e18665be9e9501d9da3a9b95f625497c4cb7ee082b532e" +checksum = "a0b198d366dbec045acfcd97295eb653a7a2b40e4dc764ef1e79aafcad439d3c" dependencies = [ "paste", "proc-macro2", @@ -5762,8 +5795,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "futures", - "futures-task", "pin-project", "tracing", ] diff --git a/Cargo.toml b/Cargo.toml index e50c6cb..bd8f3bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,10 @@ path = "src/bin/perp_dex.rs" name = "multisig" path = "src/bin/multi_sig.rs" +[[bin]] +name = "test-macro" +path = "src/bin/test_macro.rs" + [dependencies] alloy = "1.0.9" anyhow = "1.0.98" @@ -52,3 +56,5 @@ tokio-tungstenite = {version = "0.26.2",features = ["native-tls"] } tokio-util = "0.7.15" tracing = "0.1.41" tracing-subscriber = {version = "0.3.19", features = ["json","env-filter"] } +hl_sol = { path = "./hl_sol" } + diff --git a/hl_sol/Cargo.lock b/hl_sol/Cargo.lock new file mode 100644 index 0000000..9c6295a --- /dev/null +++ b/hl_sol/Cargo.lock @@ -0,0 +1,3996 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7413bbf62c40b5db916ad5a1c382df1affe42080e148d69932bb7f0a12f32e" +dependencies = [ + "alloy-consensus", + "alloy-contract", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-network", + "alloy-provider", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", + "alloy-transport", + "alloy-transport-http", + "alloy-trie", +] + +[[package]] +name = "alloy-chains" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8ff73a143281cb77c32006b04af9c047a6b8fe5860e85a88ad325328965355" +dependencies = [ + "alloy-primitives", + "num_enum", + "strum", +] + +[[package]] +name = "alloy-consensus" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7345077623aaa080fc06735ac13b8fa335125c8550f9c4f64135a5bf6f79967" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-trie", + "alloy-tx-macros", + "auto_impl", + "c-kzg", + "derive_more", + "either", + "k256", + "once_cell", + "rand 0.8.5", + "secp256k1", + "serde", + "serde_with", + "thiserror", +] + +[[package]] +name = "alloy-consensus-any" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501f83565d28bdb9d6457dd3b5d646e19db37709d0f27608a26a1839052ddade" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-contract" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c36bb4173892aeeba1c6b9e4eff923fa3fe8583f6d3e07afe1cbc5a96a853a" +dependencies = [ + "alloy-consensus", + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-provider", + "alloy-rpc-types-eth", + "alloy-sol-types", + "alloy-transport", + "futures", + "futures-util", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-core" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfe6c56d58fbfa9f0f6299376e8ce33091fc6494239466814c3f54b55743cb09" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f56873f3cac7a2c63d8e98a4314b8311aa96adb1a0f82ae923eb2119809d2c" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "itoa", + "serde", + "serde_json", + "winnow", +] + +[[package]] +name = "alloy-eip2124" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "741bdd7499908b3aa0b159bba11e71c8cddd009a2c2eb7a06e825f1ec87900a5" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "crc", + "serde", + "thiserror", +] + +[[package]] +name = "alloy-eip2930" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b82752a889170df67bbb36d42ca63c531eb16274f0d7299ae2a680facba17bd" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4769c6ffddca380b0070d71c8b7f30bed375543fe76bb2f74ec0acf4b7cd16" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", + "thiserror", +] + +[[package]] +name = "alloy-eips" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c219a87fb386a75780ddbdbbced242477321887e426b0f946c05815ceabe5e09" +dependencies = [ + "alloy-eip2124", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "auto_impl", + "c-kzg", + "derive_more", + "either", + "serde", + "serde_with", + "sha2", + "thiserror", +] + +[[package]] +name = "alloy-genesis" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dbf4c6b1b733ba0efaa6cc5f68786997a19ffcd88ff2ee2ba72fdd42594375e" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "alloy-trie", + "serde", + "serde_with", +] + +[[package]] +name = "alloy-json-abi" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "125a1c373261b252e53e04d6e92c37d881833afc1315fceab53fd46045695640" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-rpc" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "334555c323fa2bb98f1d4c242b62da9de8c715557a2ed680a76cefbcac19fefd" +dependencies = [ + "alloy-primitives", + "alloy-sol-types", + "http", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-network" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ea377c9650203d7a7da9e8dee7f04906b49a9253f554b110edd7972e75ef34" +dependencies = [ + "alloy-consensus", + "alloy-consensus-any", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-types-any", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types", + "async-trait", + "auto_impl", + "derive_more", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-network-primitives" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f9ab9a9e92c49a357edaee2d35deea0a32ac8f313cfa37448f04e7e029c9d9" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-primitives" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9485c56de23438127a731a6b4c87803d49faf1a7068dcd1d8768aca3a9edb9" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "foldhash", + "hashbrown 0.15.5", + "indexmap 2.11.0", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.2", + "ruint", + "rustc-hash", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-provider" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a85361c88c16116defbd98053e3d267054d6b82729cdbef0236f7881590f924" +dependencies = [ + "alloy-chains", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-client", + "alloy-rpc-types-eth", + "alloy-signer", + "alloy-sol-types", + "alloy-transport", + "alloy-transport-http", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "either", + "futures", + "futures-utils-wasm", + "lru", + "parking_lot", + "pin-project", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "alloy-rpc-client" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fc964abb0106e454e9e8683fb0809fb32940270ef586a58e913531360b302" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "alloy-transport", + "alloy-transport-http", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rpc-types" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6445ccdc73c8a97e1794e9f0f91af52fb2bbf9ff004339a801b0293c3928abb" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-any" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97372c51a14a804fb9c17010e3dd6c117f7866620b264e24b64d2259be44bcdf" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "672286c19528007df058bafd82c67e23247b4b3ebbc538cbddc705a82d8a930f" +dependencies = [ + "alloy-consensus", + "alloy-consensus-any", + "alloy-eips", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types", + "itertools 0.14.0", + "serde", + "serde_json", + "serde_with", + "thiserror", +] + +[[package]] +name = "alloy-serde" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aae653f049267ae7e040eab6c9b9a417064ca1a6cb21e3dd59b9f1131ef048f" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97cedce202f848592b96f7e891503d3adb33739c4e76904da73574290141b93" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "either", + "elliptic-curve", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-signer-local" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ae7d854db5b7cdd5b9ed7ad13d1e5e034cdd8be85ffef081f61dc6c9e18351" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "async-trait", + "k256", + "rand 0.8.5", + "thiserror", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d20d867dcf42019d4779519a1ceb55eba8d7f3d0e4f0a89bcba82b8f9eb01e48" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74e91b0b553c115d14bd0ed41898309356dc85d0e3d4b9014c4e7715e48c8ad" +dependencies = [ + "alloy-json-abi", + "alloy-sol-macro-input", + "const-hex", + "heck", + "indexmap 2.11.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.106", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84194d31220803f5f62d0a00f583fd3a062b36382e2bea446f1af96727754565" +dependencies = [ + "alloy-json-abi", + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.106", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe8c27b3cf6b2bb8361904732f955bc7c05e00be5f469cec7e2280b6167f3ff0" +dependencies = [ + "serde", + "winnow", +] + +[[package]] +name = "alloy-sol-types" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5383d34ea00079e6dd89c652bcbdb764db160cef84e6250926961a0b2295d04" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "serde", +] + +[[package]] +name = "alloy-transport" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08b383bc903c927635e39e1dae7df2180877d93352d1abd389883665a598afc" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "auto_impl", + "base64", + "derive_more", + "futures", + "futures-utils-wasm", + "parking_lot", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-transport-http" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e58dee1f7763ef302074b645fc4f25440637c09a60e8de234b62993f06c0ae3" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest", + "serde_json", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-trie" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3412d52bb97c6c6cc27ccc28d4e6e8cf605469101193b50b0bd5813b1f990b5" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec", + "derive_more", + "nybbles", + "serde", + "smallvec", + "tracing", +] + +[[package]] +name = "alloy-tx-macros" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14809f908822dbff0dc472c77ca4aa129ab12e22fd9bff2dd1ef54603e68e3d" +dependencies = [ + "alloy-primitives", + "darling", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +dependencies = [ + "serde", +] + +[[package]] +name = "async-stream" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "auto_impl" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + +[[package]] +name = "bitflags" +version = "2.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blst" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fd49896f12ac9b6dcd7a5998466b9b58263a695a3dd1ecc1aaca2e12a90b080" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +dependencies = [ + "serde", +] + +[[package]] +name = "c-kzg" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7318cfa722931cb5fe0838b98d3ce5621e75f6a6408abc21721d80de9223f2e4" +dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", + "serde", +] + +[[package]] +name = "cc" +version = "1.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590f9024a68a8c40351881787f1934dc11afd69090f5edb6831464694d836ea3" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "const-hex" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dccd746bf9b1038c0507b7cec21eb2b11222db96a2902c96e8c185d6d20fb9c4" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.106", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +dependencies = [ + "serde", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e178e4fba8a2726903f6ba98a6d221e76f9c12c650d5dc0e6afdc50677b49650" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "futures-utils-wasm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.3+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", + "serde", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hl_types_derive" +version = "0.1.0" +dependencies = [ + "alloy", + "heck", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +dependencies = [ + "equivalent", + "hashbrown 0.15.5", + "serde", +] + +[[package]] +name = "io-uring" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" +dependencies = [ + "hashbrown 0.15.5", +] + +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "nybbles" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63cb50036b1ad148038105af40aaa70ff24d8a14fbc44ae5c914e1348533d12e" +dependencies = [ + "alloy-rlp", + "cfg-if", + "proptest", + "ruint", + "serde", + "smallvec", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "openssl" +version = "0.10.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proptest" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags", + "lazy_static", + "num-traits", + "rand 0.9.2", + "rand_chacha 0.9.0", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "serde", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "serde", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", + "serde", +] + +[[package]] +name = "rand_xorshift" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" +dependencies = [ + "rand_core 0.9.3", +] + +[[package]] +name = "redox_syscall" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "regex-syntax" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" + +[[package]] +name = "reqwest" +version = "0.12.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" +dependencies = [ + "base64", + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "ruint" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecb38f82477f20c5c3d62ef52d7c4e536e38ea9b73fb570a20c5cae0e14bcf6" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.5", + "rand 0.9.2", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.26", +] + +[[package]] +name = "rustix" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.60.2", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "serde_json" +version = "1.0.143" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.11.0", + "schemars 0.9.0", + "schemars 1.0.4", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sha3-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0b198d366dbec045acfcd97295eb653a7a2b40e4dc764ef1e79aafcad439d3c" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys 0.60.2", +] + +[[package]] +name = "thiserror" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.3.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83bde6f1ec10e72d583d91623c939f623002284ef622b87de38cfd546cbf2031" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" + +[[package]] +name = "time-macros" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.47.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +dependencies = [ + "backtrace", + "bytes", + "io-uring", + "libc", + "mio", + "pin-project-lite", + "slab", + "socket2", + "tokio-macros", + "windows-sys 0.59.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap 2.11.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "tracing-core" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wait-timeout" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasi" +version = "0.14.3+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.106", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasmtimer" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c598d6b99ea013e35844697fc4670d08339d5cda15588f193c6beedd12f644b" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814" + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] diff --git a/hl_sol/Cargo.toml b/hl_sol/Cargo.toml new file mode 100644 index 0000000..2b2a386 --- /dev/null +++ b/hl_sol/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "hl_sol" +version = "0.1.0" +edition = "2024" + + + +[lib] +proc-macro = true + +[dependencies] +syn = "2.0" +quote = "1.0" +proc-macro2 = "1.0.101" +alloy = "1.0.27" +heck = "0.5.0" diff --git a/hl_sol/src/lib.rs b/hl_sol/src/lib.rs new file mode 100644 index 0000000..a2ad3c8 --- /dev/null +++ b/hl_sol/src/lib.rs @@ -0,0 +1,139 @@ +extern crate proc_macro; +use heck::ToShoutySnakeCase; +use proc_macro::TokenStream; +use proc_macro2::Span; +use quote::quote; +use syn::{Data, DeriveInput, Fields, Ident, parse_macro_input}; + +#[proc_macro] +pub fn sol(input: TokenStream) -> TokenStream { + let input: DeriveInput = parse_macro_input!(input as DeriveInput); + + // extract struct name and check for multisig attribute + let struct_name = &input.ident; + let is_multisig = input + .attrs + .iter() + .any(|attr| attr.path().is_ident("multisig")); + + // extract fields from struct + let fields = match &input.data { + Data::Struct(data_struct) => match &data_struct.fields { + Fields::Named(fields_named) => &fields_named.named, + _ => panic!("hl_sol: only named fields are supported"), + }, + _ => panic!("hl_sol: only structs are supported"), + }; + + // build field information for type string and sol struct + let mut sol_fields = Vec::new(); + let mut type_string_parts = Vec::new(); + let mut hyperliquid_chain_index = None; + + for (index, field) in fields.iter().enumerate() { + let field_name = field.ident.as_ref().unwrap(); + let field_type = get_type_string(&field.ty); + + // track position of hyperliquidChain field for multisig insertion + if field_name == "hyperliquidChain" { + hyperliquid_chain_index = Some(index); + } + + // build sol field and type string part + let field_type_ident = Ident::new(&field_type, Span::call_site()); + sol_fields.push(quote! { #field_type_ident #field_name; }); + type_string_parts.push(format!("{} {}", field_type, field_name)); + } + + // generate main type constant and struct + let type_name = Ident::new( + &format!("{}_TYPE", struct_name.to_string().to_shouty_snake_case()), + Span::call_site(), + ); + + let type_string = format!( + "HyperliquidTransaction:{}({})", + struct_name, + type_string_parts.join(",") + ); + + let mut output = quote! { + pub const #type_name: &str = #type_string; + + ::alloy::sol! { + struct #struct_name { + #(#sol_fields)* + } + } + }; + + // generate multisig variant if requested + if is_multisig { + // hyperliquidChain field is required for multisig + if hyperliquid_chain_index.is_none() { + panic!("hl_sol: multisig structs must have a 'hyperliquidChain' field"); + } + + let multisig_struct_name = + Ident::new(&format!("MultiSig{}", struct_name), Span::call_site()); + + let multisig_type_name = Ident::new( + &format!( + "{}_MULTISIG_TYPE", + struct_name.to_string().to_shouty_snake_case() + ), + Span::call_site(), + ); + + // define multisig fields to insert + let payload_multi_sig_user = Ident::new("payloadMultiSigUser", Span::call_site()); + let outer_signer = Ident::new("outerSigner", Span::call_site()); + let address_type = Ident::new("address", Span::call_site()); + + // insert multisig fields after hyperliquidChain + let insert_position = hyperliquid_chain_index.unwrap() + 1; + + sol_fields.insert( + insert_position, + quote! { #address_type #payload_multi_sig_user; }, + ); + sol_fields.insert(insert_position + 1, quote! { #address_type #outer_signer; }); + + type_string_parts.insert( + insert_position, + format!("address {}", payload_multi_sig_user), + ); + type_string_parts.insert(insert_position + 1, format!("address {}", outer_signer)); + + let multisig_type_string = format!( + "HyperliquidTransaction:{}({})", + struct_name, + type_string_parts.join(",") + ); + + output.extend(quote! { + pub const #multisig_type_name: &str = #multisig_type_string; + + ::alloy::sol! { + struct #multisig_struct_name { + #(#sol_fields)* + } + } + }); + } + + proc_macro::TokenStream::from(output) +} + +// extract type string from syn::Type +// simply returns the identifier as-is, letting sol! macro handle validation +fn get_type_string(ty: &syn::Type) -> String { + match ty { + syn::Type::Path(type_path) => type_path + .path + .get_ident() + .map(|ident| ident.to_string()) + .unwrap_or_else(|| panic!("hl_sol: complex types not supported")), + _ => panic!("hl_sol: only simple type names supported"), + } +} diff --git a/src/bin/test_macro.rs b/src/bin/test_macro.rs new file mode 100644 index 0000000..50fd7f1 --- /dev/null +++ b/src/bin/test_macro.rs @@ -0,0 +1,16 @@ +use hl_sol::sol; + +sol! { + #[multisig] + #[derive(Serialize)] + struct TestJest { + hyperliquidChain: string, + amount: string, + toPerp: bool, + nonce: uint64 + } +} + +fn main() { + print!("{}", TEST_JEST_TYPE) +} From 0d718b3ebbbf6f6b71298f9b305c3350d323e816 Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Wed, 3 Sep 2025 17:27:44 +0530 Subject: [PATCH 4/8] ft: port to new macro --- Cargo.toml | 4 +- Makefile | 3 + src/bin/perp_dex.rs | 12 --- src/bin/test_macro.rs | 16 ---- src/bin/transfer.rs | 35 ++++++++ src/hl/client.rs | 67 +++++++++++---- src/hl/exchange.rs | 186 ++++++++++++++---------------------------- src/hl/utils.rs | 13 +++ 8 files changed, 165 insertions(+), 171 deletions(-) delete mode 100644 src/bin/test_macro.rs create mode 100644 src/bin/transfer.rs diff --git a/Cargo.toml b/Cargo.toml index bd8f3bd..e02a2cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,8 +27,8 @@ name = "multisig" path = "src/bin/multi_sig.rs" [[bin]] -name = "test-macro" -path = "src/bin/test_macro.rs" +name = "transfer" +path = "src/bin/transfer.rs" [dependencies] alloy = "1.0.9" diff --git a/Makefile b/Makefile index 1603a98..a4e036a 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ run-dex: run-multisig: cargo run --bin multisig +run-transfer: + cargo run --bin transfer + debug: cargo build diff --git a/src/bin/perp_dex.rs b/src/bin/perp_dex.rs index 3306ae5..3a6f7b2 100644 --- a/src/bin/perp_dex.rs +++ b/src/bin/perp_dex.rs @@ -13,18 +13,6 @@ pub struct Config { #[envconfig(from = "USER_ADDRESS")] pub user_address: String, - - #[envconfig(from = "EXISTING_ORDER_ID")] - pub existing_order_id: String, - - #[envconfig(from = "BOT_URL")] - pub bot_url: String, - - #[envconfig(from = "CHECK_EVERY")] - pub check_every: u64, - - #[envconfig(from = "BIND_ADDR")] - pub bind_addr: String, } #[tokio::main] diff --git a/src/bin/test_macro.rs b/src/bin/test_macro.rs deleted file mode 100644 index 50fd7f1..0000000 --- a/src/bin/test_macro.rs +++ /dev/null @@ -1,16 +0,0 @@ -use hl_sol::sol; - -sol! { - #[multisig] - #[derive(Serialize)] - struct TestJest { - hyperliquidChain: string, - amount: string, - toPerp: bool, - nonce: uint64 - } -} - -fn main() { - print!("{}", TEST_JEST_TYPE) -} diff --git a/src/bin/transfer.rs b/src/bin/transfer.rs new file mode 100644 index 0000000..12939b7 --- /dev/null +++ b/src/bin/transfer.rs @@ -0,0 +1,35 @@ +use alloy::primitives::Address; +use envconfig::Envconfig; +use hyperqit::*; +use tracing_subscriber::EnvFilter; + +#[derive(Envconfig)] +pub struct Config { + #[envconfig(from = "PRIVATE_KEY_SENDER")] + pub private_key_sender: String, + + #[envconfig(from = "SENDER_ADDRESS")] + pub sender_address: String, +} + +#[tokio::main] +async fn main() { + tracing_subscriber::fmt() + .json() + .with_env_filter( + EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")), + ) + .init(); + let config = Config::init_from_env().unwrap(); + + let signer: Signers = Signers::Local(hyperqit::LocalWallet::signer(config.private_key_sender)); + + let user_address: Address = config.sender_address.parse().unwrap(); + + let executor = crate::HyperliquidClient::new(Network::Testnet, signer, user_address); + + executor + .transfer_usd(10, false, "0x1".to_owned()) + .await + .unwrap(); +} diff --git a/src/hl/client.rs b/src/hl/client.rs index 37825fc..7fbe701 100644 --- a/src/hl/client.rs +++ b/src/hl/client.rs @@ -7,8 +7,9 @@ use alloy::primitives::{Address, FixedBytes}; use crate::errors::{Errors, Result}; use crate::hl::exchange::{ - ExchangeRequest, ExchangeResponse, generate_action_params, - generate_convert_to_multi_sig_params, generate_send_asset_params, generate_transfer_params, + CONVERT_TO_MULTI_SIG_USER_TYPE, ConvertToMultiSigUser, ExchangeRequest, ExchangeResponse, + SEND_ASSET_TYPE, SendAsset, USD_CLASS_TRANSFER_TYPE, UsdClassTransfer, generate_action_params, + hyperliquid_signing_hash_with_default_domain, }; use crate::hl::info::{GetInfoReq, PerpetualsInfo, SpotResponse}; use crate::hl::message::SignedMessage; @@ -462,23 +463,39 @@ impl HyperliquidClient { Ok(serde_json::from_value(out.response)?) } - pub async fn transfer_usd_to_spot(&self, amount: u64) -> Result<()> { + pub async fn transfer_usd( + &self, + amount: u64, + to_perp: bool, + sig_chain_id: String, + ) -> Result<()> { debug!("transferring ${} USD to spot", amount); let nonce = self.nonce_manager.get_next_nonce(); let transfer_req = TransferRequest { chain: self.network.name(), - sig_chain_id: "0xa4b1".to_string(), + sig_chain_id: sig_chain_id, amount: amount.to_string(), - to_perp: false, + to_perp: to_perp, nonce, }; + let sig_chain_id_u64 = parse_chain_id(&transfer_req.sig_chain_id)?; + debug!("transfer request: {:?}", transfer_req); - let (to_sign, domain) = generate_transfer_params(&transfer_req)?; - let hash = to_sign.hyperliquid_signing_hash(&domain); + let hash = hyperliquid_signing_hash_with_default_domain( + USD_CLASS_TRANSFER_TYPE.to_owned(), + UsdClassTransfer { + hyperliquidChain: transfer_req.chain.clone(), + amount: transfer_req.amount.clone(), + toPerp: transfer_req.to_perp, + nonce: nonce, + }, + sig_chain_id_u64, + ); + let signature = self.signer.sign_order(hash).await?; let payload = ExchangeRequest { nonce, @@ -520,12 +537,26 @@ impl HyperliquidClient { let nonce = self.nonce_manager.get_next_nonce(); transfer_req.nonce = nonce; + let sig_chain_id_u64 = parse_chain_id(&transfer_req.sig_chain_id)?; + debug!("send asset request: {:?}", transfer_req); - let (to_sign, domain) = generate_send_asset_params(&transfer_req)?; - debug!("transfer domain: {:?}", domain); + let hash = hyperliquid_signing_hash_with_default_domain( + SEND_ASSET_TYPE.to_owned(), + SendAsset { + hyperliquidChain: transfer_req.chain.clone(), + destination: transfer_req.destination.clone(), + sourceDex: transfer_req.source_dex.clone(), + destinationDex: transfer_req.dst_dex.clone(), + token: transfer_req.token.clone(), + amount: transfer_req.amount.clone(), + fromSubAccount: transfer_req.from_sub_account.clone(), + nonce: nonce, + }, + sig_chain_id_u64, + ); - let hash = to_sign.hyperliquid_signing_hash(&domain); + debug!("transfer hash: {:?}", hash); let signature = self.signer.sign_order(hash).await?; let payload = ExchangeRequest { @@ -668,13 +699,12 @@ impl HyperliquidClient { let nonce = self.nonce_manager.get_next_nonce(); signers.sort(); + let sig_chain_id_u64 = parse_chain_id(&sig_chain_id)?; let config_str = serde_json::to_string(&MultiSigConfig { authorized_users: signers.iter().map(|s| s.to_string()).collect(), threshold, })?; - println!("config {}", config_str); - let convert_action: ConvertToMultiSigUserRequest = ConvertToMultiSigUserRequest { sig_chain_id, chain: self.network.name(), @@ -682,9 +712,16 @@ impl HyperliquidClient { nonce, }; - let (to_sign, domain) = generate_convert_to_multi_sig_params(&convert_action)?; + let hash = hyperliquid_signing_hash_with_default_domain( + CONVERT_TO_MULTI_SIG_USER_TYPE.to_owned(), + ConvertToMultiSigUser { + hyperliquidChain: convert_action.chain.clone(), + signers: convert_action.signers.clone(), + nonce, + }, + sig_chain_id_u64, + ); - let hash = to_sign.hyperliquid_signing_hash(&domain); let signature = self.signer.sign_order(hash).await?; let payload = ExchangeRequest { @@ -693,8 +730,6 @@ impl HyperliquidClient { action: serde_json::to_value(Actions::ConvertToMultiSigUser(convert_action))?, }; - println!("{}", serde_json::to_string(&payload).unwrap()); - let resp = self .client .post(format!("{}/exchange", Into::::into(self.network))) diff --git a/src/hl/exchange.rs b/src/hl/exchange.rs index 30a1619..fb10c93 100644 --- a/src/hl/exchange.rs +++ b/src/hl/exchange.rs @@ -2,14 +2,16 @@ use alloy::{ dyn_abi::Eip712Domain, hex::hex, primitives::{FixedBytes, U256, address, keccak256}, - sol, + sol as alloy_sol, sol_types::{SolStruct, eip712_domain}, }; +use hl_sol::sol; + use serde::{Deserialize, Serialize}; use crate::{ - ConvertToMultiSigUserRequest, HyperLiquidSigningHash, SendAssetRequest, + HyperLiquidSigningHash, errors::{Errors, Result}, hl::{SignedMessage, TransferRequest}, }; @@ -28,33 +30,43 @@ pub(crate) struct ExchangeRequest { } sol! { + #[multisig] #[derive(Serialize)] struct UsdClassTransfer { - string hyperliquidChain; - string amount; - bool toPerp; - uint64 nonce; + hyperliquidChain: string, + amount: string, + toPerp: bool, + nonce: uint64 } +} +sol! { + #[multisig] #[derive(Serialize)] struct SendAsset { - string hyperliquidChain; - string destination; - string sourceDex; - string destinationDex; - string token; - string amount; - string fromSubAccount; - uint64 nonce; + hyperliquidChain: string, + destination: string, + sourceDex: string, + destinationDex: string, + token: string, + amount: string, + fromSubAccount: string, + nonce: uint64 } +} - #[derive(Serialize,Debug)] - struct ConvertUserToMultiSig { - string hyperliquidChain; - string signers; - uint64 nonce; +sol! { + #[multisig] + #[derive(Serialize, Debug)] + struct ConvertToMultiSigUser { + hyperliquidChain: string, + signers: string, + nonce: uint64 } - #[derive(Serialize,Debug)] +} + +alloy_sol! { + #[derive(Serialize, Debug)] struct Agent { string source; bytes32 connectionId; @@ -67,117 +79,41 @@ impl HyperLiquidSigningHash for Agent { } } -#[derive(Clone)] -pub struct TransferClass -where - S: SolStruct, -{ - pub(crate) inner: S, - type_string: String, -} - -impl HyperLiquidSigningHash for TransferClass -where - S: SolStruct, -{ - fn hyperliquid_signing_hash(&self, domain: &Eip712Domain) -> FixedBytes<32> { - let type_hash = keccak256(self.type_string.as_bytes()); +pub fn hyperliquid_signing_hash( + type_str: String, + data: S, + domain: &Eip712Domain, +) -> FixedBytes<32> { + let type_hash = keccak256(type_str.as_bytes()); - let encoded_data = self.inner.eip712_encode_data(); + let encoded_data = data.eip712_encode_data(); - let mut struct_hash_input = Vec::new(); - struct_hash_input.extend_from_slice(type_hash.as_slice()); - struct_hash_input.extend_from_slice(&encoded_data); - let struct_hash: FixedBytes<32> = keccak256(&struct_hash_input); + let mut struct_hash_input = Vec::new(); + struct_hash_input.extend_from_slice(type_hash.as_slice()); + struct_hash_input.extend_from_slice(&encoded_data); + let struct_hash: FixedBytes<32> = keccak256(&struct_hash_input); - let mut signing_input = [0u8; 2 + 32 + 32]; - signing_input[0] = 0x19; - signing_input[1] = 0x01; - signing_input[2..34].copy_from_slice(domain.hash_struct().as_slice()); - signing_input[34..66].copy_from_slice(struct_hash.as_slice()); + let mut signing_input = [0u8; 2 + 32 + 32]; + signing_input[0] = 0x19; + signing_input[1] = 0x01; + signing_input[2..34].copy_from_slice(domain.hash_struct().as_slice()); + signing_input[34..66].copy_from_slice(struct_hash.as_slice()); - keccak256(signing_input) - } + keccak256(signing_input) } -pub fn generate_transfer_params( - req: &TransferRequest, -) -> Result<(TransferClass, Eip712Domain)> { - let hex_str = req.sig_chain_id.strip_prefix("0x").unwrap_or(&req.chain); - let chain_raw = hex::decode(hex_str)?; - let chain_id: u64 = U256::from_be_slice(chain_raw.as_slice()).try_into()?; - - Ok(( - TransferClass { - type_string: "HyperliquidTransaction:UsdClassTransfer(string hyperliquidChain,string amount,bool toPerp,uint64 nonce)".to_owned(), - inner: UsdClassTransfer { - hyperliquidChain: req.chain.clone(), - amount: req.amount.clone(), - toPerp: req.to_perp, - nonce: req.nonce, - }, - }, - eip712_domain! { - name : "HyperliquidSignTransaction", - version : "1", - chain_id : chain_id, - verifying_contract : address!("0x0000000000000000000000000000000000000000"), - }, - )) -} - -pub fn generate_send_asset_params( - req: &SendAssetRequest, -) -> Result<(TransferClass, Eip712Domain)> { - let hex_str = req.sig_chain_id.strip_prefix("0x").unwrap_or(&req.chain); - let chain_raw = hex::decode(hex_str)?; - let chain_id: u64 = U256::from_be_slice(chain_raw.as_slice()).try_into()?; - - Ok(( - TransferClass { - type_string: "HyperliquidTransaction:SendAsset(string hyperliquidChain,string destination,string sourceDex,string destinationDex,string token,string amount,string fromSubAccount,uint64 nonce)".to_owned(), - inner: SendAsset { - hyperliquidChain: req.chain.clone(), - destination:req.destination.clone(), - sourceDex: req.source_dex.clone(), - destinationDex: req.dst_dex.clone(), - token: req.token.clone(), - amount: req.amount.clone(), - fromSubAccount: req.from_sub_account.clone(), - nonce: req.nonce, - } - }, - eip712_domain! { - name : "HyperliquidSignTransaction", - version : "1", - chain_id : chain_id, - verifying_contract : address!("0x0000000000000000000000000000000000000000"), - }, - )) -} - -pub fn generate_convert_to_multi_sig_params( - req: &ConvertToMultiSigUserRequest, -) -> Result<(TransferClass, Eip712Domain)> { - let hex_str = req.sig_chain_id.strip_prefix("0x").unwrap_or(&req.chain); - let chain_raw = hex::decode(hex_str)?; - let chain_id: u64 = U256::from_be_slice(chain_raw.as_slice()).try_into()?; - Ok(( - TransferClass { - type_string: "HyperliquidTransaction:ConvertToMultiSigUser(string hyperliquidChain,string signers,uint64 nonce)".to_owned(), - inner: ConvertUserToMultiSig { - hyperliquidChain: req.chain.clone(), - signers: req.signers.clone(), - nonce: req.nonce, - } - }, - eip712_domain! { - name : "HyperliquidSignTransaction", - version : "1", - chain_id : chain_id, - verifying_contract : address!("0x0000000000000000000000000000000000000000"), - }, - )) +pub fn hyperliquid_signing_hash_with_default_domain( + type_str: String, + data: S, + sig_chain: u64, +) -> FixedBytes<32> { + let domain = eip712_domain! { + name : "HyperliquidSignTransaction", + version : "1", + chain_id : sig_chain, + verifying_contract : address!("0x0000000000000000000000000000000000000000"), + }; + hyperliquid_signing_hash(type_str, data, &domain) } pub fn generate_action_params( diff --git a/src/hl/utils.rs b/src/hl/utils.rs index e8a7bab..eef288a 100644 --- a/src/hl/utils.rs +++ b/src/hl/utils.rs @@ -1,3 +1,5 @@ +use crate::errors::Result; + #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Network { Mainnet, @@ -84,6 +86,17 @@ pub fn get_formatted_position_with_amount_raw( (px.to_string(), sz.to_string()) } +pub fn parse_chain_id(chain_id: &str) -> Result { + if chain_id.starts_with("0x") { + u64::from_str_radix(&chain_id[2..], 16) + } else if chain_id.chars().all(|c| c.is_ascii_hexdigit()) { + u64::from_str_radix(chain_id, 16) + } else { + chain_id.parse::() + } + .map_err(|e| anyhow::anyhow!("Invalid chain ID format: {}", e)) +} + #[cfg(test)] mod tests { use super::*; From b9a0542aad15c7d212bf0f991ed61964df28afda Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Wed, 3 Sep 2025 21:37:29 +0530 Subject: [PATCH 5/8] ft: fix msgpack order, wip multisig --- src/bin/multi_sig.rs | 25 ++++++-- src/hl/actions.rs | 49 ++++++++++++--- src/hl/client.rs | 141 +++++++++++++++++++++++++++++++++++++++++-- src/hl/exchange.rs | 49 ++++++++++++++- src/hl/message.rs | 18 ++++++ 5 files changed, 262 insertions(+), 20 deletions(-) diff --git a/src/bin/multi_sig.rs b/src/bin/multi_sig.rs index 94efb6a..5e642fd 100644 --- a/src/bin/multi_sig.rs +++ b/src/bin/multi_sig.rs @@ -1,3 +1,5 @@ +use std::str::FromStr; + use alloy::primitives::Address; use envconfig::Envconfig; use hyperqit::*; @@ -24,7 +26,6 @@ pub struct Config { #[tokio::main] async fn main() { tracing_subscriber::fmt() - .json() .with_env_filter( EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")), ) @@ -41,10 +42,26 @@ async fn main() { let user_address: Address = config.user_address.parse().unwrap(); - let executor = crate::HyperliquidClient::new(Network::Testnet, signer, user_address); + let executor = crate::HyperliquidClient::new( + Network::Testnet, + hyperqit::Signers::Local(user_b), + user_b_addr, + ); + + // executor + // .convert_to_multi_sig("0x01".to_string(), vec![user_a_addr, user_b_addr], 2) + // .await + // .unwrap(); + let multi_sig_user = Address::from_str("0x").unwrap(); executor - .convert_to_multi_sig("0x01".to_string(), vec![user_a_addr, user_b_addr], 2) + .multi_sig_usd_send( + 2, + Address::from_str("0x").unwrap(), + "0x66eee".to_string(), + vec![hyperqit::Signers::Local(user_a)], + multi_sig_user, + ) .await - .unwrap(); + .unwrap() } diff --git a/src/hl/actions.rs b/src/hl/actions.rs index fac848e..ad558d8 100644 --- a/src/hl/actions.rs +++ b/src/hl/actions.rs @@ -1,5 +1,7 @@ use serde::{Deserialize, Serialize}; +use crate::{SignedMessage, SignedMessageHex}; + #[derive(Deserialize, Serialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct OrderRequest { @@ -32,10 +34,10 @@ pub enum Order { #[derive(Deserialize, Serialize, Debug, Clone)] pub struct TransferRequest { - #[serde(rename = "hyperliquidChain")] - pub chain: String, #[serde(rename = "signatureChainId")] pub sig_chain_id: String, + #[serde(rename = "hyperliquidChain")] + pub chain: String, #[serde(rename = "amount")] pub amount: String, #[serde(rename = "toPerp")] @@ -50,11 +52,13 @@ pub struct TransferRequest { pub enum Actions { Order(BulkOrder), UsdClassTransfer(TransferRequest), + UsdSend(UsdSendRequest), Cancel(BulkCancel), UpdateLeverage(UpdateLeverage), PerpDeploy(PerpDeployAction), SendAsset(SendAssetRequest), ConvertToMultiSigUser(ConvertToMultiSigUserRequest), + MultiSig(MultiSigRequest), } #[derive(Serialize, Deserialize, Debug, Clone)] @@ -144,20 +148,20 @@ pub type SetFundingMultipliers = Vec<[String; 2]>; #[derive(Deserialize, Serialize, Debug, Clone)] pub struct SendAssetRequest { - #[serde(rename = "hyperliquidChain")] - pub chain: String, #[serde(rename = "signatureChainId")] pub sig_chain_id: String, + #[serde(rename = "hyperliquidChain")] + pub chain: String, #[serde(rename = "destination")] pub destination: String, #[serde(rename = "sourceDex")] pub source_dex: String, #[serde(rename = "destinationDex")] pub dst_dex: String, - #[serde(rename = "amount")] - pub amount: String, #[serde(rename = "token")] pub token: String, + #[serde(rename = "amount")] + pub amount: String, #[serde(rename = "fromSubAccount")] pub from_sub_account: String, #[serde(rename = "nonce")] @@ -167,10 +171,10 @@ pub struct SendAssetRequest { #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct ConvertToMultiSigUserRequest { - #[serde(rename = "hyperliquidChain")] - pub chain: String, #[serde(rename = "signatureChainId")] pub sig_chain_id: String, + #[serde(rename = "hyperliquidChain")] + pub chain: String, pub signers: String, pub nonce: u64, } @@ -181,3 +185,32 @@ pub struct MultiSigConfig { pub authorized_users: Vec, pub threshold: u64, } + +#[derive(Serialize, Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct UsdSendRequest { + #[serde(rename = "signatureChainId")] + pub sig_chain_id: String, + #[serde(rename = "hyperliquidChain")] + pub chain: String, + pub destination: String, + pub amount: String, + pub time: u64, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct MultiSigRequest { + #[serde(rename = "signatureChainId")] + pub sig_chain_id: String, + pub signatures: Vec, + pub payload: MultiSigPayload, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +#[serde(rename_all = "camelCase")] +pub struct MultiSigPayload { + pub multi_sig_user: String, + pub outer_signer: String, + pub action: Box, +} diff --git a/src/hl/client.rs b/src/hl/client.rs index 7fbe701..c1e3ffb 100644 --- a/src/hl/client.rs +++ b/src/hl/client.rs @@ -8,7 +8,9 @@ use alloy::primitives::{Address, FixedBytes}; use crate::errors::{Errors, Result}; use crate::hl::exchange::{ CONVERT_TO_MULTI_SIG_USER_TYPE, ConvertToMultiSigUser, ExchangeRequest, ExchangeResponse, - SEND_ASSET_TYPE, SendAsset, USD_CLASS_TRANSFER_TYPE, UsdClassTransfer, generate_action_params, + MultiSigSendAsset, MultiSigUsdClassTransfer, MultiSigUsdSend, SEND_ASSET_MULTISIG_TYPE, + SEND_ASSET_TYPE, SendAsset, USD_CLASS_TRANSFER_MULTISIG_TYPE, USD_CLASS_TRANSFER_TYPE, + USD_SEND_MULTISIG_TYPE, UsdClassTransfer, generate_action_params, generate_multi_sig_hash, hyperliquid_signing_hash_with_default_domain, }; use crate::hl::info::{GetInfoReq, PerpetualsInfo, SpotResponse}; @@ -21,9 +23,10 @@ use crate::hl::utils::*; use crate::hl::{Actions, TransferRequest}; use crate::{ BulkCancel, BulkOrder, CancelOrder, ConvertToMultiSigUserRequest, ExchangeOrderResponse, - GetHistoricalOrders, GetUserFills, GetUserOpenOrders, HyperLiquidSigningHash, MultiSigConfig, - Order, OrderRequest, PerpDeployAction, SendAssetRequest, Signers, UserFillsResponse, - UserOpenOrdersResponse, UserOrderHistoryResponse, + GetHistoricalOrders, GetUserFills, GetUserOpenOrders, HyperLiquidSigningHash, LocalWallet, + MultiSigConfig, MultiSigRequest, Order, OrderRequest, PerpDeployAction, SendAssetRequest, + SignedMessageHex, Signers, UsdSendRequest, UserFillsResponse, UserOpenOrdersResponse, + UserOrderHistoryResponse, }; #[async_trait] @@ -485,7 +488,7 @@ impl HyperliquidClient { debug!("transfer request: {:?}", transfer_req); - let hash = hyperliquid_signing_hash_with_default_domain( + let hash: FixedBytes<32> = hyperliquid_signing_hash_with_default_domain( USD_CLASS_TRANSFER_TYPE.to_owned(), UsdClassTransfer { hyperliquidChain: transfer_req.chain.clone(), @@ -541,7 +544,7 @@ impl HyperliquidClient { debug!("send asset request: {:?}", transfer_req); - let hash = hyperliquid_signing_hash_with_default_domain( + let hash: FixedBytes<32> = hyperliquid_signing_hash_with_default_domain( SEND_ASSET_TYPE.to_owned(), SendAsset { hyperliquidChain: transfer_req.chain.clone(), @@ -752,4 +755,130 @@ impl HyperliquidClient { Ok(()) } + + pub async fn multi_sig_usd_send( + &self, + amount: u64, + dst: Address, + sig_chain_id: String, + other_signers: Vec, + multi_sig_user: Address, + ) -> Result<()> { + debug!("transferring ${} USD to spot", amount); + let nonce = self.nonce_manager.get_next_nonce(); + + let transfer_req = TransferRequest { + chain: self.network.name(), + sig_chain_id: sig_chain_id.clone(), + amount: amount.to_string(), + to_perp: false, + nonce, + }; + + // action = { + // "type": "sendAsset", + // "destination": destination, + // "sourceDex": source_dex, + // "destinationDex": destination_dex, + // "token": token, + // "amount": str_amount, + // "fromSubAccount": self.vault_address if self.vault_address else "", + // "nonce": timestamp, + // } + // let transfer_req = SendAssetRequest { + // chain: self.network.name(), + // sig_chain_id: sig_chain_id.clone(), + // destination: multi_sig_user.to_string(), + // source_dex: "".to_string(), + // dst_dex: "dex".to_string(), + // amount: "2".to_string(), + // token: "USDC".to_string(), + // from_sub_account: "".to_string(), + // nonce: nonce, + // }; + + let sig_chain_id_u64 = parse_chain_id(&transfer_req.sig_chain_id)?; + + debug!("transfer request: {:?}", transfer_req); + + // let transfer_data = MultiSigSendAsset { + // hyperliquidChain: transfer_req.chain.clone(), + // payloadMultiSigUser: multi_sig_user, + // outerSigner: self.user, + // nonce, + // destination: multi_sig_user.to_string(), + // sourceDex: "".to_string(), + // destinationDex: "hybet".to_string(), + // token: "USDC".to_string(), + // amount: "2".to_string(), + // fromSubAccount: "".to_string(), + // }; + let transfer_data = MultiSigUsdClassTransfer { + hyperliquidChain: transfer_req.chain.clone(), + payloadMultiSigUser: multi_sig_user, + outerSigner: self.user, + amount: amount.to_string(), + toPerp: false, + nonce, + }; + let hash = hyperliquid_signing_hash_with_default_domain( + USD_CLASS_TRANSFER_MULTISIG_TYPE.to_owned(), + transfer_data.clone(), + sig_chain_id_u64, + ); + + let leader_signature = self.signer.sign_order(hash).await?; + let mut signatures: Vec = vec![leader_signature.into()]; + + for other in other_signers { + let other_sig = other.sign_order(hash).await?; + signatures.push(other_sig.into()); + } + + let multi_sig_payload = MultiSigRequest { + sig_chain_id, + signatures, + payload: crate::MultiSigPayload { + multi_sig_user: multi_sig_user.to_string().to_lowercase(), + outer_signer: self.user.to_string().to_lowercase(), + action: Box::new(Actions::UsdClassTransfer(transfer_req)), + }, + }; + + let sig_hash = generate_multi_sig_hash(multi_sig_payload.clone(), self.network, nonce)?; + let leader_outer_signature = self.signer.sign_order(sig_hash).await?; + + let payload = ExchangeRequest { + nonce, + signature: leader_outer_signature, + action: serde_json::to_value(Actions::MultiSig(multi_sig_payload))?, + }; + + debug!( + "transfer payload: {}", + serde_json::to_string(&payload).unwrap() + ); + + let resp = self + .client + .post(format!("{}/exchange", Into::::into(self.network))) + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to transfer USD: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + let out: ExchangeResponse = serde_json::from_str(body.as_str())?; + debug!("transfer response: {:?}", out); + if out.status != *"ok" { + return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); + } + + Ok(()) + } } diff --git a/src/hl/exchange.rs b/src/hl/exchange.rs index fb10c93..d9920f9 100644 --- a/src/hl/exchange.rs +++ b/src/hl/exchange.rs @@ -11,9 +11,10 @@ use hl_sol::sol; use serde::{Deserialize, Serialize}; use crate::{ - HyperLiquidSigningHash, + HyperLiquidSigningHash, MultiSigRequest, Network, errors::{Errors, Result}, - hl::{SignedMessage, TransferRequest}, + hl::SignedMessage, + parse_chain_id, }; #[derive(Debug, Clone, Serialize, Deserialize)] @@ -55,6 +56,26 @@ sol! { } } +sol! { + #[multisig] + #[derive(Serialize)] + struct UsdSend { + hyperliquidChain: string, + destination: string, + amount: string, + time: uint64 + } +} + +sol! { + #[derive(Serialize)] + struct SendMultiSig { + hyperliquidChain: string, + multiSigActionHash: bytes32, + nonce: uint64 + } +} + sol! { #[multisig] #[derive(Serialize, Debug)] @@ -116,6 +137,30 @@ pub fn hyperliquid_signing_hash_with_default_domain( hyperliquid_signing_hash(type_str, data, &domain) } +pub fn generate_multi_sig_hash( + payload: MultiSigRequest, + chain: Network, + nonce: u64, +) -> Result> { + let sig_chain_id_u64 = parse_chain_id(&payload.sig_chain_id)?; + let out = serde_json::to_string(&payload)?; + let mut bytes = + rmp_serde::to_vec_named(&payload).map_err(|e| Errors::AgentSignature(e.to_string()))?; + bytes.extend(nonce.to_be_bytes()); + bytes.push(0); + let out: FixedBytes<32> = keccak256(bytes.clone()); + + Ok(hyperliquid_signing_hash_with_default_domain( + SEND_MULTI_SIG_TYPE.to_owned(), + SendMultiSig { + hyperliquidChain: chain.name(), + multiSigActionHash: out, + nonce, + }, + sig_chain_id_u64, + )) +} + pub fn generate_action_params( action: &crate::Actions, is_mainnet: bool, diff --git a/src/hl/message.rs b/src/hl/message.rs index 68978b9..9d597fc 100644 --- a/src/hl/message.rs +++ b/src/hl/message.rs @@ -1,8 +1,26 @@ use alloy::primitives::U256; use serde::{Deserialize, Serialize}; + #[derive(Debug, Serialize, Deserialize, Clone)] pub struct SignedMessage { pub r: U256, pub s: U256, pub v: u64, } + +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct SignedMessageHex { + pub r: String, + pub s: String, + pub v: u64, +} + +impl From for SignedMessageHex { + fn from(signed_msg: SignedMessage) -> Self { + SignedMessageHex { + r: format!("0x{:x}", signed_msg.r), + s: format!("0x{:x}", signed_msg.s), + v: signed_msg.v, + } + } +} From 14425a8a2a0143923d8913ab44fa3a89db9c090e Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Thu, 4 Sep 2025 00:40:03 +0530 Subject: [PATCH 6/8] ft: preserve order and add l1 aciton --- Cargo.lock | 193 ++++++++++++++++++++++++------------------- Cargo.toml | 2 +- src/bin/multi_sig.rs | 10 ++- src/hl/client.rs | 83 ++++++++++++++++++- src/hl/exchange.rs | 42 +++++++++- 5 files changed, 233 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 432803a..3523b7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -328,7 +328,7 @@ dependencies = [ "derive_more 2.0.1", "foldhash", "hashbrown 0.15.3", - "indexmap 2.9.0", + "indexmap 2.11.0", "itoa", "k256", "keccak-asm", @@ -536,7 +536,7 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.9.0", + "indexmap 2.11.0", "proc-macro-error2", "proc-macro2", "quote", @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -685,33 +685,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.8" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6680de5231bd6ee4c6191b8a1325daa282b415391ec9d3a37bd34f2060dc73fa" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", "once_cell_polyfill", @@ -935,9 +935,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-lc-rs" -version = "1.13.1" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fcc8f365936c834db5514fc45aee5b1202d677e6b40e48468aaaa8183ca8c7" +checksum = "5c953fe1ba023e6b7730c0d4b031d06f267f23a46167dcbd40316644b10a17ba" dependencies = [ "aws-lc-sys", "zeroize", @@ -945,9 +945,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b1d86e7705efe1be1b569bab41d4fa1e14e220b60a160f78de2db687add079" +checksum = "dbfd150b5dbdb988bcc8fb1fe787eb6b7ee6180ca24da683b61ea5405f3d43ff" dependencies = [ "bindgen", "cc", @@ -1070,7 +1070,7 @@ dependencies = [ "bitflags 2.9.1", "cexpr", "clang-sys", - "itertools 0.11.0", + "itertools 0.10.5", "lazy_static", "lazycell", "log", @@ -1199,9 +1199,9 @@ checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" -version = "1.23.1" +version = "1.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" +checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" [[package]] name = "byteorder" @@ -1261,9 +1261,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.10" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" +checksum = "dd0b03af37dad7a14518b7691d81acb0f8222604ad3d1b02f6b4bed5188c0cd5" dependencies = [ "serde", ] @@ -1414,9 +1414,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "const-hex" @@ -1526,9 +1526,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -2327,9 +2327,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", @@ -2588,9 +2588,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" dependencies = [ "bytes", "fnv", @@ -2598,7 +2598,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.9.0", + "indexmap 2.11.0", "slab", "tokio", "tokio-util", @@ -2617,7 +2617,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.9.0", + "indexmap 2.11.0", "slab", "tokio", "tokio-util", @@ -2780,9 +2780,9 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpclient" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bc56de07c8ff3c4475648d6817557d8197ec8fb1c02675f7375d8b5a6bf9c86" +checksum = "bfddb8dd62e1a7f453e8efd0c812158392043cd345614fb0bf9889bc7261776b" dependencies = [ "async-trait", "bytes", @@ -2795,9 +2795,10 @@ dependencies = [ "hyper 1.6.0", "hyper-rustls 0.27.6", "hyper-util", - "indexmap 2.9.0", + "indexmap 2.11.0", "rand 0.9.1", "regex", + "rustls 0.23.27", "serde", "serde_json", "serde_qs", @@ -2823,7 +2824,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2 0.3.27", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -3103,12 +3104,13 @@ dependencies = [ [[package]] name = "image" -version = "0.25.6" +version = "0.25.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" dependencies = [ "bytemuck", "byteorder-lite", + "moxcms", "num-traits", ] @@ -3152,9 +3154,9 @@ dependencies = [ [[package]] name = "indenter" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" [[package]] name = "indexmap" @@ -3169,9 +3171,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" dependencies = [ "equivalent", "hashbrown 0.15.3", @@ -3253,9 +3255,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a194df1107f33c79f4f93d02c80798520551949d59dfad22b6157048a88cca93" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" dependencies = [ "jiff-static", "log", @@ -3266,9 +3268,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6e1db7ed32c6c71b759497fae34bf7933636f75a251b9e736555da426f6442" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" dependencies = [ "proc-macro2", "quote", @@ -3277,9 +3279,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ "getrandom 0.3.3", "libc", @@ -3409,12 +3411,13 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" dependencies = [ "bitflags 2.9.1", "libc", + "redox_syscall", ] [[package]] @@ -3474,7 +3477,7 @@ dependencies = [ "sha-1", "sha2", "sysinfo", - "uuid 1.17.0", + "uuid 1.18.1", "whoami", "winreg 0.11.0", "wmi", @@ -3554,6 +3557,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "moxcms" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08" +dependencies = [ + "num-traits", + "pxfm", +] + [[package]] name = "native-tls" version = "0.2.14" @@ -3917,7 +3930,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.9.0", + "indexmap 2.11.0", ] [[package]] @@ -4022,9 +4035,9 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portable-atomic-util" @@ -4067,9 +4080,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.33" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" dependencies = [ "proc-macro2", "syn 2.0.101", @@ -4149,6 +4162,15 @@ dependencies = [ "unarray", ] +[[package]] +name = "pxfm" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e790881194f6f6e86945f0a42a6981977323669aeb6c40e9c7ec253133b96f8" +dependencies = [ + "num-traits", +] + [[package]] name = "qrcode" version = "0.14.1" @@ -4258,9 +4280,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -4268,9 +4290,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -4278,9 +4300,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.12" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ "bitflags 2.9.1", ] @@ -4351,7 +4373,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", + "h2 0.3.27", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.32", @@ -4652,7 +4674,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.2.0", + "security-framework 3.3.0", ] [[package]] @@ -4849,9 +4871,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c" dependencies = [ "bitflags 2.9.1", "core-foundation 0.10.1", @@ -4935,6 +4957,7 @@ version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ + "indexmap 2.11.0", "itoa", "memchr", "ryu", @@ -4964,9 +4987,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -4993,7 +5016,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.9.0", + "indexmap 2.11.0", "serde", "serde_derive", "serde_json", @@ -5093,9 +5116,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.5" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -5543,9 +5566,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -5696,7 +5719,7 @@ version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.11.0", "serde", "serde_spanned", "toml_datetime", @@ -5706,9 +5729,9 @@ dependencies = [ [[package]] name = "toml_write" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "tower" @@ -5986,9 +6009,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.17.0" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ "getrandom 0.3.3", "js-sys", @@ -6177,11 +6200,11 @@ dependencies = [ [[package]] name = "whoami" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" dependencies = [ - "redox_syscall", + "libredox", "wasite", "web-sys", ] @@ -6204,9 +6227,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "0978bf7171b3d90bac376700cb56d606feb40f251a475a5d6634613564460b22" dependencies = [ "windows-sys 0.59.0", ] @@ -6601,9 +6624,9 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "ws_stream_wasm" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" +checksum = "6c173014acad22e83f16403ee360115b38846fe754e735c5d9d3803fe70c6abc" dependencies = [ "async_io_stream", "futures", @@ -6612,7 +6635,7 @@ dependencies = [ "pharos", "rustc_version 0.4.1", "send_wrapper 0.6.0", - "thiserror 1.0.69", + "thiserror 2.0.12", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", diff --git a/Cargo.toml b/Cargo.toml index e02a2cd..b047d1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ qrcode = "0.14.1" reqwest = "0.12.19" rmp-serde = "1.3.0" serde = "1.0.219" -serde_json = "1.0.140" +serde_json = { version = "1.0.140", features = ["preserve_order"] } thiserror = "2.0.12" tokio = "1.45.1" tokio-tungstenite = {version = "0.26.2",features = ["native-tls"] } diff --git a/src/bin/multi_sig.rs b/src/bin/multi_sig.rs index 5e642fd..08211d3 100644 --- a/src/bin/multi_sig.rs +++ b/src/bin/multi_sig.rs @@ -55,13 +55,15 @@ async fn main() { let multi_sig_user = Address::from_str("0x").unwrap(); executor - .multi_sig_usd_send( - 2, - Address::from_str("0x").unwrap(), + .multi_sig_l1_action( + Actions::PerpDeploy(PerpDeployAction::HaltTrading(HaltTrading { + coin: "dex:COIN".to_string(), + is_halted: true, + })), "0x66eee".to_string(), vec![hyperqit::Signers::Local(user_a)], multi_sig_user, ) .await - .unwrap() + .unwrap(); } diff --git a/src/hl/client.rs b/src/hl/client.rs index c1e3ffb..4efc4b5 100644 --- a/src/hl/client.rs +++ b/src/hl/client.rs @@ -1,5 +1,6 @@ use anyhow::Ok; use async_trait::async_trait; + use std::time::SystemTime; use tracing::{debug, error, info}; @@ -11,7 +12,7 @@ use crate::hl::exchange::{ MultiSigSendAsset, MultiSigUsdClassTransfer, MultiSigUsdSend, SEND_ASSET_MULTISIG_TYPE, SEND_ASSET_TYPE, SendAsset, USD_CLASS_TRANSFER_MULTISIG_TYPE, USD_CLASS_TRANSFER_TYPE, USD_SEND_MULTISIG_TYPE, UsdClassTransfer, generate_action_params, generate_multi_sig_hash, - hyperliquid_signing_hash_with_default_domain, + generate_multi_sig_l1_hash, hyperliquid_signing_hash_with_default_domain, }; use crate::hl::info::{GetInfoReq, PerpetualsInfo, SpotResponse}; use crate::hl::message::SignedMessage; @@ -24,9 +25,9 @@ use crate::hl::{Actions, TransferRequest}; use crate::{ BulkCancel, BulkOrder, CancelOrder, ConvertToMultiSigUserRequest, ExchangeOrderResponse, GetHistoricalOrders, GetUserFills, GetUserOpenOrders, HyperLiquidSigningHash, LocalWallet, - MultiSigConfig, MultiSigRequest, Order, OrderRequest, PerpDeployAction, SendAssetRequest, - SignedMessageHex, Signers, UsdSendRequest, UserFillsResponse, UserOpenOrdersResponse, - UserOrderHistoryResponse, + MultiSigConfig, MultiSigPayload, MultiSigRequest, Order, OrderRequest, PerpDeployAction, + SendAssetRequest, SignedMessageHex, Signers, UsdSendRequest, UserFillsResponse, + UserOpenOrdersResponse, UserOrderHistoryResponse, }; #[async_trait] @@ -881,4 +882,78 @@ impl HyperliquidClient { Ok(()) } + + pub async fn multi_sig_l1_action( + &self, + action: Actions, + sig_chain_id: String, + other_signers: Vec, + multi_sig_user: Address, + ) -> Result<()> { + debug!("sending multi sig l1 action {:?}", action.clone()); + + let nonce = self.nonce_manager.get_next_nonce(); + + let is_mainnet = self.network == Network::Mainnet; + let hash = generate_multi_sig_l1_hash( + &action, + multi_sig_user.to_string(), + self.user.to_string(), + is_mainnet, + nonce, + )?; + + let leader_signature = self.signer.sign_order(hash).await?; + let mut signatures: Vec = vec![leader_signature.into()]; + + for other in other_signers { + let other_sig = other.sign_order(hash).await?; + signatures.push(other_sig.into()); + } + + let multi_sig_payload: MultiSigRequest = MultiSigRequest { + sig_chain_id, + signatures, + payload: MultiSigPayload { + multi_sig_user: multi_sig_user.to_string().to_lowercase(), + outer_signer: self.user.to_string().to_lowercase(), + action: Box::new(action), // This returns IndexMap + }, + }; + + let sig_hash = generate_multi_sig_hash(multi_sig_payload.clone(), self.network, nonce)?; + let leader_outer_signature = self.signer.sign_order(sig_hash).await?; + + let payload = ExchangeRequest { + nonce, + signature: leader_outer_signature, + action: serde_json::to_value(Actions::MultiSig(multi_sig_payload))?, + }; + + debug!( + "transfer payload: {}", + serde_json::to_string(&payload).unwrap() + ); + + let resp = self + .client + .post(format!("{}/exchange", Into::::into(self.network))) + .json(&payload) + .send() + .await?; + + let status_code = resp.status().as_u16(); + let body = resp.text().await?; + if status_code != 200 { + error!("failed to transfer USD: {} - {}", status_code, body); + return Err(Errors::HyperLiquidApiError(status_code, body).into()); + } + + let out: ExchangeResponse = serde_json::from_str(body.as_str())?; + debug!("transfer response: {:?}", out); + if out.status != *"ok" { + return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); + } + Ok(()) + } } diff --git a/src/hl/exchange.rs b/src/hl/exchange.rs index d9920f9..f25fd56 100644 --- a/src/hl/exchange.rs +++ b/src/hl/exchange.rs @@ -8,10 +8,12 @@ use alloy::{ use hl_sol::sol; +use reqwest::redirect::Action; use serde::{Deserialize, Serialize}; +use serde_json::Value; use crate::{ - HyperLiquidSigningHash, MultiSigRequest, Network, + Actions, HyperLiquidSigningHash, MultiSigRequest, Network, errors::{Errors, Result}, hl::SignedMessage, parse_chain_id, @@ -143,13 +145,12 @@ pub fn generate_multi_sig_hash( nonce: u64, ) -> Result> { let sig_chain_id_u64 = parse_chain_id(&payload.sig_chain_id)?; - let out = serde_json::to_string(&payload)?; let mut bytes = rmp_serde::to_vec_named(&payload).map_err(|e| Errors::AgentSignature(e.to_string()))?; bytes.extend(nonce.to_be_bytes()); bytes.push(0); - let out: FixedBytes<32> = keccak256(bytes.clone()); + let out: FixedBytes<32> = keccak256(bytes.clone()); Ok(hyperliquid_signing_hash_with_default_domain( SEND_MULTI_SIG_TYPE.to_owned(), SendMultiSig { @@ -161,6 +162,41 @@ pub fn generate_multi_sig_hash( )) } +pub fn generate_multi_sig_l1_hash( + action: &crate::Actions, + payload_multi_sig_user: String, + outer_signer: String, + is_mainnet: bool, + nonce: u64, +) -> Result> { + let envelope = vec![ + serde_json::Value::String(payload_multi_sig_user.to_lowercase()), + serde_json::Value::String(outer_signer.to_lowercase()), + serde_json::to_value(action)?, // Convert action to Value + ]; + + let mut bytes = + rmp_serde::to_vec(&envelope).map_err(|e| Errors::AgentSignature(e.to_string()))?; + + bytes.extend(nonce.to_be_bytes()); + bytes.push(0); + let out: FixedBytes<32> = keccak256(bytes.clone()); + let source = if is_mainnet { "a" } else { "b" }.to_string(); + let data = Agent { + source, + connectionId: out, + }; + + let domain = eip712_domain! { + name: "Exchange", + version: "1", + chain_id: 1337, + verifying_contract: address!("0x0000000000000000000000000000000000000000"), + }; + + Ok(data.eip712_signing_hash(&domain)) +} + pub fn generate_action_params( action: &crate::Actions, is_mainnet: bool, From b13cf7bb31a0180b254c65a69648e08e109eb89a Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Thu, 4 Sep 2025 01:48:03 +0530 Subject: [PATCH 7/8] ft: rf multi sig flow --- src/bin/multi_sig.rs | 60 ++++++-- src/hl/client.rs | 337 ++++++++++++++++++++++++++++++------------- src/signer/mod.rs | 2 + 3 files changed, 293 insertions(+), 106 deletions(-) diff --git a/src/bin/multi_sig.rs b/src/bin/multi_sig.rs index 08211d3..29fe066 100644 --- a/src/bin/multi_sig.rs +++ b/src/bin/multi_sig.rs @@ -16,6 +16,9 @@ pub struct Config { #[envconfig(from = "PRIVATE_KEY_B")] pub private_key_b: String, + #[envconfig(from = "MULTI_SIG_ADDRESS")] + pub multi_sig: String, + #[envconfig(from = "RUST_LOG")] pub log_level: String, @@ -42,26 +45,65 @@ async fn main() { let user_address: Address = config.user_address.parse().unwrap(); + let multi_sig_user = Address::from_str(&config.multi_sig).unwrap(); + + let core_executor = crate::HyperliquidClient::new(Network::Testnet, signer, multi_sig_user); + core_executor + .convert_to_multi_sig("0x66eee".to_string(), vec![user_a_addr, user_b_addr], 2) + .await + .unwrap(); + let executor = crate::HyperliquidClient::new( Network::Testnet, hyperqit::Signers::Local(user_b), user_b_addr, ); + executor + .multi_sig_usd_class_transfer( + 1, + false, + "0x66eee".to_string(), + vec![hyperqit::Signers::Local(user_a.clone())], + multi_sig_user, + ) + .await + .unwrap(); + + executor + .multi_sig_send_asset( + user_a_addr, + "dex".to_string(), + "".to_string(), + "USDC".to_string(), + "2.0".to_string(), + None, + "0x66eee".to_string(), + vec![hyperqit::Signers::Local(user_a.clone())], + multi_sig_user, + ) + .await + .unwrap(); - // executor - // .convert_to_multi_sig("0x01".to_string(), vec![user_a_addr, user_b_addr], 2) - // .await - // .unwrap(); - let multi_sig_user = Address::from_str("0x").unwrap(); + executor + .multi_sig_usd_send( + user_a_addr, + "2.0".to_string(), + "0x66eee".to_string(), + vec![hyperqit::Signers::Local(user_a.clone())], + multi_sig_user, + ) + .await + .unwrap(); executor .multi_sig_l1_action( - Actions::PerpDeploy(PerpDeployAction::HaltTrading(HaltTrading { - coin: "dex:COIN".to_string(), - is_halted: true, + Actions::PerpDeploy(PerpDeployAction::SetOracle(SetOracle { + dex: "dex".to_string(), + oracle_pxs: vec![["dex:COIN".to_string(), "69.69".to_string()]], + mark_pxs: vec![], })), "0x66eee".to_string(), - vec![hyperqit::Signers::Local(user_a)], + vec![hyperqit::Signers::Local(user_a.clone())], multi_sig_user, ) .await diff --git a/src/hl/client.rs b/src/hl/client.rs index 4efc4b5..7b63833 100644 --- a/src/hl/client.rs +++ b/src/hl/client.rs @@ -1,3 +1,4 @@ +use alloy::sol_types::SolStruct; use anyhow::Ok; use async_trait::async_trait; @@ -8,11 +9,12 @@ use alloy::primitives::{Address, FixedBytes}; use crate::errors::{Errors, Result}; use crate::hl::exchange::{ - CONVERT_TO_MULTI_SIG_USER_TYPE, ConvertToMultiSigUser, ExchangeRequest, ExchangeResponse, - MultiSigSendAsset, MultiSigUsdClassTransfer, MultiSigUsdSend, SEND_ASSET_MULTISIG_TYPE, - SEND_ASSET_TYPE, SendAsset, USD_CLASS_TRANSFER_MULTISIG_TYPE, USD_CLASS_TRANSFER_TYPE, - USD_SEND_MULTISIG_TYPE, UsdClassTransfer, generate_action_params, generate_multi_sig_hash, - generate_multi_sig_l1_hash, hyperliquid_signing_hash_with_default_domain, + CONVERT_TO_MULTI_SIG_USER_MULTISIG_TYPE, CONVERT_TO_MULTI_SIG_USER_TYPE, ConvertToMultiSigUser, + ExchangeRequest, ExchangeResponse, MultiSigConvertToMultiSigUser, MultiSigSendAsset, + MultiSigUsdClassTransfer, MultiSigUsdSend, SEND_ASSET_MULTISIG_TYPE, SEND_ASSET_TYPE, + SendAsset, USD_CLASS_TRANSFER_MULTISIG_TYPE, USD_CLASS_TRANSFER_TYPE, USD_SEND_MULTISIG_TYPE, + UsdClassTransfer, generate_action_params, generate_multi_sig_hash, generate_multi_sig_l1_hash, + hyperliquid_signing_hash_with_default_domain, }; use crate::hl::info::{GetInfoReq, PerpetualsInfo, SpotResponse}; use crate::hl::message::SignedMessage; @@ -757,106 +759,264 @@ impl HyperliquidClient { Ok(()) } - pub async fn multi_sig_usd_send( + async fn execute_chain_multi_sig_action( + &self, + nonce: u64, + action: Actions, + multisig_payload: T, + sig_type: String, + sig_chain_id: String, + other_signers: Vec, + multi_sig_user: Address, + ) -> Result<()> { + let sig_chain_id_u64 = parse_chain_id(&sig_chain_id)?; + + // Generate inner hash for the multi-sig payload + let inner_hash = hyperliquid_signing_hash_with_default_domain( + sig_type, + multisig_payload, + sig_chain_id_u64, + ); + + // Collect signatures from leader and other signers + let leader_signature = self.signer.sign_order(inner_hash).await?; + let mut signatures: Vec = vec![leader_signature.into()]; + + for other_signer in other_signers { + let other_sig = other_signer.sign_order(inner_hash).await?; + signatures.push(other_sig.into()); + } + + // Create multi-sig request + let multi_sig_payload = MultiSigRequest { + sig_chain_id, + signatures, + payload: MultiSigPayload { + multi_sig_user: multi_sig_user.to_string().to_lowercase(), + outer_signer: self.user.to_string().to_lowercase(), + action: Box::new(action), + }, + }; + + // Generate outer signature hash and sign + let outer_hash = generate_multi_sig_hash(multi_sig_payload.clone(), self.network, nonce)?; + let leader_outer_signature = self.signer.sign_order(outer_hash).await?; + + // Send the request + let payload = ExchangeRequest { + nonce, + signature: leader_outer_signature, + action: serde_json::to_value(Actions::MultiSig(multi_sig_payload))?, + }; + + self.send_exchange_request(payload).await + } + + /// Multi-sig USD class transfer (spot <-> perp) + pub async fn multi_sig_usd_class_transfer( &self, amount: u64, - dst: Address, + to_perp: bool, sig_chain_id: String, other_signers: Vec, multi_sig_user: Address, ) -> Result<()> { - debug!("transferring ${} USD to spot", amount); + debug!( + "multi-sig USD class transfer: ${} {} for user {}", + amount, + if to_perp { "to perp" } else { "to spot" }, + multi_sig_user + ); + let nonce = self.nonce_manager.get_next_nonce(); let transfer_req = TransferRequest { chain: self.network.name(), sig_chain_id: sig_chain_id.clone(), amount: amount.to_string(), - to_perp: false, + to_perp, nonce, }; - // action = { - // "type": "sendAsset", - // "destination": destination, - // "sourceDex": source_dex, - // "destinationDex": destination_dex, - // "token": token, - // "amount": str_amount, - // "fromSubAccount": self.vault_address if self.vault_address else "", - // "nonce": timestamp, - // } - // let transfer_req = SendAssetRequest { - // chain: self.network.name(), - // sig_chain_id: sig_chain_id.clone(), - // destination: multi_sig_user.to_string(), - // source_dex: "".to_string(), - // dst_dex: "dex".to_string(), - // amount: "2".to_string(), - // token: "USDC".to_string(), - // from_sub_account: "".to_string(), - // nonce: nonce, - // }; - - let sig_chain_id_u64 = parse_chain_id(&transfer_req.sig_chain_id)?; - - debug!("transfer request: {:?}", transfer_req); - - // let transfer_data = MultiSigSendAsset { - // hyperliquidChain: transfer_req.chain.clone(), - // payloadMultiSigUser: multi_sig_user, - // outerSigner: self.user, - // nonce, - // destination: multi_sig_user.to_string(), - // sourceDex: "".to_string(), - // destinationDex: "hybet".to_string(), - // token: "USDC".to_string(), - // amount: "2".to_string(), - // fromSubAccount: "".to_string(), - // }; - let transfer_data = MultiSigUsdClassTransfer { + let multisig_transfer_data = MultiSigUsdClassTransfer { hyperliquidChain: transfer_req.chain.clone(), payloadMultiSigUser: multi_sig_user, outerSigner: self.user, - amount: amount.to_string(), - toPerp: false, + amount: transfer_req.amount.clone(), + toPerp: to_perp, nonce, }; - let hash = hyperliquid_signing_hash_with_default_domain( + + self.execute_chain_multi_sig_action( + nonce, + Actions::UsdClassTransfer(transfer_req), + multisig_transfer_data, USD_CLASS_TRANSFER_MULTISIG_TYPE.to_owned(), - transfer_data.clone(), - sig_chain_id_u64, + sig_chain_id, + other_signers, + multi_sig_user, + ) + .await + } + + /// Multi-sig send asset between DEXs + pub async fn multi_sig_send_asset( + &self, + destination: Address, + source_dex: String, + destination_dex: String, + token: String, + amount: String, + from_sub_account: Option, + sig_chain_id: String, + other_signers: Vec, + multi_sig_user: Address, + ) -> Result<()> { + debug!( + "multi-sig send asset: {} {} from {} to {} (destination: {})", + amount, token, source_dex, destination_dex, destination ); - let leader_signature = self.signer.sign_order(hash).await?; - let mut signatures: Vec = vec![leader_signature.into()]; + let nonce = self.nonce_manager.get_next_nonce(); - for other in other_signers { - let other_sig = other.sign_order(hash).await?; - signatures.push(other_sig.into()); - } + let send_asset_req = SendAssetRequest { + chain: self.network.name(), + sig_chain_id: sig_chain_id.clone(), + destination: destination.to_string(), + source_dex, + dst_dex: destination_dex.clone(), + token: token.clone(), + amount: amount.clone(), + from_sub_account: from_sub_account.unwrap_or_default(), + nonce, + }; - let multi_sig_payload = MultiSigRequest { + let multisig_send_data = MultiSigSendAsset { + hyperliquidChain: send_asset_req.chain.clone(), + payloadMultiSigUser: multi_sig_user, + outerSigner: self.user, + destination: send_asset_req.destination.clone(), + sourceDex: send_asset_req.source_dex.clone(), + destinationDex: send_asset_req.dst_dex.clone(), + token: send_asset_req.token.clone(), + amount: send_asset_req.amount.clone(), + fromSubAccount: send_asset_req.from_sub_account.clone(), + nonce, + }; + + self.execute_chain_multi_sig_action( + nonce, + Actions::SendAsset(send_asset_req), + multisig_send_data, + SEND_ASSET_MULTISIG_TYPE.to_owned(), sig_chain_id, - signatures, - payload: crate::MultiSigPayload { - multi_sig_user: multi_sig_user.to_string().to_lowercase(), - outer_signer: self.user.to_string().to_lowercase(), - action: Box::new(Actions::UsdClassTransfer(transfer_req)), - }, + other_signers, + multi_sig_user, + ) + .await + } + + /// Multi-sig USD send (L1 withdrawal) + pub async fn multi_sig_usd_send( + &self, + destination: Address, + amount: String, + sig_chain_id: String, + other_signers: Vec, + multi_sig_user: Address, + ) -> Result<()> { + debug!( + "multi-sig USD send: ${} to {} for user {}", + amount, destination, multi_sig_user + ); + + let nonce = self.nonce_manager.get_next_nonce(); + + let usd_send_req = UsdSendRequest { + chain: self.network.name(), + sig_chain_id: sig_chain_id.clone(), + destination: destination.to_string(), + amount: amount.clone(), + time: nonce, }; - let sig_hash = generate_multi_sig_hash(multi_sig_payload.clone(), self.network, nonce)?; - let leader_outer_signature = self.signer.sign_order(sig_hash).await?; + let multisig_usd_send_data = MultiSigUsdSend { + hyperliquidChain: usd_send_req.chain.clone(), + payloadMultiSigUser: multi_sig_user, + outerSigner: self.user, + destination: usd_send_req.destination.clone(), + amount: usd_send_req.amount.clone(), + time: nonce, + }; - let payload = ExchangeRequest { + self.execute_chain_multi_sig_action( + nonce, + Actions::UsdSend(usd_send_req), + multisig_usd_send_data, + USD_SEND_MULTISIG_TYPE.to_owned(), + sig_chain_id, + other_signers, + multi_sig_user, + ) + .await + } + + /// Multi-sig convert to multi-sig user + pub async fn multi_sig_convert_to_multisig_user( + &self, + signers: Vec
, + threshold: u64, + sig_chain_id: String, + other_signers: Vec, + multi_sig_user: Address, + ) -> Result<()> { + debug!( + "multi-sig convert to multisig user: {} signers, threshold {}", + signers.len(), + threshold + ); + + let mut sorted_signers = signers; + sorted_signers.sort(); + + let nonce = self.nonce_manager.get_next_nonce(); + + let config_str = serde_json::to_string(&MultiSigConfig { + authorized_users: sorted_signers.iter().map(|s| s.to_string()).collect(), + threshold, + })?; + + let convert_req = ConvertToMultiSigUserRequest { + sig_chain_id: sig_chain_id.clone(), + chain: self.network.name(), + signers: config_str.clone(), nonce, - signature: leader_outer_signature, - action: serde_json::to_value(Actions::MultiSig(multi_sig_payload))?, }; + let multisig_convert_data = MultiSigConvertToMultiSigUser { + hyperliquidChain: convert_req.chain.clone(), + payloadMultiSigUser: multi_sig_user, + outerSigner: self.user, + signers: config_str, + nonce, + }; + + self.execute_chain_multi_sig_action( + nonce, + Actions::ConvertToMultiSigUser(convert_req), + multisig_convert_data, + CONVERT_TO_MULTI_SIG_USER_MULTISIG_TYPE.to_owned(), + sig_chain_id, + other_signers, + multi_sig_user, + ) + .await + } + + /// Helper method to send exchange requests and handle responses + async fn send_exchange_request(&self, payload: ExchangeRequest) -> Result<()> { debug!( - "transfer payload: {}", + "sending exchange request: {}", serde_json::to_string(&payload).unwrap() ); @@ -869,14 +1029,16 @@ impl HyperliquidClient { let status_code = resp.status().as_u16(); let body = resp.text().await?; + if status_code != 200 { - error!("failed to transfer USD: {} - {}", status_code, body); + error!("exchange request failed: {} - {}", status_code, body); return Err(Errors::HyperLiquidApiError(status_code, body).into()); } let out: ExchangeResponse = serde_json::from_str(body.as_str())?; - debug!("transfer response: {:?}", out); - if out.status != *"ok" { + debug!("exchange response: {:?}", out); + + if out.status != "ok" { return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); } @@ -917,7 +1079,7 @@ impl HyperliquidClient { payload: MultiSigPayload { multi_sig_user: multi_sig_user.to_string().to_lowercase(), outer_signer: self.user.to_string().to_lowercase(), - action: Box::new(action), // This returns IndexMap + action: Box::new(action), }, }; @@ -931,29 +1093,10 @@ impl HyperliquidClient { }; debug!( - "transfer payload: {}", + "sending multi sig l1: {}", serde_json::to_string(&payload).unwrap() ); - let resp = self - .client - .post(format!("{}/exchange", Into::::into(self.network))) - .json(&payload) - .send() - .await?; - - let status_code = resp.status().as_u16(); - let body = resp.text().await?; - if status_code != 200 { - error!("failed to transfer USD: {} - {}", status_code, body); - return Err(Errors::HyperLiquidApiError(status_code, body).into()); - } - - let out: ExchangeResponse = serde_json::from_str(body.as_str())?; - debug!("transfer response: {:?}", out); - if out.status != *"ok" { - return Err(Errors::HyperLiquidApiError(100, out.response.to_string()).into()); - } - Ok(()) + self.send_exchange_request(payload).await } } diff --git a/src/signer/mod.rs b/src/signer/mod.rs index 308acfa..fd288f5 100644 --- a/src/signer/mod.rs +++ b/src/signer/mod.rs @@ -13,6 +13,8 @@ pub trait HyperLiquidSigningHash { pub enum Signers { Local(LocalWallet), } + +#[derive(Clone)] pub struct LocalWallet { wallet_key: PrivateKeySigner, } From 142d253dba2a04a2de8e66d69650b73d71b10fef Mon Sep 17 00:00:00 2001 From: Rahul Tripathi Date: Thu, 4 Sep 2025 01:49:37 +0530 Subject: [PATCH 8/8] ft: gmt --- src/bin/dn_strat/main.rs | 2 +- src/hl/response.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/dn_strat/main.rs b/src/bin/dn_strat/main.rs index a82e76b..909b0cd 100644 --- a/src/bin/dn_strat/main.rs +++ b/src/bin/dn_strat/main.rs @@ -1,5 +1,5 @@ -use std::time::Duration; use std::sync::Arc; +use std::time::Duration; use alloy::primitives::Address; use envconfig::Envconfig; diff --git a/src/hl/response.rs b/src/hl/response.rs index 1d1e447..266274b 100644 --- a/src/hl/response.rs +++ b/src/hl/response.rs @@ -45,7 +45,8 @@ mod test { #[test] fn test_all_exchange_responses() { - let test_cases = [r#"{ + let test_cases = [ + r#"{ "status":"ok", "response":{ "type":"order", @@ -114,7 +115,8 @@ mod test { } } }"#, - r#"{"status": "ok", "response": {"type": "default"}}"#]; + r#"{"status": "ok", "response": {"type": "default"}}"#, + ]; for (i, json_str) in test_cases.iter().enumerate() { println!("test case {}", i + 1,);