{"openapi":"3.1.0","info":{"title":"Preima API","version":"0.1.0","description":"Chain data for Robinhood Chain, paid per call in USDG with the preima-tab scheme of x402. Prices are in the x-price field of each operation."},"externalDocs":{"url":"https://preima.xyz/docs"},"servers":[{"url":"https://api.preima.xyz"}],"paths":{"/":{"get":{"operationId":"catalogue","summary":"Every endpoint with its price.","responses":{"200":{"description":"The catalogue.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/health":{"get":{"operationId":"health","summary":"Version, build, the public addresses in use and whether the service can settle.","responses":{"200":{"description":"Health.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/openapi.json":{"get":{"operationId":"openapi","summary":"This document.","responses":{"200":{"description":"OpenAPI 3.1.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/ping":{"get":{"operationId":"ping","summary":"Server time, a block number read at most 10 seconds ago and where this ticket left your tab.","x-price":{"amount":"0.001","currency":"USDG","scheme":"preima-tab"},"parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"The preima-tab ticket, base64 JSON. Without it the reply is a 402 with the terms.","schema":{"type":"string"}}],"responses":{"200":{"description":"The paid reply. The PAYMENT-RESPONSE header carries the tab position.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input. Nothing is charged.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment required, or a refused ticket. The terms are in the PAYMENT-REQUIRED header and in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"405":{"description":"Wrong method for this route. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Too many payments on tabs not seen before. Nothing was charged; send the same ticket again in a minute.","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"The ticket was accepted and the chain read failed. The body says paid true; the payment is not returned.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"The seller could not take the ticket. Nothing was charged; send the same ticket again later.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/gas":{"get":{"operationId":"gas","summary":"Gas price, base fee and block read at most 10 seconds ago, and the execution gas cost in ETH of a transfer, a tab open and a 1,000 payment claim.","x-price":{"amount":"0.001","currency":"USDG","scheme":"preima-tab"},"parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"The preima-tab ticket, base64 JSON. Without it the reply is a 402 with the terms.","schema":{"type":"string"}}],"responses":{"200":{"description":"The paid reply. The PAYMENT-RESPONSE header carries the tab position.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input. Nothing is charged.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment required, or a refused ticket. The terms are in the PAYMENT-REQUIRED header and in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"405":{"description":"Wrong method for this route. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Too many payments on tabs not seen before. Nothing was charged; send the same ticket again in a minute.","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"The ticket was accepted and the chain read failed. The body says paid true; the payment is not returned.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"The seller could not take the ticket. Nothing was charged; send the same ticket again later.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/exposure/{address}":{"get":{"operationId":"exposure","summary":"Key exposure report for an account: transaction count, code size, EIP-7702 delegation, ETH and USDG balance, and a plain verdict.","x-price":{"amount":"0.002","currency":"USDG","scheme":"preima-tab"},"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"The preima-tab ticket, base64 JSON. Without it the reply is a 402 with the terms.","schema":{"type":"string"}}],"responses":{"200":{"description":"The paid reply. The PAYMENT-RESPONSE header carries the tab position.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input. Nothing is charged.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment required, or a refused ticket. The terms are in the PAYMENT-REQUIRED header and in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"405":{"description":"Wrong method for this route. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Too many payments on tabs not seen before. Nothing was charged; send the same ticket again in a minute.","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"The ticket was accepted and the chain read failed. The body says paid true; the payment is not returned.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"The seller could not take the ticket. Nothing was charged; send the same ticket again later.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/token/{address}":{"get":{"operationId":"token","summary":"ERC-20 facts in one read: name, symbol, decimals, total supply, code size and owner, each null if the token does not answer.","x-price":{"amount":"0.002","currency":"USDG","scheme":"preima-tab"},"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"The preima-tab ticket, base64 JSON. Without it the reply is a 402 with the terms.","schema":{"type":"string"}}],"responses":{"200":{"description":"The paid reply. The PAYMENT-RESPONSE header carries the tab position.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input. Nothing is charged.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment required, or a refused ticket. The terms are in the PAYMENT-REQUIRED header and in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"405":{"description":"Wrong method for this route. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Too many payments on tabs not seen before. Nothing was charged; send the same ticket again in a minute.","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"The ticket was accepted and the chain read failed. The body says paid true; the payment is not returned.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"The seller could not take the ticket. Nothing was charged; send the same ticket again later.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/balances/{address}":{"get":{"operationId":"balances","summary":"ETH balance plus up to 20 token balances with decimals and symbol, in one read (USDG if no tokens are named).","x-price":{"amount":"0.002","currency":"USDG","scheme":"preima-tab"},"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"tokens","in":"query","required":false,"description":"Comma separated token addresses, at most 20. USDG when left out.","schema":{"type":"string"}},{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"The preima-tab ticket, base64 JSON. Without it the reply is a 402 with the terms.","schema":{"type":"string"}}],"responses":{"200":{"description":"The paid reply. The PAYMENT-RESPONSE header carries the tab position.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input. Nothing is charged.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment required, or a refused ticket. The terms are in the PAYMENT-REQUIRED header and in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"405":{"description":"Wrong method for this route. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Too many payments on tabs not seen before. Nothing was charged; send the same ticket again in a minute.","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"The ticket was accepted and the chain read failed. The body says paid true; the payment is not returned.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"The seller could not take the ticket. Nothing was charged; send the same ticket again later.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/simulate":{"post":{"operationId":"simulate","summary":"Runs a call at the latest block without sending it: return data or revert data with the decoded reason, and a gas estimate.","x-price":{"amount":"0.005","currency":"USDG","scheme":"preima-tab"},"parameters":[{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"The preima-tab ticket, base64 JSON. Without it the reply is a 402 with the terms.","schema":{"type":"string"}}],"responses":{"200":{"description":"The paid reply. The PAYMENT-RESPONSE header carries the tab position.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input. Nothing is charged.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"402":{"description":"Payment required, or a refused ticket. The terms are in the PAYMENT-REQUIRED header and in the body.","content":{"application/json":{"schema":{"type":"object"}}}},"405":{"description":"Wrong method for this route. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"413":{"description":"The body is too large. Nothing is charged.","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Too many payments on tabs not seen before. Nothing was charged; send the same ticket again in a minute.","content":{"application/json":{"schema":{"type":"object"}}}},"502":{"description":"The ticket was accepted and the chain read failed. The body says paid true; the payment is not returned.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"The seller could not take the ticket. Nothing was charged; send the same ticket again later.","content":{"application/json":{"schema":{"type":"object"}}}}},"requestBody":{"required":true,"description":"At most 16384 bytes.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["to"],"properties":{"from":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"to":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"data":{"type":"string","pattern":"^0x([0-9a-fA-F]{2})*$","description":"At most 6144 bytes."},"value":{"type":"string","description":"Wei, as a decimal string or 0x hex."}}}}}}}}}}