@covalenthq/client-sdk 2.0.2 → 2.1.0
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 -5
- package/dist/cjs/index.d.ts +1 -6
- package/dist/cjs/index.js +1792 -674
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/services/BaseService.d.ts +1 -1
- package/dist/cjs/src/services/NftService.d.ts +1 -1
- package/dist/cjs/src/services/PricingService.d.ts +1 -1
- package/dist/cjs/src/services/TransactionService.d.ts +4 -0
- package/dist/cjs/src/utils/functions/paginateEndpoint.d.ts +4 -4
- package/dist/cjs/src/utils/types/BalanceService.types.d.ts +52 -52
- package/dist/cjs/src/utils/types/BaseService.types.d.ts +55 -55
- package/dist/cjs/src/utils/types/Generic.types.d.ts +10 -7
- package/dist/cjs/src/utils/types/NftService.types.d.ts +53 -53
- package/dist/cjs/src/utils/types/PricingService.types.d.ts +7 -7
- package/dist/cjs/src/utils/types/SecurityService.types.d.ts +15 -15
- package/dist/cjs/src/utils/types/TransactionService.types.d.ts +47 -47
- package/dist/esm/index.d.ts +1 -6
- package/dist/esm/index.js +1793 -673
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/services/BaseService.d.ts +1 -1
- package/dist/esm/src/services/NftService.d.ts +1 -1
- package/dist/esm/src/services/PricingService.d.ts +1 -1
- package/dist/esm/src/services/TransactionService.d.ts +4 -0
- package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +4 -4
- package/dist/esm/src/utils/types/BalanceService.types.d.ts +52 -52
- package/dist/esm/src/utils/types/BaseService.types.d.ts +55 -55
- package/dist/esm/src/utils/types/Generic.types.d.ts +10 -7
- package/dist/esm/src/utils/types/NftService.types.d.ts +53 -53
- package/dist/esm/src/utils/types/PricingService.types.d.ts +7 -7
- package/dist/esm/src/utils/types/SecurityService.types.d.ts +15 -15
- package/dist/esm/src/utils/types/TransactionService.types.d.ts +47 -47
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChainID, type ChainName, type LogEvent, type NftData, type Pagination } from "./Generic.types";
|
|
2
|
-
export
|
|
1
|
+
import { type ChainID, type ChainName, type LogEvent, type NftData, type Nullable, type Pagination } from "./Generic.types";
|
|
2
|
+
export type ChainCollectionResponse = Nullable<{
|
|
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`. */
|
|
@@ -10,8 +10,8 @@ export interface ChainCollectionResponse {
|
|
|
10
10
|
items: ChainCollectionItem[];
|
|
11
11
|
/** * Pagination metadata. */
|
|
12
12
|
pagination: Pagination;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
}>;
|
|
14
|
+
export type ChainCollectionItem = Nullable<{
|
|
15
15
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
16
16
|
contract_address: string;
|
|
17
17
|
/** * The string returned by the `name()` method. */
|
|
@@ -22,16 +22,16 @@ export interface ChainCollectionItem {
|
|
|
22
22
|
cached_metadata_count: number;
|
|
23
23
|
cached_asset_count: number;
|
|
24
24
|
last_scraped_at: Date;
|
|
25
|
-
}
|
|
26
|
-
export
|
|
25
|
+
}>;
|
|
26
|
+
export type NftAddressBalanceNftResponse = Nullable<{
|
|
27
27
|
/** * The requested address. */
|
|
28
28
|
address: string;
|
|
29
29
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
30
30
|
updated_at: Date;
|
|
31
31
|
/** * List of response items. */
|
|
32
32
|
items: NftTokenContractBalanceItem[];
|
|
33
|
-
}
|
|
34
|
-
export
|
|
33
|
+
}>;
|
|
34
|
+
export type NftTokenContractBalanceItem = Nullable<{
|
|
35
35
|
/** * The string returned by the `name()` method. */
|
|
36
36
|
contract_name: string;
|
|
37
37
|
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
@@ -54,16 +54,16 @@ export interface NftTokenContractBalanceItem {
|
|
|
54
54
|
/** * The current floor price in native currency. The floor price is determined by the last minimum sale price within the last 30 days across all the supported markets where the collection is sold on. */
|
|
55
55
|
floor_price_native_quote: number;
|
|
56
56
|
nft_data: NftData[];
|
|
57
|
-
}
|
|
58
|
-
export
|
|
57
|
+
}>;
|
|
58
|
+
export type NftMetadataResponse = Nullable<{
|
|
59
59
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
60
60
|
updated_at: Date;
|
|
61
61
|
/** * List of response items. */
|
|
62
62
|
items: NftTokenContract[];
|
|
63
63
|
/** * Pagination metadata. */
|
|
64
64
|
pagination: Pagination;
|
|
65
|
-
}
|
|
66
|
-
export
|
|
65
|
+
}>;
|
|
66
|
+
export type NftTokenContract = Nullable<{
|
|
67
67
|
/** * The string returned by the `name()` method. */
|
|
68
68
|
contract_name: string;
|
|
69
69
|
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
@@ -74,8 +74,8 @@ export interface NftTokenContract {
|
|
|
74
74
|
is_spam: boolean;
|
|
75
75
|
type: string;
|
|
76
76
|
nft_data: NftData;
|
|
77
|
-
}
|
|
78
|
-
export
|
|
77
|
+
}>;
|
|
78
|
+
export type NftTransactionsResponse = Nullable<{
|
|
79
79
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
80
80
|
updated_at: Date;
|
|
81
81
|
/** * The requested chain ID eg: `1`. */
|
|
@@ -84,8 +84,8 @@ export interface NftTransactionsResponse {
|
|
|
84
84
|
chain_name: ChainName;
|
|
85
85
|
/** * List of response items. */
|
|
86
86
|
items: NftTransaction[];
|
|
87
|
-
}
|
|
88
|
-
export
|
|
87
|
+
}>;
|
|
88
|
+
export type NftTransaction = Nullable<{
|
|
89
89
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
90
90
|
contract_decimals: number;
|
|
91
91
|
/** * The string returned by the `name()` method. */
|
|
@@ -101,8 +101,8 @@ export interface NftTransaction {
|
|
|
101
101
|
nft_transactions: NftTransactionItem[];
|
|
102
102
|
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
103
103
|
is_spam: boolean;
|
|
104
|
-
}
|
|
105
|
-
export
|
|
104
|
+
}>;
|
|
105
|
+
export type NftTransactionItem = Nullable<{
|
|
106
106
|
/** * The block signed timestamp in UTC. */
|
|
107
107
|
block_signed_at: Date;
|
|
108
108
|
/** * The height of the block. */
|
|
@@ -141,38 +141,38 @@ export interface NftTransactionItem {
|
|
|
141
141
|
gas_quote_rate: number;
|
|
142
142
|
/** * The log events. */
|
|
143
143
|
log_events: LogEvent[];
|
|
144
|
-
}
|
|
145
|
-
export
|
|
144
|
+
}>;
|
|
145
|
+
export type NftCollectionTraitsResponse = Nullable<{
|
|
146
146
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
147
147
|
updated_at: Date;
|
|
148
148
|
/** * List of response items. */
|
|
149
149
|
items: NftTrait[];
|
|
150
|
-
}
|
|
151
|
-
export
|
|
150
|
+
}>;
|
|
151
|
+
export type NftTrait = Nullable<{
|
|
152
152
|
name: string;
|
|
153
|
-
}
|
|
154
|
-
export
|
|
153
|
+
}>;
|
|
154
|
+
export type NftCollectionAttributesForTraitResponse = Nullable<{
|
|
155
155
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
156
156
|
updated_at: Date;
|
|
157
157
|
/** * List of response items. */
|
|
158
158
|
items: NftSummaryAttribute[];
|
|
159
|
-
}
|
|
160
|
-
export
|
|
159
|
+
}>;
|
|
160
|
+
export type NftSummaryAttribute = Nullable<{
|
|
161
161
|
trait_type: string;
|
|
162
162
|
values: NftAttribute[];
|
|
163
163
|
unique_values: number;
|
|
164
|
-
}
|
|
165
|
-
export
|
|
164
|
+
}>;
|
|
165
|
+
export type NftAttribute = Nullable<{
|
|
166
166
|
value: string;
|
|
167
167
|
count: number;
|
|
168
|
-
}
|
|
169
|
-
export
|
|
168
|
+
}>;
|
|
169
|
+
export type NftCollectionTraitsSummaryResponse = Nullable<{
|
|
170
170
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
171
171
|
updated_at: Date;
|
|
172
172
|
/** * List of response items. */
|
|
173
173
|
items: NftTraitSummary[];
|
|
174
|
-
}
|
|
175
|
-
export
|
|
174
|
+
}>;
|
|
175
|
+
export type NftTraitSummary = Nullable<{
|
|
176
176
|
/** * Trait name */
|
|
177
177
|
name: string;
|
|
178
178
|
/** * Type of the value of the trait. */
|
|
@@ -182,20 +182,20 @@ export interface NftTraitSummary {
|
|
|
182
182
|
/** * Populated for `string` traits. */
|
|
183
183
|
value_string: NftTraitString;
|
|
184
184
|
attributes: NftSummaryAttribute[];
|
|
185
|
-
}
|
|
186
|
-
export
|
|
185
|
+
}>;
|
|
186
|
+
export type NftTraitNumeric = Nullable<{
|
|
187
187
|
min: number;
|
|
188
188
|
max: number;
|
|
189
|
-
}
|
|
190
|
-
export
|
|
189
|
+
}>;
|
|
190
|
+
export type NftTraitString = Nullable<{
|
|
191
191
|
/** * String value */
|
|
192
192
|
value: string;
|
|
193
193
|
/** * Number of distinct tokens that have this trait value. */
|
|
194
194
|
token_count: number;
|
|
195
195
|
/** * Percentage of tokens in the collection that have this trait. */
|
|
196
196
|
trait_percentage: number;
|
|
197
|
-
}
|
|
198
|
-
export
|
|
197
|
+
}>;
|
|
198
|
+
export type NftOwnershipForCollectionResponse = Nullable<{
|
|
199
199
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
200
200
|
updated_at: Date;
|
|
201
201
|
/** * The requested address. */
|
|
@@ -206,8 +206,8 @@ export interface NftOwnershipForCollectionResponse {
|
|
|
206
206
|
is_spam: boolean;
|
|
207
207
|
/** * List of response items. */
|
|
208
208
|
items: NftOwnershipForCollectionItem[];
|
|
209
|
-
}
|
|
210
|
-
export
|
|
209
|
+
}>;
|
|
210
|
+
export type NftOwnershipForCollectionItem = Nullable<{
|
|
211
211
|
/** * The string returned by the `name()` method. */
|
|
212
212
|
contract_name: string;
|
|
213
213
|
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
@@ -224,24 +224,24 @@ export interface NftOwnershipForCollectionItem {
|
|
|
224
224
|
balance_24h: bigint;
|
|
225
225
|
type: string;
|
|
226
226
|
nft_data: NftData;
|
|
227
|
-
}
|
|
228
|
-
export
|
|
227
|
+
}>;
|
|
228
|
+
export type GetChainCollectionsQueryParamOpts = Nullable<{
|
|
229
229
|
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
230
230
|
pageSize?: number;
|
|
231
231
|
/** * 0-indexed page number to begin pagination. */
|
|
232
232
|
pageNumber?: number;
|
|
233
233
|
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
234
234
|
noSpam?: boolean;
|
|
235
|
-
}
|
|
236
|
-
export
|
|
235
|
+
}>;
|
|
236
|
+
export type GetNftsForAddressQueryParamOpts = Nullable<{
|
|
237
237
|
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
238
238
|
noSpam?: boolean;
|
|
239
239
|
/** * If `true`, the response shape is limited to a list of collections and token ids, omitting metadata and asset information. Helpful for faster response times and wallets holding a large number of NFTs. */
|
|
240
240
|
noNftAssetMetadata?: boolean;
|
|
241
241
|
/** * By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side. */
|
|
242
242
|
withUncached?: boolean;
|
|
243
|
-
}
|
|
244
|
-
export
|
|
243
|
+
}>;
|
|
244
|
+
export type GetTokenIdsForContractWithMetadataQueryParamOpts = Nullable<{
|
|
245
245
|
/** * Omit metadata. */
|
|
246
246
|
noMetadata?: boolean;
|
|
247
247
|
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
@@ -254,20 +254,20 @@ export interface GetTokenIdsForContractWithMetadataQueryParamOpts {
|
|
|
254
254
|
valuesFilter?: string;
|
|
255
255
|
/** * By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side. */
|
|
256
256
|
withUncached?: boolean;
|
|
257
|
-
}
|
|
258
|
-
export
|
|
257
|
+
}>;
|
|
258
|
+
export type GetNftMetadataForGivenTokenIdForContractQueryParamOpts = Nullable<{
|
|
259
259
|
/** * Omit metadata. */
|
|
260
260
|
noMetadata?: boolean;
|
|
261
261
|
/** * By default, this endpoint only works on chains where we've cached the assets and the metadata. When set to `true`, the API will fetch metadata from upstream servers even if it's not cached - the downside being that the upstream server can block or rate limit the call and therefore resulting in time outs or slow response times on the Covalent side. */
|
|
262
262
|
withUncached?: boolean;
|
|
263
|
-
}
|
|
264
|
-
export
|
|
263
|
+
}>;
|
|
264
|
+
export type GetNftTransactionsForContractTokenIdQueryParamOpts = Nullable<{
|
|
265
265
|
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
266
266
|
noSpam?: boolean;
|
|
267
|
-
}
|
|
268
|
-
export
|
|
267
|
+
}>;
|
|
268
|
+
export type CheckOwnershipInNftQueryParamOpts = Nullable<{
|
|
269
269
|
/** * Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Must be used with "values-filter", is case-sensitive, and requires proper URL encoding. */
|
|
270
270
|
traitsFilter?: string;
|
|
271
271
|
/** * Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. Must be used with "traits-filter", is case-sensitive, and requires proper URL encoding. */
|
|
272
272
|
valuesFilter?: string;
|
|
273
|
-
}
|
|
273
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ContractMetadata, type LogoUrls } from "./Generic.types";
|
|
2
|
-
export
|
|
1
|
+
import { type ContractMetadata, type LogoUrls, type Nullable } from "./Generic.types";
|
|
2
|
+
export type TokenPricesResponse = Nullable<{
|
|
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;
|
|
5
5
|
/** * The string returned by the `name()` method. */
|
|
@@ -19,8 +19,8 @@ export interface TokenPricesResponse {
|
|
|
19
19
|
logo_urls: LogoUrls;
|
|
20
20
|
/** * List of response items. */
|
|
21
21
|
items: Price[];
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
}>;
|
|
23
|
+
export type Price = Nullable<{
|
|
24
24
|
contract_metadata: ContractMetadata;
|
|
25
25
|
/** * The date of the price capture. */
|
|
26
26
|
date: Date;
|
|
@@ -28,12 +28,12 @@ export interface Price {
|
|
|
28
28
|
price: number;
|
|
29
29
|
/** * A prettier version of the price for rendering purposes. */
|
|
30
30
|
pretty_price: string;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
31
|
+
}>;
|
|
32
|
+
export type GetTokenPricesQueryParamOpts = Nullable<{
|
|
33
33
|
/** * The start day of the historical price range (YYYY-MM-DD). */
|
|
34
34
|
from?: string;
|
|
35
35
|
/** * The end day of the historical price range (YYYY-MM-DD). */
|
|
36
36
|
to?: string;
|
|
37
37
|
/** * Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order. */
|
|
38
38
|
pricesAtAsc?: boolean;
|
|
39
|
-
}
|
|
39
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChainID, type ChainName } from "./Generic.types";
|
|
2
|
-
export
|
|
1
|
+
import { type ChainID, type ChainName, type Nullable } from "./Generic.types";
|
|
2
|
+
export type ApprovalsResponse = Nullable<{
|
|
3
3
|
/** * The requested address. */
|
|
4
4
|
address: string;
|
|
5
5
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -12,8 +12,8 @@ export interface ApprovalsResponse {
|
|
|
12
12
|
chain_name: ChainName;
|
|
13
13
|
/** * List of response items. */
|
|
14
14
|
items: TokensApprovalItem[];
|
|
15
|
-
}
|
|
16
|
-
export
|
|
15
|
+
}>;
|
|
16
|
+
export type TokensApprovalItem = Nullable<{
|
|
17
17
|
/** * The address for the token that has approvals. */
|
|
18
18
|
token_address: string;
|
|
19
19
|
/** * The name for the token that has approvals. */
|
|
@@ -40,8 +40,8 @@ export interface TokensApprovalItem {
|
|
|
40
40
|
pretty_value_at_risk_quote: string;
|
|
41
41
|
/** * Contracts with non-zero approvals for this token. */
|
|
42
42
|
spenders: TokenSpenderItem[];
|
|
43
|
-
}
|
|
44
|
-
export
|
|
43
|
+
}>;
|
|
44
|
+
export type TokenSpenderItem = Nullable<{
|
|
45
45
|
/** * The height of the block. */
|
|
46
46
|
block_height: number;
|
|
47
47
|
/** * The offset is the position of the tx in the block. */
|
|
@@ -69,8 +69,8 @@ export interface TokenSpenderItem {
|
|
|
69
69
|
/** * A prettier version of the quote for rendering purposes. */
|
|
70
70
|
pretty_value_at_risk_quote: string;
|
|
71
71
|
risk_factor: string;
|
|
72
|
-
}
|
|
73
|
-
export
|
|
72
|
+
}>;
|
|
73
|
+
export type NftApprovalsResponse = Nullable<{
|
|
74
74
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
75
75
|
updated_at: Date;
|
|
76
76
|
/** * The requested chain ID eg: `1`. */
|
|
@@ -81,8 +81,8 @@ export interface NftApprovalsResponse {
|
|
|
81
81
|
address: string;
|
|
82
82
|
/** * List of response items. */
|
|
83
83
|
items: NftApprovalsItem[];
|
|
84
|
-
}
|
|
85
|
-
export
|
|
84
|
+
}>;
|
|
85
|
+
export type NftApprovalsItem = Nullable<{
|
|
86
86
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
87
87
|
contract_address: string;
|
|
88
88
|
/** * The label of the contract address. */
|
|
@@ -93,14 +93,14 @@ export interface NftApprovalsItem {
|
|
|
93
93
|
token_balances: NftApprovalBalance[];
|
|
94
94
|
/** * Contracts with non-zero approvals for this token. */
|
|
95
95
|
spenders: NftApprovalSpender[];
|
|
96
|
-
}
|
|
97
|
-
export
|
|
96
|
+
}>;
|
|
97
|
+
export type NftApprovalBalance = Nullable<{
|
|
98
98
|
/** * The token's id. */
|
|
99
99
|
token_id: bigint;
|
|
100
100
|
/** * The NFT's token balance. */
|
|
101
101
|
token_balance: bigint;
|
|
102
|
-
}
|
|
103
|
-
export
|
|
102
|
+
}>;
|
|
103
|
+
export type NftApprovalSpender = Nullable<{
|
|
104
104
|
/** * The height of the block. */
|
|
105
105
|
block_height: number;
|
|
106
106
|
/** * The offset is the position of the tx in the block. */
|
|
@@ -119,4 +119,4 @@ export interface NftApprovalSpender {
|
|
|
119
119
|
token_ids_approved: string;
|
|
120
120
|
/** * Remaining number of tokens granted to the spender by the approval. */
|
|
121
121
|
allowance: string;
|
|
122
|
-
}
|
|
122
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ChainID, type ChainName, type ContractMetadata, type Explorer, type GoldRushResponse, type LogEvent, type PaginationLinks, type Quote } from "./Generic.types";
|
|
2
|
-
export
|
|
1
|
+
import { type ChainID, type ChainName, type ContractMetadata, type Explorer, type GoldRushResponse, type LogEvent, type Nullable, type PaginationLinks, type Quote } from "./Generic.types";
|
|
2
|
+
export type TransactionResponse = Nullable<{
|
|
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`. */
|
|
@@ -8,8 +8,8 @@ export interface TransactionResponse {
|
|
|
8
8
|
chain_name: ChainName;
|
|
9
9
|
/** * List of response items. */
|
|
10
10
|
items: Transaction[];
|
|
11
|
-
}
|
|
12
|
-
export
|
|
11
|
+
}>;
|
|
12
|
+
export type Transaction = Nullable<{
|
|
13
13
|
/** * The block signed timestamp in UTC. */
|
|
14
14
|
block_signed_at: Date;
|
|
15
15
|
/** * The height of the block. */
|
|
@@ -65,8 +65,8 @@ export interface Transaction {
|
|
|
65
65
|
log_events: LogEvent[];
|
|
66
66
|
/** * The details related to the safe transaction. */
|
|
67
67
|
safe_details: SafeDetails[];
|
|
68
|
-
}
|
|
69
|
-
export
|
|
68
|
+
}>;
|
|
69
|
+
export type DexReport = Nullable<{
|
|
70
70
|
/** * The offset is the position of the log entry within an event log. */
|
|
71
71
|
log_offset: number;
|
|
72
72
|
/** * Stores the name of the protocol that facilitated the event. */
|
|
@@ -128,8 +128,8 @@ export interface DexReport {
|
|
|
128
128
|
sender: string;
|
|
129
129
|
/** * Stores the recipient of the transaction - recipients can be other wallets or smart contracts. For example, if you want to Swap tokens on Uniswap, the Uniswap router would typically be the recipient of the transaction. */
|
|
130
130
|
recipient: string;
|
|
131
|
-
}
|
|
132
|
-
export
|
|
131
|
+
}>;
|
|
132
|
+
export type NftSalesReport = Nullable<{
|
|
133
133
|
/** * The offset is the position of the log entry within an event log. */
|
|
134
134
|
log_offset: number;
|
|
135
135
|
/** * Stores the topic event hash. All events have a unique topic event hash. */
|
|
@@ -179,8 +179,8 @@ export interface NftSalesReport {
|
|
|
179
179
|
num_collections_sold_per_tx: number;
|
|
180
180
|
trade_type: string;
|
|
181
181
|
trade_group_type: string;
|
|
182
|
-
}
|
|
183
|
-
export
|
|
182
|
+
}>;
|
|
183
|
+
export type LendingReport = Nullable<{
|
|
184
184
|
/** * The offset is the position of the log entry within an event log. */
|
|
185
185
|
log_offset: number;
|
|
186
186
|
/** * Stores the name of the lending protocol that facilitated the event. */
|
|
@@ -252,16 +252,16 @@ export interface LendingReport {
|
|
|
252
252
|
liquidator: string;
|
|
253
253
|
/** * Stores the wallet address of the user initiating the event. */
|
|
254
254
|
user: string;
|
|
255
|
-
}
|
|
256
|
-
export
|
|
255
|
+
}>;
|
|
256
|
+
export type SafeDetails = Nullable<{
|
|
257
257
|
/** * The address that signed the safe transaction. */
|
|
258
258
|
owner_address: string;
|
|
259
259
|
/** * The signature of the owner for the safe transaction. */
|
|
260
260
|
signature: string;
|
|
261
261
|
/** * The type of safe signature used. */
|
|
262
262
|
signature_type: string;
|
|
263
|
-
}
|
|
264
|
-
export
|
|
263
|
+
}>;
|
|
264
|
+
export type RecentTransactionsResponse = Nullable<{
|
|
265
265
|
/** * The requested address. */
|
|
266
266
|
address: string;
|
|
267
267
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -282,8 +282,8 @@ export interface RecentTransactionsResponse {
|
|
|
282
282
|
prev: (() => Promise<GoldRushResponse<RecentTransactionsResponse>>) | null;
|
|
283
283
|
/** * List of response items. */
|
|
284
284
|
items: Transaction[];
|
|
285
|
-
}
|
|
286
|
-
export
|
|
285
|
+
}>;
|
|
286
|
+
export type TransactionsTimeBucketResponse = Nullable<{
|
|
287
287
|
/** * The requested address. */
|
|
288
288
|
address: string;
|
|
289
289
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -305,8 +305,8 @@ export interface TransactionsTimeBucketResponse {
|
|
|
305
305
|
prev: (() => Promise<GoldRushResponse<TransactionsTimeBucketResponse>>) | null;
|
|
306
306
|
/** * List of response items. */
|
|
307
307
|
items: Transaction[];
|
|
308
|
-
}
|
|
309
|
-
export
|
|
308
|
+
}>;
|
|
309
|
+
export type TransactionsBlockResponse = Nullable<{
|
|
310
310
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
311
311
|
updated_at: Date;
|
|
312
312
|
/** * The requested chain ID eg: `1`. */
|
|
@@ -315,8 +315,8 @@ export interface TransactionsBlockResponse {
|
|
|
315
315
|
chain_name: ChainName;
|
|
316
316
|
/** * List of response items. */
|
|
317
317
|
items: Transaction[];
|
|
318
|
-
}
|
|
319
|
-
export
|
|
318
|
+
}>;
|
|
319
|
+
export type TransactionsSummaryResponse = Nullable<{
|
|
320
320
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
321
321
|
updated_at: Date;
|
|
322
322
|
/** * The requested address. */
|
|
@@ -327,8 +327,8 @@ export interface TransactionsSummaryResponse {
|
|
|
327
327
|
chain_name: ChainName;
|
|
328
328
|
/** * List of response items. */
|
|
329
329
|
items: TransactionsSummary[];
|
|
330
|
-
}
|
|
331
|
-
export
|
|
330
|
+
}>;
|
|
331
|
+
export type TransactionsSummary = Nullable<{
|
|
332
332
|
/** * The total number of transactions. */
|
|
333
333
|
total_count: number;
|
|
334
334
|
/** * The earliest transaction detected. */
|
|
@@ -337,16 +337,16 @@ export interface TransactionsSummary {
|
|
|
337
337
|
latest_transaction: TransactionSummary;
|
|
338
338
|
/** * The gas summary for the transactions. */
|
|
339
339
|
gas_summary: GasSummary;
|
|
340
|
-
}
|
|
341
|
-
export
|
|
340
|
+
}>;
|
|
341
|
+
export type TransactionSummary = Nullable<{
|
|
342
342
|
/** * The block signed timestamp in UTC. */
|
|
343
343
|
block_signed_at: Date;
|
|
344
344
|
/** * The requested transaction hash. */
|
|
345
345
|
tx_hash: string;
|
|
346
346
|
/** * The link to the transaction details using the Covalent API. */
|
|
347
347
|
tx_detail_link: string;
|
|
348
|
-
}
|
|
349
|
-
export
|
|
348
|
+
}>;
|
|
349
|
+
export type TransactionsResponse = Nullable<{
|
|
350
350
|
/** * The requested address. */
|
|
351
351
|
address: string;
|
|
352
352
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -367,8 +367,8 @@ export interface TransactionsResponse {
|
|
|
367
367
|
prev: (() => Promise<GoldRushResponse<TransactionsResponse>>) | null;
|
|
368
368
|
/** * List of response items. */
|
|
369
369
|
items: Transaction[];
|
|
370
|
-
}
|
|
371
|
-
export
|
|
370
|
+
}>;
|
|
371
|
+
export type TransactionsBlockPageResponse = Nullable<{
|
|
372
372
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
373
373
|
updated_at: Date;
|
|
374
374
|
/** * The requested chain ID eg: `1`. */
|
|
@@ -383,8 +383,8 @@ export interface TransactionsBlockPageResponse {
|
|
|
383
383
|
prev: (() => Promise<GoldRushResponse<TransactionsBlockPageResponse>>) | null;
|
|
384
384
|
/** * List of response items. */
|
|
385
385
|
items: Transaction[];
|
|
386
|
-
}
|
|
387
|
-
export
|
|
386
|
+
}>;
|
|
387
|
+
export type GasSummary = Nullable<{
|
|
388
388
|
/** * The total number of transactions sent by the address. */
|
|
389
389
|
total_sent_count: number;
|
|
390
390
|
/** * The total transaction fees paid by the address, denoted in wei. */
|
|
@@ -399,8 +399,8 @@ export interface GasSummary {
|
|
|
399
399
|
pretty_average_gas_quote_per_tx: string;
|
|
400
400
|
/** * The requested chain native gas token metadata. */
|
|
401
401
|
gas_metadata: ContractMetadata;
|
|
402
|
-
}
|
|
403
|
-
export
|
|
402
|
+
}>;
|
|
403
|
+
export type GetTransactionQueryParamOpts = Nullable<{
|
|
404
404
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
405
405
|
quoteCurrency?: Quote;
|
|
406
406
|
/** * Omit log events. */
|
|
@@ -413,8 +413,8 @@ export interface GetTransactionQueryParamOpts {
|
|
|
413
413
|
withLending?: boolean;
|
|
414
414
|
/** * Include safe details. */
|
|
415
415
|
withSafe?: boolean;
|
|
416
|
-
}
|
|
417
|
-
export
|
|
416
|
+
}>;
|
|
417
|
+
export type GetAllTransactionsForAddressQueryParamOpts = Nullable<{
|
|
418
418
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
419
419
|
quoteCurrency?: Quote;
|
|
420
420
|
/** * Omit log events. */
|
|
@@ -423,16 +423,16 @@ export interface GetAllTransactionsForAddressQueryParamOpts {
|
|
|
423
423
|
blockSignedAtAsc?: boolean;
|
|
424
424
|
/** * Include safe details. */
|
|
425
425
|
withSafe?: boolean;
|
|
426
|
-
}
|
|
427
|
-
export
|
|
426
|
+
}>;
|
|
427
|
+
export type GetTransactionsForBlockQueryParamOpts = Nullable<{
|
|
428
428
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
429
429
|
quoteCurrency?: Quote;
|
|
430
430
|
/** * Omit log events. */
|
|
431
431
|
noLogs?: boolean;
|
|
432
432
|
/** * Include safe details. */
|
|
433
433
|
withSafe?: boolean;
|
|
434
|
-
}
|
|
435
|
-
export
|
|
434
|
+
}>;
|
|
435
|
+
export type GetTransactionsForAddressV3QueryParamOpts = Nullable<{
|
|
436
436
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
437
437
|
quoteCurrency?: Quote;
|
|
438
438
|
/** * Omit log events. */
|
|
@@ -441,34 +441,34 @@ export interface GetTransactionsForAddressV3QueryParamOpts {
|
|
|
441
441
|
blockSignedAtAsc?: boolean;
|
|
442
442
|
/** * Include safe details. */
|
|
443
443
|
withSafe?: boolean;
|
|
444
|
-
}
|
|
445
|
-
export
|
|
444
|
+
}>;
|
|
445
|
+
export type GetTimeBucketTransactionsForAddressQueryParamOpts = Nullable<{
|
|
446
446
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
447
447
|
quoteCurrency?: Quote;
|
|
448
448
|
/** * Omit log events. */
|
|
449
449
|
noLogs?: boolean;
|
|
450
450
|
/** * Include safe details. */
|
|
451
451
|
withSafe?: boolean;
|
|
452
|
-
}
|
|
453
|
-
export
|
|
452
|
+
}>;
|
|
453
|
+
export type GetTransactionsForBlockHashByPageQueryParamOpts = Nullable<{
|
|
454
454
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
455
455
|
quoteCurrency?: Quote;
|
|
456
456
|
/** * Omit log events. */
|
|
457
457
|
noLogs?: boolean;
|
|
458
458
|
/** * Include safe details. */
|
|
459
459
|
withSafe?: boolean;
|
|
460
|
-
}
|
|
461
|
-
export
|
|
460
|
+
}>;
|
|
461
|
+
export type GetTransactionsForBlockHashQueryParamOpts = Nullable<{
|
|
462
462
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
463
463
|
quoteCurrency?: Quote;
|
|
464
464
|
/** * Omit log events. */
|
|
465
465
|
noLogs?: boolean;
|
|
466
466
|
/** * Include safe details. */
|
|
467
467
|
withSafe?: boolean;
|
|
468
|
-
}
|
|
469
|
-
export
|
|
468
|
+
}>;
|
|
469
|
+
export type GetTransactionSummaryQueryParamOpts = Nullable<{
|
|
470
470
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
471
471
|
quoteCurrency?: Quote;
|
|
472
472
|
/** * Include gas summary details. Additional charge of 1 credit when true. Response times may be impacted for wallets with millions of transactions. */
|
|
473
473
|
withGas?: boolean;
|
|
474
|
-
}
|
|
474
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@covalenthq/client-sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"module": "dist/esm/index.js",
|
|
60
60
|
"exports": {
|
|
61
61
|
".": {
|
|
62
|
-
"default": "./dist/esm/index.js",
|
|
63
62
|
"import": "./dist/esm/index.js",
|
|
64
|
-
"require": "./dist/cjs/index.js"
|
|
63
|
+
"require": "./dist/cjs/index.js",
|
|
64
|
+
"default": "./dist/esm/index.js"
|
|
65
65
|
},
|
|
66
66
|
"./cjs": "./cjs/index.js",
|
|
67
67
|
"./esm": "./esm/index.js",
|