@covalenthq/client-sdk 0.8.3 → 0.8.4
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/dist/cjs/index.js +37 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/CovalentClient.d.ts +1 -1
- package/dist/cjs/services/TransactionService.d.ts +29 -1
- package/dist/cjs/services/XykService.d.ts +13 -0
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/cjs/util/types/XykServiceTypes.d.ts +7 -1
- package/dist/es/index.js +37 -7
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/CovalentClient.d.ts +1 -1
- package/dist/es/services/TransactionService.d.ts +29 -1
- package/dist/es/services/XykService.d.ts +13 -0
- package/dist/es/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/es/util/types/XykServiceTypes.d.ts +7 -1
- package/dist/esm/index.js +37 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/CovalentClient.d.ts +1 -1
- package/dist/esm/services/TransactionService.d.ts +29 -1
- package/dist/esm/services/XykService.d.ts +13 -0
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/esm/util/types/XykServiceTypes.d.ts +7 -1
- package/dist/services/CovalentClient.d.ts +1 -1
- package/dist/services/CovalentClient.js +1 -1
- package/dist/services/TransactionService.d.ts +29 -1
- package/dist/services/TransactionService.js +22 -1
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +13 -0
- package/dist/services/XykService.js +9 -0
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/util/types/XykServiceTypes.d.ts +7 -1
- package/package.json +1 -1
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$
|
|
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$
|
|
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
|
}
|
|
@@ -6266,6 +6295,7 @@ class TokenV2VolumeWithChartData {
|
|
|
6266
6295
|
this.total_liquidity_quote = data.total_liquidity_quote;
|
|
6267
6296
|
this.total_volume_24h_quote = data.total_volume_24h_quote;
|
|
6268
6297
|
this.transactions_24h = data.transactions_24h;
|
|
6298
|
+
this.explorers = data.explorers && data.explorers !== null ? data.explorers.map((itemData) => new Explorer(itemData)) : null;
|
|
6269
6299
|
this.volume_timeseries_7d = data.volume_timeseries_7d && data.volume_timeseries_7d !== null ? data.volume_timeseries_7d.map((itemData) => new VolumeTokenTimeseries(itemData)) : null;
|
|
6270
6300
|
this.volume_timeseries_30d = data.volume_timeseries_30d && data.volume_timeseries_30d !== null ? data.volume_timeseries_30d.map((itemData) => new VolumeTokenTimeseries(itemData)) : null;
|
|
6271
6301
|
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 +7805,7 @@ class XykService {
|
|
|
7775
7805
|
}
|
|
7776
7806
|
}
|
|
7777
7807
|
|
|
7778
|
-
const userAgent = "com.covalenthq.sdk.typescript/0.8.
|
|
7808
|
+
const userAgent = "com.covalenthq.sdk.typescript/0.8.4";
|
|
7779
7809
|
/**
|
|
7780
7810
|
* CovalentClient Class
|
|
7781
7811
|
*/
|