Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(web3): import encode_erc20_transfer from execution module

Steven Enamakel7060b47b2ec2
diff --git a/crates/openhuman-core/src/web3/wallet/mod.rs b/crates/openhuman-core/src/web3/wallet/mod.rs
index 5e5da14806..41183c9a2d 100644
--- a/crates/openhuman-core/src/web3/wallet/mod.rs
+++ b/crates/openhuman-core/src/web3/wallet/mod.rs
@@ -56,7 +56,7 @@ pub(crate) mod test_support;
pub use endpoints::solana_cluster;
#[cfg(feature = "web3")]
pub use execution::{
- balances, chain_status, encode_erc20_transfer, execute_prepared, lookup_tx,
+ balances, chain_status, execute_prepared, lookup_tx,
network_defaults as wallet_network_defaults, prepare_transfer, prepared_quotes_for_test,
supported_assets, tx_receipt, tx_status, BalanceInfo, ChainStatus, ExecutePreparedParams,
ExecutionResult, PrepareTransferParams, PreparedKind, PreparedStatus, PreparedTransaction,
diff --git a/crates/openhuman-core/src/web3/wallet/schemas.rs b/crates/openhuman-core/src/web3/wallet/schemas.rs
index 61c8217169..acc63d4c23 100644
--- a/crates/openhuman-core/src/web3/wallet/schemas.rs
+++ b/crates/openhuman-core/src/web3/wallet/schemas.rs
@@ -5,11 +5,12 @@ use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::execution::{
- balances, chain_status, execute_prepared, lookup_tx, network_defaults, prepare_transfer,
- supported_assets, tx_receipt, tx_status, ExecutePreparedParams, PrepareTransferParams,
+ balances, chain_status, encode_erc20_transfer, execute_prepared, lookup_tx,
+ network_defaults, prepare_transfer, supported_assets, tx_receipt, tx_status,
+ ExecutePreparedParams, PrepareTransferParams,
};
use super::ops::{WalletAccount, WalletSetupParams, WalletSetupSource};
-use super::{encode_erc20_transfer, EvmNetwork, WalletChain};
+use super::{EvmNetwork, WalletChain};
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
@@ -470,10 +471,7 @@ fn handle_encode_erc20_transfer(params: Map<String, Value>) -> ControllerFuture
if parsed.chain != WalletChain::Evm {
return Err("encode_erc20_transfer only supports the evm chain".to_string());
}
- serde_json::to_value(super::encode_erc20_transfer(
- &parsed.to_address,
- &parsed.amount_raw,
- ).await?)
+ serde_json::to_value(encode_erc20_transfer(&parsed.to_address, &parsed.amount_raw).await?)
.map_err(|e| format!("failed to encode ERC20 transfer output: {e}"))
})
}