Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refactor #4

Merged
merged 12 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tweaks for encoded label
  • Loading branch information
TateB committed Jun 26, 2024
commit 950e6505cde7a6d293ea99ce5a697ebda98a5384
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
Loading