Skip to content

Commit 30de66b

Browse files
authored
Merge pull request #514 from hypercerts-org/dev
Deprecate infura on prod
2 parents 77c1cdc + 0d5e4e8 commit 30de66b

25 files changed

+178
-170
lines changed

.env.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ NEXT_PUBLIC_ENVIRONMENT=test
22
NEXT_PUBLIC_WC_PROJECT_ID=<placeholder wc project id>
33
NEXT_PUBLIC_ALCHEMY_API_KEY="mock-alchemy-key"
44
NEXT_PUBLIC_DRPC_API_PKEY="mock-drpc-key"
5-
NEXT_PUBLIC_INFURA_API_KEY="mock-infura-key"
65
NEXT_PUBLIC_FILECOIN_API_KEY="mock-filecoin-key"

app/collections/[collectionId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const CollectionPageInner = async ({
1717
<div>
1818
<h3 className="text-2xl font-medium">{data.name}</h3>
1919
<p className="text-sm text-slate-500 pb-2">
20-
{data.sections.data[0].collection.description}
20+
{data.sections?.data?.[0]?.collections?.[0].description}
2121
</p>
2222

2323
<div className="pt-8 justify-center flex w-full">

app/collections/edit/[collectionId]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const EditCollectionPage = async ({
1717

1818
const prefilledValues: CollectionCreateFormValues = {
1919
id: collectionId,
20-
collectionId: data.sections.data[0].collection.id,
20+
collectionId: data.sections?.data?.[0]?.collections?.[0]?.id || "",
2121
title: data.name,
22-
description: data.sections.data[0].collection.description,
22+
description: data.sections?.data?.[0]?.collections?.[0]?.description || "",
2323
borderColor: data.tile_border_color || "#000000",
2424
backgroundImg: data.background_image || "",
2525
entries:
26-
data.sections.data[0].entries?.map((hc) => ({
26+
data.sections?.data?.[0]?.entries?.map((hc) => ({
2727
entryId: hc.id,
2828
factor: hc.display_size,
2929
})) || [],

app/profile/[address]/collections-tab-content-inner.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,23 @@ export const HyperboardsOverview = ({
3636
</div>
3737
)}
3838
<div className="flex flex-col gap-4">
39-
{hyperboards.map((hyperboard) => (
40-
<HyperboardRow
41-
key={hyperboard.id}
42-
hyperboardId={hyperboard.id}
43-
name={hyperboard.name || ""}
44-
description={
45-
hyperboard.sections?.data?.[0]?.collection.description || ""
46-
}
47-
showEditAndDeleteButtons={isOwnProfile}
48-
/>
49-
))}
39+
{hyperboards.map((hyperboard) => {
40+
if (!hyperboard.id) {
41+
return null;
42+
}
43+
return (
44+
<HyperboardRow
45+
key={hyperboard.id}
46+
hyperboardId={hyperboard.id}
47+
name={hyperboard.name || ""}
48+
description={
49+
hyperboard.sections?.data?.[0]?.collections?.[0].description ||
50+
""
51+
}
52+
showEditAndDeleteButtons={isOwnProfile}
53+
/>
54+
);
55+
})}
5056
</div>
5157
</div>
5258
);

attestations/getAttestations.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,26 @@ export async function getAttestations({
4343
}: GetAttestationsParams) {
4444
const where: Record<string, any> = {};
4545

46-
if (filter?.chainId) {
47-
where.chain_id = { eq: filter.chainId.toString() };
48-
}
46+
// where: {hypercert: {token_id: {eq: 292983117918928017041965536998752430063616}}, eas_schema: {uid: {eq: "0x2f4f575d5df78ac52e8b124c4c900ec4c540f1d44f5b8825fac0af5308c91449"}, chain_id: {eq: 11155111}}}
4947
if (filter?.contractAddress) {
5048
where.contract_address = { eq: filter.contractAddress };
5149
}
50+
5251
if (filter?.tokenId) {
53-
where.token_id = { eq: filter.tokenId.toString() };
52+
where.hypercert = { token_id: { eq: filter.tokenId } };
5453
}
5554

5655
if (filter?.schemaId) {
5756
where.eas_schema = { uid: { eq: filter.schemaId } };
5857
}
5958

59+
if (filter?.chainId) {
60+
where.eas_schema = {
61+
...(where.eas_schema || {}),
62+
chain_id: { eq: Number(filter.chainId) },
63+
};
64+
}
65+
6066
const res = await request(HYPERCERTS_API_URL_GRAPH, query, {
6167
first,
6268
offset,

attestations/getCreatorFeedAttestation.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const query = graphql(
99
query AttestationsQuery($where: AttestationWhereInput) {
1010
attestations(
1111
where: $where
12-
sort: { by: { creation_block_timestamp: descending } }
12+
sortBy: { creation_block_timestamp: descending }
1313
) {
1414
count
1515
data {
@@ -38,20 +38,25 @@ export async function getCreatorFeedAttestations({
3838
}: GetAttestationsParams) {
3939
const where: Record<string, any> = {};
4040

41-
if (filter?.chainId) {
42-
where.chain_id = { eq: filter.chainId.toString() };
43-
}
4441
if (filter?.contractAddress) {
4542
where.contract_address = { eq: filter.contractAddress };
4643
}
44+
4745
if (filter?.tokenId) {
48-
where.token_id = { eq: filter.tokenId.toString() };
46+
where.hypercert = { token_id: { eq: filter.tokenId } };
4947
}
5048

5149
if (filter?.schemaId) {
5250
where.eas_schema = { uid: { eq: filter.schemaId } };
5351
}
5452

53+
if (filter?.chainId) {
54+
where.eas_schema = {
55+
...(where.eas_schema || {}),
56+
chain_id: { eq: Number(filter.chainId) },
57+
};
58+
}
59+
5560
const res = await request(HYPERCERTS_API_URL_GRAPH, query, {
5661
first,
5762
offset,

collections/getCollectionById.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { HYPERCERTS_API_URL_GRAPH } from "@/configs/hypercerts";
88

99
const query = graphql(
1010
`
11-
query Hyperboard($id: UUID!) {
11+
query Hyperboard($id: String!) {
1212
hyperboards(where: { id: { eq: $id } }) {
1313
data {
1414
...HyperboardFragment

collections/getCollectionsByAdminAddress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const query = graphql(
1111
`
1212
query Collection($admin_address: String!, $first: Int, $offset: Int) {
1313
hyperboards(
14-
where: { admin_id: { eq: $admin_address } }
14+
where: { admin_address: { eq: $admin_address } }
1515
first: $first
1616
offset: $offset
1717
) {

collections/hyperboard.fragment.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ export const HyperboardFragment = graphql(`
44
fragment HyperboardFragment on Hyperboard {
55
id
66
admins {
7-
address
8-
chain_id
7+
data {
8+
address
9+
chain_id
10+
}
911
}
1012
name
1113
background_image
@@ -15,7 +17,7 @@ export const HyperboardFragment = graphql(`
1517
count
1618
data {
1719
label
18-
collection {
20+
collections {
1921
name
2022
admins {
2123
address
@@ -32,18 +34,22 @@ export const HyperboardFragment = graphql(`
3234
name
3335
total_units
3436
owners {
35-
percentage
36-
address
37-
units
38-
avatar
39-
display_name
37+
data {
38+
percentage
39+
address
40+
units
41+
avatar
42+
display_name
43+
}
4044
}
4145
}
4246
owners {
43-
percentage_owned
44-
address
45-
display_name
46-
avatar
47+
data {
48+
percentage_owned
49+
address
50+
display_name
51+
avatar
52+
}
4753
}
4854
}
4955
}

components/hypercert/creator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function Creator({ hypercert }: { hypercert: HypercertState }) {
1414
{hypercert.creator_address && (
1515
<div className="flex space-x-1 items-center">
1616
<span>by</span>
17-
<EthAddress address={hypercert.creator_address} />
17+
<EthAddress address={hypercert.creator_address} showEnsName />
1818
</div>
1919
)}
2020
{hypercert.contract?.chain_id && (

0 commit comments

Comments
 (0)