@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.
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +38 -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 +15 -0
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/cjs/util/types/XykServiceTypes.d.ts +9 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +38 -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 +15 -0
- package/dist/es/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/es/util/types/XykServiceTypes.d.ts +9 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +38 -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 +15 -0
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +18 -0
- package/dist/esm/util/types/XykServiceTypes.d.ts +9 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -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 +15 -0
- package/dist/services/XykService.js +10 -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 +9 -1
- package/package.json +1 -1
|
@@ -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";
|
|
12
|
-
export declare const userAgent = "com.covalenthq.sdk.typescript/0.8.
|
|
12
|
+
export declare const userAgent = "com.covalenthq.sdk.typescript/0.8.5";
|
|
13
13
|
export declare class Response<T> {
|
|
14
14
|
data: T;
|
|
15
15
|
error: boolean;
|
|
@@ -411,6 +411,23 @@ declare class TransactionsSummaryResponse {
|
|
|
411
411
|
items: TransactionsSummary[];
|
|
412
412
|
constructor(data: TransactionsSummaryResponse);
|
|
413
413
|
}
|
|
414
|
+
declare class GasSummary {
|
|
415
|
+
/** * The total number of transactions sent by the address. */
|
|
416
|
+
total_sent_count: number;
|
|
417
|
+
/** * The total transaction fees paid by the address, denoted in wei. */
|
|
418
|
+
total_fees_paid: bigint | null;
|
|
419
|
+
/** * The total transaction fees paid by the address, denoted in `quote-currency`. */
|
|
420
|
+
total_gas_quote: number;
|
|
421
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
422
|
+
pretty_total_gas_quote: string;
|
|
423
|
+
/** * The average gas quote per transaction. */
|
|
424
|
+
average_gas_quote_per_tx: number;
|
|
425
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
426
|
+
pretty_average_gas_quote_per_tx: string;
|
|
427
|
+
/** * The requested chain native gas token metadata. */
|
|
428
|
+
gas_metadata: ContractMetadata;
|
|
429
|
+
constructor(data: GasSummary);
|
|
430
|
+
}
|
|
414
431
|
declare class TransactionsSummary {
|
|
415
432
|
/** * The total number of transactions. */
|
|
416
433
|
total_count: number;
|
|
@@ -418,6 +435,8 @@ declare class TransactionsSummary {
|
|
|
418
435
|
earliest_transaction: TransactionSummary;
|
|
419
436
|
/** * The latest transaction detected. */
|
|
420
437
|
latest_transaction: TransactionSummary;
|
|
438
|
+
/** * The gas summary for the transactions. */
|
|
439
|
+
gas_summary: GasSummary;
|
|
421
440
|
constructor(data: TransactionsSummary);
|
|
422
441
|
}
|
|
423
442
|
declare class TransactionSummary {
|
|
@@ -548,6 +567,12 @@ export interface GetTransactionsForBlockHashQueryParamOpts {
|
|
|
548
567
|
/** * Include safe details. */
|
|
549
568
|
withSafe?: boolean;
|
|
550
569
|
}
|
|
570
|
+
export interface GetTransactionSummaryQueryParamOpts {
|
|
571
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
572
|
+
quoteCurrency?: Quote;
|
|
573
|
+
/** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
|
|
574
|
+
withGas?: boolean;
|
|
575
|
+
}
|
|
551
576
|
export declare class TransactionService {
|
|
552
577
|
private apiKey;
|
|
553
578
|
private debug;
|
|
@@ -620,9 +645,12 @@ export declare class TransactionService {
|
|
|
620
645
|
*
|
|
621
646
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
622
647
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
648
|
+
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
649
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
650
|
+
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
623
651
|
*
|
|
624
652
|
*/
|
|
625
|
-
getTransactionSummary(chainName: Chain | Chains | ChainID, walletAddress: string): Promise<Response<TransactionsSummaryResponse>>;
|
|
653
|
+
getTransactionSummary(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetTransactionSummaryQueryParamOpts): Promise<Response<TransactionsSummaryResponse>>;
|
|
626
654
|
/**
|
|
627
655
|
*
|
|
628
656
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
@@ -56,6 +56,13 @@ declare class Pagination {
|
|
|
56
56
|
total_count: number;
|
|
57
57
|
constructor(data: Pagination);
|
|
58
58
|
}
|
|
59
|
+
declare class Explorer {
|
|
60
|
+
/** * The name of the explorer. */
|
|
61
|
+
label: string;
|
|
62
|
+
/** * The URL of the explorer. */
|
|
63
|
+
url: string;
|
|
64
|
+
constructor(data: Explorer);
|
|
65
|
+
}
|
|
59
66
|
declare class Token {
|
|
60
67
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
61
68
|
contract_address: string;
|
|
@@ -126,6 +133,8 @@ declare class PoolByAddressResponse {
|
|
|
126
133
|
declare class PoolWithTimeseries {
|
|
127
134
|
/** * The pair address. */
|
|
128
135
|
exchange: string;
|
|
136
|
+
/** * A list of explorers for this address. */
|
|
137
|
+
explorers: Explorer[];
|
|
129
138
|
swap_count_24h: string;
|
|
130
139
|
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
131
140
|
total_liquidity_quote: string;
|
|
@@ -246,6 +255,8 @@ declare class PoolsDexDataItem {
|
|
|
246
255
|
exchange_ticker_symbol: string;
|
|
247
256
|
/** * The dex logo URL for the pair address. */
|
|
248
257
|
exchange_logo_url: string;
|
|
258
|
+
/** * The list of explorers for the token address. */
|
|
259
|
+
explorers: Explorer[];
|
|
249
260
|
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
250
261
|
total_liquidity_quote: number;
|
|
251
262
|
/** * A prettier version of the total liquidity quote for rendering purposes. */
|
|
@@ -377,6 +388,8 @@ declare class TokenV2Volume {
|
|
|
377
388
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
378
389
|
contract_decimals: number;
|
|
379
390
|
swap_count_24h: number;
|
|
391
|
+
/** * The list of explorers for the token address. */
|
|
392
|
+
explorers: Explorer[];
|
|
380
393
|
/** * The exchange rate for the requested quote currency. */
|
|
381
394
|
quote_rate: number;
|
|
382
395
|
/** * The 24h exchange rate for the requested quote currency. */
|
|
@@ -419,6 +432,8 @@ declare class TokenV2VolumeWithChartData {
|
|
|
419
432
|
contract_address: string;
|
|
420
433
|
/** * The string returned by the `name()` method. */
|
|
421
434
|
contract_name: string;
|
|
435
|
+
/** * A list of explorers for this address. */
|
|
436
|
+
explorers: Explorer[];
|
|
422
437
|
/** * The total liquidity unscaled value. */
|
|
423
438
|
total_liquidity: number;
|
|
424
439
|
/** * The total volume 24h unscaled value. */
|
|
@@ -331,6 +331,8 @@ export interface TransactionsSummary {
|
|
|
331
331
|
earliest_transaction: TransactionSummary;
|
|
332
332
|
/** * The latest transaction detected. */
|
|
333
333
|
latest_transaction: TransactionSummary;
|
|
334
|
+
/** * The gas summary for the transactions. */
|
|
335
|
+
gas_summary: GasSummary;
|
|
334
336
|
}
|
|
335
337
|
export interface TransactionSummary {
|
|
336
338
|
/** * The block signed timestamp in UTC. */
|
|
@@ -368,3 +370,19 @@ export interface TransactionsBlockPageResponse {
|
|
|
368
370
|
/** * List of response items. */
|
|
369
371
|
items: Transaction[];
|
|
370
372
|
}
|
|
373
|
+
export interface GasSummary {
|
|
374
|
+
/** * The total number of transactions sent by the address. */
|
|
375
|
+
total_sent_count: number;
|
|
376
|
+
/** * The total transaction fees paid by the address, denoted in wei. */
|
|
377
|
+
total_fees_paid: bigint | null;
|
|
378
|
+
/** * The total transaction fees paid by the address, denoted in `quote-currency`. */
|
|
379
|
+
total_gas_quote: number;
|
|
380
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
381
|
+
pretty_total_gas_quote: string;
|
|
382
|
+
/** * The average gas quote per transaction. */
|
|
383
|
+
average_gas_quote_per_tx: number;
|
|
384
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
385
|
+
pretty_average_gas_quote_per_tx: string;
|
|
386
|
+
/** * The requested chain native gas token metadata. */
|
|
387
|
+
gas_metadata: ContractMetadata;
|
|
388
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Pagination, ContractMetadata } from "./GenericTypes";
|
|
1
|
+
import { Pagination, ContractMetadata, Explorer } from "./GenericTypes";
|
|
2
2
|
export interface PoolResponse {
|
|
3
3
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
4
4
|
updated_at: Date;
|
|
@@ -107,6 +107,8 @@ export interface PoolByAddressResponse {
|
|
|
107
107
|
export interface PoolWithTimeseries {
|
|
108
108
|
/** * The pair address. */
|
|
109
109
|
exchange: string;
|
|
110
|
+
/** * A list of explorers for this address. */
|
|
111
|
+
explorers: Explorer[];
|
|
110
112
|
swap_count_24h: string;
|
|
111
113
|
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
112
114
|
total_liquidity_quote: string;
|
|
@@ -222,6 +224,8 @@ export interface PoolsDexDataItem {
|
|
|
222
224
|
exchange_ticker_symbol: string;
|
|
223
225
|
/** * The dex logo URL for the pair address. */
|
|
224
226
|
exchange_logo_url: string;
|
|
227
|
+
/** * The list of explorers for the token address. */
|
|
228
|
+
explorers: Explorer[];
|
|
225
229
|
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
226
230
|
total_liquidity_quote: number;
|
|
227
231
|
/** * A prettier version of the total liquidity quote for rendering purposes. */
|
|
@@ -346,6 +350,8 @@ export interface TokenV2Volume {
|
|
|
346
350
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
347
351
|
contract_decimals: number;
|
|
348
352
|
swap_count_24h: number;
|
|
353
|
+
/** * The list of explorers for the token address. */
|
|
354
|
+
explorers: Explorer[];
|
|
349
355
|
/** * The exchange rate for the requested quote currency. */
|
|
350
356
|
quote_rate: number;
|
|
351
357
|
/** * The 24h exchange rate for the requested quote currency. */
|
|
@@ -384,6 +390,8 @@ export interface TokenV2VolumeWithChartData {
|
|
|
384
390
|
dex_name: string;
|
|
385
391
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
386
392
|
contract_address: string;
|
|
393
|
+
/** * The list of explorers for the token address. */
|
|
394
|
+
explorers: Explorer[];
|
|
387
395
|
/** * The string returned by the `name()` method. */
|
|
388
396
|
contract_name: string;
|
|
389
397
|
/** * The total liquidity unscaled value. */
|
package/dist/index.d.ts
CHANGED
|
@@ -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/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAiD,MAAM,2BAA2B,CAAC;AAClH,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -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";
|
|
12
|
-
export declare const userAgent = "com.covalenthq.sdk.typescript/0.8.
|
|
12
|
+
export declare const userAgent = "com.covalenthq.sdk.typescript/0.8.5";
|
|
13
13
|
export declare class Response<T> {
|
|
14
14
|
data: T;
|
|
15
15
|
error: boolean;
|
|
@@ -6,7 +6,7 @@ import { PricingService } from "./PricingService";
|
|
|
6
6
|
import { TransactionService } from "./TransactionService";
|
|
7
7
|
import { XykService } from "./XykService";
|
|
8
8
|
import { ApiKeyValidator } from "../util/ApiKeyValidator";
|
|
9
|
-
export const userAgent = "com.covalenthq.sdk.typescript/0.8.
|
|
9
|
+
export const userAgent = "com.covalenthq.sdk.typescript/0.8.5";
|
|
10
10
|
export class Response {
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -411,6 +411,23 @@ declare class TransactionsSummaryResponse {
|
|
|
411
411
|
items: TransactionsSummary[];
|
|
412
412
|
constructor(data: TransactionsSummaryResponse);
|
|
413
413
|
}
|
|
414
|
+
declare class GasSummary {
|
|
415
|
+
/** * The total number of transactions sent by the address. */
|
|
416
|
+
total_sent_count: number;
|
|
417
|
+
/** * The total transaction fees paid by the address, denoted in wei. */
|
|
418
|
+
total_fees_paid: bigint | null;
|
|
419
|
+
/** * The total transaction fees paid by the address, denoted in `quote-currency`. */
|
|
420
|
+
total_gas_quote: number;
|
|
421
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
422
|
+
pretty_total_gas_quote: string;
|
|
423
|
+
/** * The average gas quote per transaction. */
|
|
424
|
+
average_gas_quote_per_tx: number;
|
|
425
|
+
/** * A prettier version of the quote for rendering purposes. */
|
|
426
|
+
pretty_average_gas_quote_per_tx: string;
|
|
427
|
+
/** * The requested chain native gas token metadata. */
|
|
428
|
+
gas_metadata: ContractMetadata;
|
|
429
|
+
constructor(data: GasSummary);
|
|
430
|
+
}
|
|
414
431
|
declare class TransactionsSummary {
|
|
415
432
|
/** * The total number of transactions. */
|
|
416
433
|
total_count: number;
|
|
@@ -418,6 +435,8 @@ declare class TransactionsSummary {
|
|
|
418
435
|
earliest_transaction: TransactionSummary;
|
|
419
436
|
/** * The latest transaction detected. */
|
|
420
437
|
latest_transaction: TransactionSummary;
|
|
438
|
+
/** * The gas summary for the transactions. */
|
|
439
|
+
gas_summary: GasSummary;
|
|
421
440
|
constructor(data: TransactionsSummary);
|
|
422
441
|
}
|
|
423
442
|
declare class TransactionSummary {
|
|
@@ -548,6 +567,12 @@ export interface GetTransactionsForBlockHashQueryParamOpts {
|
|
|
548
567
|
/** * Include safe details. */
|
|
549
568
|
withSafe?: boolean;
|
|
550
569
|
}
|
|
570
|
+
export interface GetTransactionSummaryQueryParamOpts {
|
|
571
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
572
|
+
quoteCurrency?: Quote;
|
|
573
|
+
/** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
|
|
574
|
+
withGas?: boolean;
|
|
575
|
+
}
|
|
551
576
|
export declare class TransactionService {
|
|
552
577
|
private apiKey;
|
|
553
578
|
private debug;
|
|
@@ -620,9 +645,12 @@ export declare class TransactionService {
|
|
|
620
645
|
*
|
|
621
646
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
622
647
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
648
|
+
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
649
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
650
|
+
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
623
651
|
*
|
|
624
652
|
*/
|
|
625
|
-
getTransactionSummary(chainName: Chain | Chains | ChainID, walletAddress: string): Promise<Response<TransactionsSummaryResponse>>;
|
|
653
|
+
getTransactionSummary(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetTransactionSummaryQueryParamOpts): Promise<Response<TransactionsSummaryResponse>>;
|
|
626
654
|
/**
|
|
627
655
|
*
|
|
628
656
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
@@ -541,11 +541,23 @@ class TransactionsSummaryResponse {
|
|
|
541
541
|
this.items = data.items && data.items !== null ? data.items.map((itemData) => new TransactionsSummary(itemData)) : null;
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
+
class GasSummary {
|
|
545
|
+
constructor(data) {
|
|
546
|
+
this.total_sent_count = data.total_sent_count;
|
|
547
|
+
this.total_fees_paid = data.total_fees_paid && data.total_fees_paid !== null ? BigInt(data.total_fees_paid) : null;
|
|
548
|
+
this.total_gas_quote = data.total_gas_quote;
|
|
549
|
+
this.pretty_total_gas_quote = data.pretty_total_gas_quote;
|
|
550
|
+
this.average_gas_quote_per_tx = data.average_gas_quote_per_tx;
|
|
551
|
+
this.pretty_average_gas_quote_per_tx = data.pretty_average_gas_quote_per_tx;
|
|
552
|
+
this.gas_metadata = data.gas_metadata && data.gas_metadata !== null ? new ContractMetadata(data.gas_metadata) : null;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
544
555
|
class TransactionsSummary {
|
|
545
556
|
constructor(data) {
|
|
546
557
|
this.total_count = data.total_count;
|
|
547
558
|
this.earliest_transaction = data.earliest_transaction && data.earliest_transaction !== null ? new TransactionSummary(data.earliest_transaction) : null;
|
|
548
559
|
this.latest_transaction = data.latest_transaction && data.latest_transaction !== null ? new TransactionSummary(data.latest_transaction) : null;
|
|
560
|
+
this.gas_summary = data.gas_summary && data.gas_summary !== null ? new GasSummary(data.gas_summary) : null;
|
|
549
561
|
}
|
|
550
562
|
}
|
|
551
563
|
class TransactionSummary {
|
|
@@ -1258,9 +1270,12 @@ export class TransactionService {
|
|
|
1258
1270
|
*
|
|
1259
1271
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
1260
1272
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
1273
|
+
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
1274
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
1275
|
+
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
1261
1276
|
*
|
|
1262
1277
|
*/
|
|
1263
|
-
async getTransactionSummary(chainName, walletAddress) {
|
|
1278
|
+
async getTransactionSummary(chainName, walletAddress, queryParamOpts) {
|
|
1264
1279
|
let success = false;
|
|
1265
1280
|
let data;
|
|
1266
1281
|
let response;
|
|
@@ -1276,6 +1291,12 @@ export class TransactionService {
|
|
|
1276
1291
|
error_message: ApiKeyValidator.INVALID_API_KEY_MESSAGE
|
|
1277
1292
|
};
|
|
1278
1293
|
}
|
|
1294
|
+
if (queryParamOpts?.quoteCurrency !== undefined) {
|
|
1295
|
+
urlParams.append("quote-currency", queryParamOpts?.quoteCurrency.toString());
|
|
1296
|
+
}
|
|
1297
|
+
if (queryParamOpts?.withGas !== undefined) {
|
|
1298
|
+
urlParams.append("with-gas", queryParamOpts?.withGas.toString());
|
|
1299
|
+
}
|
|
1279
1300
|
let startTime;
|
|
1280
1301
|
if (this.debug) {
|
|
1281
1302
|
startTime = new Date();
|