diff options
| author | soryu <soryu@soryu.co> | 2026-02-06 20:06:30 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-06 20:15:27 +0000 |
| commit | 1b692b8cde4a888c8a35af69231f181b57bf5619 (patch) | |
| tree | 74ce25ce6ee5fb4536b53404e1a0ae923e85c30d /makima/src/daemon/api/chain.rs | |
| parent | 139be135c2086d725e4f040e744bb25acd436549 (diff) | |
| download | soryu-1b692b8cde4a888c8a35af69231f181b57bf5619.tar.gz soryu-1b692b8cde4a888c8a35af69231f181b57bf5619.zip | |
Fix: Cleanup old chain code
Diffstat (limited to 'makima/src/daemon/api/chain.rs')
| -rw-r--r-- | makima/src/daemon/api/chain.rs | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/makima/src/daemon/api/chain.rs b/makima/src/daemon/api/chain.rs deleted file mode 100644 index c37c980..0000000 --- a/makima/src/daemon/api/chain.rs +++ /dev/null @@ -1,78 +0,0 @@ -//! Chain API methods. - -use uuid::Uuid; - -use super::client::{ApiClient, ApiError}; -use super::supervisor::JsonValue; -use crate::db::models::CreateChainRequest; - -impl ApiClient { - /// Create a new chain with contracts. - pub async fn create_chain(&self, req: CreateChainRequest) -> Result<JsonValue, ApiError> { - self.post("/api/v1/chains", &req).await - } - - /// List all chains for the authenticated user. - pub async fn list_chains( - &self, - status: Option<&str>, - limit: i32, - ) -> Result<JsonValue, ApiError> { - let mut params = Vec::new(); - if let Some(s) = status { - params.push(format!("status={}", s)); - } - params.push(format!("limit={}", limit)); - let query_string = format!("?{}", params.join("&")); - self.get(&format!("/api/v1/chains{}", query_string)).await - } - - /// Get a chain by ID. - pub async fn get_chain(&self, chain_id: Uuid) -> Result<JsonValue, ApiError> { - self.get(&format!("/api/v1/chains/{}", chain_id)).await - } - - /// Get contracts in a chain. - pub async fn get_chain_contracts(&self, chain_id: Uuid) -> Result<JsonValue, ApiError> { - self.get(&format!("/api/v1/chains/{}/contracts", chain_id)) - .await - } - - /// Get chain DAG structure for visualization. - pub async fn get_chain_graph(&self, chain_id: Uuid) -> Result<JsonValue, ApiError> { - self.get(&format!("/api/v1/chains/{}/graph", chain_id)) - .await - } - - /// Archive a chain. - pub async fn archive_chain(&self, chain_id: Uuid) -> Result<JsonValue, ApiError> { - self.delete_with_response(&format!("/api/v1/chains/{}", chain_id)) - .await - } - - /// Start a chain (creates root contracts and optionally a supervisor). - pub async fn start_chain(&self, chain_id: Uuid) -> Result<JsonValue, ApiError> { - self.post_empty(&format!("/api/v1/chains/{}/start", chain_id)) - .await - } - - /// Start a chain with supervisor enabled. - pub async fn start_chain_with_supervisor( - &self, - chain_id: Uuid, - repository_url: Option<&str>, - ) -> Result<JsonValue, ApiError> { - #[derive(serde::Serialize)] - #[serde(rename_all = "camelCase")] - struct StartRequest<'a> { - with_supervisor: bool, - repository_url: Option<&'a str>, - } - let req = StartRequest { - with_supervisor: true, - repository_url, - }; - self.post(&format!("/api/v1/chains/{}/start", chain_id), &req) - .await - } -} |
