@covalenthq/client-sdk 0.9.2 → 0.9.3

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.
@@ -9,7 +9,7 @@ export type Chain = "btc-mainnet" | "eth-mainnet" | "matic-mainnet" | "bsc-mainn
9
9
  export type Quote = "USD" | "CAD" | "EUR" | "SGD" | "INR" | "JPY" | "VND" | "CNY" | "KRW" | "RUB" | "TRY" | "NGN" | "ARS" | "AUD" | "CHF" | "GBP";
10
10
  export type ChainID = 20090103 | 1 | 137 | 56 | 43114 | 10 | 250 | 1284 | 1285 | 30 | 42161 | 11297108109 | 8217 | 128 | 71402 | 2020 | 9001 | 592 | 4689 | 1666600000 | 25 | 1313161554 | 42262 | 288 | 5 | 80001 | 43113 | 97 | 1287 | 31 | 421613 | 4002 | 11297108099 | 256 | 71401 | 9000 | 336 | 4690 | 1666700000 | 1313161555 | 534354 | 534351 | 1131378225 | 53935 | 73772 | 43288 | 1294 | 56288 | 28 | 1297 | 9728 | 4328 | 1001 | 192837465 | 356256156 | 1564830818 | 278611351 | 432204 | 1026062157 | 432201 | 81 | 338 | 335 | 1088 | 588 | 2002 | 200202 | 2001 | 200101 | 73773 | 1399811149 | 2046399126 | 82 | 83 | 2139927552 | 2888 | 245022926 | 344106930 | 476158412 | 42170 | 7700 | 119 | 1029 | 14 | 114 | 19 | 16 | 321 | 322 | 1422 | 59140 | 84531 | 5001 | 534353 | 248 | 9372 | 2152 | 2154 | 416 | 23294 | 23295 | 420 | 1101 | 1662 | 1024 | 39797 | 49797 | 1663 | 11155111 | 1482601649 | 644937893 | 222000222 | 49321 | 1231 | 1230 | 7777777 | 999 | 245022934 | 2044 | 8453 | 5000 | 262018 | 59144 | 7332 | 10507 | 7979 | 1234 | 1228 | 8888 | 333000333 | 12008 | 12011 | 2038 | 1995 | 12010 | 51178 | 12009 | 12012 | 324 | 599 | 280 | 1343 | 11115 | 6765897100 | 1079 | 13337 | 16350 | 1990 | 20221 | 5611 | 12018 | 12013 | 12020 | 12015 | 12016 | 12014 | 12017 | 12019 | 431234 | 6119 | 73 | 7001 | 42888 | 919 | 5151706 | 923018 | 3441005 | 424 | 58008 | 100 | 10200 | 570 | 57000 | 167007 | 11155420 | 204 | 40 | 41 | 321123 | 360163 | 78431 | 2037 | 17772 | 152703 | 894538 | 179188 | 78432 | 7777 | 986532 | 78430 | 2195 | 11111 | 3012 | 4337 | 534352 | 17000 | 88 | 89 | 20765 | 84532 | 47279324479 | 421614 | 12027 | 12028 | 12029 | 31330 | 31331 | 31332 | 31333 | 31334 | 31335 | 412346 | 8545 | 42220;
11
11
  export type Source = "Ponder" | "GoldRush" | "Viem";
12
- export declare const userAgent = "com.covalenthq.sdk.typescript/0.9.2";
12
+ export declare const userAgent = "com.covalenthq.sdk.typescript/0.9.3";
13
13
  export declare class Response<T> {
14
14
  data: T;
15
15
  error: boolean;
@@ -457,6 +457,12 @@ export interface GetNftTransactionsForContractTokenIdQueryParamOpts {
457
457
  /** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
458
458
  noSpam?: boolean;
459
459
  }
460
+ export interface CheckOwnershipInNftQueryParamOpts {
461
+ /** * Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Must be used with "values-filter", is case-sensitive, and requires proper URL encoding. */
462
+ traitsFilter?: string;
463
+ /** * Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. Must be used with "traits-filter", is case-sensitive, and requires proper URL encoding. */
464
+ valuesFilter?: string;
465
+ }
460
466
  export interface GetNftMarketSaleCountQueryParamOpts {
461
467
  /** * The number of days to return data for. Request up 365 days. Defaults to 30 days. */
462
468
  days?: number;
@@ -617,9 +623,12 @@ export declare class NftService {
617
623
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
618
624
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
619
625
  * @param {string} collectionContract - The requested collection address.
626
+ * @param {CheckOwnershipInNftQueryParamOpts} queryParamOpts
627
+ * - `traitsFilter`: Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Must be used with "values-filter", is case-sensitive, and requires proper URL encoding.
628
+ * - `valuesFilter`: Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. Must be used with "traits-filter", is case-sensitive, and requires proper URL encoding.
620
629
  *
621
630
  */
622
- checkOwnershipInNft(chainName: Chain | Chains | ChainID, walletAddress: string, collectionContract: string): Promise<Response<NftOwnershipForCollectionResponse>>;
631
+ checkOwnershipInNft(chainName: Chain | Chains | ChainID, walletAddress: string, collectionContract: string, queryParamOpts?: CheckOwnershipInNftQueryParamOpts): Promise<Response<NftOwnershipForCollectionResponse>>;
623
632
  /**
624
633
  *
625
634
  * Commonly used to verify ownership of a specific token (ERC-721 or ERC-1155) within a collection.
package/dist/esm/index.js CHANGED
@@ -192,16 +192,6 @@ var pLimit_1 = pLimit;
192
192
 
193
193
  var pLimit$1 = /*@__PURE__*/getDefaultExportFromCjs(pLimit_1);
194
194
 
195
- function checkAndModifyResponse(jsonObj) {
196
- for (const key in jsonObj) {
197
- if (key === 'next_update_at') {
198
- delete jsonObj[key];
199
- }
200
- else if (typeof jsonObj[key] === 'object') {
201
- checkAndModifyResponse(jsonObj[key]);
202
- }
203
- }
204
- }
205
195
  async function debugOutput(url, responseStatus, startTime) {
206
196
  let endTime;
207
197
  let elapsedTime;
@@ -247,7 +237,6 @@ async function* paginateEndpoint$1(url, apiKey, urlsParams, dataClassConstructor
247
237
  }
248
238
  for (const tx of data.data.items) {
249
239
  const dataClass = new dataClassConstructor(tx);
250
- checkAndModifyResponse(dataClass);
251
240
  yield dataClass;
252
241
  }
253
242
  backoff.setNumAttempts(1);
@@ -272,7 +261,7 @@ async function* paginateEndpoint$1(url, apiKey, urlsParams, dataClassConstructor
272
261
  if (error.message.includes("An error occurred 429")) {
273
262
  throw new Error(error.message);
274
263
  }
275
- throw new Error(`An error occurred ${data ? data.error_code : response.status}: ${data ? data.error_message : response.status === 500 ? "Internal server error" : "Unknown Error"}`);
264
+ throw new Error(`An error occurred ${data ? data.error_code : response ? response.status : "Unknown Error Code"}: ${data ? data.error_message : response && response.status === 500 ? "Internal server error" : "Unknown Error"}`);
276
265
  }
277
266
  }
278
267
  }
@@ -440,7 +429,6 @@ class SecurityService {
440
429
  data = await response.json();
441
430
  }
442
431
  const dataClass = new ApprovalsResponse(data.data);
443
- checkAndModifyResponse(dataClass);
444
432
  success = true;
445
433
  return {
446
434
  data: dataClass,
@@ -513,7 +501,6 @@ class SecurityService {
513
501
  data = await response.json();
514
502
  }
515
503
  const dataClass = new NftApprovalsResponse(data.data);
516
- checkAndModifyResponse(dataClass);
517
504
  success = true;
518
505
  return {
519
506
  data: dataClass,
@@ -913,7 +900,6 @@ class BalanceService {
913
900
  data = await response.json();
914
901
  }
915
902
  const dataClass = new BalancesResponse(data.data);
916
- checkAndModifyResponse(dataClass);
917
903
  success = true;
918
904
  return {
919
905
  data: dataClass,
@@ -996,7 +982,6 @@ class BalanceService {
996
982
  data = await response.json();
997
983
  }
998
984
  const dataClass = new PortfolioResponse(data.data);
999
- checkAndModifyResponse(dataClass);
1000
985
  success = true;
1001
986
  return {
1002
987
  data: dataClass,
@@ -1148,7 +1133,6 @@ class BalanceService {
1148
1133
  data = await response.json();
1149
1134
  }
1150
1135
  const dataClass = new Erc20TransfersResponse(data.data);
1151
- checkAndModifyResponse(dataClass);
1152
1136
  success = true;
1153
1137
  return {
1154
1138
  data: dataClass,
@@ -1284,7 +1268,6 @@ class BalanceService {
1284
1268
  data = await response.json();
1285
1269
  }
1286
1270
  const dataClass = new TokenHoldersResponse(data.data);
1287
- checkAndModifyResponse(dataClass);
1288
1271
  success = true;
1289
1272
  return {
1290
1273
  data: dataClass,
@@ -1387,7 +1370,6 @@ class BalanceService {
1387
1370
  data = await response.json();
1388
1371
  }
1389
1372
  const dataClass = new HistoricalBalancesResponse(data.data);
1390
- checkAndModifyResponse(dataClass);
1391
1373
  success = true;
1392
1374
  return {
1393
1375
  data: dataClass,
@@ -1468,7 +1450,6 @@ class BalanceService {
1468
1450
  data = await response.json();
1469
1451
  }
1470
1452
  const dataClass = new TokenBalanceNativeResponse(data.data);
1471
- checkAndModifyResponse(dataClass);
1472
1453
  success = true;
1473
1454
  return {
1474
1455
  data: dataClass,
@@ -1783,7 +1764,6 @@ class BaseService {
1783
1764
  data = await response.json();
1784
1765
  }
1785
1766
  const dataClass = new BlockResponse(data.data);
1786
- checkAndModifyResponse(dataClass);
1787
1767
  success = true;
1788
1768
  return {
1789
1769
  data: dataClass,
@@ -1857,7 +1837,6 @@ class BaseService {
1857
1837
  data = await response.json();
1858
1838
  }
1859
1839
  const dataClass = new ResolvedAddress(data.data);
1860
- checkAndModifyResponse(dataClass);
1861
1840
  success = true;
1862
1841
  return {
1863
1842
  data: dataClass,
@@ -1979,7 +1958,6 @@ class BaseService {
1979
1958
  data = await response.json();
1980
1959
  }
1981
1960
  const dataClass = new BlockHeightsResponse(data.data);
1982
- checkAndModifyResponse(dataClass);
1983
1961
  success = true;
1984
1962
  return {
1985
1963
  data: dataClass,
@@ -2077,7 +2055,6 @@ class BaseService {
2077
2055
  data = await response.json();
2078
2056
  }
2079
2057
  const dataClass = new GetLogsResponse(data.data);
2080
- checkAndModifyResponse(dataClass);
2081
2058
  success = true;
2082
2059
  return {
2083
2060
  data: dataClass,
@@ -2213,7 +2190,6 @@ class BaseService {
2213
2190
  data = await response.json();
2214
2191
  }
2215
2192
  const dataClass = new LogEventsByAddressResponse(data.data);
2216
- checkAndModifyResponse(dataClass);
2217
2193
  success = true;
2218
2194
  return {
2219
2195
  data: dataClass,
@@ -2357,7 +2333,6 @@ class BaseService {
2357
2333
  data = await response.json();
2358
2334
  }
2359
2335
  const dataClass = new LogEventsByTopicHashResponse(data.data);
2360
- checkAndModifyResponse(dataClass);
2361
2336
  success = true;
2362
2337
  return {
2363
2338
  data: dataClass,
@@ -2429,7 +2404,6 @@ class BaseService {
2429
2404
  data = await response.json();
2430
2405
  }
2431
2406
  const dataClass = new AllChainsResponse(data.data);
2432
- checkAndModifyResponse(dataClass);
2433
2407
  success = true;
2434
2408
  return {
2435
2409
  data: dataClass,
@@ -2501,7 +2475,6 @@ class BaseService {
2501
2475
  data = await response.json();
2502
2476
  }
2503
2477
  const dataClass = new AllChainsStatusResponse(data.data);
2504
- checkAndModifyResponse(dataClass);
2505
2478
  success = true;
2506
2479
  return {
2507
2480
  data: dataClass,
@@ -2579,7 +2552,6 @@ class BaseService {
2579
2552
  data = await response.json();
2580
2553
  }
2581
2554
  const dataClass = new ChainActivityResponse(data.data);
2582
- checkAndModifyResponse(dataClass);
2583
2555
  success = true;
2584
2556
  return {
2585
2557
  data: dataClass,
@@ -2656,7 +2628,6 @@ class BaseService {
2656
2628
  data = await response.json();
2657
2629
  }
2658
2630
  const dataClass = new GasPricesResponse(data.data);
2659
- checkAndModifyResponse(dataClass);
2660
2631
  success = true;
2661
2632
  return {
2662
2633
  data: dataClass,
@@ -3115,7 +3086,6 @@ class NftService {
3115
3086
  data = await response.json();
3116
3087
  }
3117
3088
  const dataClass = new ChainCollectionResponse(data.data);
3118
- checkAndModifyResponse(dataClass);
3119
3089
  success = true;
3120
3090
  return {
3121
3091
  data: dataClass,
@@ -3202,7 +3172,6 @@ class NftService {
3202
3172
  data = await response.json();
3203
3173
  }
3204
3174
  const dataClass = new NftAddressBalanceNftResponse(data.data);
3205
- checkAndModifyResponse(dataClass);
3206
3175
  success = true;
3207
3176
  return {
3208
3177
  data: dataClass,
@@ -3354,7 +3323,6 @@ class NftService {
3354
3323
  data = await response.json();
3355
3324
  }
3356
3325
  const dataClass = new NftMetadataResponse(data.data);
3357
- checkAndModifyResponse(dataClass);
3358
3326
  success = true;
3359
3327
  return {
3360
3328
  data: dataClass,
@@ -3438,7 +3406,6 @@ class NftService {
3438
3406
  data = await response.json();
3439
3407
  }
3440
3408
  const dataClass = new NftMetadataResponse(data.data);
3441
- checkAndModifyResponse(dataClass);
3442
3409
  success = true;
3443
3410
  return {
3444
3411
  data: dataClass,
@@ -3518,7 +3485,6 @@ class NftService {
3518
3485
  data = await response.json();
3519
3486
  }
3520
3487
  const dataClass = new NftTransactionsResponse(data.data);
3521
- checkAndModifyResponse(dataClass);
3522
3488
  success = true;
3523
3489
  return {
3524
3490
  data: dataClass,
@@ -3592,7 +3558,6 @@ class NftService {
3592
3558
  data = await response.json();
3593
3559
  }
3594
3560
  const dataClass = new NftCollectionTraitsResponse(data.data);
3595
- checkAndModifyResponse(dataClass);
3596
3561
  success = true;
3597
3562
  return {
3598
3563
  data: dataClass,
@@ -3667,7 +3632,6 @@ class NftService {
3667
3632
  data = await response.json();
3668
3633
  }
3669
3634
  const dataClass = new NftCollectionAttributesForTraitResponse(data.data);
3670
- checkAndModifyResponse(dataClass);
3671
3635
  success = true;
3672
3636
  return {
3673
3637
  data: dataClass,
@@ -3741,7 +3705,6 @@ class NftService {
3741
3705
  data = await response.json();
3742
3706
  }
3743
3707
  const dataClass = new NftCollectionTraitSummaryResponse(data.data);
3744
- checkAndModifyResponse(dataClass);
3745
3708
  success = true;
3746
3709
  return {
3747
3710
  data: dataClass,
@@ -3768,9 +3731,12 @@ class NftService {
3768
3731
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
3769
3732
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
3770
3733
  * @param {string} collectionContract - The requested collection address.
3734
+ * @param {CheckOwnershipInNftQueryParamOpts} queryParamOpts
3735
+ * - `traitsFilter`: Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Must be used with "values-filter", is case-sensitive, and requires proper URL encoding.
3736
+ * - `valuesFilter`: Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. Must be used with "traits-filter", is case-sensitive, and requires proper URL encoding.
3771
3737
  *
3772
3738
  */
3773
- async checkOwnershipInNft(chainName, walletAddress, collectionContract) {
3739
+ async checkOwnershipInNft(chainName, walletAddress, collectionContract, queryParamOpts) {
3774
3740
  let success = false;
3775
3741
  let data;
3776
3742
  let response;
@@ -3786,6 +3752,12 @@ class NftService {
3786
3752
  error_message: ApiKeyValidator.INVALID_API_KEY_MESSAGE
3787
3753
  };
3788
3754
  }
3755
+ if (queryParamOpts?.traitsFilter !== undefined) {
3756
+ urlParams.append("traits-filter", queryParamOpts?.traitsFilter.toString());
3757
+ }
3758
+ if (queryParamOpts?.valuesFilter !== undefined) {
3759
+ urlParams.append("values-filter", queryParamOpts?.valuesFilter.toString());
3760
+ }
3789
3761
  const url = `https://api.covalenthq.com/v1/${chainName}/address/${walletAddress}/collection/${collectionContract}/?${urlParams}`;
3790
3762
  let startTime;
3791
3763
  if (this.debug) {
@@ -3816,7 +3788,6 @@ class NftService {
3816
3788
  data = await response.json();
3817
3789
  }
3818
3790
  const dataClass = new NftOwnershipForCollectionResponse(data.data);
3819
- checkAndModifyResponse(dataClass);
3820
3791
  success = true;
3821
3792
  return {
3822
3793
  data: dataClass,
@@ -3892,7 +3863,6 @@ class NftService {
3892
3863
  data = await response.json();
3893
3864
  }
3894
3865
  const dataClass = new NftOwnershipForCollectionResponse(data.data);
3895
- checkAndModifyResponse(dataClass);
3896
3866
  success = true;
3897
3867
  return {
3898
3868
  data: dataClass,
@@ -3975,7 +3945,6 @@ class NftService {
3975
3945
  data = await response.json();
3976
3946
  }
3977
3947
  const dataClass = new NftMarketSaleCountResponse(data.data);
3978
- checkAndModifyResponse(dataClass);
3979
3948
  success = true;
3980
3949
  return {
3981
3950
  data: dataClass,
@@ -4058,7 +4027,6 @@ class NftService {
4058
4027
  data = await response.json();
4059
4028
  }
4060
4029
  const dataClass = new NftMarketVolumeResponse(data.data);
4061
- checkAndModifyResponse(dataClass);
4062
4030
  success = true;
4063
4031
  return {
4064
4032
  data: dataClass,
@@ -4141,7 +4109,6 @@ class NftService {
4141
4109
  data = await response.json();
4142
4110
  }
4143
4111
  const dataClass = new NftMarketFloorPriceResponse(data.data);
4144
- checkAndModifyResponse(dataClass);
4145
4112
  success = true;
4146
4113
  return {
4147
4114
  data: dataClass,
@@ -4281,7 +4248,6 @@ class PricingService {
4281
4248
  const res = [];
4282
4249
  data.data.forEach((e) => {
4283
4250
  const dataClass = new TokenPricesResponse(e);
4284
- checkAndModifyResponse(dataClass);
4285
4251
  res.push(dataClass);
4286
4252
  });
4287
4253
  success = true;
@@ -4582,7 +4548,6 @@ class RecentTransactionsResponse {
4582
4548
  data = await response.json();
4583
4549
  }
4584
4550
  const dataClass = new RecentTransactionsResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
4585
- checkAndModifyResponse(dataClass);
4586
4551
  success = true;
4587
4552
  return {
4588
4553
  data: dataClass,
@@ -4649,7 +4614,6 @@ class RecentTransactionsResponse {
4649
4614
  data = await response.json();
4650
4615
  }
4651
4616
  const dataClass = new RecentTransactionsResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
4652
- checkAndModifyResponse(dataClass);
4653
4617
  success = true;
4654
4618
  return {
4655
4619
  data: dataClass,
@@ -4737,7 +4701,6 @@ class TransactionsBlockPageResponse {
4737
4701
  data = await response.json();
4738
4702
  }
4739
4703
  const dataClass = new TransactionsBlockPageResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
4740
- checkAndModifyResponse(dataClass);
4741
4704
  success = true;
4742
4705
  return {
4743
4706
  data: dataClass,
@@ -4804,7 +4767,6 @@ class TransactionsBlockPageResponse {
4804
4767
  data = await response.json();
4805
4768
  }
4806
4769
  const dataClass = new TransactionsBlockPageResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
4807
- checkAndModifyResponse(dataClass);
4808
4770
  success = true;
4809
4771
  return {
4810
4772
  data: dataClass,
@@ -4932,7 +4894,6 @@ class TransactionsResponse {
4932
4894
  data = await response.json();
4933
4895
  }
4934
4896
  const dataClass = new TransactionsResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
4935
- checkAndModifyResponse(dataClass);
4936
4897
  success = true;
4937
4898
  return {
4938
4899
  data: dataClass,
@@ -4999,7 +4960,6 @@ class TransactionsResponse {
4999
4960
  data = await response.json();
5000
4961
  }
5001
4962
  const dataClass = new TransactionsResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
5002
- checkAndModifyResponse(dataClass);
5003
4963
  success = true;
5004
4964
  return {
5005
4965
  data: dataClass,
@@ -5085,7 +5045,6 @@ class TransactionsTimeBucketResponse {
5085
5045
  data = await response.json();
5086
5046
  }
5087
5047
  const dataClass = new TransactionsTimeBucketResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
5088
- checkAndModifyResponse(dataClass);
5089
5048
  success = true;
5090
5049
  return {
5091
5050
  data: dataClass,
@@ -5152,7 +5111,6 @@ class TransactionsTimeBucketResponse {
5152
5111
  data = await response.json();
5153
5112
  }
5154
5113
  const dataClass = new TransactionsTimeBucketResponse(data.data, this._debug, this._apiKey, this._threadCount, this._urlParams, this._enableRetry, this._source);
5155
- checkAndModifyResponse(dataClass);
5156
5114
  success = true;
5157
5115
  return {
5158
5116
  data: dataClass,
@@ -5210,7 +5168,6 @@ async function* paginateEndpoint(url, apiKey, urlsParams, debug, threadCount, en
5210
5168
  }
5211
5169
  for (const tx of data.data.items) {
5212
5170
  const dataClass = new Transaction(tx);
5213
- checkAndModifyResponse(dataClass);
5214
5171
  yield dataClass;
5215
5172
  }
5216
5173
  backoff.setNumAttempts(1);
@@ -5229,7 +5186,7 @@ async function* paginateEndpoint(url, apiKey, urlsParams, debug, threadCount, en
5229
5186
  if (error.message.includes("An error occurred 429")) {
5230
5187
  throw new Error(error.message);
5231
5188
  }
5232
- throw new Error(`An error occurred ${data ? data.error_code : response.status}: ${data ? data.error_message : response.status === 500 ? "Internal server error" : "Unknown Error"}`);
5189
+ throw new Error(`An error occurred ${data ? data.error_code : response ? response.status : "Unknown Error Code"}: ${data ? data.error_message : response && response.status === 500 ? "Internal server error" : "Unknown Error"}`);
5233
5190
  }
5234
5191
  }
5235
5192
  }
@@ -5322,7 +5279,6 @@ class TransactionService {
5322
5279
  data = await response.json();
5323
5280
  }
5324
5281
  const dataClass = new TransactionResponse(data.data);
5325
- checkAndModifyResponse(dataClass);
5326
5282
  success = true;
5327
5283
  return {
5328
5284
  data: dataClass,
@@ -5458,7 +5414,6 @@ class TransactionService {
5458
5414
  data = await response.json();
5459
5415
  }
5460
5416
  const dataClass = new RecentTransactionsResponse(data.data, this.debug, this.apiKey, this.threadCount, urlParams, this.enableRetry, this.source);
5461
- checkAndModifyResponse(dataClass);
5462
5417
  success = true;
5463
5418
  return {
5464
5419
  data: dataClass,
@@ -5545,7 +5500,6 @@ class TransactionService {
5545
5500
  data = await response.json();
5546
5501
  }
5547
5502
  const dataClass = new TransactionsBlockResponse(data.data);
5548
- checkAndModifyResponse(dataClass);
5549
5503
  success = true;
5550
5504
  return {
5551
5505
  data: dataClass,
@@ -5628,7 +5582,6 @@ class TransactionService {
5628
5582
  data = await response.json();
5629
5583
  }
5630
5584
  const dataClass = new TransactionsSummaryResponse(data.data);
5631
- checkAndModifyResponse(dataClass);
5632
5585
  success = true;
5633
5586
  return {
5634
5587
  data: dataClass,
@@ -5718,7 +5671,6 @@ class TransactionService {
5718
5671
  data = await response.json();
5719
5672
  }
5720
5673
  const dataClass = new TransactionsResponse(data.data, this.debug, this.apiKey, this.threadCount, urlParams, this.enableRetry, this.source);
5721
- checkAndModifyResponse(dataClass);
5722
5674
  success = true;
5723
5675
  return {
5724
5676
  data: dataClass,
@@ -5804,7 +5756,6 @@ class TransactionService {
5804
5756
  data = await response.json();
5805
5757
  }
5806
5758
  const dataClass = new TransactionsTimeBucketResponse(data.data, this.debug, this.apiKey, this.threadCount, urlParams, this.enableRetry, this.source);
5807
- checkAndModifyResponse(dataClass);
5808
5759
  success = true;
5809
5760
  return {
5810
5761
  data: dataClass,
@@ -5892,7 +5843,6 @@ class TransactionService {
5892
5843
  data = await response.json();
5893
5844
  }
5894
5845
  const dataClass = new TransactionsBlockPageResponse(data.data, this.debug, this.apiKey, this.threadCount, urlParams, this.enableRetry, this.source);
5895
- checkAndModifyResponse(dataClass);
5896
5846
  success = true;
5897
5847
  return {
5898
5848
  data: dataClass,
@@ -5979,7 +5929,6 @@ class TransactionService {
5979
5929
  data = await response.json();
5980
5930
  }
5981
5931
  const dataClass = new TransactionsBlockResponse(data.data);
5982
- checkAndModifyResponse(dataClass);
5983
5932
  success = true;
5984
5933
  return {
5985
5934
  data: dataClass,
@@ -6615,7 +6564,6 @@ class XykService {
6615
6564
  data = await response.json();
6616
6565
  }
6617
6566
  const dataClass = new PoolResponse(data.data);
6618
- checkAndModifyResponse(dataClass);
6619
6567
  success = true;
6620
6568
  return {
6621
6569
  data: dataClass,
@@ -6689,7 +6637,6 @@ class XykService {
6689
6637
  data = await response.json();
6690
6638
  }
6691
6639
  const dataClass = new PoolToDexResponse(data.data);
6692
- checkAndModifyResponse(dataClass);
6693
6640
  success = true;
6694
6641
  return {
6695
6642
  data: dataClass,
@@ -6764,7 +6711,6 @@ class XykService {
6764
6711
  data = await response.json();
6765
6712
  }
6766
6713
  const dataClass = new PoolByAddressResponse(data.data);
6767
- checkAndModifyResponse(dataClass);
6768
6714
  success = true;
6769
6715
  return {
6770
6716
  data: dataClass,
@@ -6852,7 +6798,6 @@ class XykService {
6852
6798
  data = await response.json();
6853
6799
  }
6854
6800
  const dataClass = new PoolsDexDataResponse(data.data);
6855
- checkAndModifyResponse(dataClass);
6856
6801
  success = true;
6857
6802
  return {
6858
6803
  data: dataClass,
@@ -6927,7 +6872,6 @@ class XykService {
6927
6872
  data = await response.json();
6928
6873
  }
6929
6874
  const dataClass = new AddressExchangeBalancesResponse(data.data);
6930
- checkAndModifyResponse(dataClass);
6931
6875
  success = true;
6932
6876
  return {
6933
6877
  data: dataClass,
@@ -7019,7 +6963,6 @@ class XykService {
7019
6963
  data = await response.json();
7020
6964
  }
7021
6965
  const dataClass = new PoolsDexDataResponse(data.data);
7022
- checkAndModifyResponse(dataClass);
7023
6966
  success = true;
7024
6967
  return {
7025
6968
  data: dataClass,
@@ -7102,7 +7045,6 @@ class XykService {
7102
7045
  data = await response.json();
7103
7046
  }
7104
7047
  const dataClass = new NetworkExchangeTokensResponse(data.data);
7105
- checkAndModifyResponse(dataClass);
7106
7048
  success = true;
7107
7049
  return {
7108
7050
  data: dataClass,
@@ -7182,7 +7124,6 @@ class XykService {
7182
7124
  data = await response.json();
7183
7125
  }
7184
7126
  const dataClass = new NetworkExchangeTokenViewResponse(data.data);
7185
- checkAndModifyResponse(dataClass);
7186
7127
  success = true;
7187
7128
  return {
7188
7129
  data: dataClass,
@@ -7254,7 +7195,6 @@ class XykService {
7254
7195
  data = await response.json();
7255
7196
  }
7256
7197
  const dataClass = new SupportedDexesResponse(data.data);
7257
- checkAndModifyResponse(dataClass);
7258
7198
  success = true;
7259
7199
  return {
7260
7200
  data: dataClass,
@@ -7338,7 +7278,6 @@ class XykService {
7338
7278
  data = await response.json();
7339
7279
  }
7340
7280
  const dataClass = new SingleNetworkExchangeTokenResponse(data.data);
7341
- checkAndModifyResponse(dataClass);
7342
7281
  success = true;
7343
7282
  return {
7344
7283
  data: dataClass,
@@ -7413,7 +7352,6 @@ class XykService {
7413
7352
  data = await response.json();
7414
7353
  }
7415
7354
  const dataClass = new TransactionsForAccountAddressResponse(data.data);
7416
- checkAndModifyResponse(dataClass);
7417
7355
  success = true;
7418
7356
  return {
7419
7357
  data: dataClass,
@@ -7497,7 +7435,6 @@ class XykService {
7497
7435
  data = await response.json();
7498
7436
  }
7499
7437
  const dataClass = new TransactionsForTokenAddressResponse(data.data);
7500
- checkAndModifyResponse(dataClass);
7501
7438
  success = true;
7502
7439
  return {
7503
7440
  data: dataClass,
@@ -7581,7 +7518,6 @@ class XykService {
7581
7518
  data = await response.json();
7582
7519
  }
7583
7520
  const dataClass = new TransactionsForExchangeResponse(data.data);
7584
- checkAndModifyResponse(dataClass);
7585
7521
  success = true;
7586
7522
  return {
7587
7523
  data: dataClass,
@@ -7668,7 +7604,6 @@ class XykService {
7668
7604
  data = await response.json();
7669
7605
  }
7670
7606
  const dataClass = new NetworkTransactionsResponse(data.data);
7671
- checkAndModifyResponse(dataClass);
7672
7607
  success = true;
7673
7608
  return {
7674
7609
  data: dataClass,
@@ -7742,7 +7677,6 @@ class XykService {
7742
7677
  data = await response.json();
7743
7678
  }
7744
7679
  const dataClass = new EcosystemChartDataResponse(data.data);
7745
- checkAndModifyResponse(dataClass);
7746
7680
  success = true;
7747
7681
  return {
7748
7682
  data: dataClass,
@@ -7816,7 +7750,6 @@ class XykService {
7816
7750
  data = await response.json();
7817
7751
  }
7818
7752
  const dataClass = new HealthDataResponse(data.data);
7819
- checkAndModifyResponse(dataClass);
7820
7753
  success = true;
7821
7754
  return {
7822
7755
  data: dataClass,
@@ -7838,7 +7771,7 @@ class XykService {
7838
7771
  }
7839
7772
  }
7840
7773
 
7841
- const userAgent = "com.covalenthq.sdk.typescript/0.9.2";
7774
+ const userAgent = "com.covalenthq.sdk.typescript/0.9.3";
7842
7775
  class Response {
7843
7776
  }
7844
7777
  /**