@covalenthq/client-sdk 2.3.1 → 2.3.3
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 → index.js} +92 -32
- package/dist/index.js.map +1 -0
- package/dist/{esm/src → src}/services/StreamingService.d.ts +26 -1
- package/dist/{esm/src → src}/utils/types/Generic.types.d.ts +11 -27
- package/dist/{esm/src → src}/utils/types/StreamingService.types.d.ts +22 -1
- package/package.json +18 -23
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/src/services/StreamingService.d.ts +0 -151
- package/dist/cjs/src/utils/types/Generic.types.d.ts +0 -391
- package/dist/cjs/src/utils/types/StreamingService.types.d.ts +0 -201
- package/dist/esm/index.d.ts +0 -16
- package/dist/esm/index.js +0 -5696
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/src/GoldRushClient.d.ts +0 -27
- package/dist/esm/src/services/AllChainsService.d.ts +0 -63
- package/dist/esm/src/services/BalanceService.d.ts +0 -125
- package/dist/esm/src/services/BaseService.d.ts +0 -163
- package/dist/esm/src/services/BitcoinService.d.ts +0 -40
- package/dist/esm/src/services/NftService.d.ts +0 -193
- package/dist/esm/src/services/PricingService.d.ts +0 -36
- package/dist/esm/src/services/SecurityService.d.ts +0 -28
- package/dist/esm/src/services/TransactionService.d.ts +0 -134
- package/dist/esm/src/utils/functions/bigIntParser.d.ts +0 -1
- package/dist/esm/src/utils/functions/calculatePrettyBalance.d.ts +0 -1
- package/dist/esm/src/utils/functions/debugOutput.d.ts +0 -2
- package/dist/esm/src/utils/functions/endpointGenerator.d.ts +0 -4
- package/dist/esm/src/utils/functions/execution.d.ts +0 -11
- package/dist/esm/src/utils/functions/isValidApiKey.d.ts +0 -1
- package/dist/esm/src/utils/functions/paginateEndpoint.d.ts +0 -7
- package/dist/esm/src/utils/functions/prettifyCurrency.d.ts +0 -2
- package/dist/esm/src/utils/functions/timestamp-parser.d.ts +0 -1
- package/dist/esm/src/utils/types/AllChainService.types.d.ts +0 -123
- package/dist/esm/src/utils/types/BalanceService.types.d.ts +0 -442
- package/dist/esm/src/utils/types/BaseService.types.d.ts +0 -312
- package/dist/esm/src/utils/types/BitcoinService.types.d.ts +0 -88
- package/dist/esm/src/utils/types/NftService.types.d.ts +0 -355
- package/dist/esm/src/utils/types/PricingService.types.d.ts +0 -80
- package/dist/esm/src/utils/types/SecurityService.types.d.ts +0 -124
- package/dist/esm/src/utils/types/TransactionService.types.d.ts +0 -392
- /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
- /package/dist/{cjs/src → src}/GoldRushClient.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/AllChainsService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/BalanceService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/BaseService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/BitcoinService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/NftService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/PricingService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/SecurityService.d.ts +0 -0
- /package/dist/{cjs/src → src}/services/TransactionService.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/bigIntParser.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/calculatePrettyBalance.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/debugOutput.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/endpointGenerator.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/execution.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/isValidApiKey.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/paginateEndpoint.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/prettifyCurrency.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/functions/timestamp-parser.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/AllChainService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/BalanceService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/BaseService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/BitcoinService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/NftService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/PricingService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/SecurityService.types.d.ts +0 -0
- /package/dist/{cjs/src → src}/utils/types/TransactionService.types.d.ts +0 -0
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
import { type ChainID, type ChainName, type LogEvent, type NftData, type Nullable, type Pagination, type Quote } from "./Generic.types";
|
|
2
|
-
export type ChainCollectionResponse = Nullable<{
|
|
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 type ChainCollectionItem = Nullable<{
|
|
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 type NftAddressBalanceNftResponse = Nullable<{
|
|
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 type NftTokenContractBalanceItem = Nullable<{
|
|
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 type NftMetadataResponse = Nullable<{
|
|
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 type NftTokenContract = Nullable<{
|
|
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 type NftTransactionsResponse = Nullable<{
|
|
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 type NftTransaction = Nullable<{
|
|
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 type NftTransactionItem = Nullable<{
|
|
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 type NftCollectionTraitsResponse = Nullable<{
|
|
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 type NftTrait = Nullable<{
|
|
152
|
-
name: string;
|
|
153
|
-
}>;
|
|
154
|
-
export type NftCollectionAttributesForTraitResponse = Nullable<{
|
|
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 type NftSummaryAttribute = Nullable<{
|
|
161
|
-
trait_type: string;
|
|
162
|
-
values: NftAttribute[];
|
|
163
|
-
unique_values: number;
|
|
164
|
-
}>;
|
|
165
|
-
export type NftAttribute = Nullable<{
|
|
166
|
-
value: string;
|
|
167
|
-
count: number;
|
|
168
|
-
}>;
|
|
169
|
-
export type NftCollectionTraitsSummaryResponse = Nullable<{
|
|
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 type NftTraitSummary = Nullable<{
|
|
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 type NftTraitNumeric = Nullable<{
|
|
187
|
-
min: number;
|
|
188
|
-
max: number;
|
|
189
|
-
}>;
|
|
190
|
-
export type NftTraitString = Nullable<{
|
|
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 type NftOwnershipForCollectionResponse = Nullable<{
|
|
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 type NftOwnershipForCollectionItem = Nullable<{
|
|
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 type GetChainCollectionsQueryParamOpts = Nullable<{
|
|
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 type GetNftsForAddressQueryParamOpts = Nullable<{
|
|
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 type GetTokenIdsForContractWithMetadataQueryParamOpts = Nullable<{
|
|
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 type GetNftMetadataForGivenTokenIdForContractQueryParamOpts = Nullable<{
|
|
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 type GetNftTransactionsForContractTokenIdQueryParamOpts = Nullable<{
|
|
265
|
-
/** * If `true`, the suspected spam tokens are removed. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
266
|
-
noSpam?: boolean;
|
|
267
|
-
}>;
|
|
268
|
-
export type CheckOwnershipInNftQueryParamOpts = Nullable<{
|
|
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
|
-
}>;
|
|
274
|
-
export type GetCollectionMarketDataQueryParamOpts = Nullable<{
|
|
275
|
-
/** * The requested quote currency eg: `USD`. */
|
|
276
|
-
quote_currency?: Quote;
|
|
277
|
-
/** The number of days to return data for. Request up 365 days. Defaults to 30 days. */
|
|
278
|
-
days?: number;
|
|
279
|
-
}>;
|
|
280
|
-
export type NftCollectionFloorPriceResponse = Nullable<{
|
|
281
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
282
|
-
updated_at: Date;
|
|
283
|
-
/** The requested address. */
|
|
284
|
-
address: string;
|
|
285
|
-
/** * The requested quote currency eg: `USD`. */
|
|
286
|
-
quote_currency: Quote;
|
|
287
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
288
|
-
chain_name: ChainName;
|
|
289
|
-
/** * The requested chain ID eg: `1`. */
|
|
290
|
-
chain_id: ChainID;
|
|
291
|
-
/** * List of response items. */
|
|
292
|
-
items: NftCollectionFloorPriceItem[];
|
|
293
|
-
}>;
|
|
294
|
-
export type NftCollectionFloorPriceItem = Nullable<{
|
|
295
|
-
/** * The timestamp of the date of sale. */
|
|
296
|
-
date: Date;
|
|
297
|
-
/** * The ticker symbol for the native currency. */
|
|
298
|
-
native_ticker_symbol: string;
|
|
299
|
-
/** * The contract name of the native currency. */
|
|
300
|
-
native_name: string;
|
|
301
|
-
/** * The current floor price in native currency. */
|
|
302
|
-
floor_price_native_quote: number;
|
|
303
|
-
/** * The current floor price converted to fiat in quote-currency. */
|
|
304
|
-
floor_price_quote: number;
|
|
305
|
-
/** * A prettier version of the floor price quote for rendering purposes. */
|
|
306
|
-
pretty_floor_price_quote: string;
|
|
307
|
-
}>;
|
|
308
|
-
export type NftCollectionVolumeResponse = Nullable<{
|
|
309
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
310
|
-
updated_at: Date;
|
|
311
|
-
/** The requested address. */
|
|
312
|
-
address: string;
|
|
313
|
-
/** * The requested quote currency eg: `USD`. */
|
|
314
|
-
quote_currency: Quote;
|
|
315
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
316
|
-
chain_name: ChainName;
|
|
317
|
-
/** * The requested chain ID eg: `1`. */
|
|
318
|
-
chain_id: ChainID;
|
|
319
|
-
/** * List of response items. */
|
|
320
|
-
items: NftCollectionVolumeItem[];
|
|
321
|
-
}>;
|
|
322
|
-
export type NftCollectionVolumeItem = Nullable<{
|
|
323
|
-
/** * The timestamp of the date of sale. */
|
|
324
|
-
date: Date;
|
|
325
|
-
/** * The ticker symbol for the native currency. */
|
|
326
|
-
native_ticker_symbol: string;
|
|
327
|
-
/** * The contract name of the native currency. */
|
|
328
|
-
native_name: string;
|
|
329
|
-
/** * The current volume converted to fiat in `quoteCurrency`. */
|
|
330
|
-
volume_quote: number;
|
|
331
|
-
/** * The current volume in native currency. */
|
|
332
|
-
volume_native_quote: number;
|
|
333
|
-
/** * A prettier version of the volume quote for rendering purposes. */
|
|
334
|
-
pretty_volume_quote: string;
|
|
335
|
-
}>;
|
|
336
|
-
export type NftCollectionSalesCountResponse = Nullable<{
|
|
337
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
338
|
-
updated_at: Date;
|
|
339
|
-
/** The requested address. */
|
|
340
|
-
address: string;
|
|
341
|
-
/** * The requested quote currency eg: `USD`. */
|
|
342
|
-
quote_currency: Quote;
|
|
343
|
-
/** * The requested chain name eg: `eth-mainnet`. */
|
|
344
|
-
chain_name: ChainName;
|
|
345
|
-
/** * The requested chain ID eg: `1`. */
|
|
346
|
-
chain_id: ChainID;
|
|
347
|
-
/** * List of response items. */
|
|
348
|
-
items: NftCollectionSalesCountItem[];
|
|
349
|
-
}>;
|
|
350
|
-
export type NftCollectionSalesCountItem = Nullable<{
|
|
351
|
-
/** * The timestamp of the date of sale. */
|
|
352
|
-
date: Date;
|
|
353
|
-
/** * The total amount of sales for the current day. */
|
|
354
|
-
sales_count: string;
|
|
355
|
-
}>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { type ContractMetadata, type LogoUrls, type Nullable, type Quote } from "./Generic.types";
|
|
2
|
-
export type TokenPricesResponse = Nullable<{
|
|
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
|
-
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
16
|
-
update_at: Date;
|
|
17
|
-
/** * The requested quote currency eg: `USD`. */
|
|
18
|
-
quote_currency: Quote;
|
|
19
|
-
/** * The contract logo URLs. */
|
|
20
|
-
logo_urls: LogoUrls;
|
|
21
|
-
/** * List of response items. */
|
|
22
|
-
items: Price[];
|
|
23
|
-
}>;
|
|
24
|
-
export type Price = Nullable<{
|
|
25
|
-
contract_metadata: ContractMetadata;
|
|
26
|
-
/** * The date of the price capture. */
|
|
27
|
-
date: Date;
|
|
28
|
-
/** * The price in the requested `quote-currency`. */
|
|
29
|
-
price: number;
|
|
30
|
-
/** * A prettier version of the price for rendering purposes. */
|
|
31
|
-
pretty_price: string;
|
|
32
|
-
}>;
|
|
33
|
-
export type GetTokenPricesQueryParamOpts = Nullable<{
|
|
34
|
-
/** * The start day of the historical price range (YYYY-MM-DD). */
|
|
35
|
-
from?: string;
|
|
36
|
-
/** * The end day of the historical price range (YYYY-MM-DD). */
|
|
37
|
-
to?: string;
|
|
38
|
-
/** * Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order. */
|
|
39
|
-
pricesAtAsc?: boolean;
|
|
40
|
-
}>;
|
|
41
|
-
export type PoolSpotPriceQueryParamsOpts = Nullable<{
|
|
42
|
-
/** * The currency to convert. */
|
|
43
|
-
quoteCurrency: string;
|
|
44
|
-
}>;
|
|
45
|
-
export type PoolSpotPricesResponse = Nullable<{
|
|
46
|
-
/** * The timestamp when the response was generated. */
|
|
47
|
-
updated_at: Date;
|
|
48
|
-
/** * The pool contract address. */
|
|
49
|
-
pool_address: string;
|
|
50
|
-
/** * The contract address of token_0 in the token pair making up the pool. */
|
|
51
|
-
token_0_address: string;
|
|
52
|
-
/** * The contract name of token_0 in the token pair making up the pool. */
|
|
53
|
-
token_0_name: string;
|
|
54
|
-
/** * The contract symbol of token_0 in the token pair making up the pool. */
|
|
55
|
-
token_0_ticker: string;
|
|
56
|
-
/** * Price of token_0 in units of token_1. */
|
|
57
|
-
token_0_price: string;
|
|
58
|
-
/** * Price of token_0 in units of token_1 as of 24 hours ago. */
|
|
59
|
-
token_0_price_24h: string;
|
|
60
|
-
/** * Price of token_0 in the selected quote currency (defaults to USD). */
|
|
61
|
-
token_0_price_quote: string;
|
|
62
|
-
/** * Price of token_0 in the selected quote currency (defaults to USD) as of 24 hours ago. */
|
|
63
|
-
token_0_price_24h_quote: string;
|
|
64
|
-
/** * The contract address of token_1 in the token pair making up the pool. */
|
|
65
|
-
token_1_address: string;
|
|
66
|
-
/** * The contract name of token_1 in the token pair making up the pool. */
|
|
67
|
-
token_1_name: string;
|
|
68
|
-
/** * The contract symbol of token_1 in the token pair making up the pool. */
|
|
69
|
-
token_1_ticker: string;
|
|
70
|
-
/** * Price of token_1 in units of token_0. */
|
|
71
|
-
token_1_price: string;
|
|
72
|
-
/** * Price of token_1 in units of token_0 as of 24 hours ago. */
|
|
73
|
-
token_1_price_24h: string;
|
|
74
|
-
/** * Price of token_1 in the selected quote currency (defaults to USD). */
|
|
75
|
-
token_1_price_quote: string;
|
|
76
|
-
/** * Price of token_1 in the selected quote currency (defaults to USD) as of 24 hours ago. */
|
|
77
|
-
token_1_price_24h_quote: string;
|
|
78
|
-
/** * The currency to convert. */
|
|
79
|
-
quote_currency: string;
|
|
80
|
-
}>;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { type ChainID, type ChainName, type Nullable, type Quote } from "./Generic.types";
|
|
2
|
-
export type ApprovalsResponse = Nullable<{
|
|
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: Quote;
|
|
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 type TokensApprovalItem = Nullable<{
|
|
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 type TokenSpenderItem = Nullable<{
|
|
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 type NftApprovalsResponse = Nullable<{
|
|
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 type NftApprovalsItem = Nullable<{
|
|
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
|
-
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
93
|
-
supports_erc: string[];
|
|
94
|
-
/** * List of asset balances held by the user. */
|
|
95
|
-
token_balances: NftApprovalBalance[];
|
|
96
|
-
/** * Contracts with non-zero approvals for this token. */
|
|
97
|
-
spenders: NftApprovalSpender[];
|
|
98
|
-
}>;
|
|
99
|
-
export type NftApprovalBalance = Nullable<{
|
|
100
|
-
/** * The token's id. */
|
|
101
|
-
token_id: bigint;
|
|
102
|
-
/** * The NFT's token balance. */
|
|
103
|
-
token_balance: bigint;
|
|
104
|
-
}>;
|
|
105
|
-
export type NftApprovalSpender = Nullable<{
|
|
106
|
-
/** * The height of the block. */
|
|
107
|
-
block_height: number;
|
|
108
|
-
/** * The offset is the position of the tx in the block. */
|
|
109
|
-
tx_offset: number;
|
|
110
|
-
/** * The offset is the position of the log entry within an event log." */
|
|
111
|
-
log_offset: number;
|
|
112
|
-
/** * The block signed timestamp in UTC. */
|
|
113
|
-
block_signed_at: Date;
|
|
114
|
-
/** * Most recent transaction that updated approval amounts for the token. */
|
|
115
|
-
tx_hash: string;
|
|
116
|
-
/** * Address of the contract with approval for the token. */
|
|
117
|
-
spender_address: string;
|
|
118
|
-
/** * Name of the contract with approval for the token. */
|
|
119
|
-
spender_address_label: string;
|
|
120
|
-
/** * The token ids approved. */
|
|
121
|
-
token_ids_approved: string;
|
|
122
|
-
/** * Remaining number of tokens granted to the spender by the approval. */
|
|
123
|
-
allowance: string;
|
|
124
|
-
}>;
|