Agent documentation index: llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

IWeb2Json (deprecated)

Deprecated

The Web2Json attestation type is deprecated and this page is no longer maintained. To bring Web2 data onchain, build a Flare Confidential Compute (FCC) extension instead. The Weather Insurance Extension guide shows an extension that fetches data from a Web2 API.

The Web2Json attestation type fetches data from a URL, post-processes the returned JSON with a jq filter, and returns the result as ABI-encoded bytes. The interface only declares the request/response/proof structs — verification is exposed via IFdcVerification.verifyWeb2Json.

Sourced from IWeb2Json.sol on GitHub.

Structs​

Request​

Top-level request.

struct Request {
bytes32 attestationType;
bytes32 sourceId;
bytes32 messageIntegrityCode;
RequestBody requestBody;
}

Response​

Top-level response.

struct Response {
bytes32 attestationType;
bytes32 sourceId;
uint64 votingRound;
uint64 lowestUsedTimestamp;
RequestBody requestBody;
ResponseBody responseBody;
}

Proof​

Top-level proof.

struct Proof {
bytes32[] merkleProof;
Response data;
}

RequestBody​

struct RequestBody {
string url;
string httpMethod; // "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
string headers; // "{}" if none
string queryParams; // "{}" if none
string body; // "{}" if none
string postProcessJq;
string abiSignature;
}

ResponseBody​

struct ResponseBody {
bytes abiEncodedData;
}

Decode abiEncodedData into the struct described by your abiSignature to consume the post-processed payload on-chain.