POST /prepare-auth, POST /tx-confirm, and POST /finalize; POST /prepare receives multipart/form-data.
Set the worker URL once so the examples work with the Kuest endpoint or an operator runtime override:
Forbidden):
1. GET /market-config
Reads runtime configuration for the worker.
Budget for every market:
multi_multiple pays the standard fee for each independent market, while multi_unique pays the neg-risk fee for each question. Inspect the returned transaction plan before signing; include POL for gas separately.
2. POST /prepare-auth
Creates a short-lived EIP-712 challenge for the exact payload hash.expiresAt is a Unix timestamp in milliseconds, and the challenge is valid for 30 minutes. Use the returned domain and types; include chainId in the EIP-712 domain when signing:
3. POST /prepare
Validates the signed payload, processes images, uploads draft metadata to Irys, checks for existing initialized questions, and starts background preparation. Required multipart fields:
Save the exact string you hashed as
payload.json, and save the returned challenge fields plus your real signature as auth.json. Do not reformat payload.json after hashing it.
202 Accepted):
GET /pending until request.prepared.txPlan is available.
4. GET /pending
Returns a resumable request byrequestId or the latest resumable request for a creator.
If no request matches the supplied identifiers, the response is
{ "request": null }. Persist requestId so recovery targets the intended request instead of whichever request is newest for that creator.
Prepared response shape:
txPlan item in order from the creator wallet, and wait for a successful receipt before sending a dependent transaction:
5. POST /tx-confirm
Persists transaction hashes so the flow can resume. This endpoint checks that transaction IDs belong to the saved plan. Final validation of sender, target, calldata, value, and receipt happens duringPOST /finalize.
409 with Conflicting tx hash. The prepared status in this endpoint’s response acknowledges saved hashes; use GET /pending to read the workflow status.
Response:
6. POST /finalize
Starts or resumes finalization. Send all hashes you have, including hashes already confirmed throughPOST /tx-confirm.
finalize_in_progress response uses 202 Accepted; poll GET /pending for the next step. Other successful responses use 200 OK.
Possible responses:
metadata_update_pending, execute every item in metadataUpdateTxPlan, call POST /tx-confirm with the new hashes, then call POST /finalize again.
Final response:
Optional Health Check
GET / returns "OK" when the worker is reachable.