Skip to content

Commit ee0571c

Browse files
feat(docs): update Web2Json guides and docs
1 parent da09aa1 commit ee0571c

File tree

11 files changed

+9
-38
lines changed

11 files changed

+9
-38
lines changed

docs/fdc/attestation-types/json-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: JsonApi (deprecated)
33
description: Data retrieval from Web2 JSON APIs with JQ transformations.
44
keywords: [fdc, oracle, flare-data-connector, flare-network, json, api, web2]
5-
sidebar_position: 1
5+
sidebar_position: 100
66
unlisted: true
77
---
88

docs/fdc/attestation-types/web2-json.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ The provided ABI signature is used to encode the jq-filtered JSON data.
4444
If encoding fails, the request is rejected.
4545

4646
`LowestUsedTimestamp` is unlimited.
47+
48+
## Whitelisted URLs
49+
50+
Before a request to the FDC for data at an endpoint can be made, the specific URL must be whitelisted.
51+
On mainnets, this is done through government proposals (details in the [FIP.14](https://proposals.flare.network/FIP/FIP_14.html#31-process-of-adding-updating-or-removing-an-api-endpoint) proposal).
52+
On testnets, whitelisting is handled by the Flare Team.

docs/fdc/guides/_available_testnet.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/fdc/guides/foundry/04-web2-json.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ keywords: [ethereum, flare-data-connector, evm, flare-network]
88
sidebar_position: 1
99
---
1010

11-
import AvailableTestnet from "../_available_testnet.mdx";
12-
13-
The `Web2Json` attestation type enables data collection from an arbitrary Web2 source.
11+
The `Web2Json` attestation type enables data collection from an arbitrary Web2 source, thought the source has to be whitelisted by the Flare Network in advance.
1412
You can learn more about it in the official [specification repo](/fdc/attestation-types/web2-json).
1513

16-
<AvailableTestnet />
17-
1814
We will now demonstrate how the FDC protocol can be used to collect the data of a given [Star Wars API](https://swapi.dev/) request.
1915
It will be a `GET` request to the URL `https://swapi.info/api/peaople/3`.
2016
The same procedure works for all public APIs.

docs/fdc/guides/foundry/05-proof-of-reserves.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ keywords:
1616
sidebar_position: 1
1717
---
1818

19-
import AvailableTestnet from "../_available_testnet.mdx";
20-
2119
This is a guide on how to build a simple dApp using the [Flare Data Connector](/fdc/overview).
2220
It demonstrates how multiple attestation types, namely the [EVMTransaction](/fdc/attestation-types/evm-transaction) and [Web2Json](/fdc/attestation-types/web2-json), can be combined within the same app.
2321

docs/fdc/guides/foundry/06-weather-insurance.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ keywords:
1818
sidebar_position: 1
1919
---
2020

21-
import AvailableTestnet from "../_available_testnet.mdx";
22-
2321
In this guide, we will examine an example of a simple insurance dApp that uses the FDC's [Web2Json](/fdc/guides/hardhat/web2-json) attestation type.
2422
The dApp will allow users to create insurance policies for temperatures at specific coordinates falling below a specified threshold.
2523
Other users will be able to claim those policies, and the policies will be settled automatically by the contract.
2624

2725
All the code described in this guide is available on GitHub in the [Flare Foundry starter repository](https://github.com/flare-foundation/flare-foundry-starter).
2826

29-
<AvailableTestnet />
30-
3127
### The Process of Using the dApp
3228

3329
To start with, let us describe the requirements for our Weather Insurance dApp.

docs/fdc/guides/foundry/07-web2-json-for-custom-api.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ keywords: [ethereum, flare-data-connector, evm, flare-network]
88
sidebar_position: 1
99
---
1010

11-
import AvailableTestnet from "../_available_testnet.mdx";
12-
1311
The [Web2Json guide](/fdc/guides/foundry/web2-json) demonstrates how the Flare Data Connector can be used to fetch Web2 and store it on the chain.
1412
The code for this and other examples is available within the [Flare Foundry starter](https://github.com/flare-foundation/flare-foundry-starter) repository.
1513
In this guide, we will see how the `Web2Json` example script within the Flare Foundry starter can be modified to work with custom data and custom contracts.
1614
That way, the example code can serve as the base building block for a custom project.
1715

18-
<AvailableTestnet />
19-
2016
## Necessary modifications
2117

2218
In order to run on custom data, the example code needs to be modified in four places only.

docs/fdc/guides/foundry/08-cross-chain-payment.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ keywords: [ethereum, flare-data-connector, evm, cross-chain, payment]
88
sidebar_position: 1
99
---
1010

11-
import AvailableTestnet from "../_available_testnet.mdx";
12-
1311
We will now demonstrate how the FDC protocol can be used to verify a payment that occurred on one chain (e.g., Sepolia testnet) and trigger an action on another (e.g., Coston2). In this example, verifying a specific USDC transfer on Sepolia will result in the minting of a commemorative NFT on Coston2.
1412
In this guide, we will follow the steps outlined under User Workflow in the [FDC overview](/fdc/overview).
1513

16-
<AvailableTestnet />
17-
1814
Our implementation requires handling the FDC voting round finalization process. To manage this, we will use separate scripts in `script/crossChainPayment.s.sol` that handle different stages of the validation process:
1915

2016
```solidity title="script/crossChainPayment.s.sol"

docs/fdc/guides/foundry/09-cross-chain-fdc.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ keywords:
99
sidebar_position: 1
1010
---
1111

12-
import AvailableTestnet from "../_available_testnet.mdx";
13-
1412
This guide demonstrates a powerful cross-chain workflow using the Flare Data Connector (FDC).
1513
We will fetch data from a public Web2 API using the [Web2Json](/fdc/attestation-types/web2-json) attestation type on a Flare network (Coston2) and then use the resulting proof to trigger a state change on a different EVM-compatible blockchain, the XRPL EVM Sidechain Testnet.
1614

@@ -22,8 +20,6 @@ This allows a verifier contract on the target chain to confirm the validity of F
2220

2321
Before running any code, check if the `Relay` contract is already being relayed, or submit a request to the Flare team.
2422

25-
<AvailableTestnet />
26-
2723
For this example, we will:
2824

2925
1. Deploy a custom verification infrastructure to the XRPL EVM Sidechain Testnet.

docs/fdc/guides/hardhat/04-web2-json.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ sidebar_position: 1
99
unlisted: false
1010
---
1111

12-
import AvailableTestnet from "../_available_testnet.mdx";
13-
14-
The `Web2Json` attestation type enables data collection from an arbitrary Web2 source.
12+
The `Web2Json` attestation type enables data collection from an arbitrary Web2 source, thought the source has to be whitelisted by the Flare Network in advance.
1513
You can learn more about it in the official [specification](/fdc/attestation-types/web2-json).
1614

17-
<AvailableTestnet />
18-
1915
We will now demonstrate how the FDC protocol can be used to collect the data of a given [Star Wars API](https://swapi.dev/) request.
2016
The request we will be making is `https://swapi.info/api/people/3`.
2117
The same procedure works for all public APIs.

0 commit comments

Comments
 (0)