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