Skip to content

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

fix(x402): allow zero limit in list_payments

Steven Enamakele8703d7d2b1c
diff --git a/crates/openhuman-core/src/web3/x402/schemas.rs b/crates/openhuman-core/src/web3/x402/schemas.rs
index efae4858c2..d425ac3ff9 100644
--- a/crates/openhuman-core/src/web3/x402/schemas.rs
+++ b/crates/openhuman-core/src/web3/x402/schemas.rs
@@ -135,7 +135,7 @@ fn handle_list_payments(params: Map<String, Value>) -> ControllerFuture {
let config = crate::config::rpc::load_config_with_timeout()
.await
.map_err(|error| format!("x402 list_payments: {error}"))?;
- let limit = p.limit.unwrap_or(50).clamp(1, 500);
+ let limit = p.limit.unwrap_or(50).min(500);
let response = crate::modules::x402_service::list_payments(&config, limit)
.await
.map_err(|error| format!("x402 list_payments: {error}"))?;