@covalenthq/client-sdk 0.7.6 → 0.8.1
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/README.md +5 -0
- package/dist/cjs/index.js +2762 -199
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/BalanceService.d.ts +14 -13
- package/dist/cjs/services/BaseService.d.ts +12 -11
- package/dist/cjs/services/CovalentClient.d.ts +5 -3
- package/dist/cjs/services/NftService.d.ts +18 -17
- package/dist/cjs/services/PricingService.d.ts +4 -3
- package/dist/cjs/services/SecurityService.d.ts +5 -4
- package/dist/cjs/services/TransactionService.d.ts +79 -12
- package/dist/cjs/services/XykService.d.ts +226 -15
- package/dist/cjs/util/ApiHelpers.d.ts +2 -1
- package/dist/cjs/util/backoff.d.ts +2 -1
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/cjs/util/types/XykServiceTypes.d.ts +114 -0
- package/dist/es/index.js +2762 -199
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/BalanceService.d.ts +14 -13
- package/dist/es/services/BaseService.d.ts +12 -11
- package/dist/es/services/CovalentClient.d.ts +5 -3
- package/dist/es/services/NftService.d.ts +18 -17
- package/dist/es/services/PricingService.d.ts +4 -3
- package/dist/es/services/SecurityService.d.ts +5 -4
- package/dist/es/services/TransactionService.d.ts +79 -12
- package/dist/es/services/XykService.d.ts +226 -15
- package/dist/es/util/ApiHelpers.d.ts +2 -1
- package/dist/es/util/backoff.d.ts +2 -1
- package/dist/es/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/es/util/types/XykServiceTypes.d.ts +114 -0
- package/dist/esm/index.js +2762 -199
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/BalanceService.d.ts +14 -13
- package/dist/esm/services/BaseService.d.ts +12 -11
- package/dist/esm/services/CovalentClient.d.ts +5 -3
- package/dist/esm/services/NftService.d.ts +18 -17
- package/dist/esm/services/PricingService.d.ts +4 -3
- package/dist/esm/services/SecurityService.d.ts +5 -4
- package/dist/esm/services/TransactionService.d.ts +79 -12
- package/dist/esm/services/XykService.d.ts +226 -15
- package/dist/esm/util/ApiHelpers.d.ts +2 -1
- package/dist/esm/util/backoff.d.ts +2 -1
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/esm/util/types/XykServiceTypes.d.ts +114 -0
- package/dist/services/BalanceService.d.ts +14 -13
- package/dist/services/BalanceService.js +16 -15
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts +12 -11
- package/dist/services/BaseService.js +25 -24
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/CovalentClient.d.ts +5 -3
- package/dist/services/CovalentClient.js +17 -17
- package/dist/services/CovalentClient.js.map +1 -1
- package/dist/services/NftService.d.ts +18 -17
- package/dist/services/NftService.js +30 -29
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.d.ts +4 -3
- package/dist/services/PricingService.js +4 -3
- package/dist/services/PricingService.js.map +1 -1
- package/dist/services/SecurityService.d.ts +5 -4
- package/dist/services/SecurityService.js +6 -5
- package/dist/services/SecurityService.js.map +1 -1
- package/dist/services/TransactionService.d.ts +79 -12
- package/dist/services/TransactionService.js +369 -41
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +226 -15
- package/dist/services/XykService.js +335 -34
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/ApiHelpers.d.ts +2 -1
- package/dist/util/ApiHelpers.js +3 -3
- package/dist/util/ApiHelpers.js.map +1 -1
- package/dist/util/backoff.d.ts +2 -1
- package/dist/util/backoff.js +3 -3
- package/dist/util/backoff.js.map +1 -1
- package/dist/util/types/TransactionServiceTypes.d.ts +11 -0
- package/dist/util/types/XykServiceTypes.d.ts +114 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Chain, Quote, Response } from "./CovalentClient";
|
|
1
|
+
import { Chain, Quote, Response, ChainID, Source } from "./CovalentClient";
|
|
2
2
|
import { Chains } from "../util/Chains";
|
|
3
3
|
declare class TransactionResponse {
|
|
4
4
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -340,6 +340,7 @@ declare class RecentTransactionsResponse {
|
|
|
340
340
|
private _threadCount;
|
|
341
341
|
private _urlParams;
|
|
342
342
|
private _enableRetry;
|
|
343
|
+
private _source;
|
|
343
344
|
/** * The requested address. */
|
|
344
345
|
address: string;
|
|
345
346
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -355,7 +356,7 @@ declare class RecentTransactionsResponse {
|
|
|
355
356
|
links: PaginationLinks;
|
|
356
357
|
/** * List of response items. */
|
|
357
358
|
items: Transaction[];
|
|
358
|
-
constructor(data: RecentTransactionsResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean);
|
|
359
|
+
constructor(data: RecentTransactionsResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean, _source: Source);
|
|
359
360
|
prev(): Promise<Response<RecentTransactionsResponse>>;
|
|
360
361
|
next(): Promise<Response<RecentTransactionsResponse>>;
|
|
361
362
|
}
|
|
@@ -366,6 +367,26 @@ declare class PaginationLinks {
|
|
|
366
367
|
next: string;
|
|
367
368
|
constructor(data: PaginationLinks);
|
|
368
369
|
}
|
|
370
|
+
declare class TransactionsBlockPageResponse {
|
|
371
|
+
private _debug;
|
|
372
|
+
private _apiKey;
|
|
373
|
+
private _threadCount;
|
|
374
|
+
private _urlParams;
|
|
375
|
+
private _enableRetry;
|
|
376
|
+
private _source;
|
|
377
|
+
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
378
|
+
updated_at: Date;
|
|
379
|
+
/** * The requested chain ID eg: `1`. */
|
|
380
|
+
chain_id: number;
|
|
381
|
+
/** * The requested chain name eg: `eth-mainnet`. */
|
|
382
|
+
chain_name: string;
|
|
383
|
+
links: PaginationLinks;
|
|
384
|
+
/** * List of response items. */
|
|
385
|
+
items: Transaction[];
|
|
386
|
+
constructor(data: TransactionsBlockPageResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean, _source: Source);
|
|
387
|
+
prev(): Promise<Response<TransactionsBlockPageResponse>>;
|
|
388
|
+
next(): Promise<Response<TransactionsBlockPageResponse>>;
|
|
389
|
+
}
|
|
369
390
|
declare class TransactionsBlockResponse {
|
|
370
391
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
371
392
|
updated_at: Date;
|
|
@@ -414,6 +435,7 @@ declare class TransactionsResponse {
|
|
|
414
435
|
private _threadCount;
|
|
415
436
|
private _urlParams;
|
|
416
437
|
private _enableRetry;
|
|
438
|
+
private _source;
|
|
417
439
|
/** * The requested address. */
|
|
418
440
|
address: string;
|
|
419
441
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -429,7 +451,7 @@ declare class TransactionsResponse {
|
|
|
429
451
|
links: PaginationLinks;
|
|
430
452
|
/** * List of response items. */
|
|
431
453
|
items: Transaction[];
|
|
432
|
-
constructor(data: TransactionsResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean);
|
|
454
|
+
constructor(data: TransactionsResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean, _source: Source);
|
|
433
455
|
prev(): Promise<Response<TransactionsResponse>>;
|
|
434
456
|
next(): Promise<Response<TransactionsResponse>>;
|
|
435
457
|
}
|
|
@@ -439,6 +461,7 @@ declare class TransactionsTimeBucketResponse {
|
|
|
439
461
|
private _threadCount;
|
|
440
462
|
private _urlParams;
|
|
441
463
|
private _enableRetry;
|
|
464
|
+
private _source;
|
|
442
465
|
/** * The requested address. */
|
|
443
466
|
address: string;
|
|
444
467
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -455,7 +478,7 @@ declare class TransactionsTimeBucketResponse {
|
|
|
455
478
|
links: PaginationLinks;
|
|
456
479
|
/** * List of response items. */
|
|
457
480
|
items: Transaction[];
|
|
458
|
-
constructor(data: TransactionsTimeBucketResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean);
|
|
481
|
+
constructor(data: TransactionsTimeBucketResponse, _debug: boolean, _apiKey: string, _threadCount: number, _urlParams: URLSearchParams, _enableRetry: boolean, _source: Source);
|
|
459
482
|
prev(): Promise<Response<TransactionsTimeBucketResponse>>;
|
|
460
483
|
next(): Promise<Response<TransactionsTimeBucketResponse>>;
|
|
461
484
|
}
|
|
@@ -509,14 +532,31 @@ export interface GetTimeBucketTransactionsForAddressQueryParamOpts {
|
|
|
509
532
|
/** * Include safe details. */
|
|
510
533
|
withSafe?: boolean;
|
|
511
534
|
}
|
|
535
|
+
export interface GetTransactionsForBlockHashByPageQueryParamOpts {
|
|
536
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
537
|
+
quoteCurrency?: Quote;
|
|
538
|
+
/** * Omit log events. */
|
|
539
|
+
noLogs?: boolean;
|
|
540
|
+
/** * Include safe details. */
|
|
541
|
+
withSafe?: boolean;
|
|
542
|
+
}
|
|
543
|
+
export interface GetTransactionsForBlockHashQueryParamOpts {
|
|
544
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
545
|
+
quoteCurrency?: Quote;
|
|
546
|
+
/** * Omit log events. */
|
|
547
|
+
noLogs?: boolean;
|
|
548
|
+
/** * Include safe details. */
|
|
549
|
+
withSafe?: boolean;
|
|
550
|
+
}
|
|
512
551
|
export declare class TransactionService {
|
|
513
552
|
private apiKey;
|
|
514
553
|
private debug;
|
|
515
554
|
private threadCount;
|
|
516
555
|
private is_key_valid;
|
|
517
556
|
private enableRetry;
|
|
557
|
+
private source;
|
|
518
558
|
private LIMIT;
|
|
519
|
-
constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry
|
|
559
|
+
constructor(apiKey: string, debug: boolean, threadCount: number, is_key_valid: boolean, enableRetry: boolean, source: Source);
|
|
520
560
|
/**
|
|
521
561
|
*
|
|
522
562
|
* Commonly used to fetch and render a single transaction including its decoded log events. Additionally return semantically decoded information for DEX trades, lending and NFT sales.
|
|
@@ -532,7 +572,7 @@ export declare class TransactionService {
|
|
|
532
572
|
* - `withSafe`: Include safe details.
|
|
533
573
|
*
|
|
534
574
|
*/
|
|
535
|
-
getTransaction(chainName: Chain | Chains, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<Response<TransactionResponse>>;
|
|
575
|
+
getTransaction(chainName: Chain | Chains | ChainID, txHash: string, queryParamOpts?: GetTransactionQueryParamOpts): Promise<Response<TransactionResponse>>;
|
|
536
576
|
/**
|
|
537
577
|
*
|
|
538
578
|
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
@@ -546,7 +586,7 @@ export declare class TransactionService {
|
|
|
546
586
|
* - `withSafe`: Include safe details.
|
|
547
587
|
*
|
|
548
588
|
*/
|
|
549
|
-
getAllTransactionsForAddress(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<Transaction>;
|
|
589
|
+
getAllTransactionsForAddress(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): AsyncIterable<Transaction>;
|
|
550
590
|
/**
|
|
551
591
|
*
|
|
552
592
|
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
@@ -560,7 +600,7 @@ export declare class TransactionService {
|
|
|
560
600
|
* - `withSafe`: Include safe details.
|
|
561
601
|
*
|
|
562
602
|
*/
|
|
563
|
-
getAllTransactionsForAddressByPage(chainName: Chain | Chains, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise<Response<RecentTransactionsResponse>>;
|
|
603
|
+
getAllTransactionsForAddressByPage(chainName: Chain | Chains | ChainID, walletAddress: string, queryParamOpts?: GetAllTransactionsForAddressQueryParamOpts): Promise<Response<RecentTransactionsResponse>>;
|
|
564
604
|
/**
|
|
565
605
|
*
|
|
566
606
|
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
@@ -573,7 +613,7 @@ export declare class TransactionService {
|
|
|
573
613
|
* - `withSafe`: Include safe details.
|
|
574
614
|
*
|
|
575
615
|
*/
|
|
576
|
-
getTransactionsForBlock(chainName: Chain | Chains, blockHeight: number, queryParamOpts?: GetTransactionsForBlockQueryParamOpts): Promise<Response<TransactionsBlockResponse>>;
|
|
616
|
+
getTransactionsForBlock(chainName: Chain | Chains | ChainID, blockHeight: number | string, queryParamOpts?: GetTransactionsForBlockQueryParamOpts): Promise<Response<TransactionsBlockResponse>>;
|
|
577
617
|
/**
|
|
578
618
|
*
|
|
579
619
|
* Commonly used to fetch the earliest and latest transactions, and the transaction count for a wallet. Calculate the age of the wallet and the time it has been idle and quickly gain insights into their engagement with web3.
|
|
@@ -582,7 +622,7 @@ export declare class TransactionService {
|
|
|
582
622
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
583
623
|
*
|
|
584
624
|
*/
|
|
585
|
-
getTransactionSummary(chainName: Chain | Chains, walletAddress: string): Promise<Response<TransactionsSummaryResponse>>;
|
|
625
|
+
getTransactionSummary(chainName: Chain | Chains | ChainID, walletAddress: string): Promise<Response<TransactionsSummaryResponse>>;
|
|
586
626
|
/**
|
|
587
627
|
*
|
|
588
628
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
@@ -595,7 +635,7 @@ export declare class TransactionService {
|
|
|
595
635
|
* - `withSafe`: Include safe details.
|
|
596
636
|
*
|
|
597
637
|
*/
|
|
598
|
-
getTransactionsForAddressV3(chainName: Chain | Chains, walletAddress: string, page: number, queryParamOpts?: GetTransactionsForAddressV3QueryParamOpts): Promise<Response<TransactionsResponse>>;
|
|
638
|
+
getTransactionsForAddressV3(chainName: Chain | Chains | ChainID, walletAddress: string, page: number, queryParamOpts?: GetTransactionsForAddressV3QueryParamOpts): Promise<Response<TransactionsResponse>>;
|
|
599
639
|
/**
|
|
600
640
|
*
|
|
601
641
|
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
@@ -607,6 +647,33 @@ export declare class TransactionService {
|
|
|
607
647
|
* - `withSafe`: Include safe details.
|
|
608
648
|
*
|
|
609
649
|
*/
|
|
610
|
-
getTimeBucketTransactionsForAddress(chainName: Chain | Chains, walletAddress: string, timeBucket: number, queryParamOpts?: GetTimeBucketTransactionsForAddressQueryParamOpts): Promise<Response<TransactionsTimeBucketResponse>>;
|
|
650
|
+
getTimeBucketTransactionsForAddress(chainName: Chain | Chains | ChainID, walletAddress: string, timeBucket: number, queryParamOpts?: GetTimeBucketTransactionsForAddressQueryParamOpts): Promise<Response<TransactionsTimeBucketResponse>>;
|
|
651
|
+
/**
|
|
652
|
+
*
|
|
653
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
654
|
+
*
|
|
655
|
+
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
656
|
+
* @param {string} blockHash - The requested block hash.
|
|
657
|
+
* @param {number} page - The requested 0-indexed page number.
|
|
658
|
+
* @param {GetTransactionsForBlockHashByPageQueryParamOpts} queryParamOpts
|
|
659
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
660
|
+
* - `noLogs`: Omit log events.
|
|
661
|
+
* - `withSafe`: Include safe details.
|
|
662
|
+
*
|
|
663
|
+
*/
|
|
664
|
+
getTransactionsForBlockHashByPage(chainName: Chain | Chains | ChainID, blockHash: string, page: number, queryParamOpts?: GetTransactionsForBlockHashByPageQueryParamOpts): Promise<Response<TransactionsBlockPageResponse>>;
|
|
665
|
+
/**
|
|
666
|
+
*
|
|
667
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
668
|
+
*
|
|
669
|
+
* @param {string} chainName - The chain name eg: `eth-mainnet`.
|
|
670
|
+
* @param {string} blockHash - The requested block hash.
|
|
671
|
+
* @param {GetTransactionsForBlockHashQueryParamOpts} queryParamOpts
|
|
672
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
673
|
+
* - `noLogs`: Omit log events.
|
|
674
|
+
* - `withSafe`: Include safe details.
|
|
675
|
+
*
|
|
676
|
+
*/
|
|
677
|
+
getTransactionsForBlockHash(chainName: Chain, blockHash: string, queryParamOpts?: GetTransactionsForBlockHashQueryParamOpts): Promise<Response<TransactionsBlockResponse>>;
|
|
611
678
|
}
|
|
612
679
|
export {};
|