From 05c014b17fa57ec02931dd8e459dfd2356f25ff7 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Mon, 25 Mar 2024 18:43:42 -0600 Subject: [PATCH 1/7] (feat): add support for querying from multiple chains at the same time --- pnpm-lock.yaml | 17 +-- sdk/package.json | 5 +- sdk/src/constants.ts | 7 +- sdk/src/indexer.ts | 198 ++++++++++++++++++++++----------- sdk/src/indexer/gql/graphql.ts | 2 + sdk/src/types/client.ts | 9 ++ sdk/src/types/indexer.ts | 5 +- sdk/test/utils/config.test.ts | 2 +- 8 files changed, 170 insertions(+), 75 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17a77b2f..679811f9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -574,8 +574,8 @@ importers: specifier: ^1.0.5 version: 1.0.5 '@urql/core': - specifier: ^4.2.0 - version: 4.2.0(graphql@16.8.1) + specifier: ^4.3.0 + version: 4.3.0(graphql@16.8.1) '@whatwg-node/fetch': specifier: ^0.9.13 version: 0.9.14 @@ -603,6 +603,9 @@ importers: viem: specifier: ^1.21.4 version: 1.21.4(typescript@5.3.2) + wonka: + specifier: ^6.3.4 + version: 6.3.4 devDependencies: '@babel/core': specifier: ^7.23.5 @@ -7356,7 +7359,7 @@ packages: '@graphql-typed-document-node/core': 3.2.0(graphql@16.8.1) '@hypercerts-org/contracts': 1.1.2(typescript@5.1.6) '@openzeppelin/merkle-tree': 1.0.5 - '@urql/core': 4.2.0(graphql@16.8.1) + '@urql/core': 4.3.0(graphql@16.8.1) '@whatwg-node/fetch': 0.9.14 ajv: 8.12.0 axios: 1.6.2(debug@4.3.4) @@ -12319,8 +12322,8 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@urql/core@4.2.0(graphql@16.8.1): - resolution: {integrity: sha512-GRkZ4kECR9UohWAjiSk2UYUetco6/PqSrvyC4AH6g16tyqEShA63M232cfbE1J9XJPaGNjia14Gi+oOqzp144w==} + /@urql/core@4.3.0(graphql@16.8.1): + resolution: {integrity: sha512-wT+FeL8DG4x5o6RfHEnONNFVDM3616ouzATMYUClB6CB+iIu2mwfBKd7xSUxYOZmwtxna5/hDRQdMl3nbQZlnw==} dependencies: '@0no-co/graphql.web': 1.0.4(graphql@16.8.1) wonka: 6.3.4 @@ -27790,7 +27793,7 @@ packages: /puppeteer@18.2.1: resolution: {integrity: sha512-7+UhmYa7wxPh2oMRwA++k8UGVDxh3YdWFB52r9C3tM81T6BU7cuusUSxImz0GEYSOYUKk/YzIhkQ6+vc0gHbxQ==} engines: {node: '>=14.1.0'} - deprecated: < 21.5.0 is no longer supported + deprecated: < 21.8.0 is no longer supported requiresBuild: true dependencies: https-proxy-agent: 5.0.1 @@ -32033,7 +32036,7 @@ packages: peerDependencies: react: '>= 16.8.0' dependencies: - '@urql/core': 4.2.0(graphql@16.8.1) + '@urql/core': 4.3.0(graphql@16.8.1) react: 18.2.0 wonka: 6.3.4 transitivePeerDependencies: diff --git a/sdk/package.json b/sdk/package.json index 3ac4d84b..f5b6b93c 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -26,7 +26,7 @@ "@graphql-typed-document-node/core": "^3.2.0", "@hypercerts-org/contracts": "1.1.2", "@openzeppelin/merkle-tree": "^1.0.5", - "@urql/core": "^4.2.0", + "@urql/core": "^4.3.0", "@whatwg-node/fetch": "^0.9.13", "ajv": "^8.11.2", "axios": "^1.6.2", @@ -35,7 +35,8 @@ "graphql": "^16.8.1", "loglevel": "^1.8.1", "urql": "^4.0.6", - "viem": "^1.21.4" + "viem": "^1.21.4", + "wonka": "^6.3.4" }, "devDependencies": { "@babel/core": "^7.23.5", diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index b6956c20..85582795 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -5,7 +5,7 @@ import { Deployment, SupportedChainIds } from "./types"; import { deployments } from "@hypercerts-org/contracts"; -const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercerts-admin"; +const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercerts-org"; // The APIs we expose @@ -20,26 +20,31 @@ const DEPLOYMENTS: { [key in SupportedChainIds]: Partial } = { addresses: deployments[10], graphName: "hypercerts-optimism-mainnet", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-optimism-mainnet`, + isTestnet: false, } as const, 42220: { addresses: deployments[42220], graphName: "hypercerts-celo", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-celo`, + isTestnet: false, }, 11155111: { addresses: deployments[11155111], graphName: "hypercerts-sepolia", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-sepolia`, + isTestnet: true, } as const, 84532: { addresses: deployments[84532], graphName: "hypercerts-base-sepolia", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-base-sepolia`, + isTestnet: true, } as const, 8453: { addresses: deployments[8453], graphName: "hypercerts-base-mainnet", graphUrl: `${DEFAULT_GRAPH_BASE_URL}/hypercerts-base-mainnet`, + isTestnet: false, } as const, }; diff --git a/sdk/src/indexer.ts b/sdk/src/indexer.ts index 7abaeb53..d143799b 100644 --- a/sdk/src/indexer.ts +++ b/sdk/src/indexer.ts @@ -1,37 +1,46 @@ import { logger } from "./utils"; import { defaultQueryParams } from "./indexer/utils"; -import { HypercertClientConfig, HypercertIndexerInterface, QueryParams } from "./types"; -import { Client, cacheExchange, fetchExchange } from "@urql/core"; import { - ClaimsByOwnerDocument, - ClaimsByOwnerQueryVariables, + HypercertClientConfig, + HypercertIndexerInterface, + IndexerEnvironment, + QueryParams, + QueryParamsWithChainId, +} from "./types"; + +import { AnyVariables, cacheExchange, Client, fetchExchange } from "@urql/core"; +import { ClaimByIdDocument, ClaimByIdQueryVariables, - RecentClaimsDocument, - RecentClaimsQueryVariables, - ClaimTokensByOwnerDocument, - ClaimTokensByOwnerQueryVariables, - ClaimTokensByClaimDocument, - ClaimTokensByClaimQueryVariables, + ClaimsByOwnerDocument, + ClaimsByOwnerQueryVariables, ClaimTokenByIdDocument, ClaimTokenByIdQueryVariables, + ClaimTokensByClaimDocument, + ClaimTokensByClaimQueryVariables, + ClaimTokensByOwnerDocument, + ClaimTokensByOwnerQueryVariables, + RecentClaimsDocument, + RecentClaimsQueryVariables, } from "./indexer/gql/graphql"; +import { DEPLOYMENTS } from "./constants"; +import { TypedDocumentNode } from "@graphql-typed-document-node/core"; + /** * A class that provides indexing functionality for Hypercerts. * * This class implements the `HypercertIndexerInterface` and provides methods for retrieving claims by owner and by ID. It uses the Graph client for indexing. * Because of the autogenerated Graph client packed with the SDK, this class is not recommended for custom Graph deployments. * - * @property {GraphClient} _graphClient - The Graph client used by the indexer. - * * @example * const indexer = new HypercertIndexer({ graphUrl: 'your-graph-url', graphName: 'your-graph-name' }); * const claims = await indexer.claimsByOwner('your-address'); */ export class HypercertIndexer implements HypercertIndexerInterface { /** The Graph client used by the indexer. */ - private _graphName?: string; - private _graphUrl: string; + private environment: IndexerEnvironment; + + private graphClients: Map; /** * Creates a new instance of the `HypercertIndexer` class. @@ -40,19 +49,77 @@ export class HypercertIndexer implements HypercertIndexerInterface { constructor(options: Partial) { logger.info("Creating HypercertIndexer", "constructor", { name: options.graphName, url: options.graphUrl }); if (!options.graphUrl) throw new Error("Missing graphUrl"); - this._graphName = options.graphName; - this._graphUrl = options.graphUrl; + this.environment = options.indexerEnvironment || "test"; + + const environments = HypercertIndexer.getDeploymentsForEnvironment(this.environment); + + this.graphClients = new Map(); + for (const [chainId, deployment] of environments) { + if (!deployment.graphUrl) { + console.log(`Missing graphUrl for chain ${chainId}`); + continue; + } + this.graphClients.set( + parseInt(chainId), + new Client({ + url: deployment.graphUrl, + exchanges: [cacheExchange, fetchExchange], + }), + ); + } + } + + static getDeploymentsForEnvironment(environment: IndexerEnvironment) { + return Object.entries(DEPLOYMENTS).filter(([_, deployment]) => { + if (environment === "test") { + return deployment.isTestnet; + } + + if (environment === "production") { + return !deployment.isTestnet; + } + + return true; + }); } + performQuery = async ( + query: TypedDocumentNode, + variables: Variables, + chainId?: number, + ) => { + const chains = chainId ? [chainId] : Array.from(this.graphClients.keys()); + return await Promise.all( + chains.map(async (c) => { + const client = this.graphClients.get(c); + if (!client) { + throw new Error(`No client found for chain ${chainId}`); + } + + return client + .query(query, variables) + .toPromise() + .then((res) => { + if (res.error) { + throw res.error; + } + + return res.data; + }); + }), + ); + }; + /** * Gets the Graph client used by the indexer. * @returns The Graph client. */ - get graphClient(): Client { - return new Client({ - url: this._graphUrl, - exchanges: [cacheExchange, fetchExchange], - }); + getGraphClient(chainId: number): Client { + const client = this.graphClients.get(chainId); + if (!client) { + throw new Error(`No client found for chain ${chainId}`); + } + return client; } /** @@ -61,57 +128,51 @@ export class HypercertIndexer implements HypercertIndexerInterface { * @param params The query parameters. * @returns A Promise that resolves to the claims. */ - claimsByOwner = async (owner: string, params: QueryParams = defaultQueryParams) => { + claimsByOwner = async (owner: string, { chainId, ...params }: QueryParamsWithChainId = defaultQueryParams) => { const query = ClaimsByOwnerDocument; const variables: ClaimsByOwnerQueryVariables = { owner, ...params, }; - const result = await this.graphClient.query(query, variables); - - if (result.error) { - throw result.error; - } - - return result.data; + const results = await this.performQuery(query, variables, chainId); + const claims = results.flatMap((result) => result?.claims || []); + return { + claims, + }; }; /** * Gets a claim by its ID. - * @param id The ID of the claim. + * @param claimId The ID of the claim. * @returns A Promise that resolves to the claim. */ - claimById = async (id: string) => { + claimById = async (claimId: string) => { const query = ClaimByIdDocument; + const { chainId } = this.parseClaimId(claimId); const variables: ClaimByIdQueryVariables = { - id, + id: claimId, }; - const result = await this.graphClient.query(query, variables); - - if (result.error) { - throw result.error; - } + const results = await this.performQuery(query, variables, chainId); - return result.data; + return results[0]; }; /** * Gets the most recent claims. * @param params The query parameters. * @returns A Promise that resolves to the claims. */ - firstClaims = async (params: QueryParams = defaultQueryParams) => { + firstClaims = async ({ chainId, ...params }: QueryParamsWithChainId = defaultQueryParams) => { const query = RecentClaimsDocument; const variables: RecentClaimsQueryVariables = { ...params, }; - const result = await this.graphClient.query(query, variables); - - if (result.error) { - throw result.error; - } - return result.data; + const results = await this.performQuery(query, variables, chainId); + const claims = results.flatMap((result) => result?.claims || []); + return { + claims, + }; }; /** @@ -120,19 +181,18 @@ export class HypercertIndexer implements HypercertIndexerInterface { * @param params The query parameters. * @returns A Promise that resolves to the claim tokens. */ - fractionsByOwner = async (owner: string, params: QueryParams = defaultQueryParams) => { + fractionsByOwner = async (owner: string, { chainId, ...params }: QueryParamsWithChainId = defaultQueryParams) => { const query = ClaimTokensByOwnerDocument; const variables: ClaimTokensByOwnerQueryVariables = { owner, ...params, }; - const result = await this.graphClient.query(query, variables); - - if (result.error) { - throw result.error; - } - return result.data; + const results = await this.performQuery(query, variables, chainId); + const claimTokens = results.flatMap((result) => result?.claimTokens || []); + return { + claimTokens, + }; }; /** @@ -143,17 +203,14 @@ export class HypercertIndexer implements HypercertIndexerInterface { */ fractionsByClaim = async (claimId: string, params: QueryParams = defaultQueryParams) => { const query = ClaimTokensByClaimDocument; + const { chainId } = this.parseClaimId(claimId); const variables: ClaimTokensByClaimQueryVariables = { claimId, ...params, }; - const result = await this.graphClient.query(query, variables); - if (result.error) { - throw result.error; - } - - return result.data; + const results = await this.performQuery(query, variables, chainId); + return results[0]; }; /** @@ -163,15 +220,30 @@ export class HypercertIndexer implements HypercertIndexerInterface { */ fractionById = async (fractionId: string) => { const query = ClaimTokenByIdDocument; + const { chainId } = this.parseClaimId(fractionId); + const variables: ClaimTokenByIdQueryVariables = { claimTokenId: fractionId, }; - const result = await this.graphClient.query(query, variables); - if (result.error) { - throw result.error; + const results = await this.performQuery(query, variables, chainId); + return results[0]; + }; + + private parseClaimId(claimId: string) { + const [chainId, contractAddress, tokenId] = claimId.split("-"); + + if (!chainId || !contractAddress || !tokenId) { + console.log("Invalid claimId format. Expected 'chainId-contractAddress-tokenId'"); + throw new Error(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId"`); } - return result.data; - }; + const chainIdInt = parseInt(chainId, 10); + const tokenIdBigInt = BigInt(tokenId); + return { + chainId: chainIdInt, + contractAddress, + tokenId: tokenIdBigInt, + }; + } } diff --git a/sdk/src/indexer/gql/graphql.ts b/sdk/src/indexer/gql/graphql.ts index 16905658..071b0a89 100644 --- a/sdk/src/indexer/gql/graphql.ts +++ b/sdk/src/indexer/gql/graphql.ts @@ -1085,6 +1085,8 @@ export type _Block_ = { hash?: Maybe; /** The block number */ number: Scalars["Int"]["output"]; + /** The hash of the parent block */ + parentHash?: Maybe; /** Integer representation of the timestamp stored in blocks for the chain */ timestamp?: Maybe; }; diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index fab055bc..0925f18d 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -63,6 +63,7 @@ export type Deployment = { /** The url to the subgraph that indexes the contract events. Override for localized testing */ graphUrl: string; graphName: string; + isTestnet: boolean; }; /** @@ -80,8 +81,16 @@ export type HypercertClientConfig = Deployment & readOnly: boolean; /** Reason for readOnly mode */ readOnlyReason?: string; + /** The environment to run the indexer in. This can be either production or test. */ + indexerEnvironment: IndexerEnvironment; }; +/** + * The environment to run the indexer in. + * Production will run against all mainnet chains, while test will run against testnet chains. + */ +export type IndexerEnvironment = "production" | "test"; + /** * Configuration options for the Hypercert storage layer. * @note The API tokens are optional, but required for storing data on NFT.storage and Web3.storage. diff --git a/sdk/src/types/indexer.ts b/sdk/src/types/indexer.ts index 9417e95d..2374e377 100644 --- a/sdk/src/types/indexer.ts +++ b/sdk/src/types/indexer.ts @@ -7,6 +7,7 @@ import { ClaimTokensByClaimQuery, ClaimTokenByIdQuery, } from "../indexer/gql/graphql"; + export type QueryParams = { orderDirections: "asc" | "desc"; skip: number; @@ -14,8 +15,10 @@ export type QueryParams = { [key: string]: string | number | undefined; }; +export type QueryParamsWithChainId = QueryParams & { chainId?: number }; + export interface HypercertIndexerInterface { - graphClient: Client; + getGraphClient(chainId: number): Client; claimsByOwner: (owner: string, params?: QueryParams) => Promise; claimById: (id: string) => Promise; firstClaims: (params?: QueryParams) => Promise; diff --git a/sdk/test/utils/config.test.ts b/sdk/test/utils/config.test.ts index b1af9e36..33f75089 100644 --- a/sdk/test/utils/config.test.ts +++ b/sdk/test/utils/config.test.ts @@ -18,7 +18,7 @@ describe("Config: graphUrl", () => { it("should return the default graphUrl when no overrides are specified", () => { const result = getConfig({ chain: { id: 11155111 } }); - expect(result.graphUrl).to.equal("https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-sepolia"); + expect(result.graphUrl).to.equal("https://api.thegraph.com/subgraphs/name/hypercerts-org/hypercerts-sepolia"); }); it("should return the config specified by overrides", () => { From 6be33d71d9d68dc55f3113cb196159ec75f5f589 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Tue, 26 Mar 2024 17:02:41 -0600 Subject: [PATCH 2/7] (feat): refactor parseClaimId to standalone utility method, add sql update script for claimIds in supabase --- frontend/hooks/createBlueprintInRegistry.ts | 35 - ...ate-claimids-in-supabase-to-multichain.sql | 10 + sdk/src/indexer.ts | 24 +- sdk/src/indexer/gql/fragment-masking.ts | 50 +- sdk/src/indexer/gql/gql.ts | 25 +- sdk/src/indexer/gql/graphql.ts | 1980 +++++++---------- sdk/src/indexer/gql/index.ts | 2 +- sdk/src/utils/index.ts | 2 + sdk/src/utils/parsing.ts | 37 + 9 files changed, 856 insertions(+), 1309 deletions(-) delete mode 100644 frontend/hooks/createBlueprintInRegistry.ts create mode 100644 scripts/update-claimids-in-supabase-to-multichain.sql create mode 100644 sdk/src/utils/parsing.ts diff --git a/frontend/hooks/createBlueprintInRegistry.ts b/frontend/hooks/createBlueprintInRegistry.ts deleted file mode 100644 index d1d5d8d0..00000000 --- a/frontend/hooks/createBlueprintInRegistry.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { supabase } from "../lib/supabase-client"; -import { useMutation } from "wagmi"; - -export const useMintBlueprintToRegistry = ({ - onComplete, -}: { - onComplete?: () => void; -}) => { - return useMutation( - ["mintBlueprintToRegistry"], - async ({ - registryId, - minterAddress, - value, - }: { - registryId: string; - minterAddress: string; - value: string; - }) => { - supabase - .from("claim-blueprints-optimism") - .insert({ - registry_id: registryId, - minter_address: minterAddress, - form_values: value, - }) - .then((res) => { - if (res.error) { - throw res.error; - } - return true; - }); - }, - ); -}; diff --git a/scripts/update-claimids-in-supabase-to-multichain.sql b/scripts/update-claimids-in-supabase-to-multichain.sql new file mode 100644 index 00000000..97c3b5f3 --- /dev/null +++ b/scripts/update-claimids-in-supabase-to-multichain.sql @@ -0,0 +1,10 @@ +update "allowlistCache-chainId" set "claimId" = concat("chainId", '-', "claimId"); +update "allowlistCache-optimism" set "claimId" = concat('10', '-', "claimId"); +update "allowlistCache-goerli" set "claimId" = concat('5', '-', "claimId"); +update "allowlistCache-sepolia" set "claimId" = concat('11155111', '-', "claimId"); + +update "claims-metadata-mapping" set "claimId" = concat("chainId", '-', "claimId"); + +update "collections" set "claimId" = concat("chainId", '-', "claimId"); + +update "zuzalu-community-hypercerts" set "claimId" = concat("chainId", '-', "claimId"); \ No newline at end of file diff --git a/sdk/src/indexer.ts b/sdk/src/indexer.ts index d143799b..590c01db 100644 --- a/sdk/src/indexer.ts +++ b/sdk/src/indexer.ts @@ -25,6 +25,7 @@ import { } from "./indexer/gql/graphql"; import { DEPLOYMENTS } from "./constants"; import { TypedDocumentNode } from "@graphql-typed-document-node/core"; +import { parseClaimOrFractionId } from "./utils/parsing"; /** * A class that provides indexing functionality for Hypercerts. @@ -149,7 +150,7 @@ export class HypercertIndexer implements HypercertIndexerInterface { */ claimById = async (claimId: string) => { const query = ClaimByIdDocument; - const { chainId } = this.parseClaimId(claimId); + const { chainId } = parseClaimOrFractionId(claimId); const variables: ClaimByIdQueryVariables = { id: claimId, }; @@ -203,7 +204,7 @@ export class HypercertIndexer implements HypercertIndexerInterface { */ fractionsByClaim = async (claimId: string, params: QueryParams = defaultQueryParams) => { const query = ClaimTokensByClaimDocument; - const { chainId } = this.parseClaimId(claimId); + const { chainId } = parseClaimOrFractionId(claimId); const variables: ClaimTokensByClaimQueryVariables = { claimId, ...params, @@ -220,7 +221,7 @@ export class HypercertIndexer implements HypercertIndexerInterface { */ fractionById = async (fractionId: string) => { const query = ClaimTokenByIdDocument; - const { chainId } = this.parseClaimId(fractionId); + const { chainId } = parseClaimOrFractionId(fractionId); const variables: ClaimTokenByIdQueryVariables = { claimTokenId: fractionId, @@ -229,21 +230,4 @@ export class HypercertIndexer implements HypercertIndexerInterface { const results = await this.performQuery(query, variables, chainId); return results[0]; }; - - private parseClaimId(claimId: string) { - const [chainId, contractAddress, tokenId] = claimId.split("-"); - - if (!chainId || !contractAddress || !tokenId) { - console.log("Invalid claimId format. Expected 'chainId-contractAddress-tokenId'"); - throw new Error(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId"`); - } - - const chainIdInt = parseInt(chainId, 10); - const tokenIdBigInt = BigInt(tokenId); - return { - chainId: chainIdInt, - contractAddress, - tokenId: tokenIdBigInt, - }; - } } diff --git a/sdk/src/indexer/gql/fragment-masking.ts b/sdk/src/indexer/gql/fragment-masking.ts index 71bfb909..2ba06f10 100644 --- a/sdk/src/indexer/gql/fragment-masking.ts +++ b/sdk/src/indexer/gql/fragment-masking.ts @@ -1,57 +1,57 @@ -import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from "@graphql-typed-document-node/core"; -import { FragmentDefinitionNode } from "graphql"; -import { Incremental } from "./graphql"; +import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core'; +import { FragmentDefinitionNode } from 'graphql'; +import { Incremental } from './graphql'; -export type FragmentType> = - TDocumentType extends DocumentTypeDecoration - ? [TType] extends [{ " $fragmentName"?: infer TKey }] - ? TKey extends string - ? { " $fragmentRefs"?: { [key in TKey]: TType } } - : never + +export type FragmentType> = TDocumentType extends DocumentTypeDecoration< + infer TType, + any +> + ? [TType] extends [{ ' $fragmentName'?: infer TKey }] + ? TKey extends string + ? { ' $fragmentRefs'?: { [key in TKey]: TType } } : never - : never; + : never + : never; // return non-nullable if `fragmentType` is non-nullable export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: FragmentType>, + fragmentType: FragmentType> ): TType; // return nullable if `fragmentType` is nullable export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: FragmentType> | null | undefined, + fragmentType: FragmentType> | null | undefined ): TType | null | undefined; // return array of non-nullable if `fragmentType` is array of non-nullable export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: ReadonlyArray>>, + fragmentType: ReadonlyArray>> ): ReadonlyArray; // return array of nullable if `fragmentType` is array of nullable export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: ReadonlyArray>> | null | undefined, + fragmentType: ReadonlyArray>> | null | undefined ): ReadonlyArray | null | undefined; export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: - | FragmentType> - | ReadonlyArray>> - | null - | undefined, + fragmentType: FragmentType> | ReadonlyArray>> | null | undefined ): TType | ReadonlyArray | null | undefined { return fragmentType as any; } -export function makeFragmentData, FT extends ResultOf>( - data: FT, - _fragment: F, -): FragmentType { + +export function makeFragmentData< + F extends DocumentTypeDecoration, + FT extends ResultOf +>(data: FT, _fragment: F): FragmentType { return data as FragmentType; } export function isFragmentReady( queryNode: DocumentTypeDecoration, fragmentNode: TypedDocumentNode, - data: FragmentType, any>> | null | undefined, + data: FragmentType, any>> | null | undefined ): data is FragmentType { const deferredFields = (queryNode as { __meta__?: { deferredFields: Record } }).__meta__ ?.deferredFields; @@ -62,5 +62,5 @@ export function isFragmentReady( const fragName = fragDef?.name?.value; const fields = (fragName && deferredFields[fragName]) || []; - return fields.length > 0 && fields.every((field) => data && field in data); + return fields.length > 0 && fields.every(field => data && field in data); } diff --git a/sdk/src/indexer/gql/gql.ts b/sdk/src/indexer/gql/gql.ts index 9a5d6c61..2d67d9d7 100644 --- a/sdk/src/indexer/gql/gql.ts +++ b/sdk/src/indexer/gql/gql.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as types from "./graphql"; -import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; +import * as types from './graphql'; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; /** * Map of all GraphQL operations in the project. @@ -13,10 +13,8 @@ import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - 'query ClaimsByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}': - types.ClaimsByOwnerDocument, - 'query ClaimTokensByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}': - types.ClaimTokensByOwnerDocument, + "query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}": types.ClaimsByOwnerDocument, + "query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}": types.ClaimTokensByOwnerDocument, }; /** @@ -36,23 +34,14 @@ export function graphql(source: string): unknown; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql( - source: 'query ClaimsByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}', -): (typeof documents)['query ClaimsByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}']; +export function graphql(source: "query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"): (typeof documents)["query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql( - source: 'query ClaimTokensByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}', -): (typeof documents)['query ClaimTokensByOwner($owner: Bytes = "", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}']; +export function graphql(source: "query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"): (typeof documents)["query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; } -export type DocumentType> = TDocumentNode extends DocumentNode< - infer TType, - any -> - ? TType - : never; +export type DocumentType> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never; \ No newline at end of file diff --git a/sdk/src/indexer/gql/graphql.ts b/sdk/src/indexer/gql/graphql.ts index 071b0a89..61f9f9ad 100644 --- a/sdk/src/indexer/gql/graphql.ts +++ b/sdk/src/indexer/gql/graphql.ts @@ -1,230 +1,231 @@ /* eslint-disable */ -import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; +import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; export type MakeEmpty = { [_ in K]?: never }; -export type Incremental = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string }; - String: { input: string; output: string }; - Boolean: { input: boolean; output: boolean }; - Int: { input: number; output: number }; - Float: { input: number; output: number }; - BigDecimal: { input: any; output: any }; - BigInt: { input: any; output: any }; - Bytes: { input: any; output: any }; + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + BigDecimal: { input: any; output: any; } + BigInt: { input: any; output: any; } + Bytes: { input: any; output: any; } /** * 8 bytes signed integer * */ - Int8: { input: any; output: any }; + Int8: { input: any; output: any; } }; export type AcceptedToken = { - __typename?: "AcceptedToken"; - accepted: Scalars["Boolean"]["output"]; - id: Scalars["String"]["output"]; - minimumAmountPerUnit: Scalars["BigInt"]["output"]; + __typename?: 'AcceptedToken'; + accepted: Scalars['Boolean']['output']; + id: Scalars['String']['output']; + minimumAmountPerUnit: Scalars['BigInt']['output']; token: Token; }; export type AcceptedToken_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; - accepted?: InputMaybe; - accepted_in?: InputMaybe>; - accepted_not?: InputMaybe; - accepted_not_in?: InputMaybe>; + accepted?: InputMaybe; + accepted_in?: InputMaybe>; + accepted_not?: InputMaybe; + accepted_not_in?: InputMaybe>; and?: InputMaybe>>; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; - minimumAmountPerUnit?: InputMaybe; - minimumAmountPerUnit_gt?: InputMaybe; - minimumAmountPerUnit_gte?: InputMaybe; - minimumAmountPerUnit_in?: InputMaybe>; - minimumAmountPerUnit_lt?: InputMaybe; - minimumAmountPerUnit_lte?: InputMaybe; - minimumAmountPerUnit_not?: InputMaybe; - minimumAmountPerUnit_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + minimumAmountPerUnit?: InputMaybe; + minimumAmountPerUnit_gt?: InputMaybe; + minimumAmountPerUnit_gte?: InputMaybe; + minimumAmountPerUnit_in?: InputMaybe>; + minimumAmountPerUnit_lt?: InputMaybe; + minimumAmountPerUnit_lte?: InputMaybe; + minimumAmountPerUnit_not?: InputMaybe; + minimumAmountPerUnit_not_in?: InputMaybe>; or?: InputMaybe>>; - token?: InputMaybe; + token?: InputMaybe; token_?: InputMaybe; - token_contains?: InputMaybe; - token_contains_nocase?: InputMaybe; - token_ends_with?: InputMaybe; - token_ends_with_nocase?: InputMaybe; - token_gt?: InputMaybe; - token_gte?: InputMaybe; - token_in?: InputMaybe>; - token_lt?: InputMaybe; - token_lte?: InputMaybe; - token_not?: InputMaybe; - token_not_contains?: InputMaybe; - token_not_contains_nocase?: InputMaybe; - token_not_ends_with?: InputMaybe; - token_not_ends_with_nocase?: InputMaybe; - token_not_in?: InputMaybe>; - token_not_starts_with?: InputMaybe; - token_not_starts_with_nocase?: InputMaybe; - token_starts_with?: InputMaybe; - token_starts_with_nocase?: InputMaybe; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; }; export enum AcceptedToken_OrderBy { - Accepted = "accepted", - Id = "id", - MinimumAmountPerUnit = "minimumAmountPerUnit", - Token = "token", - TokenDecimals = "token__decimals", - TokenId = "token__id", - TokenName = "token__name", - TokenSymbol = "token__symbol", + Accepted = 'accepted', + Id = 'id', + MinimumAmountPerUnit = 'minimumAmountPerUnit', + Token = 'token', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenName = 'token__name', + TokenSymbol = 'token__symbol' } export enum Aggregation_Interval { - Day = "day", - Hour = "hour", + Day = 'day', + Hour = 'hour' } export type Allowlist = { - __typename?: "Allowlist"; + __typename?: 'Allowlist'; claim: Claim; - id: Scalars["String"]["output"]; - root: Scalars["Bytes"]["output"]; + id: Scalars['String']['output']; + root: Scalars['Bytes']['output']; }; export type Allowlist_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - claim?: InputMaybe; + claim?: InputMaybe; claim_?: InputMaybe; - claim_contains?: InputMaybe; - claim_contains_nocase?: InputMaybe; - claim_ends_with?: InputMaybe; - claim_ends_with_nocase?: InputMaybe; - claim_gt?: InputMaybe; - claim_gte?: InputMaybe; - claim_in?: InputMaybe>; - claim_lt?: InputMaybe; - claim_lte?: InputMaybe; - claim_not?: InputMaybe; - claim_not_contains?: InputMaybe; - claim_not_contains_nocase?: InputMaybe; - claim_not_ends_with?: InputMaybe; - claim_not_ends_with_nocase?: InputMaybe; - claim_not_in?: InputMaybe>; - claim_not_starts_with?: InputMaybe; - claim_not_starts_with_nocase?: InputMaybe; - claim_starts_with?: InputMaybe; - claim_starts_with_nocase?: InputMaybe; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; + claim_contains?: InputMaybe; + claim_contains_nocase?: InputMaybe; + claim_ends_with?: InputMaybe; + claim_ends_with_nocase?: InputMaybe; + claim_gt?: InputMaybe; + claim_gte?: InputMaybe; + claim_in?: InputMaybe>; + claim_lt?: InputMaybe; + claim_lte?: InputMaybe; + claim_not?: InputMaybe; + claim_not_contains?: InputMaybe; + claim_not_contains_nocase?: InputMaybe; + claim_not_ends_with?: InputMaybe; + claim_not_ends_with_nocase?: InputMaybe; + claim_not_in?: InputMaybe>; + claim_not_starts_with?: InputMaybe; + claim_not_starts_with_nocase?: InputMaybe; + claim_starts_with?: InputMaybe; + claim_starts_with_nocase?: InputMaybe; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; or?: InputMaybe>>; - root?: InputMaybe; - root_contains?: InputMaybe; - root_gt?: InputMaybe; - root_gte?: InputMaybe; - root_in?: InputMaybe>; - root_lt?: InputMaybe; - root_lte?: InputMaybe; - root_not?: InputMaybe; - root_not_contains?: InputMaybe; - root_not_in?: InputMaybe>; + root?: InputMaybe; + root_contains?: InputMaybe; + root_gt?: InputMaybe; + root_gte?: InputMaybe; + root_in?: InputMaybe>; + root_lt?: InputMaybe; + root_lte?: InputMaybe; + root_not?: InputMaybe; + root_not_contains?: InputMaybe; + root_not_in?: InputMaybe>; }; export enum Allowlist_OrderBy { - Claim = "claim", - ClaimContract = "claim__contract", - ClaimCreation = "claim__creation", - ClaimCreator = "claim__creator", - ClaimId = "claim__id", - ClaimOwner = "claim__owner", - ClaimTokenId = "claim__tokenID", - ClaimTotalUnits = "claim__totalUnits", - ClaimUri = "claim__uri", - Id = "id", - Root = "root", + Claim = 'claim', + ClaimContract = 'claim__contract', + ClaimCreation = 'claim__creation', + ClaimCreator = 'claim__creator', + ClaimId = 'claim__id', + ClaimOwner = 'claim__owner', + ClaimTokenId = 'claim__tokenID', + ClaimTotalUnits = 'claim__totalUnits', + ClaimUri = 'claim__uri', + Id = 'id', + Root = 'root' } export type BlockChangedFilter = { - number_gte: Scalars["Int"]["input"]; + number_gte: Scalars['Int']['input']; }; export type Block_Height = { - hash?: InputMaybe; - number?: InputMaybe; - number_gte?: InputMaybe; + hash?: InputMaybe; + number?: InputMaybe; + number_gte?: InputMaybe; }; export type Claim = { - __typename?: "Claim"; + __typename?: 'Claim'; allowlist?: Maybe; - contract: Scalars["String"]["output"]; - creation: Scalars["BigInt"]["output"]; - creator?: Maybe; - id: Scalars["String"]["output"]; - owner?: Maybe; - tokenID: Scalars["BigInt"]["output"]; - totalUnits?: Maybe; - uri?: Maybe; + contract: Scalars['String']['output']; + creation: Scalars['BigInt']['output']; + creator?: Maybe; + id: Scalars['String']['output']; + owner?: Maybe; + tokenID: Scalars['BigInt']['output']; + totalUnits?: Maybe; + uri?: Maybe; }; export type ClaimToken = { - __typename?: "ClaimToken"; + __typename?: 'ClaimToken'; claim: Claim; - id: Scalars["String"]["output"]; + id: Scalars['String']['output']; offers?: Maybe>; - owner: Scalars["Bytes"]["output"]; - tokenID: Scalars["BigInt"]["output"]; - units: Scalars["BigInt"]["output"]; + owner: Scalars['Bytes']['output']; + tokenID: Scalars['BigInt']['output']; + units: Scalars['BigInt']['output']; }; + export type ClaimTokenOffersArgs = { - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; where?: InputMaybe; }; @@ -232,370 +233,371 @@ export type ClaimToken_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - claim?: InputMaybe; + claim?: InputMaybe; claim_?: InputMaybe; - claim_contains?: InputMaybe; - claim_contains_nocase?: InputMaybe; - claim_ends_with?: InputMaybe; - claim_ends_with_nocase?: InputMaybe; - claim_gt?: InputMaybe; - claim_gte?: InputMaybe; - claim_in?: InputMaybe>; - claim_lt?: InputMaybe; - claim_lte?: InputMaybe; - claim_not?: InputMaybe; - claim_not_contains?: InputMaybe; - claim_not_contains_nocase?: InputMaybe; - claim_not_ends_with?: InputMaybe; - claim_not_ends_with_nocase?: InputMaybe; - claim_not_in?: InputMaybe>; - claim_not_starts_with?: InputMaybe; - claim_not_starts_with_nocase?: InputMaybe; - claim_starts_with?: InputMaybe; - claim_starts_with_nocase?: InputMaybe; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; + claim_contains?: InputMaybe; + claim_contains_nocase?: InputMaybe; + claim_ends_with?: InputMaybe; + claim_ends_with_nocase?: InputMaybe; + claim_gt?: InputMaybe; + claim_gte?: InputMaybe; + claim_in?: InputMaybe>; + claim_lt?: InputMaybe; + claim_lte?: InputMaybe; + claim_not?: InputMaybe; + claim_not_contains?: InputMaybe; + claim_not_contains_nocase?: InputMaybe; + claim_not_ends_with?: InputMaybe; + claim_not_ends_with_nocase?: InputMaybe; + claim_not_in?: InputMaybe>; + claim_not_starts_with?: InputMaybe; + claim_not_starts_with_nocase?: InputMaybe; + claim_starts_with?: InputMaybe; + claim_starts_with_nocase?: InputMaybe; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; offers_?: InputMaybe; or?: InputMaybe>>; - owner?: InputMaybe; - owner_contains?: InputMaybe; - owner_gt?: InputMaybe; - owner_gte?: InputMaybe; - owner_in?: InputMaybe>; - owner_lt?: InputMaybe; - owner_lte?: InputMaybe; - owner_not?: InputMaybe; - owner_not_contains?: InputMaybe; - owner_not_in?: InputMaybe>; - tokenID?: InputMaybe; - tokenID_gt?: InputMaybe; - tokenID_gte?: InputMaybe; - tokenID_in?: InputMaybe>; - tokenID_lt?: InputMaybe; - tokenID_lte?: InputMaybe; - tokenID_not?: InputMaybe; - tokenID_not_in?: InputMaybe>; - units?: InputMaybe; - units_gt?: InputMaybe; - units_gte?: InputMaybe; - units_in?: InputMaybe>; - units_lt?: InputMaybe; - units_lte?: InputMaybe; - units_not?: InputMaybe; - units_not_in?: InputMaybe>; + owner?: InputMaybe; + owner_contains?: InputMaybe; + owner_gt?: InputMaybe; + owner_gte?: InputMaybe; + owner_in?: InputMaybe>; + owner_lt?: InputMaybe; + owner_lte?: InputMaybe; + owner_not?: InputMaybe; + owner_not_contains?: InputMaybe; + owner_not_in?: InputMaybe>; + tokenID?: InputMaybe; + tokenID_gt?: InputMaybe; + tokenID_gte?: InputMaybe; + tokenID_in?: InputMaybe>; + tokenID_lt?: InputMaybe; + tokenID_lte?: InputMaybe; + tokenID_not?: InputMaybe; + tokenID_not_in?: InputMaybe>; + units?: InputMaybe; + units_gt?: InputMaybe; + units_gte?: InputMaybe; + units_in?: InputMaybe>; + units_lt?: InputMaybe; + units_lte?: InputMaybe; + units_not?: InputMaybe; + units_not_in?: InputMaybe>; }; export enum ClaimToken_OrderBy { - Claim = "claim", - ClaimContract = "claim__contract", - ClaimCreation = "claim__creation", - ClaimCreator = "claim__creator", - ClaimId = "claim__id", - ClaimOwner = "claim__owner", - ClaimTokenId = "claim__tokenID", - ClaimTotalUnits = "claim__totalUnits", - ClaimUri = "claim__uri", - Id = "id", - Offers = "offers", - Owner = "owner", - TokenId = "tokenID", - Units = "units", + Claim = 'claim', + ClaimContract = 'claim__contract', + ClaimCreation = 'claim__creation', + ClaimCreator = 'claim__creator', + ClaimId = 'claim__id', + ClaimOwner = 'claim__owner', + ClaimTokenId = 'claim__tokenID', + ClaimTotalUnits = 'claim__totalUnits', + ClaimUri = 'claim__uri', + Id = 'id', + Offers = 'offers', + Owner = 'owner', + TokenId = 'tokenID', + Units = 'units' } export type Claim_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; - allowlist?: InputMaybe; + allowlist?: InputMaybe; allowlist_?: InputMaybe; - allowlist_contains?: InputMaybe; - allowlist_contains_nocase?: InputMaybe; - allowlist_ends_with?: InputMaybe; - allowlist_ends_with_nocase?: InputMaybe; - allowlist_gt?: InputMaybe; - allowlist_gte?: InputMaybe; - allowlist_in?: InputMaybe>; - allowlist_lt?: InputMaybe; - allowlist_lte?: InputMaybe; - allowlist_not?: InputMaybe; - allowlist_not_contains?: InputMaybe; - allowlist_not_contains_nocase?: InputMaybe; - allowlist_not_ends_with?: InputMaybe; - allowlist_not_ends_with_nocase?: InputMaybe; - allowlist_not_in?: InputMaybe>; - allowlist_not_starts_with?: InputMaybe; - allowlist_not_starts_with_nocase?: InputMaybe; - allowlist_starts_with?: InputMaybe; - allowlist_starts_with_nocase?: InputMaybe; + allowlist_contains?: InputMaybe; + allowlist_contains_nocase?: InputMaybe; + allowlist_ends_with?: InputMaybe; + allowlist_ends_with_nocase?: InputMaybe; + allowlist_gt?: InputMaybe; + allowlist_gte?: InputMaybe; + allowlist_in?: InputMaybe>; + allowlist_lt?: InputMaybe; + allowlist_lte?: InputMaybe; + allowlist_not?: InputMaybe; + allowlist_not_contains?: InputMaybe; + allowlist_not_contains_nocase?: InputMaybe; + allowlist_not_ends_with?: InputMaybe; + allowlist_not_ends_with_nocase?: InputMaybe; + allowlist_not_in?: InputMaybe>; + allowlist_not_starts_with?: InputMaybe; + allowlist_not_starts_with_nocase?: InputMaybe; + allowlist_starts_with?: InputMaybe; + allowlist_starts_with_nocase?: InputMaybe; and?: InputMaybe>>; - contract?: InputMaybe; - contract_contains?: InputMaybe; - contract_contains_nocase?: InputMaybe; - contract_ends_with?: InputMaybe; - contract_ends_with_nocase?: InputMaybe; - contract_gt?: InputMaybe; - contract_gte?: InputMaybe; - contract_in?: InputMaybe>; - contract_lt?: InputMaybe; - contract_lte?: InputMaybe; - contract_not?: InputMaybe; - contract_not_contains?: InputMaybe; - contract_not_contains_nocase?: InputMaybe; - contract_not_ends_with?: InputMaybe; - contract_not_ends_with_nocase?: InputMaybe; - contract_not_in?: InputMaybe>; - contract_not_starts_with?: InputMaybe; - contract_not_starts_with_nocase?: InputMaybe; - contract_starts_with?: InputMaybe; - contract_starts_with_nocase?: InputMaybe; - creation?: InputMaybe; - creation_gt?: InputMaybe; - creation_gte?: InputMaybe; - creation_in?: InputMaybe>; - creation_lt?: InputMaybe; - creation_lte?: InputMaybe; - creation_not?: InputMaybe; - creation_not_in?: InputMaybe>; - creator?: InputMaybe; - creator_contains?: InputMaybe; - creator_gt?: InputMaybe; - creator_gte?: InputMaybe; - creator_in?: InputMaybe>; - creator_lt?: InputMaybe; - creator_lte?: InputMaybe; - creator_not?: InputMaybe; - creator_not_contains?: InputMaybe; - creator_not_in?: InputMaybe>; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; + contract?: InputMaybe; + contract_contains?: InputMaybe; + contract_contains_nocase?: InputMaybe; + contract_ends_with?: InputMaybe; + contract_ends_with_nocase?: InputMaybe; + contract_gt?: InputMaybe; + contract_gte?: InputMaybe; + contract_in?: InputMaybe>; + contract_lt?: InputMaybe; + contract_lte?: InputMaybe; + contract_not?: InputMaybe; + contract_not_contains?: InputMaybe; + contract_not_contains_nocase?: InputMaybe; + contract_not_ends_with?: InputMaybe; + contract_not_ends_with_nocase?: InputMaybe; + contract_not_in?: InputMaybe>; + contract_not_starts_with?: InputMaybe; + contract_not_starts_with_nocase?: InputMaybe; + contract_starts_with?: InputMaybe; + contract_starts_with_nocase?: InputMaybe; + creation?: InputMaybe; + creation_gt?: InputMaybe; + creation_gte?: InputMaybe; + creation_in?: InputMaybe>; + creation_lt?: InputMaybe; + creation_lte?: InputMaybe; + creation_not?: InputMaybe; + creation_not_in?: InputMaybe>; + creator?: InputMaybe; + creator_contains?: InputMaybe; + creator_gt?: InputMaybe; + creator_gte?: InputMaybe; + creator_in?: InputMaybe>; + creator_lt?: InputMaybe; + creator_lte?: InputMaybe; + creator_not?: InputMaybe; + creator_not_contains?: InputMaybe; + creator_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; or?: InputMaybe>>; - owner?: InputMaybe; - owner_contains?: InputMaybe; - owner_gt?: InputMaybe; - owner_gte?: InputMaybe; - owner_in?: InputMaybe>; - owner_lt?: InputMaybe; - owner_lte?: InputMaybe; - owner_not?: InputMaybe; - owner_not_contains?: InputMaybe; - owner_not_in?: InputMaybe>; - tokenID?: InputMaybe; - tokenID_gt?: InputMaybe; - tokenID_gte?: InputMaybe; - tokenID_in?: InputMaybe>; - tokenID_lt?: InputMaybe; - tokenID_lte?: InputMaybe; - tokenID_not?: InputMaybe; - tokenID_not_in?: InputMaybe>; - totalUnits?: InputMaybe; - totalUnits_gt?: InputMaybe; - totalUnits_gte?: InputMaybe; - totalUnits_in?: InputMaybe>; - totalUnits_lt?: InputMaybe; - totalUnits_lte?: InputMaybe; - totalUnits_not?: InputMaybe; - totalUnits_not_in?: InputMaybe>; - uri?: InputMaybe; - uri_contains?: InputMaybe; - uri_contains_nocase?: InputMaybe; - uri_ends_with?: InputMaybe; - uri_ends_with_nocase?: InputMaybe; - uri_gt?: InputMaybe; - uri_gte?: InputMaybe; - uri_in?: InputMaybe>; - uri_lt?: InputMaybe; - uri_lte?: InputMaybe; - uri_not?: InputMaybe; - uri_not_contains?: InputMaybe; - uri_not_contains_nocase?: InputMaybe; - uri_not_ends_with?: InputMaybe; - uri_not_ends_with_nocase?: InputMaybe; - uri_not_in?: InputMaybe>; - uri_not_starts_with?: InputMaybe; - uri_not_starts_with_nocase?: InputMaybe; - uri_starts_with?: InputMaybe; - uri_starts_with_nocase?: InputMaybe; + owner?: InputMaybe; + owner_contains?: InputMaybe; + owner_gt?: InputMaybe; + owner_gte?: InputMaybe; + owner_in?: InputMaybe>; + owner_lt?: InputMaybe; + owner_lte?: InputMaybe; + owner_not?: InputMaybe; + owner_not_contains?: InputMaybe; + owner_not_in?: InputMaybe>; + tokenID?: InputMaybe; + tokenID_gt?: InputMaybe; + tokenID_gte?: InputMaybe; + tokenID_in?: InputMaybe>; + tokenID_lt?: InputMaybe; + tokenID_lte?: InputMaybe; + tokenID_not?: InputMaybe; + tokenID_not_in?: InputMaybe>; + totalUnits?: InputMaybe; + totalUnits_gt?: InputMaybe; + totalUnits_gte?: InputMaybe; + totalUnits_in?: InputMaybe>; + totalUnits_lt?: InputMaybe; + totalUnits_lte?: InputMaybe; + totalUnits_not?: InputMaybe; + totalUnits_not_in?: InputMaybe>; + uri?: InputMaybe; + uri_contains?: InputMaybe; + uri_contains_nocase?: InputMaybe; + uri_ends_with?: InputMaybe; + uri_ends_with_nocase?: InputMaybe; + uri_gt?: InputMaybe; + uri_gte?: InputMaybe; + uri_in?: InputMaybe>; + uri_lt?: InputMaybe; + uri_lte?: InputMaybe; + uri_not?: InputMaybe; + uri_not_contains?: InputMaybe; + uri_not_contains_nocase?: InputMaybe; + uri_not_ends_with?: InputMaybe; + uri_not_ends_with_nocase?: InputMaybe; + uri_not_in?: InputMaybe>; + uri_not_starts_with?: InputMaybe; + uri_not_starts_with_nocase?: InputMaybe; + uri_starts_with?: InputMaybe; + uri_starts_with_nocase?: InputMaybe; }; export enum Claim_OrderBy { - Allowlist = "allowlist", - AllowlistId = "allowlist__id", - AllowlistRoot = "allowlist__root", - Contract = "contract", - Creation = "creation", - Creator = "creator", - Id = "id", - Owner = "owner", - TokenId = "tokenID", - TotalUnits = "totalUnits", - Uri = "uri", + Allowlist = 'allowlist', + AllowlistId = 'allowlist__id', + AllowlistRoot = 'allowlist__root', + Contract = 'contract', + Creation = 'creation', + Creator = 'creator', + Id = 'id', + Owner = 'owner', + TokenId = 'tokenID', + TotalUnits = 'totalUnits', + Uri = 'uri' } export type Offer = { - __typename?: "Offer"; + __typename?: 'Offer'; acceptedTokens: Array; fractionID: ClaimToken; - id: Scalars["String"]["output"]; - maxUnitsPerTrade: Scalars["BigInt"]["output"]; - minUnitsPerTrade: Scalars["BigInt"]["output"]; + id: Scalars['String']['output']; + maxUnitsPerTrade: Scalars['BigInt']['output']; + minUnitsPerTrade: Scalars['BigInt']['output']; status: OfferStatus; - unitsAvailable: Scalars["BigInt"]["output"]; + unitsAvailable: Scalars['BigInt']['output']; }; + export type OfferAcceptedTokensArgs = { - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; where?: InputMaybe; }; export enum OfferStatus { - Cancelled = "Cancelled", - Fulfilled = "Fulfilled", - Open = "Open", + Cancelled = 'Cancelled', + Fulfilled = 'Fulfilled', + Open = 'Open' } export type Offer_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; - acceptedTokens?: InputMaybe>; + acceptedTokens?: InputMaybe>; acceptedTokens_?: InputMaybe; - acceptedTokens_contains?: InputMaybe>; - acceptedTokens_contains_nocase?: InputMaybe>; - acceptedTokens_not?: InputMaybe>; - acceptedTokens_not_contains?: InputMaybe>; - acceptedTokens_not_contains_nocase?: InputMaybe>; + acceptedTokens_contains?: InputMaybe>; + acceptedTokens_contains_nocase?: InputMaybe>; + acceptedTokens_not?: InputMaybe>; + acceptedTokens_not_contains?: InputMaybe>; + acceptedTokens_not_contains_nocase?: InputMaybe>; and?: InputMaybe>>; - fractionID?: InputMaybe; + fractionID?: InputMaybe; fractionID_?: InputMaybe; - fractionID_contains?: InputMaybe; - fractionID_contains_nocase?: InputMaybe; - fractionID_ends_with?: InputMaybe; - fractionID_ends_with_nocase?: InputMaybe; - fractionID_gt?: InputMaybe; - fractionID_gte?: InputMaybe; - fractionID_in?: InputMaybe>; - fractionID_lt?: InputMaybe; - fractionID_lte?: InputMaybe; - fractionID_not?: InputMaybe; - fractionID_not_contains?: InputMaybe; - fractionID_not_contains_nocase?: InputMaybe; - fractionID_not_ends_with?: InputMaybe; - fractionID_not_ends_with_nocase?: InputMaybe; - fractionID_not_in?: InputMaybe>; - fractionID_not_starts_with?: InputMaybe; - fractionID_not_starts_with_nocase?: InputMaybe; - fractionID_starts_with?: InputMaybe; - fractionID_starts_with_nocase?: InputMaybe; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; - maxUnitsPerTrade?: InputMaybe; - maxUnitsPerTrade_gt?: InputMaybe; - maxUnitsPerTrade_gte?: InputMaybe; - maxUnitsPerTrade_in?: InputMaybe>; - maxUnitsPerTrade_lt?: InputMaybe; - maxUnitsPerTrade_lte?: InputMaybe; - maxUnitsPerTrade_not?: InputMaybe; - maxUnitsPerTrade_not_in?: InputMaybe>; - minUnitsPerTrade?: InputMaybe; - minUnitsPerTrade_gt?: InputMaybe; - minUnitsPerTrade_gte?: InputMaybe; - minUnitsPerTrade_in?: InputMaybe>; - minUnitsPerTrade_lt?: InputMaybe; - minUnitsPerTrade_lte?: InputMaybe; - minUnitsPerTrade_not?: InputMaybe; - minUnitsPerTrade_not_in?: InputMaybe>; + fractionID_contains?: InputMaybe; + fractionID_contains_nocase?: InputMaybe; + fractionID_ends_with?: InputMaybe; + fractionID_ends_with_nocase?: InputMaybe; + fractionID_gt?: InputMaybe; + fractionID_gte?: InputMaybe; + fractionID_in?: InputMaybe>; + fractionID_lt?: InputMaybe; + fractionID_lte?: InputMaybe; + fractionID_not?: InputMaybe; + fractionID_not_contains?: InputMaybe; + fractionID_not_contains_nocase?: InputMaybe; + fractionID_not_ends_with?: InputMaybe; + fractionID_not_ends_with_nocase?: InputMaybe; + fractionID_not_in?: InputMaybe>; + fractionID_not_starts_with?: InputMaybe; + fractionID_not_starts_with_nocase?: InputMaybe; + fractionID_starts_with?: InputMaybe; + fractionID_starts_with_nocase?: InputMaybe; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + maxUnitsPerTrade?: InputMaybe; + maxUnitsPerTrade_gt?: InputMaybe; + maxUnitsPerTrade_gte?: InputMaybe; + maxUnitsPerTrade_in?: InputMaybe>; + maxUnitsPerTrade_lt?: InputMaybe; + maxUnitsPerTrade_lte?: InputMaybe; + maxUnitsPerTrade_not?: InputMaybe; + maxUnitsPerTrade_not_in?: InputMaybe>; + minUnitsPerTrade?: InputMaybe; + minUnitsPerTrade_gt?: InputMaybe; + minUnitsPerTrade_gte?: InputMaybe; + minUnitsPerTrade_in?: InputMaybe>; + minUnitsPerTrade_lt?: InputMaybe; + minUnitsPerTrade_lte?: InputMaybe; + minUnitsPerTrade_not?: InputMaybe; + minUnitsPerTrade_not_in?: InputMaybe>; or?: InputMaybe>>; status?: InputMaybe; status_in?: InputMaybe>; status_not?: InputMaybe; status_not_in?: InputMaybe>; - unitsAvailable?: InputMaybe; - unitsAvailable_gt?: InputMaybe; - unitsAvailable_gte?: InputMaybe; - unitsAvailable_in?: InputMaybe>; - unitsAvailable_lt?: InputMaybe; - unitsAvailable_lte?: InputMaybe; - unitsAvailable_not?: InputMaybe; - unitsAvailable_not_in?: InputMaybe>; + unitsAvailable?: InputMaybe; + unitsAvailable_gt?: InputMaybe; + unitsAvailable_gte?: InputMaybe; + unitsAvailable_in?: InputMaybe>; + unitsAvailable_lt?: InputMaybe; + unitsAvailable_lte?: InputMaybe; + unitsAvailable_not?: InputMaybe; + unitsAvailable_not_in?: InputMaybe>; }; export enum Offer_OrderBy { - AcceptedTokens = "acceptedTokens", - FractionId = "fractionID", - FractionIdId = "fractionID__id", - FractionIdOwner = "fractionID__owner", - FractionIdTokenId = "fractionID__tokenID", - FractionIdUnits = "fractionID__units", - Id = "id", - MaxUnitsPerTrade = "maxUnitsPerTrade", - MinUnitsPerTrade = "minUnitsPerTrade", - Status = "status", - UnitsAvailable = "unitsAvailable", + AcceptedTokens = 'acceptedTokens', + FractionId = 'fractionID', + FractionIdId = 'fractionID__id', + FractionIdOwner = 'fractionID__owner', + FractionIdTokenId = 'fractionID__tokenID', + FractionIdUnits = 'fractionID__units', + Id = 'id', + MaxUnitsPerTrade = 'maxUnitsPerTrade', + MinUnitsPerTrade = 'minUnitsPerTrade', + Status = 'status', + UnitsAvailable = 'unitsAvailable' } /** Defines the order direction, either ascending or descending */ export enum OrderDirection { - Asc = "asc", - Desc = "desc", + Asc = 'asc', + Desc = 'desc' } export type Query = { - __typename?: "Query"; + __typename?: 'Query'; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; acceptedToken?: Maybe; @@ -614,124 +616,139 @@ export type Query = { trades: Array; }; + export type Query_MetaArgs = { block?: InputMaybe; }; + export type QueryAcceptedTokenArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryAcceptedTokensArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type QueryAllowlistArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryAllowlistsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type QueryClaimArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryClaimTokenArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryClaimTokensArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type QueryClaimsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type QueryOfferArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryOffersArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type QueryTokenArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryTokensArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type QueryTradeArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type QueryTradesArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; export type Subscription = { - __typename?: "Subscription"; + __typename?: 'Subscription'; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; acceptedToken?: Maybe; @@ -750,350 +767,365 @@ export type Subscription = { trades: Array; }; + export type Subscription_MetaArgs = { block?: InputMaybe; }; + export type SubscriptionAcceptedTokenArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionAcceptedTokensArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type SubscriptionAllowlistArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionAllowlistsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type SubscriptionClaimArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionClaimTokenArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionClaimTokensArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type SubscriptionClaimsArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type SubscriptionOfferArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionOffersArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type SubscriptionTokenArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionTokensArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; + export type SubscriptionTradeArgs = { block?: InputMaybe; - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; subgraphError?: _SubgraphErrorPolicy_; }; + export type SubscriptionTradesArgs = { block?: InputMaybe; - first?: InputMaybe; + first?: InputMaybe; orderBy?: InputMaybe; orderDirection?: InputMaybe; - skip?: InputMaybe; + skip?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; where?: InputMaybe; }; export type Token = { - __typename?: "Token"; - decimals?: Maybe; - id: Scalars["String"]["output"]; - name: Scalars["String"]["output"]; - symbol?: Maybe; + __typename?: 'Token'; + decimals?: Maybe; + id: Scalars['String']['output']; + name: Scalars['String']['output']; + symbol?: Maybe; }; export type Token_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; and?: InputMaybe>>; - decimals?: InputMaybe; - decimals_gt?: InputMaybe; - decimals_gte?: InputMaybe; - decimals_in?: InputMaybe>; - decimals_lt?: InputMaybe; - decimals_lte?: InputMaybe; - decimals_not?: InputMaybe; - decimals_not_in?: InputMaybe>; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; - name?: InputMaybe; - name_contains?: InputMaybe; - name_contains_nocase?: InputMaybe; - name_ends_with?: InputMaybe; - name_ends_with_nocase?: InputMaybe; - name_gt?: InputMaybe; - name_gte?: InputMaybe; - name_in?: InputMaybe>; - name_lt?: InputMaybe; - name_lte?: InputMaybe; - name_not?: InputMaybe; - name_not_contains?: InputMaybe; - name_not_contains_nocase?: InputMaybe; - name_not_ends_with?: InputMaybe; - name_not_ends_with_nocase?: InputMaybe; - name_not_in?: InputMaybe>; - name_not_starts_with?: InputMaybe; - name_not_starts_with_nocase?: InputMaybe; - name_starts_with?: InputMaybe; - name_starts_with_nocase?: InputMaybe; + decimals?: InputMaybe; + decimals_gt?: InputMaybe; + decimals_gte?: InputMaybe; + decimals_in?: InputMaybe>; + decimals_lt?: InputMaybe; + decimals_lte?: InputMaybe; + decimals_not?: InputMaybe; + decimals_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + name?: InputMaybe; + name_contains?: InputMaybe; + name_contains_nocase?: InputMaybe; + name_ends_with?: InputMaybe; + name_ends_with_nocase?: InputMaybe; + name_gt?: InputMaybe; + name_gte?: InputMaybe; + name_in?: InputMaybe>; + name_lt?: InputMaybe; + name_lte?: InputMaybe; + name_not?: InputMaybe; + name_not_contains?: InputMaybe; + name_not_contains_nocase?: InputMaybe; + name_not_ends_with?: InputMaybe; + name_not_ends_with_nocase?: InputMaybe; + name_not_in?: InputMaybe>; + name_not_starts_with?: InputMaybe; + name_not_starts_with_nocase?: InputMaybe; + name_starts_with?: InputMaybe; + name_starts_with_nocase?: InputMaybe; or?: InputMaybe>>; - symbol?: InputMaybe; - symbol_contains?: InputMaybe; - symbol_contains_nocase?: InputMaybe; - symbol_ends_with?: InputMaybe; - symbol_ends_with_nocase?: InputMaybe; - symbol_gt?: InputMaybe; - symbol_gte?: InputMaybe; - symbol_in?: InputMaybe>; - symbol_lt?: InputMaybe; - symbol_lte?: InputMaybe; - symbol_not?: InputMaybe; - symbol_not_contains?: InputMaybe; - symbol_not_contains_nocase?: InputMaybe; - symbol_not_ends_with?: InputMaybe; - symbol_not_ends_with_nocase?: InputMaybe; - symbol_not_in?: InputMaybe>; - symbol_not_starts_with?: InputMaybe; - symbol_not_starts_with_nocase?: InputMaybe; - symbol_starts_with?: InputMaybe; - symbol_starts_with_nocase?: InputMaybe; + symbol?: InputMaybe; + symbol_contains?: InputMaybe; + symbol_contains_nocase?: InputMaybe; + symbol_ends_with?: InputMaybe; + symbol_ends_with_nocase?: InputMaybe; + symbol_gt?: InputMaybe; + symbol_gte?: InputMaybe; + symbol_in?: InputMaybe>; + symbol_lt?: InputMaybe; + symbol_lte?: InputMaybe; + symbol_not?: InputMaybe; + symbol_not_contains?: InputMaybe; + symbol_not_contains_nocase?: InputMaybe; + symbol_not_ends_with?: InputMaybe; + symbol_not_ends_with_nocase?: InputMaybe; + symbol_not_in?: InputMaybe>; + symbol_not_starts_with?: InputMaybe; + symbol_not_starts_with_nocase?: InputMaybe; + symbol_starts_with?: InputMaybe; + symbol_starts_with_nocase?: InputMaybe; }; export enum Token_OrderBy { - Decimals = "decimals", - Id = "id", - Name = "name", - Symbol = "symbol", + Decimals = 'decimals', + Id = 'id', + Name = 'name', + Symbol = 'symbol' } export type Trade = { - __typename?: "Trade"; - amountPerUnit: Scalars["BigInt"]["output"]; - buyer: Scalars["Bytes"]["output"]; - id: Scalars["String"]["output"]; + __typename?: 'Trade'; + amountPerUnit: Scalars['BigInt']['output']; + buyer: Scalars['Bytes']['output']; + id: Scalars['String']['output']; offerID: Offer; token: Token; - unitsSold: Scalars["BigInt"]["output"]; + unitsSold: Scalars['BigInt']['output']; }; export type Trade_Filter = { /** Filter for the block changed event. */ _change_block?: InputMaybe; - amountPerUnit?: InputMaybe; - amountPerUnit_gt?: InputMaybe; - amountPerUnit_gte?: InputMaybe; - amountPerUnit_in?: InputMaybe>; - amountPerUnit_lt?: InputMaybe; - amountPerUnit_lte?: InputMaybe; - amountPerUnit_not?: InputMaybe; - amountPerUnit_not_in?: InputMaybe>; + amountPerUnit?: InputMaybe; + amountPerUnit_gt?: InputMaybe; + amountPerUnit_gte?: InputMaybe; + amountPerUnit_in?: InputMaybe>; + amountPerUnit_lt?: InputMaybe; + amountPerUnit_lte?: InputMaybe; + amountPerUnit_not?: InputMaybe; + amountPerUnit_not_in?: InputMaybe>; and?: InputMaybe>>; - buyer?: InputMaybe; - buyer_contains?: InputMaybe; - buyer_gt?: InputMaybe; - buyer_gte?: InputMaybe; - buyer_in?: InputMaybe>; - buyer_lt?: InputMaybe; - buyer_lte?: InputMaybe; - buyer_not?: InputMaybe; - buyer_not_contains?: InputMaybe; - buyer_not_in?: InputMaybe>; - id?: InputMaybe; - id_contains?: InputMaybe; - id_contains_nocase?: InputMaybe; - id_ends_with?: InputMaybe; - id_ends_with_nocase?: InputMaybe; - id_gt?: InputMaybe; - id_gte?: InputMaybe; - id_in?: InputMaybe>; - id_lt?: InputMaybe; - id_lte?: InputMaybe; - id_not?: InputMaybe; - id_not_contains?: InputMaybe; - id_not_contains_nocase?: InputMaybe; - id_not_ends_with?: InputMaybe; - id_not_ends_with_nocase?: InputMaybe; - id_not_in?: InputMaybe>; - id_not_starts_with?: InputMaybe; - id_not_starts_with_nocase?: InputMaybe; - id_starts_with?: InputMaybe; - id_starts_with_nocase?: InputMaybe; - offerID?: InputMaybe; + buyer?: InputMaybe; + buyer_contains?: InputMaybe; + buyer_gt?: InputMaybe; + buyer_gte?: InputMaybe; + buyer_in?: InputMaybe>; + buyer_lt?: InputMaybe; + buyer_lte?: InputMaybe; + buyer_not?: InputMaybe; + buyer_not_contains?: InputMaybe; + buyer_not_in?: InputMaybe>; + id?: InputMaybe; + id_contains?: InputMaybe; + id_contains_nocase?: InputMaybe; + id_ends_with?: InputMaybe; + id_ends_with_nocase?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_contains_nocase?: InputMaybe; + id_not_ends_with?: InputMaybe; + id_not_ends_with_nocase?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_starts_with?: InputMaybe; + id_not_starts_with_nocase?: InputMaybe; + id_starts_with?: InputMaybe; + id_starts_with_nocase?: InputMaybe; + offerID?: InputMaybe; offerID_?: InputMaybe; - offerID_contains?: InputMaybe; - offerID_contains_nocase?: InputMaybe; - offerID_ends_with?: InputMaybe; - offerID_ends_with_nocase?: InputMaybe; - offerID_gt?: InputMaybe; - offerID_gte?: InputMaybe; - offerID_in?: InputMaybe>; - offerID_lt?: InputMaybe; - offerID_lte?: InputMaybe; - offerID_not?: InputMaybe; - offerID_not_contains?: InputMaybe; - offerID_not_contains_nocase?: InputMaybe; - offerID_not_ends_with?: InputMaybe; - offerID_not_ends_with_nocase?: InputMaybe; - offerID_not_in?: InputMaybe>; - offerID_not_starts_with?: InputMaybe; - offerID_not_starts_with_nocase?: InputMaybe; - offerID_starts_with?: InputMaybe; - offerID_starts_with_nocase?: InputMaybe; + offerID_contains?: InputMaybe; + offerID_contains_nocase?: InputMaybe; + offerID_ends_with?: InputMaybe; + offerID_ends_with_nocase?: InputMaybe; + offerID_gt?: InputMaybe; + offerID_gte?: InputMaybe; + offerID_in?: InputMaybe>; + offerID_lt?: InputMaybe; + offerID_lte?: InputMaybe; + offerID_not?: InputMaybe; + offerID_not_contains?: InputMaybe; + offerID_not_contains_nocase?: InputMaybe; + offerID_not_ends_with?: InputMaybe; + offerID_not_ends_with_nocase?: InputMaybe; + offerID_not_in?: InputMaybe>; + offerID_not_starts_with?: InputMaybe; + offerID_not_starts_with_nocase?: InputMaybe; + offerID_starts_with?: InputMaybe; + offerID_starts_with_nocase?: InputMaybe; or?: InputMaybe>>; - token?: InputMaybe; + token?: InputMaybe; token_?: InputMaybe; - token_contains?: InputMaybe; - token_contains_nocase?: InputMaybe; - token_ends_with?: InputMaybe; - token_ends_with_nocase?: InputMaybe; - token_gt?: InputMaybe; - token_gte?: InputMaybe; - token_in?: InputMaybe>; - token_lt?: InputMaybe; - token_lte?: InputMaybe; - token_not?: InputMaybe; - token_not_contains?: InputMaybe; - token_not_contains_nocase?: InputMaybe; - token_not_ends_with?: InputMaybe; - token_not_ends_with_nocase?: InputMaybe; - token_not_in?: InputMaybe>; - token_not_starts_with?: InputMaybe; - token_not_starts_with_nocase?: InputMaybe; - token_starts_with?: InputMaybe; - token_starts_with_nocase?: InputMaybe; - unitsSold?: InputMaybe; - unitsSold_gt?: InputMaybe; - unitsSold_gte?: InputMaybe; - unitsSold_in?: InputMaybe>; - unitsSold_lt?: InputMaybe; - unitsSold_lte?: InputMaybe; - unitsSold_not?: InputMaybe; - unitsSold_not_in?: InputMaybe>; + token_contains?: InputMaybe; + token_contains_nocase?: InputMaybe; + token_ends_with?: InputMaybe; + token_ends_with_nocase?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_contains_nocase?: InputMaybe; + token_not_ends_with?: InputMaybe; + token_not_ends_with_nocase?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_starts_with?: InputMaybe; + token_not_starts_with_nocase?: InputMaybe; + token_starts_with?: InputMaybe; + token_starts_with_nocase?: InputMaybe; + unitsSold?: InputMaybe; + unitsSold_gt?: InputMaybe; + unitsSold_gte?: InputMaybe; + unitsSold_in?: InputMaybe>; + unitsSold_lt?: InputMaybe; + unitsSold_lte?: InputMaybe; + unitsSold_not?: InputMaybe; + unitsSold_not_in?: InputMaybe>; }; export enum Trade_OrderBy { - AmountPerUnit = "amountPerUnit", - Buyer = "buyer", - Id = "id", - OfferId = "offerID", - OfferIdId = "offerID__id", - OfferIdMaxUnitsPerTrade = "offerID__maxUnitsPerTrade", - OfferIdMinUnitsPerTrade = "offerID__minUnitsPerTrade", - OfferIdStatus = "offerID__status", - OfferIdUnitsAvailable = "offerID__unitsAvailable", - Token = "token", - TokenDecimals = "token__decimals", - TokenId = "token__id", - TokenName = "token__name", - TokenSymbol = "token__symbol", - UnitsSold = "unitsSold", + AmountPerUnit = 'amountPerUnit', + Buyer = 'buyer', + Id = 'id', + OfferId = 'offerID', + OfferIdId = 'offerID__id', + OfferIdMaxUnitsPerTrade = 'offerID__maxUnitsPerTrade', + OfferIdMinUnitsPerTrade = 'offerID__minUnitsPerTrade', + OfferIdStatus = 'offerID__status', + OfferIdUnitsAvailable = 'offerID__unitsAvailable', + Token = 'token', + TokenDecimals = 'token__decimals', + TokenId = 'token__id', + TokenName = 'token__name', + TokenSymbol = 'token__symbol', + UnitsSold = 'unitsSold' } export type _Block_ = { - __typename?: "_Block_"; + __typename?: '_Block_'; /** The hash of the block */ - hash?: Maybe; + hash?: Maybe; /** The block number */ - number: Scalars["Int"]["output"]; + number: Scalars['Int']['output']; /** The hash of the parent block */ - parentHash?: Maybe; + parentHash?: Maybe; /** Integer representation of the timestamp stored in blocks for the chain */ - timestamp?: Maybe; + timestamp?: Maybe; }; /** The type for the top-level _meta field */ export type _Meta_ = { - __typename?: "_Meta_"; + __typename?: '_Meta_'; /** * Information about a specific subgraph block. The hash of the block * will be null if the _meta field has a block constraint that asks for @@ -1103,547 +1135,75 @@ export type _Meta_ = { */ block: _Block_; /** The deployment ID */ - deployment: Scalars["String"]["output"]; + deployment: Scalars['String']['output']; /** If `true`, the subgraph encountered indexing errors at some past block */ - hasIndexingErrors: Scalars["Boolean"]["output"]; + hasIndexingErrors: Scalars['Boolean']['output']; }; export enum _SubgraphErrorPolicy_ { /** Data will be returned even if the subgraph has indexing errors */ - Allow = "allow", + Allow = 'allow', /** If the subgraph has indexing errors, data will be omitted. The default. */ - Deny = "deny", + Deny = 'deny' } export type ClaimsByOwnerQueryVariables = Exact<{ - owner?: InputMaybe; + owner?: InputMaybe; orderDirection?: InputMaybe; - first?: InputMaybe; - skip?: InputMaybe; + first?: InputMaybe; + skip?: InputMaybe; }>; -export type ClaimsByOwnerQuery = { - __typename?: "Query"; - claims: Array<{ - __typename?: "Claim"; - contract: string; - tokenID: any; - creator?: any | null; - id: string; - owner?: any | null; - totalUnits?: any | null; - uri?: string | null; - }>; -}; + +export type ClaimsByOwnerQuery = { __typename?: 'Query', claims: Array<{ __typename?: 'Claim', contract: string, tokenID: any, creator?: any | null, id: string, owner?: any | null, totalUnits?: any | null, uri?: string | null }> }; export type RecentClaimsQueryVariables = Exact<{ orderDirection?: InputMaybe; - first?: InputMaybe; - skip?: InputMaybe; + first?: InputMaybe; + skip?: InputMaybe; }>; -export type RecentClaimsQuery = { - __typename?: "Query"; - claims: Array<{ - __typename?: "Claim"; - contract: string; - tokenID: any; - creator?: any | null; - id: string; - owner?: any | null; - totalUnits?: any | null; - uri?: string | null; - }>; -}; + +export type RecentClaimsQuery = { __typename?: 'Query', claims: Array<{ __typename?: 'Claim', contract: string, tokenID: any, creator?: any | null, id: string, owner?: any | null, totalUnits?: any | null, uri?: string | null }> }; export type ClaimByIdQueryVariables = Exact<{ - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; }>; -export type ClaimByIdQuery = { - __typename?: "Query"; - claim?: { - __typename?: "Claim"; - contract: string; - tokenID: any; - creator?: any | null; - id: string; - owner?: any | null; - totalUnits?: any | null; - uri?: string | null; - } | null; -}; + +export type ClaimByIdQuery = { __typename?: 'Query', claim?: { __typename?: 'Claim', contract: string, tokenID: any, creator?: any | null, id: string, owner?: any | null, totalUnits?: any | null, uri?: string | null } | null }; export type ClaimTokensByOwnerQueryVariables = Exact<{ - owner?: InputMaybe; + owner?: InputMaybe; orderDirection?: InputMaybe; - first?: InputMaybe; - skip?: InputMaybe; + first?: InputMaybe; + skip?: InputMaybe; }>; -export type ClaimTokensByOwnerQuery = { - __typename?: "Query"; - claimTokens: Array<{ - __typename?: "ClaimToken"; - id: string; - owner: any; - tokenID: any; - units: any; - claim: { __typename?: "Claim"; id: string; creation: any; uri?: string | null; totalUnits?: any | null }; - }>; -}; + +export type ClaimTokensByOwnerQuery = { __typename?: 'Query', claimTokens: Array<{ __typename?: 'ClaimToken', id: string, owner: any, tokenID: any, units: any, claim: { __typename?: 'Claim', id: string, creation: any, uri?: string | null, totalUnits?: any | null } }> }; export type ClaimTokensByClaimQueryVariables = Exact<{ - claimId: Scalars["String"]["input"]; + claimId: Scalars['String']['input']; orderDirection?: InputMaybe; - first?: InputMaybe; - skip?: InputMaybe; + first?: InputMaybe; + skip?: InputMaybe; }>; -export type ClaimTokensByClaimQuery = { - __typename?: "Query"; - claimTokens: Array<{ __typename?: "ClaimToken"; id: string; owner: any; tokenID: any; units: any }>; -}; + +export type ClaimTokensByClaimQuery = { __typename?: 'Query', claimTokens: Array<{ __typename?: 'ClaimToken', id: string, owner: any, tokenID: any, units: any }> }; export type ClaimTokenByIdQueryVariables = Exact<{ - claimTokenId: Scalars["ID"]["input"]; + claimTokenId: Scalars['ID']['input']; }>; -export type ClaimTokenByIdQuery = { - __typename?: "Query"; - claimToken?: { - __typename?: "ClaimToken"; - id: string; - owner: any; - tokenID: any; - units: any; - claim: { __typename?: "Claim"; id: string; creation: any; uri?: string | null; totalUnits?: any | null }; - } | null; -}; -export const ClaimsByOwnerDocument = { - kind: "Document", - definitions: [ - { - kind: "OperationDefinition", - operation: "query", - name: { kind: "Name", value: "ClaimsByOwner" }, - variableDefinitions: [ - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "owner" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Bytes" } }, - defaultValue: { kind: "StringValue", value: "", block: false }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "OrderDirection" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "first" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { - kind: "Field", - name: { kind: "Name", value: "claims" }, - arguments: [ - { - kind: "Argument", - name: { kind: "Name", value: "where" }, - value: { - kind: "ObjectValue", - fields: [ - { - kind: "ObjectField", - name: { kind: "Name", value: "owner" }, - value: { kind: "Variable", name: { kind: "Name", value: "owner" } }, - }, - ], - }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "skip" }, - value: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "first" }, - value: { kind: "Variable", name: { kind: "Name", value: "first" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "orderDirection" }, - value: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "contract" } }, - { kind: "Field", name: { kind: "Name", value: "tokenID" } }, - { kind: "Field", name: { kind: "Name", value: "creator" } }, - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "owner" } }, - { kind: "Field", name: { kind: "Name", value: "totalUnits" } }, - { kind: "Field", name: { kind: "Name", value: "uri" } }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const RecentClaimsDocument = { - kind: "Document", - definitions: [ - { - kind: "OperationDefinition", - operation: "query", - name: { kind: "Name", value: "RecentClaims" }, - variableDefinitions: [ - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "OrderDirection" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "first" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { - kind: "Field", - name: { kind: "Name", value: "claims" }, - arguments: [ - { - kind: "Argument", - name: { kind: "Name", value: "orderDirection" }, - value: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "orderBy" }, - value: { kind: "EnumValue", value: "creation" }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "first" }, - value: { kind: "Variable", name: { kind: "Name", value: "first" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "contract" } }, - { kind: "Field", name: { kind: "Name", value: "tokenID" } }, - { kind: "Field", name: { kind: "Name", value: "creator" } }, - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "owner" } }, - { kind: "Field", name: { kind: "Name", value: "totalUnits" } }, - { kind: "Field", name: { kind: "Name", value: "uri" } }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const ClaimByIdDocument = { - kind: "Document", - definitions: [ - { - kind: "OperationDefinition", - operation: "query", - name: { kind: "Name", value: "ClaimById" }, - variableDefinitions: [ - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "id" } }, - type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { - kind: "Field", - name: { kind: "Name", value: "claim" }, - arguments: [ - { - kind: "Argument", - name: { kind: "Name", value: "id" }, - value: { kind: "Variable", name: { kind: "Name", value: "id" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "contract" } }, - { kind: "Field", name: { kind: "Name", value: "tokenID" } }, - { kind: "Field", name: { kind: "Name", value: "creator" } }, - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "owner" } }, - { kind: "Field", name: { kind: "Name", value: "totalUnits" } }, - { kind: "Field", name: { kind: "Name", value: "uri" } }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const ClaimTokensByOwnerDocument = { - kind: "Document", - definitions: [ - { - kind: "OperationDefinition", - operation: "query", - name: { kind: "Name", value: "ClaimTokensByOwner" }, - variableDefinitions: [ - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "owner" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Bytes" } }, - defaultValue: { kind: "StringValue", value: "", block: false }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "OrderDirection" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "first" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { - kind: "Field", - name: { kind: "Name", value: "claimTokens" }, - arguments: [ - { - kind: "Argument", - name: { kind: "Name", value: "where" }, - value: { - kind: "ObjectValue", - fields: [ - { - kind: "ObjectField", - name: { kind: "Name", value: "owner" }, - value: { kind: "Variable", name: { kind: "Name", value: "owner" } }, - }, - ], - }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "skip" }, - value: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "first" }, - value: { kind: "Variable", name: { kind: "Name", value: "first" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "orderDirection" }, - value: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "owner" } }, - { kind: "Field", name: { kind: "Name", value: "tokenID" } }, - { kind: "Field", name: { kind: "Name", value: "units" } }, - { - kind: "Field", - name: { kind: "Name", value: "claim" }, - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "creation" } }, - { kind: "Field", name: { kind: "Name", value: "uri" } }, - { kind: "Field", name: { kind: "Name", value: "totalUnits" } }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const ClaimTokensByClaimDocument = { - kind: "Document", - definitions: [ - { - kind: "OperationDefinition", - operation: "query", - name: { kind: "Name", value: "ClaimTokensByClaim" }, - variableDefinitions: [ - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "claimId" } }, - type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "OrderDirection" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "first" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - type: { kind: "NamedType", name: { kind: "Name", value: "Int" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { - kind: "Field", - name: { kind: "Name", value: "claimTokens" }, - arguments: [ - { - kind: "Argument", - name: { kind: "Name", value: "where" }, - value: { - kind: "ObjectValue", - fields: [ - { - kind: "ObjectField", - name: { kind: "Name", value: "claim" }, - value: { kind: "Variable", name: { kind: "Name", value: "claimId" } }, - }, - ], - }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "skip" }, - value: { kind: "Variable", name: { kind: "Name", value: "skip" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "first" }, - value: { kind: "Variable", name: { kind: "Name", value: "first" } }, - }, - { - kind: "Argument", - name: { kind: "Name", value: "orderDirection" }, - value: { kind: "Variable", name: { kind: "Name", value: "orderDirection" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "owner" } }, - { kind: "Field", name: { kind: "Name", value: "tokenID" } }, - { kind: "Field", name: { kind: "Name", value: "units" } }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; -export const ClaimTokenByIdDocument = { - kind: "Document", - definitions: [ - { - kind: "OperationDefinition", - operation: "query", - name: { kind: "Name", value: "ClaimTokenById" }, - variableDefinitions: [ - { - kind: "VariableDefinition", - variable: { kind: "Variable", name: { kind: "Name", value: "claimTokenId" } }, - type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ID" } } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { - kind: "Field", - name: { kind: "Name", value: "claimToken" }, - arguments: [ - { - kind: "Argument", - name: { kind: "Name", value: "id" }, - value: { kind: "Variable", name: { kind: "Name", value: "claimTokenId" } }, - }, - ], - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "owner" } }, - { kind: "Field", name: { kind: "Name", value: "tokenID" } }, - { kind: "Field", name: { kind: "Name", value: "units" } }, - { - kind: "Field", - name: { kind: "Name", value: "claim" }, - selectionSet: { - kind: "SelectionSet", - selections: [ - { kind: "Field", name: { kind: "Name", value: "id" } }, - { kind: "Field", name: { kind: "Name", value: "creation" } }, - { kind: "Field", name: { kind: "Name", value: "uri" } }, - { kind: "Field", name: { kind: "Name", value: "totalUnits" } }, - ], - }, - }, - ], - }, - }, - ], - }, - }, - ], -} as unknown as DocumentNode; +export type ClaimTokenByIdQuery = { __typename?: 'Query', claimToken?: { __typename?: 'ClaimToken', id: string, owner: any, tokenID: any, units: any, claim: { __typename?: 'Claim', id: string, creation: any, uri?: string | null, totalUnits?: any | null } } | null }; + + +export const ClaimsByOwnerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ClaimsByOwner"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"owner"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}},"defaultValue":{"kind":"StringValue","value":"","block":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"claims"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"owner"},"value":{"kind":"Variable","name":{"kind":"Name","value":"owner"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"tokenID"}},{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"totalUnits"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}}]}}]}}]} as unknown as DocumentNode; +export const RecentClaimsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"RecentClaims"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"claims"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"EnumValue","value":"creation"}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"tokenID"}},{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"totalUnits"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}}]}}]}}]} as unknown as DocumentNode; +export const ClaimByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ClaimById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"claim"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contract"}},{"kind":"Field","name":{"kind":"Name","value":"tokenID"}},{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"totalUnits"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}}]}}]}}]} as unknown as DocumentNode; +export const ClaimTokensByOwnerDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ClaimTokensByOwner"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"owner"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Bytes"}},"defaultValue":{"kind":"StringValue","value":"","block":false}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"claimTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"owner"},"value":{"kind":"Variable","name":{"kind":"Name","value":"owner"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"tokenID"}},{"kind":"Field","name":{"kind":"Name","value":"units"}},{"kind":"Field","name":{"kind":"Name","value":"claim"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"creation"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}},{"kind":"Field","name":{"kind":"Name","value":"totalUnits"}}]}}]}}]}}]} as unknown as DocumentNode; +export const ClaimTokensByClaimDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ClaimTokensByClaim"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"claimId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"skip"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"claimTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"claim"},"value":{"kind":"Variable","name":{"kind":"Name","value":"claimId"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"skip"},"value":{"kind":"Variable","name":{"kind":"Name","value":"skip"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"tokenID"}},{"kind":"Field","name":{"kind":"Name","value":"units"}}]}}]}}]} as unknown as DocumentNode; +export const ClaimTokenByIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ClaimTokenById"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"claimTokenId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"claimToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"claimTokenId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"owner"}},{"kind":"Field","name":{"kind":"Name","value":"tokenID"}},{"kind":"Field","name":{"kind":"Name","value":"units"}},{"kind":"Field","name":{"kind":"Name","value":"claim"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"creation"}},{"kind":"Field","name":{"kind":"Name","value":"uri"}},{"kind":"Field","name":{"kind":"Name","value":"totalUnits"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/sdk/src/indexer/gql/index.ts b/sdk/src/indexer/gql/index.ts index 0ea4a91c..f5159916 100644 --- a/sdk/src/indexer/gql/index.ts +++ b/sdk/src/indexer/gql/index.ts @@ -1,2 +1,2 @@ export * from "./fragment-masking"; -export * from "./gql"; +export * from "./gql"; \ No newline at end of file diff --git a/sdk/src/utils/index.ts b/sdk/src/utils/index.ts index 37e88876..ffe0e6b4 100644 --- a/sdk/src/utils/index.ts +++ b/sdk/src/utils/index.ts @@ -7,6 +7,7 @@ import { logger } from "./logger"; import { handleSdkError, handleContractError } from "./errors"; import { uploadMetadata, uploadAllowlist } from "./apis"; import { getClaimStoredDataFromTxHash } from "./txParser"; +import { parseClaimOrFractionId } from "./parsing"; export { walletClientToSigner, @@ -21,4 +22,5 @@ export { uploadAllowlist, parseAllowListEntriesToMerkleTree, getClaimStoredDataFromTxHash, + parseClaimOrFractionId, }; diff --git a/sdk/src/utils/parsing.ts b/sdk/src/utils/parsing.ts new file mode 100644 index 00000000..74ce0758 --- /dev/null +++ b/sdk/src/utils/parsing.ts @@ -0,0 +1,37 @@ +import { isAddress } from "viem"; + +export const parseClaimOrFractionId = (claimId: string) => { + const [chainId, contractAddress, id] = claimId.split("-"); + + if (!chainId || !contractAddress || !id || !isAddress(contractAddress)) { + console.log("Invalid claimId format. Expected 'chainId-contractAddress-tokenId'"); + throw new Error(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId"`); + } + + let chainIdParsed: number | undefined; + try { + chainIdParsed = parseInt(chainId, 10); + } catch (error) { + console.log(`Invalid chainId while parsing: ${chainId}`); + throw new Error(`Invalid chainId while parsing: ${chainId}`); + } + + let idParsed: BigInt | undefined; + try { + idParsed = BigInt(id); + } catch (error) { + console.log(`Invalid id while parsing: ${id}`); + throw new Error(`Invalid id while parsing: ${id}`); + } + + if (!chainIdParsed || !idParsed) { + console.log(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId"`); + throw new Error(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId"`); + } + + return { + chainId: chainIdParsed, + contractAddress, + id: idParsed, + }; +}; From 7317623ca754053159bfe003ee4243d18b14f145 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Tue, 26 Mar 2024 17:10:24 -0600 Subject: [PATCH 3/7] (feat): update autotask scripts --- defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts | 5 ++++- defender/src/auto-tasks/mint-claim-from-allowlist.ts | 2 +- defender/src/auto-tasks/on-allowlist-created.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts b/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts index 578f6aa8..921a92c3 100644 --- a/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts +++ b/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts @@ -93,7 +93,10 @@ export async function handler(event: AutotaskEvent) { console.log("ClaimIDs: ", claimIds.toString()); const formattedClaimIds = claimIds.map( - (claimId) => `${contractAddress}-${claimId.toString().toLowerCase()}`, + (claimId) => + `${network.chainId}-${contractAddress}-${claimId + .toString() + .toLowerCase()}`, ); console.log("Formatted claim ids", formattedClaimIds); diff --git a/defender/src/auto-tasks/mint-claim-from-allowlist.ts b/defender/src/auto-tasks/mint-claim-from-allowlist.ts index b53ca014..ab1fa571 100644 --- a/defender/src/auto-tasks/mint-claim-from-allowlist.ts +++ b/defender/src/auto-tasks/mint-claim-from-allowlist.ts @@ -103,7 +103,7 @@ export async function handler(event: AutotaskEvent) { batchTransferEvents[0].args["claimIDs"][0].toString(), ); - const formattedClaimId = `${contractAddress}-${claimId + const formattedClaimId = `${network.chainId}-${contractAddress}-${claimId .toString() .toLowerCase()}`; console.log("Formatted claim id", formattedClaimId); diff --git a/defender/src/auto-tasks/on-allowlist-created.ts b/defender/src/auto-tasks/on-allowlist-created.ts index 0e73472b..61704688 100644 --- a/defender/src/auto-tasks/on-allowlist-created.ts +++ b/defender/src/auto-tasks/on-allowlist-created.ts @@ -129,7 +129,7 @@ export async function handler(event: AutotaskEvent) { console.log("addresses", addresses); const data = addresses.map((address, index) => ({ address: address.toLowerCase(), - claimId: `${contractAddress}-${tokenId}`, + claimId: `${network.chainId}-${contractAddress}-${tokenId}`, fractionCounter: index, chainId: network.chainId, })); From cc330a4497726975a689b6175ca0396dc1dc79ba Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Sat, 6 Apr 2024 21:28:41 -0300 Subject: [PATCH 4/7] (feat): add is claim on connected chain utility method --- pnpm-lock.yaml | 3 +++ sdk/package.json | 1 + sdk/src/client.ts | 6 ++++++ sdk/src/indexer.ts | 6 +++++- sdk/src/types/client.ts | 12 ++++++++++-- sdk/src/utils/chains.ts | 9 +++++++++ 6 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 sdk/src/utils/chains.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e05f22cf..d159c099 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -591,6 +591,9 @@ importers: ethers: specifier: 5.7.2 version: 5.7.2 + fast-deep-equal: + specifier: ^3.1.3 + version: 3.1.3 graphql: specifier: ^16.8.1 version: 16.8.1 diff --git a/sdk/package.json b/sdk/package.json index 6329bb32..a13dffe3 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -32,6 +32,7 @@ "axios": "^1.6.2", "dotenv": "^16.0.3", "ethers": "5.7.2", + "fast-deep-equal": "^3.1.3", "graphql": "^16.8.1", "loglevel": "^1.8.1", "urql": "^4.0.6", diff --git a/sdk/src/client.ts b/sdk/src/client.ts index ac677b92..edba7016 100644 --- a/sdk/src/client.ts +++ b/sdk/src/client.ts @@ -22,6 +22,7 @@ import { parseAllowListEntriesToMerkleTree } from "./utils/allowlist"; import { DEPLOYMENTS } from "./constants"; import { getClaimStoredDataFromTxHash } from "./utils"; import { ParserReturnType } from "./utils/txParser"; +import { isClaimOnChain } from "./utils/chains"; /** * The `HypercertClient` is a core class in the hypercerts SDK, providing a high-level interface to interact with the hypercerts system. @@ -75,6 +76,11 @@ export class HypercertClient implements HypercertClientInterface { } } + isClaimOrFractionOnConnectedChain = (claimOrFractionId: string) => { + const connectedChain = this._walletClient?.chain?.id; + return isClaimOnChain(claimOrFractionId, connectedChain); + }; + /** * Gets the config for the client. * @returns The client config. diff --git a/sdk/src/indexer.ts b/sdk/src/indexer.ts index 590c01db..ae4019d8 100644 --- a/sdk/src/indexer.ts +++ b/sdk/src/indexer.ts @@ -72,6 +72,10 @@ export class HypercertIndexer implements HypercertIndexerInterface { static getDeploymentsForEnvironment(environment: IndexerEnvironment) { return Object.entries(DEPLOYMENTS).filter(([_, deployment]) => { + if (environment === "all") { + return true; + } + if (environment === "test") { return deployment.isTestnet; } @@ -80,7 +84,7 @@ export class HypercertIndexer implements HypercertIndexerInterface { return !deployment.isTestnet; } - return true; + return false; }); } diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index c4ee4e1f..606f6894 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -80,15 +80,16 @@ export type HypercertClientConfig = Deployment & readOnly: boolean; /** Reason for readOnly mode */ readOnlyReason?: string; - /** The environment to run the indexer in. This can be either production or test. */ + /** The environment to run the indexer in. This can be either production, test or all. Defaults to test */ indexerEnvironment: IndexerEnvironment; }; /** * The environment to run the indexer in. * Production will run against all mainnet chains, while test will run against testnet chains. + * All will run against both */ -export type IndexerEnvironment = "production" | "test"; +export type IndexerEnvironment = "production" | "test" | "all"; /** * Configuration options for the Hypercert storage layer. @@ -292,4 +293,11 @@ export interface HypercertClientMethods { units: bigint[], proofs: (Hex | ByteArray)[][], ) => Promise<`0x${string}` | undefined>; + + /** + * Check if a claim or fraction is on the chain that the Hypercertclient + * is currently connected to + * @param claimOrFractionId The ID of the claim or fraction to check. + */ + isClaimOrFractionOnConnectedChain: (claimOrFractionId: string) => boolean; } diff --git a/sdk/src/utils/chains.ts b/sdk/src/utils/chains.ts new file mode 100644 index 00000000..9f5ccb0d --- /dev/null +++ b/sdk/src/utils/chains.ts @@ -0,0 +1,9 @@ +import { parseClaimOrFractionId } from "./parsing"; + +export const isClaimOnChain = (claimId: string, chainId: number | undefined) => { + if (chainId === undefined) { + return false; + } + const { chainId: parsedChainId } = parseClaimOrFractionId(claimId); + return parsedChainId === chainId; +}; From a1cb9e2edb98ab916e39eb91b3c544eaaf08a347 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Sun, 14 Apr 2024 11:24:14 -0400 Subject: [PATCH 5/7] (feat): update tests and docs --- sdk/README.md | 24 ++++++++-------- sdk/package.json | 2 +- sdk/src/constants.ts | 1 + sdk/src/indexer.ts | 17 +++++++---- sdk/src/types/client.ts | 2 +- sdk/src/utils/config.ts | 48 ++++++-------------------------- sdk/src/utils/parsing.ts | 4 +-- sdk/test/indexer.test.ts | 25 ++++++++--------- sdk/test/indexer/queries.test.ts | 5 +--- sdk/test/utils/config.test.ts | 9 +++--- 10 files changed, 55 insertions(+), 82 deletions(-) diff --git a/sdk/README.md b/sdk/README.md index 729940a6..6b5f1f23 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -58,18 +58,18 @@ HypercertClientConfig is a configuration object used when initializing a new ins you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide `chain.id` to initalize the client in `readonly` mode. -| Field | Type | Description | -| --------------------------- | ------- | ---------------------------------------------------------------------------------------------- | -| `chain` | Object | Partial configuration for the blockchain network. | -| `contractAddress` | String | The address of the deployed contract. | -| `graphUrl` | String | The URL to the subgraph that indexes the contract events. Override for localized testing. | -| `graphName` | String | The name of the subgraph. | -| `easContractAddress` | String | The address of the EAS contract. | -| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | -| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | -| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | -| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | -| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | +| Field | Type | Description | +| --------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------- | +| `chain` | Object | Partial configuration for the blockchain network. | +| `contractAddress` | String | The address of the deployed contract. | +| `graphName` | String | The name of the subgraph. | +| `easContractAddress` | String | The address of the EAS contract. | +| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | +| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | +| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | +| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | +| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | +| `indexerEnvironment` | `'test' \| 'production' \| 'all'` | Determines which graphs should be read out when querying | The environment of the indexer. | ### Read-only mode diff --git a/sdk/package.json b/sdk/package.json index a13dffe3..d8970961 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "1.5.0", + "version": "2.0.0-alpha.4", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index 85582795..1fc4fdc1 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -6,6 +6,7 @@ import { Deployment, SupportedChainIds } from "./types"; import { deployments } from "@hypercerts-org/contracts"; const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercerts-org"; +export const DEFAULT_INDEXER_ENVIRONMENT = "production"; // The APIs we expose diff --git a/sdk/src/indexer.ts b/sdk/src/indexer.ts index ae4019d8..5c62f9bf 100644 --- a/sdk/src/indexer.ts +++ b/sdk/src/indexer.ts @@ -34,7 +34,7 @@ import { parseClaimOrFractionId } from "./utils/parsing"; * Because of the autogenerated Graph client packed with the SDK, this class is not recommended for custom Graph deployments. * * @example - * const indexer = new HypercertIndexer({ graphUrl: 'your-graph-url', graphName: 'your-graph-name' }); + * const indexer = new HypercertIndexer({ indexerEnvironment: 'production' }); * const claims = await indexer.claimsByOwner('your-address'); */ export class HypercertIndexer implements HypercertIndexerInterface { @@ -48,16 +48,22 @@ export class HypercertIndexer implements HypercertIndexerInterface { * @param options The configuration options for the indexer. */ constructor(options: Partial) { - logger.info("Creating HypercertIndexer", "constructor", { name: options.graphName, url: options.graphUrl }); - if (!options.graphUrl) throw new Error("Missing graphUrl"); - this.environment = options.indexerEnvironment || "test"; + logger.info("Creating HypercertIndexer", "constructor (write)", { + environment: options.indexerEnvironment, + }); + + if (!options.indexerEnvironment) { + throw new Error("Missing indexer environment"); + } + this.environment = options.indexerEnvironment; const environments = HypercertIndexer.getDeploymentsForEnvironment(this.environment); + logger.info("Creating Graph clients", "constructor (read)", { environments }); this.graphClients = new Map(); for (const [chainId, deployment] of environments) { if (!deployment.graphUrl) { - console.log(`Missing graphUrl for chain ${chainId}`); + logger.info("Missing graphUrl for chain", "constructor (read)", { chainId }); continue; } this.graphClients.set( @@ -71,6 +77,7 @@ export class HypercertIndexer implements HypercertIndexerInterface { } static getDeploymentsForEnvironment(environment: IndexerEnvironment) { + logger.info("Indexer", "getDeploymentsForEnvironment", { environment }); return Object.entries(DEPLOYMENTS).filter(([_, deployment]) => { if (environment === "all") { return true; diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index 606f6894..dcd02794 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -68,7 +68,7 @@ export type Deployment = { /** * Configuration options for the Hypercert client. */ -export type HypercertClientConfig = Deployment & +export type HypercertClientConfig = Pick & HypercertStorageConfig & HypercertEvaluatorConfig & { /** The PublicClient is inherently read-only */ diff --git a/sdk/src/utils/config.ts b/sdk/src/utils/config.ts index 7ac30a8e..d58e2cb7 100644 --- a/sdk/src/utils/config.ts +++ b/sdk/src/utils/config.ts @@ -1,6 +1,6 @@ import { sepolia, optimism, celo, Chain, baseSepolia, base } from "viem/chains"; -import { DEPLOYMENTS } from "../constants"; +import { DEFAULT_INDEXER_ENVIRONMENT } from "../constants"; import { ConfigurationError, Deployment, @@ -34,7 +34,7 @@ import { deployments } from "../../src"; * @throws {UnsupportedChainError} Will throw an `UnsupportedChainError` if the default configuration for the provided chain ID is missing. */ export const getConfig = (overrides: Partial): Partial => { - // Get the chainId, first from overrides, then environment variables, then the constant + // Get the chainId of the writing chain, first from overrides, then environment variables, then the constant const chain = getChainConfig(overrides); if (!chain) { logger.warn("[getConfig]: No default config for chain found"); @@ -43,22 +43,20 @@ export const getConfig = (overrides: Partial): Partial & { unsafeForceOverrideConfig?: boolean }) | undefined; if (overrides.unsafeForceOverrideConfig) { - if (!overrides.chain?.id || !overrides.graphUrl) { + if (!overrides.chain?.id) { throw new InvalidOrMissingError( `attempted to override with chainId=${overrides.chain?.id}, but requires chainName, graphUrl, and contractAddress to be set`, { chainID: overrides.chain?.id?.toString(), - graphUrl: overrides.graphUrl, }, ); } baseDeployment = { chain: { ...chain, id: overrides.chain?.id }, - graphUrl: overrides.graphUrl, unsafeForceOverrideConfig: overrides.unsafeForceOverrideConfig, }; } else { - //TODO doo many casts + //TODO do many casts baseDeployment = overrides.chain?.id ? (getDeployment(overrides.chain?.id as SupportedChainIds) as Partial & { unsafeForceOverrideConfig?: boolean; @@ -81,8 +79,8 @@ export const getConfig = (overrides: Partial): Partial { return deployments[chainId]; }; +const getIndexerEnvironment = (overrides: Partial) => { + return { indexerEnvironment: overrides.indexerEnvironment || DEFAULT_INDEXER_ENVIRONMENT }; +}; + const getChainConfig = (overrides: Partial) => { const chainId = overrides?.chain?.id ? overrides.chain?.id : undefined; @@ -120,38 +122,6 @@ const getChainConfig = (overrides: Partial) => { return chain; }; -const getGraphUrl = (overrides: Partial) => { - let graphUrl; - if (overrides.unsafeForceOverrideConfig) { - if (!overrides.graphUrl) { - throw new ConfigurationError("A graphUrl must be specified when overriding configuration"); - } - try { - new URL(overrides.graphUrl); - } catch (error) { - throw new ConfigurationError("Invalid graph URL", { graphUrl: overrides.graphUrl }); - } - graphUrl = overrides.graphUrl; - return { graphUrl }; - } - - const chain = getChainConfig(overrides); - - graphUrl = DEPLOYMENTS[chain?.id as keyof typeof DEPLOYMENTS].graphUrl ?? process.env.GRAPH_URL; - if (!graphUrl) { - throw new UnsupportedChainError(`No Graph URL found in deployments or env vars`, { - chainID: chain?.toString(), - }); - } - try { - new URL(graphUrl); - } catch (error) { - throw new ConfigurationError("Invalid graph URL", { graphUrl }); - } - - return { graphUrl }; -}; - const getWalletClient = (overrides: Partial) => { const walletClient = overrides.walletClient; diff --git a/sdk/src/utils/parsing.ts b/sdk/src/utils/parsing.ts index 74ce0758..d699b8b4 100644 --- a/sdk/src/utils/parsing.ts +++ b/sdk/src/utils/parsing.ts @@ -4,7 +4,7 @@ export const parseClaimOrFractionId = (claimId: string) => { const [chainId, contractAddress, id] = claimId.split("-"); if (!chainId || !contractAddress || !id || !isAddress(contractAddress)) { - console.log("Invalid claimId format. Expected 'chainId-contractAddress-tokenId'"); + console.log(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId`); throw new Error(`Invalid claimId format (claimId given: ${claimId}}. Expected "chainId-contractAddress-tokenId"`); } @@ -16,7 +16,7 @@ export const parseClaimOrFractionId = (claimId: string) => { throw new Error(`Invalid chainId while parsing: ${chainId}`); } - let idParsed: BigInt | undefined; + let idParsed: bigint | undefined; try { idParsed = BigInt(id); } catch (error) { diff --git a/sdk/test/indexer.test.ts b/sdk/test/indexer.test.ts index cc5d29d3..784e2d54 100644 --- a/sdk/test/indexer.test.ts +++ b/sdk/test/indexer.test.ts @@ -1,22 +1,21 @@ -import { describe, it } from "vitest"; - -import { expect } from "chai"; +import { describe, it, expect } from "vitest"; import { HypercertIndexer } from "../src/indexer"; +import { DEPLOYMENTS } from "../src/constants"; describe("HypercertsIndexer", () => { - it("should be able to create a new instance without valid graphName", () => { - const indexer = new HypercertIndexer({ graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet" }); - - expect(indexer).to.be.an.instanceOf(HypercertIndexer); + it("should only initialize with test environments", async () => { + const environments = HypercertIndexer.getDeploymentsForEnvironment("test"); + expect(environments.every(([_, deployment]) => deployment.isTestnet)).toBe(true); }); - it("should be able to create a new instance with valid graphName and url", () => { - const indexer = new HypercertIndexer({ - graphName: "hypercerts-testnet", - graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet", - }); + it("should only initialize with production environments", async () => { + const environments = HypercertIndexer.getDeploymentsForEnvironment("production"); + expect(environments.every(([_, deployment]) => !deployment.isTestnet)).toBe(true); + }); - expect(indexer).to.be.an.instanceOf(HypercertIndexer); + it("should only initialize with all environments", async () => { + const environments = HypercertIndexer.getDeploymentsForEnvironment("all"); + expect(environments.length).toEqual(Object.keys(DEPLOYMENTS).length); }); }); diff --git a/sdk/test/indexer/queries.test.ts b/sdk/test/indexer/queries.test.ts index 27096d01..9c4793f1 100644 --- a/sdk/test/indexer/queries.test.ts +++ b/sdk/test/indexer/queries.test.ts @@ -7,10 +7,7 @@ describe("HypercertIndexer", () => { let indexer: HypercertIndexer; beforeEach(() => { - indexer = new HypercertIndexer({ - graphName: "hypercerts-testnet", - graphUrl: "https://api.thegraph.com/subgraphs/name/hypercerts-testnet", - }); + indexer = new HypercertIndexer({ indexerEnvironment: "test" }); }); afterEach(() => { diff --git a/sdk/test/utils/config.test.ts b/sdk/test/utils/config.test.ts index 33f75089..f9d21fce 100644 --- a/sdk/test/utils/config.test.ts +++ b/sdk/test/utils/config.test.ts @@ -8,6 +8,7 @@ import { ConfigurationError, HypercertClientConfig, InvalidOrMissingError } from import { getConfig } from "../../src/utils/config"; import { reloadEnv } from "../../test/setup-env"; import { walletClient, publicClient } from "../helpers"; +import { DEFAULT_INDEXER_ENVIRONMENT } from "../../src/constants"; chai.use(chaiSubset); @@ -16,25 +17,23 @@ describe("Config: graphUrl", () => { reloadEnv(); }); - it("should return the default graphUrl when no overrides are specified", () => { + it("should return the default indexer environment when no overrides are specified", () => { const result = getConfig({ chain: { id: 11155111 } }); - expect(result.graphUrl).to.equal("https://api.thegraph.com/subgraphs/name/hypercerts-org/hypercerts-sepolia"); + expect(result.indexerEnvironment).to.equal(DEFAULT_INDEXER_ENVIRONMENT); }); it("should return the config specified by overrides", () => { const overrides: Partial = { chain: { id: 11155111 }, - graphUrl: "https://api.example.com", unsafeForceOverrideConfig: true, }; const result = getConfig(overrides); - expect(result.graphUrl).to.equal(overrides.graphUrl); + expect(result.chain?.id).to.equal(overrides.chain?.id); }); it("should throw an error when the graph URL specified by overrides is invalid", () => { const overrides: Partial = { chain: { id: 11155111 }, - graphUrl: "incorrect-url", unsafeForceOverrideConfig: true, }; From b78ac09571e7a0c759e7d3fa95a5095178decbd6 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Sun, 14 Apr 2024 19:07:48 -0400 Subject: [PATCH 6/7] (feat): set default indexer environment to all --- sdk/package.json | 2 +- sdk/src/constants.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/package.json b/sdk/package.json index d8970961..caef98df 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "2.0.0-alpha.4", + "version": "2.0.0-alpha.5", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", diff --git a/sdk/src/constants.ts b/sdk/src/constants.ts index 1fc4fdc1..bb155cd6 100644 --- a/sdk/src/constants.ts +++ b/sdk/src/constants.ts @@ -2,11 +2,11 @@ * Constants */ -import { Deployment, SupportedChainIds } from "./types"; +import { Deployment, IndexerEnvironment, SupportedChainIds } from "./types"; import { deployments } from "@hypercerts-org/contracts"; const DEFAULT_GRAPH_BASE_URL = "https://api.thegraph.com/subgraphs/name/hypercerts-org"; -export const DEFAULT_INDEXER_ENVIRONMENT = "production"; +export const DEFAULT_INDEXER_ENVIRONMENT: IndexerEnvironment = "all"; // The APIs we expose From 5f7a08ca5a971480af560b0e5b2964f11b9ee2f8 Mon Sep 17 00:00:00 2001 From: jipstavenuiter Date: Sun, 14 Apr 2024 19:09:13 -0400 Subject: [PATCH 7/7] (fix): revert auto-task updates --- defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts | 5 +---- defender/src/auto-tasks/mint-claim-from-allowlist.ts | 2 +- defender/src/auto-tasks/on-allowlist-created.ts | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts b/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts index 921a92c3..578f6aa8 100644 --- a/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts +++ b/defender/src/auto-tasks/batch-mint-claims-from-allowlists.ts @@ -93,10 +93,7 @@ export async function handler(event: AutotaskEvent) { console.log("ClaimIDs: ", claimIds.toString()); const formattedClaimIds = claimIds.map( - (claimId) => - `${network.chainId}-${contractAddress}-${claimId - .toString() - .toLowerCase()}`, + (claimId) => `${contractAddress}-${claimId.toString().toLowerCase()}`, ); console.log("Formatted claim ids", formattedClaimIds); diff --git a/defender/src/auto-tasks/mint-claim-from-allowlist.ts b/defender/src/auto-tasks/mint-claim-from-allowlist.ts index ab1fa571..b53ca014 100644 --- a/defender/src/auto-tasks/mint-claim-from-allowlist.ts +++ b/defender/src/auto-tasks/mint-claim-from-allowlist.ts @@ -103,7 +103,7 @@ export async function handler(event: AutotaskEvent) { batchTransferEvents[0].args["claimIDs"][0].toString(), ); - const formattedClaimId = `${network.chainId}-${contractAddress}-${claimId + const formattedClaimId = `${contractAddress}-${claimId .toString() .toLowerCase()}`; console.log("Formatted claim id", formattedClaimId); diff --git a/defender/src/auto-tasks/on-allowlist-created.ts b/defender/src/auto-tasks/on-allowlist-created.ts index 61704688..0e73472b 100644 --- a/defender/src/auto-tasks/on-allowlist-created.ts +++ b/defender/src/auto-tasks/on-allowlist-created.ts @@ -129,7 +129,7 @@ export async function handler(event: AutotaskEvent) { console.log("addresses", addresses); const data = addresses.map((address, index) => ({ address: address.toLowerCase(), - claimId: `${network.chainId}-${contractAddress}-${tokenId}`, + claimId: `${contractAddress}-${tokenId}`, fractionCounter: index, chainId: network.chainId, }));