@covalenthq/client-sdk 1.0.2 → 2.0.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/LICENSE +201 -0
- package/README.md +223 -282
- package/dist/cjs/index.d.ts +17 -20
- package/dist/cjs/index.js +2331 -7659
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/GoldRushClient.d.ts +20 -0
- package/dist/cjs/src/services/BalanceService.d.ts +125 -0
- package/dist/cjs/src/services/BaseService.d.ts +161 -0
- package/dist/cjs/src/services/NftService.d.ts +157 -0
- package/dist/cjs/src/services/PricingService.d.ts +25 -0
- package/dist/cjs/src/services/SecurityService.d.ts +28 -0
- package/dist/cjs/src/services/TransactionService.d.ts +128 -0
- package/dist/cjs/src/utils/functions/bigIntParser.d.ts +1 -0
- package/dist/cjs/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts} +0 -0
- package/dist/cjs/src/utils/functions/debugOutput.d.ts +2 -0
- package/dist/cjs/src/utils/functions/endpointGenerator.d.ts +4 -0
- package/dist/cjs/src/utils/functions/execution.d.ts +11 -0
- package/dist/cjs/src/utils/functions/isValidApiKey.d.ts +1 -0
- package/dist/cjs/src/utils/functions/paginateEndpoint.d.ts +7 -0
- package/dist/cjs/src/utils/functions/prettifyCurrency.d.ts +2 -0
- package/dist/{esm/util/types/BalanceServiceTypes.d.ts → cjs/src/utils/types/BalanceService.types.d.ts} +91 -27
- package/dist/{es/util/types/BaseServiceTypes.d.ts → cjs/src/utils/types/BaseService.types.d.ts} +68 -18
- package/dist/cjs/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/{esm/util/types/NftServiceTypes.d.ts → cjs/src/utils/types/NftService.types.d.ts} +53 -83
- package/dist/cjs/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts} +9 -3
- package/dist/{esm/util/types/SecurityServiceTypes.d.ts → cjs/src/utils/types/SecurityService.types.d.ts} +8 -7
- package/dist/{esm/util/types/TransactionServiceTypes.d.ts → cjs/src/utils/types/TransactionService.types.d.ts} +110 -24
- package/dist/es/index.d.ts +17 -20
- package/dist/es/index.js +2327 -7649
- package/dist/es/index.js.map +1 -1
- package/dist/es/src/GoldRushClient.d.ts +20 -0
- package/dist/es/src/services/BalanceService.d.ts +125 -0
- package/dist/es/src/services/BaseService.d.ts +161 -0
- package/dist/es/src/services/NftService.d.ts +157 -0
- package/dist/es/src/services/PricingService.d.ts +25 -0
- package/dist/es/src/services/SecurityService.d.ts +28 -0
- package/dist/es/src/services/TransactionService.d.ts +128 -0
- package/dist/es/src/utils/functions/bigIntParser.d.ts +1 -0
- package/dist/es/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts} +0 -0
- package/dist/es/src/utils/functions/debugOutput.d.ts +2 -0
- package/dist/es/src/utils/functions/endpointGenerator.d.ts +4 -0
- package/dist/es/src/utils/functions/execution.d.ts +11 -0
- package/dist/es/src/utils/functions/isValidApiKey.d.ts +1 -0
- package/dist/es/src/utils/functions/paginateEndpoint.d.ts +7 -0
- package/dist/es/src/utils/functions/prettifyCurrency.d.ts +2 -0
- package/dist/{cjs/util/types/BalanceServiceTypes.d.ts → es/src/utils/types/BalanceService.types.d.ts} +91 -27
- package/dist/{esm/util/types/BaseServiceTypes.d.ts → es/src/utils/types/BaseService.types.d.ts} +68 -18
- package/dist/es/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/{cjs/util/types/NftServiceTypes.d.ts → es/src/utils/types/NftService.types.d.ts} +53 -83
- package/dist/es/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts} +9 -3
- package/dist/{util/types/SecurityServiceTypes.d.ts → es/src/utils/types/SecurityService.types.d.ts} +8 -7
- package/dist/{cjs/util/types/TransactionServiceTypes.d.ts → es/src/utils/types/TransactionService.types.d.ts} +110 -24
- package/dist/esm/index.d.ts +17 -20
- package/dist/esm/index.js +2327 -7649
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/GoldRushClient.d.ts +20 -0
- package/dist/esm/src/services/BalanceService.d.ts +125 -0
- package/dist/esm/src/services/BaseService.d.ts +161 -0
- package/dist/esm/src/services/NftService.d.ts +157 -0
- package/dist/esm/src/services/PricingService.d.ts +25 -0
- package/dist/esm/src/services/SecurityService.d.ts +28 -0
- package/dist/esm/src/services/TransactionService.d.ts +128 -0
- package/dist/esm/src/utils/functions/bigIntParser.d.ts +1 -0
- package/dist/esm/{util/CalculatePrettyBalance.d.ts → src/utils/functions/calculatePrettyBalance.d.ts} +0 -0
- package/dist/esm/src/utils/functions/debugOutput.d.ts +2 -0
- package/dist/esm/src/utils/functions/endpointGenerator.d.ts +4 -0
- package/dist/esm/src/utils/functions/execution.d.ts +11 -0
- package/dist/esm/src/utils/functions/isValidApiKey.d.ts +1 -0
- package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +7 -0
- package/dist/esm/src/utils/functions/prettifyCurrency.d.ts +2 -0
- package/dist/{util/types/BalanceServiceTypes.d.ts → esm/src/utils/types/BalanceService.types.d.ts} +91 -27
- package/dist/{cjs/util/types/BaseServiceTypes.d.ts → esm/src/utils/types/BaseService.types.d.ts} +68 -18
- package/dist/esm/src/utils/types/Generic.types.d.ts +477 -0
- package/dist/{util/types/NftServiceTypes.d.ts → esm/src/utils/types/NftService.types.d.ts} +53 -83
- package/dist/esm/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts} +9 -3
- package/dist/{es/util/types/SecurityServiceTypes.d.ts → esm/src/utils/types/SecurityService.types.d.ts} +8 -7
- package/dist/{util/types/TransactionServiceTypes.d.ts → esm/src/utils/types/TransactionService.types.d.ts} +110 -24
- package/package.json +25 -12
- package/dist/cjs/services/BalanceService.d.ts +0 -638
- package/dist/cjs/services/BaseService.d.ts +0 -571
- package/dist/cjs/services/CovalentClient.d.ts +0 -57
- package/dist/cjs/services/NftService.d.ts +0 -686
- package/dist/cjs/services/PricingService.d.ts +0 -103
- package/dist/cjs/services/SecurityService.d.ts +0 -162
- package/dist/cjs/services/TransactionService.d.ts +0 -711
- package/dist/cjs/services/XykService.d.ts +0 -1018
- package/dist/cjs/util/ApiHelpers.d.ts +0 -6
- package/dist/cjs/util/ApiKeyValidator.d.ts +0 -8
- package/dist/cjs/util/Chains.d.ts +0 -223
- package/dist/cjs/util/backoff.d.ts +0 -12
- package/dist/cjs/util/prettifyCurrency.d.ts +0 -2
- package/dist/cjs/util/types/GenericTypes.d.ts +0 -116
- package/dist/cjs/util/types/SecurityServiceTypes.d.ts +0 -121
- package/dist/cjs/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/es/services/BalanceService.d.ts +0 -638
- package/dist/es/services/BaseService.d.ts +0 -571
- package/dist/es/services/CovalentClient.d.ts +0 -57
- package/dist/es/services/NftService.d.ts +0 -686
- package/dist/es/services/PricingService.d.ts +0 -103
- package/dist/es/services/SecurityService.d.ts +0 -162
- package/dist/es/services/TransactionService.d.ts +0 -711
- package/dist/es/services/XykService.d.ts +0 -1018
- package/dist/es/util/ApiHelpers.d.ts +0 -6
- package/dist/es/util/ApiKeyValidator.d.ts +0 -8
- package/dist/es/util/Chains.d.ts +0 -223
- package/dist/es/util/backoff.d.ts +0 -12
- package/dist/es/util/prettifyCurrency.d.ts +0 -2
- package/dist/es/util/types/BalanceServiceTypes.d.ts +0 -378
- package/dist/es/util/types/GenericTypes.d.ts +0 -116
- package/dist/es/util/types/NftServiceTypes.d.ts +0 -303
- package/dist/es/util/types/TransactionServiceTypes.d.ts +0 -388
- package/dist/es/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/esm/services/BalanceService.d.ts +0 -638
- package/dist/esm/services/BaseService.d.ts +0 -571
- package/dist/esm/services/CovalentClient.d.ts +0 -57
- package/dist/esm/services/NftService.d.ts +0 -686
- package/dist/esm/services/PricingService.d.ts +0 -103
- package/dist/esm/services/SecurityService.d.ts +0 -162
- package/dist/esm/services/TransactionService.d.ts +0 -711
- package/dist/esm/services/XykService.d.ts +0 -1018
- package/dist/esm/util/ApiHelpers.d.ts +0 -6
- package/dist/esm/util/ApiKeyValidator.d.ts +0 -8
- package/dist/esm/util/Chains.d.ts +0 -223
- package/dist/esm/util/backoff.d.ts +0 -12
- package/dist/esm/util/prettifyCurrency.d.ts +0 -2
- package/dist/esm/util/types/GenericTypes.d.ts +0 -116
- package/dist/esm/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/services/BalanceService.d.ts +0 -638
- package/dist/services/BalanceService.js +0 -959
- package/dist/services/BalanceService.js.map +0 -1
- package/dist/services/BaseService.d.ts +0 -571
- package/dist/services/BaseService.js +0 -1202
- package/dist/services/BaseService.js.map +0 -1
- package/dist/services/CovalentClient.d.ts +0 -57
- package/dist/services/CovalentClient.js +0 -49
- package/dist/services/CovalentClient.js.map +0 -1
- package/dist/services/NftService.d.ts +0 -686
- package/dist/services/NftService.js +0 -1490
- package/dist/services/NftService.js.map +0 -1
- package/dist/services/PricingService.d.ts +0 -103
- package/dist/services/PricingService.js +0 -155
- package/dist/services/PricingService.js.map +0 -1
- package/dist/services/SecurityService.d.ts +0 -162
- package/dist/services/SecurityService.js +0 -249
- package/dist/services/SecurityService.js.map +0 -1
- package/dist/services/TransactionService.d.ts +0 -711
- package/dist/services/TransactionService.js +0 -1687
- package/dist/services/TransactionService.js.map +0 -1
- package/dist/services/XykService.d.ts +0 -1018
- package/dist/services/XykService.js +0 -1827
- package/dist/services/XykService.js.map +0 -1
- package/dist/util/ApiHelpers.d.ts +0 -6
- package/dist/util/ApiHelpers.js +0 -87
- package/dist/util/ApiHelpers.js.map +0 -1
- package/dist/util/ApiKeyValidator.d.ts +0 -8
- package/dist/util/ApiKeyValidator.js +0 -13
- package/dist/util/ApiKeyValidator.js.map +0 -1
- package/dist/util/CalculatePrettyBalance.d.ts +0 -1
- package/dist/util/CalculatePrettyBalance.js +0 -32
- package/dist/util/CalculatePrettyBalance.js.map +0 -1
- package/dist/util/Chains.d.ts +0 -223
- package/dist/util/Chains.js +0 -225
- package/dist/util/Chains.js.map +0 -1
- package/dist/util/backoff.d.ts +0 -12
- package/dist/util/backoff.js +0 -47
- package/dist/util/backoff.js.map +0 -1
- package/dist/util/prettifyCurrency.d.ts +0 -2
- package/dist/util/prettifyCurrency.js +0 -69
- package/dist/util/prettifyCurrency.js.map +0 -1
- package/dist/util/types/BalanceServiceTypes.js +0 -2
- package/dist/util/types/BalanceServiceTypes.js.map +0 -1
- package/dist/util/types/BaseServiceTypes.d.ts +0 -276
- package/dist/util/types/BaseServiceTypes.js +0 -2
- package/dist/util/types/BaseServiceTypes.js.map +0 -1
- package/dist/util/types/GenericTypes.d.ts +0 -116
- package/dist/util/types/GenericTypes.js +0 -2
- package/dist/util/types/GenericTypes.js.map +0 -1
- package/dist/util/types/NftServiceTypes.js +0 -2
- package/dist/util/types/NftServiceTypes.js.map +0 -1
- package/dist/util/types/PricingServiceTypes.d.ts +0 -33
- package/dist/util/types/PricingServiceTypes.js +0 -2
- package/dist/util/types/PricingServiceTypes.js.map +0 -1
- package/dist/util/types/SecurityServiceTypes.js +0 -2
- package/dist/util/types/SecurityServiceTypes.js.map +0 -1
- package/dist/util/types/TransactionServiceTypes.js +0 -2
- package/dist/util/types/TransactionServiceTypes.js.map +0 -1
- package/dist/util/types/XykServiceTypes.d.ts +0 -687
- package/dist/util/types/XykServiceTypes.js +0 -2
- package/dist/util/types/XykServiceTypes.js.map +0 -1
package/dist/cjs/{util/types/PricingServiceTypes.d.ts → src/utils/types/PricingService.types.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractMetadata, LogoUrls } from "./
|
|
1
|
+
import { type ContractMetadata, type LogoUrls } from "./Generic.types";
|
|
2
2
|
export interface TokenPricesResponse {
|
|
3
3
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
4
4
|
contract_decimals: number;
|
|
@@ -18,8 +18,6 @@ export interface TokenPricesResponse {
|
|
|
18
18
|
/** * The contract logo URLs. */
|
|
19
19
|
logo_urls: LogoUrls;
|
|
20
20
|
/** * List of response items. */
|
|
21
|
-
prices: Price[];
|
|
22
|
-
/** * List of response items. */
|
|
23
21
|
items: Price[];
|
|
24
22
|
}
|
|
25
23
|
export interface Price {
|
|
@@ -31,3 +29,11 @@ export interface Price {
|
|
|
31
29
|
/** * A prettier version of the price for rendering purposes. */
|
|
32
30
|
pretty_price: string;
|
|
33
31
|
}
|
|
32
|
+
export interface GetTokenPricesQueryParamOpts {
|
|
33
|
+
/** * The start day of the historical price range (YYYY-MM-DD). */
|
|
34
|
+
from?: string;
|
|
35
|
+
/** * The end day of the historical price range (YYYY-MM-DD). */
|
|
36
|
+
to?: string;
|
|
37
|
+
/** * Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order. */
|
|
38
|
+
pricesAtAsc?: boolean;
|
|
39
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ChainID, type ChainName } from "./Generic.types";
|
|
1
2
|
export interface ApprovalsResponse {
|
|
2
3
|
/** * The requested address. */
|
|
3
4
|
address: string;
|
|
@@ -6,9 +7,9 @@ export interface ApprovalsResponse {
|
|
|
6
7
|
/** * The requested quote currency eg: `USD`. */
|
|
7
8
|
quote_currency: string;
|
|
8
9
|
/** * The requested chain ID eg: `1`. */
|
|
9
|
-
chain_id:
|
|
10
|
+
chain_id: ChainID;
|
|
10
11
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
11
|
-
chain_name:
|
|
12
|
+
chain_name: ChainName;
|
|
12
13
|
/** * List of response items. */
|
|
13
14
|
items: TokensApprovalItem[];
|
|
14
15
|
}
|
|
@@ -26,7 +27,7 @@ export interface TokensApprovalItem {
|
|
|
26
27
|
/** * The exchange rate for the requested quote currency. */
|
|
27
28
|
quote_rate: number;
|
|
28
29
|
/** * Wallet balance of the token. */
|
|
29
|
-
balance: bigint
|
|
30
|
+
balance: bigint;
|
|
30
31
|
/** * Value of the wallet balance of the token. */
|
|
31
32
|
balance_quote: number;
|
|
32
33
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -73,9 +74,9 @@ export interface NftApprovalsResponse {
|
|
|
73
74
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
74
75
|
updated_at: Date;
|
|
75
76
|
/** * The requested chain ID eg: `1`. */
|
|
76
|
-
chain_id:
|
|
77
|
+
chain_id: ChainID;
|
|
77
78
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
78
|
-
chain_name:
|
|
79
|
+
chain_name: ChainName;
|
|
79
80
|
/** * The requested address. */
|
|
80
81
|
address: string;
|
|
81
82
|
/** * List of response items. */
|
|
@@ -95,9 +96,9 @@ export interface NftApprovalsItem {
|
|
|
95
96
|
}
|
|
96
97
|
export interface NftApprovalBalance {
|
|
97
98
|
/** * The token's id. */
|
|
98
|
-
token_id: bigint
|
|
99
|
+
token_id: bigint;
|
|
99
100
|
/** * The NFT's token balance. */
|
|
100
|
-
token_balance: bigint
|
|
101
|
+
token_balance: bigint;
|
|
101
102
|
}
|
|
102
103
|
export interface NftApprovalSpender {
|
|
103
104
|
/** * The height of the block. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ContractMetadata, LogEvent,
|
|
1
|
+
import { type ChainID, type ChainName, type ContractMetadata, type Explorer, type GoldRushResponse, type LogEvent, type PaginationLinks, type Quote } from "./Generic.types";
|
|
2
2
|
export interface TransactionResponse {
|
|
3
3
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
4
4
|
updated_at: Date;
|
|
5
5
|
/** * The requested chain ID eg: `1`. */
|
|
6
|
-
chain_id:
|
|
6
|
+
chain_id: ChainID;
|
|
7
7
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
8
|
-
chain_name:
|
|
8
|
+
chain_name: ChainName;
|
|
9
9
|
/** * List of response items. */
|
|
10
10
|
items: Transaction[];
|
|
11
11
|
}
|
|
@@ -33,7 +33,7 @@ export interface Transaction {
|
|
|
33
33
|
/** * The label of `to` address. */
|
|
34
34
|
to_address_label: string;
|
|
35
35
|
/** * The value attached to this tx. */
|
|
36
|
-
value: bigint
|
|
36
|
+
value: bigint;
|
|
37
37
|
/** * The value attached in `quote-currency` to this tx. */
|
|
38
38
|
value_quote: number;
|
|
39
39
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -46,7 +46,7 @@ export interface Transaction {
|
|
|
46
46
|
/** * The gas price at the time of this tx. */
|
|
47
47
|
gas_price: number;
|
|
48
48
|
/** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
|
|
49
|
-
fees_paid: bigint
|
|
49
|
+
fees_paid: bigint;
|
|
50
50
|
/** * The gas spent in `quote-currency` denomination. */
|
|
51
51
|
gas_quote: number;
|
|
52
52
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -269,21 +269,20 @@ export interface RecentTransactionsResponse {
|
|
|
269
269
|
/** * The requested quote currency eg: `USD`. */
|
|
270
270
|
quote_currency: string;
|
|
271
271
|
/** * The requested chain ID eg: `1`. */
|
|
272
|
-
chain_id:
|
|
272
|
+
chain_id: ChainID;
|
|
273
273
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
274
|
-
chain_name:
|
|
274
|
+
chain_name: ChainName;
|
|
275
275
|
/** * The current page of the response. */
|
|
276
276
|
current_page: number;
|
|
277
|
+
/** * URL link to the next and prev pages. */
|
|
277
278
|
links: PaginationLinks;
|
|
279
|
+
/** * An executable async function for the next page. */
|
|
280
|
+
next: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
|
|
281
|
+
/** * An executable async function for the prev page. */
|
|
282
|
+
prev: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
|
|
278
283
|
/** * List of response items. */
|
|
279
284
|
items: Transaction[];
|
|
280
285
|
}
|
|
281
|
-
export interface PaginationLinks {
|
|
282
|
-
/** * URL link to the next page. */
|
|
283
|
-
prev: string;
|
|
284
|
-
/** * URL link to the previous page. */
|
|
285
|
-
next: string;
|
|
286
|
-
}
|
|
287
286
|
export interface TransactionsTimeBucketResponse {
|
|
288
287
|
/** * The requested address. */
|
|
289
288
|
address: string;
|
|
@@ -292,13 +291,18 @@ export interface TransactionsTimeBucketResponse {
|
|
|
292
291
|
/** * The requested quote currency eg: `USD`. */
|
|
293
292
|
quote_currency: string;
|
|
294
293
|
/** * The requested chain ID eg: `1`. */
|
|
295
|
-
chain_id:
|
|
294
|
+
chain_id: ChainID;
|
|
296
295
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
297
|
-
chain_name:
|
|
296
|
+
chain_name: ChainName;
|
|
298
297
|
complete: boolean;
|
|
299
298
|
/** * The current bucket of the response. */
|
|
300
299
|
current_bucket: number;
|
|
300
|
+
/** * URL link to the next and prev pages. */
|
|
301
301
|
links: PaginationLinks;
|
|
302
|
+
/** * An executable async function for the next page. */
|
|
303
|
+
next: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
|
|
304
|
+
/** * An executable async function for the prev page. */
|
|
305
|
+
prev: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
|
|
302
306
|
/** * List of response items. */
|
|
303
307
|
items: Transaction[];
|
|
304
308
|
}
|
|
@@ -306,9 +310,9 @@ export interface TransactionsBlockResponse {
|
|
|
306
310
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
307
311
|
updated_at: Date;
|
|
308
312
|
/** * The requested chain ID eg: `1`. */
|
|
309
|
-
chain_id:
|
|
313
|
+
chain_id: ChainID;
|
|
310
314
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
311
|
-
chain_name:
|
|
315
|
+
chain_name: ChainName;
|
|
312
316
|
/** * List of response items. */
|
|
313
317
|
items: Transaction[];
|
|
314
318
|
}
|
|
@@ -318,9 +322,9 @@ export interface TransactionsSummaryResponse {
|
|
|
318
322
|
/** * The requested address. */
|
|
319
323
|
address: string;
|
|
320
324
|
/** * The requested chain ID eg: `1`. */
|
|
321
|
-
chain_id:
|
|
325
|
+
chain_id: ChainID;
|
|
322
326
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
323
|
-
chain_name:
|
|
327
|
+
chain_name: ChainName;
|
|
324
328
|
/** * List of response items. */
|
|
325
329
|
items: TransactionsSummary[];
|
|
326
330
|
}
|
|
@@ -350,12 +354,17 @@ export interface TransactionsResponse {
|
|
|
350
354
|
/** * The requested quote currency eg: `USD`. */
|
|
351
355
|
quote_currency: string;
|
|
352
356
|
/** * The requested chain ID eg: `1`. */
|
|
353
|
-
chain_id:
|
|
357
|
+
chain_id: ChainID;
|
|
354
358
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
355
|
-
chain_name:
|
|
359
|
+
chain_name: ChainName;
|
|
356
360
|
/** * The current page of the response. */
|
|
357
361
|
current_page: number;
|
|
362
|
+
/** * URL link to the next and prev pages. */
|
|
358
363
|
links: PaginationLinks;
|
|
364
|
+
/** * An executable async function for the next page. */
|
|
365
|
+
next: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
|
|
366
|
+
/** * An executable async function for the prev page. */
|
|
367
|
+
prev: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
|
|
359
368
|
/** * List of response items. */
|
|
360
369
|
items: Transaction[];
|
|
361
370
|
}
|
|
@@ -363,10 +372,15 @@ export interface TransactionsBlockPageResponse {
|
|
|
363
372
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
364
373
|
updated_at: Date;
|
|
365
374
|
/** * The requested chain ID eg: `1`. */
|
|
366
|
-
chain_id:
|
|
375
|
+
chain_id: ChainID;
|
|
367
376
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
368
|
-
chain_name:
|
|
377
|
+
chain_name: ChainName;
|
|
378
|
+
/** * URL link to the next and prev pages. */
|
|
369
379
|
links: PaginationLinks;
|
|
380
|
+
/** * An executable async function for the next page. */
|
|
381
|
+
next: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
|
|
382
|
+
/** * An executable async function for the prev page. */
|
|
383
|
+
prev: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
|
|
370
384
|
/** * List of response items. */
|
|
371
385
|
items: Transaction[];
|
|
372
386
|
}
|
|
@@ -374,7 +388,7 @@ export interface GasSummary {
|
|
|
374
388
|
/** * The total number of transactions sent by the address. */
|
|
375
389
|
total_sent_count: number;
|
|
376
390
|
/** * The total transaction fees paid by the address, denoted in wei. */
|
|
377
|
-
total_fees_paid: bigint
|
|
391
|
+
total_fees_paid: bigint;
|
|
378
392
|
/** * The total transaction fees paid by the address, denoted in `quote-currency`. */
|
|
379
393
|
total_gas_quote: number;
|
|
380
394
|
/** * A prettier version of the quote for rendering purposes. */
|
|
@@ -386,3 +400,75 @@ export interface GasSummary {
|
|
|
386
400
|
/** * The requested chain native gas token metadata. */
|
|
387
401
|
gas_metadata: ContractMetadata;
|
|
388
402
|
}
|
|
403
|
+
export interface GetTransactionQueryParamOpts {
|
|
404
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
405
|
+
quoteCurrency?: Quote;
|
|
406
|
+
/** * Omit log events. */
|
|
407
|
+
noLogs?: boolean;
|
|
408
|
+
/** * Decoded DEX details including protocol (e.g. Uniswap), event (e.g 'add_liquidity') and tokens involved with historical prices. Additional 0.05 credits charged if data available. */
|
|
409
|
+
withDex?: boolean;
|
|
410
|
+
/** * Decoded NFT sales details including marketplace (e.g. Opensea) and cached media links. Additional 0.05 credits charged if data available. */
|
|
411
|
+
withNftSales?: boolean;
|
|
412
|
+
/** * Decoded lending details including protocol (e.g. Aave), event (e.g. 'deposit') and tokens involved with prices. Additional 0.05 credits charged if data available. */
|
|
413
|
+
withLending?: boolean;
|
|
414
|
+
/** * Include safe details. */
|
|
415
|
+
withSafe?: boolean;
|
|
416
|
+
}
|
|
417
|
+
export interface GetAllTransactionsForAddressQueryParamOpts {
|
|
418
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
419
|
+
quoteCurrency?: Quote;
|
|
420
|
+
/** * Omit log events. */
|
|
421
|
+
noLogs?: boolean;
|
|
422
|
+
/** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
|
|
423
|
+
blockSignedAtAsc?: boolean;
|
|
424
|
+
/** * Include safe details. */
|
|
425
|
+
withSafe?: boolean;
|
|
426
|
+
}
|
|
427
|
+
export interface GetTransactionsForBlockQueryParamOpts {
|
|
428
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
429
|
+
quoteCurrency?: Quote;
|
|
430
|
+
/** * Omit log events. */
|
|
431
|
+
noLogs?: boolean;
|
|
432
|
+
/** * Include safe details. */
|
|
433
|
+
withSafe?: boolean;
|
|
434
|
+
}
|
|
435
|
+
export interface GetTransactionsForAddressV3QueryParamOpts {
|
|
436
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
437
|
+
quoteCurrency?: Quote;
|
|
438
|
+
/** * Omit log events. */
|
|
439
|
+
noLogs?: boolean;
|
|
440
|
+
/** * Sort the transactions in ascending chronological order. By default, it's set to `false` and returns transactions in descending chronological order. */
|
|
441
|
+
blockSignedAtAsc?: boolean;
|
|
442
|
+
/** * Include safe details. */
|
|
443
|
+
withSafe?: boolean;
|
|
444
|
+
}
|
|
445
|
+
export interface GetTimeBucketTransactionsForAddressQueryParamOpts {
|
|
446
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
447
|
+
quoteCurrency?: Quote;
|
|
448
|
+
/** * Omit log events. */
|
|
449
|
+
noLogs?: boolean;
|
|
450
|
+
/** * Include safe details. */
|
|
451
|
+
withSafe?: boolean;
|
|
452
|
+
}
|
|
453
|
+
export interface GetTransactionsForBlockHashByPageQueryParamOpts {
|
|
454
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
455
|
+
quoteCurrency?: Quote;
|
|
456
|
+
/** * Omit log events. */
|
|
457
|
+
noLogs?: boolean;
|
|
458
|
+
/** * Include safe details. */
|
|
459
|
+
withSafe?: boolean;
|
|
460
|
+
}
|
|
461
|
+
export interface GetTransactionsForBlockHashQueryParamOpts {
|
|
462
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
463
|
+
quoteCurrency?: Quote;
|
|
464
|
+
/** * Omit log events. */
|
|
465
|
+
noLogs?: boolean;
|
|
466
|
+
/** * Include safe details. */
|
|
467
|
+
withSafe?: boolean;
|
|
468
|
+
}
|
|
469
|
+
export interface GetTransactionSummaryQueryParamOpts {
|
|
470
|
+
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
471
|
+
quoteCurrency?: Quote;
|
|
472
|
+
/** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
|
|
473
|
+
withGas?: boolean;
|
|
474
|
+
}
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
18
|
-
export { calculatePrettyBalance } from "./util/CalculatePrettyBalance";
|
|
19
|
-
export { prettifyCurrency } from "./util/prettifyCurrency";
|
|
20
|
-
export { Chains } from "./util/Chains";
|
|
1
|
+
export {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Please use `GoldRushClient` going forward!
|
|
4
|
+
* `CovalentClient` will be removed after Aug 30, 2024.
|
|
5
|
+
*/
|
|
6
|
+
GoldRushClient as CovalentClient, GoldRushClient, } from "./src/GoldRushClient";
|
|
7
|
+
export { bigIntParser } from "./src/utils/functions/bigIntParser";
|
|
8
|
+
export { calculatePrettyBalance } from "./src/utils/functions/calculatePrettyBalance";
|
|
9
|
+
export { isValidApiKey } from "./src/utils/functions/isValidApiKey";
|
|
10
|
+
export { prettifyCurrency } from "./src/utils/functions/prettifyCurrency";
|
|
11
|
+
export * from "./src/utils/types/BalanceService.types";
|
|
12
|
+
export * from "./src/utils/types/BaseService.types";
|
|
13
|
+
export * from "./src/utils/types/Generic.types";
|
|
14
|
+
export * from "./src/utils/types/NftService.types";
|
|
15
|
+
export * from "./src/utils/types/PricingService.types";
|
|
16
|
+
export * from "./src/utils/types/SecurityService.types";
|
|
17
|
+
export * from "./src/utils/types/TransactionService.types";
|