@covalenthq/client-sdk 0.8.3 → 0.8.5

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 (37) hide show
  1. package/dist/cjs/index.d.ts +1 -1
  2. package/dist/cjs/index.js +38 -7
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/services/CovalentClient.d.ts +1 -1
  5. package/dist/cjs/services/TransactionService.d.ts +29 -1
  6. package/dist/cjs/services/XykService.d.ts +15 -0
  7. package/dist/cjs/util/types/TransactionServiceTypes.d.ts +18 -0
  8. package/dist/cjs/util/types/XykServiceTypes.d.ts +9 -1
  9. package/dist/es/index.d.ts +1 -1
  10. package/dist/es/index.js +38 -7
  11. package/dist/es/index.js.map +1 -1
  12. package/dist/es/services/CovalentClient.d.ts +1 -1
  13. package/dist/es/services/TransactionService.d.ts +29 -1
  14. package/dist/es/services/XykService.d.ts +15 -0
  15. package/dist/es/util/types/TransactionServiceTypes.d.ts +18 -0
  16. package/dist/es/util/types/XykServiceTypes.d.ts +9 -1
  17. package/dist/esm/index.d.ts +1 -1
  18. package/dist/esm/index.js +38 -7
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/services/CovalentClient.d.ts +1 -1
  21. package/dist/esm/services/TransactionService.d.ts +29 -1
  22. package/dist/esm/services/XykService.d.ts +15 -0
  23. package/dist/esm/util/types/TransactionServiceTypes.d.ts +18 -0
  24. package/dist/esm/util/types/XykServiceTypes.d.ts +9 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js.map +1 -1
  27. package/dist/services/CovalentClient.d.ts +1 -1
  28. package/dist/services/CovalentClient.js +1 -1
  29. package/dist/services/TransactionService.d.ts +29 -1
  30. package/dist/services/TransactionService.js +22 -1
  31. package/dist/services/TransactionService.js.map +1 -1
  32. package/dist/services/XykService.d.ts +15 -0
  33. package/dist/services/XykService.js +10 -0
  34. package/dist/services/XykService.js.map +1 -1
  35. package/dist/util/types/TransactionServiceTypes.d.ts +18 -0
  36. package/dist/util/types/XykServiceTypes.d.ts +9 -1
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- export { CovalentClient, Client, Chain, Quote, CovalentClientSettings } from "./services/CovalentClient";
1
+ export { CovalentClient, Client, Chain, Quote, CovalentClientSettings, ChainID } from "./services/CovalentClient";
2
2
  export * from "./util/types/BalanceServiceTypes";
3
3
  export * from "./util/types/BaseServiceTypes";
4
4
  export * from "./util/types/NftServiceTypes";
package/dist/cjs/index.js CHANGED
@@ -698,7 +698,7 @@ let Pagination$3 = class Pagination {
698
698
  this.total_count = data.total_count;
699
699
  }
700
700
  };
701
- let Explorer$1 = class Explorer {
701
+ let Explorer$2 = class Explorer {
702
702
  constructor(data) {
703
703
  this.label = data.label;
704
704
  this.url = data.url;
@@ -725,7 +725,7 @@ class TokenTransferItem {
725
725
  this.pretty_delta_quote = data.pretty_delta_quote;
726
726
  this.balance_quote = data.balance_quote;
727
727
  this.method_calls = data.method_calls && data.method_calls !== null ? data.method_calls.map((itemData) => new MethodCallsForTransfers(itemData)) : null;
728
- this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer$1(itemData)) : null;
728
+ this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer$2(itemData)) : null;
729
729
  }
730
730
  }
731
731
  class MethodCallsForTransfers {
@@ -4311,7 +4311,7 @@ class Transaction {
4311
4311
  this.pretty_gas_quote = data.pretty_gas_quote;
4312
4312
  this.gas_quote_rate = data.gas_quote_rate;
4313
4313
  this.gas_metadata = data.gas_metadata && data.gas_metadata !== null ? new ContractMetadata$1(data.gas_metadata) : null;
4314
- this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer(itemData)) : null;
4314
+ this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer$1(itemData)) : null;
4315
4315
  this.dex_details = data.dex_details && data.dex_details !== null ? data.dex_details.map((itemData) => new DexReport(itemData)) : null;
4316
4316
  this.nft_sale_details = data.nft_sale_details && data.nft_sale_details !== null ? data.nft_sale_details.map((itemData) => new NftSalesReport(itemData)) : null;
4317
4317
  this.lending_details = data.lending_details && data.lending_details !== null ? data.lending_details.map((itemData) => new LendingReport(itemData)) : null;
@@ -4329,12 +4329,12 @@ let ContractMetadata$1 = class ContractMetadata {
4329
4329
  this.logo_url = data.logo_url;
4330
4330
  }
4331
4331
  };
4332
- class Explorer {
4332
+ let Explorer$1 = class Explorer {
4333
4333
  constructor(data) {
4334
4334
  this.label = data.label;
4335
4335
  this.url = data.url;
4336
4336
  }
4337
- }
4337
+ };
4338
4338
  class DexReport {
4339
4339
  constructor(data) {
4340
4340
  this.log_offset = data.log_offset;
@@ -4816,11 +4816,23 @@ class TransactionsSummaryResponse {
4816
4816
  this.items = data.items && data.items !== null ? data.items.map((itemData) => new TransactionsSummary(itemData)) : null;
4817
4817
  }
4818
4818
  }
4819
+ class GasSummary {
4820
+ constructor(data) {
4821
+ this.total_sent_count = data.total_sent_count;
4822
+ this.total_fees_paid = data.total_fees_paid && data.total_fees_paid !== null ? BigInt(data.total_fees_paid) : null;
4823
+ this.total_gas_quote = data.total_gas_quote;
4824
+ this.pretty_total_gas_quote = data.pretty_total_gas_quote;
4825
+ this.average_gas_quote_per_tx = data.average_gas_quote_per_tx;
4826
+ this.pretty_average_gas_quote_per_tx = data.pretty_average_gas_quote_per_tx;
4827
+ this.gas_metadata = data.gas_metadata && data.gas_metadata !== null ? new ContractMetadata$1(data.gas_metadata) : null;
4828
+ }
4829
+ }
4819
4830
  class TransactionsSummary {
4820
4831
  constructor(data) {
4821
4832
  this.total_count = data.total_count;
4822
4833
  this.earliest_transaction = data.earliest_transaction && data.earliest_transaction !== null ? new TransactionSummary(data.earliest_transaction) : null;
4823
4834
  this.latest_transaction = data.latest_transaction && data.latest_transaction !== null ? new TransactionSummary(data.latest_transaction) : null;
4835
+ this.gas_summary = data.gas_summary && data.gas_summary !== null ? new GasSummary(data.gas_summary) : null;
4824
4836
  }
4825
4837
  }
4826
4838
  class TransactionSummary {
@@ -5533,9 +5545,12 @@ class TransactionService {
5533
5545
  *
5534
5546
  * @param {string} chainName - The chain name eg: `eth-mainnet`.
5535
5547
  * @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
5548
+ * @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
5549
+ * - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
5550
+ * - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
5536
5551
  *
5537
5552
  */
5538
- async getTransactionSummary(chainName, walletAddress) {
5553
+ async getTransactionSummary(chainName, walletAddress, queryParamOpts) {
5539
5554
  let success = false;
5540
5555
  let data;
5541
5556
  let response;
@@ -5551,6 +5566,12 @@ class TransactionService {
5551
5566
  error_message: ApiKeyValidator.INVALID_API_KEY_MESSAGE
5552
5567
  };
5553
5568
  }
5569
+ if (queryParamOpts?.quoteCurrency !== undefined) {
5570
+ urlParams.append("quote-currency", queryParamOpts?.quoteCurrency.toString());
5571
+ }
5572
+ if (queryParamOpts?.withGas !== undefined) {
5573
+ urlParams.append("with-gas", queryParamOpts?.withGas.toString());
5574
+ }
5554
5575
  let startTime;
5555
5576
  if (this.debug) {
5556
5577
  startTime = new Date();
@@ -5993,6 +6014,12 @@ class Pagination {
5993
6014
  this.total_count = data.total_count;
5994
6015
  }
5995
6016
  }
6017
+ class Explorer {
6018
+ constructor(data) {
6019
+ this.label = data.label;
6020
+ this.url = data.url;
6021
+ }
6022
+ }
5996
6023
  class Token {
5997
6024
  constructor(data) {
5998
6025
  this.contract_address = data.contract_address;
@@ -6063,6 +6090,7 @@ class PoolWithTimeseries {
6063
6090
  this.pretty_volume_7d_quote = data.pretty_volume_7d_quote;
6064
6091
  this.token_0_reserve_quote = data.token_0_reserve_quote;
6065
6092
  this.token_1_reserve_quote = data.token_1_reserve_quote;
6093
+ this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer(itemData)) : null;
6066
6094
  this.token_0 = data.token_0 && data.token_0 !== null ? new Token(data.token_0) : null;
6067
6095
  this.token_1 = data.token_1 && data.token_1 !== null ? new Token(data.token_1) : null;
6068
6096
  this.volume_timeseries_7d = data.volume_timeseries_7d && data.volume_timeseries_7d !== null ? data.volume_timeseries_7d.map((itemData) => new VolumeTimeseries(itemData)) : null;
@@ -6147,6 +6175,7 @@ class PoolsDexDataItem {
6147
6175
  this.pretty_volume_24h_quote = data.pretty_volume_24h_quote;
6148
6176
  this.pretty_volume_7d_quote = data.pretty_volume_7d_quote;
6149
6177
  this.pretty_fee_24h_quote = data.pretty_fee_24h_quote;
6178
+ this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer(itemData)) : null;
6150
6179
  this.token_0 = data.token_0 && data.token_0 !== null ? new PoolsDexToken(data.token_0) : null;
6151
6180
  this.token_1 = data.token_1 && data.token_1 !== null ? new PoolsDexToken(data.token_1) : null;
6152
6181
  }
@@ -6233,6 +6262,7 @@ class TokenV2Volume {
6233
6262
  this.pretty_total_volume_24h_quote = data.pretty_total_volume_24h_quote;
6234
6263
  this.total_liquidity_quote = data.total_liquidity_quote;
6235
6264
  this.total_volume_24h_quote = data.total_volume_24h_quote;
6265
+ this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer(itemData)) : null;
6236
6266
  }
6237
6267
  }
6238
6268
  class NetworkExchangeTokenViewResponse {
@@ -6266,6 +6296,7 @@ class TokenV2VolumeWithChartData {
6266
6296
  this.total_liquidity_quote = data.total_liquidity_quote;
6267
6297
  this.total_volume_24h_quote = data.total_volume_24h_quote;
6268
6298
  this.transactions_24h = data.transactions_24h;
6299
+ this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer(itemData)) : null;
6269
6300
  this.volume_timeseries_7d = data.volume_timeseries_7d && data.volume_timeseries_7d !== null ? data.volume_timeseries_7d.map((itemData) => new VolumeTokenTimeseries(itemData)) : null;
6270
6301
  this.volume_timeseries_30d = data.volume_timeseries_30d && data.volume_timeseries_30d !== null ? data.volume_timeseries_30d.map((itemData) => new VolumeTokenTimeseries(itemData)) : null;
6271
6302
  this.liquidity_timeseries_7d = data.liquidity_timeseries_7d && data.liquidity_timeseries_7d !== null ? data.liquidity_timeseries_7d.map((itemData) => new LiquidityTokenTimeseries(itemData)) : null;
@@ -7775,7 +7806,7 @@ class XykService {
7775
7806
  }
7776
7807
  }
7777
7808
 
7778
- const userAgent = "com.covalenthq.sdk.typescript/0.8.3";
7809
+ const userAgent = "com.covalenthq.sdk.typescript/0.8.5";
7779
7810
  /**
7780
7811
  * CovalentClient Class
7781
7812
  */