Skip to content

Commit

Permalink
tweaks for encoded label
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Jun 26, 2024
1 parent b1fbc2a commit 950e650
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"react-dom": "^18.2.0",
"react-transition-state": "^1.1.5",
"styled-components": "^6.1.11",
"viem": "latest",
"wagmi": "latest"
"viem": "2.13.6",
"wagmi": "2.9.9"
},
"devDependencies": {
"@biomejs/biome": "^1.1.2",
"@types/react": "^18.2.23",
"@types/react-dom": "^18.2.8",
"@vitejs/plugin-react": "^4.1.0",
"@wagmi/cli": "latest",
"@wagmi/cli": "2.1.8",
"buffer": "^6.0.3",
"typescript": "^5.2.2",
"vite": "^4.4.9"
Expand Down
3 changes: 2 additions & 1 deletion src/Deed.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isEncodedLabelhash, truncateFormat } from "@ensdomains/ensjs/utils";
import { Button, Card, Typography } from "@ensdomains/thorin";
import { type Address, type Hex, encodeFunctionData, formatEther, getAddress } from "viem";
import {
Expand Down Expand Up @@ -68,7 +69,7 @@ export const DeedComponent = ({ id, name, value, owner, isExact }: Props) => {
return (
<Card className="deed-card">
<div className="deed-data">
<Typography fontVariant="headingThree">{label}</Typography>
<Typography fontVariant="headingThree">{isEncodedLabelhash(label) ? truncateFormat(label) : label}</Typography>
<Typography>{formattedEth} ETH</Typography>
<Typography>Owned by {primaryName || owner}</Typography>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/query/reclaimSubgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const getDeedsForAccountQueryFn =
const decodedDeeds = account.deeds.map(({ id, value }, i) => ({
id,
value: BigInt(value),
name: isHash(decodedLabels[i]) ? truncateFormat(encodeLabelhash(decodedLabels[i])) : decodedLabels[i],
name: isHash(decodedLabels[i]) ? encodeLabelhash(decodedLabels[i]) : decodedLabels[i],
}));

return {
Expand Down
12 changes: 11 additions & 1 deletion src/wagmi.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { type CheckedChainWithEns, addresses, subgraphs } from "@ensdomains/ensjs/contracts";
import { type CheckedChainWithEns, addresses } from "@ensdomains/ensjs/contracts";
import { http, createConfig } from "wagmi";
import { mainnet } from "wagmi/chains";
import { injected } from "wagmi/connectors";

const ENS_SUBGRAPH_API_KEY = "9ad5cff64d93ed2c33d1a57b3ec03ea9";

const subgraphs = {
1: {
ens: {
url: `https://gateway-arbitrum.network.thegraph.com/api/${ENS_SUBGRAPH_API_KEY}/subgraphs/id/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH`,
},
},
};

const mainnetWithEns = {
...mainnet,
contracts: {
Expand Down

0 comments on commit 950e650

Please sign in to comment.