@quicknode/sdk 1.1.5 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +3 -8
  2. package/cjs/index.js +15 -1093
  3. package/esm/{src/client → client}/client.js +0 -2
  4. package/esm/{src/index.js → index.js} +0 -2
  5. package/esm/lib/validation/ValidateInput.js +16 -0
  6. package/esm/lib/validation/validators.js +15 -0
  7. package/index.d.ts +6 -2767
  8. package/package.json +11 -29
  9. package/esm/package.json.js +0 -3
  10. package/esm/src/api/api.js +0 -94
  11. package/esm/src/api/controllers/contracts.js +0 -34
  12. package/esm/src/api/controllers/events.js +0 -113
  13. package/esm/src/api/controllers/nfts.js +0 -227
  14. package/esm/src/api/controllers/tokens.js +0 -93
  15. package/esm/src/api/controllers/transactions.js +0 -120
  16. package/esm/src/api/controllers/utils.js +0 -53
  17. package/esm/src/api/graphql/customUrqlClient.js +0 -23
  18. package/esm/src/api/graphql/generatedTypes.js +0 -22
  19. package/esm/src/api/graphql/modifyQueryForChain.js +0 -28
  20. package/esm/src/api/index.d.ts +0 -2690
  21. package/esm/src/api/index.js +0 -2
  22. package/esm/src/api/types/chains.js +0 -7
  23. package/esm/src/api/types/contracts/getContractDetails.js +0 -12
  24. package/esm/src/api/types/events/getAll.js +0 -7
  25. package/esm/src/api/types/events/getByContract.js +0 -12
  26. package/esm/src/api/types/nfts/getByContractAddress.js +0 -10
  27. package/esm/src/api/types/nfts/getByWalletAddress.js +0 -18
  28. package/esm/src/api/types/nfts/getCollectionDetails.js +0 -11
  29. package/esm/src/api/types/nfts/getCollectionEvents.js +0 -12
  30. package/esm/src/api/types/nfts/getNFTDetails.js +0 -9
  31. package/esm/src/api/types/nfts/getNFTEvents.js +0 -13
  32. package/esm/src/api/types/nfts/getTrendingCollections.js +0 -7
  33. package/esm/src/api/types/nfts/verifyOwnershipByAddress.js +0 -12
  34. package/esm/src/api/types/tokens/getBalancesByWalletAddress.js +0 -12
  35. package/esm/src/api/types/transactions/getByHash.js +0 -11
  36. package/esm/src/api/types/transactions/getBySearch.js +0 -7
  37. package/esm/src/api/types/utils/gasPrices.js +0 -12
  38. package/esm/src/api/utils/constants.js +0 -3
  39. package/esm/src/api/utils/helpers.js +0 -11
  40. package/esm/src/api/utils/isValidENSAddress.js +0 -21
  41. package/esm/src/api/utils/postQueryFormatter.js +0 -24
  42. package/esm/src/api/utils/removeNodesAndEdges.js +0 -51
  43. package/esm/src/lib/validation/ValidateInput.js +0 -35
  44. package/esm/src/lib/validation/codegenDerivedValidators.js +0 -28
  45. package/esm/src/lib/validation/validators.js +0 -105
  46. package/esm/{src/client → client}/index.js +0 -0
  47. package/esm/{src/core → core}/addOns/nftTokenV2/actions.js +0 -0
  48. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_fetchNFTCollectionDetails.js +0 -0
  49. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_fetchNFTs.js +0 -0
  50. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_fetchNFTsByCollection.js +0 -0
  51. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTokenMetadataByContractAddress.js +0 -0
  52. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTokenMetadataBySymbol.js +0 -0
  53. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTransactionsByAddress.js +0 -0
  54. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTransfersByNFT.js +0 -0
  55. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getWalletTokenBalance.js +0 -0
  56. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getWalletTokenTransactions.js +0 -0
  57. package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_verifyNFTsOwner.js +0 -0
  58. package/esm/{src/core → core}/addOns/shared/helpers.js +0 -0
  59. package/esm/{src/core → core}/chains.js +0 -0
  60. package/esm/{src/core → core}/core.js +0 -0
  61. package/esm/{src/core → core}/index.d.ts +4 -4
  62. /package/esm/{src/core → core}/index.js +0 -0
  63. /package/esm/{src/lib → lib}/errors/QNChainNotSupported.js +0 -0
  64. /package/esm/{src/lib → lib}/errors/QNInputValidationError.js +0 -0
  65. /package/esm/{src/lib → lib}/errors/QNInvalidEnpointUrl.js +0 -0
  66. /package/esm/{src/lib → lib}/helpers/globalFetch.js +0 -0
package/cjs/index.js CHANGED
@@ -2,15 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var fetch = require('cross-fetch');
6
- var core = require('@urql/core');
7
- var exchangeGraphcache = require('@urql/exchange-graphcache');
8
- var tslib = require('tslib');
9
- var zod = require('zod');
10
- var graphql = require('graphql');
11
- var klona = require('klona');
12
5
  var viem = require('viem');
6
+ var zod = require('zod');
13
7
  var chains = require('viem/chains');
8
+ var fetch = require('cross-fetch');
14
9
 
15
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
11
 
@@ -32,328 +27,8 @@ function _interopNamespace(e) {
32
27
  return Object.freeze(n);
33
28
  }
34
29
 
35
- var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
36
30
  var viem__namespace = /*#__PURE__*/_interopNamespace(viem);
37
-
38
- function isConnection(object) {
39
- return (typeof object === 'object' &&
40
- !!object &&
41
- ('edges' in object ||
42
- 'total' in object ||
43
- 'pageInfo' in object ||
44
- 'breadcrumbs' in object));
45
- }
46
- function removeNodesAndEdges(data) {
47
- const keys = Object.keys(data);
48
- const output = {};
49
- keys.forEach((key) => {
50
- const value = data[key];
51
- if (typeof value === 'string' ||
52
- typeof value === 'boolean' ||
53
- typeof value === 'number' ||
54
- value === null ||
55
- value === undefined) {
56
- return (output[key] = value);
57
- }
58
- if (Array.isArray(value)) {
59
- // An array can just be an array of strings and not edges and nodes
60
- if (value.every((val) => typeof val === 'string')) {
61
- return (output[key] = value);
62
- }
63
- return (output[key] = value.map((item) => removeNodesAndEdges(item)));
64
- }
65
- if (isConnection(value)) {
66
- if (value.breadcrumbs)
67
- output[`${key}Breadcrumbs`] = value.breadcrumbs;
68
- if (value.total)
69
- output[`${key}Total`] = value.total;
70
- if (value.viewport)
71
- output[`${key}Viewport`] = value.viewport;
72
- if (value.pageInfo) {
73
- const { ...pageInfoRest } = value.pageInfo;
74
- output[`${key}PageInfo`] = pageInfoRest;
75
- }
76
- return (output[key] = value.edges?.map((item) => {
77
- if (item.node) {
78
- return removeNodesAndEdges(item.node);
79
- }
80
- return item;
81
- }));
82
- }
83
- return (output[key] = removeNodesAndEdges(value));
84
- });
85
- return output;
86
- }
87
-
88
- class CustomUrqlClient {
89
- constructor(urqlClient) {
90
- this.urqlClient = urqlClient;
91
- }
92
- async query(options) {
93
- const { query, variables, ...additionalOptions } = options;
94
- const result = await this.urqlClient.query(query, variables, additionalOptions);
95
- const { error } = result;
96
- if (error) {
97
- console.error(error.stack);
98
- throw error;
99
- }
100
- return {
101
- ...result,
102
- data: result?.data &&
103
- removeNodesAndEdges(result.data),
104
- };
105
- }
106
- }
107
-
108
- // Below are zod enums used a validators that should be the same as the string unions generated by codegen.
109
- // There are compile-time checks to ensure that they are the same and in sync. If you are getting a
110
- // type error here, you need to update the the validator array to match the codegen type.
111
- const CONTRACT_STANDARDS = ['ERC20', 'ERC721', 'ERC1155'];
112
- const isContractStandard = zod.z.enum(CONTRACT_STANDARDS);
113
- const MARKETPLACES = [
114
- 'BLUR',
115
- 'CRYPTOPUNKS',
116
- 'LOOKSRARE',
117
- 'NIFTY_GATEWAY',
118
- 'OPENSEA',
119
- 'SEAPORT',
120
- 'X2Y2',
121
- 'ZEROX',
122
- ];
123
- const isMarketplace = zod.z.enum(MARKETPLACES);
124
- const TOKEN_TRANSFER_TYPES = [
125
- 'TRANSFER',
126
- 'MINT',
127
- 'SALE',
128
- 'SWAP',
129
- 'BURN',
130
- ];
131
- const isTokenTransferType = zod.z.enum(TOKEN_TRANSFER_TYPES);
132
-
133
- const supportedChains = [
134
- 'ethereum',
135
- 'polygon',
136
- 'ethereumSepolia',
137
- ];
138
-
139
- /**
140
- * https://eips.ethereum.org/EIPS/eip-137#name-syntax
141
- *
142
- * explanation of the regex pattern:
143
- * ^ Matches the start of the string
144
- * (?=.{3,255}$) Lookahead assertion for the length of the string (3 to 255 characters)
145
- * [\p{L}\p{N}\p{Pd}\p{M}\p{S}\u{1F300}-\u{1F6FF}]+ Matches one or more Unicode letter, number, punctuation, symbol, or character in the specified emoji range
146
- * (\.[\p{L}\p{N}\p{Pd}\p{M}\p{S}\u{1F300}-\u{1F6FF}]+)* Matches zero or more occurrences of a dot followed by one or more Unicode characters
147
- * \.(?:eth|xyz|art) Matches a dot followed by either 'eth', 'xyz', or 'art'
148
- * $ Matches the end of the string
149
- *
150
- */
151
- function isValidENSAddress(ensAddress) {
152
- const allowedTLDs = ['eth', 'xyz', 'art'];
153
- const unicodeAndEmojis = '[\\p{L}\\p{N}\\p{Pd}\\p{M}\\p{S}\\u{1F300}-\\u{1F6FF}]';
154
- const regexPattern = `^(?=.{3,255}$)${unicodeAndEmojis}+(\\.${unicodeAndEmojis}+)*\\.(?:${allowedTLDs.join('|')})$`;
155
- const regex = new RegExp(regexPattern, 'mu');
156
- return regex.test(ensAddress);
157
- }
158
-
159
- const isEvmAddress = zod.z
160
- .string()
161
- .length(42) // Using built-in function for better error messages
162
- .startsWith('0x') // Using built-in function for better error messages
163
- .regex(/^0x[a-fA-F0-9]{40}$/, 'Not a valid address');
164
- const isENSAddress = zod.z.string().refine((val) => isValidENSAddress(val));
165
- const isEvmTransactionHash = zod.z
166
- .string()
167
- .length(66) // Using built-in function for better error messages
168
- .startsWith('0x') // Using built-in function for better error messages
169
- .regex(/^0x[a-fA-F0-9]{64}$/, 'Not a valid transaction hash');
170
- const supportedChainInput = zod.z
171
- .object({
172
- chain: zod.z.enum(supportedChains).nullish(),
173
- })
174
- .strict();
175
- function fullFilters(baseType) {
176
- return zod.z
177
- .object({
178
- eq: baseType.nullish(),
179
- gt: baseType.nullish(),
180
- gte: baseType.nullish(),
181
- in: zod.z.array(baseType).nullish(),
182
- lt: baseType.nullish(),
183
- lte: baseType.nullish(),
184
- notIn: zod.z.array(baseType).nullish(),
185
- })
186
- .strict();
187
- }
188
- function limitedFilters(baseType) {
189
- return zod.z
190
- .object({
191
- eq: baseType.nullish(),
192
- in: zod.z.array(baseType).nullish(),
193
- notIn: zod.z.array(baseType).nullish(),
194
- })
195
- .strict();
196
- }
197
- const tokenEventFilters = zod.z
198
- .object({
199
- blockNumber: fullFilters(zod.z.number().positive()).nullish(),
200
- contractAddress: limitedFilters(isEvmAddress).nullish(),
201
- contractStandard: limitedFilters(isContractStandard).nullish(),
202
- fromAddress: limitedFilters(isEvmAddress).nullish(),
203
- marketplace: limitedFilters(isMarketplace).nullish(),
204
- timestamp: fullFilters(zod.z.string().datetime({ offset: true })).nullish(),
205
- toAddress: limitedFilters(isEvmAddress).nullish(),
206
- transactionHash: limitedFilters(isEvmTransactionHash).nullish(),
207
- type: limitedFilters(isTokenTransferType).nullish(),
208
- walletAddress: limitedFilters(isEvmAddress).nullish(),
209
- })
210
- .strict();
211
- const transactionFilters = zod.z
212
- .object({
213
- blockNumber: fullFilters(zod.z.number().positive()).nullish(),
214
- fromAddress: isEvmAddress.nullish(),
215
- timestamp: fullFilters(zod.z.string().datetime({ offset: true })).nullish(),
216
- toAddress: isEvmAddress.nullish(),
217
- })
218
- .strict();
219
- const gasPriceFilters = zod.z
220
- .object({
221
- blockNumber: fullFilters(zod.z.number().positive()).nullish(),
222
- })
223
- .strict();
224
- const paginationParams = zod.z
225
- .object({
226
- before: zod.z.string().nullish(),
227
- after: zod.z.string().nullish(),
228
- first: zod.z.number().positive().nullish(),
229
- })
230
- .strict();
231
- const baseEventsInput = zod.z
232
- .object({
233
- filter: tokenEventFilters.nullish(),
234
- })
235
- .merge(paginationParams)
236
- .strict();
237
- const baseTransactionsInput = zod.z
238
- .object({
239
- filter: transactionFilters.optional(),
240
- })
241
- .merge(paginationParams)
242
- .strict();
243
- const contractTokensFilter = zod.z
244
- .array(zod.z
245
- .object({
246
- contractAddress: isEvmAddress,
247
- tokenId: zod.z.string().optional(),
248
- })
249
- .strict())
250
- .nonempty();
251
- const rpcPaginationParams = zod.z
252
- .object({
253
- perPage: zod.z.number().positive().nullish(),
254
- page: zod.z.number().positive().nullish(),
255
- })
256
- .strict();
257
-
258
- const walletByAddressValidator = zod.z
259
- .object({
260
- address: zod.z.union([isENSAddress, isEvmAddress]),
261
- filter: zod.z
262
- .object({
263
- contractTokens: contractTokensFilter,
264
- })
265
- .strict()
266
- .optional(),
267
- })
268
- .merge(paginationParams)
269
- .merge(supportedChainInput)
270
- .strict();
271
-
272
- const nftDetailsValidator = zod.z
273
- .object({ contractAddress: isEvmAddress, tokenId: zod.z.string() })
274
- .merge(supportedChainInput)
275
- .strict();
276
-
277
- const nftCollectionDetailsValidator = zod.z
278
- .object({
279
- contractAddress: isEvmAddress,
280
- })
281
- .merge(supportedChainInput)
282
- .strict();
283
-
284
- const nftTrendingCollectionsValidator = paginationParams
285
- .merge(supportedChainInput)
286
- .strict();
287
-
288
- const nftsByContractAddressValidator = zod.z
289
- .object({ contractAddress: isEvmAddress })
290
- .merge(paginationParams)
291
- .merge(supportedChainInput)
292
- .strict();
293
-
294
- const verifyOwnershipValidator = zod.z
295
- .object({
296
- address: zod.z.union([isENSAddress, isEvmAddress]),
297
- nfts: contractTokensFilter,
298
- })
299
- .merge(supportedChainInput)
300
- .strict();
301
-
302
- const CodegenEthMainnetContractDetailsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetContractDetails" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "ContractDetails" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "ContractInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Contract" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "abi" } }, { "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isVerified" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportedErcInterfaces" } }, { "kind": "Field", "name": { "kind": "Name", "value": "symbol" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenContract" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "decimals" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "ContractDetails" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contract" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "ContractInfo" } }] } }] } }] };
303
- const CodegenEthereumMainnetEventsGetAllDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthereumMainnetEventsGetAll" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEventsFilterInput" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "EventsGetAll" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TokenEventInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transferIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenBurnEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenTransferEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenMintEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenSaleEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "marketplace" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenContractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sentTokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "EventsGetAll" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenEvents" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TokenEventInfo" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] };
304
- const CodegenEthereumMainnetEventsByContractDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthereumMainnetEventsByContract" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEventsFilterInput" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "EventsByContract" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TokenEventInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transferIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenBurnEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenTransferEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenMintEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenSaleEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "marketplace" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenContractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sentTokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "EventsByContract" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contract" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenEvents" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TokenEventInfo" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] } }] };
305
- const CodegenEthMainnetEventsByCollectionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetEventsByCollection" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEventsFilterInput" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "CollectionEventsFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TokenEventInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transferIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenBurnEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenTransferEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenMintEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenSaleEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "marketplace" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenContractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sentTokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "CollectionEventsFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "collection" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenEvents" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }, { "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": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TokenEventInfo" } }] } }] } }] } }] } }] } }] };
306
- const CodegenEthereumMainnetEventsByNftDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthereumMainnetEventsByNft" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "tokenId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEventsFilterInput" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "NftEventsFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TokenEventInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionHash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transferIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenBurnEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenTransferEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenMintEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tokenQuantity" } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "TokenSaleEvent" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "marketplace" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenContractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "receivedTokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sentTokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "NftEventsFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nft" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "tokenId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "tokenId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenEvents" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }, { "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": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TokenEventInfo" } }] } }] } }] } }] } }] } }] };
307
- const CodegenEthMainnetWalletNFTsByContractAddressDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetWalletNFTsByContractAddress" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "NftsByContractAddressFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "ERC1155NFTNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ERC1155NFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "animationUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "collectionSlug" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "metadata" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "wallets" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }] } }] } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "ERC721NFTNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ERC721NFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "animationUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "attributes" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "collectionSlug" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "metadata" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "wallet" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "NftsByContractAddressFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "collection" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ERC1155Collection" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nfts" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "ERC1155NFTNode" } }] } }] } }] } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ERC721Collection" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nfts" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "ERC721NFTNode" } }] } }] } }] } }] } }] } }] } }] };
308
- const CodegenEthMainnetWalletNFTsByAddressDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetWalletNFTsByAddress" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "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": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFTsFilterInput" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "WalletByAddressFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "WalletNFTNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nft" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "animationUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "collectionSlug" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "metadata" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "WalletByAddressFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByAddress" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "walletNFTs" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "WalletNFTNode" } }] } }] } }] } }] } }] } }] };
309
- const CodegenEthMainnetWalletNFTsByEnsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetWalletNFTsByEns" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "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": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFTsFilterInput" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "WalletByEnsFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "WalletNFTNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nft" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "animationUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "collectionSlug" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "metadata" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "WalletByEnsFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByENS" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "ensName" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "walletNFTs" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "WalletNFTNode" } }] } }] } }] } }] } }] } }] };
310
- const CodegenEthMainnetNFTDetailsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetNFTDetails" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "tokenId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "NftDetails" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "NftDetails" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nft" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "tokenId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "tokenId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "Field", "name": { "kind": "Name", "value": "animationUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "collectionSlug" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "metadata" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ERC1155NFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "wallets" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }] } }] } }] } }] } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "ERC721NFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "wallet" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }] } }] } }] } }] } }] };
311
- const CodegenEthMainnetNftCollectionDetailsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetNftCollectionDetails" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "NftCollectionInfo" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "NftCollectionInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "collection" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "contractAddress" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "contractAddress" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "bannerImage" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "height" } }, { "kind": "Field", "name": { "kind": "Name", "value": "mimeType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "url" } }, { "kind": "Field", "name": { "kind": "Name", "value": "width" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "baseTokenUri" } }, { "kind": "Field", "name": { "kind": "Name", "value": "circulatingSupply" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contract" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isVerified" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "symbol" } }, { "kind": "Field", "name": { "kind": "Name", "value": "supportedErcInterfaces" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "image" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "height" } }, { "kind": "Field", "name": { "kind": "Name", "value": "mimeType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "url" } }, { "kind": "Field", "name": { "kind": "Name", "value": "width" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ohlcvChart" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "ObjectValue", "fields": [{ "kind": "ObjectField", "name": { "kind": "Name", "value": "limit" }, "value": { "kind": "IntValue", "value": "1" } }] } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "average" } }, { "kind": "Field", "name": { "kind": "Name", "value": "close" } }, { "kind": "Field", "name": { "kind": "Name", "value": "count" } }, { "kind": "Field", "name": { "kind": "Name", "value": "high" } }, { "kind": "Field", "name": { "kind": "Name", "value": "low" } }, { "kind": "Field", "name": { "kind": "Name", "value": "open" } }, { "kind": "Field", "name": { "kind": "Name", "value": "volume" } }, { "kind": "Field", "name": { "kind": "Name", "value": "timestamp" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "openseaMetadata" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "isHidden" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isVerified" } }, { "kind": "Field", "name": { "kind": "Name", "value": "unsafeSlug" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "slug" } }, { "kind": "Field", "name": { "kind": "Name", "value": "symbol" } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalSupply" } }, { "kind": "Field", "name": { "kind": "Name", "value": "twitterUsername" } }] } }] } }] };
312
- const CodegenEthMainnetTrendingCollectionsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetTrendingCollections" }, "variableDefinitions": [{ "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": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "NftTrendingCollections" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TrendingCollectionInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Collection" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "baseTokenUri" } }, { "kind": "Field", "name": { "kind": "Name", "value": "circulatingSupply" } }, { "kind": "Field", "name": { "kind": "Name", "value": "description" } }, { "kind": "Field", "name": { "kind": "Name", "value": "externalUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "image" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "height" } }, { "kind": "Field", "name": { "kind": "Name", "value": "mimeType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "url" } }, { "kind": "Field", "name": { "kind": "Name", "value": "width" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "openseaMetadata" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "isHidden" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isVerified" } }, { "kind": "Field", "name": { "kind": "Name", "value": "unsafeSlug" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "symbol" } }, { "kind": "Field", "name": { "kind": "Name", "value": "totalSupply" } }, { "kind": "Field", "name": { "kind": "Name", "value": "twitterUsername" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "NftTrendingCollections" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "trendingCollections" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "collection" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TrendingCollectionInfo" } }] } }] } }] } }] } }] } }] };
313
- const CodegenEthMainnetVerifyOwnershipByAddressDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetVerifyOwnershipByAddress" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFTsFilterInput" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "VerifyOwnershipInfo" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "VerifyOwnershipNFTDetails" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nft" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "VerifyOwnershipInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByAddress" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletNFTs" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "VerifyOwnershipNFTDetails" } }] } }] } }] } }] } }] } }] };
314
- const CodegenEthMainnetVerifyOwnershipByENSDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetVerifyOwnershipByENS" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFTsFilterInput" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "VerifyOwnershipInfoByENS" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "VerifyOwnershipNFTDetails" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletNFT" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "nft" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenId" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "VerifyOwnershipInfoByENS" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByENS" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "ensName" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletNFTs" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "VerifyOwnershipNFTDetails" } }] } }] } }] } }] } }] } }] };
315
- const CodegenEthMainnetBalancesByWalletAddressDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetBalancesByWalletAddress" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "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": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "GetBalancesByWalletAddressFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TokenBalanceNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletTokenBalance" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "totalBalance" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contract" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "decimals" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "symbol" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "GetBalancesByWalletAddressFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByAddress" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenBalances" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TokenBalanceNode" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] } }] };
316
- const CodegenEthMainnetBalancesByWalletENSDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetBalancesByWalletENS" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "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": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "GetBalancesByWalletENSFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TokenBalanceNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "WalletTokenBalance" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "totalBalance" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contract" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "decimals" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "symbol" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "GetBalancesByWalletENSFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByENS" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "ensName" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenBalances" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TokenBalanceNode" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] } }] };
317
- const CodegenEthMainnetTransactionsByHashDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetTransactionsByHash" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "hash" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsByHash" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Transaction" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cumulativeGasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "effectiveGasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxPriorityFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "Field", "name": { "kind": "Name", "value": "input" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsByHash" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "transaction" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "hash" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "hash" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsNode" } }] } }] } }] };
318
- const CodegenEthMainnetTransactionsBySearchDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetTransactionsBySearch" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "TransactionsFilterInput" } } }, { "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": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsBySearch" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Transaction" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cumulativeGasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "effectiveGasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxPriorityFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "Field", "name": { "kind": "Name", "value": "input" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsBySearch" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "transactions" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }, { "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": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsNode" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] };
319
- const CodegenEthMainnetTransactionsByWalletAddressDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetTransactionsByWalletAddress" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "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": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsByWalletAddress" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Transaction" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cumulativeGasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "effectiveGasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxPriorityFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "Field", "name": { "kind": "Name", "value": "input" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsByWalletAddress" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByAddress" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "address" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "address" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactions" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsNode" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] } }] };
320
- const CodegenEthMainnetTransactionsByWalletENSDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetTransactionsByWalletENS" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "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": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsByWalletENS" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsNode" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Transaction" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "blockTimestamp" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fromAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cumulativeGasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "effectiveGasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasPrice" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gasUsed" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hash" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxPriorityFeePerGas" } }, { "kind": "Field", "name": { "kind": "Name", "value": "toAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "type" } }, { "kind": "Field", "name": { "kind": "Name", "value": "input" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactionIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "Pagination" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "PageInfo" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "endCursor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasNextPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hasPreviousPage" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startCursor" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "TransactionsByWalletENS" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "walletByENS" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "ensName" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "ensName" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "address" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ensName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "transactions" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "first" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "first" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "after" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "after" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "edges" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "node" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "TransactionsNode" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "pageInfo" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "Pagination" } }] } }] } }] } }] } }] };
321
- const CodegenEthMainnetGasPricesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "EthMainnetGasPrices" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "GasPriceFilterInput" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "ethereum" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "GasPrice" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "GasPriceInfo" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "GasPrice" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "blockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "total" } }, { "kind": "Field", "name": { "kind": "Name", "value": "average" } }, { "kind": "Field", "name": { "kind": "Name", "value": "ceiling" } }, { "kind": "Field", "name": { "kind": "Name", "value": "floor" } }, { "kind": "Field", "name": { "kind": "Name", "value": "median" } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "GasPrice" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "EVMSchemaType" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "gasPrices" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "filter" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "filter" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "GasPriceInfo" } }] } }] } }] };
322
-
323
- // Formats the query result with the edges and nodes removed into what we want to return to the user
324
- function formatQueryResult(queryResult, resultsKey, // Key that the actual results are in
325
- paginationKey, // Key that the pagination info is in
326
- resultsKeyToRemove, // Key that the results are nested under to remove for each entry
327
- additionalModification) {
328
- const additionaProperties = Object.fromEntries(Object.entries(queryResult).filter(([key]) => key !== resultsKey && key !== paginationKey));
329
- let trimmedResults = queryResult[resultsKey];
330
- if (resultsKeyToRemove) {
331
- trimmedResults = trimmedResults.map((result) => result[resultsKeyToRemove] || {});
332
- }
333
- const formattedResultBase = {
334
- results: trimmedResults,
335
- pageInfo: queryResult[paginationKey],
336
- };
337
- let result = {
338
- ...formattedResultBase,
339
- ...additionaProperties,
340
- };
341
- if (additionalModification)
342
- result = additionalModification(result);
343
- return result;
344
- }
345
-
346
- const emptyPageInfo = {
347
- endCursor: null,
348
- hasNextPage: false,
349
- hasPreviousPage: false,
350
- startCursor: null,
351
- };
352
- function weiToGwei(wei) {
353
- return +(wei / 1e9).toFixed(2);
354
- }
355
-
356
- const DEFAULT_CHAIN = 'ethereum';
31
+ var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
357
32
 
358
33
  class QNInputValidationError extends Error {
359
34
  constructor({ messages, zodError, }) {
@@ -388,765 +63,6 @@ function formatErrors(baseError) {
388
63
  })
389
64
  : null;
390
65
  }
391
- // Decorator for runtime validation to handle input that is unknown at compile time
392
- function ValidateInput(schema) {
393
- return function (target, propertyName, descriptor) {
394
- const method = descriptor.value;
395
- if (!method)
396
- return;
397
- descriptor.value = async function (...args) {
398
- const [input] = args;
399
- const validation = schema.safeParse(input);
400
- if (!validation.success) {
401
- const formattedErrors = formatErrors(validation.error);
402
- if (formattedErrors) {
403
- throw formattedErrors;
404
- }
405
- }
406
- return method.apply(this, args);
407
- };
408
- };
409
- }
410
-
411
- function modifyQueryForChain(chainName, originalDocumentNode) {
412
- // We need to deep clone the document node in order to not mutate the query so it is consistent
413
- // across multiple calls to the same query with different chains
414
- const documentNode = klona.klona(originalDocumentNode);
415
- documentNode.definitions = documentNode.definitions.map((doc) => {
416
- if (doc.kind === graphql.Kind.OPERATION_DEFINITION) {
417
- doc.selectionSet.selections = doc.selectionSet.selections.map((selection) => {
418
- if (selection.kind === graphql.Kind.FIELD &&
419
- selection.name.kind == graphql.Kind.NAME &&
420
- selection.name.value === 'ethereum') {
421
- const updatedChainSelection = {
422
- ...selection,
423
- name: { ...selection.name, value: chainName },
424
- };
425
- return updatedChainSelection;
426
- }
427
- return selection;
428
- });
429
- }
430
- return doc;
431
- });
432
- return documentNode;
433
- }
434
-
435
- class NftsController {
436
- constructor(client, defaultChain = DEFAULT_CHAIN) {
437
- this.client = client;
438
- this.defaultChain = defaultChain;
439
- }
440
- async getByWallet(variables) {
441
- const { address, ...allVariables } = variables;
442
- if (isValidENSAddress(address)) {
443
- return this.getByWalletENS({
444
- ensName: address,
445
- ...allVariables,
446
- });
447
- }
448
- return this.getByWalletAddress({
449
- address,
450
- ...allVariables,
451
- });
452
- }
453
- async getByWalletENS(variables) {
454
- const { chain, ...queryVariables } = variables;
455
- const userChain = chain || this.defaultChain;
456
- const query = modifyQueryForChain(userChain, CodegenEthMainnetWalletNFTsByEnsDocument);
457
- const result = await this.client.query({
458
- query: query,
459
- variables: queryVariables,
460
- });
461
- const walletByENS = result?.data?.[userChain]?.walletByENS;
462
- if (!walletByENS?.walletNFTs?.length) {
463
- // Address can still be valid ENS name, but not have any NFTs
464
- const address = walletByENS?.address || '';
465
- const ensName = walletByENS?.ensName || '';
466
- return {
467
- address: address,
468
- ensName: ensName,
469
- results: [],
470
- pageInfo: emptyPageInfo,
471
- };
472
- }
473
- const formattedResult = formatQueryResult(walletByENS, 'walletNFTs', 'walletNFTsPageInfo', 'nft');
474
- return formattedResult;
475
- }
476
- async getByWalletAddress(variables) {
477
- const { chain, ...queryVariables } = variables;
478
- const userChain = chain || this.defaultChain;
479
- const query = modifyQueryForChain(userChain, CodegenEthMainnetWalletNFTsByAddressDocument);
480
- const result = await this.client.query({
481
- query: query,
482
- variables: queryVariables,
483
- });
484
- const walletByAddress = result?.data?.[userChain]?.walletByAddress;
485
- if (!walletByAddress?.walletNFTs?.length) {
486
- const address = walletByAddress?.address || '';
487
- const ensName = walletByAddress?.ensName || '';
488
- return {
489
- address: address,
490
- ensName: ensName,
491
- results: [],
492
- pageInfo: emptyPageInfo,
493
- };
494
- }
495
- const formattedResult = formatQueryResult(walletByAddress, 'walletNFTs', 'walletNFTsPageInfo', 'nft');
496
- return formattedResult;
497
- }
498
- async getTrendingCollections(variables) {
499
- const { chain, ...queryVariables } = variables;
500
- const userChain = chain || this.defaultChain;
501
- const query = modifyQueryForChain(userChain, CodegenEthMainnetTrendingCollectionsDocument);
502
- const result = await this.client.query({
503
- query: query,
504
- variables: queryVariables,
505
- });
506
- const chainResult = result?.data?.[userChain];
507
- if (chainResult?.trendingCollections?.length) {
508
- const formattedResult = formatQueryResult(chainResult, 'trendingCollections', 'trendingCollectionsPageInfo', 'collection');
509
- return formattedResult;
510
- }
511
- return {
512
- results: [],
513
- pageInfo: emptyPageInfo,
514
- };
515
- }
516
- async getByContractAddress(variables) {
517
- const { chain, ...queryVariables } = variables;
518
- const userChain = chain || this.defaultChain;
519
- const query = modifyQueryForChain(userChain, CodegenEthMainnetWalletNFTsByContractAddressDocument);
520
- const result = await this.client.query({
521
- query: query,
522
- variables: queryVariables,
523
- });
524
- const collection = result?.data?.[userChain]?.collection;
525
- if (!collection?.nfts?.length) {
526
- return {
527
- standard: null,
528
- results: [],
529
- pageInfo: emptyPageInfo,
530
- };
531
- }
532
- const setErcStandard = (results) => {
533
- const standardMap = {
534
- ERC1155Collection: 'ERC1155',
535
- ERC721Collection: 'ERC721',
536
- };
537
- // Remove address too since it was only used as a key field
538
- const { __typename, address, ...newResults } = results;
539
- return {
540
- ...newResults,
541
- standard: standardMap[results['__typename']] || null,
542
- };
543
- };
544
- const formattedResult = formatQueryResult(collection, 'nfts', 'nftsPageInfo', null, setErcStandard);
545
- return formattedResult;
546
- }
547
- async getNFTDetails(variables) {
548
- const { chain, ...queryVariables } = variables;
549
- const userChain = chain || this.defaultChain;
550
- const query = modifyQueryForChain(userChain, CodegenEthMainnetNFTDetailsDocument);
551
- const result = await this.client.query({
552
- query,
553
- variables: queryVariables,
554
- });
555
- const nft = result?.data?.[userChain]?.nft;
556
- if (nft)
557
- return { nft };
558
- return { nft: null };
559
- }
560
- async getCollectionDetails(variables) {
561
- const { chain, ...queryVariables } = variables;
562
- const userChain = chain || this.defaultChain;
563
- const query = modifyQueryForChain(userChain, CodegenEthMainnetNftCollectionDetailsDocument);
564
- const result = await this.client.query({
565
- query: query,
566
- variables: queryVariables,
567
- });
568
- const collection = result?.data?.[userChain]?.collection;
569
- if (collection)
570
- return { collection };
571
- return { collection: null };
572
- }
573
- async verifyOwnership(variables) {
574
- const { address, ...allVariables } = variables;
575
- if (isValidENSAddress(address)) {
576
- return this.verifyOwnershipByENS({
577
- ensName: address,
578
- ...allVariables,
579
- });
580
- }
581
- return this.verifyOwnershipByAddress({
582
- address,
583
- ...allVariables,
584
- });
585
- }
586
- async verifyOwnershipByAddress(variables) {
587
- const { chain, address, nfts } = variables;
588
- const userChain = chain || this.defaultChain;
589
- const query = modifyQueryForChain(userChain, CodegenEthMainnetVerifyOwnershipByAddressDocument);
590
- const result = await this.client.query({
591
- query: query,
592
- variables: { address, filter: { contractTokens: nfts } },
593
- });
594
- const walletNFTs = result?.data?.[userChain]?.walletByAddress?.walletNFTs;
595
- return !!walletNFTs?.length;
596
- }
597
- async verifyOwnershipByENS(variables) {
598
- const { chain, ensName, nfts } = variables;
599
- const userChain = chain || this.defaultChain;
600
- const query = modifyQueryForChain(userChain, CodegenEthMainnetVerifyOwnershipByENSDocument);
601
- const result = await this.client.query({
602
- query: query,
603
- variables: { ensName, filter: { contractTokens: nfts } },
604
- });
605
- const walletByENS = result?.data?.[userChain]?.walletByENS?.walletNFTs;
606
- return !!walletByENS?.length;
607
- }
608
- }
609
- tslib.__decorate([
610
- ValidateInput(walletByAddressValidator),
611
- tslib.__metadata("design:type", Function),
612
- tslib.__metadata("design:paramtypes", [Object]),
613
- tslib.__metadata("design:returntype", Promise)
614
- ], NftsController.prototype, "getByWallet", null);
615
- tslib.__decorate([
616
- ValidateInput(nftTrendingCollectionsValidator),
617
- tslib.__metadata("design:type", Function),
618
- tslib.__metadata("design:paramtypes", [Object]),
619
- tslib.__metadata("design:returntype", Promise)
620
- ], NftsController.prototype, "getTrendingCollections", null);
621
- tslib.__decorate([
622
- ValidateInput(nftsByContractAddressValidator),
623
- tslib.__metadata("design:type", Function),
624
- tslib.__metadata("design:paramtypes", [Object]),
625
- tslib.__metadata("design:returntype", Promise)
626
- ], NftsController.prototype, "getByContractAddress", null);
627
- tslib.__decorate([
628
- ValidateInput(nftDetailsValidator),
629
- tslib.__metadata("design:type", Function),
630
- tslib.__metadata("design:paramtypes", [Object]),
631
- tslib.__metadata("design:returntype", Promise)
632
- ], NftsController.prototype, "getNFTDetails", null);
633
- tslib.__decorate([
634
- ValidateInput(nftCollectionDetailsValidator),
635
- tslib.__metadata("design:type", Function),
636
- tslib.__metadata("design:paramtypes", [Object]),
637
- tslib.__metadata("design:returntype", Promise)
638
- ], NftsController.prototype, "getCollectionDetails", null);
639
- tslib.__decorate([
640
- ValidateInput(verifyOwnershipValidator),
641
- tslib.__metadata("design:type", Function),
642
- tslib.__metadata("design:paramtypes", [Object]),
643
- tslib.__metadata("design:returntype", Promise)
644
- ], NftsController.prototype, "verifyOwnership", null);
645
-
646
- const balancesByWalletAddressValidator = zod.z
647
- .object({
648
- address: zod.z.union([isENSAddress, isEvmAddress]),
649
- })
650
- .merge(paginationParams)
651
- .merge(supportedChainInput)
652
- .strict();
653
-
654
- class TokensController {
655
- constructor(client, defaultChain = DEFAULT_CHAIN) {
656
- this.client = client;
657
- this.defaultChain = defaultChain;
658
- }
659
- async getBalancesByWallet(variables) {
660
- const { address, ...allVariables } = variables;
661
- if (isValidENSAddress(address)) {
662
- return this.getBalancesByWalletENS({
663
- ensName: address,
664
- ...allVariables,
665
- });
666
- }
667
- return this.getBalancesByWalletAddress({
668
- address,
669
- ...allVariables,
670
- });
671
- }
672
- async getBalancesByWalletENS(variables) {
673
- const { chain, ...queryVariables } = variables;
674
- const userChain = chain || this.defaultChain;
675
- const query = modifyQueryForChain(userChain, CodegenEthMainnetBalancesByWalletENSDocument);
676
- const result = await this.client.query({
677
- variables: queryVariables,
678
- query: query,
679
- });
680
- const walletByENS = result?.data?.[userChain]?.walletByENS;
681
- if (!walletByENS?.tokenBalances?.length) {
682
- // Address can still be valid ENS name, but not have any balances
683
- const address = walletByENS?.address || '';
684
- const ensName = walletByENS?.ensName || '';
685
- return {
686
- address: address,
687
- ensName: ensName,
688
- results: [],
689
- pageInfo: emptyPageInfo,
690
- };
691
- }
692
- const formattedResult = formatQueryResult(walletByENS, 'tokenBalances', 'tokenBalancesPageInfo', null, this.flattenBalanceResponses // Remove the "contract" key and move info to balance result body
693
- );
694
- return formattedResult;
695
- }
696
- async getBalancesByWalletAddress(variables) {
697
- const { chain, ...queryVariables } = variables;
698
- const userChain = chain || this.defaultChain;
699
- const query = modifyQueryForChain(userChain, CodegenEthMainnetBalancesByWalletAddressDocument);
700
- const result = await this.client.query({
701
- variables: queryVariables,
702
- query: query,
703
- });
704
- const walletByAddress = result?.data?.[userChain]?.walletByAddress;
705
- if (!walletByAddress?.tokenBalances?.length) {
706
- // Address can still be valid address, but not have any balances
707
- const address = walletByAddress?.address || '';
708
- const ensName = walletByAddress?.ensName || '';
709
- return {
710
- address: address,
711
- ensName: ensName,
712
- results: [],
713
- pageInfo: emptyPageInfo,
714
- };
715
- }
716
- const formattedResult = formatQueryResult(walletByAddress, 'tokenBalances', 'tokenBalancesPageInfo', null, this.flattenBalanceResponses // Remove the "contract" key and move info to balance result body
717
- );
718
- return formattedResult;
719
- }
720
- flattenBalanceResponses(response) {
721
- const modifiedResults = response.results.map((result) => {
722
- const { contract: { ...contractInfo }, ...balanceInfo } = result;
723
- return { ...balanceInfo, ...contractInfo };
724
- });
725
- response.results = modifiedResults;
726
- return response;
727
- }
728
- }
729
- tslib.__decorate([
730
- ValidateInput(balancesByWalletAddressValidator),
731
- tslib.__metadata("design:type", Function),
732
- tslib.__metadata("design:paramtypes", [Object]),
733
- tslib.__metadata("design:returntype", Promise)
734
- ], TokensController.prototype, "getBalancesByWallet", null);
735
-
736
- const gasPricesValidator = zod.z
737
- .object({
738
- returnInGwei: zod.z.boolean().nullish(),
739
- filter: gasPriceFilters.nullish(),
740
- })
741
- .merge(supportedChainInput)
742
- .strict();
743
-
744
- class UtilsController {
745
- constructor(client, defaultChain = DEFAULT_CHAIN) {
746
- this.client = client;
747
- this.defaultChain = defaultChain;
748
- }
749
- async getGasPrices(variables) {
750
- const { chain, ...queryVariables } = variables;
751
- const returnInGwei = variables.returnInGwei || false;
752
- const userChain = chain || this.defaultChain;
753
- const query = modifyQueryForChain(userChain, CodegenEthMainnetGasPricesDocument);
754
- const result = await this.client.query({
755
- query: query,
756
- variables: queryVariables,
757
- });
758
- const gasPrices = result?.data?.[userChain]?.gasPrices;
759
- if (Array.isArray(gasPrices) && gasPrices.length > 0) {
760
- if (returnInGwei) {
761
- const fieldsToTransform = [
762
- 'total',
763
- 'average',
764
- 'ceiling',
765
- 'floor',
766
- 'median',
767
- ];
768
- const modifiedGasPrices = gasPrices.map((gasPrice) => {
769
- fieldsToTransform.map((field) => {
770
- gasPrice[field] = weiToGwei(gasPrice[field]);
771
- });
772
- return gasPrice;
773
- });
774
- return { gasPrices: modifiedGasPrices };
775
- }
776
- return { gasPrices };
777
- }
778
- return { gasPrices: [] };
779
- }
780
- }
781
- tslib.__decorate([
782
- ValidateInput(gasPricesValidator),
783
- tslib.__metadata("design:type", Function),
784
- tslib.__metadata("design:paramtypes", [Object]),
785
- tslib.__metadata("design:returntype", Promise)
786
- ], UtilsController.prototype, "getGasPrices", null);
787
-
788
- // Using zod for runtime validation
789
- const contractDetailsValidator = zod.z
790
- .object({
791
- contractAddress: isEvmAddress,
792
- })
793
- .merge(supportedChainInput)
794
- .strict();
795
-
796
- class ContractsController {
797
- constructor(client, defaultChain = DEFAULT_CHAIN) {
798
- this.client = client;
799
- this.defaultChain = defaultChain;
800
- }
801
- async getDetails(variables) {
802
- const { chain, ...queryVariables } = variables;
803
- const userChain = chain || this.defaultChain;
804
- const query = modifyQueryForChain(userChain, CodegenEthMainnetContractDetailsDocument);
805
- const result = await this.client.query({
806
- variables: queryVariables,
807
- query: query,
808
- });
809
- const contract = result?.data?.[userChain]?.contract;
810
- if (contract)
811
- return { contract };
812
- return { contract: null };
813
- }
814
- }
815
- tslib.__decorate([
816
- ValidateInput(contractDetailsValidator),
817
- tslib.__metadata("design:type", Function),
818
- tslib.__metadata("design:paramtypes", [Object]),
819
- tslib.__metadata("design:returntype", Promise)
820
- ], ContractsController.prototype, "getDetails", null);
821
-
822
- const contractEventsValidator = zod.z
823
- .object({
824
- contractAddress: isEvmAddress,
825
- })
826
- .merge(baseEventsInput)
827
- .merge(supportedChainInput)
828
- .strict();
829
-
830
- const collectionEventsValidator = zod.z
831
- .object({
832
- contractAddress: isEvmAddress,
833
- })
834
- .merge(baseEventsInput)
835
- .merge(supportedChainInput)
836
- .strict();
837
-
838
- const nftEventsValidator = zod.z
839
- .object({
840
- contractAddress: isEvmAddress,
841
- tokenId: zod.z.string(),
842
- })
843
- .merge(baseEventsInput)
844
- .merge(supportedChainInput)
845
- .strict();
846
-
847
- const allEventsValidator = baseEventsInput
848
- .merge(supportedChainInput)
849
- .strict();
850
-
851
- class EventsController {
852
- constructor(client, defaultChain = DEFAULT_CHAIN) {
853
- this.client = client;
854
- this.defaultChain = defaultChain;
855
- }
856
- async getByContract(variables) {
857
- const { chain, ...queryVariables } = variables;
858
- const userChain = chain || this.defaultChain;
859
- const query = modifyQueryForChain(userChain, CodegenEthereumMainnetEventsByContractDocument);
860
- const result = await this.client.query({
861
- query: query,
862
- variables: queryVariables,
863
- });
864
- const contract = result?.data?.[userChain]?.contract;
865
- if (!contract?.tokenEvents?.length) {
866
- return {
867
- results: [],
868
- pageInfo: emptyPageInfo,
869
- };
870
- }
871
- const formattedResult = formatQueryResult(contract, 'tokenEvents', 'tokenEventsPageInfo');
872
- return formattedResult;
873
- }
874
- async getByNFTCollection(variables) {
875
- const { chain, ...queryVariables } = variables;
876
- const userChain = chain || this.defaultChain;
877
- const query = modifyQueryForChain(userChain, CodegenEthMainnetEventsByCollectionDocument);
878
- const result = await this.client.query({
879
- query: query,
880
- variables: queryVariables,
881
- });
882
- const collection = result?.data?.[userChain]?.collection;
883
- if (!collection?.tokenEvents?.length)
884
- return { results: [], pageInfo: emptyPageInfo };
885
- function removeKeyFields(results) {
886
- const { address, ...newResults } = results;
887
- return newResults;
888
- }
889
- const formattedResult = formatQueryResult(collection, 'tokenEvents', 'tokenEventsPageInfo', null, removeKeyFields);
890
- return formattedResult;
891
- }
892
- async getByNFT(variables) {
893
- const { chain, ...queryVariables } = variables;
894
- const userChain = chain || this.defaultChain;
895
- const query = modifyQueryForChain(userChain, CodegenEthereumMainnetEventsByNftDocument);
896
- const result = await this.client.query({
897
- query: query,
898
- variables: queryVariables,
899
- });
900
- const nft = result?.data?.[userChain]?.nft;
901
- if (!nft?.tokenEvents?.length)
902
- return { results: [], pageInfo: emptyPageInfo };
903
- function removeKeyFields(results) {
904
- const { contractAddress, tokenId, ...newResults } = results;
905
- return newResults;
906
- }
907
- const formattedResult = formatQueryResult(nft, 'tokenEvents', 'tokenEventsPageInfo', null, removeKeyFields);
908
- return formattedResult;
909
- }
910
- async getAll(variables) {
911
- const { chain, ...queryVariables } = variables;
912
- const userChain = chain || this.defaultChain;
913
- const query = modifyQueryForChain(userChain, CodegenEthereumMainnetEventsGetAllDocument);
914
- const result = await this.client.query({
915
- query: query,
916
- variables: queryVariables,
917
- });
918
- const events = result?.data?.[userChain];
919
- if (events?.tokenEvents?.length) {
920
- const formattedResult = formatQueryResult(events, 'tokenEvents', 'tokenEventsPageInfo');
921
- return formattedResult;
922
- }
923
- return { results: [], pageInfo: emptyPageInfo };
924
- }
925
- }
926
- tslib.__decorate([
927
- ValidateInput(contractEventsValidator),
928
- tslib.__metadata("design:type", Function),
929
- tslib.__metadata("design:paramtypes", [Object]),
930
- tslib.__metadata("design:returntype", Promise)
931
- ], EventsController.prototype, "getByContract", null);
932
- tslib.__decorate([
933
- ValidateInput(collectionEventsValidator),
934
- tslib.__metadata("design:type", Function),
935
- tslib.__metadata("design:paramtypes", [Object]),
936
- tslib.__metadata("design:returntype", Promise)
937
- ], EventsController.prototype, "getByNFTCollection", null);
938
- tslib.__decorate([
939
- ValidateInput(nftEventsValidator),
940
- tslib.__metadata("design:type", Function),
941
- tslib.__metadata("design:paramtypes", [Object]),
942
- tslib.__metadata("design:returntype", Promise)
943
- ], EventsController.prototype, "getByNFT", null);
944
- tslib.__decorate([
945
- ValidateInput(allEventsValidator),
946
- tslib.__metadata("design:type", Function),
947
- tslib.__metadata("design:paramtypes", [Object]),
948
- tslib.__metadata("design:returntype", Promise)
949
- ], EventsController.prototype, "getAll", null);
950
-
951
- const transactionsBySearchValidator = baseTransactionsInput
952
- .merge(supportedChainInput)
953
- .strict();
954
-
955
- const transactionsByHashValidator = zod.z
956
- .object({
957
- hash: isEvmTransactionHash,
958
- })
959
- .merge(supportedChainInput)
960
- .strict();
961
-
962
- class TransactionsController {
963
- constructor(client, defaultChain = DEFAULT_CHAIN) {
964
- this.client = client;
965
- this.defaultChain = defaultChain;
966
- }
967
- async getByWallet(variables) {
968
- const { address, ...allVariables } = variables;
969
- let queryResult;
970
- if (isValidENSAddress(address)) {
971
- queryResult = await this.getByWalletENS({
972
- ensName: address,
973
- ...allVariables,
974
- });
975
- }
976
- else {
977
- queryResult = await this.getByWalletAddress({
978
- address,
979
- ...allVariables,
980
- });
981
- }
982
- if (!queryResult?.transactions?.length) {
983
- // Address can still be valid address, but not have any transactions
984
- const address = queryResult?.address || '';
985
- const ensName = queryResult?.ensName || '';
986
- return {
987
- address: address,
988
- ensName: ensName,
989
- results: [],
990
- pageInfo: emptyPageInfo,
991
- };
992
- }
993
- const formattedResult = formatQueryResult(queryResult, 'transactions', 'transactionsPageInfo');
994
- return formattedResult;
995
- }
996
- async getByWalletAddress(variables) {
997
- const { chain, ...queryVariables } = variables;
998
- const userChain = chain || this.defaultChain;
999
- const query = modifyQueryForChain(userChain, CodegenEthMainnetTransactionsByWalletAddressDocument);
1000
- const result = await this.client.query({
1001
- variables: queryVariables,
1002
- query: query,
1003
- });
1004
- const walletByAddress = result?.data?.[userChain]?.walletByAddress;
1005
- return walletByAddress;
1006
- }
1007
- async getByWalletENS(variables) {
1008
- const { chain, ...queryVariables } = variables;
1009
- const userChain = chain || this.defaultChain;
1010
- const query = modifyQueryForChain(userChain, CodegenEthMainnetTransactionsByWalletENSDocument);
1011
- const result = await this.client.query({
1012
- variables: queryVariables,
1013
- query: query,
1014
- });
1015
- const walletByENS = result?.data?.[userChain]?.walletByENS;
1016
- return walletByENS;
1017
- }
1018
- async getAll(variables) {
1019
- const { chain, ...queryVariables } = variables;
1020
- const userChain = chain || this.defaultChain;
1021
- const query = modifyQueryForChain(userChain, CodegenEthMainnetTransactionsBySearchDocument);
1022
- const result = await this.client.query({
1023
- variables: queryVariables,
1024
- query: query,
1025
- });
1026
- const transactions = result?.data?.[userChain];
1027
- if (transactions && transactions?.transactions?.length > 0) {
1028
- const formattedResult = formatQueryResult(transactions, 'transactions', 'transactionsPageInfo');
1029
- return formattedResult;
1030
- }
1031
- return {
1032
- results: [],
1033
- pageInfo: emptyPageInfo,
1034
- };
1035
- }
1036
- async getByHash(variables) {
1037
- const { chain, ...queryVariables } = variables;
1038
- const userChain = chain || this.defaultChain;
1039
- const query = modifyQueryForChain(userChain, CodegenEthMainnetTransactionsByHashDocument);
1040
- const result = await this.client.query({
1041
- variables: queryVariables,
1042
- query: query,
1043
- });
1044
- const transaction = result?.data?.[userChain];
1045
- if (transaction?.transaction)
1046
- return transaction;
1047
- return { transaction: null };
1048
- }
1049
- }
1050
- tslib.__decorate([
1051
- ValidateInput(balancesByWalletAddressValidator),
1052
- tslib.__metadata("design:type", Function),
1053
- tslib.__metadata("design:paramtypes", [Object]),
1054
- tslib.__metadata("design:returntype", Promise)
1055
- ], TransactionsController.prototype, "getByWallet", null);
1056
- tslib.__decorate([
1057
- ValidateInput(transactionsBySearchValidator),
1058
- tslib.__metadata("design:type", Function),
1059
- tslib.__metadata("design:paramtypes", [Object]),
1060
- tslib.__metadata("design:returntype", Promise)
1061
- ], TransactionsController.prototype, "getAll", null);
1062
- tslib.__decorate([
1063
- ValidateInput(transactionsByHashValidator),
1064
- tslib.__metadata("design:type", Function),
1065
- tslib.__metadata("design:paramtypes", [Object]),
1066
- tslib.__metadata("design:returntype", Promise)
1067
- ], TransactionsController.prototype, "getByHash", null);
1068
-
1069
- var name="@quicknode/sdk";var repository={type:"git",url:"https://github.com/quiknode-labs/qn-oss.git",directory:"packages/libs/sdk"};var license="MIT";var version="1.1.5";var main="./cjs/index.js";var module$1="./esm/src/index.js";var types="./index.d.ts";var sideEffects=false;var dependencies={"@urql/core":"^4.2.0","@urql/exchange-graphcache":"^6.4.0","cross-fetch":"^3.1.6",graphql:"^16.6.0",klona:"^2.0.6",tslib:"^2.5.3",viem:"^1.2.0",zod:"^3.21.4"};var devDependencies={"@graphql-codegen/cli":"4.0.1","@graphql-codegen/fragment-matcher":"^3.3.1","@graphql-codegen/typed-document-node":"^4.0.1","@graphql-codegen/typescript":"2.8.0","@graphql-codegen/typescript-operations":"^2.5.5","@pollyjs/adapter-node-http":"^6.0.5","@pollyjs/core":"^6.0.5","@pollyjs/persister-fs":"^6.0.5","@types/jest":"^29.5.1","@types/mocha":"^10.0.1","@types/node":"^18.13.0","@types/supertest":"^2.0.12",dotenv:"^16.0.3","eslint-plugin-no-only-tests":"^3.1.0",supertest:"^6.3.3"};var scripts={codegen:"npx graphql-codegen --require dotenv/config"};var exports$1={".":{"import":"./esm/src/index.js",require:"./cjs/index.js"},"./api":{"import":"./esm/src/api/index.js","default":"./cjs/src/api/index.js",types:"./esm/src/api/index.d.ts"},"./core":{"import":"./esm/src/core/index.js","default":"./cjs/src/core/index.js",types:"./esm/src/core/index.d.ts"}};var typesVersions={"*":{api:["./esm/src/api/index.d.ts"],core:["./esm/src/core/index.d.ts"]}};var packageJson = {name:name,repository:repository,license:license,version:version,main:main,module:module$1,types:types,sideEffects:sideEffects,dependencies:dependencies,devDependencies:devDependencies,scripts:scripts,exports:exports$1,typesVersions:typesVersions};
1070
-
1071
- class API {
1072
- constructor({ graphApiKey, additionalHeaders, defaultChain, } = {}) {
1073
- if (!graphApiKey) {
1074
- console.warn('QuickNode SDK warning: no apiKey provided. Access with no apiKey is heavily rate limited and intended for development use only. For higher rate limits or production usage, create an account on https://www.quicknode.com/');
1075
- }
1076
- this.graphApiKey = graphApiKey;
1077
- this.additionalHeaders = additionalHeaders;
1078
- this.urqlClient = this.createUrqlClient();
1079
- this.customUrqlClient = new CustomUrqlClient(this.urqlClient);
1080
- this.defaultChain = defaultChain || DEFAULT_CHAIN;
1081
- this.nfts = new NftsController(this.customUrqlClient, this.defaultChain);
1082
- this.tokens = new TokensController(this.customUrqlClient, this.defaultChain);
1083
- this.utils = new UtilsController(this.customUrqlClient, this.defaultChain);
1084
- this.contracts = new ContractsController(this.customUrqlClient, this.defaultChain);
1085
- this.transactions = new TransactionsController(this.customUrqlClient, this.defaultChain);
1086
- this.events = new EventsController(this.customUrqlClient, this.defaultChain);
1087
- // Re-export the Urql client configured to use the Graph API for use with custom queries
1088
- this.graphApiClient = this.urqlClient;
1089
- }
1090
- createUrqlClient() {
1091
- const headers = { ...this.additionalHeaders };
1092
- if (this.graphApiKey)
1093
- headers['x-api-key'] = this.graphApiKey;
1094
- headers['x-quicknode-sdk'] = 'js-sdk';
1095
- headers['x-quicknode-sdk-version'] = packageJson?.version || 'n/a';
1096
- const useNftKey = (data) => `${data['contractAddress']}:${data['tokenId']}`;
1097
- const useAddressAsKey = (data) => `${data['address']}`;
1098
- const useTransactionHashAndIndex = (data) => `${data['transactionHash']}:${data['transferIndex']}`;
1099
- const urqlCache = exchangeGraphcache.cacheExchange({
1100
- logger: (severity, message) => {
1101
- if (severity === 'warn' && process.env['SHOW_URQL_WARNINGS']) {
1102
- console.warn(message);
1103
- }
1104
- if (severity === 'debug' && process.env['SHOW_URQL_DEBUG']) {
1105
- console.debug(message);
1106
- }
1107
- if (severity === 'error') {
1108
- console.error(message);
1109
- }
1110
- },
1111
- keys: {
1112
- EVMSchemaType: () => null,
1113
- Collection: useAddressAsKey,
1114
- CollectionOHLCVChart: () => null,
1115
- Contract: useAddressAsKey,
1116
- ERC721NFT: useNftKey,
1117
- ERC721Collection: useAddressAsKey,
1118
- ERC1155NFT: useNftKey,
1119
- ERC1155Collection: useAddressAsKey,
1120
- GasPrice: () => null,
1121
- NFT: useNftKey,
1122
- NFTContract: useAddressAsKey,
1123
- TokenAttribute: () => null,
1124
- TokenContract: useAddressAsKey,
1125
- TokenEvent: useTransactionHashAndIndex,
1126
- TokenMintEvent: useTransactionHashAndIndex,
1127
- TokenBurnEvent: useTransactionHashAndIndex,
1128
- TokenSaleEvent: useTransactionHashAndIndex,
1129
- TokenSwapEvent: useTransactionHashAndIndex,
1130
- TokenTransferEvent: useTransactionHashAndIndex,
1131
- TokenUpload: () => null,
1132
- OpenSeaMetadata: () => null,
1133
- Transaction: (data) => `${data['hash']}`,
1134
- TrendingCollection: () => null,
1135
- Wallet: (data) => `${data['address']}`,
1136
- WalletNFT: () => null,
1137
- WalletTokenBalance: () => null,
1138
- },
1139
- });
1140
- const client = new core.Client({
1141
- fetch: fetch__default["default"],
1142
- url: process.env['NX_GRAPHQL_API_URI'] ||
1143
- 'https://api.quicknode.com/graphql',
1144
- exchanges: [urqlCache, core.fetchExchange],
1145
- fetchOptions: () => ({ headers }),
1146
- });
1147
- return client;
1148
- }
1149
- }
1150
66
 
1151
67
  // We can't dynamically extend the viem client based on which add-ons are specified, which would
1152
68
  // make the types fully align with the add-ons for the client, so instead we do run-time checks to
@@ -1157,6 +73,18 @@ function checkAddOnEnabled(enabled, humanName, configName) {
1157
73
  }
1158
74
  }
1159
75
 
76
+ const isEvmAddress = zod.z
77
+ .string()
78
+ .length(42) // Using built-in function for better error messages
79
+ .startsWith('0x') // Using built-in function for better error messages
80
+ .regex(/^0x[a-fA-F0-9]{40}$/, 'Not a valid address');
81
+ const rpcPaginationParams = zod.z
82
+ .object({
83
+ perPage: zod.z.number().positive().nullish(),
84
+ page: zod.z.number().positive().nullish(),
85
+ })
86
+ .strict();
87
+
1160
88
  const qnFetchNFTInputSchema = zod.z
1161
89
  .object({
1162
90
  wallet: isEvmAddress,
@@ -1418,16 +346,10 @@ class Core {
1418
346
  }
1419
347
 
1420
348
  const QuickNode = {
1421
- API: API,
1422
349
  Core: Core,
1423
350
  };
1424
351
 
1425
- Object.defineProperty(exports, 'gql', {
1426
- enumerable: true,
1427
- get: function () { return core.gql; }
1428
- });
1429
352
  exports.viem = viem__namespace;
1430
- exports.API = API;
1431
353
  exports.Core = Core;
1432
354
  exports.QNChainNotSupported = QNChainNotSupported;
1433
355
  exports.QNInputValidationError = QNInputValidationError;