@covalenthq/client-sdk 2.2.4 → 2.2.6
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 +357 -356
- package/dist/cjs/index.js +212 -61
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/services/BalanceService.d.ts +2 -2
- package/dist/cjs/src/services/PricingService.d.ts +13 -2
- package/dist/cjs/src/services/TransactionService.d.ts +49 -20
- package/dist/cjs/src/utils/types/BalanceService.types.d.ts +1 -1
- package/dist/cjs/src/utils/types/PricingService.types.d.ts +40 -0
- package/dist/cjs/src/utils/types/TransactionService.types.d.ts +47 -2
- package/dist/esm/index.js +212 -61
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/services/BalanceService.d.ts +2 -2
- package/dist/esm/src/services/PricingService.d.ts +13 -2
- package/dist/esm/src/services/TransactionService.d.ts +49 -20
- package/dist/esm/src/utils/types/BalanceService.types.d.ts +1 -1
- package/dist/esm/src/utils/types/PricingService.types.d.ts +40 -0
- package/dist/esm/src/utils/types/TransactionService.types.d.ts +47 -2
- package/package.json +74 -73
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var version = "2.2.
|
|
3
|
+
var version = "2.2.6";
|
|
4
4
|
|
|
5
5
|
const bigIntParser = (val) => {
|
|
6
6
|
if (val === null || val === undefined) {
|
|
@@ -2304,6 +2304,35 @@ class PricingService {
|
|
|
2304
2304
|
};
|
|
2305
2305
|
return await this.execution.execute(endpoint, parseData);
|
|
2306
2306
|
}
|
|
2307
|
+
/**
|
|
2308
|
+
*
|
|
2309
|
+
* Get the spot token pair prices for a specified pool contract address. Supports pools on Uniswap V2, V3 and their forks.
|
|
2310
|
+
*
|
|
2311
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2312
|
+
* @param {string} contractAddress - The pool contract address.
|
|
2313
|
+
* @param {GetTokenPricesQueryParamOpts} queryParamOpts
|
|
2314
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, `GBP`, `BTC` and `ETH`.
|
|
2315
|
+
*
|
|
2316
|
+
*/
|
|
2317
|
+
async getPoolSpotPrices(chainName, contractAddress, queryParamOpts) {
|
|
2318
|
+
const endpoint = endpointGenerator(`pricing/spot_prices/${chainName}/pools/${contractAddress}`, [
|
|
2319
|
+
{
|
|
2320
|
+
key: "quote-currency",
|
|
2321
|
+
value: queryParamOpts?.quoteCurrency,
|
|
2322
|
+
},
|
|
2323
|
+
]);
|
|
2324
|
+
const parseData = (data) => {
|
|
2325
|
+
if (data.data) {
|
|
2326
|
+
data.data.forEach((dataItem) => {
|
|
2327
|
+
dataItem.updated_at = dataItem.updated_at
|
|
2328
|
+
? new Date(dataItem.updated_at)
|
|
2329
|
+
: null;
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2332
|
+
return data;
|
|
2333
|
+
};
|
|
2334
|
+
return await this.execution.execute(endpoint, parseData);
|
|
2335
|
+
}
|
|
2307
2336
|
}
|
|
2308
2337
|
|
|
2309
2338
|
/**
|
|
@@ -2454,6 +2483,119 @@ class TransactionService {
|
|
|
2454
2483
|
};
|
|
2455
2484
|
return await this.execution.execute(endpoint, parseData);
|
|
2456
2485
|
}
|
|
2486
|
+
/**
|
|
2487
|
+
*
|
|
2488
|
+
* 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.
|
|
2489
|
+
*
|
|
2490
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2491
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
2492
|
+
* @param {GetTransactionSummaryQueryParamOpts} queryParamOpts
|
|
2493
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
2494
|
+
* - `withGas`: Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions.
|
|
2495
|
+
*
|
|
2496
|
+
*/
|
|
2497
|
+
async getTransactionSummary(chainName, walletAddress, queryParamOpts) {
|
|
2498
|
+
const endpoint = endpointGenerator(`${chainName}/address/${walletAddress}/transactions_summary`, [
|
|
2499
|
+
{
|
|
2500
|
+
key: "quote-currency",
|
|
2501
|
+
value: queryParamOpts?.quoteCurrency,
|
|
2502
|
+
},
|
|
2503
|
+
{
|
|
2504
|
+
key: "with-gas",
|
|
2505
|
+
value: queryParamOpts?.withGas,
|
|
2506
|
+
},
|
|
2507
|
+
]);
|
|
2508
|
+
const parseData = (data) => {
|
|
2509
|
+
if (data.data) {
|
|
2510
|
+
data.data.updated_at = data.data.updated_at
|
|
2511
|
+
? new Date(data.data.updated_at)
|
|
2512
|
+
: null;
|
|
2513
|
+
data.data.items = data.data.items
|
|
2514
|
+
? data.data.items.map((txsItem) => ({
|
|
2515
|
+
...txsItem,
|
|
2516
|
+
earliest_transaction: {
|
|
2517
|
+
...txsItem.earliest_transaction,
|
|
2518
|
+
block_signed_at: txsItem?.earliest_transaction?.block_signed_at
|
|
2519
|
+
? new Date(txsItem.earliest_transaction.block_signed_at)
|
|
2520
|
+
: null,
|
|
2521
|
+
},
|
|
2522
|
+
latest_transaction: {
|
|
2523
|
+
...txsItem.latest_transaction,
|
|
2524
|
+
block_signed_at: txsItem?.latest_transaction?.block_signed_at
|
|
2525
|
+
? new Date(txsItem?.latest_transaction?.block_signed_at)
|
|
2526
|
+
: null,
|
|
2527
|
+
},
|
|
2528
|
+
// ? API vs docs non-consistent
|
|
2529
|
+
// gas_summary: {
|
|
2530
|
+
// ...txsItem.gas_summary,
|
|
2531
|
+
// total_fees_paid: bigIntParser(
|
|
2532
|
+
// txsItem.gas_summary.total_fees_paid
|
|
2533
|
+
// ),
|
|
2534
|
+
// },
|
|
2535
|
+
}))
|
|
2536
|
+
: null;
|
|
2537
|
+
}
|
|
2538
|
+
return data;
|
|
2539
|
+
};
|
|
2540
|
+
return await this.execution.execute(endpoint, parseData);
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
*
|
|
2544
|
+
* Commonly used to fetch and render the earliest transactions involving an address. Frequently seen in wallet applications.
|
|
2545
|
+
*
|
|
2546
|
+
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2547
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
2548
|
+
* @param {GetEarliestTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
2549
|
+
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
2550
|
+
* - `noLogs`: Omit log events.
|
|
2551
|
+
*
|
|
2552
|
+
*/
|
|
2553
|
+
async getEarliestTransactionsForAddress(chainName, walletAddress, queryParamOpts) {
|
|
2554
|
+
const searchParams = [
|
|
2555
|
+
{
|
|
2556
|
+
key: "quote-currency",
|
|
2557
|
+
value: queryParamOpts?.quoteCurrency,
|
|
2558
|
+
},
|
|
2559
|
+
{
|
|
2560
|
+
key: "no-logs",
|
|
2561
|
+
value: queryParamOpts?.noLogs,
|
|
2562
|
+
},
|
|
2563
|
+
];
|
|
2564
|
+
const endpoint = endpointGenerator(`${chainName}/bulk/transactions/${walletAddress}`, searchParams);
|
|
2565
|
+
const parseData = (data) => {
|
|
2566
|
+
if (data.data) {
|
|
2567
|
+
data.data.prev = data.data?.links?.prev
|
|
2568
|
+
? async () => this.execution.execute(endpointGenerator(data.data?.links?.prev, searchParams), parseData)
|
|
2569
|
+
: null;
|
|
2570
|
+
data.data.next = data.data?.links?.next
|
|
2571
|
+
? async () => this.execution.execute(endpointGenerator(data.data?.links?.next, searchParams), parseData)
|
|
2572
|
+
: null;
|
|
2573
|
+
data.data.updated_at = data.data.updated_at
|
|
2574
|
+
? new Date(data.data.updated_at)
|
|
2575
|
+
: null;
|
|
2576
|
+
data.data.items = data.data.items
|
|
2577
|
+
? data.data.items.map((txItem) => ({
|
|
2578
|
+
...txItem,
|
|
2579
|
+
value: bigIntParser(txItem.value),
|
|
2580
|
+
fees_paid: bigIntParser(txItem.fees_paid),
|
|
2581
|
+
block_signed_at: txItem.block_signed_at
|
|
2582
|
+
? new Date(txItem.block_signed_at)
|
|
2583
|
+
: null,
|
|
2584
|
+
log_events: txItem.log_events
|
|
2585
|
+
? txItem.log_events.map((logItem) => ({
|
|
2586
|
+
...logItem,
|
|
2587
|
+
block_signed_at: logItem.block_signed_at
|
|
2588
|
+
? new Date(logItem.block_signed_at)
|
|
2589
|
+
: null,
|
|
2590
|
+
}))
|
|
2591
|
+
: null,
|
|
2592
|
+
}))
|
|
2593
|
+
: null;
|
|
2594
|
+
}
|
|
2595
|
+
return data;
|
|
2596
|
+
};
|
|
2597
|
+
return await this.execution.execute(endpoint, parseData);
|
|
2598
|
+
}
|
|
2457
2599
|
/**
|
|
2458
2600
|
*
|
|
2459
2601
|
* Commonly used to fetch and render the most recent transactions involving an address. Frequently seen in wallet applications.
|
|
@@ -2604,18 +2746,18 @@ class TransactionService {
|
|
|
2604
2746
|
return await this.execution.execute(endpoint, parseData);
|
|
2605
2747
|
}
|
|
2606
2748
|
/**
|
|
2607
|
-
*
|
|
2608
|
-
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
2609
2749
|
*
|
|
2610
2750
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2611
|
-
* @param {
|
|
2612
|
-
* @param {
|
|
2751
|
+
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
2752
|
+
* @param {number} page - The requested page, 0-indexed.
|
|
2753
|
+
* @param {getPaginatedTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
2613
2754
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
2614
2755
|
* - `noLogs`: Omit log events.
|
|
2756
|
+
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
2615
2757
|
*
|
|
2616
2758
|
*/
|
|
2617
|
-
async
|
|
2618
|
-
const
|
|
2759
|
+
async getPaginatedTransactionsForAddress(chainName, walletAddress, page, queryParamOpts) {
|
|
2760
|
+
const searchParams = [
|
|
2619
2761
|
{
|
|
2620
2762
|
key: "quote-currency",
|
|
2621
2763
|
value: queryParamOpts?.quoteCurrency,
|
|
@@ -2624,9 +2766,20 @@ class TransactionService {
|
|
|
2624
2766
|
key: "no-logs",
|
|
2625
2767
|
value: queryParamOpts?.noLogs,
|
|
2626
2768
|
},
|
|
2627
|
-
|
|
2769
|
+
{
|
|
2770
|
+
key: "block-signed-at-asc",
|
|
2771
|
+
value: queryParamOpts?.blockSignedAtAsc,
|
|
2772
|
+
},
|
|
2773
|
+
];
|
|
2774
|
+
const endpoint = endpointGenerator(`${chainName}/address/${walletAddress}/transactions_v3/page/${page}`, searchParams);
|
|
2628
2775
|
const parseData = (data) => {
|
|
2629
2776
|
if (data.data) {
|
|
2777
|
+
data.data.prev = data.data?.links?.prev
|
|
2778
|
+
? async () => this.execution.execute(endpointGenerator(data.data?.links?.prev, searchParams), parseData)
|
|
2779
|
+
: null;
|
|
2780
|
+
data.data.next = data.data?.links?.next
|
|
2781
|
+
? async () => this.execution.execute(endpointGenerator(data.data?.links?.next, searchParams), parseData)
|
|
2782
|
+
: null;
|
|
2630
2783
|
data.data.updated_at = data.data.updated_at
|
|
2631
2784
|
? new Date(data.data.updated_at)
|
|
2632
2785
|
: null;
|
|
@@ -2654,54 +2807,54 @@ class TransactionService {
|
|
|
2654
2807
|
return await this.execution.execute(endpoint, parseData);
|
|
2655
2808
|
}
|
|
2656
2809
|
/**
|
|
2657
|
-
*
|
|
2658
|
-
* 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.
|
|
2659
2810
|
*
|
|
2660
2811
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2661
2812
|
* @param {string} walletAddress - The requested address. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically.
|
|
2662
|
-
* @param {
|
|
2813
|
+
* @param {number} timeBucket - The 0-indexed 15-minute time bucket. E.g. 27 Feb 2023 05:23 GMT = 1677475383 (Unix time). 1677475383/900=1863861 timeBucket.
|
|
2814
|
+
* @param {GetTimeBucketTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
2663
2815
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
2664
|
-
* - `
|
|
2816
|
+
* - `noLogs`: Omit log events.
|
|
2665
2817
|
*
|
|
2666
2818
|
*/
|
|
2667
|
-
async
|
|
2668
|
-
const
|
|
2819
|
+
async getTimeBucketTransactionsForAddress(chainName, walletAddress, timeBucket, queryParamOpts) {
|
|
2820
|
+
const searchParams = [
|
|
2669
2821
|
{
|
|
2670
2822
|
key: "quote-currency",
|
|
2671
2823
|
value: queryParamOpts?.quoteCurrency,
|
|
2672
2824
|
},
|
|
2673
2825
|
{
|
|
2674
|
-
key: "
|
|
2675
|
-
value: queryParamOpts?.
|
|
2826
|
+
key: "no-logs",
|
|
2827
|
+
value: queryParamOpts?.noLogs,
|
|
2676
2828
|
},
|
|
2677
|
-
]
|
|
2829
|
+
];
|
|
2830
|
+
const endpoint = endpointGenerator(`${chainName}/bulk/transactions/${walletAddress}/${timeBucket}`, searchParams);
|
|
2678
2831
|
const parseData = (data) => {
|
|
2679
2832
|
if (data.data) {
|
|
2833
|
+
data.data.prev = data.data?.links?.prev
|
|
2834
|
+
? async () => this.execution.execute(endpointGenerator(data.data?.links?.prev, searchParams), parseData)
|
|
2835
|
+
: null;
|
|
2836
|
+
data.data.next = data.data?.links?.next
|
|
2837
|
+
? async () => this.execution.execute(endpointGenerator(data.data?.links?.next, searchParams), parseData)
|
|
2838
|
+
: null;
|
|
2680
2839
|
data.data.updated_at = data.data.updated_at
|
|
2681
2840
|
? new Date(data.data.updated_at)
|
|
2682
2841
|
: null;
|
|
2683
2842
|
data.data.items = data.data.items
|
|
2684
|
-
? data.data.items.map((
|
|
2685
|
-
...
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
// gas_summary: {
|
|
2700
|
-
// ...txsItem.gas_summary,
|
|
2701
|
-
// total_fees_paid: bigIntParser(
|
|
2702
|
-
// txsItem.gas_summary.total_fees_paid
|
|
2703
|
-
// ),
|
|
2704
|
-
// },
|
|
2843
|
+
? data.data.items.map((txItem) => ({
|
|
2844
|
+
...txItem,
|
|
2845
|
+
value: bigIntParser(txItem.value),
|
|
2846
|
+
fees_paid: bigIntParser(txItem.fees_paid),
|
|
2847
|
+
block_signed_at: txItem.block_signed_at
|
|
2848
|
+
? new Date(txItem.block_signed_at)
|
|
2849
|
+
: null,
|
|
2850
|
+
log_events: txItem.log_events
|
|
2851
|
+
? txItem.log_events.map((logItem) => ({
|
|
2852
|
+
...logItem,
|
|
2853
|
+
block_signed_at: logItem.block_signed_at
|
|
2854
|
+
? new Date(logItem.block_signed_at)
|
|
2855
|
+
: null,
|
|
2856
|
+
}))
|
|
2857
|
+
: null,
|
|
2705
2858
|
}))
|
|
2706
2859
|
: null;
|
|
2707
2860
|
}
|
|
@@ -2710,17 +2863,18 @@ class TransactionService {
|
|
|
2710
2863
|
return await this.execution.execute(endpoint, parseData);
|
|
2711
2864
|
}
|
|
2712
2865
|
/**
|
|
2866
|
+
*
|
|
2867
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
2713
2868
|
*
|
|
2714
2869
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2715
|
-
* @param {
|
|
2870
|
+
* @param {number} blockHeight - The requested block height.
|
|
2716
2871
|
* @param {number} page - The requested page, 0-indexed.
|
|
2717
|
-
* @param {
|
|
2872
|
+
* @param {getTransactionsForBlockByPageQueryParamOpts} queryParamOpts
|
|
2718
2873
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
2719
2874
|
* - `noLogs`: Omit log events.
|
|
2720
|
-
* - `blockSignedAtAsc`: Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order.
|
|
2721
2875
|
*
|
|
2722
2876
|
*/
|
|
2723
|
-
async
|
|
2877
|
+
async getTransactionsForBlockByPage(chainName, blockHeight, page, queryParamOpts) {
|
|
2724
2878
|
const searchParams = [
|
|
2725
2879
|
{
|
|
2726
2880
|
key: "quote-currency",
|
|
@@ -2730,23 +2884,19 @@ class TransactionService {
|
|
|
2730
2884
|
key: "no-logs",
|
|
2731
2885
|
value: queryParamOpts?.noLogs,
|
|
2732
2886
|
},
|
|
2733
|
-
{
|
|
2734
|
-
key: "block-signed-at-asc",
|
|
2735
|
-
value: queryParamOpts?.blockSignedAtAsc,
|
|
2736
|
-
},
|
|
2737
2887
|
];
|
|
2738
|
-
const endpoint = endpointGenerator(`${chainName}/
|
|
2888
|
+
const endpoint = endpointGenerator(`${chainName}/block/${blockHeight}/transactions_v3/page/${page}`, searchParams);
|
|
2739
2889
|
const parseData = (data) => {
|
|
2740
2890
|
if (data.data) {
|
|
2891
|
+
data.data.updated_at = data.data.updated_at
|
|
2892
|
+
? new Date(data.data.updated_at)
|
|
2893
|
+
: null;
|
|
2741
2894
|
data.data.prev = data.data?.links?.prev
|
|
2742
2895
|
? async () => this.execution.execute(endpointGenerator(data.data?.links?.prev, searchParams), parseData)
|
|
2743
2896
|
: null;
|
|
2744
2897
|
data.data.next = data.data?.links?.next
|
|
2745
2898
|
? async () => this.execution.execute(endpointGenerator(data.data?.links?.next, searchParams), parseData)
|
|
2746
2899
|
: null;
|
|
2747
|
-
data.data.updated_at = data.data.updated_at
|
|
2748
|
-
? new Date(data.data.updated_at)
|
|
2749
|
-
: null;
|
|
2750
2900
|
data.data.items = data.data.items
|
|
2751
2901
|
? data.data.items.map((txItem) => ({
|
|
2752
2902
|
...txItem,
|
|
@@ -2771,16 +2921,17 @@ class TransactionService {
|
|
|
2771
2921
|
return await this.execution.execute(endpoint, parseData);
|
|
2772
2922
|
}
|
|
2773
2923
|
/**
|
|
2924
|
+
*
|
|
2925
|
+
* Commonly used to fetch all transactions including their decoded log events in a block and further flag interesting wallets or transactions.
|
|
2774
2926
|
*
|
|
2775
2927
|
* @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1.
|
|
2776
|
-
* @param {string}
|
|
2777
|
-
* @param {
|
|
2778
|
-
* @param {GetTimeBucketTransactionsForAddressQueryParamOpts} queryParamOpts
|
|
2928
|
+
* @param {string} blockHash - The requested block hash.
|
|
2929
|
+
* @param {getTransactionsForBlockByPageQueryParamOpts} queryParamOpts
|
|
2779
2930
|
* - `quoteCurrency`: The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`.
|
|
2780
2931
|
* - `noLogs`: Omit log events.
|
|
2781
2932
|
*
|
|
2782
2933
|
*/
|
|
2783
|
-
async
|
|
2934
|
+
async getTransactionsForBlock(chainName, blockHash, queryParamOpts) {
|
|
2784
2935
|
const searchParams = [
|
|
2785
2936
|
{
|
|
2786
2937
|
key: "quote-currency",
|
|
@@ -2791,15 +2942,9 @@ class TransactionService {
|
|
|
2791
2942
|
value: queryParamOpts?.noLogs,
|
|
2792
2943
|
},
|
|
2793
2944
|
];
|
|
2794
|
-
const endpoint = endpointGenerator(`${chainName}/
|
|
2945
|
+
const endpoint = endpointGenerator(`${chainName}/block_hash/${blockHash}/transactions_v3`, searchParams);
|
|
2795
2946
|
const parseData = (data) => {
|
|
2796
2947
|
if (data.data) {
|
|
2797
|
-
data.data.prev = data.data?.links?.prev
|
|
2798
|
-
? async () => this.execution.execute(endpointGenerator(data.data?.links?.prev, searchParams), parseData)
|
|
2799
|
-
: null;
|
|
2800
|
-
data.data.next = data.data?.links?.next
|
|
2801
|
-
? async () => this.execution.execute(endpointGenerator(data.data?.links?.next, searchParams), parseData)
|
|
2802
|
-
: null;
|
|
2803
2948
|
data.data.updated_at = data.data.updated_at
|
|
2804
2949
|
? new Date(data.data.updated_at)
|
|
2805
2950
|
: null;
|
|
@@ -2826,6 +2971,12 @@ class TransactionService {
|
|
|
2826
2971
|
};
|
|
2827
2972
|
return await this.execution.execute(endpoint, parseData);
|
|
2828
2973
|
}
|
|
2974
|
+
/**
|
|
2975
|
+
* @deprecated This method has been deprecated and will be removed in future releases. Use `getPaginatedTransactionsForAddress` instead.
|
|
2976
|
+
*/
|
|
2977
|
+
async getTransactionsForAddressV3(chainName, walletAddress, page, queryParamOpts) {
|
|
2978
|
+
return this.getPaginatedTransactionsForAddress(chainName, walletAddress, page, queryParamOpts);
|
|
2979
|
+
}
|
|
2829
2980
|
}
|
|
2830
2981
|
|
|
2831
2982
|
async function debugOutput(settings, ...content) {
|