@covalenthq/client-sdk 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +30 -17
- package/dist/es/index.d.ts +0 -17
- package/dist/es/index.js +0 -2854
- package/dist/es/index.js.map +0 -1
- package/dist/es/src/GoldRushClient.d.ts +0 -20
- package/dist/es/src/services/BalanceService.d.ts +0 -125
- package/dist/es/src/services/BaseService.d.ts +0 -161
- package/dist/es/src/services/NftService.d.ts +0 -157
- package/dist/es/src/services/PricingService.d.ts +0 -25
- package/dist/es/src/services/SecurityService.d.ts +0 -28
- package/dist/es/src/services/TransactionService.d.ts +0 -128
- package/dist/es/src/utils/functions/bigIntParser.d.ts +0 -1
- package/dist/es/src/utils/functions/calculatePrettyBalance.d.ts +0 -1
- package/dist/es/src/utils/functions/debugOutput.d.ts +0 -2
- package/dist/es/src/utils/functions/endpointGenerator.d.ts +0 -4
- package/dist/es/src/utils/functions/execution.d.ts +0 -11
- package/dist/es/src/utils/functions/isValidApiKey.d.ts +0 -1
- package/dist/es/src/utils/functions/paginateEndpoint.d.ts +0 -7
- package/dist/es/src/utils/functions/prettifyCurrency.d.ts +0 -2
- package/dist/es/src/utils/types/BalanceService.types.d.ts +0 -442
- package/dist/es/src/utils/types/BaseService.types.d.ts +0 -326
- package/dist/es/src/utils/types/Generic.types.d.ts +0 -477
- package/dist/es/src/utils/types/NftService.types.d.ts +0 -273
- package/dist/es/src/utils/types/PricingService.types.d.ts +0 -39
- package/dist/es/src/utils/types/SecurityService.types.d.ts +0 -122
- package/dist/es/src/utils/types/TransactionService.types.d.ts +0 -474
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import { type ChainID, type ChainName, type LogEvent, type NftData, type Pagination } from "./Generic.types";
|
|
2
|
-
export interface ChainCollectionResponse {
|
|
3
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
4
|
-
updated_at: Date;
|
|
5
|
-
/** * The requested chain ID eg: `1`. */
|
|
6
|
-
chain_id: ChainID;
|
|
7
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
8
|
-
chain_name: ChainName;
|
|
9
|
-
/** * List of response items. */
|
|
10
|
-
items: ChainCollectionItem[];
|
|
11
|
-
/** * Pagination metadata. */
|
|
12
|
-
pagination: Pagination;
|
|
13
|
-
}
|
|
14
|
-
export interface ChainCollectionItem {
|
|
15
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
16
|
-
contract_address: string;
|
|
17
|
-
/** * The string returned by the `name()` method. */
|
|
18
|
-
contract_name: string;
|
|
19
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
20
|
-
is_spam: boolean;
|
|
21
|
-
token_total_supply: number;
|
|
22
|
-
cached_metadata_count: number;
|
|
23
|
-
cached_asset_count: number;
|
|
24
|
-
last_scraped_at: Date;
|
|
25
|
-
}
|
|
26
|
-
export interface NftAddressBalanceNftResponse {
|
|
27
|
-
/** * The requested address. */
|
|
28
|
-
address: string;
|
|
29
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
30
|
-
updated_at: Date;
|
|
31
|
-
/** * List of response items. */
|
|
32
|
-
items: NftTokenContractBalanceItem[];
|
|
33
|
-
}
|
|
34
|
-
export interface NftTokenContractBalanceItem {
|
|
35
|
-
/** * The string returned by the `name()` method. */
|
|
36
|
-
contract_name: string;
|
|
37
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
38
|
-
contract_ticker_symbol: string;
|
|
39
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
40
|
-
contract_address: string;
|
|
41
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
42
|
-
supports_erc: string[];
|
|
43
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
44
|
-
is_spam: boolean;
|
|
45
|
-
last_transfered_at: Date;
|
|
46
|
-
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
47
|
-
balance: bigint;
|
|
48
|
-
balance_24h: bigint;
|
|
49
|
-
type: string;
|
|
50
|
-
/** * The current floor price converted to fiat in `quote-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. */
|
|
51
|
-
floor_price_quote: number;
|
|
52
|
-
/** * A prettier version of the floor price quote for rendering purposes. */
|
|
53
|
-
pretty_floor_price_quote: string;
|
|
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
|
-
floor_price_native_quote: number;
|
|
56
|
-
nft_data: NftData[];
|
|
57
|
-
}
|
|
58
|
-
export interface NftMetadataResponse {
|
|
59
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
60
|
-
updated_at: Date;
|
|
61
|
-
/** * List of response items. */
|
|
62
|
-
items: NftTokenContract[];
|
|
63
|
-
/** * Pagination metadata. */
|
|
64
|
-
pagination: Pagination;
|
|
65
|
-
}
|
|
66
|
-
export interface NftTokenContract {
|
|
67
|
-
/** * The string returned by the `name()` method. */
|
|
68
|
-
contract_name: string;
|
|
69
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
70
|
-
contract_ticker_symbol: string;
|
|
71
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
72
|
-
contract_address: string;
|
|
73
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
74
|
-
is_spam: boolean;
|
|
75
|
-
type: string;
|
|
76
|
-
nft_data: NftData;
|
|
77
|
-
}
|
|
78
|
-
export interface NftTransactionsResponse {
|
|
79
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
80
|
-
updated_at: Date;
|
|
81
|
-
/** * The requested chain ID eg: `1`. */
|
|
82
|
-
chain_id: ChainID;
|
|
83
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
84
|
-
chain_name: ChainName;
|
|
85
|
-
/** * List of response items. */
|
|
86
|
-
items: NftTransaction[];
|
|
87
|
-
}
|
|
88
|
-
export interface NftTransaction {
|
|
89
|
-
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
90
|
-
contract_decimals: number;
|
|
91
|
-
/** * The string returned by the `name()` method. */
|
|
92
|
-
contract_name: string;
|
|
93
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
94
|
-
contract_ticker_symbol: string;
|
|
95
|
-
/** * The contract logo URL. */
|
|
96
|
-
logo_url: string;
|
|
97
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
98
|
-
contract_address: string;
|
|
99
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
100
|
-
supports_erc: string[];
|
|
101
|
-
nft_transactions: NftTransactionItem[];
|
|
102
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
103
|
-
is_spam: boolean;
|
|
104
|
-
}
|
|
105
|
-
export interface NftTransactionItem {
|
|
106
|
-
/** * The block signed timestamp in UTC. */
|
|
107
|
-
block_signed_at: Date;
|
|
108
|
-
/** * The height of the block. */
|
|
109
|
-
block_height: number;
|
|
110
|
-
/** * The requested transaction hash. */
|
|
111
|
-
tx_hash: string;
|
|
112
|
-
/** * The offset is the position of the tx in the block. */
|
|
113
|
-
tx_offset: number;
|
|
114
|
-
/** * Whether or not transaction is successful. */
|
|
115
|
-
successful: boolean;
|
|
116
|
-
/** * The sender's wallet address. */
|
|
117
|
-
from_address: string;
|
|
118
|
-
/** * The label of `from` address. */
|
|
119
|
-
from_address_label: string;
|
|
120
|
-
/** * The receiver's wallet address. */
|
|
121
|
-
to_address: string;
|
|
122
|
-
/** * The label of `to` address. */
|
|
123
|
-
to_address_label: string;
|
|
124
|
-
/** * The value attached to this tx. */
|
|
125
|
-
value: bigint;
|
|
126
|
-
/** * The value attached in `quote-currency` to this tx. */
|
|
127
|
-
value_quote: number;
|
|
128
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
129
|
-
pretty_value_quote: string;
|
|
130
|
-
gas_offered: number;
|
|
131
|
-
/** * The gas spent for this tx. */
|
|
132
|
-
gas_spent: number;
|
|
133
|
-
/** * The gas price at the time of this tx. */
|
|
134
|
-
gas_price: number;
|
|
135
|
-
/** * The total transaction fees (gas_price * gas_spent) paid for this tx, denoted in wei. */
|
|
136
|
-
fees_paid: bigint;
|
|
137
|
-
/** * The gas spent in `quote-currency` denomination. */
|
|
138
|
-
gas_quote: number;
|
|
139
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
140
|
-
pretty_gas_quote: string;
|
|
141
|
-
gas_quote_rate: number;
|
|
142
|
-
/** * The log events. */
|
|
143
|
-
log_events: LogEvent[];
|
|
144
|
-
}
|
|
145
|
-
export interface NftCollectionTraitsResponse {
|
|
146
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
147
|
-
updated_at: Date;
|
|
148
|
-
/** * List of response items. */
|
|
149
|
-
items: NftTrait[];
|
|
150
|
-
}
|
|
151
|
-
export interface NftTrait {
|
|
152
|
-
name: string;
|
|
153
|
-
}
|
|
154
|
-
export interface NftCollectionAttributesForTraitResponse {
|
|
155
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
156
|
-
updated_at: Date;
|
|
157
|
-
/** * List of response items. */
|
|
158
|
-
items: NftSummaryAttribute[];
|
|
159
|
-
}
|
|
160
|
-
export interface NftSummaryAttribute {
|
|
161
|
-
trait_type: string;
|
|
162
|
-
values: NftAttribute[];
|
|
163
|
-
unique_values: number;
|
|
164
|
-
}
|
|
165
|
-
export interface NftAttribute {
|
|
166
|
-
value: string;
|
|
167
|
-
count: number;
|
|
168
|
-
}
|
|
169
|
-
export interface NftCollectionTraitsSummaryResponse {
|
|
170
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
171
|
-
updated_at: Date;
|
|
172
|
-
/** * List of response items. */
|
|
173
|
-
items: NftTraitSummary[];
|
|
174
|
-
}
|
|
175
|
-
export interface NftTraitSummary {
|
|
176
|
-
/** * Trait name */
|
|
177
|
-
name: string;
|
|
178
|
-
/** * Type of the value of the trait. */
|
|
179
|
-
value_type: string;
|
|
180
|
-
/** * Populated for `numeric` traits. */
|
|
181
|
-
value_numeric: NftTraitNumeric;
|
|
182
|
-
/** * Populated for `string` traits. */
|
|
183
|
-
value_string: NftTraitString;
|
|
184
|
-
attributes: NftSummaryAttribute[];
|
|
185
|
-
}
|
|
186
|
-
export interface NftTraitNumeric {
|
|
187
|
-
min: number;
|
|
188
|
-
max: number;
|
|
189
|
-
}
|
|
190
|
-
export interface NftTraitString {
|
|
191
|
-
/** * String value */
|
|
192
|
-
value: string;
|
|
193
|
-
/** * Number of distinct tokens that have this trait value. */
|
|
194
|
-
token_count: number;
|
|
195
|
-
/** * Percentage of tokens in the collection that have this trait. */
|
|
196
|
-
trait_percentage: number;
|
|
197
|
-
}
|
|
198
|
-
export interface NftOwnershipForCollectionResponse {
|
|
199
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
200
|
-
updated_at: Date;
|
|
201
|
-
/** * The requested address. */
|
|
202
|
-
address: string;
|
|
203
|
-
/** * The requested collection. */
|
|
204
|
-
collection: string;
|
|
205
|
-
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
206
|
-
is_spam: boolean;
|
|
207
|
-
/** * List of response items. */
|
|
208
|
-
items: NftOwnershipForCollectionItem[];
|
|
209
|
-
}
|
|
210
|
-
export interface NftOwnershipForCollectionItem {
|
|
211
|
-
/** * The string returned by the `name()` method. */
|
|
212
|
-
contract_name: string;
|
|
213
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
214
|
-
contract_ticker_symbol: string;
|
|
215
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
216
|
-
contract_address: string;
|
|
217
|
-
/** * The token's id. */
|
|
218
|
-
token_id: bigint;
|
|
219
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
220
|
-
supports_erc: string[];
|
|
221
|
-
last_transfered_at: Date;
|
|
222
|
-
/** * Nft balance. */
|
|
223
|
-
balance: bigint;
|
|
224
|
-
balance_24h: bigint;
|
|
225
|
-
type: string;
|
|
226
|
-
nft_data: NftData;
|
|
227
|
-
}
|
|
228
|
-
export interface GetChainCollectionsQueryParamOpts {
|
|
229
|
-
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
230
|
-
pageSize?: number;
|
|
231
|
-
/** * 0-indexed page number to begin pagination. */
|
|
232
|
-
pageNumber?: number;
|
|
233
|
-
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
234
|
-
noSpam?: boolean;
|
|
235
|
-
}
|
|
236
|
-
export interface GetNftsForAddressQueryParamOpts {
|
|
237
|
-
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
238
|
-
noSpam?: boolean;
|
|
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
|
-
noNftAssetMetadata?: boolean;
|
|
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
|
-
withUncached?: boolean;
|
|
243
|
-
}
|
|
244
|
-
export interface GetTokenIdsForContractWithMetadataQueryParamOpts {
|
|
245
|
-
/** * Omit metadata. */
|
|
246
|
-
noMetadata?: boolean;
|
|
247
|
-
/** * Number of items per page. Omitting this parameter defaults to 100. */
|
|
248
|
-
pageSize?: number;
|
|
249
|
-
/** * 0-indexed page number to begin pagination. */
|
|
250
|
-
pageNumber?: number;
|
|
251
|
-
/** * Filters NFTs based on a specific trait. If this filter is used, the API will return all NFTs with the specified trait. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding. */
|
|
252
|
-
traitsFilter?: string;
|
|
253
|
-
/** * Filters NFTs based on a specific trait value. If this filter is used, the API will return all NFTs with the specified trait value. If used with "traits-filter", only NFTs matching both filters will be returned. Accepts comma-separated values, is case-sensitive, and requires proper URL encoding. */
|
|
254
|
-
valuesFilter?: string;
|
|
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
|
-
withUncached?: boolean;
|
|
257
|
-
}
|
|
258
|
-
export interface GetNftMetadataForGivenTokenIdForContractQueryParamOpts {
|
|
259
|
-
/** * Omit metadata. */
|
|
260
|
-
noMetadata?: boolean;
|
|
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
|
-
withUncached?: boolean;
|
|
263
|
-
}
|
|
264
|
-
export interface GetNftTransactionsForContractTokenIdQueryParamOpts {
|
|
265
|
-
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
266
|
-
noSpam?: boolean;
|
|
267
|
-
}
|
|
268
|
-
export interface CheckOwnershipInNftQueryParamOpts {
|
|
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
|
-
traitsFilter?: string;
|
|
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
|
-
valuesFilter?: string;
|
|
273
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type ContractMetadata, type LogoUrls } from "./Generic.types";
|
|
2
|
-
export interface TokenPricesResponse {
|
|
3
|
-
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
4
|
-
contract_decimals: number;
|
|
5
|
-
/** * The string returned by the `name()` method. */
|
|
6
|
-
contract_name: string;
|
|
7
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
8
|
-
contract_ticker_symbol: string;
|
|
9
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
10
|
-
contract_address: string;
|
|
11
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
12
|
-
supports_erc: string[];
|
|
13
|
-
/** * The contract logo URL. */
|
|
14
|
-
logo_url: string;
|
|
15
|
-
update_at: Date;
|
|
16
|
-
/** * The requested quote currency eg: `USD`. */
|
|
17
|
-
quote_currency: string;
|
|
18
|
-
/** * The contract logo URLs. */
|
|
19
|
-
logo_urls: LogoUrls;
|
|
20
|
-
/** * List of response items. */
|
|
21
|
-
items: Price[];
|
|
22
|
-
}
|
|
23
|
-
export interface Price {
|
|
24
|
-
contract_metadata: ContractMetadata;
|
|
25
|
-
/** * The date of the price capture. */
|
|
26
|
-
date: Date;
|
|
27
|
-
/** * The price in the requested `quote-currency`. */
|
|
28
|
-
price: number;
|
|
29
|
-
/** * A prettier version of the price for rendering purposes. */
|
|
30
|
-
pretty_price: string;
|
|
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,122 +0,0 @@
|
|
|
1
|
-
import { type ChainID, type ChainName } from "./Generic.types";
|
|
2
|
-
export interface ApprovalsResponse {
|
|
3
|
-
/** * The requested address. */
|
|
4
|
-
address: string;
|
|
5
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
6
|
-
updated_at: Date;
|
|
7
|
-
/** * The requested quote currency eg: `USD`. */
|
|
8
|
-
quote_currency: string;
|
|
9
|
-
/** * The requested chain ID eg: `1`. */
|
|
10
|
-
chain_id: ChainID;
|
|
11
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
12
|
-
chain_name: ChainName;
|
|
13
|
-
/** * List of response items. */
|
|
14
|
-
items: TokensApprovalItem[];
|
|
15
|
-
}
|
|
16
|
-
export interface TokensApprovalItem {
|
|
17
|
-
/** * The address for the token that has approvals. */
|
|
18
|
-
token_address: string;
|
|
19
|
-
/** * The name for the token that has approvals. */
|
|
20
|
-
token_address_label: string;
|
|
21
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
22
|
-
ticker_symbol: string;
|
|
23
|
-
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
24
|
-
contract_decimals: number;
|
|
25
|
-
/** * The contract logo URL. */
|
|
26
|
-
logo_url: string;
|
|
27
|
-
/** * The exchange rate for the requested quote currency. */
|
|
28
|
-
quote_rate: number;
|
|
29
|
-
/** * Wallet balance of the token. */
|
|
30
|
-
balance: bigint;
|
|
31
|
-
/** * Value of the wallet balance of the token. */
|
|
32
|
-
balance_quote: number;
|
|
33
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
34
|
-
pretty_balance_quote: string;
|
|
35
|
-
/** * Total amount at risk across all spenders. */
|
|
36
|
-
value_at_risk: string;
|
|
37
|
-
/** * Value of total amount at risk across all spenders. */
|
|
38
|
-
value_at_risk_quote: number;
|
|
39
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
40
|
-
pretty_value_at_risk_quote: string;
|
|
41
|
-
/** * Contracts with non-zero approvals for this token. */
|
|
42
|
-
spenders: TokenSpenderItem[];
|
|
43
|
-
}
|
|
44
|
-
export interface TokenSpenderItem {
|
|
45
|
-
/** * The height of the block. */
|
|
46
|
-
block_height: number;
|
|
47
|
-
/** * The offset is the position of the tx in the block. */
|
|
48
|
-
tx_offset: number;
|
|
49
|
-
/** * The offset is the position of the log entry within an event log." */
|
|
50
|
-
log_offset: number;
|
|
51
|
-
/** * The block signed timestamp in UTC. */
|
|
52
|
-
block_signed_at: Date;
|
|
53
|
-
/** * Most recent transaction that updated approval amounts for the token. */
|
|
54
|
-
tx_hash: string;
|
|
55
|
-
/** * Address of the contract with approval for the token. */
|
|
56
|
-
spender_address: string;
|
|
57
|
-
/** * Name of the contract with approval for the token. */
|
|
58
|
-
spender_address_label: string;
|
|
59
|
-
/** * Remaining number of tokens granted to the spender by the approval. */
|
|
60
|
-
allowance: string;
|
|
61
|
-
/** * Value of the remaining allowance specified by the approval. */
|
|
62
|
-
allowance_quote: number;
|
|
63
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
64
|
-
pretty_allowance_quote: string;
|
|
65
|
-
/** * Amount at risk for spender. */
|
|
66
|
-
value_at_risk: string;
|
|
67
|
-
/** * Value of amount at risk for spender. */
|
|
68
|
-
value_at_risk_quote: number;
|
|
69
|
-
/** * A prettier version of the quote for rendering purposes. */
|
|
70
|
-
pretty_value_at_risk_quote: string;
|
|
71
|
-
risk_factor: string;
|
|
72
|
-
}
|
|
73
|
-
export interface NftApprovalsResponse {
|
|
74
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
75
|
-
updated_at: Date;
|
|
76
|
-
/** * The requested chain ID eg: `1`. */
|
|
77
|
-
chain_id: ChainID;
|
|
78
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
79
|
-
chain_name: ChainName;
|
|
80
|
-
/** * The requested address. */
|
|
81
|
-
address: string;
|
|
82
|
-
/** * List of response items. */
|
|
83
|
-
items: NftApprovalsItem[];
|
|
84
|
-
}
|
|
85
|
-
export interface NftApprovalsItem {
|
|
86
|
-
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
87
|
-
contract_address: string;
|
|
88
|
-
/** * The label of the contract address. */
|
|
89
|
-
contract_address_label: string;
|
|
90
|
-
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
91
|
-
contract_ticker_symbol: string;
|
|
92
|
-
/** * List of asset balances held by the user. */
|
|
93
|
-
token_balances: NftApprovalBalance[];
|
|
94
|
-
/** * Contracts with non-zero approvals for this token. */
|
|
95
|
-
spenders: NftApprovalSpender[];
|
|
96
|
-
}
|
|
97
|
-
export interface NftApprovalBalance {
|
|
98
|
-
/** * The token's id. */
|
|
99
|
-
token_id: bigint;
|
|
100
|
-
/** * The NFT's token balance. */
|
|
101
|
-
token_balance: bigint;
|
|
102
|
-
}
|
|
103
|
-
export interface NftApprovalSpender {
|
|
104
|
-
/** * The height of the block. */
|
|
105
|
-
block_height: number;
|
|
106
|
-
/** * The offset is the position of the tx in the block. */
|
|
107
|
-
tx_offset: number;
|
|
108
|
-
/** * The offset is the position of the log entry within an event log." */
|
|
109
|
-
log_offset: number;
|
|
110
|
-
/** * The block signed timestamp in UTC. */
|
|
111
|
-
block_signed_at: Date;
|
|
112
|
-
/** * Most recent transaction that updated approval amounts for the token. */
|
|
113
|
-
tx_hash: string;
|
|
114
|
-
/** * Address of the contract with approval for the token. */
|
|
115
|
-
spender_address: string;
|
|
116
|
-
/** * Name of the contract with approval for the token. */
|
|
117
|
-
spender_address_label: string;
|
|
118
|
-
/** * The token ids approved. */
|
|
119
|
-
token_ids_approved: string;
|
|
120
|
-
/** * Remaining number of tokens granted to the spender by the approval. */
|
|
121
|
-
allowance: string;
|
|
122
|
-
}
|