{"openapi":"3.1.0","info":{"title":"Taskmarket Onchain API","version":"1.1.0","description":"On-chain facts for agents, paid per call with x402 (USDC on Base): verify a payment receipt (MATCH/MISMATCH), read a decoded wallet balance, check a transaction's status, or list an address's recent ERC-20 transfers. All reads come from free public RPCs; no accounts or API keys.","x-guidance":"Four paid x402 resources on USDC/Base: POST /verify-receipt {chain, txHash, expectedRecipient, expectedAmount, token?}; POST /wallet-balance {chain, address, token?}; POST /tx-status {chain, txHash}; POST /address-activity {chain, address, token?, limit?, blocks?}. The first request returns HTTP 402 with a PAYMENT-REQUIRED header and a JSON body containing `accepts`; sign the EIP-3009 USDC transfer authorization for that route's price and retry with the Payment header. Free endpoints: GET /health, GET /, GET /openapi.json, GET /.well-known/x402.","contact":{"name":"Taskmarket Onchain API","email":"mostafaashry115+agent@gmail.com","url":"https://wurk.fun/user/ReceiptWorks"}},"servers":[{"url":"https://taskmarket-x402.dynv6.net"}],"paths":{"/verify-receipt":{"post":{"summary":"Verify an on-chain payment/transfer against an expected recipient and amount","description":"Given a transaction hash, an expected recipient and an expected amount, return MATCH or MISMATCH with on-chain evidence (token transfers, block, status). Paid endpoint: USDC on Base via x402. A GET variant with the same fields as query parameters is available at the same price (used by directory probes).","operationId":"verifyReceipt","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}],"scheme":"exact","network":"eip155:8453","payTo":"0xe43389bF0cCf7f3056e93b8B273Fa78c3Bb75Fb6","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyReceiptRequest"}}}},"responses":{"200":{"description":"Verification result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyReceiptResponse"}}}},"400":{"description":"Invalid input (bad chain, address, hash or parameter)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required (x402). Pay USDC on Base and retry with the payment header.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 payment requirements (v2)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"number","example":2},"error":{"type":"string","example":"Payment required"},"accepts":{"type":"array","items":{"type":"object"}}}}}}},"404":{"description":"Requested on-chain object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"On-chain data could not be decoded (e.g. token metadata unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Free public RPC lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/wallet-balance":{"post":{"summary":"Read a decoded wallet balance (native, USDC, or any ERC-20)","description":"Read a wallet's balance: native coin, USDC, or any ERC-20 token address. The balance is decoded with the token's decimals and pinned to a block number, with explorer URLs to check the same values independently. Reads come from free public RPCs (Base, BSC, Ethereum, Polygon). A GET variant with the same fields as query parameters is available at the same price (used by directory probes).","operationId":"walletBalance","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}],"scheme":"exact","network":"eip155:8453","payTo":"0xe43389bF0cCf7f3056e93b8B273Fa78c3Bb75Fb6","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletBalanceRequest"}}}},"responses":{"200":{"description":"Decoded balance at a pinned block","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletBalanceResponse"}}}},"400":{"description":"Invalid input (bad chain, address, hash or parameter)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required (x402). Pay USDC on Base and retry with the payment header.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 payment requirements (v2)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"number","example":2},"error":{"type":"string","example":"Payment required"},"accepts":{"type":"array","items":{"type":"object"}}}}}}},"404":{"description":"Requested on-chain object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"On-chain data could not be decoded (e.g. token metadata unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Free public RPC lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tx-status":{"post":{"summary":"Get the status, block, from/to, value, gas used and timestamp of a transaction","description":"Return a transaction's status (success / reverted / pending), block number and timestamp, from/to, native value, gas used, effective gas price, fee, confirmations and explorer links. Reads come from free public RPCs. A GET variant with the same fields as query parameters is available at the same price (used by directory probes).","operationId":"txStatus","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.01"},"protocols":[{"x402":{}}],"scheme":"exact","network":"eip155:8453","payTo":"0xe43389bF0cCf7f3056e93b8B273Fa78c3Bb75Fb6","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxStatusRequest"}}}},"responses":{"200":{"description":"Transaction status and receipt facts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TxStatusResponse"}}}},"400":{"description":"Invalid input (bad chain, address, hash or parameter)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required (x402). Pay USDC on Base and retry with the payment header.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 payment requirements (v2)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"number","example":2},"error":{"type":"string","example":"Payment required"},"accepts":{"type":"array","items":{"type":"object"}}}}}}},"404":{"description":"Requested on-chain object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"On-chain data could not be decoded (e.g. token metadata unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Free public RPC lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/address-activity":{"post":{"summary":"List recent ERC-20 transfers involving an address (bounded, newest first)","description":"Return recent ERC-20 transfers involving an address, newest first, bounded by `limit` (default 20, max 50) and a recent block window `blocks` (default 2000, max 9000). Each entry has direction, from/to, decoded value, block, tx hash and an explorer link. Reads come from free public RPC eth_getLogs. A GET variant with the same fields as query parameters is available at the same price (used by directory probes).","operationId":"addressActivity","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.02"},"protocols":[{"x402":{}}],"scheme":"exact","network":"eip155:8453","payTo":"0xe43389bF0cCf7f3056e93b8B273Fa78c3Bb75Fb6","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressActivityRequest"}}}},"responses":{"200":{"description":"Recent ERC-20 transfers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressActivityResponse"}}}},"400":{"description":"Invalid input (bad chain, address, hash or parameter)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Payment Required (x402). Pay USDC on Base and retry with the payment header.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 payment requirements (v2)","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"x402Version":{"type":"number","example":2},"error":{"type":"string","example":"Payment required"},"accepts":{"type":"array","items":{"type":"object"}}}}}}},"404":{"description":"Requested on-chain object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"On-chain data could not be decoded (e.g. token metadata unavailable)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Free public RPC lookup failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/health":{"get":{"summary":"Free health check","operationId":"health","responses":{"200":{"description":"Service health","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/":{"get":{"summary":"Free service info and docs","operationId":"index","responses":{"200":{"description":"Service info","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/openapi.json":{"get":{"summary":"This OpenAPI document","operationId":"openapi","responses":{"200":{"description":"OpenAPI document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/.well-known/x402":{"get":{"summary":"x402 discovery document (all paid resources)","operationId":"wellKnownX402","responses":{"200":{"description":"Discovery fan-out for crawlers","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"Chain":{"type":"string","enum":["base","bsc","ethereum","polygon"],"default":"base","description":"Which public chain to read from."},"VerifyReceiptRequest":{"type":"object","required":["txHash","expectedRecipient","expectedAmount"],"properties":{"chain":{"$ref":"#/components/schemas/Chain"},"txHash":{"type":"string","description":"0x-prefixed transaction hash."},"expectedRecipient":{"type":"string","description":"0x-prefixed address that should have received the transfer."},"expectedAmount":{"type":"string","description":"Decimal amount in human units, e.g. \"1.50\"."},"token":{"type":"string","description":"\"USDC\" (default), \"native\", or a 0x token address."},"tokenDecimals":{"type":"integer","description":"Required only when token is a custom address."}}},"VerifyReceiptResponse":{"type":"object","required":["verdict","evidence","checks"],"properties":{"verdict":{"type":"string","enum":["MATCH","MISMATCH","NOT_FOUND","ERROR"]},"reason":{"type":"string"},"error":{"type":"string"},"evidence":{"type":"object","properties":{"txHash":{"type":"string"},"chain":{"type":"string"},"chainName":{"type":"string"},"blockNumber":{"type":"integer"},"status":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"transfers":{"type":"array","items":{"type":"object"}}}},"checks":{"type":"object"}}},"WalletBalanceRequest":{"type":"object","required":["address"],"properties":{"chain":{"$ref":"#/components/schemas/Chain"},"address":{"type":"string","description":"0x-prefixed 20-byte address to read."},"token":{"type":"string","description":"\"USDC\" (default), \"native\", or a 0x ERC-20 token address."},"tokenDecimals":{"type":"integer","description":"Optional fallback decimals for a custom token."}}},"WalletBalanceResponse":{"type":"object","required":["ok","chain","address","blockNumber","token","balance"],"properties":{"ok":{"type":"boolean"},"chain":{"type":"string"},"chainName":{"type":"string"},"chainId":{"type":"integer"},"address":{"type":"string"},"blockNumber":{"type":"integer"},"blockTimestamp":{"type":["string","null"]},"token":{"type":"object","properties":{"kind":{"type":"string","enum":["native","erc20"]},"address":{"type":["string","null"]},"symbol":{"type":["string","null"]},"decimals":{"type":"integer"}}},"balance":{"type":"object","properties":{"atomic":{"type":"string","description":"Raw integer units as a string."},"human":{"type":"string","description":"Decoded decimal amount."},"symbol":{"type":["string","null"]}}},"evidence":{"type":"object"}}},"TxStatusRequest":{"type":"object","required":["txHash"],"properties":{"chain":{"$ref":"#/components/schemas/Chain"},"txHash":{"type":"string","description":"0x-prefixed 32-byte transaction hash."}}},"TxStatusResponse":{"type":"object","required":["ok","chain","txHash","status","from","to","value"],"properties":{"ok":{"type":"boolean"},"chain":{"type":"string"},"chainName":{"type":"string"},"chainId":{"type":"integer"},"txHash":{"type":"string"},"status":{"type":"string","enum":["success","reverted","pending"]},"blockNumber":{"type":["integer","null"]},"blockHash":{"type":["string","null"]},"transactionIndex":{"type":["integer","null"]},"timestamp":{"type":["string","null"]},"confirmations":{"type":["integer","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"contractAddress":{"type":["string","null"]},"nonce":{"type":["integer","null"]},"value":{"type":"object","properties":{"atomic":{"type":"string"},"human":{"type":"string"},"symbol":{"type":"string"}}},"gasUsed":{"type":["string","null"]},"effectiveGasPrice":{"type":["string","null"]},"fee":{"type":["object","null"]},"explorer":{"type":"object"},"readAt":{"type":"string"}}},"AddressActivityRequest":{"type":"object","required":["address"],"properties":{"chain":{"$ref":"#/components/schemas/Chain"},"address":{"type":"string","description":"0x-prefixed 20-byte address to inspect."},"token":{"type":"string","description":"ERC-20 token: \"USDC\" (default) or a 0x token address."},"limit":{"type":"integer","minimum":1,"maximum":50,"default":20,"description":"Maximum transfers to return (newest first)."},"blocks":{"type":"integer","minimum":50,"maximum":9000,"default":2000,"description":"Recent block window scanned for transfers."}}},"AddressActivityResponse":{"type":"object","required":["ok","chain","address","token","window","transfers"],"properties":{"ok":{"type":"boolean"},"chain":{"type":"string"},"chainName":{"type":"string"},"chainId":{"type":"integer"},"address":{"type":"string"},"token":{"type":"object"},"window":{"type":"object"},"count":{"type":"integer"},"totalMatched":{"type":"integer"},"truncated":{"type":"boolean"},"transfers":{"type":"array","items":{"type":"object","properties":{"direction":{"type":"string","enum":["in","out","self"]},"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"valueHuman":{"type":"string"},"blockNumber":{"type":"integer"},"txHash":{"type":"string"},"logIndex":{"type":["integer","null"]},"explorerTxUrl":{"type":"string"}}}},"evidence":{"type":"object"}}},"ErrorResponse":{"type":"object","required":["ok","error","code"],"properties":{"ok":{"type":"boolean","example":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object"}}}}}}