fn act( state: &AppState, req: &AgentSpendReq, ) -> Result<(AgentSpendResult, String, String), String>