Skip to content

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

fix(web3): thread approval turn context through crypto client calls

Steven Enamakelfffb87266b8e
diff --git a/crates/openhuman-core/src/agent/artifacts/ops.rs b/crates/openhuman-core/src/agent/artifacts/ops.rs
index 452c69120b..3c58251e6b 100644
--- a/crates/openhuman-core/src/agent/artifacts/ops.rs
+++ b/crates/openhuman-core/src/agent/artifacts/ops.rs
@@ -12,7 +12,6 @@ use crate::security::SecurityPolicy;
#[cfg(feature = "documents")]
use crate::tools::PresentationTool;
#[cfg(feature = "documents")]
-use tinytools::Tool;
use super::store;
use super::types::ArtifactKind;
diff --git a/crates/openhuman-core/src/web3/client.rs b/crates/openhuman-core/src/web3/client.rs
index 4d2fc83be2..4ce4fad77b 100644
--- a/crates/openhuman-core/src/web3/client.rs
+++ b/crates/openhuman-core/src/web3/client.rs
@@ -41,7 +41,10 @@ impl CryptoClient {
pub async fn routes(&self) -> Result<Value, String> {
tracing::debug!("{LOG_PREFIX} routes");
self.inner
- .get::<Value>("/agent-integrations/crypto/routes")
+ .get::<Value>(
+ &crate::security::approval::ApprovalTurnContext::default(),
+ "/agent-integrations/crypto/routes",
+ )
.await
.map_err(|e| format!("web3 routes failed: {e}"))
}
@@ -52,7 +55,11 @@ impl CryptoClient {
// addresses (sender / recipient) which must not be emitted in full.
tracing::debug!("{LOG_PREFIX} swap_tx chain_id={:?}", body.get("chainId"));
self.inner
- .post::<Value>("/agent-integrations/crypto/swap", body)
+ .post::<Value>(
+ &crate::security::approval::ApprovalTurnContext::default(),
+ "/agent-integrations/crypto/swap",
+ body,
+ )
.await
.map_err(|e| format!("web3 swap quote failed: {e}"))
}
@@ -67,7 +74,11 @@ impl CryptoClient {
body.get("dstChainId")
);
self.inner
- .post::<Value>("/agent-integrations/crypto/bridge", body)
+ .post::<Value>(
+ &crate::security::approval::ApprovalTurnContext::default(),
+ "/agent-integrations/crypto/bridge",
+ body,
+ )
.await
.map_err(|e| format!("web3 bridge quote failed: {e}"))
}
diff --git a/crates/openhuman-core/src/web3/wallet/schemas.rs b/crates/openhuman-core/src/web3/wallet/schemas.rs
index 54df8c6ddb..7f428836a1 100644
--- a/crates/openhuman-core/src/web3/wallet/schemas.rs
+++ b/crates/openhuman-core/src/web3/wallet/schemas.rs
@@ -484,7 +484,7 @@ fn handle_prepare_transfer(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let parsed: PrepareTransferParams = serde_json::from_value(Value::Object(params))
.map_err(|e| format!("invalid params: {e}"))?;
- prepare_transfer(parsed).await?.into_cli_compatible_json()
+ prepare_transfer(parsed, None).await?.into_cli_compatible_json()
})
}
@@ -492,7 +492,7 @@ fn handle_execute_prepared(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let parsed: ExecutePreparedParams = serde_json::from_value(Value::Object(params))
.map_err(|e| format!("invalid params: {e}"))?;
- execute_prepared(parsed).await?.into_cli_compatible_json()
+ execute_prepared(parsed, None).await?.into_cli_compatible_json()
})
}