/api/tasks/*
High-level task creation helper (auto-generates taskId, validates fee).
POST /api/tasks/submit
Wrapper for TASK_SUBMIT. Requires the caller to sign the tx (server doesn't hold keys).
This endpoint is not a separate signing facility — it merely accepts the signed tx and auto-generates the taskId if not provided. Most clients use POST /api/chain/tx directly.
- TypeScript
- cURL
import { OmbraClient } from "@ombrachain/sdk";
const client = new OmbraClient({ endpoint: "https://api.ombra-net.com" });
const result = await client.tasks.submitTask({
prompt: "Hello",
taskType: "chat",
fee: "100000",
wallet: myWallet, // SDK handles sign + broadcast
});
console.log(result.taskId, result.txHash);
curl -X POST https://api.ombra-net.com/api/chain/tx \
-H "Content-Type: application/json" \
-d @task-submit.json
GET /api/tasks/:id
curl https://api.ombra-net.com/api/tasks/d00cb34e8b163a15...
Response: same shape as /api/chain/task/:id.
GET /api/tasks/active
Tasks currently in-flight (status ∈ {submitted, responses_collected}).
curl https://api.ombra-net.com/api/tasks/active
Response:
{ "tasks": [{ "taskId": "...", "status": "submitted", ... }] }
Useful for miners — filter by taskType matching local capabilities.