@quicknode/sdk 0.5.1 → 0.5.2

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.
package/src/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './client';
2
2
  export { QuickNodeSDK as default } from './client';
3
3
  export * from './queries';
4
+ export * from './graphql/types';
package/src/index.esm.js CHANGED
@@ -7804,6 +7804,7 @@ var extras = {
7804
7804
  gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;
7805
7805
  })(gql || (gql = {}));
7806
7806
  gql["default"] = gql;
7807
+ var gql$1 = gql;
7807
7808
 
7808
7809
  function setContext(setter) {
7809
7810
  return new ApolloLink(function (operation, forward) {
@@ -7912,38 +7913,6 @@ function onError(errorHandler) {
7912
7913
  return ErrorLink;
7913
7914
  })(ApolloLink));
7914
7915
 
7915
- const getWalletAddressNFTsRawQuery = gql `
7916
- query WalletNFTs($address: String, $first: Int, $after: String) {
7917
- wallet(address: $address) {
7918
- ensName
7919
- address
7920
- tokens(first: $first, after: $after) {
7921
- pageInfo {
7922
- hasNextPage
7923
- endCursor
7924
- }
7925
- edges {
7926
- node {
7927
- tokenId
7928
- images {
7929
- url
7930
- }
7931
- ... on ERC721Token {
7932
- contract {
7933
- address
7934
- ... on ERC721Contract {
7935
- symbol
7936
- name
7937
- }
7938
- }
7939
- }
7940
- }
7941
- }
7942
- }
7943
- }
7944
- }
7945
- `;
7946
-
7947
7916
  const getWalletENSNFTsRawQuery = gql `
7948
7917
  query WalletNFTs($ensName: String, $first: Int, $after: String) {
7949
7918
  wallet(ensName: $ensName) {
@@ -8038,45 +8007,6 @@ const getCollectionDetailsRawQuery = gql `
8038
8007
  }
8039
8008
  `;
8040
8009
 
8041
- const getNFTEventLogsRawQuery = gql `
8042
- query NFTEvents(
8043
- $address: String!
8044
- $tokenId: String!
8045
- $filter: LogsFilterInputType
8046
- $first: Int
8047
- $after: String
8048
- ) {
8049
- token(contractAddress: $address, tokenId: $tokenId) {
8050
- ... on ERC721Token {
8051
- tokenId
8052
- contract {
8053
- address # Included key field for caching
8054
- }
8055
- logs(filter: $filter, first: $first, after: $after) {
8056
- edges {
8057
- node {
8058
- blockNumber
8059
- type
8060
- fromAddress
8061
- toAddress
8062
- estimatedConfirmedAt
8063
- transactionHash
8064
- ... on OrderLog {
8065
- marketplace
8066
- priceInEth
8067
- }
8068
- }
8069
- }
8070
- pageInfo {
8071
- hasNextPage
8072
- endCursor
8073
- }
8074
- }
8075
- }
8076
- }
8077
- }
8078
- `;
8079
-
8080
8010
  const getNFTDetailsRawQuery = gql `
8081
8011
  query Token($contractAddress: String!, $tokenId: String!) {
8082
8012
  token(contractAddress: $contractAddress, tokenId: $tokenId) {
@@ -8117,20 +8047,215 @@ const getNFTDetailsRawQuery = gql `
8117
8047
  }
8118
8048
  `;
8119
8049
 
8120
- const getContractEventLogsRawQuery = gql `
8121
- query ContractEvents(
8122
- $address: String!
8123
- $filter: LogsFilterInputType
8124
- $first: Int
8125
- $after: String
8126
- ) {
8127
- contract(address: $address) {
8050
+ var ContractsOrderByEnum;
8051
+ (function (ContractsOrderByEnum) {
8052
+ /**
8053
+ * Sort contracts by average sale price within a given time range. Defaults to within last hour, use timeframe on "stats" to further filter.
8054
+ * @deprecated Use the trendingCollections query instead.
8055
+ */
8056
+ ContractsOrderByEnum["Average"] = "AVERAGE";
8057
+ /**
8058
+ * Sort contracts by max sale price within a given time range. Defaults to within last hour, use timeframe on "stats" to further filter.
8059
+ * @deprecated Use the trendingCollections query instead.
8060
+ */
8061
+ ContractsOrderByEnum["Ceiling"] = "CEILING";
8062
+ /**
8063
+ * Sort contracts by min sale price within a given time range. Defaults to within last hour, use timeframe on "stats" to further filter.
8064
+ * @deprecated Use the trendingCollections query instead.
8065
+ */
8066
+ ContractsOrderByEnum["Floor"] = "FLOOR";
8067
+ /** Sort contracts alphabetically by name */
8068
+ ContractsOrderByEnum["Name"] = "NAME";
8069
+ /**
8070
+ * Sort contracts by number of sales. Defaults to within last hour, use timeframe on "stats" to further filter.
8071
+ * @deprecated Use the trendingCollections query instead.
8072
+ */
8073
+ ContractsOrderByEnum["Sales"] = "SALES";
8074
+ /** Sort contracts alphabetically by symbol */
8075
+ ContractsOrderByEnum["Symbol"] = "SYMBOL";
8076
+ /**
8077
+ * Sort contracts by volume. Defaults to within last hour, use timeframe on "stats" to further filter.
8078
+ * @deprecated Use the trendingCollections query instead.
8079
+ */
8080
+ ContractsOrderByEnum["Volume"] = "VOLUME";
8081
+ })(ContractsOrderByEnum || (ContractsOrderByEnum = {}));
8082
+ var HeldCollectionsOrderByEnum;
8083
+ (function (HeldCollectionsOrderByEnum) {
8084
+ /** The timestamp of when the wallet acquired a token in this collection. */
8085
+ HeldCollectionsOrderByEnum["DateAcquired"] = "DATE_ACQUIRED";
8086
+ /** The name of the collection */
8087
+ HeldCollectionsOrderByEnum["Name"] = "NAME";
8088
+ })(HeldCollectionsOrderByEnum || (HeldCollectionsOrderByEnum = {}));
8089
+ var HeldTokensOrderByEnum;
8090
+ (function (HeldTokensOrderByEnum) {
8091
+ /** The timestamp of when the wallet acquired this token. */
8092
+ HeldTokensOrderByEnum["DateAcquired"] = "DATE_ACQUIRED";
8093
+ /** The name of the token */
8094
+ HeldTokensOrderByEnum["Name"] = "NAME";
8095
+ })(HeldTokensOrderByEnum || (HeldTokensOrderByEnum = {}));
8096
+ var LogOrderMarketplace;
8097
+ (function (LogOrderMarketplace) {
8098
+ LogOrderMarketplace["Blur"] = "BLUR";
8099
+ LogOrderMarketplace["Cryptopunks"] = "CRYPTOPUNKS";
8100
+ LogOrderMarketplace["Gem"] = "GEM";
8101
+ LogOrderMarketplace["Genie"] = "GENIE";
8102
+ LogOrderMarketplace["Looksrare"] = "LOOKSRARE";
8103
+ LogOrderMarketplace["Niftygateway"] = "NIFTYGATEWAY";
8104
+ LogOrderMarketplace["Opensea"] = "OPENSEA";
8105
+ LogOrderMarketplace["X2Y2"] = "X2Y2";
8106
+ LogOrderMarketplace["Zerox"] = "ZEROX";
8107
+ })(LogOrderMarketplace || (LogOrderMarketplace = {}));
8108
+ var LogType;
8109
+ (function (LogType) {
8110
+ LogType["Mint"] = "MINT";
8111
+ LogType["Order"] = "ORDER";
8112
+ LogType["Transfer"] = "TRANSFER";
8113
+ })(LogType || (LogType = {}));
8114
+ var OrderDirectionEnum;
8115
+ (function (OrderDirectionEnum) {
8116
+ /** Sort ascending (A-Z) */
8117
+ OrderDirectionEnum["Asc"] = "ASC";
8118
+ /** Sort descending (Z-A) */
8119
+ OrderDirectionEnum["Desc"] = "DESC";
8120
+ })(OrderDirectionEnum || (OrderDirectionEnum = {}));
8121
+ var RefreshMetadataStatusMessage;
8122
+ (function (RefreshMetadataStatusMessage) {
8123
+ RefreshMetadataStatusMessage["Completed"] = "COMPLETED";
8124
+ RefreshMetadataStatusMessage["CompletedToken"] = "COMPLETED_TOKEN";
8125
+ RefreshMetadataStatusMessage["Error"] = "ERROR";
8126
+ RefreshMetadataStatusMessage["ErrorToken"] = "ERROR_TOKEN";
8127
+ RefreshMetadataStatusMessage["Queued"] = "QUEUED";
8128
+ RefreshMetadataStatusMessage["QueuedToken"] = "QUEUED_TOKEN";
8129
+ })(RefreshMetadataStatusMessage || (RefreshMetadataStatusMessage = {}));
8130
+ var TokenStandard;
8131
+ (function (TokenStandard) {
8132
+ TokenStandard["Erc721"] = "ERC721";
8133
+ TokenStandard["Erc1155"] = "ERC1155";
8134
+ })(TokenStandard || (TokenStandard = {}));
8135
+ var TrendingCollectionsOrderByEnum;
8136
+ (function (TrendingCollectionsOrderByEnum) {
8137
+ /** Sort contracts by average sale price within a given time range. Defaults to within last hour. */
8138
+ TrendingCollectionsOrderByEnum["Average"] = "AVERAGE";
8139
+ /** Sort contracts by number of sales. Defaults to within last hour. */
8140
+ TrendingCollectionsOrderByEnum["Sales"] = "SALES";
8141
+ /** Sort contracts by volume. Defaults to within last hour. */
8142
+ TrendingCollectionsOrderByEnum["Volume"] = "VOLUME";
8143
+ })(TrendingCollectionsOrderByEnum || (TrendingCollectionsOrderByEnum = {}));
8144
+ var TrendingCollectionsTimePeriodEnum;
8145
+ (function (TrendingCollectionsTimePeriodEnum) {
8146
+ /** Last 24 hours */
8147
+ TrendingCollectionsTimePeriodEnum["OneDay"] = "ONE_DAY";
8148
+ /** Last hour */
8149
+ TrendingCollectionsTimePeriodEnum["OneHour"] = "ONE_HOUR";
8150
+ /** Last 7 days */
8151
+ TrendingCollectionsTimePeriodEnum["SevenDays"] = "SEVEN_DAYS";
8152
+ /** Last 12 hours */
8153
+ TrendingCollectionsTimePeriodEnum["TwelveHours"] = "TWELVE_HOURS";
8154
+ })(TrendingCollectionsTimePeriodEnum || (TrendingCollectionsTimePeriodEnum = {}));
8155
+ const NftCollection = gql$1 `
8156
+ fragment NftCollection on Contract {
8157
+ ... on ERC721Contract {
8158
+ address
8159
+ isVerified
8160
+ circulatingSupply
8161
+ name
8162
+ symbol
8163
+ stats {
8164
+ average
8165
+ ceiling
8166
+ floor
8167
+ totalSales
8168
+ volume
8169
+ }
8170
+ }
8171
+ }
8172
+ `;
8173
+ const Nft = gql$1 `
8174
+ fragment Nft on Token {
8175
+ ... on ERC721Token {
8176
+ tokenId
8177
+ attributes {
8178
+ name
8179
+ value
8180
+ }
8181
+ contract {
8128
8182
  address
8129
- logs(filter: $filter, first: $first, after: $after) {
8130
- pageInfo {
8131
- hasNextPage
8132
- endCursor
8183
+ isVerified
8184
+ tokenStandard
8185
+ ... on ERC721Contract {
8186
+ name
8187
+ }
8188
+ }
8189
+ images {
8190
+ height
8191
+ mimeType
8192
+ url
8193
+ width
8194
+ }
8195
+ name
8196
+ symbol
8197
+ metadata {
8198
+ animation_url
8199
+ background_color
8200
+ description
8201
+ external_url
8202
+ image
8203
+ image_data
8204
+ name
8205
+ youtube_url
8206
+ }
8207
+ }
8208
+ }
8209
+ `;
8210
+ const ContractEventLog = gql$1 `
8211
+ fragment ContractEventLog on Log {
8212
+ blockNumber
8213
+ type
8214
+ fromAddress
8215
+ toAddress
8216
+ estimatedConfirmedAt
8217
+ transactionHash
8218
+ token {
8219
+ contract {
8220
+ address
8221
+ }
8222
+ ... on ERC721Token {
8223
+ tokenId
8224
+ }
8225
+ }
8226
+ ... on OrderLog {
8227
+ marketplace
8228
+ priceInEth
8229
+ }
8230
+ }
8231
+ `;
8232
+ const ContractEventsLogs = gql$1 `
8233
+ query ContractEventsLogs($address: String!, $filter: LogsFilterInputType, $first: Int, $after: String) {
8234
+ contract(address: $address) {
8235
+ address
8236
+ logs(filter: $filter, first: $first, after: $after) {
8237
+ pageInfo {
8238
+ hasNextPage
8239
+ endCursor
8240
+ }
8241
+ edges {
8242
+ node {
8243
+ ...ContractEventLog
8133
8244
  }
8245
+ }
8246
+ }
8247
+ }
8248
+ }
8249
+ ${ContractEventLog}`;
8250
+ const NftEventsLogs = gql$1 `
8251
+ query NFTEventsLogs($address: String!, $tokenId: String!, $filter: LogsFilterInputType, $first: Int, $after: String) {
8252
+ token(contractAddress: $address, tokenId: $tokenId) {
8253
+ ... on ERC721Token {
8254
+ tokenId
8255
+ contract {
8256
+ address
8257
+ }
8258
+ logs(filter: $filter, first: $first, after: $after) {
8134
8259
  edges {
8135
8260
  node {
8136
8261
  blockNumber
@@ -8139,53 +8264,74 @@ const getContractEventLogsRawQuery = gql `
8139
8264
  toAddress
8140
8265
  estimatedConfirmedAt
8141
8266
  transactionHash
8142
- token {
8143
- contract {
8144
- address
8145
- }
8146
- ... on ERC721Token {
8147
- tokenId
8148
- }
8149
- }
8150
8267
  ... on OrderLog {
8151
8268
  marketplace
8152
8269
  priceInEth
8153
8270
  }
8154
8271
  }
8155
8272
  }
8156
- }
8157
- }
8158
- }
8159
- `;
8160
-
8161
- const getNFTsWalletAndContractsRawQuery = gql `
8162
- query NFTsWalletAndContract(
8163
- $filter: TokensFilterInputType
8164
- $address: String
8165
- $first: Int
8166
- $after: String
8167
- ) {
8168
- wallet(address: $address) {
8169
- ensName
8170
- address
8171
- tokens(filter: $filter, first: $first, after: $after) {
8172
8273
  pageInfo {
8173
8274
  hasNextPage
8174
8275
  endCursor
8175
8276
  }
8176
- edges {
8177
- node {
8178
- tokenId
8179
- images {
8180
- url
8277
+ }
8278
+ }
8279
+ }
8280
+ }
8281
+ `;
8282
+ const WalletNfTs = gql$1 `
8283
+ query WalletNFTs($address: String!, $first: Int, $after: String) {
8284
+ wallet(address: $address) {
8285
+ ensName
8286
+ address
8287
+ tokens(first: $first, after: $after) {
8288
+ pageInfo {
8289
+ hasNextPage
8290
+ endCursor
8291
+ }
8292
+ edges {
8293
+ node {
8294
+ tokenId
8295
+ images {
8296
+ url
8297
+ }
8298
+ ... on ERC721Token {
8299
+ contract {
8300
+ address
8301
+ ... on ERC721Contract {
8302
+ symbol
8303
+ name
8304
+ }
8181
8305
  }
8182
- ... on ERC721Token {
8183
- contract {
8184
- address
8185
- ... on ERC721Contract {
8186
- symbol
8187
- name
8188
- }
8306
+ }
8307
+ }
8308
+ }
8309
+ }
8310
+ }
8311
+ }
8312
+ `;
8313
+ const NfTsWalletAndContract = gql$1 `
8314
+ query NFTsWalletAndContract($filter: TokensFilterInputType, $address: String, $first: Int, $after: String) {
8315
+ wallet(address: $address) {
8316
+ ensName
8317
+ address
8318
+ tokens(filter: $filter, first: $first, after: $after) {
8319
+ pageInfo {
8320
+ hasNextPage
8321
+ endCursor
8322
+ }
8323
+ edges {
8324
+ node {
8325
+ tokenId
8326
+ images {
8327
+ url
8328
+ }
8329
+ ... on ERC721Token {
8330
+ contract {
8331
+ address
8332
+ ... on ERC721Contract {
8333
+ symbol
8334
+ name
8189
8335
  }
8190
8336
  }
8191
8337
  }
@@ -8193,9 +8339,37 @@ const getNFTsWalletAndContractsRawQuery = gql `
8193
8339
  }
8194
8340
  }
8195
8341
  }
8196
- `;
8342
+ }
8343
+ `;
8344
+ const TrendingNftCollections = gql$1 `
8345
+ query TrendingNFTCollections($after: String, $first: Int, $orderBy: TrendingCollectionsOrderByEnum, $orderDirection: OrderDirectionEnum, $timePeriod: TrendingCollectionsTimePeriodEnum, $timeRange: DateInputType) {
8346
+ trendingCollections(
8347
+ after: $after
8348
+ first: $first
8349
+ orderBy: $orderBy
8350
+ orderDirection: $orderDirection
8351
+ timePeriod: $timePeriod
8352
+ timeRange: $timeRange
8353
+ ) {
8354
+ edges {
8355
+ cursor
8356
+ node {
8357
+ ...NftCollection
8358
+ }
8359
+ }
8360
+ pageInfo {
8361
+ endCursor
8362
+ hasNextPage
8363
+ }
8364
+ }
8365
+ }
8366
+ ${NftCollection}`;
8197
8367
 
8198
- const DEFAULT_LOG_FILTER_TYPES = ['TRANSFER', 'ORDER', 'MINT'];
8368
+ const DEFAULT_LOG_FILTER_TYPES = [
8369
+ LogType.Transfer,
8370
+ LogType.Order,
8371
+ LogType.Mint,
8372
+ ];
8199
8373
  class NFTQueries {
8200
8374
  constructor(client) {
8201
8375
  this.client = client;
@@ -8203,15 +8377,15 @@ class NFTQueries {
8203
8377
  getNFTsByWalletAddress(variables) {
8204
8378
  return __awaiter(this, void 0, void 0, function* () {
8205
8379
  const { address } = variables, otherVariables = __rest(variables, ["address"]);
8206
- return yield this.client.query({
8207
- query: getWalletAddressNFTsRawQuery,
8380
+ return this.client.query({
8381
+ query: WalletNfTs,
8208
8382
  variables: Object.assign({ address: address.toLowerCase() }, otherVariables),
8209
8383
  });
8210
8384
  });
8211
8385
  }
8212
8386
  getNFTsByWalletENS(variables) {
8213
8387
  return __awaiter(this, void 0, void 0, function* () {
8214
- return yield this.client.query({
8388
+ return this.client.query({
8215
8389
  query: getWalletENSNFTsRawQuery,
8216
8390
  variables,
8217
8391
  });
@@ -8220,7 +8394,7 @@ class NFTQueries {
8220
8394
  getNFTsByContractAddress(variables) {
8221
8395
  return __awaiter(this, void 0, void 0, function* () {
8222
8396
  const { address } = variables, otherVariables = __rest(variables, ["address"]);
8223
- return yield this.client.query({
8397
+ return this.client.query({
8224
8398
  query: getContractAddressNFTsRawQuery,
8225
8399
  variables: Object.assign({ address: address.toLowerCase() }, otherVariables),
8226
8400
  });
@@ -8229,7 +8403,7 @@ class NFTQueries {
8229
8403
  getCollectionDetails(variables) {
8230
8404
  return __awaiter(this, void 0, void 0, function* () {
8231
8405
  const { address } = variables, otherVariables = __rest(variables, ["address"]);
8232
- return yield this.client.query({
8406
+ return this.client.query({
8233
8407
  query: getCollectionDetailsRawQuery,
8234
8408
  variables: Object.assign({ address: address.toLowerCase() }, otherVariables),
8235
8409
  });
@@ -8238,8 +8412,8 @@ class NFTQueries {
8238
8412
  getNFTEventLogs(variables) {
8239
8413
  return __awaiter(this, void 0, void 0, function* () {
8240
8414
  const { address, types = DEFAULT_LOG_FILTER_TYPES } = variables, otherVariables = __rest(variables, ["address", "types"]);
8241
- return yield this.client.query({
8242
- query: getNFTEventLogsRawQuery,
8415
+ return this.client.query({
8416
+ query: NftEventsLogs,
8243
8417
  variables: Object.assign(Object.assign({}, otherVariables), { address: address.toLowerCase(), filter: {
8244
8418
  typeIn: types,
8245
8419
  } }),
@@ -8249,7 +8423,7 @@ class NFTQueries {
8249
8423
  getNFTDetails(variables) {
8250
8424
  return __awaiter(this, void 0, void 0, function* () {
8251
8425
  const { contractAddress } = variables, otherVariables = __rest(variables, ["contractAddress"]);
8252
- return yield this.client.query({
8426
+ return this.client.query({
8253
8427
  query: getNFTDetailsRawQuery,
8254
8428
  variables: Object.assign({ contractAddress: contractAddress.toLowerCase() }, otherVariables),
8255
8429
  });
@@ -8258,8 +8432,8 @@ class NFTQueries {
8258
8432
  getContractEventLogs(variables) {
8259
8433
  return __awaiter(this, void 0, void 0, function* () {
8260
8434
  const { address, types = DEFAULT_LOG_FILTER_TYPES } = variables, otherVariables = __rest(variables, ["address", "types"]);
8261
- return yield this.client.query({
8262
- query: getContractEventLogsRawQuery,
8435
+ return this.client.query({
8436
+ query: ContractEventsLogs,
8263
8437
  variables: Object.assign(Object.assign({}, otherVariables), { address: address.toLowerCase(), filter: {
8264
8438
  typeIn: types,
8265
8439
  } }),
@@ -8270,36 +8444,49 @@ class NFTQueries {
8270
8444
  return __awaiter(this, void 0, void 0, function* () {
8271
8445
  const { address, contracts } = variables, otherVariables = __rest(variables, ["address", "contracts"]);
8272
8446
  const normalizedContracts = contracts.map((contract) => contract.toLowerCase());
8273
- const response = yield this.client.query({
8274
- query: getNFTsWalletAndContractsRawQuery,
8447
+ return this.client.query({
8448
+ query: NfTsWalletAndContract,
8275
8449
  variables: Object.assign(Object.assign({}, otherVariables), { address: address.toLowerCase(), filter: { contractAddressIn: normalizedContracts } }),
8276
8450
  });
8277
- return response;
8451
+ });
8452
+ }
8453
+ getTrendingNFTCollections(variables) {
8454
+ return __awaiter(this, void 0, void 0, function* () {
8455
+ return this.client.query({
8456
+ query: TrendingNftCollections,
8457
+ variables,
8458
+ });
8278
8459
  });
8279
8460
  }
8280
8461
  }
8281
8462
 
8282
- /**
8283
- * @todo implement generic typing
8284
- */
8285
- const removeNodesAndEdges = (data) => {
8463
+ function isConnection(object) {
8464
+ return (typeof object === 'object' &&
8465
+ !!object &&
8466
+ ('edges' in object ||
8467
+ 'total' in object ||
8468
+ 'pageInfo' in object ||
8469
+ 'breadcrumbs' in object));
8470
+ }
8471
+ function removeNodesAndEdges(data) {
8286
8472
  const keys = Object.keys(data);
8287
8473
  const output = {};
8288
8474
  keys
8289
8475
  .filter((key) => key !== '__typename')
8290
8476
  .forEach((key) => {
8477
+ var _a;
8291
8478
  const value = data[key];
8292
8479
  if (typeof value === 'string' ||
8293
8480
  typeof value === 'boolean' ||
8294
8481
  typeof value === 'number' ||
8295
- value === null) {
8482
+ value === null ||
8483
+ value === undefined) {
8296
8484
  return (output[key] = value);
8297
8485
  }
8298
8486
  if (Array.isArray(value)) {
8299
8487
  return (output[key] = value.map((item) => removeNodesAndEdges(item)));
8300
8488
  }
8301
- if (value &&
8302
- (value.edges || value.total || value.pageInfo || value.breadcrumbs)) {
8489
+ if (isConnection(value)) {
8303
8490
  if (value.breadcrumbs)
8304
8491
  output[`${key}Breadcrumbs`] = value.breadcrumbs;
8305
8492
  if (value.total)
@@ -8307,41 +8494,53 @@ const removeNodesAndEdges = (data) => {
8307
8494
  if (value.viewport)
8308
8495
  output[`${key}Viewport`] = value.viewport;
8309
8496
  if (value.pageInfo) {
8310
- const _a = value.pageInfo, pageInfoRest = __rest(_a, ["__typename"]);
8497
+ const _b = value.pageInfo, pageInfoRest = __rest(_b, ["__typename"]);
8311
8498
  output[`${key}PageInfo`] = pageInfoRest;
8312
8499
  }
8313
- output[key] = value.edges.map((item) => {
8500
+ return (output[key] = (_a = value.edges) === null || _a === void 0 ? void 0 : _a.map((item) => {
8314
8501
  if (item.node) {
8315
8502
  return removeNodesAndEdges(item.node);
8316
8503
  }
8317
8504
  return item;
8318
- });
8319
- }
8320
- else {
8321
- output[key] = value === null ? null : removeNodesAndEdges(value);
8505
+ }));
8322
8506
  }
8507
+ return (output[key] = removeNodesAndEdges(value));
8323
8508
  });
8324
8509
  return output;
8325
- };
8510
+ }
8326
8511
 
8327
8512
  class CustomApolloClient {
8328
8513
  constructor(apolloClient) {
8329
8514
  this.apolloClient = apolloClient;
8330
8515
  }
8331
- /**
8332
- * @todo improve typing here
8333
- */
8334
8516
  query(options) {
8335
8517
  return __awaiter(this, void 0, void 0, function* () {
8336
8518
  const result = yield this.apolloClient.query(options);
8337
- if ((result === null || result === void 0 ? void 0 : result.data) && typeof (result === null || result === void 0 ? void 0 : result.data) === 'object') {
8338
- result.data = removeNodesAndEdges(result.data);
8339
- }
8340
- return result;
8519
+ return Object.assign(Object.assign({}, result), { data: (result === null || result === void 0 ? void 0 : result.data) &&
8520
+ removeNodesAndEdges(result.data) });
8341
8521
  });
8342
8522
  }
8343
8523
  }
8344
8524
 
8525
+ const result = {
8526
+ "possibleTypes": {
8527
+ "Contract": [
8528
+ "BaseContract",
8529
+ "ERC721Contract"
8530
+ ],
8531
+ "Log": [
8532
+ "BaseLog",
8533
+ "MintLog",
8534
+ "OrderLog",
8535
+ "TransferLog"
8536
+ ],
8537
+ "Token": [
8538
+ "BaseToken",
8539
+ "ERC721Token"
8540
+ ]
8541
+ }
8542
+ };
8543
+
8345
8544
  const QUICKNODE_GRAPHQL_CLIENT_SUPPRESS_WARNINGS =
8346
8545
  /**
8347
8546
  * @todo set unified config util
@@ -8382,6 +8581,7 @@ class QuickNodeSDK {
8382
8581
  };
8383
8582
  }));
8384
8583
  const cacheStructure = new InMemoryCache({
8584
+ possibleTypes: result.possibleTypes,
8385
8585
  typePolicies: {
8386
8586
  ERC721Token: {
8387
8587
  keyFields: ['tokenId', 'contract', ['address']],
@@ -8402,4 +8602,4 @@ class QuickNodeSDK {
8402
8602
  }
8403
8603
  }
8404
8604
 
8405
- export { QuickNodeSDK, QuickNodeSDK as default, getContractAddressNFTsRawQuery, getWalletAddressNFTsRawQuery, getWalletENSNFTsRawQuery };
8605
+ export { ContractEventLog, ContractEventsLogs, ContractsOrderByEnum, HeldCollectionsOrderByEnum, HeldTokensOrderByEnum, LogOrderMarketplace, LogType, NfTsWalletAndContract, Nft, NftCollection, NftEventsLogs, OrderDirectionEnum, QuickNodeSDK, RefreshMetadataStatusMessage, TokenStandard, TrendingCollectionsOrderByEnum, TrendingCollectionsTimePeriodEnum, TrendingNftCollections, WalletNfTs, QuickNodeSDK as default, getContractAddressNFTsRawQuery, getWalletENSNFTsRawQuery };