@covalenthq/client-sdk 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +61 -24
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/BalanceService.d.ts +32 -21
- package/dist/cjs/services/BaseService.d.ts +8 -1
- package/dist/cjs/services/CovalentClient.d.ts +3 -3
- package/dist/cjs/services/NftService.d.ts +12 -8
- package/dist/cjs/services/PricingService.d.ts +2 -2
- package/dist/cjs/services/TransactionService.d.ts +11 -11
- package/dist/cjs/services/XykService.d.ts +50 -50
- package/dist/cjs/util/Chains.d.ts +29 -4
- package/dist/cjs/util/types/BalanceServiceTypes.d.ts +45 -7
- package/dist/cjs/util/types/BaseServiceTypes.d.ts +7 -1
- package/dist/cjs/util/types/GenericTypes.d.ts +2 -0
- package/dist/cjs/util/types/NftServiceTypes.d.ts +8 -8
- package/dist/cjs/util/types/PricingServiceTypes.d.ts +1 -1
- package/dist/cjs/util/types/TransactionServiceTypes.d.ts +10 -10
- package/dist/cjs/util/types/XykServiceTypes.d.ts +51 -51
- package/dist/es/index.js +61 -24
- package/dist/es/index.js.map +1 -1
- package/dist/es/services/BalanceService.d.ts +32 -21
- package/dist/es/services/BaseService.d.ts +8 -1
- package/dist/es/services/CovalentClient.d.ts +3 -3
- package/dist/es/services/NftService.d.ts +12 -8
- package/dist/es/services/PricingService.d.ts +2 -2
- package/dist/es/services/TransactionService.d.ts +11 -11
- package/dist/es/services/XykService.d.ts +50 -50
- package/dist/es/util/Chains.d.ts +29 -4
- package/dist/es/util/types/BalanceServiceTypes.d.ts +45 -7
- package/dist/es/util/types/BaseServiceTypes.d.ts +7 -1
- package/dist/es/util/types/GenericTypes.d.ts +2 -0
- package/dist/es/util/types/NftServiceTypes.d.ts +8 -8
- package/dist/es/util/types/PricingServiceTypes.d.ts +1 -1
- package/dist/es/util/types/TransactionServiceTypes.d.ts +10 -10
- package/dist/es/util/types/XykServiceTypes.d.ts +51 -51
- package/dist/esm/index.js +61 -24
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/BalanceService.d.ts +32 -21
- package/dist/esm/services/BaseService.d.ts +8 -1
- package/dist/esm/services/CovalentClient.d.ts +3 -3
- package/dist/esm/services/NftService.d.ts +12 -8
- package/dist/esm/services/PricingService.d.ts +2 -2
- package/dist/esm/services/TransactionService.d.ts +11 -11
- package/dist/esm/services/XykService.d.ts +50 -50
- package/dist/esm/util/Chains.d.ts +29 -4
- package/dist/esm/util/types/BalanceServiceTypes.d.ts +45 -7
- package/dist/esm/util/types/BaseServiceTypes.d.ts +7 -1
- package/dist/esm/util/types/GenericTypes.d.ts +2 -0
- package/dist/esm/util/types/NftServiceTypes.d.ts +8 -8
- package/dist/esm/util/types/PricingServiceTypes.d.ts +1 -1
- package/dist/esm/util/types/TransactionServiceTypes.d.ts +10 -10
- package/dist/esm/util/types/XykServiceTypes.d.ts +51 -51
- package/dist/services/BalanceService.d.ts +32 -21
- package/dist/services/BalanceService.js +15 -11
- package/dist/services/BalanceService.js.map +1 -1
- package/dist/services/BaseService.d.ts +8 -1
- package/dist/services/BaseService.js +7 -1
- package/dist/services/BaseService.js.map +1 -1
- package/dist/services/CovalentClient.d.ts +3 -3
- package/dist/services/CovalentClient.js +1 -1
- package/dist/services/NftService.d.ts +12 -8
- package/dist/services/NftService.js +2 -0
- package/dist/services/NftService.js.map +1 -1
- package/dist/services/PricingService.d.ts +2 -2
- package/dist/services/TransactionService.d.ts +11 -11
- package/dist/services/TransactionService.js.map +1 -1
- package/dist/services/XykService.d.ts +50 -50
- package/dist/services/XykService.js +6 -6
- package/dist/services/XykService.js.map +1 -1
- package/dist/util/Chains.d.ts +29 -4
- package/dist/util/Chains.js +28 -3
- package/dist/util/Chains.js.map +1 -1
- package/dist/util/types/BalanceServiceTypes.d.ts +45 -7
- package/dist/util/types/BaseServiceTypes.d.ts +7 -1
- package/dist/util/types/GenericTypes.d.ts +2 -0
- package/dist/util/types/NftServiceTypes.d.ts +8 -8
- package/dist/util/types/PricingServiceTypes.d.ts +1 -1
- package/dist/util/types/TransactionServiceTypes.d.ts +10 -10
- package/dist/util/types/XykServiceTypes.d.ts +51 -51
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pagination, Explorer, ContractMetadata, LogoUrls, NftCollectionAttribute } from "./GenericTypes";
|
|
2
2
|
export interface BalancesResponse {
|
|
3
3
|
/** * The requested address. */
|
|
4
4
|
address: string;
|
|
@@ -25,7 +25,7 @@ export interface BalanceItem {
|
|
|
25
25
|
/** * A display-friendly name for the contract. */
|
|
26
26
|
contract_display_name: string;
|
|
27
27
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
28
|
-
supports_erc: string;
|
|
28
|
+
supports_erc: string[];
|
|
29
29
|
/** * The contract logo URL. */
|
|
30
30
|
logo_url: string;
|
|
31
31
|
/** * The contract logo URLs. */
|
|
@@ -57,12 +57,47 @@ export interface BalanceItem {
|
|
|
57
57
|
/** * The protocol metadata. */
|
|
58
58
|
protocol_metadata: ProtocolMetadata;
|
|
59
59
|
/** * NFT-specific data. */
|
|
60
|
-
nft_data:
|
|
60
|
+
nft_data: BalanceNftData[];
|
|
61
61
|
}
|
|
62
62
|
export interface ProtocolMetadata {
|
|
63
63
|
/** * The name of the protocol. */
|
|
64
64
|
protocol_name: string;
|
|
65
65
|
}
|
|
66
|
+
export interface BalanceNftData {
|
|
67
|
+
/** * The token's id. */
|
|
68
|
+
token_id: bigint | null;
|
|
69
|
+
/** * The count of the number of NFTs with this ID. */
|
|
70
|
+
token_balance: bigint | null;
|
|
71
|
+
/** * External URL for additional metadata. */
|
|
72
|
+
token_url: string;
|
|
73
|
+
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
74
|
+
supports_erc: string[];
|
|
75
|
+
/** * The latest price value on chain of the token ID. */
|
|
76
|
+
token_price_wei: bigint | null;
|
|
77
|
+
/** * The latest quote_rate of the token ID denominated in unscaled ETH. */
|
|
78
|
+
token_quote_rate_eth: string;
|
|
79
|
+
/** * The address of the original owner of this NFT. */
|
|
80
|
+
original_owner: string;
|
|
81
|
+
external_data: NftExternalDataV1;
|
|
82
|
+
/** * The current owner of this NFT. */
|
|
83
|
+
owner: string;
|
|
84
|
+
/** * The address of the current owner of this NFT. */
|
|
85
|
+
owner_address: string;
|
|
86
|
+
/** * When set to true, this NFT has been Burned. */
|
|
87
|
+
burned: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface NftExternalDataV1 {
|
|
90
|
+
name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
image: string;
|
|
93
|
+
image_256: string;
|
|
94
|
+
image_512: string;
|
|
95
|
+
image_1024: string;
|
|
96
|
+
animation_url: string;
|
|
97
|
+
external_url: string;
|
|
98
|
+
attributes: NftCollectionAttribute[];
|
|
99
|
+
owner: string;
|
|
100
|
+
}
|
|
66
101
|
export interface PortfolioResponse {
|
|
67
102
|
/** * The requested address. */
|
|
68
103
|
address: string;
|
|
@@ -238,7 +273,7 @@ export interface TokenHolder {
|
|
|
238
273
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
239
274
|
contract_address: string;
|
|
240
275
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
241
|
-
supports_erc: string;
|
|
276
|
+
supports_erc: string[];
|
|
242
277
|
/** * The contract logo URL. */
|
|
243
278
|
logo_url: string;
|
|
244
279
|
/** * The requested address. */
|
|
@@ -274,13 +309,14 @@ export interface HistoricalBalanceItem {
|
|
|
274
309
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
275
310
|
contract_address: string;
|
|
276
311
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
277
|
-
supports_erc: string;
|
|
312
|
+
supports_erc: string[];
|
|
278
313
|
/** * The contract logo URL. */
|
|
279
314
|
logo_url: string;
|
|
280
315
|
/** * The height of the block. */
|
|
281
316
|
block_height: number;
|
|
282
317
|
/** * The block height when the token was last transferred. */
|
|
283
318
|
last_transferred_block_height: number;
|
|
319
|
+
contract_display_name: string;
|
|
284
320
|
/** * The timestamp when the token was transferred. */
|
|
285
321
|
last_transferred_at: Date;
|
|
286
322
|
/** * Indicates if a token is the chain's native gas token, eg: ETH on Ethereum. */
|
|
@@ -297,8 +333,10 @@ export interface HistoricalBalanceItem {
|
|
|
297
333
|
quote: number;
|
|
298
334
|
/** * A prettier version of the quote for rendering purposes. */
|
|
299
335
|
pretty_quote: string;
|
|
336
|
+
/** * The protocol metadata. */
|
|
337
|
+
protocol_metadata: ProtocolMetadata;
|
|
300
338
|
/** * NFT-specific data. */
|
|
301
|
-
nft_data:
|
|
339
|
+
nft_data: BalanceNftData[];
|
|
302
340
|
}
|
|
303
341
|
export interface TokenBalanceNativeResponse {
|
|
304
342
|
/** * The requested address. */
|
|
@@ -324,7 +362,7 @@ export interface NativeBalanceItem {
|
|
|
324
362
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
325
363
|
contract_address: string;
|
|
326
364
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
327
|
-
supports_erc: string;
|
|
365
|
+
supports_erc: string[];
|
|
328
366
|
/** * The contract logo URL. */
|
|
329
367
|
logo_url: string;
|
|
330
368
|
/** * The height of the block. */
|
|
@@ -54,10 +54,16 @@ export interface BlockHeightsResponse {
|
|
|
54
54
|
/** * The requested chain name eg: `eth-mainnet`. */
|
|
55
55
|
chain_name: string;
|
|
56
56
|
/** * List of response items. */
|
|
57
|
-
items:
|
|
57
|
+
items: BlockHeights[];
|
|
58
58
|
/** * Pagination metadata. */
|
|
59
59
|
pagination: Pagination;
|
|
60
60
|
}
|
|
61
|
+
export interface BlockHeights {
|
|
62
|
+
/** * The block signed timestamp in UTC. */
|
|
63
|
+
signed_at: Date;
|
|
64
|
+
/** * The block height. */
|
|
65
|
+
height: number;
|
|
66
|
+
}
|
|
61
67
|
export interface GetLogsResponse {
|
|
62
68
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
63
69
|
updated_at: Date;
|
|
@@ -18,6 +18,8 @@ export interface NftData {
|
|
|
18
18
|
token_url: string;
|
|
19
19
|
/** * The original minter. */
|
|
20
20
|
original_owner: string;
|
|
21
|
+
/** * The current holder of this NFT. */
|
|
22
|
+
current_owner: string;
|
|
21
23
|
external_data: NftExternalData;
|
|
22
24
|
/** * If `true`, the asset data is available from the Covalent CDN. */
|
|
23
25
|
asset_cached: boolean;
|
|
@@ -39,13 +39,13 @@ export interface NftTokenContractBalanceItem {
|
|
|
39
39
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
40
40
|
contract_address: string;
|
|
41
41
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
42
|
-
supports_erc: string;
|
|
42
|
+
supports_erc: string[];
|
|
43
43
|
/** * Denotes whether the token is suspected spam. Supports `eth-mainnet` and `matic-mainnet`. */
|
|
44
44
|
is_spam: boolean;
|
|
45
45
|
last_transfered_at: Date;
|
|
46
46
|
/** * The asset balance. Use `contract_decimals` to scale this balance for display purposes. */
|
|
47
47
|
balance: bigint | null;
|
|
48
|
-
balance_24h:
|
|
48
|
+
balance_24h: string;
|
|
49
49
|
type: string;
|
|
50
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
51
|
floor_price_quote: number;
|
|
@@ -97,7 +97,7 @@ export interface NftTransaction {
|
|
|
97
97
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
98
98
|
contract_address: string;
|
|
99
99
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
100
|
-
supports_erc: string;
|
|
100
|
+
supports_erc: string[];
|
|
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;
|
|
@@ -127,11 +127,11 @@ export interface NftTransactionItem {
|
|
|
127
127
|
value_quote: number;
|
|
128
128
|
/** * A prettier version of the quote for rendering purposes. */
|
|
129
129
|
pretty_value_quote: string;
|
|
130
|
-
gas_offered:
|
|
130
|
+
gas_offered: number;
|
|
131
131
|
/** * The gas spent for this tx. */
|
|
132
|
-
gas_spent:
|
|
132
|
+
gas_spent: number;
|
|
133
133
|
/** * The gas price at the time of this tx. */
|
|
134
|
-
gas_price:
|
|
134
|
+
gas_price: number;
|
|
135
135
|
/** * The total transaction fees (gas_price * gas_spent) paid for this tx, denoted in wei. */
|
|
136
136
|
fees_paid: bigint | null;
|
|
137
137
|
/** * The gas spent in `quote-currency` denomination. */
|
|
@@ -217,11 +217,11 @@ export interface NftOwnershipForCollectionItem {
|
|
|
217
217
|
/** * The token's id. */
|
|
218
218
|
token_id: bigint | null;
|
|
219
219
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
220
|
-
supports_erc: string;
|
|
220
|
+
supports_erc: string[];
|
|
221
221
|
last_transfered_at: Date;
|
|
222
222
|
/** * Nft balance. */
|
|
223
223
|
balance: bigint | null;
|
|
224
|
-
balance_24h:
|
|
224
|
+
balance_24h: string;
|
|
225
225
|
type: string;
|
|
226
226
|
nft_data: NftData;
|
|
227
227
|
}
|
|
@@ -9,7 +9,7 @@ export interface TokenPricesResponse {
|
|
|
9
9
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
10
10
|
contract_address: string;
|
|
11
11
|
/** * A list of supported standard ERC interfaces, eg: `ERC20` and `ERC721`. */
|
|
12
|
-
supports_erc: string;
|
|
12
|
+
supports_erc: string[];
|
|
13
13
|
/** * The contract logo URL. */
|
|
14
14
|
logo_url: string;
|
|
15
15
|
update_at: Date;
|
|
@@ -40,11 +40,11 @@ export interface Transaction {
|
|
|
40
40
|
pretty_value_quote: string;
|
|
41
41
|
/** * The requested chain native gas token metadata. */
|
|
42
42
|
gas_metadata: ContractMetadata;
|
|
43
|
-
gas_offered:
|
|
43
|
+
gas_offered: number;
|
|
44
44
|
/** * The gas spent for this tx. */
|
|
45
|
-
gas_spent:
|
|
45
|
+
gas_spent: number;
|
|
46
46
|
/** * The gas price at the time of this tx. */
|
|
47
|
-
gas_price:
|
|
47
|
+
gas_price: number;
|
|
48
48
|
/** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
|
|
49
49
|
fees_paid: bigint | null;
|
|
50
50
|
/** * The gas spent in `quote-currency` denomination. */
|
|
@@ -73,7 +73,7 @@ export interface DexReport {
|
|
|
73
73
|
protocol_name: string;
|
|
74
74
|
/** * Stores the contract address of the protocol that facilitated the event. */
|
|
75
75
|
protocol_address: string;
|
|
76
|
-
/** *
|
|
76
|
+
/** * The protocol logo URL. */
|
|
77
77
|
protocol_logo_url: string;
|
|
78
78
|
/** * Stores the aggregator responsible for the event. */
|
|
79
79
|
aggregator_name: string;
|
|
@@ -94,7 +94,7 @@ export interface DexReport {
|
|
|
94
94
|
lp_token_ticker: string;
|
|
95
95
|
lp_token_num_decimals: number;
|
|
96
96
|
lp_token_name: string;
|
|
97
|
-
lp_token_value:
|
|
97
|
+
lp_token_value: string;
|
|
98
98
|
exchange_rate_usd: number;
|
|
99
99
|
/** * Stores the address of token 0 in the specific pair. */
|
|
100
100
|
token_0_address: string;
|
|
@@ -113,13 +113,13 @@ export interface DexReport {
|
|
|
113
113
|
/** * Stores the contract name of token 1 in the specific pair. */
|
|
114
114
|
token_1_name: string;
|
|
115
115
|
/** * Stores the amount of token 0 used in the transaction. For example, 1 ETH, 100 USDC, 30 UNI, etc. */
|
|
116
|
-
token_0_amount:
|
|
116
|
+
token_0_amount: string;
|
|
117
117
|
token_0_quote_rate: number;
|
|
118
118
|
token_0_usd_quote: number;
|
|
119
119
|
pretty_token_0_usd_quote: string;
|
|
120
120
|
token_0_logo_url: string;
|
|
121
121
|
/** * Stores the amount of token 1 used in the transaction. For example, 1 ETH, 100 USDC, 30 UNI, etc. */
|
|
122
|
-
token_1_amount:
|
|
122
|
+
token_1_amount: string;
|
|
123
123
|
token_1_quote_rate: number;
|
|
124
124
|
token_1_usd_quote: number;
|
|
125
125
|
pretty_token_1_usd_quote: string;
|
|
@@ -138,7 +138,7 @@ export interface NftSalesReport {
|
|
|
138
138
|
protocol_contract_address: string;
|
|
139
139
|
/** * Stores the name of the protocol that facilitated the event. */
|
|
140
140
|
protocol_name: string;
|
|
141
|
-
/** *
|
|
141
|
+
/** * The protocol logo URL. */
|
|
142
142
|
protocol_logo_url: string;
|
|
143
143
|
/** * Stores the address of the transaction recipient. */
|
|
144
144
|
to: string;
|
|
@@ -149,7 +149,7 @@ export interface NftSalesReport {
|
|
|
149
149
|
/** * Stores the address buying the NFT. */
|
|
150
150
|
taker: string;
|
|
151
151
|
/** * Stores the NFTs token ID. All NFTs have a token ID. Within a collection, these token IDs are unique. If the NFT is transferred to another owner, the token id remains the same, as this number is its identifier within a collection. For example, if a collection has 10K NFTs then an NFT in that collection can have a token ID from 1-10K. */
|
|
152
|
-
token_id:
|
|
152
|
+
token_id: string;
|
|
153
153
|
/** * Stores the address of the collection. For example, [Bored Ape Yacht Club](https://etherscan.io/token/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d) */
|
|
154
154
|
collection_address: string;
|
|
155
155
|
/** * Stores the name of the collection. */
|
|
@@ -187,7 +187,7 @@ export interface LendingReport {
|
|
|
187
187
|
protocol_name: string;
|
|
188
188
|
/** * Stores the contract address of the lending protocol that facilitated the event. */
|
|
189
189
|
protocol_address: string;
|
|
190
|
-
/** *
|
|
190
|
+
/** * The protocol logo URL. */
|
|
191
191
|
protocol_logo_url: string;
|
|
192
192
|
/** * Lending protocols often have multiple version (e.g. Aave V1, V2 and V3). The `version` field allows you to look at a specific version of the Lending protocol. */
|
|
193
193
|
version: string;
|
|
@@ -14,15 +14,15 @@ export interface PoolResponse {
|
|
|
14
14
|
export interface Pool {
|
|
15
15
|
/** * The pair address. */
|
|
16
16
|
exchange: string;
|
|
17
|
-
swap_count_24h:
|
|
17
|
+
swap_count_24h: number;
|
|
18
18
|
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
19
|
-
total_liquidity_quote:
|
|
20
|
-
volume_24h_quote:
|
|
21
|
-
fee_24h_quote:
|
|
19
|
+
total_liquidity_quote: number;
|
|
20
|
+
volume_24h_quote: number;
|
|
21
|
+
fee_24h_quote: number;
|
|
22
22
|
/** * Total supply of this pool token. */
|
|
23
23
|
total_supply: bigint | null;
|
|
24
24
|
/** * The exchange rate for the requested quote currency. */
|
|
25
|
-
quote_rate:
|
|
25
|
+
quote_rate: number;
|
|
26
26
|
/** * A prettier version of the total liquidity quote for rendering purposes. */
|
|
27
27
|
pretty_total_liquidity_quote: string;
|
|
28
28
|
/** * A prettier version of the volume 24h quote for rendering purposes. */
|
|
@@ -37,8 +37,8 @@ export interface Pool {
|
|
|
37
37
|
chain_id: string;
|
|
38
38
|
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
39
39
|
dex_name: string;
|
|
40
|
-
volume_7d_quote:
|
|
41
|
-
annualized_fee:
|
|
40
|
+
volume_7d_quote: number;
|
|
41
|
+
annualized_fee: number;
|
|
42
42
|
token_0: Token;
|
|
43
43
|
token_1: Token;
|
|
44
44
|
}
|
|
@@ -50,14 +50,14 @@ export interface Token {
|
|
|
50
50
|
volume_in_24h: string;
|
|
51
51
|
volume_out_24h: string;
|
|
52
52
|
/** * The exchange rate for the requested quote currency. */
|
|
53
|
-
quote_rate:
|
|
53
|
+
quote_rate: number;
|
|
54
54
|
reserve: string;
|
|
55
55
|
/** * The contract logo URL. */
|
|
56
56
|
logo_url: string;
|
|
57
57
|
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
58
58
|
contract_ticker_symbol: string;
|
|
59
59
|
/** * Use contract decimals to format the token balance for display purposes - divide the balance by `10^{contract_decimals}`. */
|
|
60
|
-
contract_decimals:
|
|
60
|
+
contract_decimals: number;
|
|
61
61
|
volume_in_7d: string;
|
|
62
62
|
volume_out_7d: string;
|
|
63
63
|
}
|
|
@@ -89,7 +89,7 @@ export interface SupportedDex {
|
|
|
89
89
|
/** * The dex logo URL. */
|
|
90
90
|
logo_url: string;
|
|
91
91
|
factory_contract_address: string;
|
|
92
|
-
router_contract_addresses: string;
|
|
92
|
+
router_contract_addresses: string[];
|
|
93
93
|
swap_fee: number;
|
|
94
94
|
}
|
|
95
95
|
export interface PoolByAddressResponse {
|
|
@@ -109,21 +109,21 @@ export interface PoolWithTimeseries {
|
|
|
109
109
|
exchange: string;
|
|
110
110
|
/** * A list of explorers for this address. */
|
|
111
111
|
explorers: Explorer[];
|
|
112
|
-
swap_count_24h:
|
|
112
|
+
swap_count_24h: number;
|
|
113
113
|
/** * The total liquidity converted to fiat in `quote-currency`. */
|
|
114
|
-
total_liquidity_quote:
|
|
115
|
-
volume_24h_quote:
|
|
116
|
-
fee_24h_quote:
|
|
114
|
+
total_liquidity_quote: number;
|
|
115
|
+
volume_24h_quote: number;
|
|
116
|
+
fee_24h_quote: number;
|
|
117
117
|
/** * Total supply of this pool token. */
|
|
118
118
|
total_supply: bigint | null;
|
|
119
119
|
/** * The exchange rate for the requested quote currency. */
|
|
120
|
-
quote_rate:
|
|
120
|
+
quote_rate: number;
|
|
121
121
|
/** * The requested chain ID eg: `1`. */
|
|
122
122
|
chain_id: string;
|
|
123
123
|
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
124
124
|
dex_name: string;
|
|
125
|
-
volume_7d_quote:
|
|
126
|
-
annualized_fee:
|
|
125
|
+
volume_7d_quote: number;
|
|
126
|
+
annualized_fee: number;
|
|
127
127
|
/** * A prettier version of the total liquidity quote for rendering purposes. */
|
|
128
128
|
pretty_total_liquidity_quote: string;
|
|
129
129
|
/** * A prettier version of the volume 24h quote for rendering purposes. */
|
|
@@ -134,8 +134,8 @@ export interface PoolWithTimeseries {
|
|
|
134
134
|
pretty_volume_7d_quote: string;
|
|
135
135
|
token_0: Token;
|
|
136
136
|
token_1: Token;
|
|
137
|
-
token_0_reserve_quote:
|
|
138
|
-
token_1_reserve_quote:
|
|
137
|
+
token_0_reserve_quote: number;
|
|
138
|
+
token_1_reserve_quote: number;
|
|
139
139
|
volume_timeseries_7d: VolumeTimeseries[];
|
|
140
140
|
volume_timeseries_30d: VolumeTimeseries[];
|
|
141
141
|
liquidity_timeseries_7d: LiquidityTimeseries[];
|
|
@@ -148,56 +148,56 @@ export interface VolumeTimeseries {
|
|
|
148
148
|
dex_name: string;
|
|
149
149
|
/** * The requested chain ID eg: `1`. */
|
|
150
150
|
chain_id: string;
|
|
151
|
-
dt:
|
|
151
|
+
dt: Date;
|
|
152
152
|
/** * The pair address. */
|
|
153
153
|
exchange: string;
|
|
154
154
|
sum_amount0in: string;
|
|
155
155
|
sum_amount0out: string;
|
|
156
156
|
sum_amount1in: string;
|
|
157
157
|
sum_amount1out: string;
|
|
158
|
-
volume_quote:
|
|
158
|
+
volume_quote: number;
|
|
159
159
|
/** * A prettier version of the volume quote for rendering purposes. */
|
|
160
160
|
pretty_volume_quote: string;
|
|
161
|
-
token_0_quote_rate:
|
|
162
|
-
token_1_quote_rate:
|
|
163
|
-
swap_count_24:
|
|
161
|
+
token_0_quote_rate: number;
|
|
162
|
+
token_1_quote_rate: number;
|
|
163
|
+
swap_count_24: number;
|
|
164
164
|
}
|
|
165
165
|
export interface LiquidityTimeseries {
|
|
166
166
|
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
167
167
|
dex_name: string;
|
|
168
168
|
/** * The requested chain ID eg: `1`. */
|
|
169
169
|
chain_id: string;
|
|
170
|
-
dt:
|
|
170
|
+
dt: Date;
|
|
171
171
|
/** * The pair address. */
|
|
172
172
|
exchange: string;
|
|
173
173
|
r0_c: string;
|
|
174
174
|
r1_c: string;
|
|
175
|
-
liquidity_quote:
|
|
175
|
+
liquidity_quote: number;
|
|
176
176
|
/** * A prettier version of the liquidity quote for rendering purposes. */
|
|
177
177
|
pretty_liquidity_quote: string;
|
|
178
|
-
token_0_quote_rate:
|
|
179
|
-
token_1_quote_rate:
|
|
178
|
+
token_0_quote_rate: number;
|
|
179
|
+
token_1_quote_rate: number;
|
|
180
180
|
}
|
|
181
181
|
export interface PriceTimeseries {
|
|
182
182
|
/** * The name of the DEX, eg: `uniswap_v2`. */
|
|
183
183
|
dex_name: string;
|
|
184
184
|
/** * The requested chain ID eg: `1`. */
|
|
185
185
|
chain_id: string;
|
|
186
|
-
dt:
|
|
186
|
+
dt: Date;
|
|
187
187
|
/** * The pair address. */
|
|
188
188
|
exchange: string;
|
|
189
|
-
price_of_token0_in_token1:
|
|
189
|
+
price_of_token0_in_token1: number;
|
|
190
190
|
/** * A prettier version of the price token0 for rendering purposes. */
|
|
191
191
|
pretty_price_of_token0_in_token1: string;
|
|
192
192
|
price_of_token0_in_token1_description: string;
|
|
193
|
-
price_of_token1_in_token0:
|
|
193
|
+
price_of_token1_in_token0: number;
|
|
194
194
|
/** * A prettier version of the price token1 for rendering purposes. */
|
|
195
195
|
pretty_price_of_token1_in_token0: string;
|
|
196
196
|
price_of_token1_in_token0_description: string;
|
|
197
197
|
/** * The requested quote currency eg: `USD`. */
|
|
198
198
|
quote_currency: string;
|
|
199
|
-
price_of_token0_in_quote_currency:
|
|
200
|
-
price_of_token1_in_quote_currency:
|
|
199
|
+
price_of_token0_in_quote_currency: number;
|
|
200
|
+
price_of_token1_in_quote_currency: number;
|
|
201
201
|
}
|
|
202
202
|
export interface PoolsDexDataResponse {
|
|
203
203
|
/** * The timestamp when the response was generated. Useful to show data staleness to users. */
|
|
@@ -345,8 +345,8 @@ export interface TokenV2Volume {
|
|
|
345
345
|
contract_address: string;
|
|
346
346
|
/** * The string returned by the `name()` method. */
|
|
347
347
|
contract_name: string;
|
|
348
|
-
total_liquidity:
|
|
349
|
-
total_volume_24h:
|
|
348
|
+
total_liquidity: string;
|
|
349
|
+
total_volume_24h: string;
|
|
350
350
|
/** * The contract logo URL. */
|
|
351
351
|
logo_url: string;
|
|
352
352
|
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
@@ -394,14 +394,14 @@ export interface TokenV2VolumeWithChartData {
|
|
|
394
394
|
dex_name: string;
|
|
395
395
|
/** * Use the relevant `contract_address` to lookup prices, logos, token transfers, etc. */
|
|
396
396
|
contract_address: string;
|
|
397
|
-
/** * The list of explorers for the token address. */
|
|
398
|
-
explorers: Explorer[];
|
|
399
397
|
/** * The string returned by the `name()` method. */
|
|
400
398
|
contract_name: string;
|
|
399
|
+
/** * A list of explorers for this address. */
|
|
400
|
+
explorers: Explorer[];
|
|
401
401
|
/** * The total liquidity unscaled value. */
|
|
402
|
-
total_liquidity:
|
|
402
|
+
total_liquidity: string;
|
|
403
403
|
/** * The total volume 24h unscaled value. */
|
|
404
|
-
total_volume_24h:
|
|
404
|
+
total_volume_24h: string;
|
|
405
405
|
/** * The contract logo URL. */
|
|
406
406
|
logo_url: string;
|
|
407
407
|
/** * The ticker symbol for this contract. This field is set by a developer and non-unique across a network. */
|
|
@@ -441,7 +441,7 @@ export interface VolumeTokenTimeseries {
|
|
|
441
441
|
/** * The requested chain ID eg: `1`. */
|
|
442
442
|
chain_id: string;
|
|
443
443
|
/** * The current date. */
|
|
444
|
-
dt:
|
|
444
|
+
dt: Date;
|
|
445
445
|
/** * The total volume unscaled for this day. */
|
|
446
446
|
total_volume: string;
|
|
447
447
|
/** * The volume in `quote-currency` denomination. */
|
|
@@ -455,7 +455,7 @@ export interface LiquidityTokenTimeseries {
|
|
|
455
455
|
/** * The requested chain ID eg: `1`. */
|
|
456
456
|
chain_id: string;
|
|
457
457
|
/** * The current date. */
|
|
458
|
-
dt:
|
|
458
|
+
dt: Date;
|
|
459
459
|
/** * The total liquidity unscaled up to this day. */
|
|
460
460
|
total_liquidity: string;
|
|
461
461
|
/** * The liquidity in `quote-currency` denomination. */
|
|
@@ -469,7 +469,7 @@ export interface PriceTokenTimeseries {
|
|
|
469
469
|
/** * The requested chain ID eg: `1`. */
|
|
470
470
|
chain_id: string;
|
|
471
471
|
/** * The current date. */
|
|
472
|
-
dt:
|
|
472
|
+
dt: Date;
|
|
473
473
|
/** * The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. */
|
|
474
474
|
quote_currency: string;
|
|
475
475
|
/** * The exchange rate for the requested quote currency. */
|
|
@@ -519,12 +519,12 @@ export interface ExchangeTransaction {
|
|
|
519
519
|
address: string;
|
|
520
520
|
/** * A list of explorers for this transaction. */
|
|
521
521
|
explorers: Explorer[];
|
|
522
|
-
amount_0:
|
|
523
|
-
amount_1:
|
|
524
|
-
amount_0_in:
|
|
525
|
-
amount_0_out:
|
|
526
|
-
amount_1_in:
|
|
527
|
-
amount_1_out:
|
|
522
|
+
amount_0: string;
|
|
523
|
+
amount_1: string;
|
|
524
|
+
amount_0_in: string;
|
|
525
|
+
amount_0_out: string;
|
|
526
|
+
amount_1_in: string;
|
|
527
|
+
amount_1_out: string;
|
|
528
528
|
to_address: string;
|
|
529
529
|
from_address: string;
|
|
530
530
|
sender_address: string;
|
|
@@ -540,11 +540,11 @@ export interface ExchangeTransaction {
|
|
|
540
540
|
/** * The requested chain native gas token metadata. */
|
|
541
541
|
gas_metadata: ContractMetadata;
|
|
542
542
|
/** * The amount of gas supplied for this tx. */
|
|
543
|
-
gas_offered:
|
|
543
|
+
gas_offered: number;
|
|
544
544
|
/** * The gas spent for this tx. */
|
|
545
|
-
gas_spent:
|
|
545
|
+
gas_spent: number;
|
|
546
546
|
/** * The gas price at the time of this tx. */
|
|
547
|
-
gas_price:
|
|
547
|
+
gas_price: number;
|
|
548
548
|
/** * The total transaction fees (`gas_price` * `gas_spent`) paid for this tx, denoted in wei. */
|
|
549
549
|
fees_paid: bigint | null;
|
|
550
550
|
/** * The gas spent in `quote-currency` denomination. */
|