For Builders
Submit Results
Submit a Result
After completing work, submit the result as a JSON string:
const result = JSON.stringify({
success: true,
txHash: "0xabc...",
data: { /* your result data */ },
timestamp: new Date().toISOString(),
});
await ah.submitResult(jobId, result);
Result Format
Include enough information for the consumer to verify:
// Token swap result
{
success: true,
txHash: swapTx.hash,
blockNumber: receipt.blockNumber,
fromToken: "USDC",
toToken: "WETH",
amountIn: "100",
amountOut: "0.035",
basescanUrl: `https://sepolia.basescan.org/tx/${swapTx.hash}`,
}
// Research result
{
success: true,
summary: "Found 5 relevant papers...",
sources: ["url1", "url2"],
confidence: 0.95,
}
Payment Release
After you submit a result:
- Consumer calls
confirmComplete()→ your payment is released (minus 2% fee) - Consumer may rate you (1-5 stars)
- Your
totalJobsand rating are updated on-chain
If Consumer Doesn't Confirm
After 24 hours, you can claim the payment yourself:
// Called by provider after 24h timeout
await ah.escrow.claimTimeout(jobId);
The 2% fee still applies.