diff --git a/daostar-website/src/App.js b/daostar-website/src/App.js index 57fb20d..0dbe2bb 100644 --- a/daostar-website/src/App.js +++ b/daostar-website/src/App.js @@ -272,6 +272,25 @@ function App() { data: EASOptimismData, } = EASOptimismRes; console.log(EASOptimismData) + + + const ENSQueryRes = useQuery(queries.ENS_QUERY, { + context: { apiName: "ensTextRecords" }, + variables: { + "where": { + "value_not": null, + "key_starts_with_nocase": "daouri", + "key_ends_with_nocase": "daouri" + }, + "first": 5 + }, + }); + const { + loading: ENSQueryResLoading, + error: ENSQueryResError, + data: ENSQueryResData, + } = ENSQueryRes; + console.log(ENSQueryResData) if ( error || goerliError || @@ -328,6 +347,8 @@ function App() { const EASOptimismAttestations = EASOptimismData?.attestations || []; + const ENSTextRecords = + ENSQueryResData?.textChangeds || []; // This object clones and modifies the mainnetV0 registration instances to change the network ID to "ethereum" // So that when we click on an old registration instance card we are able to view and edit its proprties // this allows to query mainnetV0 subgraph link @@ -400,6 +421,7 @@ function App() { osmosisInstances={osmosisInstances} stargazeInstances={stargazeInstances} easAttestations={EASAttestations} + ENSTextRecords={ENSTextRecords} /> } /> diff --git a/daostar-website/src/components/ENSCard/ENSCard.js b/daostar-website/src/components/ENSCard/ENSCard.js new file mode 100644 index 0000000..8f07011 --- /dev/null +++ b/daostar-website/src/components/ENSCard/ENSCard.js @@ -0,0 +1,39 @@ +import React, { Fragment } from 'react'; +import { Card, Divider } from '@blueprintjs/core'; +import '../AttestationCard/AttestationCard.css'; + +const DisplayENSTextRecord = ({ + id, + key, + value, + resolver +}) => { + const daoName = resolver?.domain?.name ?? "Unknown DAO"; + const daoAddress = resolver?.domain?.resolvedAddress?.id ?? "Unknown DAO"; + const daoURI = value ? value : "https://daostar.org/registration"; + + return ( + + + {daoName} + + + + ENS ID: + {id} + + + DAO Address: + {daoAddress} + + + DAO URI: + {daoURI} + + + + + ); +}; + +export default DisplayENSTextRecord; diff --git a/daostar-website/src/components/ExplorePage/ExplorePage.js b/daostar-website/src/components/ExplorePage/ExplorePage.js index 8f11825..861c05c 100644 --- a/daostar-website/src/components/ExplorePage/ExplorePage.js +++ b/daostar-website/src/components/ExplorePage/ExplorePage.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import RegistrationCard from "../RegistrationCard/RegistrationCard"; import AttestationCard from "../AttestationCard/AttestationCard"; +import ENSCard from "../ENSCard/ENSCard"; import "./ExplorePage.css"; import { InputGroup, Button } from "@blueprintjs/core"; import { filterEASbyId } from "../FilterRegistrations/Filter_Registrations_By_Id"; @@ -61,6 +62,7 @@ const NetworkButtons = [ { text: "Osmosis", filter: "osmosis" }, { text: "Stargaze", filter: "stargaze" }, { text: "EAS", filter: "easAttestations" }, + { text: "ENS", filter: "ensTextRecords"} ]; NetworkButtons.sort((a, b) => a.text.localeCompare(b.text)); @@ -70,7 +72,8 @@ const ExplorePage = ({ junosInstances, osmosisInstances, stargazeInstances, - easAttestations + easAttestations, + ENSTextRecords }) => { const [filterVal, setFilterVal] = useState(""); const onChangeFilter = (e) => setFilterVal(e.target.value); @@ -156,6 +159,11 @@ const ExplorePage = ({ .map((attestation, i) => ( )); + case "ensTextRecords": + return ENSTextRecords + .map((textRecord, i) => ( + + )); default: return ( <> diff --git a/daostar-website/src/components/ExplorePage/queries/registrations.js b/daostar-website/src/components/ExplorePage/queries/registrations.js index 522e859..b64dd7b 100644 --- a/daostar-website/src/components/ExplorePage/queries/registrations.js +++ b/daostar-website/src/components/ExplorePage/queries/registrations.js @@ -101,4 +101,24 @@ const ATTESTATIONS_BY_SCHEMA = gql` } `; -export default { REGISTRATIONS, REGISTRATION, REGISTRATIONSOLD, ATTESTATIONS_BY_SCHEMA } + + + +const ENS_QUERY = gql ` +query TextChangeds($where: TextChanged_filter, $first: Int) @api(contextKey: "apiName"){ + textChangeds(where: $where, first: $first) { + id + key + value + resolver { + domain { + name + resolvedAddress { + id + } + } + } + } +} +`; +export default { REGISTRATIONS, REGISTRATION, REGISTRATIONSOLD, ATTESTATIONS_BY_SCHEMA, ENS_QUERY } diff --git a/daostar-website/src/index.js b/daostar-website/src/index.js index 30242cf..8791dba 100644 --- a/daostar-website/src/index.js +++ b/daostar-website/src/index.js @@ -39,8 +39,8 @@ const client = new ApolloClient({ ethereum: "https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-ethereum-mainnet-v0", arbitrum: "https://api.thegraph.com/subgraphs/name/crazyyuan/daostar-arbitrum", easOptimismSepolia:"https://optimism-sepolia.easscan.org/graphql", - easOptimism:"https://optimism.easscan.org/graphql" - + easOptimism:"https://optimism.easscan.org/graphql", + ensTextRecords: "https://api.thegraph.com/subgraphs/name/ensdomains/ens" }, //defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar', httpSuffix: "",
+ ENS ID: + {id} +
+ DAO Address: + {daoAddress} +
+ DAO URI: + {daoURI} +