Skip to content

Commit 9f2fba0

Browse files
authored
Merge pull request #327 from sablier-labs/refactor/envio-testing-column
feat: EnvioEndpointTable
2 parents 035f544 + a661c24 commit 9f2fba0

File tree

5 files changed

+45
-12
lines changed

5 files changed

+45
-12
lines changed

docs/api/airdrops/02-airdrops-endpoints.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ title: "Endpoints"
77
import DeprecatedSubgraphs from "@site/docs/snippets/DeprecatedSubgraphs.mdx";
88
import EnvioEndpoints from "@site/docs/snippets/EnvioEndpoints.mdx";
99
import TheGraphEndpoints from "@site/docs/snippets/TheGraphEndpoints.mdx";
10+
import EnvioEndpointTable from "@site/src/components/molecules/EnvioEndpointTable";
1011
import LinkPreview from "@site/src/components/molecules/LinkPreview";
1112

1213
# Airdrops Endpoints
@@ -48,9 +49,7 @@ new [Lockup](/api/lockup/overview) streams.
4849

4950
### Endpoints
5051

51-
| Chain | Endpoint |
52-
| ---------- | ------------------------------------------------- |
53-
| All Chains | https://indexer.hyperindex.xyz/508d217/v1/graphql |
52+
<EnvioEndpointTable protocolId="508d217" />
5453

5554
<EnvioEndpoints />
5655

docs/api/flow/02-flow-endpoints.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ title: "Endpoints"
77
import DeprecatedSubgraphs from "@site/docs/snippets/DeprecatedSubgraphs.mdx";
88
import EnvioEndpoints from "@site/docs/snippets/EnvioEndpoints.mdx";
99
import TheGraphEndpoints from "@site/docs/snippets/TheGraphEndpoints.mdx";
10+
import EnvioEndpointTable from "@site/src/components/molecules/EnvioEndpointTable";
1011
import LinkPreview from "@site/src/components/molecules/LinkPreview";
1112

1213
# Flow Endpoints
@@ -27,9 +28,7 @@ creating, depositing, or voiding Flow streams.
2728

2829
### Endpoints
2930

30-
| Chain | Endpoint |
31-
| ---------- | ------------------------------------------------- |
32-
| All Chains | https://indexer.hyperindex.xyz/3b4ea6b/v1/graphql |
31+
<EnvioEndpointTable protocolId="3b4ea6b" />
3332

3433
<EnvioEndpoints />
3534

docs/api/lockup/02-lockup-endpoints.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ title: "Endpoints"
77
import DeprecatedSubgraphs from "@site/docs/snippets/DeprecatedSubgraphs.mdx";
88
import EnvioEndpoints from "@site/docs/snippets/EnvioEndpoints.mdx";
99
import TheGraphEndpoints from "@site/docs/snippets/TheGraphEndpoints.mdx";
10+
import EnvioEndpointTable from "@site/src/components/molecules/EnvioEndpointTable";
1011
import LinkPreview from "@site/src/components/molecules/LinkPreview";
1112

1213
# Lockup Endpoints
@@ -27,9 +28,7 @@ creating, withdrawing, or transferring Lockup streams.
2728

2829
### Endpoints
2930

30-
| Chain | Endpoint |
31-
| ---------- | ------------------------------------------------- |
32-
| All Chains | https://indexer.hyperindex.xyz/53b7e25/v1/graphql |
31+
<EnvioEndpointTable protocolId="53b7e25" />
3332

3433
<EnvioEndpoints />
3534

docs/snippets/EnvioEndpoints.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"All Chains" means most of the chains supported by Sablier, e.g., Ethereum Mainnet, Optimism, Polygon. The full list can
22
be found [here](https://github.com/sablier-labs/indexers/blob/main/packages/constants/src).
33

4-
The endpoint is meant to be plugged into a query client. Use
5-
[Hasura's online explorer](https://cloud.hasura.io/public/graphiql?) to view the entities and query API.
6-
74
:::tip Unified Endpoint
85

96
As you can see, Envio offers a single API endpoint that aggregates data across all chains. This approach differs from
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from "react";
2+
import Link from "@docusaurus/Link";
3+
4+
interface Props {
5+
protocolId: string;
6+
}
7+
8+
const EnvioEndpointTable: React.FC<Props> = ({ protocolId }) => {
9+
// Generate the Envio endpoint URL
10+
const endpoint = `https://indexer.hyperindex.xyz/${protocolId}/v1/graphql`;
11+
12+
// Construct the testing URL
13+
const testingUrl = `https://cloud.hasura.io/public/graphiql?endpoint=https%3A%2F%2Findexer.hyperindex.xyz%2F${protocolId}%2Fv1%2Fgraphql`;
14+
15+
return (
16+
<table>
17+
<thead>
18+
<tr>
19+
<th>Chain</th>
20+
<th>Endpoint</th>
21+
<th>Testing</th>
22+
</tr>
23+
</thead>
24+
<tbody>
25+
<tr>
26+
<td>All Chains</td>
27+
<td>
28+
<Link to={endpoint}>{endpoint}</Link>
29+
</td>
30+
<td>
31+
<Link to={testingUrl}>Hasura GraphiQL</Link>
32+
</td>
33+
</tr>
34+
</tbody>
35+
</table>
36+
);
37+
};
38+
39+
export default EnvioEndpointTable;

0 commit comments

Comments
 (0)