Skip to content

Commit d95f30f

Browse files
authored
migrate from hosted subgraph (#1975)
1 parent c5933b7 commit d95f30f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/content/data-feeds/ens.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ In Solidity, the address of the ENS registry must be known. According to [ENS do
7575

7676
ENS registry address: [0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e](https://etherscan.io/address/0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e).
7777

78-
Also, instead of using readable string names like `eth-usd.data.eth`, resolvers accept bytes32 hash IDs for names. Hash IDs can be retrieved from [this subgraph](https://thegraph.com/explorer/subgraph/ensdomains/ens) or via this npm package [eth-ens-namehash](https://www.npmjs.com/package/@ensdomains/eth-ens-namehash).
78+
Also, instead of using readable string names like `eth-usd.data.eth`, resolvers accept bytes32 hash IDs for names. Hash IDs can be retrieved from [this subgraph](https://thegraph.com/explorer/subgraphs/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH) or via this npm package [eth-ens-namehash](https://www.npmjs.com/package/@ensdomains/eth-ens-namehash).
7979

8080
"ETH / USD" hash: `0xf599f4cd075a34b92169cf57271da65a7a936c35e3f31e854447fbb3e7eb736d`
8181

src/features/ens/components/EnsLookupForm.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ export const EnsLookupForm = () => {
3030
}`,
3131
})
3232

33-
const response = await fetch("https://api.thegraph.com/subgraphs/name/ensdomains/ens", {
34-
method: "post",
35-
body: data,
36-
headers: {
37-
"Content-Type": "application/json",
38-
"Content-Length": data.length.toString(),
39-
"User-Agent": "Node",
40-
},
41-
})
33+
const response = await fetch(
34+
"https://gateway-arbitrum.network.thegraph.com/api/934b65a95f6dd6f3d9a468d9cdda9ec6/subgraphs/id/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH",
35+
{
36+
method: "post",
37+
body: data,
38+
headers: {
39+
"Content-Type": "application/json",
40+
"Content-Length": data.length.toString(),
41+
"User-Agent": "Node",
42+
},
43+
}
44+
)
4245
const json = await response.json()
4346
const hashName = json.data.domains[0] ? json.data.domains[0].id : "Not Found"
4447

0 commit comments

Comments
 (0)