From 9109ce08c0ec2573120ee1bf121a665779faeff2 Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Wed, 13 Sep 2023 12:15:34 -0400 Subject: [PATCH] Update codegen to new schema (#98) --- .../sdk/src/api/graphql/fragmentMatcher.ts | 3 +- .../sdk/src/api/graphql/generatedTypes.ts | 118 +++++++++++++----- 2 files changed, 91 insertions(+), 30 deletions(-) diff --git a/packages/libs/sdk/src/api/graphql/fragmentMatcher.ts b/packages/libs/sdk/src/api/graphql/fragmentMatcher.ts index 716a9e3c..83f599f1 100644 --- a/packages/libs/sdk/src/api/graphql/fragmentMatcher.ts +++ b/packages/libs/sdk/src/api/graphql/fragmentMatcher.ts @@ -12,7 +12,8 @@ ], "Contract": [ "NFTContract", - "TokenContract" + "TokenContract", + "UnclassifiedContract" ], "NFT": [ "ERC721NFT", diff --git a/packages/libs/sdk/src/api/graphql/generatedTypes.ts b/packages/libs/sdk/src/api/graphql/generatedTypes.ts index 7b34cc63..86d52214 100644 --- a/packages/libs/sdk/src/api/graphql/generatedTypes.ts +++ b/packages/libs/sdk/src/api/graphql/generatedTypes.ts @@ -98,6 +98,8 @@ export type CodegenCollectionCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; @@ -335,6 +337,8 @@ export type CodegenContractCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; export type CodegenContractStandard = @@ -362,17 +366,6 @@ export type CodegenContractTokenEventsConnectionEdge = { node: CodegenTokenEvent; }; -export type CodegenContractsConnection = { - edges: Array; - pageInfo: CodegenPageInfo; - totalCount?: Maybe; -}; - -export type CodegenContractsEdge = { - cursor: Scalars['String']; - node: CodegenContract; -}; - /** Filter input for contracts */ export type CodegenContractsFilterInput = { /** The address of the contract */ @@ -489,6 +482,8 @@ export type CodegenERC721CollectionCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; @@ -548,6 +543,8 @@ export type CodegenERC721NFTCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; export type CodegenERC1155Collection = CodegenCollection & { @@ -647,6 +644,8 @@ export type CodegenERC1155CollectionCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; @@ -704,6 +703,8 @@ export type CodegenERC1155NFTCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; @@ -734,7 +735,7 @@ export type CodegenEVMSchemaType = { collection?: Maybe; collections: CodegenEVMSchemaTypeCollectionsConnection; contract?: Maybe; - contracts: CodegenContractsConnection; + contracts: CodegenEVMSchemaTypeContractsConnection; /** Fetch historical gas prices by block number. */ gasPrices?: Maybe>; nft?: Maybe; @@ -796,6 +797,8 @@ export type CodegenEVMSchemaTypeCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; @@ -845,6 +848,17 @@ export type CodegenEVMSchemaTypeCollectionsConnectionEdge = { node: CodegenCollection; }; +export type CodegenEVMSchemaTypeContractsConnection = { + edges: Array; + pageInfo: CodegenPageInfo; + totalCount?: Maybe; +}; + +export type CodegenEVMSchemaTypeContractsConnectionEdge = { + cursor: Scalars['String']; + node: CodegenContract; +}; + export type CodegenEVMSchemaTypeTokenEventsConnection = { edges: Array; pageInfo: CodegenPageInfo; @@ -963,6 +977,8 @@ export type CodegenNFTCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; export type CodegenNFTContract = CodegenContract & { @@ -989,6 +1005,8 @@ export type CodegenNFTContractCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; export type CodegenNFTTokenEventsConnection = { @@ -1042,6 +1060,8 @@ export type CodegenQuery = { }; export type CodegenStringInput = { + /** Contains */ + contains?: InputMaybe; /** Equal to */ eq?: InputMaybe; /** In */ @@ -1107,6 +1127,8 @@ export type CodegenTokenContractCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; /** Token details */ @@ -1133,6 +1155,9 @@ export type CodegenTokenEvent = { type: CodegenTokenTransferType; }; +export type CodegenTokenEventOrderBy = + | 'TIMESTAMP'; + /** Filter input for token events */ export type CodegenTokenEventsFilterInput = { /** Filter token events by their block number */ @@ -1407,6 +1432,33 @@ export type CodegenTrendingPeriod = | 'THIRTY_MINUTES' | 'TWELVE_HOURS'; +export type CodegenUnclassifiedContract = CodegenContract & { + /** The ABI of the contract */ + abi?: Maybe; + /** The contract address */ + address: Scalars['String']; + /** Contract with verified ABI */ + isVerified?: Maybe; + /** The name of the contract */ + name?: Maybe; + /** The supported ERC interfaces of the contract */ + supportedErcInterfaces?: Maybe>; + /** The symbol of the contract */ + symbol?: Maybe; + tokenEvents: CodegenContractTokenEventsConnection; +}; + + +export type CodegenUnclassifiedContractCodegentokenEventsArgs = { + after?: InputMaybe; + before?: InputMaybe; + filter?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; +}; + export type CodegenWallet = { /** The address of the wallet */ address: Scalars['String']; @@ -1419,7 +1471,7 @@ export type CodegenWallet = { walletCollection?: Maybe; walletCollections: CodegenWalletWalletCollectionsConnection; walletNFT?: Maybe; - walletNFTs: CodegenWalletNFTsConnection; + walletNFTs: CodegenWalletWalletNFTsConnection; }; @@ -1439,6 +1491,8 @@ export type CodegenWalletCodegentokenEventsArgs = { filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; }; @@ -1498,6 +1552,8 @@ export type CodegenWalletCollectionOrderBy = /** Filter of collections in a wallet */ export type CodegenWalletCollectionsFilterInput = { + /** The name of the collection */ + collectionName?: InputMaybe; contractAddressIn?: InputMaybe>; }; @@ -1507,17 +1563,6 @@ export type CodegenWalletNFT = { nftsCount?: Maybe; }; -export type CodegenWalletNFTsConnection = { - edges: Array; - pageInfo: CodegenPageInfo; - totalCount?: Maybe; -}; - -export type CodegenWalletNFTsConnectionEdge = { - cursor: Scalars['String']; - node: CodegenWalletNFT; -}; - /** Filter of nfts in a wallet by contract address and optional token id. Results are returned if any of the conditions are matched. */ export type CodegenWalletNFTsContractTokenFilterInput = { contractAddress: Scalars['String']; @@ -1527,6 +1572,8 @@ export type CodegenWalletNFTsContractTokenFilterInput = { /** Filter of nfts in a wallet */ export type CodegenWalletNFTsFilterInput = { contractTokens?: InputMaybe>; + /** The name of the nft */ + nftName?: InputMaybe; }; export type CodegenWalletNFTsOrderBy = @@ -1571,12 +1618,12 @@ export type CodegenWalletTokenEventsConnectionEdge = { }; export type CodegenWalletTransactionsConnection = { - edges: Array; + edges: Array; pageInfo: CodegenPageInfo; totalCount?: Maybe; }; -export type CodegenWalletTransactionsEdge = { +export type CodegenWalletTransactionsConnectionEdge = { cursor: Scalars['String']; node: CodegenTransaction; }; @@ -1592,6 +1639,17 @@ export type CodegenWalletWalletCollectionsConnectionEdge = { node: CodegenWalletCollection; }; +export type CodegenWalletWalletNFTsConnection = { + edges: Array; + pageInfo: CodegenPageInfo; + totalCount?: Maybe; +}; + +export type CodegenWalletWalletNFTsConnectionEdge = { + cursor: Scalars['String']; + node: CodegenWalletNFT; +}; + export type CodegenEthMainnetContractDetailsQueryVariables = Exact<{ contractAddress: Scalars['String']; }>; @@ -1781,7 +1839,7 @@ export type CodegenEthMainnetGasPricesQuery = { ethereum: CodegenGasPriceFragmen export type CodegenCollectionEventsFragmentFragment = { collection?: { address: string, tokenEvents: { pageInfo: CodegenPaginationFragment, edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }> } } | { address: string, tokenEvents: { pageInfo: CodegenPaginationFragment, edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }> } } | null }; -export type CodegenEventsByContractFragment = { contract?: { tokenEvents: { edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }>, pageInfo: CodegenPaginationFragment } } | { tokenEvents: { edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }>, pageInfo: CodegenPaginationFragment } } | null }; +export type CodegenEventsByContractFragment = { contract?: { tokenEvents: { edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }>, pageInfo: CodegenPaginationFragment } } | { tokenEvents: { edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }>, pageInfo: CodegenPaginationFragment } } | { tokenEvents: { edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }>, pageInfo: CodegenPaginationFragment } } | null }; export type CodegenNftEventsFragmentFragment = { nft?: { contractAddress: string, tokenId: any, tokenEvents: { pageInfo: CodegenPaginationFragment, edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }> } } | { contractAddress: string, tokenId: any, tokenEvents: { pageInfo: CodegenPaginationFragment, edges: Array<{ node: CodegenTokenEventInfo_CodegenTokenBurnEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenMintEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSaleEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenSwapEvent_CodegenFragment | CodegenTokenEventInfo_CodegenTokenTransferEvent_CodegenFragment }> } } | null }; @@ -1797,7 +1855,7 @@ export type CodegenVerifyOwnershipInfoByENSFragment = { walletByENS?: { walletNF export type CodegenVerifyOwnershipNFTDetailsFragment = { nft?: { contractAddress: string, tokenId: any } | { contractAddress: string, tokenId: any } | null }; -export type CodegenContractDetailsFragment = { contract?: CodegenContractInfo_CodegenNFTContract_CodegenFragment | CodegenContractInfo_CodegenTokenContract_CodegenFragment | null }; +export type CodegenContractDetailsFragment = { contract?: CodegenContractInfo_CodegenNFTContract_CodegenFragment | CodegenContractInfo_CodegenTokenContract_CodegenFragment | CodegenContractInfo_CodegenUnclassifiedContract_CodegenFragment | null }; export type CodegenGetBalancesByWalletAddressFragmentFragment = { walletByAddress?: { address: string, ensName?: string | null, tokenBalances: { edges: Array<{ node: CodegenTokenBalanceNodeFragment }>, pageInfo: CodegenPaginationFragment } } | null }; @@ -1835,7 +1893,9 @@ export type CodegenContractInfo_CodegenNFTContract_CodegenFragment = { __typenam export type CodegenContractInfo_CodegenTokenContract_CodegenFragment = { __typename: 'TokenContract', decimals?: any | null, abi?: any | null, address: string, isVerified?: boolean | null, name?: string | null, supportedErcInterfaces?: Array | null, symbol?: string | null }; -export type CodegenContractInfoFragment = CodegenContractInfo_CodegenNFTContract_CodegenFragment | CodegenContractInfo_CodegenTokenContract_CodegenFragment; +export type CodegenContractInfo_CodegenUnclassifiedContract_CodegenFragment = { __typename: 'UnclassifiedContract', abi?: any | null, address: string, isVerified?: boolean | null, name?: string | null, supportedErcInterfaces?: Array | null, symbol?: string | null }; + +export type CodegenContractInfoFragment = CodegenContractInfo_CodegenNFTContract_CodegenFragment | CodegenContractInfo_CodegenTokenContract_CodegenFragment | CodegenContractInfo_CodegenUnclassifiedContract_CodegenFragment; export type CodegenGasPriceInfoFragment = { blockNumber: number, total: number, average: number, ceiling: number, floor: number, median: number };