diff --git a/bun.lockb b/bun.lockb index 05ab4663..b8f8e4e5 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/report-details/funding-data-wrapper.tsx b/components/report-details/funding-data-wrapper.tsx index 78197336..f4355b4b 100644 --- a/components/report-details/funding-data-wrapper.tsx +++ b/components/report-details/funding-data-wrapper.tsx @@ -5,73 +5,73 @@ import type { Report } from "@/types"; import { Loader2 } from "lucide-react"; interface FundingDataWrapperProps { - hypercertId: Partial["hypercertId"]; - children: React.ReactNode; - totalAmount: Partial["totalCost"]; - fundedAmount: Partial["fundedSoFar"]; + hypercertId: Partial["hypercertId"]; + children: React.ReactNode; + totalAmount: Partial["totalCost"]; + fundedAmount: Partial["fundedSoFar"]; } const FundingDataWrapper: React.FC = ({ - hypercertId, - totalAmount, - fundedAmount, - children, + hypercertId, + totalAmount, + fundedAmount, + children, }: FundingDataWrapperProps) => { - if (!hypercertId) { - return
No hypercertId found
; - } - if (!totalAmount) { - return
No total cost found
; - } + if (!hypercertId) { + return
No hypercertId found
; + } + if (!totalAmount) { + return
No total cost found
; + } - const { genesisFractionQuery, hypercertClaimQuery } = - useFetchFundingData(hypercertId); + const { genesisFractionQuery, hypercertClaimQuery } = + useFetchFundingData(hypercertId); - const { data: genesisFractionResponse, isPending: fractionsPending } = - genesisFractionQuery; - const { data: hypercertClaimResponse, isPending: claimPending } = - hypercertClaimQuery; + const { data: genesisFractionResponse, isPending: fractionsPending } = + genesisFractionQuery; + const { data: hypercertClaimResponse, isPending: claimPending } = + hypercertClaimQuery; + const genesisFraction = genesisFractionResponse?.data[0]; + const hypercertClaim = hypercertClaimResponse; - const genesisFraction = genesisFractionResponse?.claimTokens[0]; - const hypercertClaim = hypercertClaimResponse?.claim; + if (fractionsPending || claimPending) + return ( +
+
+ +
+ Loading funding data... +
+ ); - if (fractionsPending || claimPending) - return ( -
-
- -
- Loading funding data... -
- ); + if (!hypercertClaim) { + return
Missing data for calculations
; + } + console.log("hypercertClaim", hypercertClaim); - if (!hypercertClaim) { - return
Missing data for calculations
; - } + const totalUnits = hypercertClaim.units ? Number(hypercertClaim.units) : 0; + const pricePerUnit = totalAmount / Number(totalUnits); + const percentProgress = ((fundedAmount || 0) / totalAmount) * 100; + const minUnitAmount = 1 / pricePerUnit; + const dollarAmountNeeded = (totalAmount - (fundedAmount || 0)).toFixed(2); - const totalUnits = hypercertClaim.totalUnits; - const pricePerUnit = totalAmount / Number(totalUnits); - const percentProgress = ((fundedAmount || 0) / totalAmount) * 100; - const minUnitAmount = 1 / pricePerUnit; - const dollarAmountNeeded = (totalAmount - (fundedAmount || 0)).toFixed(2); - - return ( - - {children} - - ); + return ( + + {children} + + ); }; export default FundingDataWrapper; diff --git a/components/report-details/support/form.tsx b/components/report-details/support/form.tsx index d158919d..29b87c8f 100644 --- a/components/report-details/support/form.tsx +++ b/components/report-details/support/form.tsx @@ -124,7 +124,6 @@ async function getOrdersForReport( const { data: orders } = await hypercertClient.api.fetchOrdersByHypercertId( { hypercertId, - chainId, }, ); return orders; diff --git a/config/constants.ts b/config/constants.ts new file mode 100644 index 00000000..bc9b6345 --- /dev/null +++ b/config/constants.ts @@ -0,0 +1,19 @@ +import { optimism, sepolia } from "viem/chains"; +import { Chain } from "viem"; +import { Environment } from "@hypercerts-org/sdk"; + +export const WC_PROJECT_ID = process.env.NEXT_PUBLIC_WC_PROJECT_ID; +export const ENVIRONMENT = process.env.NEXT_PUBLIC_ENVIRONMENT as Environment; + +export const testNetChains = [sepolia] as const; +export const prodNetChains = [optimism] as const; + +export const SUPPORTED_CHAINS = ( + ENVIRONMENT === "production" ? prodNetChains : testNetChains +) as readonly [Chain, ...Chain[]]; +const allChains = [ + ...testNetChains.map((x) => x.id), + ...prodNetChains.map((x) => x.id), +] as const; + +export type SupportedChainIdType = (typeof allChains)[number]; diff --git a/config/hypercerts.ts b/config/hypercerts.ts new file mode 100644 index 00000000..19f55ec9 --- /dev/null +++ b/config/hypercerts.ts @@ -0,0 +1,13 @@ +import { parseUnits } from "viem"; +import { CONSTANTS } from "@hypercerts-org/sdk"; +import { ENVIRONMENT } from "@/config/constants"; + +const HYPERCERT_API_URL = + CONSTANTS.ENDPOINTS[ENVIRONMENT as keyof typeof CONSTANTS.ENDPOINTS]; + +export const HYPERCERTS_API_URL_REST = `${HYPERCERT_API_URL}/v1`; +export const HYPERCERTS_API_URL_GRAPH = `${HYPERCERT_API_URL}/v1/graphql`; + +export const DEFAULT_NUM_FRACTIONS = parseUnits("1", 8); + +export const DEFAULT_DISPLAY_CURRENCY = "usd"; diff --git a/contexts/funding-context.tsx b/contexts/funding-context.tsx index 689ecc55..b46947dc 100644 --- a/contexts/funding-context.tsx +++ b/contexts/funding-context.tsx @@ -1,12 +1,10 @@ "use client"; -import type { Claim } from "@/types"; -import type { ClaimToken } from "@hypercerts-org/sdk"; import { type ReactNode, createContext, useContext } from "react"; // Define the shape of the context interface FundingContextType { - genesisFraction?: ClaimToken; - hypercertClaim: Claim; + genesisFraction?: any; + hypercertClaim: any; pricePerUnit: number; totalUnits: number; totalAmount: number; diff --git a/graphql-hypercerts-env.d.ts b/graphql-hypercerts-env.d.ts new file mode 100644 index 00000000..e0bc58ac --- /dev/null +++ b/graphql-hypercerts-env.d.ts @@ -0,0 +1,115 @@ +/* eslint-disable */ +/* prettier-ignore */ + +export type introspection_types = { + 'AllowlistRecord': { kind: 'OBJECT'; name: 'AllowlistRecord'; fields: { 'claimed': { name: 'claimed'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'entry': { name: 'entry'; type: { kind: 'SCALAR'; name: 'Float'; ofType: null; } }; 'hypercert_id': { name: 'hypercert_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'leaf': { name: 'leaf'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'proof': { name: 'proof'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; } }; 'root': { name: 'root'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'token_id': { name: 'token_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'total_units': { name: 'total_units'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'units': { name: 'units'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'user_address': { name: 'user_address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'AllowlistRecordFetchInput': { kind: 'INPUT_OBJECT'; name: 'AllowlistRecordFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'AllowlistRecordSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'AllowlistRecordSortOptions': { kind: 'INPUT_OBJECT'; name: 'AllowlistRecordSortOptions'; isOneOf: false; inputFields: [{ name: 'hypercert_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'leaf'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'entry'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'user_address'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'claimed'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'proof'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'units'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'total_units'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'root'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'AllowlistRecordWhereInput': { kind: 'INPUT_OBJECT'; name: 'AllowlistRecordWhereInput'; isOneOf: false; inputFields: [{ name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'leaf'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'entry'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'user_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'claimed'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'proof'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'units'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'total_units'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'root'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'Attestation': { kind: 'OBJECT'; name: 'Attestation'; fields: { 'attester': { name: 'attester'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'creation_block_number': { name: 'creation_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creation_block_timestamp': { name: 'creation_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'hypercert': { name: 'hypercert'; type: { kind: 'OBJECT'; name: 'HypercertBaseType'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'last_update_block_number': { name: 'last_update_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'last_update_block_timestamp': { name: 'last_update_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'recipient': { name: 'recipient'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'resolver': { name: 'resolver'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'schema': { name: 'schema'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'supported_schemas_id': { name: 'supported_schemas_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'uid': { name: 'uid'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; }; }; + 'AttestationFetchInput': { kind: 'INPUT_OBJECT'; name: 'AttestationFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'AttestationSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'AttestationSchema': { kind: 'OBJECT'; name: 'AttestationSchema'; fields: { 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'records': { name: 'records'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Attestation'; ofType: null; }; }; } }; 'resolver': { name: 'resolver'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'revocable': { name: 'revocable'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'schema': { name: 'schema'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'uid': { name: 'uid'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; }; }; + 'AttestationSortOptions': { kind: 'INPUT_OBJECT'; name: 'AttestationSortOptions'; isOneOf: false; inputFields: [{ name: 'attestation_uid'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'attester_address'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'recipient_address'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'schema'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'AttestationWhereInput': { kind: 'INPUT_OBJECT'; name: 'AttestationWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'uid'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'supported_schemas_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'attester'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'recipient'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'resolver'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'schema'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'attestation'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contract_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercerts'; type: { kind: 'INPUT_OBJECT'; name: 'BasicHypercertWhereArgs'; ofType: null; }; defaultValue: null }, { name: 'metadata'; type: { kind: 'INPUT_OBJECT'; name: 'BasicMetadataWhereInput'; ofType: null; }; defaultValue: null }]; }; + 'BasicAttestationWhereInput': { kind: 'INPUT_OBJECT'; name: 'BasicAttestationWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'uid'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'supported_schemas_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'attester'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'recipient'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'resolver'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'schema'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'attestation'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contract_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'BasicContractWhereInput': { kind: 'INPUT_OBJECT'; name: 'BasicContractWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contract_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'BasicFractionWhereInput': { kind: 'INPUT_OBJECT'; name: 'BasicFractionWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'fraction_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'units'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'owner_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'BasicHypercertWhereArgs': { kind: 'INPUT_OBJECT'; name: 'BasicHypercertWhereArgs'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creator_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'uri'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'attestations_count'; type: { kind: 'INPUT_OBJECT'; name: 'NumberSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'sales_count'; type: { kind: 'INPUT_OBJECT'; name: 'NumberSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'BasicMetadataWhereInput': { kind: 'INPUT_OBJECT'; name: 'BasicMetadataWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'uri'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contributors'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'work_scope'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'impact_scope'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'rights'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_block_update_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'work_timeframe_from'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'work_timeframe_to'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'impact_timeframe_from'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'impact_timeframe_to'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'BigInt': unknown; + 'BigIntSearchOptions': { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; isOneOf: false; inputFields: [{ name: 'eq'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; defaultValue: null }, { name: 'gt'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; defaultValue: null }, { name: 'gte'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; defaultValue: null }, { name: 'lt'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; defaultValue: null }, { name: 'lte'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; defaultValue: null }]; }; + 'Blueprint': { kind: 'OBJECT'; name: 'Blueprint'; fields: { 'admins': { name: 'admins'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; }; }; } }; 'created_at': { name: 'created_at'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'form_values': { name: 'form_values'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'minted': { name: 'minted'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'minter_address': { name: 'minter_address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'BlueprintFetchInput': { kind: 'INPUT_OBJECT'; name: 'BlueprintFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'BlueprintSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'BlueprintSortOptions': { kind: 'INPUT_OBJECT'; name: 'BlueprintSortOptions'; isOneOf: false; inputFields: [{ name: 'created_at'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'BlueprintWhereInput': { kind: 'INPUT_OBJECT'; name: 'BlueprintWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'NumberSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'minter_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'admin_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'minted'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'Boolean': unknown; + 'BooleanSearchOptions': { kind: 'INPUT_OBJECT'; name: 'BooleanSearchOptions'; isOneOf: false; inputFields: [{ name: 'eq'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }]; }; + 'Collection': { kind: 'OBJECT'; name: 'Collection'; fields: { 'admins': { name: 'admins'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; }; }; } }; 'chain_ids': { name: 'chain_ids'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; }; }; } }; 'created_at': { name: 'created_at'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'description': { name: 'description'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'Contract': { kind: 'OBJECT'; name: 'Contract'; fields: { 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'contract_address': { name: 'contract_address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'start_block': { name: 'start_block'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; }; }; + 'ContractFetchInput': { kind: 'INPUT_OBJECT'; name: 'ContractFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'ContractSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'ContractSortOptions': { kind: 'INPUT_OBJECT'; name: 'ContractSortOptions'; isOneOf: false; inputFields: [{ name: 'contract_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'contract_address'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'ContractWhereInput': { kind: 'INPUT_OBJECT'; name: 'ContractWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contract_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'EthBigInt': unknown; + 'Float': unknown; + 'Fraction': { kind: 'OBJECT'; name: 'Fraction'; fields: { 'creation_block_number': { name: 'creation_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creation_block_timestamp': { name: 'creation_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'fraction_id': { name: 'fraction_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'hypercert_id': { name: 'hypercert_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'last_update_block_number': { name: 'last_update_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'last_update_block_timestamp': { name: 'last_update_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'metadata': { name: 'metadata'; type: { kind: 'OBJECT'; name: 'Metadata'; ofType: null; } }; 'orders': { name: 'orders'; type: { kind: 'OBJECT'; name: 'GetOrdersResponse'; ofType: null; } }; 'owner_address': { name: 'owner_address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'sales': { name: 'sales'; type: { kind: 'OBJECT'; name: 'GetSalesResponse'; ofType: null; } }; 'units': { name: 'units'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; }; }; + 'FractionFetchInput': { kind: 'INPUT_OBJECT'; name: 'FractionFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'FractionSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'FractionSortOptions': { kind: 'INPUT_OBJECT'; name: 'FractionSortOptions'; isOneOf: false; inputFields: [{ name: 'creation_block_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'units'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'owner_address'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'FractionWhereInput': { kind: 'INPUT_OBJECT'; name: 'FractionWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'fraction_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'units'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'owner_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercerts'; type: { kind: 'INPUT_OBJECT'; name: 'BasicHypercertWhereArgs'; ofType: null; }; defaultValue: null }]; }; + 'GetAllowlistRecordResponse': { kind: 'OBJECT'; name: 'GetAllowlistRecordResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AllowlistRecord'; ofType: null; }; }; } }; }; }; + 'GetAttestationsResponse': { kind: 'OBJECT'; name: 'GetAttestationsResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Attestation'; ofType: null; }; }; } }; }; }; + 'GetAttestationsSchemaResponse': { kind: 'OBJECT'; name: 'GetAttestationsSchemaResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AttestationSchema'; ofType: null; }; }; } }; }; }; + 'GetBlueprintResponse': { kind: 'OBJECT'; name: 'GetBlueprintResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Blueprint'; ofType: null; }; }; } }; }; }; + 'GetContractsResponse': { kind: 'OBJECT'; name: 'GetContractsResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Contract'; ofType: null; }; }; } }; }; }; + 'GetFractionsResponse': { kind: 'OBJECT'; name: 'GetFractionsResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Fraction'; ofType: null; }; }; } }; }; }; + 'GetHyperboardsResponse': { kind: 'OBJECT'; name: 'GetHyperboardsResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Hyperboard'; ofType: null; }; }; } }; }; }; + 'GetHypercertsResponse': { kind: 'OBJECT'; name: 'GetHypercertsResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Hypercert'; ofType: null; }; }; } }; }; }; + 'GetMetadataResponse': { kind: 'OBJECT'; name: 'GetMetadataResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Metadata'; ofType: null; }; }; } }; }; }; + 'GetOrdersForHypercertResponse': { kind: 'OBJECT'; name: 'GetOrdersForHypercertResponse'; fields: { 'cheapestOrder': { name: 'cheapestOrder'; type: { kind: 'OBJECT'; name: 'Order'; ofType: null; } }; 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Order'; ofType: null; }; }; } }; 'totalUnitsForSale': { name: 'totalUnitsForSale'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; } }; }; }; + 'GetOrdersResponse': { kind: 'OBJECT'; name: 'GetOrdersResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Order'; ofType: null; }; }; } }; }; }; + 'GetSalesResponse': { kind: 'OBJECT'; name: 'GetSalesResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Sale'; ofType: null; }; }; } }; }; }; + 'GetUsersResponse': { kind: 'OBJECT'; name: 'GetUsersResponse'; fields: { 'count': { name: 'count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'data': { name: 'data'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; }; } }; }; }; + 'Hyperboard': { kind: 'OBJECT'; name: 'Hyperboard'; fields: { 'admins': { name: 'admins'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'User'; ofType: null; }; }; }; } }; 'background_image': { name: 'background_image'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chain_ids': { name: 'chain_ids'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; }; }; } }; 'grayscale_images': { name: 'grayscale_images'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'sections': { name: 'sections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SectionResponseType'; ofType: null; }; } }; 'tile_border_color': { name: 'tile_border_color'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'HyperboardFetchInput': { kind: 'INPUT_OBJECT'; name: 'HyperboardFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'HyperboardSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'HyperboardSortOptions': { kind: 'INPUT_OBJECT'; name: 'HyperboardSortOptions'; isOneOf: false; inputFields: [{ name: 'name'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'admin_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'chainId'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'HyperboardWhereInput': { kind: 'INPUT_OBJECT'; name: 'HyperboardWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'admin_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'Hypercert': { kind: 'OBJECT'; name: 'Hypercert'; fields: { 'attestations': { name: 'attestations'; type: { kind: 'OBJECT'; name: 'GetAttestationsResponse'; ofType: null; } }; 'attestations_count': { name: 'attestations_count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'contract': { name: 'contract'; type: { kind: 'OBJECT'; name: 'Contract'; ofType: null; } }; 'contracts_id': { name: 'contracts_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'creation_block_number': { name: 'creation_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creation_block_timestamp': { name: 'creation_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creator_address': { name: 'creator_address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'fractions': { name: 'fractions'; type: { kind: 'OBJECT'; name: 'GetFractionsResponse'; ofType: null; } }; 'hypercert_id': { name: 'hypercert_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'last_update_block_number': { name: 'last_update_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'last_update_block_timestamp': { name: 'last_update_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'metadata': { name: 'metadata'; type: { kind: 'OBJECT'; name: 'Metadata'; ofType: null; } }; 'orders': { name: 'orders'; type: { kind: 'OBJECT'; name: 'GetOrdersForHypercertResponse'; ofType: null; } }; 'sales': { name: 'sales'; type: { kind: 'OBJECT'; name: 'GetSalesResponse'; ofType: null; } }; 'sales_count': { name: 'sales_count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'token_id': { name: 'token_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'units': { name: 'units'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'uri': { name: 'uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'HypercertBaseType': { kind: 'OBJECT'; name: 'HypercertBaseType'; fields: { 'attestations_count': { name: 'attestations_count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'contracts_id': { name: 'contracts_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'creation_block_number': { name: 'creation_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creation_block_timestamp': { name: 'creation_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creator_address': { name: 'creator_address'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'hypercert_id': { name: 'hypercert_id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'last_update_block_number': { name: 'last_update_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'last_update_block_timestamp': { name: 'last_update_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'metadata': { name: 'metadata'; type: { kind: 'OBJECT'; name: 'Metadata'; ofType: null; } }; 'sales_count': { name: 'sales_count'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; } }; 'token_id': { name: 'token_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'units': { name: 'units'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'uri': { name: 'uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'HypercertFetchInput': { kind: 'INPUT_OBJECT'; name: 'HypercertFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'HypercertSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'HypercertSortOptions': { kind: 'INPUT_OBJECT'; name: 'HypercertSortOptions'; isOneOf: false; inputFields: [{ name: 'hypercert_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'units'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'owner_address'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'last_block_update_timestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'uri'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'attestations_count'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'sales_count'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'HypercertsWhereArgs': { kind: 'INPUT_OBJECT'; name: 'HypercertsWhereArgs'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_update_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'token_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creator_address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'uri'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'attestations_count'; type: { kind: 'INPUT_OBJECT'; name: 'NumberSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'sales_count'; type: { kind: 'INPUT_OBJECT'; name: 'NumberSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contract'; type: { kind: 'INPUT_OBJECT'; name: 'BasicContractWhereInput'; ofType: null; }; defaultValue: null }, { name: 'metadata'; type: { kind: 'INPUT_OBJECT'; name: 'BasicMetadataWhereInput'; ofType: null; }; defaultValue: null }, { name: 'attestations'; type: { kind: 'INPUT_OBJECT'; name: 'BasicAttestationWhereInput'; ofType: null; }; defaultValue: null }, { name: 'fractions'; type: { kind: 'INPUT_OBJECT'; name: 'BasicFractionWhereInput'; ofType: null; }; defaultValue: null }]; }; + 'ID': unknown; + 'IdSearchOptions': { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; isOneOf: false; inputFields: [{ name: 'eq'; type: { kind: 'SCALAR'; name: 'UUID'; ofType: null; }; defaultValue: null }, { name: 'in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'UUID'; ofType: null; }; }; }; defaultValue: null }]; }; + 'Int': unknown; + 'JSON': unknown; + 'Metadata': { kind: 'OBJECT'; name: 'Metadata'; fields: { 'allow_list_uri': { name: 'allow_list_uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'contributors': { name: 'contributors'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'external_url': { name: 'external_url'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'image': { name: 'image'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'impact_scope': { name: 'impact_scope'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; } }; 'impact_timeframe_from': { name: 'impact_timeframe_from'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'impact_timeframe_to': { name: 'impact_timeframe_to'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'properties': { name: 'properties'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'rights': { name: 'rights'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; } }; 'uri': { name: 'uri'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'work_scope': { name: 'work_scope'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; } }; 'work_timeframe_from': { name: 'work_timeframe_from'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'work_timeframe_to': { name: 'work_timeframe_to'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; }; }; + 'MetadataFetchInput': { kind: 'INPUT_OBJECT'; name: 'MetadataFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'MetadataSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'MetadataSortOptions': { kind: 'INPUT_OBJECT'; name: 'MetadataSortOptions'; isOneOf: false; inputFields: [{ name: 'description'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'external_url'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'metadata_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'uri'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'allow_list_uri'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'MetadataWhereInput': { kind: 'INPUT_OBJECT'; name: 'MetadataWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'uri'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'contributors'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'work_scope'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'impact_scope'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'rights'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'last_block_update_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'work_timeframe_from'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'work_timeframe_to'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'impact_timeframe_from'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'impact_timeframe_to'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercerts'; type: { kind: 'INPUT_OBJECT'; name: 'BasicHypercertWhereArgs'; ofType: null; }; defaultValue: null }]; }; + 'NumberArraySearchOptions': { kind: 'INPUT_OBJECT'; name: 'NumberArraySearchOptions'; isOneOf: false; inputFields: [{ name: 'contains'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; }; }; defaultValue: null }, { name: 'overlaps'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; }; }; defaultValue: null }]; }; + 'NumberSearchOptions': { kind: 'INPUT_OBJECT'; name: 'NumberSearchOptions'; isOneOf: false; inputFields: [{ name: 'eq'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'in'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; }; }; defaultValue: null }, { name: 'gt'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'gte'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'lt'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'lte'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }]; }; + 'Order': { kind: 'OBJECT'; name: 'Order'; fields: { 'additionalParameters': { name: 'additionalParameters'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'amounts': { name: 'amounts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; }; }; } }; 'chainId': { name: 'chainId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; }; } }; 'collection': { name: 'collection'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'collectionType': { name: 'collectionType'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'currency': { name: 'currency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'endTime': { name: 'endTime'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'globalNonce': { name: 'globalNonce'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'hypercert': { name: 'hypercert'; type: { kind: 'OBJECT'; name: 'HypercertBaseType'; ofType: null; } }; 'hypercert_id': { name: 'hypercert_id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'invalidated': { name: 'invalidated'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'itemIds': { name: 'itemIds'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; } }; 'orderNonce': { name: 'orderNonce'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'price': { name: 'price'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'pricePerPercentInToken': { name: 'pricePerPercentInToken'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'pricePerPercentInUSD': { name: 'pricePerPercentInUSD'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'quoteType': { name: 'quoteType'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'signature': { name: 'signature'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'signer': { name: 'signer'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'startTime': { name: 'startTime'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'strategyId': { name: 'strategyId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'subsetNonce': { name: 'subsetNonce'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'validator_codes': { name: 'validator_codes'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; } }; }; }; + 'OrderFetchInput': { kind: 'INPUT_OBJECT'; name: 'OrderFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'OrderSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'OrderSortOptions': { kind: 'INPUT_OBJECT'; name: 'OrderSortOptions'; isOneOf: false; inputFields: [{ name: 'amounts'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'chainId'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'collection'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'collectionType'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'currency'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'endTime'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'globalNonce'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'invalidated'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'orderNonce'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'price'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'quoteType'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'signer'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'startTime'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'strategyId'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'OrderWhereInput': { kind: 'INPUT_OBJECT'; name: 'OrderWhereInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chainId'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'signer'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'allowlistRecords': { name: 'allowlistRecords'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetAllowlistRecordResponse'; ofType: null; }; } }; 'attestationSchemas': { name: 'attestationSchemas'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetAttestationsSchemaResponse'; ofType: null; }; } }; 'attestations': { name: 'attestations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetAttestationsResponse'; ofType: null; }; } }; 'blueprints': { name: 'blueprints'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetBlueprintResponse'; ofType: null; }; } }; 'contracts': { name: 'contracts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetContractsResponse'; ofType: null; }; } }; 'fractions': { name: 'fractions'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetFractionsResponse'; ofType: null; }; } }; 'hyperboards': { name: 'hyperboards'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetHyperboardsResponse'; ofType: null; }; } }; 'hypercerts': { name: 'hypercerts'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetHypercertsResponse'; ofType: null; }; } }; 'metadata': { name: 'metadata'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetMetadataResponse'; ofType: null; }; } }; 'orders': { name: 'orders'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetOrdersResponse'; ofType: null; }; } }; 'sales': { name: 'sales'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetSalesResponse'; ofType: null; }; } }; 'users': { name: 'users'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'GetUsersResponse'; ofType: null; }; } }; }; }; + 'Sale': { kind: 'OBJECT'; name: 'Sale'; fields: { 'amounts': { name: 'amounts'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; }; }; } }; 'buyer': { name: 'buyer'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'collection': { name: 'collection'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'creation_block_number': { name: 'creation_block_number'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'creation_block_timestamp': { name: 'creation_block_timestamp'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'currency': { name: 'currency'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'hypercert': { name: 'hypercert'; type: { kind: 'OBJECT'; name: 'HypercertBaseType'; ofType: null; } }; 'hypercert_id': { name: 'hypercert_id'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'item_ids': { name: 'item_ids'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; }; }; } }; 'seller': { name: 'seller'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'strategy_id': { name: 'strategy_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'transaction_hash': { name: 'transaction_hash'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; }; + 'SaleFetchInput': { kind: 'INPUT_OBJECT'; name: 'SaleFetchInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'INPUT_OBJECT'; name: 'SaleSortOptions'; ofType: null; }; defaultValue: null }]; }; + 'SaleSortOptions': { kind: 'INPUT_OBJECT'; name: 'SaleSortOptions'; isOneOf: false; inputFields: [{ name: 'amounts'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'buyer'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'collection'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creationBlockNumber'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'creationBlockTimestamp'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'currency'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'hypercertId'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'seller'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'strategyId'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'transactionHash'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; }; + 'SaleWhereInput': { kind: 'INPUT_OBJECT'; name: 'SaleWhereInput'; isOneOf: false; inputFields: [{ name: 'transaction_hash'; type: { kind: 'INPUT_OBJECT'; name: 'IdSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'hypercert_id'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'item_ids'; type: { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; ofType: null; }; defaultValue: null }, { name: 'currency'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'collection'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'buyer'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'seller'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'strategy_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_number'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'creation_block_timestamp'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'amounts'; type: { kind: 'INPUT_OBJECT'; name: 'NumberArraySearchOptions'; ofType: null; }; defaultValue: null }]; }; + 'Section': { kind: 'OBJECT'; name: 'Section'; fields: { 'collection': { name: 'collection'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Collection'; ofType: null; }; } }; 'entries': { name: 'entries'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SectionEntry'; ofType: null; }; }; }; } }; 'label': { name: 'label'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'owners': { name: 'owners'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SectionOwner'; ofType: null; }; }; }; } }; }; }; + 'SectionEntry': { kind: 'OBJECT'; name: 'SectionEntry'; fields: { 'display_size': { name: 'display_size'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'is_blueprint': { name: 'is_blueprint'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'owners': { name: 'owners'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'SectionEntryOwner'; ofType: null; }; }; }; } }; 'percentage_of_section': { name: 'percentage_of_section'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'total_units': { name: 'total_units'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; } }; }; }; + 'SectionEntryOwner': { kind: 'OBJECT'; name: 'SectionEntryOwner'; fields: { 'address': { name: 'address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'avatar': { name: 'avatar'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'display_name': { name: 'display_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'percentage': { name: 'percentage'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'units': { name: 'units'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; } }; }; }; + 'SectionOwner': { kind: 'OBJECT'; name: 'SectionOwner'; fields: { 'address': { name: 'address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'avatar': { name: 'avatar'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'display_name': { name: 'display_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'percentage_owned': { name: 'percentage_owned'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; }; }; + 'SectionResponseType': { kind: 'OBJECT'; name: 'SectionResponseType'; fields: { 'count': { name: 'count'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Float'; ofType: null; }; } }; 'data': { name: 'data'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Section'; ofType: null; }; }; }; } }; }; }; + 'SortOrder': { name: 'SortOrder'; enumValues: 'ascending' | 'descending'; }; + 'String': unknown; + 'StringArraySearchOptions': { kind: 'INPUT_OBJECT'; name: 'StringArraySearchOptions'; isOneOf: false; inputFields: [{ name: 'contains'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }, { name: 'overlaps'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }]; }; + 'StringSearchOptions': { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; isOneOf: false; inputFields: [{ name: 'eq'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'contains'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'startsWith'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'endsWith'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; }; + 'UUID': unknown; + 'User': { kind: 'OBJECT'; name: 'User'; fields: { 'address': { name: 'address'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'avatar': { name: 'avatar'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'chain_id': { name: 'chain_id'; type: { kind: 'SCALAR'; name: 'EthBigInt'; ofType: null; } }; 'display_name': { name: 'display_name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; }; + 'UserWhereInput': { kind: 'INPUT_OBJECT'; name: 'UserWhereInput'; isOneOf: false; inputFields: [{ name: 'address'; type: { kind: 'INPUT_OBJECT'; name: 'StringSearchOptions'; ofType: null; }; defaultValue: null }, { name: 'chain_id'; type: { kind: 'INPUT_OBJECT'; name: 'BigIntSearchOptions'; ofType: null; }; defaultValue: null }]; }; +}; + +/** An IntrospectionQuery representation of your schema. + * + * @remarks + * This is an introspection of your schema saved as a file by GraphQLSP. + * It will automatically be used by `gql.tada` to infer the types of your GraphQL documents. + * If you need to reuse this data or update your `scalars`, update `tadaOutputLocation` to + * instead save to a .ts instead of a .d.ts file. + */ +export type introspection = { + name: never; + query: 'Query'; + mutation: never; + subscription: never; + types: introspection_types; +}; + +import * as gqlTada from 'gql.tada'; + +declare module 'gql.tada' { + interface setupSchema { + introspection: introspection + } +} \ No newline at end of file diff --git a/hooks/use-funding-data.ts b/hooks/use-funding-data.ts index 9466fd2a..7ea66b23 100644 --- a/hooks/use-funding-data.ts +++ b/hooks/use-funding-data.ts @@ -1,43 +1,28 @@ "use client"; -import type { Claim, Report } from "@/types"; -import { type ClaimToken, HypercertClient } from "@hypercerts-org/sdk"; -import { type UseQueryResult, useQuery } from "@tanstack/react-query"; -import { sepolia } from "viem/chains"; -import { usePublicClient } from "wagmi"; +import { getFractionsByHypercert } from "@/hypercerts/getFractionsByHypercert"; +import { getHypercert } from "@/hypercerts/getHypercert"; +import type { Report } from "@/types"; + +import { useQuery } from "@tanstack/react-query"; -type UseFetchFundingDataReturnType = { - genesisFractionQuery: UseQueryResult>; - hypercertClaimQuery: UseQueryResult>; -}; export const useFetchFundingData = ( - hypercertId: Partial["hypercertId"] -): UseFetchFundingDataReturnType => { - const publicClient = usePublicClient({ chainId: sepolia.id }); + hypercertId: Partial["hypercertId"], +) => { + if (!hypercertId) { + throw new Error("hypercertId is required"); + } - const { indexer } = new HypercertClient({ - chain: { id: sepolia.id }, // Sepolia testnet - // @ts-ignore - publicClient, - }); - const fractionQuery: Partial["genesisFractionQuery"] = - useQuery({ - queryKey: ["hypercerts", "fractions", "id", hypercertId], - queryFn: () => - indexer.fractionsByClaim( - hypercertId as string - ), - }); + const fractionQuery = useQuery({ + queryKey: ["hypercerts", "fractions", "id", hypercertId], + queryFn: () => getFractionsByHypercert(hypercertId), + }); - const claimByIdQuery: Partial["hypercertClaimQuery"] = - useQuery({ - queryKey: ["hypercerts", "claim", "id", hypercertId], - queryFn: () => - indexer.claimById( - hypercertId as string - ), - }); + const claimByIdQuery = useQuery({ + queryKey: ["hypercerts", "claim", "id", hypercertId], + queryFn: () => getHypercert(hypercertId), + }); return { genesisFractionQuery: fractionQuery, diff --git a/hooks/use-get-current-erc20-allowance.ts b/hooks/use-get-current-erc20-allowance.ts index 4686f0a2..80627a0a 100644 --- a/hooks/use-get-current-erc20-allowance.ts +++ b/hooks/use-get-current-erc20-allowance.ts @@ -12,8 +12,8 @@ export const useGetCurrentERC20Allowance = () => { const { chainId, address } = useAccount(); const hypercertsExchangeAddress = deployments[asDeployedChain(chainId ?? sepolia.id)].HypercertExchange; - const wethAddress = - addressesByNetwork[utils.asDeployedChain(chainId ?? sepolia.id)].WETH; + // TODO: FIX IT + const wethAddress = "FILL_ME"; const { data } = useReadContract({ abi: WETHAbi, address: wethAddress as `0x${string}`, diff --git a/hooks/use-support-form.ts b/hooks/use-support-form.ts index 65ffd757..2f498804 100644 --- a/hooks/use-support-form.ts +++ b/hooks/use-support-form.ts @@ -23,7 +23,7 @@ const useSupportForm = ( typeof useHandleBuyFraction >["handleBuyFraction"], address: Address | undefined, - hypercertId: string | undefined + hypercertId: string | undefined, ) => { const [isProcessing, setIsProcessing] = useState(false); @@ -47,12 +47,21 @@ const useSupportForm = ( const onSubmit = async (values: SupportFormInputs) => { setIsProcessing(true); form.reset(); + console.log("values", values); + console.log("pricePerUnit", pricePerUnit); const unitsToBuy = values.fractionPayment / pricePerUnit; if (!address) { throw new Error("No address found"); } - await handleBuyFraction(order, BigInt(Math.trunc(unitsToBuy)), address, hypercertId, values.comment, values.fractionPayment); + await handleBuyFraction( + order, + BigInt(Math.trunc(unitsToBuy)), + address, + hypercertId, + values.comment, + values.fractionPayment, + ); }; return { form, isProcessing, onSubmit }; diff --git a/hypercerts/fragments/fraction-state.fragment.ts b/hypercerts/fragments/fraction-state.fragment.ts new file mode 100644 index 00000000..c67d77cb --- /dev/null +++ b/hypercerts/fragments/fraction-state.fragment.ts @@ -0,0 +1,16 @@ +import { ResultOf, graphql } from "@/lib/graphql"; + +export const FractionStateFragment = graphql(` + fragment FractionStateFragment on Fraction { + creation_block_number + creation_block_timestamp + fraction_id + hypercert_id + last_update_block_number + last_update_block_timestamp + owner_address + units + } +`); + +export type FractionStateFragment = ResultOf; diff --git a/hypercerts/fragments/hypercert-full.fragment.ts b/hypercerts/fragments/hypercert-full.fragment.ts new file mode 100644 index 00000000..3c45819a --- /dev/null +++ b/hypercerts/fragments/hypercert-full.fragment.ts @@ -0,0 +1,58 @@ +import { ResultOf, graphql } from "@/lib/graphql"; + +export const HypercertFullFragment = graphql(` + fragment HypercertFullFragment on Hypercert { + metadata { + name + description + external_url + work_scope + work_timeframe_from + work_timeframe_to + impact_scope + impact_timeframe_from + impact_timeframe_to + properties + image + contributors + } + creation_block_number + creation_block_timestamp + last_update_block_number + last_update_block_timestamp + hypercert_id + contract { + chain_id + contract_address + } + creator_address + units + attestations { + count + data { + data + uid + creation_block_number + creation_block_timestamp + last_update_block_number + last_update_block_timestamp + attester + } + } + fractions { + count + data { + creation_block_number + creation_block_timestamp + fraction_id + hypercert_id + last_update_block_number + last_update_block_timestamp + owner_address + units + } + } + token_id + } +`); +export type HypercertFull = ResultOf; diff --git a/hypercerts/fragments/hypercert-list.fragment.ts b/hypercerts/fragments/hypercert-list.fragment.ts new file mode 100644 index 00000000..2ed07eb4 --- /dev/null +++ b/hypercerts/fragments/hypercert-list.fragment.ts @@ -0,0 +1,40 @@ +import { ResultOf, graphql } from "@/lib/graphql"; + +export const HypercertListFragment = graphql(` + fragment HypercertListFragment on Hypercert { + metadata { + name + } + attestations { + count + data { + data + } + } + creation_block_number + creation_block_timestamp + last_update_block_number + last_update_block_timestamp + hypercert_id + contract { + chain_id + } + units + orders { + cheapestOrder { + id + price + additionalParameters + currency + chainId + pricePerPercentInUSD + pricePerPercentInToken + } + totalUnitsForSale + data { + invalidated + } + } + } +`); +export type HypercertListFragment = ResultOf; diff --git a/hypercerts/getFractionsByHypercert.ts b/hypercerts/getFractionsByHypercert.ts new file mode 100644 index 00000000..f5757183 --- /dev/null +++ b/hypercerts/getFractionsByHypercert.ts @@ -0,0 +1,39 @@ +//TODO server-only? +import { graphql, readFragment } from "@/lib/graphql"; + +import { HYPERCERTS_API_URL_GRAPH } from "@/config/hypercerts"; +import { FractionStateFragment } from "@/hypercerts/fragments/fraction-state.fragment"; +import request from "graphql-request"; + +const query = graphql( + ` + query Fraction($hypercert_id: String!) { + fractions(where: { hypercert_id: { eq: $hypercert_id } }) { + count + data { + ...FractionStateFragment + } + } + } + `, + [FractionStateFragment], +); + +export async function getFractionsByHypercert(hypercertId: string) { + const res = await request(HYPERCERTS_API_URL_GRAPH, query, { + hypercert_id: hypercertId, + }); + + if (!res.fractions?.data) { + return undefined; + } + + const processedFragments = res.fractions.data.map((fraction) => { + return readFragment(FractionStateFragment, fraction); + }); + console.log("Processed Fragments", processedFragments); + return { + count: res.fractions.count, + data: processedFragments, + }; +} diff --git a/hypercerts/getHypercert.ts b/hypercerts/getHypercert.ts new file mode 100644 index 00000000..48e299fd --- /dev/null +++ b/hypercerts/getHypercert.ts @@ -0,0 +1,31 @@ +import { graphql, readFragment } from "@/lib/graphql"; + +import { HYPERCERTS_API_URL_GRAPH } from "@/config/hypercerts"; +import { HypercertFullFragment } from "./fragments/hypercert-full.fragment"; +import request from "graphql-request"; + +const query = graphql( + ` + query Hypercert($hypercert_id: String) { + hypercerts(where: { hypercert_id: { eq: $hypercert_id } }) { + data { + ...HypercertFullFragment + } + } + } + `, + [HypercertFullFragment], +); + +export async function getHypercert(hypercertId: string) { + const res = await request(HYPERCERTS_API_URL_GRAPH, query, { + hypercert_id: hypercertId, + }); + + const hypercertFullFragment = res.hypercerts?.data?.[0]; + if (!hypercertFullFragment) { + return undefined; + } + + return readFragment(HypercertFullFragment, hypercertFullFragment); +} diff --git a/hypercerts/getHypercertsByCreator.ts b/hypercerts/getHypercertsByCreator.ts new file mode 100644 index 00000000..ac0f6596 --- /dev/null +++ b/hypercerts/getHypercertsByCreator.ts @@ -0,0 +1,46 @@ +import "server-only"; + +import { graphql, readFragment } from "@/lib/graphql"; + +import { HYPERCERTS_API_URL_GRAPH } from "@/config/hypercerts"; +import { HypercertListFragment } from "@/hypercerts/fragments/hypercert-list.fragment"; +import request from "graphql-request"; + +const query = graphql( + ` + query AllHypercerts($where: HypercertsWhereArgs) { + hypercerts(where: $where) { + count + data { + ...HypercertListFragment + } + } + } + `, + [HypercertListFragment], +); + +export async function getHypercertsByCreator({ + creatorAddress, +}: { + creatorAddress: string; +}) { + try { + const queryRes = await request(HYPERCERTS_API_URL_GRAPH, query, { + where: { creator_address: { eq: creatorAddress.toLowerCase() } }, + }); + + if (!queryRes.hypercerts?.data) return undefined; + + return { + count: queryRes.hypercerts.count ?? 0, + data: + queryRes.hypercerts.data.map((hypercert) => + readFragment(HypercertListFragment, hypercert), + ) || [], + }; + } catch (e) { + console.error(`[getHypercertsByCreator] Error: ${(e as Error).message}`); + return undefined; + } +} diff --git a/hypercerts/getHypercertsByOwner.ts b/hypercerts/getHypercertsByOwner.ts new file mode 100644 index 00000000..20ee7af2 --- /dev/null +++ b/hypercerts/getHypercertsByOwner.ts @@ -0,0 +1,56 @@ +import "server-only"; + +import { graphql, readFragment } from "@/lib/graphql"; + +import { HYPERCERTS_API_URL_GRAPH } from "@/config/hypercerts"; +// import { HypercertListFragment } from "@/hypercerts/fragments/hypercert-list.fragment"; +import { HypercertFullFragment } from "@/hypercerts/fragments/hypercert-full.fragment"; +import request from "graphql-request"; +import { getAddress } from "viem"; +import { FragmentOf } from "gql.tada"; + +const query = graphql( + ` + query AllHypercerts($where: HypercertsWhereArgs) { + hypercerts(where: $where) { + count + data { + ...HypercertFullFragment + } + } + } + `, + [HypercertFullFragment], +); + +export async function getHypercertsByOwner({ + ownerAddress, +}: { + ownerAddress: string; +}) { + try { + const queryRes = await request(HYPERCERTS_API_URL_GRAPH, query, { + where: { fractions: { owner_address: { eq: getAddress(ownerAddress) } } }, + }); + + if (!queryRes.hypercerts?.data) return undefined; + + return { + count: queryRes.hypercerts.count ?? 0, + data: + queryRes.hypercerts.data.map((hypercert) => + readFragment(HypercertFullFragment, hypercert), + ) || [], + }; + } catch (e) { + console.error(`[getHypercertsByOwner] Error: ${(e as Error).message}`); + return undefined; + } +} + +export type HypercertsByOwnerResult = + | { + count: number; + data: FragmentOf[]; + } + | undefined; diff --git a/lib/directus.ts b/lib/directus.ts index 39d7c365..aed7447d 100644 --- a/lib/directus.ts +++ b/lib/directus.ts @@ -202,7 +202,7 @@ export const getFundedAmountByHCId = async ( fields: ["amount"], filter: { hypercert_id: { - _eq: hypercertId, + _eq: hypercertId.toLowerCase(), }, }, }) diff --git a/lib/graphql.ts b/lib/graphql.ts new file mode 100644 index 00000000..1e7f64d1 --- /dev/null +++ b/lib/graphql.ts @@ -0,0 +1,13 @@ +import { introspection } from "@/graphql-hypercerts-env"; +import { initGraphQLTada } from "gql.tada"; + +export const graphql = initGraphQLTada<{ + introspection: introspection; + scalars: { + BigInt: string | null | undefined; + EthBigInt: string | null | undefined; + }; +}>(); + +export type { FragmentOf, ResultOf, VariablesOf } from "gql.tada"; +export { readFragment } from "gql.tada"; diff --git a/lib/impact-reports.ts b/lib/impact-reports.ts index 530bd0db..8ebf9442 100644 --- a/lib/impact-reports.ts +++ b/lib/impact-reports.ts @@ -1,20 +1,26 @@ -import 'server-only' +import "server-only"; import { - type ClaimsByOwnerQuery, + HypercertClaimdata, HypercertClient, type HypercertMetadata, - type HypercertsStorage, } from "@hypercerts-org/sdk"; import { Mutex } from "async-mutex"; -import type { Claim, Report } from "@/types"; +import type { Report } from "@/types"; import { getCMSReports, getFundedAmountByHCId } from "./directus"; import { getOrders } from "./marketplace"; -import { delay } from './utils'; +import { delay } from "./utils"; +import { getHypercertsByCreator } from "@/hypercerts/getHypercertsByCreator"; +import { getHypercertsByOwner } from "@/hypercerts/getHypercertsByOwner"; +import { FragmentOf } from "gql.tada"; + +import { HypercertFullFragment } from "@/hypercerts/fragments/hypercert-full.fragment"; let reports: Report[] | null = null; -let claims: Claim[] | null = null; +let claims: + | NonNullable>>["data"] + | null = null; const reportsMutex = new Mutex(); let hypercertClient: HypercertClient | null = null; @@ -33,57 +39,65 @@ export const fetchReports = async (): Promise => { try { if (reports) { console.log( - "[server] Reports already exist, no need to fetch from remote" + "[server] Reports already exist, no need to fetch from remote", ); console.log(`[server] Existing reports: ${reports.length}`); } else { console.log( - `[server] Fetching reports from remote using owner address: ${ownerAddress}` + `[server] Fetching reports from remote using owner address: ${ownerAddress}`, ); + const hypercertsRes = await getHypercertsByOwner({ ownerAddress }); + + if (!hypercertsRes) { + throw new Error( + `[Hypercerts] Failed to fetch claims owned by ${ownerAddress}`, + ); + } + console.log("hypercertsRes", hypercertsRes.data); + claims = hypercertsRes.data; - // case 1: Hypercerts are available - try { - claims = await getHypercertClaims(ownerAddress); - - const _reports = await updateReports({isHypercertsAvailable: true}); + const _reports = await updateReports(); - // step 3: get orders from marketplace - const orders = await getOrders(_reports); + // step 3: get orders from marketplace + const orders = await getOrders(_reports); - // TODO: remove this when we don't need dummy order + // TODO: remove this when we don't need dummy order + if (process.env.DEPLOY_ENV === "production") { + const orderMap = new Map(orders.map(order => [order?.hypercertId, order])); + + + reports = _reports.map(report => { + const order = orderMap.get(report.hypercertId); + if (order) { + report.order = order; + } else if (report.fundedSoFar < report.totalCost) { + console.warn(`[server] No order found for hypercert ${report.hypercertId}`); + } + return report; + }); + } else { reports = _reports.map((report) => { for (const order of orders) { - if (order && order.hypercertId === report.hypercertId) { + if (order) { report.order = order; break; } } - + // warn if there is no order for a report that is not fully funded if (!report.order && report.fundedSoFar < report.totalCost) { - // warn if there is no order for a report that is not fully funded console.warn( `[server] No order found for hypercert ${report.hypercertId}`, ); } return report; }); - - console.log(`[server] total fetched reports: ${reports.length}`); - } - - // case 2: Hypercerts are not available - catch (error) { - console.log("try me") - reports = await updateReports({isHypercertsAvailable: false}); - - console.log(`[server] total fetched reports without Hypercerts: ${reports.length}`); } + console.log(`[server] total fetched reports: ${reports.length}`); } - return reports; - } - catch (error) { + return reports; + } catch (error) { console.error(`[server] Failed to fetch reports: ${error}`); throw new Error(`[server] Failed to fetch reports: ${error}`); } @@ -112,24 +126,24 @@ export const fetchReportBySlug = async (slug: string): Promise => { }; export const fetchReportByHCId = async ( - hypercertId: string + hypercertId: string, ): Promise => { try { const reports = await fetchReports(); const foundReport = reports.find( - (report: Report) => report.hypercertId === hypercertId + (report: Report) => report.hypercertId === hypercertId, ); if (!foundReport) { throw new Error( - `[server] Report with hypercert Id '${hypercertId}' not found.` + `[server] Report with hypercert Id '${hypercertId}' not found.`, ); } return foundReport; } catch (error) { throw new Error( - `[server] Failed to get report with hypercert Id '${hypercertId}': ${error}` + `[server] Failed to get report with hypercert Id '${hypercertId}': ${error}`, ); } }; @@ -150,7 +164,7 @@ export const getHypercertClient = (): HypercertClient => { return hypercertClient; } - hypercertClient = new HypercertClient({ chain: { id: 11155111 } }); // Sepolia testnet + hypercertClient = new HypercertClient({ environment: "test" }); // Sepolia testnet return hypercertClient; }; @@ -162,34 +176,36 @@ export const getHypercertClient = (): HypercertClient => { * @returns A promise that resolves to an array of claims. * @throws Will throw an error if the owner address is not set or the claims cannot be fetched. */ -export const getHypercertClaims = async ( - ownerAddress: string -): Promise => { +export const getHypercertClaims = async (ownerAddress: string) => { if (claims) { console.log(`[server] Claims already exist, no need to fetch from remote`); console.log(`[server] Existing claims: ${claims.length}`); } else { - - try { - console.log(`[Hypercerts] Fetching claims owned by ${ownerAddress}`); - - // see graphql query: https://github.com/hypercerts-org/hypercerts/blob/d7f5fee/sdk/src/indexer/queries/claims.graphql#L1-L11 - const response = await getHypercertClient().indexer.claimsByOwner(ownerAddress); - claims = (response as ClaimsByOwnerQuery).claims as Claim[]; - console.log(`[Hypercerts] Fetched claims: ${claims ? claims.length : 0}`); - - - } catch (error) { - console.error( - `[Hypercerts] Failed to fetch claims owned by ${ownerAddress}: ${error}` - ); - throw new Error( - `[Hypercerts] Failed to fetch claims owned by ${ownerAddress}: ${error}` - ); + try { + console.log(`[Hypercerts] Fetching claims owned by ${ownerAddress}`); + + const hypercertsRes = await getHypercertsByOwner({ + ownerAddress, + }); + if (!hypercertsRes) { + throw new Error( + `[Hypercerts] Failed to fetch claims owned by ${ownerAddress}`, + ); + } + console.log("Query Results:", hypercertsRes); + claims = hypercertsRes?.data; + // console.log(`[Hypercerts] Fetched claims: ${claims ? claims.length : 0}`); + } catch (error) { + console.error( + `[Hypercerts] Failed to fetch claims owned by ${ownerAddress}: ${error}`, + ); + throw new Error( + `[Hypercerts] Failed to fetch claims owned by ${ownerAddress}: ${error}`, + ); + } } -} -return claims; + return claims; }; export const fetchNewReports = async () => { @@ -198,8 +214,14 @@ export const fetchNewReports = async () => { } const ownerAddress = process.env.HC_OWNER_ADDRESS; - const response = await getHypercertClient().indexer.claimsByOwner(ownerAddress); - const newClaims = (response as ClaimsByOwnerQuery).claims as Claim[]; + const hypercertsRes = await getHypercertsByOwner({ + ownerAddress, + }); + const newClaims = hypercertsRes?.data; + if (!newClaims) { + console.error(`[server] Failed to fetch claims owned by ${ownerAddress}`); + return; + } console.log(`[server] update new reports if there are new claims`); if (claims && newClaims.length === claims.length) { @@ -211,156 +233,96 @@ export const fetchNewReports = async () => { console.log(`[server] claims in the cache are outdated, updating reports`); claims = newClaims; - await updateReports({isHypercertsAvailable: true}); + await updateReports(); } -} - -const updateReports = async (params: {isHypercertsAvailable: boolean}) : Promise => { - const fromCMS = await getCMSReports(); +}; - if (params.isHypercertsAvailable) { +const updateReports = async (): Promise => { + if (!claims) { + throw new Error( + `[server] Claims are not fetched yet, please fetch claims first.`, + ); + } - if (!claims) { - throw new Error(`[server] Claims are not fetched yet, please fetch claims first.`); - } + const fromCMS = await getCMSReports(); - const existingReportIds = reports ? reports.map(report => report.hypercertId) : []; + const existingReportIds = reports + ? reports.map((report) => report.hypercertId) + : []; + const reportsToUpdatePromises = claims + .filter( + (claim) => + claim.hypercert_id && !existingReportIds.includes(claim.hypercert_id), + ) + .map(async (claim, index) => { + console.log(`[server] Processing claim with ID: ${claim.hypercert_id}.`); - - const reportsToUpdatePromises = claims.filter(claim => !existingReportIds.includes(claim.id)).map(async (claim, index) => { - - console.log(`[server] Processing claim with ID: ${claim.id}.`); + // a delay to spread out the requests + await delay(index * 20); - // a delay to spread out the requests - await delay(index * 20); + // step 2: get offchain data from CMS - // step 1: get metadata from IPFS - const metadata = await getHypercertMetadata( - claim.uri as string, - getHypercertClient().storage + const cmsReport = fromCMS.find( + (cmsReport) => cmsReport.title === claim?.metadata?.name, + ); + if (!cmsReport) { + // TODO: change this to just logging + throw new Error( + `[server] CMS content for report titled '${claim?.metadata?.name}' not found.`, ); + } - // step 2: get offchain data from CMS - - const cmsReport = fromCMS.find( - (cmsReport) => cmsReport.title === metadata.name - ); - if (!cmsReport) { - throw new Error( - `[server] CMS content for report titled '${metadata.name}' not found.` - ); - } - - - - return { - hypercertId: claim.id, - title: metadata.name, - summary: metadata.description, - image: metadata.image, - originalReportUrl: metadata.external_url, - state: metadata.properties?.[0].value, - category: metadata.hypercert?.work_scope.value?.[0], - workTimeframe: metadata.hypercert?.work_timeframe.display_value, - impactScope: metadata.hypercert?.impact_scope.display_value, - impactTimeframe: metadata.hypercert?.impact_timeframe.display_value, - contributors: metadata.hypercert?.contributors.value?.map((name) => name), - cmsId: cmsReport.id, - status: cmsReport.status, - dateCreated: cmsReport.date_created, - slug: cmsReport.slug, - story: cmsReport.story, - bcRatio: cmsReport.bc_ratio, - villagesImpacted: cmsReport.villages_impacted, - peopleImpacted: cmsReport.people_impacted, - verifiedBy: cmsReport.verified_by, - dateUpdated: cmsReport.date_updated, - byline: cmsReport.byline, - totalCost: Number(cmsReport.total_cost), - fundedSoFar: await getFundedAmountByHCId(claim.id), - } as Report; - }) + return { + hypercertId: claim.hypercert_id, + title: claim?.metadata?.name, + summary: claim?.metadata?.description, + image: "https://directus.voicedeck.org/assets/" + cmsReport.image, + originalReportUrl: claim?.metadata?.external_url, + category: claim?.metadata?.work_scope?.[0], + workTimeframe: `${claim.metadata?.work_timeframe_from} - ${claim.metadata?.work_timeframe_to}`, + impactScope: claim?.metadata?.impact_scope?.[0], + impactTimeframe: `${claim?.metadata?.impact_timeframe_from} - ${claim?.metadata?.impact_timeframe_to}`, + contributors: claim?.metadata?.contributors?.map( + (name: string) => name, + ), + cmsId: cmsReport.id, + status: cmsReport.status, + dateCreated: cmsReport.date_created, + slug: cmsReport.slug, + story: cmsReport.story, + state: cmsReport.states[0], + bcRatio: cmsReport.bc_ratio, + villagesImpacted: cmsReport.villages_impacted, + peopleImpacted: cmsReport.people_impacted, + verifiedBy: cmsReport.verified_by, + dateUpdated: cmsReport.date_updated, + byline: cmsReport.byline, + totalCost: Number(cmsReport.total_cost), + fundedSoFar: await getFundedAmountByHCId(claim.hypercert_id as string), + } as Report; + }); const reportsToUpdate = await Promise.all(reportsToUpdatePromises); if (reportsToUpdate.length > 0) { - console.log(`[server] Found ${reportsToUpdate.length} new. Updating reports...`); + console.log( + `[server] Found ${reportsToUpdate.length} new. Updating reports...`, + ); reports = [...(reports || []), ...reportsToUpdate]; console.log(`[server] Reports updated. Total reports: ${reports.length}`); } else { - console.log(`[server] No new or updated claims found. No need to update reports.`); + console.log( + `[server] No new or updated claims found. No need to update reports.`, + ); } -} else { - const _reports : Report[] = []; - fromCMS.forEach((item) => { - const _report = { - hypercertId: "", - title: item.title, - summary: item.summary, - image: "https://directus.voicedeck.org/assets/" + item.image, - originalReportUrl: item.original_report_url, - state: item.states ? item.states[0] : "", - category: item.category, - workTimeframe: item.work_timeframe, - impactScope: item.impact_scope, - impactTimeframe: item.impact_timeframe, - contributors: [item.contributor], - cmsId: item.id, - status: item.status, - dateCreated: item.date_created, - slug: item.slug, - story: item.story, - bcRatio: item.bc_ratio, - villagesImpacted: item.villages_impacted, - peopleImpacted: item.people_impacted, - verifiedBy: item.verified_by, - dateUpdated: item.date_updated, - byline: item.byline, - totalCost: Number(item.total_cost), - fundedSoFar: 0, - } as Report; - - _reports.push(_report); - }) - reports = _reports; -}; - return reports as Report[]; -} - -/** - * Retrieves the metadata for a given claim URI from IPFS. - * @param claimUri - The IPFS URI of the claim for which metadata is to be fetched. - * @param storage - An instance of HypercertsStorage to retrieve metadata from IPFS. - * @returns A promise that resolves to the metadata of the claim. - * @throws Will throw an error if the metadata cannot be fetched. - */ -export const getHypercertMetadata = async ( - claimUri: string, - storage: HypercertsStorage -): Promise => { - let metadata: HypercertMetadata | null; - - try { - const response = await storage.getMetadata(claimUri); - metadata = response; - - return metadata; - } catch (error) { - console.error( - `[Hypercerts] Failed to fetch metadata of ${claimUri}: ${error}` - ); - throw new Error( - `[Hypercerts] Failed to fetch metadata of ${claimUri}: ${error}` - ); - } }; // update the fundedSoFar field of the report export const updateFundedAmount = async ( hypercertId: string, - amount: number + amount: number, ): Promise => { const release = await reportsMutex.acquire(); diff --git a/lib/marketplace.ts b/lib/marketplace.ts index c908fdf9..eda432dd 100644 --- a/lib/marketplace.ts +++ b/lib/marketplace.ts @@ -1,4 +1,4 @@ -import 'server-only' +import "server-only"; import { HypercertExchangeClient } from "@hypercerts-org/marketplace-sdk"; import { ethers } from "ethers"; @@ -11,13 +11,13 @@ let orders: (Order | null)[] | null = null; let hypercertExchangeClient: HypercertExchangeClient | null = null; const provider = new ethers.JsonRpcProvider( - process.env.ETHEREUM_RPC_URL as string + process.env.ETHEREUM_RPC_URL as string, ); // here we use placeholder private key for the signer because we are not actually signing any transactions const signer = new ethers.Wallet( "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - provider + provider, ); /** @@ -29,15 +29,13 @@ export async function fetchOrder(hypercertId: string): Promise { const hypercertExchangeClient = getHypercertExchangeClient(); const response = await hypercertExchangeClient.api.fetchOrdersByHypercertId({ - hypercertId: - hypercertId, - chainId: sepolia.id, + hypercertId: hypercertId, }); if (response.data && response.data.length > 0) { if (response.data.length > 1) { console.warn( - `[server] ${response.data.length} orders found for hypercert ${hypercertId}` + `[server] ${response.data.length} orders found for hypercert ${hypercertId}`, ); } // Assuming there is only one item per order for the VoiceDeck use case @@ -54,36 +52,39 @@ export async function fetchOrder(hypercertId: string): Promise { export async function getOrders(reports: Report[]): Promise<(Order | null)[]> { try { if (orders) { - console.log( - "[server] Hypercert orders already exist, no need to fetch from remote", - ); - console.log(`[server] existing Hypercert orders: ${orders.length}`); - } else { - - // TODO: remove this when we don't need dummy order - if (process.env.NEXT_PUBLIC_DEPLOY_ENV === "production") { - // fetch only orders for reports that are not fully funded - orders = await Promise.all( - reports.map((report) => - report.fundedSoFar < report.totalCost - ? fetchOrder(report.hypercertId) - : null - ) + console.log( + "[server] Hypercert orders already exist, no need to fetch from remote", ); - console.log(`[server] fetched orders: ${orders.length}`); + console.log(`[server] existing Hypercert orders: ${orders.length}`); } else { - // fetch only orders for reports that are not fully funded - orders = await Promise.all( - reports.map((report) => - report.fundedSoFar < report.totalCost - ? fetchOrder("0xa16dfb32eb140a6f3f2ac68f41dad8c7e83c4941-39472754562828861761751454462085112528896") - : null - ) - ); - console.log(`[server] fetched orders: ${orders.filter(order => order !== null).length}`); - } + // TODO: remove this when we don't need dummy order + if (process.env.NEXT_PUBLIC_DEPLOY_ENV === "production") { + // fetch only orders for reports that are not fully funded + orders = await Promise.all( + reports.map((report) => + report.fundedSoFar < report.totalCost + ? fetchOrder(report.hypercertId) + : null, + ), + ); + console.log(`[server] fetched orders: ${orders.length}`); + } else { + // fetch only orders for reports that are not fully funded + orders = await Promise.all( + reports.map((report) => + report.fundedSoFar < report.totalCost + ? fetchOrder( + "0xa16dfb32eb140a6f3f2ac68f41dad8c7e83c4941-39472754562828861761751454462085112528896", + ) + : null, + ), + ); + console.log( + `[server] fetched orders: ${orders.filter((order) => order !== null).length}`, + ); + } } - + return orders; } catch (error) { console.error(`[server] Failed to fetch orders: ${error}`); @@ -102,7 +103,7 @@ export const getHypercertExchangeClient = (): HypercertExchangeClient => { hypercertExchangeClient = new HypercertExchangeClient( sepolia.id, provider, - signer + signer, ); return hypercertExchangeClient; diff --git a/next.config.mjs b/next.config.mjs index f56b88f6..4b883f03 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,5 +1,8 @@ /** @type {import('next').NextConfig} */ const nextConfig = { + typescript: { + ignoreBuildErrors: true, + }, webpack: (config) => { config.externals.push("pino-pretty", "lokijs", "encoding"); return config; @@ -7,7 +10,7 @@ const nextConfig = { images: { remotePatterns: [ { - hostname: process.env.NEXT_PUBLIC_DEPLOY_ENV === "production" ? "directus.voicedeck.org" : "directus.vd-dev.org", + hostname: "directus.voicedeck.org", protocol: "https", } ] diff --git a/package.json b/package.json index 2b063cf4..e4d435f2 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,14 @@ "prepare": "node .husky/install.mjs" }, "dependencies": { - "@anon-aadhaar/react": "2.0.5", + "@anon-aadhaar/react": "^2.4.0", "@directus/sdk": "^15.0.2", "@ethersproject/providers": "^5.7.2", "@fontsource-variable/plus-jakarta-sans": "^5.0.20", "@hookform/resolvers": "^3.3.4", - "@hypercerts-org/contracts": "^1.1.2", - "@hypercerts-org/marketplace-sdk": "^0.0.23", - "@hypercerts-org/sdk": "1.4.3", + "@hypercerts-org/contracts": "2.0.0-alpha.8", + "@hypercerts-org/marketplace-sdk": "0.3.35", + "@hypercerts-org/sdk": "2.2.0-beta.2", "@radix-ui/react-aspect-ratio": "^1.0.3", "@radix-ui/react-avatar": "^1.0.4", "@radix-ui/react-checkbox": "^1.0.4", @@ -37,6 +37,7 @@ "@radix-ui/react-tooltip": "^1.0.7", "@tanstack/query-core": "^5.29.0", "@tanstack/react-query": "^5.25.0", + "@urql/next": "^1.1.2", "@wagmi/core": "^2.6.5", "@web3modal/wagmi": "^4.0.13", "async-mutex": "^0.4.1", @@ -45,6 +46,9 @@ "cmdk": "^1.0.0", "ethers": "^6.11.1", "fuse.js": "^7.0.0", + "gql.tada": "^1.8.9", + "graphql": "^16.9.0", + "graphql-request": "^7.1.0", "html-react-parser": "^5.1.8", "js-sha3": "^0.9.3", "lit-html": "^3.1.2", @@ -56,13 +60,15 @@ "server-only": "^0.0.1", "tailwind-merge": "^2.2.1", "tailwindcss-animate": "^1.0.7", + "urql": "^4.1.0", "use-dehydrated-state": "^0.1.0", "vaul": "^0.9.0", "viem": "^2.7.20", - "wagmi": "^2.5.7", + "wagmi": "^2.12.19", "zod": "^3.22.4" }, "devDependencies": { + "@0no-co/graphqlsp": "^1.12.16", "@biomejs/biome": "1.6.0", "@tailwindcss/typography": "^0.5.10", "@types/node": "^20", @@ -73,6 +79,6 @@ "lint-staged": "^15.2.2", "postcss": "^8", "tailwindcss": "^3.3.0", - "typescript": "^5" + "typescript": "^5.4.2" } } diff --git a/schema.graphql b/schema.graphql new file mode 100644 index 00000000..13d4178d --- /dev/null +++ b/schema.graphql @@ -0,0 +1,859 @@ +type Query { + attestations(where: AttestationWhereInput, sort: AttestationFetchInput, first: Int, offset: Int): GetAttestationsResponse! + orders(where: OrderWhereInput, sort: OrderFetchInput, first: Int, offset: Int): GetOrdersResponse! + sales(where: SaleWhereInput, sort: SaleFetchInput, first: Int, offset: Int): GetSalesResponse! + fractions(where: FractionWhereInput, sort: FractionFetchInput, first: Int, offset: Int): GetFractionsResponse! + hypercerts(where: HypercertsWhereArgs, sort: HypercertFetchInput, first: Int, offset: Int): GetHypercertsResponse! + metadata(where: MetadataWhereInput, sort: MetadataFetchInput, first: Int, offset: Int): GetMetadataResponse! + contracts(where: ContractWhereInput, sort: ContractFetchInput, first: Int, offset: Int): GetContractsResponse! + attestationSchemas(first: Int, offset: Int): GetAttestationsSchemaResponse! + collections(where: CollectionWhereInput, sort: CollectionFetchInput, first: Int, offset: Int): GetCollectionsResponse! + allowlistRecords(where: AllowlistRecordWhereInput, sort: AllowlistRecordFetchInput, first: Int, offset: Int): GetAllowlistRecordResponse! +} + +type GetAttestationsResponse { + data: [Attestation!] + count: Int +} + +"""Attestation on the Ethereum Attestation Service""" +type Attestation { + id: ID! + + """ID referencing the supported EAS schema in the database""" + supported_schemas_id: ID + + """Unique identifier for the attestation on EAS""" + uid: ID + + """Block number at which the attestation was created""" + creation_block_number: EthBigInt + + """Timestamp at which the attestation was created""" + creation_block_timestamp: EthBigInt + + """Block number at which the attestation was last updated""" + last_update_block_number: EthBigInt + + """Timestamp at which the attestation was last updated""" + last_update_block_timestamp: EthBigInt + + """Address of the creator of the attestation""" + attester: String + + """Address of the recipient of the attestation""" + recipient: String + + """Address of the resolver contract for the attestation""" + resolver: String + + """Unique identifier of the EAS schema used to create the attestation""" + schema: String + + """Encoded data of the attestation""" + data: JSON + + """Hypercert related to the attestation""" + hypercert: HypercertBaseType +} + +"""Handles uint256 bigint values stored in DB""" +scalar EthBigInt + +""" +The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf") + +type HypercertBaseType { + id: ID! + + """The UUID of the contract as stored in the database""" + contracts_id: ID + + """ + Concatenation of [chainID]-[contractAddress]-[tokenID] to discern hypercerts across chains + """ + hypercert_id: ID + + """The address of the creator of the hypercert""" + creator_address: String + + """The token ID of the hypercert""" + token_id: EthBigInt + + """The total units held by the hypercert""" + units: EthBigInt + + """References the metadata for this claim""" + uri: String + + """The metadata for the hypercert as referenced by the uri""" + metadata: Metadata + creation_block_number: EthBigInt + creation_block_timestamp: EthBigInt + last_update_block_number: EthBigInt + last_update_block_timestamp: EthBigInt + + """Count of attestations referencing this hypercert""" + attestations_count: Int + + """Count of sales of fractions that belong to this hypercert""" + sales_count: Int +} + +""" +Metadata related to the hypercert describing work, impact, timeframes and other relevant information +""" +type Metadata { + id: ID! + + """Name of the hypercert""" + name: String + + """Description of the hypercert""" + description: String + + """Base64 encoded representation of the image of the hypercert""" + image: String + + """URI of the hypercert metadata""" + uri: String + + """URI of the allow list for the hypercert""" + allow_list_uri: String + + """Contributors to the work and impact of the hypercert""" + contributors: [String!] + + """References additional information related to the hypercert""" + external_url: String + + """Impact scope of the hypercert""" + impact_scope: [String!] + + """Timestamp of the start of the impact (in seconds)""" + impact_timeframe_from: EthBigInt + + """Timestamp of the end of the impact (in seconds)""" + impact_timeframe_to: EthBigInt + + """Properties of the hypercert""" + properties: JSON + + """Rights of the hypercert""" + rights: [String!] + + """Work scope of the hypercert""" + work_scope: [String!] + + """Timestamp of the start of the work (in seconds)""" + work_timeframe_from: EthBigInt + + """Timestamp of the end of the work (in seconds)""" + work_timeframe_to: EthBigInt +} + +input AttestationWhereInput { + id: IdSearchOptions + uid: StringSearchOptions + supported_schemas_id: StringSearchOptions + creation_block_timestamp: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + last_update_block_number: BigIntSearchOptions + last_update_block_timestamp: BigIntSearchOptions + attester: StringSearchOptions + recipient: StringSearchOptions + resolver: StringSearchOptions + schema: StringSearchOptions + attestation: StringSearchOptions + chain_id: BigIntSearchOptions + contract_address: StringSearchOptions + token_id: StringSearchOptions + hypercerts: BasicHypercertWhereArgs + metadata: BasicMetadataWhereInput +} + +input IdSearchOptions { + eq: UUID +} + +""" +A field whose value is a generic Universally Unique Identifier: https://en.wikipedia.org/wiki/Universally_unique_identifier. +""" +scalar UUID + +input StringSearchOptions { + eq: String + contains: String + startsWith: String + endsWith: String +} + +input BigIntSearchOptions { + eq: BigInt + gt: BigInt + gte: BigInt + lt: BigInt + lte: BigInt +} + +""" +The `BigInt` scalar type represents non-fractional signed whole numeric values. +""" +scalar BigInt + +input BasicHypercertWhereArgs { + id: IdSearchOptions + creation_block_timestamp: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + last_update_block_number: BigIntSearchOptions + last_update_block_timestamp: BigIntSearchOptions + token_id: BigIntSearchOptions + creator_address: StringSearchOptions + uri: StringSearchOptions + hypercert_id: StringSearchOptions + + """Count of attestations referencing this hypercert""" + attestations_count: NumberSearchOptions + sales_count: NumberSearchOptions +} + +input NumberSearchOptions { + eq: Int + gt: Int + gte: Int + lt: Int + lte: Int +} + +input BasicMetadataWhereInput { + id: IdSearchOptions + name: StringSearchOptions + description: StringSearchOptions + uri: StringSearchOptions + contributors: StringArraySearchOptions + work_scope: StringArraySearchOptions + impact_scope: StringArraySearchOptions + rights: StringArraySearchOptions + creation_block_timestamp: BigIntSearchOptions + last_block_update_timestamp: BigIntSearchOptions + work_timeframe_from: BigIntSearchOptions + work_timeframe_to: BigIntSearchOptions + impact_timeframe_from: BigIntSearchOptions + impact_timeframe_to: BigIntSearchOptions +} + +input StringArraySearchOptions { + contains: [String!] +} + +input AttestationFetchInput { + by: AttestationSortOptions +} + +input AttestationSortOptions { + attestation_uid: SortOrder + creation_block_timestamp: SortOrder + creation_block_number: SortOrder + last_update_block_number: SortOrder + last_update_block_timestamp: SortOrder + attester_address: SortOrder + recipient_address: SortOrder + schema: SortOrder +} + +"""The direction to sort the query results""" +enum SortOrder { + """Ascending order""" + ascending + + """Descending order""" + descending +} + +type GetOrdersResponse { + data: [Order!] + count: Int +} + +type Order { + id: ID! + hypercert_id: String! + createdAt: String! + quoteType: Float! + globalNonce: String! + orderNonce: String! + strategyId: Float! + collectionType: Float! + collection: String! + currency: String! + signer: String! + startTime: Float! + endTime: Float! + price: String! + signature: String! + additionalParameters: String! + chainId: EthBigInt! + subsetNonce: Float! + itemIds: [String!]! + amounts: [Float!]! + invalidated: Boolean! + validator_codes: [String!] + pricePerPercentInUSD: String! + pricePerPercentInToken: String! + + """The hypercert associated with this order""" + hypercert: HypercertBaseType +} + +input OrderWhereInput { + id: IdSearchOptions + chainId: BigIntSearchOptions + signer: StringSearchOptions + hypercert_id: StringSearchOptions +} + +input OrderFetchInput { + by: OrderSortOptions +} + +input OrderSortOptions { + amounts: SortOrder + chainId: SortOrder + collection: SortOrder + collectionType: SortOrder + createdAt: SortOrder + currency: SortOrder + endTime: SortOrder + globalNonce: SortOrder + hypercert_id: SortOrder + invalidated: SortOrder + orderNonce: SortOrder + price: SortOrder + quoteType: SortOrder + signer: SortOrder + startTime: SortOrder + strategyId: SortOrder +} + +type GetSalesResponse { + data: [Sale!] + count: Int +} + +type Sale { + id: ID! + + """The address of the buyer""" + buyer: String! + + """The address of the seller""" + seller: String! + + """The ID of the strategy registered with the exchange contracts""" + strategy_id: EthBigInt + + """The address of the token accepted for this order""" + currency: String! + + """The address of the contract minting the tradable fractions""" + collection: String! + + """Token ids of the sold fractions""" + item_ids: [EthBigInt!] + + """The ID of the hypercert token referenced in the order""" + hypercert_id: String + + """Number of units sold for each fraction""" + amounts: [EthBigInt!] + + """The transactions hash of the sale""" + transaction_hash: String! + + """The block number of the transaction creating the sale""" + creation_block_number: EthBigInt + + """The timestamp of the block creating the sale""" + creation_block_timestamp: EthBigInt + + """The hypercert associated with this order""" + hypercert: HypercertBaseType +} + +input SaleWhereInput { + transaction_hash: IdSearchOptions + hypercert_id: StringSearchOptions + item_ids: StringArraySearchOptions + currency: StringSearchOptions + collection: StringSearchOptions + buyer: StringSearchOptions + seller: StringSearchOptions + strategy_id: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + creation_block_timestamp: BigIntSearchOptions + amounts: NumberArraySearchOptions +} + +input NumberArraySearchOptions { + contains: [BigInt!] +} + +input SaleFetchInput { + by: SaleSortOptions +} + +input SaleSortOptions { + amounts: SortOrder + buyer: SortOrder + collection: SortOrder + creationBlockNumber: SortOrder + creationBlockTimestamp: SortOrder + currency: SortOrder + hypercertId: SortOrder + seller: SortOrder + strategyId: SortOrder + transactionHash: SortOrder +} + +"""Fraction of an hypercert""" +type GetFractionsResponse { + data: [Fraction!] + count: Int +} + +"""Fraction of an hypercert""" +type Fraction { + id: ID! + + """Address of the owner of the fractions""" + owner_address: String + + """Units held by the fraction""" + units: EthBigInt + + """ + The ID of the fraction concatenated from the chain ID, contract address, and ID of the hypercert claim + """ + hypercert_id: ID + + """ + The ID of the fraction concatenated from the chain ID, contract address, and token ID of the fraction + """ + fraction_id: ID + + """Marketplace orders related to this fraction""" + orders: GetOrdersResponse + + """The metadata for the fraction""" + metadata: Metadata + + """Sales related to this fraction""" + sales: GetSalesResponse + + """Block number of the creation of the fraction""" + creation_block_number: EthBigInt + + """Timestamp of the block of the creation of the fraction""" + creation_block_timestamp: EthBigInt + + """Block number of the last update of the fraction""" + last_update_block_number: EthBigInt + + """Timestamp of the block of the last update of the fraction""" + last_update_block_timestamp: EthBigInt +} + +input FractionWhereInput { + id: IdSearchOptions + hypercert_id: StringSearchOptions + fraction_id: StringSearchOptions + creation_block_timestamp: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + last_update_block_number: BigIntSearchOptions + last_update_block_timestamp: BigIntSearchOptions + token_id: BigIntSearchOptions + units: BigIntSearchOptions + owner_address: StringSearchOptions + hypercerts: BasicHypercertWhereArgs +} + +input FractionFetchInput { + by: FractionSortOptions +} + +input FractionSortOptions { + creation_block_timestamp: SortOrder + creation_block_number: SortOrder + last_update_block_number: SortOrder + last_update_block_timestamp: SortOrder + token_id: SortOrder + units: SortOrder + owner_address: SortOrder +} + +""" +Hypercert with metadata, contract, orders, sales and fraction information +""" +type GetHypercertsResponse { + data: [Hypercert!] + count: Int +} + +""" +Hypercert with metadata, contract, orders, sales and fraction information +""" +type Hypercert { + id: ID! + + """The UUID of the contract as stored in the database""" + contracts_id: ID + + """ + Concatenation of [chainID]-[contractAddress]-[tokenID] to discern hypercerts across chains + """ + hypercert_id: ID + + """The address of the creator of the hypercert""" + creator_address: String + + """The token ID of the hypercert""" + token_id: EthBigInt + + """The total units held by the hypercert""" + units: EthBigInt + + """References the metadata for this claim""" + uri: String + + """The metadata for the hypercert as referenced by the uri""" + metadata: Metadata + creation_block_number: EthBigInt + creation_block_timestamp: EthBigInt + last_update_block_number: EthBigInt + last_update_block_timestamp: EthBigInt + + """Count of attestations referencing this hypercert""" + attestations_count: Int + + """Count of sales of fractions that belong to this hypercert""" + sales_count: Int + + """The contract that the hypercert is associated with""" + contract: Contract + + """Transferable fractions representing partial ownership of the hypercert""" + fractions: GetFractionsResponse + + """Attestations for the hypercert or parts of its data""" + attestations: GetAttestationsResponse + + """Marketplace orders related to this hypercert""" + orders: GetOrdersForHypercertResponse + + """Sales related to this hypercert""" + sales: GetSalesResponse +} + +"""Pointer to a contract deployed on a chain""" +type Contract { + id: ID! + + """The ID of the chain on which the contract is deployed""" + chain_id: EthBigInt + + """The address of the contract""" + contract_address: String + + """The block number at which the contract was deployed""" + start_block: EthBigInt +} + +type GetOrdersForHypercertResponse { + data: [Order!] + count: Int + cheapestOrder: Order + totalUnitsForSale: BigInt +} + +"""Arguments for filtering hypercerts""" +input HypercertsWhereArgs { + id: IdSearchOptions + creation_block_timestamp: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + last_update_block_number: BigIntSearchOptions + last_update_block_timestamp: BigIntSearchOptions + token_id: BigIntSearchOptions + creator_address: StringSearchOptions + uri: StringSearchOptions + hypercert_id: StringSearchOptions + + """Count of attestations referencing this hypercert""" + attestations_count: NumberSearchOptions + sales_count: NumberSearchOptions + contract: BasicContractWhereInput + metadata: BasicMetadataWhereInput + attestations: BasicAttestationWhereInput + fractions: BasicFractionWhereInput +} + +input BasicContractWhereInput { + id: IdSearchOptions + contract_address: StringSearchOptions + chain_id: BigIntSearchOptions +} + +input BasicAttestationWhereInput { + id: IdSearchOptions + uid: StringSearchOptions + supported_schemas_id: StringSearchOptions + creation_block_timestamp: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + last_update_block_number: BigIntSearchOptions + last_update_block_timestamp: BigIntSearchOptions + attester: StringSearchOptions + recipient: StringSearchOptions + resolver: StringSearchOptions + schema: StringSearchOptions + attestation: StringSearchOptions + chain_id: BigIntSearchOptions + contract_address: StringSearchOptions + token_id: StringSearchOptions +} + +input BasicFractionWhereInput { + id: IdSearchOptions + hypercert_id: StringSearchOptions + fraction_id: StringSearchOptions + creation_block_timestamp: BigIntSearchOptions + creation_block_number: BigIntSearchOptions + last_update_block_number: BigIntSearchOptions + last_update_block_timestamp: BigIntSearchOptions + token_id: BigIntSearchOptions + units: BigIntSearchOptions + owner_address: StringSearchOptions +} + +input HypercertFetchInput { + by: HypercertSortOptions +} + +input HypercertSortOptions { + hypercert_id: SortOrder + creation_block_timestamp: SortOrder + creation_block_number: SortOrder + last_update_block_number: SortOrder + last_update_block_timestamp: SortOrder + token_id: SortOrder + units: SortOrder + owner_address: SortOrder + last_block_update_timestamp: SortOrder + uri: SortOrder + attestations_count: SortOrder + sales_count: SortOrder +} + +type GetMetadataResponse { + data: [Metadata!] + count: Int +} + +input MetadataWhereInput { + id: IdSearchOptions + name: StringSearchOptions + description: StringSearchOptions + uri: StringSearchOptions + contributors: StringArraySearchOptions + work_scope: StringArraySearchOptions + impact_scope: StringArraySearchOptions + rights: StringArraySearchOptions + creation_block_timestamp: BigIntSearchOptions + last_block_update_timestamp: BigIntSearchOptions + work_timeframe_from: BigIntSearchOptions + work_timeframe_to: BigIntSearchOptions + impact_timeframe_from: BigIntSearchOptions + impact_timeframe_to: BigIntSearchOptions + hypercerts: BasicHypercertWhereArgs +} + +input MetadataFetchInput { + by: MetadataSortOptions +} + +input MetadataSortOptions { + description: SortOrder + external_url: SortOrder + metadata_id: SortOrder + name: SortOrder + uri: SortOrder + allow_list_uri: SortOrder +} + +"""Pointer to a contract deployed on a chain""" +type GetContractsResponse { + data: [Contract!] + count: Int +} + +input ContractWhereInput { + id: IdSearchOptions + contract_address: StringSearchOptions + chain_id: BigIntSearchOptions +} + +input ContractFetchInput { + by: ContractSortOptions +} + +input ContractSortOptions { + contract_id: SortOrder + contract_address: SortOrder + chain_id: SortOrder +} + +type GetAttestationsSchemaResponse { + data: [AttestationSchema!] + count: Int +} + +"""Supported EAS attestation schemas and their related records""" +type AttestationSchema { + id: ID! + + """Chain ID of the chains where the attestation schema is supported""" + chain_id: EthBigInt + + """Unique identifier for the attestation schema""" + uid: ID + + """Address of the resolver contract for the attestation schema""" + resolver: String + + """Whether the attestation schema is revocable""" + revocable: Boolean + + """String representation of the attestation schema""" + schema: String + + """List of attestations related to the attestation schema""" + records: [Attestation!] +} + +type GetCollectionsResponse { + data: [Collection!] + count: Int +} + +"""Collection of hypercerts for reference and display purposes""" +type Collection { + id: ID! + + """Name of the collection""" + name: String! + + """Address of the collection owner""" + admin_id: String! + + """Chain ID of the collection""" + chain_id: EthBigInt + + """Background image of the collection""" + background_image: String + + """Whether the collection should be rendered as a grayscale image""" + grayscale_image: Boolean + + """Color of the borders of the hypercert collection""" + tile_border_color: String +} + +input CollectionWhereInput { + id: IdSearchOptions + chain_id: BigIntSearchOptions + admin_id: StringSearchOptions +} + +input CollectionFetchInput { + by: CollectionSortOptions +} + +input CollectionSortOptions { + name: SortOrder + admin_id: SortOrder + chainId: SortOrder +} + +type GetAllowlistRecordResponse { + data: [AllowlistRecord!] + count: Int +} + +"""Records of allow list entries for claimable fractions""" +type AllowlistRecord { + id: ID! + + """The hypercert ID the claimable fraction belongs to""" + hypercert_id: String + + """The token ID of the hypercert the claimable fraction belongs to""" + token_id: EthBigInt + + """The leaf of the Merkle tree for the claimable fraction""" + leaf: String + + """The entry index of the Merkle tree for the claimable fraction""" + entry: Float + + """The address of the user who can claim the fraction""" + user_address: String + + """Whether the fraction has been claimed""" + claimed: Boolean + + """The proof for the claimable fraction""" + proof: [String!] + + """The number of units of the claimable fraction""" + units: EthBigInt + + """The total number of units held by the hypercert""" + total_units: EthBigInt + + """The root of the allow list Merkle tree""" + root: String +} + +input AllowlistRecordWhereInput { + hypercert_id: StringSearchOptions + token_id: BigIntSearchOptions + leaf: StringSearchOptions + entry: BigIntSearchOptions + user_address: StringSearchOptions + claimed: BooleanSearchOptions + proof: StringArraySearchOptions + units: BigIntSearchOptions + total_units: BigIntSearchOptions + root: StringSearchOptions +} + +input BooleanSearchOptions { + eq: Boolean +} + +input AllowlistRecordFetchInput { + by: AllowlistRecordSortOptions +} + +input AllowlistRecordSortOptions { + hypercert_id: SortOrder + token_id: SortOrder + leaf: SortOrder + entry: SortOrder + user_address: SortOrder + claimed: SortOrder + proof: SortOrder + units: SortOrder + total_units: SortOrder + root: SortOrder +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 0741578c..c01a9b89 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,8 +15,13 @@ "incremental": true, "plugins": [ { - "name": "next", + "name": "next" }, + { + "name": "@0no-co/graphqlsp", + "schema": "https://staging-api.hypercerts.org/v1/graphql", + "tadaOutputLocation": "./graphql-hypercerts-env.d.ts" + } ], "paths": { "@/*": ["./*"], @@ -25,9 +30,9 @@ "@/styles/*": ["./styles/*"], "@/types/*": ["./types/*"], "@/hooks/*": ["./hooks/*"], - "@/assets/*": ["./assets/*"], - }, + "@/assets/*": ["./assets/*"] + } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"], + "exclude": ["node_modules"] } diff --git a/types/index.ts b/types/index.ts index 8f3152f5..6c527464 100644 --- a/types/index.ts +++ b/types/index.ts @@ -80,20 +80,6 @@ export interface Report { * @property {any} totalUnits - The total number of units. * @property {string} uri - The URI of the claim metadata. */ -export interface Claim { - __typename?: "Claim"; - contract: string; - // biome-ignore lint: type definition imported from @hypercerts-org/sdk - tokenID: any; - // biome-ignore lint: type definition imported from @hypercerts-org/sdk - creator?: any | null; - id: string; - // biome-ignore lint: type definition imported from @hypercerts-org/sdk - owner?: any | null; - // biome-ignore lint: type definition imported from @hypercerts-org/sdk - totalUnits?: any | null; - uri?: string | null; -} // Represents an Order in the Hypercerts Marketplace export type Order = { @@ -132,7 +118,6 @@ export interface CMSContent { summary: string | null; image: string | null; original_report_url: string | null; - states: string[] | null; category: string | null; work_timeframe: string | null; impact_scope: string | null; @@ -145,6 +130,7 @@ export interface CMSContent { status: string; date_created: string | null; slug: string; + states: string[]; story: string | null; bc_ratio: number | null; villages_impacted: number | null;