@tokemak/queries 0.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/index.cjs +61119 -0
- package/dist/index.d.ts +2753 -0
- package/package.json +33 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2753 @@
|
|
|
1
|
+
import * as viem from 'viem';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import * as _tokemak_tokenlist from '@tokemak/tokenlist';
|
|
4
|
+
import { INetwork, IToken, IProtocol } from '@tokemak/tokenlist';
|
|
5
|
+
import * as abitype from 'abitype';
|
|
6
|
+
import { Config } from '@wagmi/core';
|
|
7
|
+
import { SupportedChainIds } from '@tokemak/config';
|
|
8
|
+
import { Config as Config$1 } from 'wagmi';
|
|
9
|
+
import { systemRegistryAbi } from '@tokemak/abis';
|
|
10
|
+
import { ExtractAbiFunctionNames } from '@tokemak/utils';
|
|
11
|
+
|
|
12
|
+
declare const getEthPrice: () => Promise<number | undefined>;
|
|
13
|
+
|
|
14
|
+
declare const getTokePrice: () => Promise<number | undefined>;
|
|
15
|
+
|
|
16
|
+
type PriceSource = "alchemy" | "coingecko" | "defillama";
|
|
17
|
+
interface GetTokenPriceConfig$1 {
|
|
18
|
+
chainId?: number;
|
|
19
|
+
tokenAddress: Address;
|
|
20
|
+
includedSources?: PriceSource[];
|
|
21
|
+
excludedSources?: PriceSource[];
|
|
22
|
+
}
|
|
23
|
+
declare const getTokenPrice: ({ chainId, tokenAddress, includedSources, excludedSources, }: GetTokenPriceConfig$1) => Promise<number | undefined>;
|
|
24
|
+
|
|
25
|
+
type DestinationVault = {
|
|
26
|
+
exchangeName: string;
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
29
|
+
declare function getExchangeNames(destinationVaults: DestinationVault[]): string[];
|
|
30
|
+
|
|
31
|
+
declare function getPoolStats<T extends {
|
|
32
|
+
vaultAddress: string;
|
|
33
|
+
}>(destinationsWithTokens: T[], vaultAddress: string): T | null;
|
|
34
|
+
|
|
35
|
+
declare const modifyAutopoolName: (name: string) => string;
|
|
36
|
+
|
|
37
|
+
interface BaseDataEntry {
|
|
38
|
+
timestamp: string;
|
|
39
|
+
date: Date;
|
|
40
|
+
}
|
|
41
|
+
declare function fillMissingDates<T extends BaseDataEntry>(data: T[]): T[];
|
|
42
|
+
|
|
43
|
+
declare function nestedArrayToObject<PrimaryKey extends PropertyKey, SecondaryKey extends PropertyKey, Value>(primaryKeys: readonly PrimaryKey[], secondaryKeys: readonly (readonly SecondaryKey[])[], // Adjusted to accept readonly arrays
|
|
44
|
+
values: readonly (readonly Value[])[]): Record<PrimaryKey, Record<SecondaryKey, Value | undefined>>;
|
|
45
|
+
|
|
46
|
+
declare function arraysToObject<K extends PropertyKey, V>(keys: readonly K[], values: readonly V[]): Record<K, V>;
|
|
47
|
+
|
|
48
|
+
declare function mergeArraysWithKey<T extends Record<string, any>, U>(objectsArray: readonly T[], arraysArray: readonly (readonly U[])[], key: string): (T & Record<string, U[]>)[];
|
|
49
|
+
|
|
50
|
+
declare function mergeArrays<T extends Record<string, any>, U extends Record<string, any>>(objectsArray: readonly T[], objectsToMergeArray: readonly U[]): (T & U)[];
|
|
51
|
+
|
|
52
|
+
declare function getTimestampDaysFromStart(startTimestamp: number, days: number): number;
|
|
53
|
+
|
|
54
|
+
declare const formatDateRange: (dateRange: Date[], type?: "date" | "time") => {
|
|
55
|
+
unlockPeriodDateRange: string;
|
|
56
|
+
unlockPeriodStartFullDate: string;
|
|
57
|
+
unlockRenewalFullDate: string;
|
|
58
|
+
unlockPeriodStartDate?: undefined;
|
|
59
|
+
unlockRenewalDate?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
unlockPeriodDateRange: string;
|
|
62
|
+
unlockPeriodStartFullDate: string;
|
|
63
|
+
unlockRenewalFullDate: string;
|
|
64
|
+
unlockPeriodStartDate: string;
|
|
65
|
+
unlockRenewalDate: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare function mergeStringArrays(keys: string[], values: string[]): {
|
|
69
|
+
[key: string]: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
interface GetChainsOptions$1 {
|
|
73
|
+
includeTestnet?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Returns the appropriate array of chains
|
|
77
|
+
* based on environment + 'includeTestnet' logic.
|
|
78
|
+
*/
|
|
79
|
+
declare function getChainsForEnv({ includeTestnet, }: GetChainsOptions$1): INetwork[];
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A generic helper to:
|
|
83
|
+
* 1) Accept an array of "chain" objects (each must have `chainId`).
|
|
84
|
+
* 2) Accept an async function (`fetchFn`) that returns a Promise for each chain.
|
|
85
|
+
* 3) Returns a dictionary keyed by chain ID (Record<number, T>) of the resolved results.
|
|
86
|
+
*/
|
|
87
|
+
declare function fetchChainDataMap<ChainType extends INetwork, ResultType>(chains: ChainType[], fetchFn: (chain: ChainType) => Promise<ResultType>): Promise<Record<number, ResultType>>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Raw pool data from the subgraph. Adjust field types if needed.
|
|
91
|
+
*/
|
|
92
|
+
interface PoolRewardsBalanceDayData {
|
|
93
|
+
id: string;
|
|
94
|
+
timestamp: string;
|
|
95
|
+
balance: bigint | number;
|
|
96
|
+
balanceUSD: bigint | number;
|
|
97
|
+
earned: bigint | number;
|
|
98
|
+
earnedUSD: bigint | number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The shape of each aggregated daily record returned by this helper.
|
|
102
|
+
*/
|
|
103
|
+
interface AggregatedDayData {
|
|
104
|
+
id: string;
|
|
105
|
+
formattedDate: string;
|
|
106
|
+
timestamp: string;
|
|
107
|
+
balance: number;
|
|
108
|
+
balanceUSD: number;
|
|
109
|
+
earned: number;
|
|
110
|
+
earnedUSD: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Aggregates an array of day-data into unique timestamps. Also filters
|
|
114
|
+
* out days where `earned = 0`.
|
|
115
|
+
*/
|
|
116
|
+
declare function aggregateSTokeRewardsDayData(dayDatas: PoolRewardsBalanceDayData[]): AggregatedDayData[];
|
|
117
|
+
|
|
118
|
+
interface GetChainsOptions {
|
|
119
|
+
includeTestnet?: boolean;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Returns the appropriate array of chains
|
|
123
|
+
* based on environment + 'includeTestnet' logic.
|
|
124
|
+
*/
|
|
125
|
+
declare function getSTokeChainsForEnv({ includeTestnet, }: GetChainsOptions): INetwork[];
|
|
126
|
+
|
|
127
|
+
declare const ETH_BASE_ASSETS: string[];
|
|
128
|
+
declare const USD_BASE_ASSETS: string[];
|
|
129
|
+
declare enum AutopoolCategory {
|
|
130
|
+
ETH = "eth",
|
|
131
|
+
USD = "usd",
|
|
132
|
+
CRYPTO = "crypto"
|
|
133
|
+
}
|
|
134
|
+
declare const getAutopoolCategory: (baseAsset: string) => AutopoolCategory;
|
|
135
|
+
|
|
136
|
+
declare const BASE_ASSETS: readonly [{
|
|
137
|
+
readonly symbol: "ETH";
|
|
138
|
+
readonly address: abitype.Address;
|
|
139
|
+
readonly chainId: number;
|
|
140
|
+
readonly decimals: number;
|
|
141
|
+
readonly logoURI: string;
|
|
142
|
+
readonly name: string;
|
|
143
|
+
readonly audits?: string;
|
|
144
|
+
readonly extensions?: {
|
|
145
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
146
|
+
bridgeInfo?: {
|
|
147
|
+
[chainId: number]: {
|
|
148
|
+
tokenAddress: abitype.Address;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
rebasing?: boolean;
|
|
152
|
+
parentAsset?: string;
|
|
153
|
+
};
|
|
154
|
+
}, {
|
|
155
|
+
readonly symbol: "PXETH";
|
|
156
|
+
readonly address: abitype.Address;
|
|
157
|
+
readonly chainId: number;
|
|
158
|
+
readonly decimals: number;
|
|
159
|
+
readonly logoURI: string;
|
|
160
|
+
readonly name: string;
|
|
161
|
+
readonly audits?: string;
|
|
162
|
+
readonly extensions?: {
|
|
163
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
164
|
+
bridgeInfo?: {
|
|
165
|
+
[chainId: number]: {
|
|
166
|
+
tokenAddress: abitype.Address;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
rebasing?: boolean;
|
|
170
|
+
parentAsset?: string;
|
|
171
|
+
};
|
|
172
|
+
}, {
|
|
173
|
+
readonly symbol: "USDC";
|
|
174
|
+
readonly address: abitype.Address;
|
|
175
|
+
readonly chainId: number;
|
|
176
|
+
readonly decimals: number;
|
|
177
|
+
readonly logoURI: string;
|
|
178
|
+
readonly name: string;
|
|
179
|
+
readonly audits?: string;
|
|
180
|
+
readonly extensions?: {
|
|
181
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
182
|
+
bridgeInfo?: {
|
|
183
|
+
[chainId: number]: {
|
|
184
|
+
tokenAddress: abitype.Address;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
rebasing?: boolean;
|
|
188
|
+
parentAsset?: string;
|
|
189
|
+
};
|
|
190
|
+
}, {
|
|
191
|
+
readonly symbol: "DOLA";
|
|
192
|
+
readonly address: abitype.Address;
|
|
193
|
+
readonly chainId: number;
|
|
194
|
+
readonly decimals: number;
|
|
195
|
+
readonly logoURI: string;
|
|
196
|
+
readonly name: string;
|
|
197
|
+
readonly audits?: string;
|
|
198
|
+
readonly extensions?: {
|
|
199
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
200
|
+
bridgeInfo?: {
|
|
201
|
+
[chainId: number]: {
|
|
202
|
+
tokenAddress: abitype.Address;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
rebasing?: boolean;
|
|
206
|
+
parentAsset?: string;
|
|
207
|
+
};
|
|
208
|
+
}, {
|
|
209
|
+
readonly symbol: "S";
|
|
210
|
+
readonly address: abitype.Address;
|
|
211
|
+
readonly chainId: number;
|
|
212
|
+
readonly decimals: number;
|
|
213
|
+
readonly logoURI: string;
|
|
214
|
+
readonly name: string;
|
|
215
|
+
readonly audits?: string;
|
|
216
|
+
readonly extensions?: {
|
|
217
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
218
|
+
bridgeInfo?: {
|
|
219
|
+
[chainId: number]: {
|
|
220
|
+
tokenAddress: abitype.Address;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
rebasing?: boolean;
|
|
224
|
+
parentAsset?: string;
|
|
225
|
+
};
|
|
226
|
+
}];
|
|
227
|
+
declare const PRICED_TOKENS: readonly [{
|
|
228
|
+
readonly symbol: "ETH";
|
|
229
|
+
readonly address: abitype.Address;
|
|
230
|
+
readonly chainId: number;
|
|
231
|
+
readonly decimals: number;
|
|
232
|
+
readonly logoURI: string;
|
|
233
|
+
readonly name: string;
|
|
234
|
+
readonly audits?: string;
|
|
235
|
+
readonly extensions?: {
|
|
236
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
237
|
+
bridgeInfo?: {
|
|
238
|
+
[chainId: number]: {
|
|
239
|
+
tokenAddress: abitype.Address;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
rebasing?: boolean;
|
|
243
|
+
parentAsset?: string;
|
|
244
|
+
};
|
|
245
|
+
}, {
|
|
246
|
+
readonly symbol: "PXETH";
|
|
247
|
+
readonly address: abitype.Address;
|
|
248
|
+
readonly chainId: number;
|
|
249
|
+
readonly decimals: number;
|
|
250
|
+
readonly logoURI: string;
|
|
251
|
+
readonly name: string;
|
|
252
|
+
readonly audits?: string;
|
|
253
|
+
readonly extensions?: {
|
|
254
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
255
|
+
bridgeInfo?: {
|
|
256
|
+
[chainId: number]: {
|
|
257
|
+
tokenAddress: abitype.Address;
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
rebasing?: boolean;
|
|
261
|
+
parentAsset?: string;
|
|
262
|
+
};
|
|
263
|
+
}, {
|
|
264
|
+
readonly symbol: "USDC";
|
|
265
|
+
readonly address: abitype.Address;
|
|
266
|
+
readonly chainId: number;
|
|
267
|
+
readonly decimals: number;
|
|
268
|
+
readonly logoURI: string;
|
|
269
|
+
readonly name: string;
|
|
270
|
+
readonly audits?: string;
|
|
271
|
+
readonly extensions?: {
|
|
272
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
273
|
+
bridgeInfo?: {
|
|
274
|
+
[chainId: number]: {
|
|
275
|
+
tokenAddress: abitype.Address;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
rebasing?: boolean;
|
|
279
|
+
parentAsset?: string;
|
|
280
|
+
};
|
|
281
|
+
}, {
|
|
282
|
+
readonly symbol: "DOLA";
|
|
283
|
+
readonly address: abitype.Address;
|
|
284
|
+
readonly chainId: number;
|
|
285
|
+
readonly decimals: number;
|
|
286
|
+
readonly logoURI: string;
|
|
287
|
+
readonly name: string;
|
|
288
|
+
readonly audits?: string;
|
|
289
|
+
readonly extensions?: {
|
|
290
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
291
|
+
bridgeInfo?: {
|
|
292
|
+
[chainId: number]: {
|
|
293
|
+
tokenAddress: abitype.Address;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
rebasing?: boolean;
|
|
297
|
+
parentAsset?: string;
|
|
298
|
+
};
|
|
299
|
+
}, {
|
|
300
|
+
readonly symbol: "S";
|
|
301
|
+
readonly address: abitype.Address;
|
|
302
|
+
readonly chainId: number;
|
|
303
|
+
readonly decimals: number;
|
|
304
|
+
readonly logoURI: string;
|
|
305
|
+
readonly name: string;
|
|
306
|
+
readonly audits?: string;
|
|
307
|
+
readonly extensions?: {
|
|
308
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
309
|
+
bridgeInfo?: {
|
|
310
|
+
[chainId: number]: {
|
|
311
|
+
tokenAddress: abitype.Address;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
rebasing?: boolean;
|
|
315
|
+
parentAsset?: string;
|
|
316
|
+
};
|
|
317
|
+
}, {
|
|
318
|
+
readonly symbol: "TOKE";
|
|
319
|
+
readonly address: abitype.Address;
|
|
320
|
+
readonly chainId: number;
|
|
321
|
+
readonly decimals: number;
|
|
322
|
+
readonly logoURI: string;
|
|
323
|
+
readonly name: string;
|
|
324
|
+
readonly audits?: string;
|
|
325
|
+
readonly extensions?: {
|
|
326
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
327
|
+
bridgeInfo?: {
|
|
328
|
+
[chainId: number]: {
|
|
329
|
+
tokenAddress: abitype.Address;
|
|
330
|
+
};
|
|
331
|
+
};
|
|
332
|
+
rebasing?: boolean;
|
|
333
|
+
parentAsset?: string;
|
|
334
|
+
};
|
|
335
|
+
}];
|
|
336
|
+
type BaseAsset = (typeof BASE_ASSETS)[number]["symbol"];
|
|
337
|
+
declare const WRAPPED_TOKENS: readonly [{
|
|
338
|
+
readonly symbol: "WETH";
|
|
339
|
+
readonly address: abitype.Address;
|
|
340
|
+
readonly chainId: number;
|
|
341
|
+
readonly decimals: number;
|
|
342
|
+
readonly logoURI: string;
|
|
343
|
+
readonly name: string;
|
|
344
|
+
readonly audits?: string;
|
|
345
|
+
readonly extensions?: {
|
|
346
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
347
|
+
bridgeInfo?: {
|
|
348
|
+
[chainId: number]: {
|
|
349
|
+
tokenAddress: abitype.Address;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
rebasing?: boolean;
|
|
353
|
+
parentAsset?: string;
|
|
354
|
+
};
|
|
355
|
+
}, {
|
|
356
|
+
readonly symbol: "WS";
|
|
357
|
+
readonly address: abitype.Address;
|
|
358
|
+
readonly chainId: number;
|
|
359
|
+
readonly decimals: number;
|
|
360
|
+
readonly logoURI: string;
|
|
361
|
+
readonly name: string;
|
|
362
|
+
readonly audits?: string;
|
|
363
|
+
readonly extensions?: {
|
|
364
|
+
bridgeMainnetAdapter?: abitype.Address;
|
|
365
|
+
bridgeInfo?: {
|
|
366
|
+
[chainId: number]: {
|
|
367
|
+
tokenAddress: abitype.Address;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
rebasing?: boolean;
|
|
371
|
+
parentAsset?: string;
|
|
372
|
+
};
|
|
373
|
+
}];
|
|
374
|
+
type TokenSymbol = (typeof PRICED_TOKENS)[number]["symbol"] | (typeof BASE_ASSETS)[number]["symbol"] | (typeof WRAPPED_TOKENS)[number]["symbol"];
|
|
375
|
+
type TokenPrices = {
|
|
376
|
+
[K in TokenSymbol]: number;
|
|
377
|
+
};
|
|
378
|
+
declare const getTokenPrices: () => Promise<TokenPrices>;
|
|
379
|
+
|
|
380
|
+
type Currencies = TokenPrices & {
|
|
381
|
+
baseAsset: number;
|
|
382
|
+
USD: number;
|
|
383
|
+
};
|
|
384
|
+
type ExtraReward = IToken & {
|
|
385
|
+
apr: number;
|
|
386
|
+
};
|
|
387
|
+
declare const getChainAutopools: (wagmiConfig: Config, { chainId, prices, }: {
|
|
388
|
+
chainId: SupportedChainIds;
|
|
389
|
+
prices: TokenPrices;
|
|
390
|
+
}) => Promise<{
|
|
391
|
+
symbol: string;
|
|
392
|
+
logoURI?: string | undefined;
|
|
393
|
+
description?: string;
|
|
394
|
+
type?: "Tokemak" | "Ecosystem" | undefined;
|
|
395
|
+
tvl: number;
|
|
396
|
+
totalAssets: {
|
|
397
|
+
denom: number;
|
|
398
|
+
ETH: number;
|
|
399
|
+
WETH: number;
|
|
400
|
+
USDC: number;
|
|
401
|
+
DOLA: number;
|
|
402
|
+
PXETH: number;
|
|
403
|
+
S: number;
|
|
404
|
+
TOKE: number;
|
|
405
|
+
WS: number;
|
|
406
|
+
baseAsset: number;
|
|
407
|
+
USD: number;
|
|
408
|
+
};
|
|
409
|
+
destinations: {
|
|
410
|
+
debtValueHeldByVaultUsd: number;
|
|
411
|
+
debtValueHeldByVaultEth: number;
|
|
412
|
+
compositeReturn: number;
|
|
413
|
+
debtValueHeldByVaultAllocation: number;
|
|
414
|
+
underlyingTokens: {
|
|
415
|
+
valueUsd: number;
|
|
416
|
+
value: number;
|
|
417
|
+
address: viem.Address;
|
|
418
|
+
chainId: number;
|
|
419
|
+
decimals: number;
|
|
420
|
+
logoURI: string;
|
|
421
|
+
name: string;
|
|
422
|
+
symbol: string;
|
|
423
|
+
audits?: string;
|
|
424
|
+
extensions?: {
|
|
425
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
426
|
+
bridgeInfo?: {
|
|
427
|
+
[chainId: number]: {
|
|
428
|
+
tokenAddress: viem.Address;
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
rebasing?: boolean;
|
|
432
|
+
parentAsset?: string;
|
|
433
|
+
};
|
|
434
|
+
}[];
|
|
435
|
+
poolName: string;
|
|
436
|
+
exchange: IProtocol | undefined;
|
|
437
|
+
vaultAddress: `0x${string}`;
|
|
438
|
+
exchangeName: string;
|
|
439
|
+
totalSupply: bigint;
|
|
440
|
+
lastSnapshotTimestamp: bigint;
|
|
441
|
+
feeApr: bigint;
|
|
442
|
+
lastDebtReportTime: bigint;
|
|
443
|
+
minDebtValue: bigint;
|
|
444
|
+
maxDebtValue: bigint;
|
|
445
|
+
debtValueHeldByVault: bigint;
|
|
446
|
+
queuedForRemoval: boolean;
|
|
447
|
+
statsIncomplete: boolean;
|
|
448
|
+
isShutdown: boolean;
|
|
449
|
+
shutdownStatus: number;
|
|
450
|
+
autoPoolOwnsShares: bigint;
|
|
451
|
+
actualLPTotalSupply: bigint;
|
|
452
|
+
dexPool: `0x${string}`;
|
|
453
|
+
lpTokenAddress: `0x${string}`;
|
|
454
|
+
lpTokenSymbol: string;
|
|
455
|
+
lpTokenName: string;
|
|
456
|
+
statsSafeLPTotalSupply: bigint;
|
|
457
|
+
statsIncentiveCredits: number;
|
|
458
|
+
rewardsTokens: readonly {
|
|
459
|
+
tokenAddress: `0x${string}`;
|
|
460
|
+
}[];
|
|
461
|
+
underlyingTokenSymbols: readonly {
|
|
462
|
+
symbol: string;
|
|
463
|
+
}[];
|
|
464
|
+
lstStatsData: readonly {
|
|
465
|
+
lastSnapshotTimestamp: bigint;
|
|
466
|
+
baseApr: bigint;
|
|
467
|
+
discount: bigint;
|
|
468
|
+
discountHistory: readonly [number, number, number, number, number, number, number, number, number, number];
|
|
469
|
+
discountTimestampByPercent: number;
|
|
470
|
+
}[];
|
|
471
|
+
underlyingTokenValueHeld: readonly {
|
|
472
|
+
valueHeldInEth: bigint;
|
|
473
|
+
}[];
|
|
474
|
+
reservesInEth: readonly bigint[];
|
|
475
|
+
statsPeriodFinishForRewards: readonly number[];
|
|
476
|
+
statsAnnualizedRewardAmounts: readonly bigint[];
|
|
477
|
+
}[];
|
|
478
|
+
exchanges: {
|
|
479
|
+
valueUsd: number;
|
|
480
|
+
value: number;
|
|
481
|
+
allocation: number;
|
|
482
|
+
logoURI: string;
|
|
483
|
+
name: string;
|
|
484
|
+
audits?: string;
|
|
485
|
+
type: "DEX" | "Lending Market" | "Protocol" | "Portfolio Tracker";
|
|
486
|
+
}[];
|
|
487
|
+
timestamp: number;
|
|
488
|
+
isNew: boolean;
|
|
489
|
+
extraRewarders: {
|
|
490
|
+
__typename?: "Rewarder";
|
|
491
|
+
id: any;
|
|
492
|
+
currentApy?: any | null;
|
|
493
|
+
rewardToken?: {
|
|
494
|
+
__typename?: "RefToken";
|
|
495
|
+
symbol?: string | null;
|
|
496
|
+
id: any;
|
|
497
|
+
} | null;
|
|
498
|
+
}[] | null | undefined;
|
|
499
|
+
createdAt: Date;
|
|
500
|
+
baseAsset: {
|
|
501
|
+
price: number;
|
|
502
|
+
address: viem.Address;
|
|
503
|
+
chainId: number;
|
|
504
|
+
decimals: number;
|
|
505
|
+
logoURI: string;
|
|
506
|
+
name: string;
|
|
507
|
+
symbol: string;
|
|
508
|
+
audits?: string;
|
|
509
|
+
extensions?: {
|
|
510
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
511
|
+
bridgeInfo?: {
|
|
512
|
+
[chainId: number]: {
|
|
513
|
+
tokenAddress: viem.Address;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
516
|
+
rebasing?: boolean;
|
|
517
|
+
parentAsset?: string;
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
denomination: {
|
|
521
|
+
price: number;
|
|
522
|
+
address: viem.Address;
|
|
523
|
+
chainId: number;
|
|
524
|
+
decimals: number;
|
|
525
|
+
logoURI: string;
|
|
526
|
+
name: string;
|
|
527
|
+
symbol: string;
|
|
528
|
+
audits?: string;
|
|
529
|
+
extensions?: {
|
|
530
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
531
|
+
bridgeInfo?: {
|
|
532
|
+
[chainId: number]: {
|
|
533
|
+
tokenAddress: viem.Address;
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
rebasing?: boolean;
|
|
537
|
+
parentAsset?: string;
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
useDenomination: boolean;
|
|
541
|
+
UIBaseAsset: IToken;
|
|
542
|
+
UITokens: {
|
|
543
|
+
valueUsd: number;
|
|
544
|
+
value: number;
|
|
545
|
+
allocation: number;
|
|
546
|
+
address: viem.Address;
|
|
547
|
+
chainId: number;
|
|
548
|
+
decimals: number;
|
|
549
|
+
logoURI: string;
|
|
550
|
+
name: string;
|
|
551
|
+
symbol: string;
|
|
552
|
+
audits?: string;
|
|
553
|
+
extensions?: {
|
|
554
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
555
|
+
bridgeInfo?: {
|
|
556
|
+
[chainId: number]: {
|
|
557
|
+
tokenAddress: viem.Address;
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
rebasing?: boolean;
|
|
561
|
+
parentAsset?: string;
|
|
562
|
+
};
|
|
563
|
+
}[];
|
|
564
|
+
UIExchanges: {
|
|
565
|
+
valueUsd: number;
|
|
566
|
+
value: number;
|
|
567
|
+
allocation: number;
|
|
568
|
+
logoURI: string;
|
|
569
|
+
name: string;
|
|
570
|
+
audits?: string;
|
|
571
|
+
type: "DEX" | "Lending Market" | "Protocol" | "Portfolio Tracker";
|
|
572
|
+
}[];
|
|
573
|
+
tokens: {
|
|
574
|
+
valueUsd: number;
|
|
575
|
+
value: number;
|
|
576
|
+
allocation: number;
|
|
577
|
+
address: viem.Address;
|
|
578
|
+
chainId: number;
|
|
579
|
+
decimals: number;
|
|
580
|
+
logoURI: string;
|
|
581
|
+
name: string;
|
|
582
|
+
symbol: string;
|
|
583
|
+
audits?: string;
|
|
584
|
+
extensions?: {
|
|
585
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
586
|
+
bridgeInfo?: {
|
|
587
|
+
[chainId: number]: {
|
|
588
|
+
tokenAddress: viem.Address;
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
rebasing?: boolean;
|
|
592
|
+
parentAsset?: string;
|
|
593
|
+
};
|
|
594
|
+
}[];
|
|
595
|
+
chain: _tokemak_tokenlist.INetwork | undefined;
|
|
596
|
+
apr: {
|
|
597
|
+
base: any;
|
|
598
|
+
boosted: number;
|
|
599
|
+
extraAprs: ExtraReward[];
|
|
600
|
+
combined: any;
|
|
601
|
+
hasBoostedApr: boolean;
|
|
602
|
+
hasExtraAprs: boolean;
|
|
603
|
+
};
|
|
604
|
+
dailyEarnings: {
|
|
605
|
+
combined: {
|
|
606
|
+
denom: number;
|
|
607
|
+
ETH: number;
|
|
608
|
+
WETH: number;
|
|
609
|
+
USDC: number;
|
|
610
|
+
DOLA: number;
|
|
611
|
+
PXETH: number;
|
|
612
|
+
S: number;
|
|
613
|
+
TOKE: number;
|
|
614
|
+
WS: number;
|
|
615
|
+
baseAsset: number;
|
|
616
|
+
USD: number;
|
|
617
|
+
};
|
|
618
|
+
base: {
|
|
619
|
+
denom: number;
|
|
620
|
+
ETH: number;
|
|
621
|
+
WETH: number;
|
|
622
|
+
USDC: number;
|
|
623
|
+
DOLA: number;
|
|
624
|
+
PXETH: number;
|
|
625
|
+
S: number;
|
|
626
|
+
TOKE: number;
|
|
627
|
+
WS: number;
|
|
628
|
+
baseAsset: number;
|
|
629
|
+
USD: number;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
navPerShare: {
|
|
633
|
+
denom: number;
|
|
634
|
+
ETH: number;
|
|
635
|
+
WETH: number;
|
|
636
|
+
USDC: number;
|
|
637
|
+
DOLA: number;
|
|
638
|
+
PXETH: number;
|
|
639
|
+
S: number;
|
|
640
|
+
TOKE: number;
|
|
641
|
+
WS: number;
|
|
642
|
+
baseAsset: number;
|
|
643
|
+
USD: number;
|
|
644
|
+
};
|
|
645
|
+
idle: {
|
|
646
|
+
allocation: number;
|
|
647
|
+
token: IToken;
|
|
648
|
+
denom: number;
|
|
649
|
+
ETH: number;
|
|
650
|
+
WETH: number;
|
|
651
|
+
USDC: number;
|
|
652
|
+
DOLA: number;
|
|
653
|
+
PXETH: number;
|
|
654
|
+
S: number;
|
|
655
|
+
TOKE: number;
|
|
656
|
+
WS: number;
|
|
657
|
+
baseAsset: number;
|
|
658
|
+
USD: number;
|
|
659
|
+
};
|
|
660
|
+
category: AutopoolCategory;
|
|
661
|
+
poolAddress: `0x${string}`;
|
|
662
|
+
name: string;
|
|
663
|
+
vaultType: `0x${string}`;
|
|
664
|
+
streamingFeeBps: bigint;
|
|
665
|
+
periodicFeeBps: bigint;
|
|
666
|
+
feeHighMarkEnabled: boolean;
|
|
667
|
+
feeSettingsIncomplete: boolean;
|
|
668
|
+
isShutdown: boolean;
|
|
669
|
+
shutdownStatus: number;
|
|
670
|
+
rewarder: `0x${string}`;
|
|
671
|
+
strategy: `0x${string}`;
|
|
672
|
+
totalSupply: bigint;
|
|
673
|
+
totalIdle: bigint;
|
|
674
|
+
totalDebt: bigint;
|
|
675
|
+
}[]>;
|
|
676
|
+
|
|
677
|
+
declare const convertBaseAssetToTokenPrices: (baseAssetValue: number, baseAssetPrice: number, prices: TokenPrices) => Currencies;
|
|
678
|
+
|
|
679
|
+
declare const convertBaseAssetToTokenPricesAndDenom: (baseAsset: number, baseAssetPrice: number, denomPrice: number, prices: TokenPrices) => {
|
|
680
|
+
denom: number;
|
|
681
|
+
ETH: number;
|
|
682
|
+
WETH: number;
|
|
683
|
+
USDC: number;
|
|
684
|
+
DOLA: number;
|
|
685
|
+
PXETH: number;
|
|
686
|
+
S: number;
|
|
687
|
+
TOKE: number;
|
|
688
|
+
WS: number;
|
|
689
|
+
baseAsset: number;
|
|
690
|
+
USD: number;
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
declare const getAutopoolInfo: (symbol: string) => _tokemak_tokenlist.IAutopool | undefined;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Generic function to find the closest entry in an array based on a numeric property
|
|
697
|
+
* @param data - Array of objects to search through
|
|
698
|
+
* @param targetValue - The target value to find the closest match for
|
|
699
|
+
* @param propertyKey - The property key to compare against (e.g., 'timestamp', 'date')
|
|
700
|
+
* @param maxDifference - Maximum allowed difference (default: Infinity)
|
|
701
|
+
* @param getValue - Optional function to extract the value from the object (default: direct property access)
|
|
702
|
+
* @returns The closest entry or null if no entry is within the tolerance
|
|
703
|
+
*/
|
|
704
|
+
declare function findClosestEntry<T extends Record<string, any>>(data: T[], targetValue: number, propertyKey: keyof T, maxDifference?: number, getValue?: (item: T) => number): T | null;
|
|
705
|
+
/**
|
|
706
|
+
* Specialized function to find the closest entry by timestamp
|
|
707
|
+
* @param data - Array of objects with timestamp property
|
|
708
|
+
* @param targetTimestamp - The target timestamp to find the closest match for
|
|
709
|
+
* @param maxDifferenceInSeconds - Maximum allowed difference in seconds (default: 12 hours)
|
|
710
|
+
* @returns The closest entry or null if no entry is within the tolerance
|
|
711
|
+
*/
|
|
712
|
+
declare function findClosestTimestampEntry<T extends {
|
|
713
|
+
timestamp: number;
|
|
714
|
+
}>(data: T[], targetTimestamp: number, maxDifferenceInSeconds?: number): T | null;
|
|
715
|
+
/**
|
|
716
|
+
* Specialized function to find the closest entry by date
|
|
717
|
+
* @param data - Array of objects with date property
|
|
718
|
+
* @param targetDate - The target date to find the closest match for
|
|
719
|
+
* @param maxDifferenceInMs - Maximum allowed difference in milliseconds (default: 24 hours)
|
|
720
|
+
* @returns The closest entry or null if no entry is within the tolerance
|
|
721
|
+
*/
|
|
722
|
+
declare function findClosestDateEntry<T extends {
|
|
723
|
+
date: Date;
|
|
724
|
+
}>(data: T[], targetDate: Date, maxDifferenceInMs?: number): T | null;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Generic pagination helper for GraphQL queries
|
|
728
|
+
*
|
|
729
|
+
* @template T - The type of the query function
|
|
730
|
+
* @template R - The return type of the query function
|
|
731
|
+
* @template K - The key of the array property to paginate
|
|
732
|
+
* @param queryFn - The GraphQL query function to paginate
|
|
733
|
+
* @param arrayKey - The key of the array property to collect from the query result
|
|
734
|
+
* @param options - Pagination options
|
|
735
|
+
* @returns Promise with all paginated results combined
|
|
736
|
+
*/
|
|
737
|
+
declare function paginateQuery<T extends (variables?: any) => Promise<any>, R extends Awaited<ReturnType<T>>, K extends keyof R>(queryFn: T, arrayKey: K, options?: {
|
|
738
|
+
first?: number;
|
|
739
|
+
maxPages?: number;
|
|
740
|
+
onPage?: (page: R[K], pageNumber: number) => void;
|
|
741
|
+
}): Promise<R[K]>;
|
|
742
|
+
|
|
743
|
+
declare const getAutopools: (wagmiConfig: Config$1, { prices, includeTestnet, }: {
|
|
744
|
+
prices: TokenPrices;
|
|
745
|
+
includeTestnet?: boolean;
|
|
746
|
+
}) => Promise<{
|
|
747
|
+
symbol: string;
|
|
748
|
+
logoURI?: string | undefined;
|
|
749
|
+
description?: string;
|
|
750
|
+
type?: "Tokemak" | "Ecosystem" | undefined;
|
|
751
|
+
tvl: number;
|
|
752
|
+
totalAssets: {
|
|
753
|
+
denom: number;
|
|
754
|
+
ETH: number;
|
|
755
|
+
WETH: number;
|
|
756
|
+
USDC: number;
|
|
757
|
+
DOLA: number;
|
|
758
|
+
PXETH: number;
|
|
759
|
+
S: number;
|
|
760
|
+
TOKE: number;
|
|
761
|
+
WS: number;
|
|
762
|
+
baseAsset: number;
|
|
763
|
+
USD: number;
|
|
764
|
+
};
|
|
765
|
+
destinations: {
|
|
766
|
+
debtValueHeldByVaultUsd: number;
|
|
767
|
+
debtValueHeldByVaultEth: number;
|
|
768
|
+
compositeReturn: number;
|
|
769
|
+
debtValueHeldByVaultAllocation: number;
|
|
770
|
+
underlyingTokens: {
|
|
771
|
+
valueUsd: number;
|
|
772
|
+
value: number;
|
|
773
|
+
address: viem.Address;
|
|
774
|
+
chainId: number;
|
|
775
|
+
decimals: number;
|
|
776
|
+
logoURI: string;
|
|
777
|
+
name: string;
|
|
778
|
+
symbol: string;
|
|
779
|
+
audits?: string;
|
|
780
|
+
extensions?: {
|
|
781
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
782
|
+
bridgeInfo?: {
|
|
783
|
+
[chainId: number]: {
|
|
784
|
+
tokenAddress: viem.Address;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
rebasing?: boolean;
|
|
788
|
+
parentAsset?: string;
|
|
789
|
+
};
|
|
790
|
+
}[];
|
|
791
|
+
poolName: string;
|
|
792
|
+
exchange: _tokemak_tokenlist.IProtocol | undefined;
|
|
793
|
+
vaultAddress: `0x${string}`;
|
|
794
|
+
exchangeName: string;
|
|
795
|
+
totalSupply: bigint;
|
|
796
|
+
lastSnapshotTimestamp: bigint;
|
|
797
|
+
feeApr: bigint;
|
|
798
|
+
lastDebtReportTime: bigint;
|
|
799
|
+
minDebtValue: bigint;
|
|
800
|
+
maxDebtValue: bigint;
|
|
801
|
+
debtValueHeldByVault: bigint;
|
|
802
|
+
queuedForRemoval: boolean;
|
|
803
|
+
statsIncomplete: boolean;
|
|
804
|
+
isShutdown: boolean;
|
|
805
|
+
shutdownStatus: number;
|
|
806
|
+
autoPoolOwnsShares: bigint;
|
|
807
|
+
actualLPTotalSupply: bigint;
|
|
808
|
+
dexPool: `0x${string}`;
|
|
809
|
+
lpTokenAddress: `0x${string}`;
|
|
810
|
+
lpTokenSymbol: string;
|
|
811
|
+
lpTokenName: string;
|
|
812
|
+
statsSafeLPTotalSupply: bigint;
|
|
813
|
+
statsIncentiveCredits: number;
|
|
814
|
+
rewardsTokens: readonly {
|
|
815
|
+
tokenAddress: `0x${string}`;
|
|
816
|
+
}[];
|
|
817
|
+
underlyingTokenSymbols: readonly {
|
|
818
|
+
symbol: string;
|
|
819
|
+
}[];
|
|
820
|
+
lstStatsData: readonly {
|
|
821
|
+
lastSnapshotTimestamp: bigint;
|
|
822
|
+
baseApr: bigint;
|
|
823
|
+
discount: bigint;
|
|
824
|
+
discountHistory: readonly [number, number, number, number, number, number, number, number, number, number];
|
|
825
|
+
discountTimestampByPercent: number;
|
|
826
|
+
}[];
|
|
827
|
+
underlyingTokenValueHeld: readonly {
|
|
828
|
+
valueHeldInEth: bigint;
|
|
829
|
+
}[];
|
|
830
|
+
reservesInEth: readonly bigint[];
|
|
831
|
+
statsPeriodFinishForRewards: readonly number[];
|
|
832
|
+
statsAnnualizedRewardAmounts: readonly bigint[];
|
|
833
|
+
}[];
|
|
834
|
+
exchanges: {
|
|
835
|
+
valueUsd: number;
|
|
836
|
+
value: number;
|
|
837
|
+
allocation: number;
|
|
838
|
+
logoURI: string;
|
|
839
|
+
name: string;
|
|
840
|
+
audits?: string;
|
|
841
|
+
type: "DEX" | "Lending Market" | "Protocol" | "Portfolio Tracker";
|
|
842
|
+
}[];
|
|
843
|
+
timestamp: number;
|
|
844
|
+
isNew: boolean;
|
|
845
|
+
extraRewarders: {
|
|
846
|
+
__typename?: "Rewarder";
|
|
847
|
+
id: any;
|
|
848
|
+
currentApy?: any | null;
|
|
849
|
+
rewardToken?: {
|
|
850
|
+
__typename?: "RefToken";
|
|
851
|
+
symbol?: string | null;
|
|
852
|
+
id: any;
|
|
853
|
+
} | null;
|
|
854
|
+
}[] | null | undefined;
|
|
855
|
+
createdAt: Date;
|
|
856
|
+
baseAsset: {
|
|
857
|
+
price: number;
|
|
858
|
+
address: viem.Address;
|
|
859
|
+
chainId: number;
|
|
860
|
+
decimals: number;
|
|
861
|
+
logoURI: string;
|
|
862
|
+
name: string;
|
|
863
|
+
symbol: string;
|
|
864
|
+
audits?: string;
|
|
865
|
+
extensions?: {
|
|
866
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
867
|
+
bridgeInfo?: {
|
|
868
|
+
[chainId: number]: {
|
|
869
|
+
tokenAddress: viem.Address;
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
rebasing?: boolean;
|
|
873
|
+
parentAsset?: string;
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
denomination: {
|
|
877
|
+
price: number;
|
|
878
|
+
address: viem.Address;
|
|
879
|
+
chainId: number;
|
|
880
|
+
decimals: number;
|
|
881
|
+
logoURI: string;
|
|
882
|
+
name: string;
|
|
883
|
+
symbol: string;
|
|
884
|
+
audits?: string;
|
|
885
|
+
extensions?: {
|
|
886
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
887
|
+
bridgeInfo?: {
|
|
888
|
+
[chainId: number]: {
|
|
889
|
+
tokenAddress: viem.Address;
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
rebasing?: boolean;
|
|
893
|
+
parentAsset?: string;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
useDenomination: boolean;
|
|
897
|
+
UIBaseAsset: _tokemak_tokenlist.IToken;
|
|
898
|
+
UITokens: {
|
|
899
|
+
valueUsd: number;
|
|
900
|
+
value: number;
|
|
901
|
+
allocation: number;
|
|
902
|
+
address: viem.Address;
|
|
903
|
+
chainId: number;
|
|
904
|
+
decimals: number;
|
|
905
|
+
logoURI: string;
|
|
906
|
+
name: string;
|
|
907
|
+
symbol: string;
|
|
908
|
+
audits?: string;
|
|
909
|
+
extensions?: {
|
|
910
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
911
|
+
bridgeInfo?: {
|
|
912
|
+
[chainId: number]: {
|
|
913
|
+
tokenAddress: viem.Address;
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
rebasing?: boolean;
|
|
917
|
+
parentAsset?: string;
|
|
918
|
+
};
|
|
919
|
+
}[];
|
|
920
|
+
UIExchanges: {
|
|
921
|
+
valueUsd: number;
|
|
922
|
+
value: number;
|
|
923
|
+
allocation: number;
|
|
924
|
+
logoURI: string;
|
|
925
|
+
name: string;
|
|
926
|
+
audits?: string;
|
|
927
|
+
type: "DEX" | "Lending Market" | "Protocol" | "Portfolio Tracker";
|
|
928
|
+
}[];
|
|
929
|
+
tokens: {
|
|
930
|
+
valueUsd: number;
|
|
931
|
+
value: number;
|
|
932
|
+
allocation: number;
|
|
933
|
+
address: viem.Address;
|
|
934
|
+
chainId: number;
|
|
935
|
+
decimals: number;
|
|
936
|
+
logoURI: string;
|
|
937
|
+
name: string;
|
|
938
|
+
symbol: string;
|
|
939
|
+
audits?: string;
|
|
940
|
+
extensions?: {
|
|
941
|
+
bridgeMainnetAdapter?: viem.Address;
|
|
942
|
+
bridgeInfo?: {
|
|
943
|
+
[chainId: number]: {
|
|
944
|
+
tokenAddress: viem.Address;
|
|
945
|
+
};
|
|
946
|
+
};
|
|
947
|
+
rebasing?: boolean;
|
|
948
|
+
parentAsset?: string;
|
|
949
|
+
};
|
|
950
|
+
}[];
|
|
951
|
+
chain: _tokemak_tokenlist.INetwork | undefined;
|
|
952
|
+
apr: {
|
|
953
|
+
base: any;
|
|
954
|
+
boosted: number;
|
|
955
|
+
extraAprs: ExtraReward[];
|
|
956
|
+
combined: any;
|
|
957
|
+
hasBoostedApr: boolean;
|
|
958
|
+
hasExtraAprs: boolean;
|
|
959
|
+
};
|
|
960
|
+
dailyEarnings: {
|
|
961
|
+
combined: {
|
|
962
|
+
denom: number;
|
|
963
|
+
ETH: number;
|
|
964
|
+
WETH: number;
|
|
965
|
+
USDC: number;
|
|
966
|
+
DOLA: number;
|
|
967
|
+
PXETH: number;
|
|
968
|
+
S: number;
|
|
969
|
+
TOKE: number;
|
|
970
|
+
WS: number;
|
|
971
|
+
baseAsset: number;
|
|
972
|
+
USD: number;
|
|
973
|
+
};
|
|
974
|
+
base: {
|
|
975
|
+
denom: number;
|
|
976
|
+
ETH: number;
|
|
977
|
+
WETH: number;
|
|
978
|
+
USDC: number;
|
|
979
|
+
DOLA: number;
|
|
980
|
+
PXETH: number;
|
|
981
|
+
S: number;
|
|
982
|
+
TOKE: number;
|
|
983
|
+
WS: number;
|
|
984
|
+
baseAsset: number;
|
|
985
|
+
USD: number;
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
navPerShare: {
|
|
989
|
+
denom: number;
|
|
990
|
+
ETH: number;
|
|
991
|
+
WETH: number;
|
|
992
|
+
USDC: number;
|
|
993
|
+
DOLA: number;
|
|
994
|
+
PXETH: number;
|
|
995
|
+
S: number;
|
|
996
|
+
TOKE: number;
|
|
997
|
+
WS: number;
|
|
998
|
+
baseAsset: number;
|
|
999
|
+
USD: number;
|
|
1000
|
+
};
|
|
1001
|
+
idle: {
|
|
1002
|
+
allocation: number;
|
|
1003
|
+
token: _tokemak_tokenlist.IToken;
|
|
1004
|
+
denom: number;
|
|
1005
|
+
ETH: number;
|
|
1006
|
+
WETH: number;
|
|
1007
|
+
USDC: number;
|
|
1008
|
+
DOLA: number;
|
|
1009
|
+
PXETH: number;
|
|
1010
|
+
S: number;
|
|
1011
|
+
TOKE: number;
|
|
1012
|
+
WS: number;
|
|
1013
|
+
baseAsset: number;
|
|
1014
|
+
USD: number;
|
|
1015
|
+
};
|
|
1016
|
+
category: AutopoolCategory;
|
|
1017
|
+
poolAddress: `0x${string}`;
|
|
1018
|
+
name: string;
|
|
1019
|
+
vaultType: `0x${string}`;
|
|
1020
|
+
streamingFeeBps: bigint;
|
|
1021
|
+
periodicFeeBps: bigint;
|
|
1022
|
+
feeHighMarkEnabled: boolean;
|
|
1023
|
+
feeSettingsIncomplete: boolean;
|
|
1024
|
+
isShutdown: boolean;
|
|
1025
|
+
shutdownStatus: number;
|
|
1026
|
+
rewarder: `0x${string}`;
|
|
1027
|
+
strategy: `0x${string}`;
|
|
1028
|
+
totalSupply: bigint;
|
|
1029
|
+
totalIdle: bigint;
|
|
1030
|
+
totalDebt: bigint;
|
|
1031
|
+
}[] | undefined>;
|
|
1032
|
+
type IAutopools = Awaited<ReturnType<typeof getAutopools>>;
|
|
1033
|
+
type IAutopool = NonNullable<IAutopools>[number];
|
|
1034
|
+
|
|
1035
|
+
declare const getAutopoolRebalances: (id: Address, chainId?: SupportedChainIds) => Promise<{
|
|
1036
|
+
ix: number;
|
|
1037
|
+
__typename?: "AutopoolRebalance";
|
|
1038
|
+
autopool: any;
|
|
1039
|
+
timestamp: any;
|
|
1040
|
+
logIndex: any;
|
|
1041
|
+
transactionHash: any;
|
|
1042
|
+
blockNumber: any;
|
|
1043
|
+
tokenOutAmount: any;
|
|
1044
|
+
tokenOutValueInEth: any;
|
|
1045
|
+
tokenOutValueBaseAsset: any;
|
|
1046
|
+
tokenOutValueDenominatedIn: any;
|
|
1047
|
+
tokenInAmount: any;
|
|
1048
|
+
tokenInValueInEth: any;
|
|
1049
|
+
tokenInValueBaseAsset: any;
|
|
1050
|
+
tokenInValueDenominatedIn: any;
|
|
1051
|
+
destinationOutName: string;
|
|
1052
|
+
destinationOutAddress: any;
|
|
1053
|
+
destinationOutExchangeName: string;
|
|
1054
|
+
destinationInName: string;
|
|
1055
|
+
destinationInAddress: any;
|
|
1056
|
+
destinationInExchangeName: string;
|
|
1057
|
+
tokenOut: {
|
|
1058
|
+
__typename?: "RefToken";
|
|
1059
|
+
id: any;
|
|
1060
|
+
symbol?: string | null;
|
|
1061
|
+
};
|
|
1062
|
+
tokenIn: {
|
|
1063
|
+
__typename?: "RefToken";
|
|
1064
|
+
id: any;
|
|
1065
|
+
symbol?: string | null;
|
|
1066
|
+
};
|
|
1067
|
+
destinationOutUnderlyingTokens: Array<{
|
|
1068
|
+
__typename?: "RefToken";
|
|
1069
|
+
id: any;
|
|
1070
|
+
symbol?: string | null;
|
|
1071
|
+
}>;
|
|
1072
|
+
destinationInUnderlyingTokens: Array<{
|
|
1073
|
+
__typename?: "RefToken";
|
|
1074
|
+
id: any;
|
|
1075
|
+
symbol?: string | null;
|
|
1076
|
+
}>;
|
|
1077
|
+
}[]>;
|
|
1078
|
+
|
|
1079
|
+
declare const getAutopoolsRebalances: (chainId?: SupportedChainIds) => Promise<{
|
|
1080
|
+
__typename?: "Rebalance";
|
|
1081
|
+
autopool: any;
|
|
1082
|
+
blockNumber: any;
|
|
1083
|
+
hash: string;
|
|
1084
|
+
id: string;
|
|
1085
|
+
ix: any;
|
|
1086
|
+
timestamp: any;
|
|
1087
|
+
outData?: {
|
|
1088
|
+
__typename?: "RebalanceInOut";
|
|
1089
|
+
id: string;
|
|
1090
|
+
exchangeName: string;
|
|
1091
|
+
ethValue: any;
|
|
1092
|
+
destination: any;
|
|
1093
|
+
underlyer: {
|
|
1094
|
+
__typename?: "RefToken";
|
|
1095
|
+
decimals: any;
|
|
1096
|
+
id: any;
|
|
1097
|
+
name?: string | null;
|
|
1098
|
+
symbol?: string | null;
|
|
1099
|
+
};
|
|
1100
|
+
tokens: Array<{
|
|
1101
|
+
__typename?: "RefToken";
|
|
1102
|
+
decimals: any;
|
|
1103
|
+
id: any;
|
|
1104
|
+
name?: string | null;
|
|
1105
|
+
symbol?: string | null;
|
|
1106
|
+
}>;
|
|
1107
|
+
} | null;
|
|
1108
|
+
inData?: {
|
|
1109
|
+
__typename?: "RebalanceInOut";
|
|
1110
|
+
ethValue: any;
|
|
1111
|
+
exchangeName: string;
|
|
1112
|
+
id: string;
|
|
1113
|
+
destination: any;
|
|
1114
|
+
underlyer: {
|
|
1115
|
+
__typename?: "RefToken";
|
|
1116
|
+
decimals: any;
|
|
1117
|
+
id: any;
|
|
1118
|
+
name?: string | null;
|
|
1119
|
+
symbol?: string | null;
|
|
1120
|
+
};
|
|
1121
|
+
tokens: Array<{
|
|
1122
|
+
__typename?: "RefToken";
|
|
1123
|
+
decimals: any;
|
|
1124
|
+
id: any;
|
|
1125
|
+
name?: string | null;
|
|
1126
|
+
symbol?: string | null;
|
|
1127
|
+
}>;
|
|
1128
|
+
} | null;
|
|
1129
|
+
}[]>;
|
|
1130
|
+
|
|
1131
|
+
declare const getAutopoolsHistory: (autopools: IAutopools, days: number, includeTestnet?: boolean) => Promise<{
|
|
1132
|
+
[key: string]: (Omit<{
|
|
1133
|
+
__typename?: "AutopoolDayData";
|
|
1134
|
+
totalSupply: any;
|
|
1135
|
+
nav: any;
|
|
1136
|
+
date: string;
|
|
1137
|
+
timestamp: any;
|
|
1138
|
+
id: string;
|
|
1139
|
+
vault: {
|
|
1140
|
+
__typename?: "Autopool";
|
|
1141
|
+
id: any;
|
|
1142
|
+
registered: boolean;
|
|
1143
|
+
};
|
|
1144
|
+
}, "date"> & {
|
|
1145
|
+
date: Date;
|
|
1146
|
+
baseAsset: IToken;
|
|
1147
|
+
})[];
|
|
1148
|
+
} | undefined>;
|
|
1149
|
+
type IAutopoolsHistory = Awaited<ReturnType<typeof getAutopoolsHistory>>;
|
|
1150
|
+
|
|
1151
|
+
type VaultAddedMapping = {
|
|
1152
|
+
[key: string]: Pick<VaultAddedMapping, "vault" | "blockTimestamp">;
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
interface CurveLP {
|
|
1156
|
+
apr: number;
|
|
1157
|
+
baseApy: number;
|
|
1158
|
+
crvApy: number;
|
|
1159
|
+
crvBoost: number;
|
|
1160
|
+
curveTvl: number;
|
|
1161
|
+
cvxApy: number;
|
|
1162
|
+
timestamp: string;
|
|
1163
|
+
totalSupply: bigint;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
interface UserActivity {
|
|
1167
|
+
data: string;
|
|
1168
|
+
[key: string]: any;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
interface QuoteAndPriceBaseConfig {
|
|
1172
|
+
sellToken: Address;
|
|
1173
|
+
buyToken: Address;
|
|
1174
|
+
sellAmount?: bigint;
|
|
1175
|
+
buyAmount?: bigint;
|
|
1176
|
+
slippagePercentage?: number;
|
|
1177
|
+
gasPrice?: number;
|
|
1178
|
+
enableSlippageProtection?: boolean;
|
|
1179
|
+
priceImpactProtectionPercentage?: number;
|
|
1180
|
+
shouldSellEntireBalance?: boolean;
|
|
1181
|
+
}
|
|
1182
|
+
interface QuoteAndPriceBaseResult {
|
|
1183
|
+
allowanceTarget: string;
|
|
1184
|
+
auxiliaryChainData: Record<string, unknown>;
|
|
1185
|
+
buyAmount: bigint;
|
|
1186
|
+
buyTokenAddress: Address;
|
|
1187
|
+
buyTokenToEthRate: string;
|
|
1188
|
+
chainId: number;
|
|
1189
|
+
estimatedGas: string;
|
|
1190
|
+
estimatedPriceImpact: string;
|
|
1191
|
+
expectedSlippage: string | null;
|
|
1192
|
+
fees: {
|
|
1193
|
+
zeroExFee: string | null;
|
|
1194
|
+
};
|
|
1195
|
+
gas: string;
|
|
1196
|
+
gasPrice: string;
|
|
1197
|
+
grossBuyAmount: string;
|
|
1198
|
+
grossPrice: string;
|
|
1199
|
+
grossSellAmount: string;
|
|
1200
|
+
minimumProtocolFee: string;
|
|
1201
|
+
price: string;
|
|
1202
|
+
protocolFee: string;
|
|
1203
|
+
sellAmount: bigint;
|
|
1204
|
+
sellTokenAddress: Address;
|
|
1205
|
+
sellTokenToEthRate: string;
|
|
1206
|
+
sources: {
|
|
1207
|
+
name: string;
|
|
1208
|
+
proportion: string;
|
|
1209
|
+
}[];
|
|
1210
|
+
value: string;
|
|
1211
|
+
}
|
|
1212
|
+
interface FillData {
|
|
1213
|
+
router: string;
|
|
1214
|
+
gasUsed: number;
|
|
1215
|
+
path: string;
|
|
1216
|
+
routerVersion: number;
|
|
1217
|
+
}
|
|
1218
|
+
interface Order {
|
|
1219
|
+
fill: {
|
|
1220
|
+
input: string;
|
|
1221
|
+
output: string;
|
|
1222
|
+
adjustedOutput: string;
|
|
1223
|
+
gas: number;
|
|
1224
|
+
fillData: FillData;
|
|
1225
|
+
};
|
|
1226
|
+
adjustedOutput: string;
|
|
1227
|
+
gas: number;
|
|
1228
|
+
input: string;
|
|
1229
|
+
output: string;
|
|
1230
|
+
makerAmount: string;
|
|
1231
|
+
makerToken: string;
|
|
1232
|
+
source: string;
|
|
1233
|
+
takerAmount: string;
|
|
1234
|
+
takerToken: string;
|
|
1235
|
+
type: number;
|
|
1236
|
+
}
|
|
1237
|
+
interface QuoteResult extends QuoteAndPriceBaseResult {
|
|
1238
|
+
data: `0x${string}`;
|
|
1239
|
+
decodedUniqueId: string;
|
|
1240
|
+
guaranteedPrice: string;
|
|
1241
|
+
orders: Order[];
|
|
1242
|
+
to: Address;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
type SendParam = {
|
|
1246
|
+
dstEid: number;
|
|
1247
|
+
to: `0x${string}`;
|
|
1248
|
+
amountLD: bigint;
|
|
1249
|
+
minAmountLD: bigint;
|
|
1250
|
+
extraOptions: any;
|
|
1251
|
+
composeMsg: `0x${string}`;
|
|
1252
|
+
oftCmd: `0x${string}`;
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
interface TransactionRequest {
|
|
1256
|
+
from: Address;
|
|
1257
|
+
to: Address;
|
|
1258
|
+
data: `0x${string}`;
|
|
1259
|
+
value: `0x${string}` | string;
|
|
1260
|
+
gasPrice: string;
|
|
1261
|
+
gas?: string;
|
|
1262
|
+
}
|
|
1263
|
+
interface Token {
|
|
1264
|
+
address: Address;
|
|
1265
|
+
chainId: number;
|
|
1266
|
+
symbol: string;
|
|
1267
|
+
decimals: number;
|
|
1268
|
+
name: string;
|
|
1269
|
+
coinKey: string;
|
|
1270
|
+
logoURI: string;
|
|
1271
|
+
priceUSD: string;
|
|
1272
|
+
}
|
|
1273
|
+
interface GasCost {
|
|
1274
|
+
type: string;
|
|
1275
|
+
price: string;
|
|
1276
|
+
estimate: string;
|
|
1277
|
+
limit: string;
|
|
1278
|
+
amount: string;
|
|
1279
|
+
amountUSD: string;
|
|
1280
|
+
token: Token;
|
|
1281
|
+
}
|
|
1282
|
+
interface StepEstimate {
|
|
1283
|
+
tool: string;
|
|
1284
|
+
fromAmount: string;
|
|
1285
|
+
toAmount: string;
|
|
1286
|
+
toAmountMin: string;
|
|
1287
|
+
approvalAddress: Address;
|
|
1288
|
+
executionDuration: number;
|
|
1289
|
+
feeCosts: any[];
|
|
1290
|
+
gasCosts: GasCost[];
|
|
1291
|
+
}
|
|
1292
|
+
interface Step {
|
|
1293
|
+
id: string;
|
|
1294
|
+
type: string;
|
|
1295
|
+
action: {
|
|
1296
|
+
fromChainId: number;
|
|
1297
|
+
fromAmount: string;
|
|
1298
|
+
fromToken: Token;
|
|
1299
|
+
toChainId: number;
|
|
1300
|
+
toToken: Token;
|
|
1301
|
+
slippage: number;
|
|
1302
|
+
fromAddress: Address;
|
|
1303
|
+
toAddress: Address;
|
|
1304
|
+
};
|
|
1305
|
+
estimate: StepEstimate;
|
|
1306
|
+
tool: string;
|
|
1307
|
+
toolDetails: {
|
|
1308
|
+
key: string;
|
|
1309
|
+
name: string;
|
|
1310
|
+
logoURI: string;
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
interface Fill {
|
|
1314
|
+
from: Address;
|
|
1315
|
+
to: Address;
|
|
1316
|
+
source: string;
|
|
1317
|
+
proportionBps: string;
|
|
1318
|
+
}
|
|
1319
|
+
interface Route {
|
|
1320
|
+
fills: Fill[];
|
|
1321
|
+
tokens: {
|
|
1322
|
+
address: Address;
|
|
1323
|
+
symbol: string;
|
|
1324
|
+
}[];
|
|
1325
|
+
}
|
|
1326
|
+
interface TokenMetadata {
|
|
1327
|
+
buyToken: {
|
|
1328
|
+
buyTaxBps: string;
|
|
1329
|
+
sellTaxBps: string;
|
|
1330
|
+
};
|
|
1331
|
+
sellToken: {
|
|
1332
|
+
buyTaxBps: string;
|
|
1333
|
+
sellTaxBps: string;
|
|
1334
|
+
};
|
|
1335
|
+
}
|
|
1336
|
+
interface Issues {
|
|
1337
|
+
allowance?: {
|
|
1338
|
+
actual: string;
|
|
1339
|
+
spender: Address;
|
|
1340
|
+
};
|
|
1341
|
+
balance?: {
|
|
1342
|
+
token: Address;
|
|
1343
|
+
actual: string;
|
|
1344
|
+
expected: string;
|
|
1345
|
+
};
|
|
1346
|
+
simulationIncomplete: boolean;
|
|
1347
|
+
invalidSourcesPassed: string[];
|
|
1348
|
+
}
|
|
1349
|
+
interface ZeroExQuoteDetails {
|
|
1350
|
+
blockNumber: string;
|
|
1351
|
+
buyAmount: string;
|
|
1352
|
+
buyToken: Address;
|
|
1353
|
+
fees?: {
|
|
1354
|
+
integratorFee: null | string;
|
|
1355
|
+
zeroExFee: null | string;
|
|
1356
|
+
gasFee: null | string;
|
|
1357
|
+
};
|
|
1358
|
+
issues: Issues;
|
|
1359
|
+
liquidityAvailable: boolean;
|
|
1360
|
+
minBuyAmount: string;
|
|
1361
|
+
route: Route;
|
|
1362
|
+
sellAmount: string;
|
|
1363
|
+
sellToken: Address;
|
|
1364
|
+
tokenMetadata: TokenMetadata;
|
|
1365
|
+
totalNetworkFee: string;
|
|
1366
|
+
transaction: TransactionRequest;
|
|
1367
|
+
zid: `0x${string}`;
|
|
1368
|
+
}
|
|
1369
|
+
interface LifiQuoteDetails {
|
|
1370
|
+
type: string;
|
|
1371
|
+
id: string;
|
|
1372
|
+
tool: string;
|
|
1373
|
+
toolDetails: {
|
|
1374
|
+
key: string;
|
|
1375
|
+
name: string;
|
|
1376
|
+
logoURI: string;
|
|
1377
|
+
};
|
|
1378
|
+
action: {
|
|
1379
|
+
fromToken: Token;
|
|
1380
|
+
fromAmount: string;
|
|
1381
|
+
toToken: Token;
|
|
1382
|
+
fromChainId: number;
|
|
1383
|
+
toChainId: number;
|
|
1384
|
+
slippage: number;
|
|
1385
|
+
fromAddress: Address;
|
|
1386
|
+
toAddress: Address;
|
|
1387
|
+
};
|
|
1388
|
+
estimate: {
|
|
1389
|
+
tool: string;
|
|
1390
|
+
approvalAddress: Address;
|
|
1391
|
+
toAmountMin: string;
|
|
1392
|
+
toAmount: string;
|
|
1393
|
+
fromAmount: string;
|
|
1394
|
+
feeCosts: any[];
|
|
1395
|
+
gasCosts: GasCost[];
|
|
1396
|
+
executionDuration: number;
|
|
1397
|
+
fromAmountUSD: string;
|
|
1398
|
+
toAmountUSD: string;
|
|
1399
|
+
};
|
|
1400
|
+
includedSteps: Step[];
|
|
1401
|
+
integrator: string;
|
|
1402
|
+
transactionRequest: TransactionRequest & {
|
|
1403
|
+
chainId: number;
|
|
1404
|
+
gasLimit: string;
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
interface SwapQuoteResponse {
|
|
1408
|
+
aggregatorName: string;
|
|
1409
|
+
asyncSwapper: Address;
|
|
1410
|
+
buyAmount: string;
|
|
1411
|
+
minBuyAmount: string;
|
|
1412
|
+
tx: TransactionRequest;
|
|
1413
|
+
fullQuoteDetails: ZeroExQuoteDetails | LifiQuoteDetails;
|
|
1414
|
+
expiration: number;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
interface minAmountWithdrawnBaseConfig {
|
|
1418
|
+
address: Address | undefined;
|
|
1419
|
+
slippage: number | undefined;
|
|
1420
|
+
chainId: number | undefined;
|
|
1421
|
+
decimals: number | undefined;
|
|
1422
|
+
amount: bigint;
|
|
1423
|
+
isSwap: boolean | undefined;
|
|
1424
|
+
buyToken: Address | undefined;
|
|
1425
|
+
sellToken: Address | undefined;
|
|
1426
|
+
disabled?: boolean;
|
|
1427
|
+
autopool: Address | undefined;
|
|
1428
|
+
}
|
|
1429
|
+
interface minAmountDepositedBaseConfig {
|
|
1430
|
+
address: Address | undefined;
|
|
1431
|
+
chainId: number | undefined;
|
|
1432
|
+
decimals: number | undefined;
|
|
1433
|
+
amount: bigint;
|
|
1434
|
+
slippage: number | undefined;
|
|
1435
|
+
isSwap: boolean | undefined;
|
|
1436
|
+
disabled?: boolean;
|
|
1437
|
+
}
|
|
1438
|
+
interface minAmountWithdrawnFunctionConfig extends minAmountWithdrawnBaseConfig {
|
|
1439
|
+
config: Config$1;
|
|
1440
|
+
user: Address | undefined;
|
|
1441
|
+
}
|
|
1442
|
+
interface minAmountDepositedFunctionConfig extends minAmountDepositedBaseConfig {
|
|
1443
|
+
config: Config$1;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
declare const getCurveLP: () => Promise<CurveLP | undefined>;
|
|
1447
|
+
|
|
1448
|
+
declare const getSushiLP: (wagmiConfig: Config, { ethPrice }: {
|
|
1449
|
+
ethPrice: number;
|
|
1450
|
+
}) => Promise<{
|
|
1451
|
+
tvl: number;
|
|
1452
|
+
lpReserve: bigint;
|
|
1453
|
+
totalSupply: bigint;
|
|
1454
|
+
reserves: readonly [bigint, bigint, number];
|
|
1455
|
+
apr: any;
|
|
1456
|
+
weeklyTokeEmissions: any;
|
|
1457
|
+
valueOf1LP: number;
|
|
1458
|
+
} | undefined>;
|
|
1459
|
+
type ISushiLP = Awaited<ReturnType<typeof getSushiLP>>;
|
|
1460
|
+
|
|
1461
|
+
type UserActivityTotalsType = {
|
|
1462
|
+
[key: string]: {
|
|
1463
|
+
totalDeposits: bigint;
|
|
1464
|
+
totalStakes: bigint;
|
|
1465
|
+
totalWithdrawals: bigint;
|
|
1466
|
+
totalUnstakes: bigint;
|
|
1467
|
+
chainId: SupportedChainIds;
|
|
1468
|
+
};
|
|
1469
|
+
};
|
|
1470
|
+
declare const getChainUserActivity: (address?: Address, chainId?: SupportedChainIds) => Promise<{
|
|
1471
|
+
events: {
|
|
1472
|
+
timestamp: number;
|
|
1473
|
+
shareChange: string;
|
|
1474
|
+
assetChange: string;
|
|
1475
|
+
vaultAddress: string;
|
|
1476
|
+
}[];
|
|
1477
|
+
totals: UserActivityTotalsType;
|
|
1478
|
+
} | undefined>;
|
|
1479
|
+
|
|
1480
|
+
type IUserReward = {
|
|
1481
|
+
payload: {
|
|
1482
|
+
wallet: Address;
|
|
1483
|
+
cycle: bigint;
|
|
1484
|
+
amount: bigint;
|
|
1485
|
+
chainId: bigint;
|
|
1486
|
+
};
|
|
1487
|
+
signature: {
|
|
1488
|
+
v: number;
|
|
1489
|
+
r: `0x${string}`;
|
|
1490
|
+
s: `0x${string}`;
|
|
1491
|
+
msg: string;
|
|
1492
|
+
};
|
|
1493
|
+
summary?: {
|
|
1494
|
+
[key: string]: any;
|
|
1495
|
+
};
|
|
1496
|
+
breakdown?: {
|
|
1497
|
+
[key: string]: any;
|
|
1498
|
+
};
|
|
1499
|
+
};
|
|
1500
|
+
declare const getRewardsPayloadV1: (cycleHash: string, account: Address, rewardsV1Url: string) => Promise<IUserReward | null>;
|
|
1501
|
+
|
|
1502
|
+
declare const getUserAutoEthRewards: (wagmiConfig: Config, rewardsV1Url: string, rewardsHash: Address, address: Address, ethPrice: number, chainId: number) => Promise<{
|
|
1503
|
+
currentUserRewardsUsd: string;
|
|
1504
|
+
currentUserAPR?: number | undefined;
|
|
1505
|
+
currentUserRewards?: number | undefined;
|
|
1506
|
+
lastWeekUserRewards?: number | undefined;
|
|
1507
|
+
}>;
|
|
1508
|
+
|
|
1509
|
+
declare const getUserRewardsV1: (wagmiConfig: Config, { address, rewardsCycleIndex, rewardsV1, rewardsV1Url, rewardsV1Hash, chainId, }: {
|
|
1510
|
+
address: Address;
|
|
1511
|
+
rewardsCycleIndex: bigint;
|
|
1512
|
+
rewardsV1: Address;
|
|
1513
|
+
rewardsV1Url: string;
|
|
1514
|
+
rewardsV1Hash: Address;
|
|
1515
|
+
chainId: number;
|
|
1516
|
+
}) => Promise<{
|
|
1517
|
+
claimable: bigint;
|
|
1518
|
+
rewardsPayload: IUserReward | null;
|
|
1519
|
+
latestClaimablePayload: IUserReward;
|
|
1520
|
+
} | {
|
|
1521
|
+
rewardsPayload: IUserReward | null;
|
|
1522
|
+
latestClaimablePayload: null;
|
|
1523
|
+
claimable?: undefined;
|
|
1524
|
+
} | undefined>;
|
|
1525
|
+
|
|
1526
|
+
declare const getUserV1: (wagmiConfig: Config, { currentCycleIndex, address, chainId, }: {
|
|
1527
|
+
currentCycleIndex: bigint;
|
|
1528
|
+
address: Address;
|
|
1529
|
+
chainId: number;
|
|
1530
|
+
}) => Promise<{
|
|
1531
|
+
stakedToke: bigint;
|
|
1532
|
+
claimableToke: bigint | undefined;
|
|
1533
|
+
claimableEth: bigint | undefined;
|
|
1534
|
+
claimableAutoEth: bigint;
|
|
1535
|
+
tokeRewardsPayload: IUserReward | null | undefined;
|
|
1536
|
+
ethRewardsPayload: IUserReward | null | undefined;
|
|
1537
|
+
missedTokeRewardsPayload: IUserReward | null;
|
|
1538
|
+
autoEthGuardedRewardsPayload: IUserReward | null;
|
|
1539
|
+
claimableMissedToke: bigint;
|
|
1540
|
+
} | undefined>;
|
|
1541
|
+
|
|
1542
|
+
declare const getUserActivity: ({ address, includeTestnet, }: {
|
|
1543
|
+
address: Address;
|
|
1544
|
+
includeTestnet?: boolean;
|
|
1545
|
+
}) => Promise<{
|
|
1546
|
+
events: NonNullable<Awaited<ReturnType<typeof getChainUserActivity>>>["events"];
|
|
1547
|
+
totals: {
|
|
1548
|
+
[x: string]: {
|
|
1549
|
+
totalDeposits: bigint;
|
|
1550
|
+
totalWithdrawals: bigint;
|
|
1551
|
+
chainId: SupportedChainIds;
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
}>;
|
|
1555
|
+
type IUserActivity = Awaited<ReturnType<typeof getUserActivity>>;
|
|
1556
|
+
|
|
1557
|
+
interface UserDayDataEntry {
|
|
1558
|
+
id: string;
|
|
1559
|
+
date: Date;
|
|
1560
|
+
vaultAddress: Address;
|
|
1561
|
+
baseAsset: IToken;
|
|
1562
|
+
timestamp: string;
|
|
1563
|
+
shares: string;
|
|
1564
|
+
rewardsClaimed: string;
|
|
1565
|
+
nav: {
|
|
1566
|
+
ETH: number;
|
|
1567
|
+
USD: number;
|
|
1568
|
+
PXETH: number;
|
|
1569
|
+
USDC: number;
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
interface EnhancedUserHistoryEntry {
|
|
1573
|
+
date: Date;
|
|
1574
|
+
timestamp: string;
|
|
1575
|
+
autopools: UserDayDataEntry[];
|
|
1576
|
+
nav: {
|
|
1577
|
+
ETH: number;
|
|
1578
|
+
USD: number;
|
|
1579
|
+
PXETH: number;
|
|
1580
|
+
USDC: number;
|
|
1581
|
+
};
|
|
1582
|
+
formattedDate: string;
|
|
1583
|
+
events: any[];
|
|
1584
|
+
differential: number;
|
|
1585
|
+
}
|
|
1586
|
+
declare const getUserAutopoolsHistory: (address: Address, autopoolsHistory: IAutopoolsHistory, events: Awaited<ReturnType<typeof getUserActivity>>["events"] | undefined, includeTestnet?: boolean) => Promise<EnhancedUserHistoryEntry[]>;
|
|
1587
|
+
|
|
1588
|
+
declare const getUserSushiLP: (wagmiConfig: Config, { sushiLP, currentCycleIndex, address, cycleRolloverBlockNumber, chainId, }: {
|
|
1589
|
+
sushiLP: ISushiLP;
|
|
1590
|
+
currentCycleIndex: bigint;
|
|
1591
|
+
address: Address;
|
|
1592
|
+
cycleRolloverBlockNumber: bigint;
|
|
1593
|
+
chainId: number;
|
|
1594
|
+
}) => Promise<{
|
|
1595
|
+
sushiLPBalance: bigint | undefined;
|
|
1596
|
+
tSushiLPBalance: bigint | undefined;
|
|
1597
|
+
tSushiLPRequested: readonly [bigint, bigint] | undefined;
|
|
1598
|
+
shareOftSushiLP: number;
|
|
1599
|
+
tSushiLPUsd: number;
|
|
1600
|
+
balanceExcludingWithdrawal: bigint;
|
|
1601
|
+
hasAddedTSushi: boolean;
|
|
1602
|
+
hasRequestedUnlock: boolean;
|
|
1603
|
+
hasUnlockableBalance: boolean;
|
|
1604
|
+
withdrawalAmount: bigint;
|
|
1605
|
+
hasBalanceExcludingWithdrawal: boolean;
|
|
1606
|
+
} | undefined>;
|
|
1607
|
+
|
|
1608
|
+
declare const getUserCurveLP: (wagmiConfig: Config$1, { curveLP, address, chainId, }: {
|
|
1609
|
+
curveLP: CurveLP;
|
|
1610
|
+
address: Address;
|
|
1611
|
+
chainId: number;
|
|
1612
|
+
}) => Promise<{
|
|
1613
|
+
curveLPBalance: bigint | undefined;
|
|
1614
|
+
convexLPBalance: bigint | undefined;
|
|
1615
|
+
shareOfCurve: number;
|
|
1616
|
+
shareOfConvex: number;
|
|
1617
|
+
curveLPUsd: number;
|
|
1618
|
+
convexLPUsd: number;
|
|
1619
|
+
} | undefined>;
|
|
1620
|
+
|
|
1621
|
+
declare const getMutlipleAutopoolRebalances: (ids: Address[], chainId?: SupportedChainIds) => Promise<{
|
|
1622
|
+
__typename?: "Rebalance";
|
|
1623
|
+
autopool: any;
|
|
1624
|
+
blockNumber: any;
|
|
1625
|
+
hash: string;
|
|
1626
|
+
id: string;
|
|
1627
|
+
ix: any;
|
|
1628
|
+
timestamp: any;
|
|
1629
|
+
outData?: {
|
|
1630
|
+
__typename?: "RebalanceInOut";
|
|
1631
|
+
id: string;
|
|
1632
|
+
exchangeName: string;
|
|
1633
|
+
ethValue: any;
|
|
1634
|
+
destination: any;
|
|
1635
|
+
underlyer: {
|
|
1636
|
+
__typename?: "RefToken";
|
|
1637
|
+
decimals: any;
|
|
1638
|
+
id: any;
|
|
1639
|
+
name?: string | null;
|
|
1640
|
+
symbol?: string | null;
|
|
1641
|
+
};
|
|
1642
|
+
tokens: Array<{
|
|
1643
|
+
__typename?: "RefToken";
|
|
1644
|
+
decimals: any;
|
|
1645
|
+
id: any;
|
|
1646
|
+
name?: string | null;
|
|
1647
|
+
symbol?: string | null;
|
|
1648
|
+
}>;
|
|
1649
|
+
} | null;
|
|
1650
|
+
inData?: {
|
|
1651
|
+
__typename?: "RebalanceInOut";
|
|
1652
|
+
ethValue: any;
|
|
1653
|
+
exchangeName: string;
|
|
1654
|
+
id: string;
|
|
1655
|
+
destination: any;
|
|
1656
|
+
underlyer: {
|
|
1657
|
+
__typename?: "RefToken";
|
|
1658
|
+
decimals: any;
|
|
1659
|
+
id: any;
|
|
1660
|
+
name?: string | null;
|
|
1661
|
+
symbol?: string | null;
|
|
1662
|
+
};
|
|
1663
|
+
tokens: Array<{
|
|
1664
|
+
__typename?: "RefToken";
|
|
1665
|
+
decimals: any;
|
|
1666
|
+
id: any;
|
|
1667
|
+
name?: string | null;
|
|
1668
|
+
symbol?: string | null;
|
|
1669
|
+
}>;
|
|
1670
|
+
} | null;
|
|
1671
|
+
}[]>;
|
|
1672
|
+
|
|
1673
|
+
declare const getAutopoolDayData: (address: Address, chainId?: SupportedChainIds, startTimestamp?: number) => Promise<{
|
|
1674
|
+
navPerShare: number;
|
|
1675
|
+
rewarderApy: number;
|
|
1676
|
+
baseApy: any;
|
|
1677
|
+
combinedApy: any;
|
|
1678
|
+
date: Date;
|
|
1679
|
+
__typename?: "AutopoolDayData";
|
|
1680
|
+
totalSupply: any;
|
|
1681
|
+
nav: any;
|
|
1682
|
+
timestamp: any;
|
|
1683
|
+
id: string;
|
|
1684
|
+
autopoolApy?: any | null;
|
|
1685
|
+
autopoolDay7MAApy?: any | null;
|
|
1686
|
+
autopoolDay30MAApy?: any | null;
|
|
1687
|
+
rewarderDay7MAApy?: any | null;
|
|
1688
|
+
rewarderDay30MAApy?: any | null;
|
|
1689
|
+
baseAsset: {
|
|
1690
|
+
__typename?: "Token";
|
|
1691
|
+
id: any;
|
|
1692
|
+
decimals: any;
|
|
1693
|
+
};
|
|
1694
|
+
vault: {
|
|
1695
|
+
__typename?: "Autopool";
|
|
1696
|
+
id: any;
|
|
1697
|
+
registered: boolean;
|
|
1698
|
+
};
|
|
1699
|
+
}[]>;
|
|
1700
|
+
|
|
1701
|
+
declare const systemRegistryFunctionNames: string[];
|
|
1702
|
+
declare const getSystemConfig: (wagmiConfig: Config, { systemRegistry }: {
|
|
1703
|
+
systemRegistry: Address;
|
|
1704
|
+
}) => Promise<{
|
|
1705
|
+
asyncSwapperRegistry: void | `0x${string}` | undefined;
|
|
1706
|
+
autopoolRouter: void | `0x${string}` | undefined;
|
|
1707
|
+
autopoolRegistry: void | `0x${string}` | undefined;
|
|
1708
|
+
swapRouter: void | `0x${string}` | undefined;
|
|
1709
|
+
} | undefined>;
|
|
1710
|
+
|
|
1711
|
+
declare const getUserAutopools: ({ address, includeTestnet, autopools, userActivity, prices, config, }: {
|
|
1712
|
+
address: Address;
|
|
1713
|
+
includeTestnet?: boolean;
|
|
1714
|
+
autopools: IAutopools;
|
|
1715
|
+
userActivity: IUserActivity;
|
|
1716
|
+
prices: TokenPrices;
|
|
1717
|
+
config: Config$1;
|
|
1718
|
+
}) => Promise<{
|
|
1719
|
+
nav: TokenPrices & {
|
|
1720
|
+
USD: number;
|
|
1721
|
+
};
|
|
1722
|
+
idle: {
|
|
1723
|
+
allocation: number;
|
|
1724
|
+
ETH: number;
|
|
1725
|
+
WETH: number;
|
|
1726
|
+
USDC: number;
|
|
1727
|
+
DOLA: number;
|
|
1728
|
+
PXETH: number;
|
|
1729
|
+
S: number;
|
|
1730
|
+
TOKE: number;
|
|
1731
|
+
WS: number;
|
|
1732
|
+
USD: number;
|
|
1733
|
+
token: IToken;
|
|
1734
|
+
baseAsset: number;
|
|
1735
|
+
}[];
|
|
1736
|
+
supplied: TokenPrices & {
|
|
1737
|
+
USD: number;
|
|
1738
|
+
};
|
|
1739
|
+
returns: TokenPrices & {
|
|
1740
|
+
USD: number;
|
|
1741
|
+
};
|
|
1742
|
+
categories: {
|
|
1743
|
+
usd: {
|
|
1744
|
+
nav: TokenPrices & {
|
|
1745
|
+
USD: number;
|
|
1746
|
+
};
|
|
1747
|
+
supplied: TokenPrices & {
|
|
1748
|
+
USD: number;
|
|
1749
|
+
};
|
|
1750
|
+
returns: TokenPrices & {
|
|
1751
|
+
USD: number;
|
|
1752
|
+
};
|
|
1753
|
+
idle: {
|
|
1754
|
+
allocation: number;
|
|
1755
|
+
ETH: number;
|
|
1756
|
+
WETH: number;
|
|
1757
|
+
USDC: number;
|
|
1758
|
+
DOLA: number;
|
|
1759
|
+
PXETH: number;
|
|
1760
|
+
S: number;
|
|
1761
|
+
TOKE: number;
|
|
1762
|
+
WS: number;
|
|
1763
|
+
USD: number;
|
|
1764
|
+
};
|
|
1765
|
+
avgDailyReturns: TokenPrices & {
|
|
1766
|
+
USD: number;
|
|
1767
|
+
};
|
|
1768
|
+
apr: number;
|
|
1769
|
+
totalDeposits: number;
|
|
1770
|
+
totalWithdrawals: number;
|
|
1771
|
+
};
|
|
1772
|
+
eth: {
|
|
1773
|
+
nav: TokenPrices & {
|
|
1774
|
+
USD: number;
|
|
1775
|
+
};
|
|
1776
|
+
supplied: TokenPrices & {
|
|
1777
|
+
USD: number;
|
|
1778
|
+
};
|
|
1779
|
+
returns: TokenPrices & {
|
|
1780
|
+
USD: number;
|
|
1781
|
+
};
|
|
1782
|
+
idle: {
|
|
1783
|
+
allocation: number;
|
|
1784
|
+
ETH: number;
|
|
1785
|
+
WETH: number;
|
|
1786
|
+
USDC: number;
|
|
1787
|
+
DOLA: number;
|
|
1788
|
+
PXETH: number;
|
|
1789
|
+
S: number;
|
|
1790
|
+
TOKE: number;
|
|
1791
|
+
WS: number;
|
|
1792
|
+
USD: number;
|
|
1793
|
+
};
|
|
1794
|
+
avgDailyReturns: TokenPrices & {
|
|
1795
|
+
USD: number;
|
|
1796
|
+
};
|
|
1797
|
+
apr: number;
|
|
1798
|
+
totalDeposits: number;
|
|
1799
|
+
totalWithdrawals: number;
|
|
1800
|
+
};
|
|
1801
|
+
crypto: {
|
|
1802
|
+
nav: TokenPrices & {
|
|
1803
|
+
USD: number;
|
|
1804
|
+
};
|
|
1805
|
+
supplied: TokenPrices & {
|
|
1806
|
+
USD: number;
|
|
1807
|
+
};
|
|
1808
|
+
returns: TokenPrices & {
|
|
1809
|
+
USD: number;
|
|
1810
|
+
};
|
|
1811
|
+
idle: {
|
|
1812
|
+
allocation: number;
|
|
1813
|
+
ETH: number;
|
|
1814
|
+
WETH: number;
|
|
1815
|
+
USDC: number;
|
|
1816
|
+
DOLA: number;
|
|
1817
|
+
PXETH: number;
|
|
1818
|
+
S: number;
|
|
1819
|
+
TOKE: number;
|
|
1820
|
+
WS: number;
|
|
1821
|
+
USD: number;
|
|
1822
|
+
};
|
|
1823
|
+
avgDailyReturns: TokenPrices & {
|
|
1824
|
+
USD: number;
|
|
1825
|
+
};
|
|
1826
|
+
apr: number;
|
|
1827
|
+
totalDeposits: number;
|
|
1828
|
+
totalWithdrawals: number;
|
|
1829
|
+
};
|
|
1830
|
+
};
|
|
1831
|
+
exchanges: {
|
|
1832
|
+
allocation: number;
|
|
1833
|
+
valueUsd: number;
|
|
1834
|
+
value: number;
|
|
1835
|
+
logoURI: string;
|
|
1836
|
+
name: string;
|
|
1837
|
+
audits?: string;
|
|
1838
|
+
type: "DEX" | "Lending Market" | "Protocol" | "Portfolio Tracker";
|
|
1839
|
+
}[];
|
|
1840
|
+
tokens: {
|
|
1841
|
+
allocation: number;
|
|
1842
|
+
valueUsd: number;
|
|
1843
|
+
value: number;
|
|
1844
|
+
address: Address;
|
|
1845
|
+
chainId: number;
|
|
1846
|
+
decimals: number;
|
|
1847
|
+
logoURI: string;
|
|
1848
|
+
name: string;
|
|
1849
|
+
symbol: string;
|
|
1850
|
+
audits?: string;
|
|
1851
|
+
extensions?: {
|
|
1852
|
+
bridgeMainnetAdapter?: Address;
|
|
1853
|
+
bridgeInfo?: {
|
|
1854
|
+
[chainId: number]: {
|
|
1855
|
+
tokenAddress: Address;
|
|
1856
|
+
};
|
|
1857
|
+
};
|
|
1858
|
+
rebasing?: boolean;
|
|
1859
|
+
parentAsset?: string;
|
|
1860
|
+
};
|
|
1861
|
+
}[];
|
|
1862
|
+
pools: {
|
|
1863
|
+
debtValueHeldByVaultAllocation: number;
|
|
1864
|
+
debtValueHeldByVaultUsd: number;
|
|
1865
|
+
debtValueHeldByVaultEth: number;
|
|
1866
|
+
compositeReturn: number;
|
|
1867
|
+
underlyingTokens: {
|
|
1868
|
+
valueUsd: number;
|
|
1869
|
+
value: number;
|
|
1870
|
+
address: Address;
|
|
1871
|
+
chainId: number;
|
|
1872
|
+
decimals: number;
|
|
1873
|
+
logoURI: string;
|
|
1874
|
+
name: string;
|
|
1875
|
+
symbol: string;
|
|
1876
|
+
audits?: string;
|
|
1877
|
+
extensions?: {
|
|
1878
|
+
bridgeMainnetAdapter?: Address;
|
|
1879
|
+
bridgeInfo?: {
|
|
1880
|
+
[chainId: number]: {
|
|
1881
|
+
tokenAddress: Address;
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
rebasing?: boolean;
|
|
1885
|
+
parentAsset?: string;
|
|
1886
|
+
};
|
|
1887
|
+
}[];
|
|
1888
|
+
poolName: string;
|
|
1889
|
+
exchange: _tokemak_tokenlist.IProtocol | undefined;
|
|
1890
|
+
vaultAddress: `0x${string}`;
|
|
1891
|
+
exchangeName: string;
|
|
1892
|
+
totalSupply: bigint;
|
|
1893
|
+
lastSnapshotTimestamp: bigint;
|
|
1894
|
+
feeApr: bigint;
|
|
1895
|
+
lastDebtReportTime: bigint;
|
|
1896
|
+
minDebtValue: bigint;
|
|
1897
|
+
maxDebtValue: bigint;
|
|
1898
|
+
debtValueHeldByVault: bigint;
|
|
1899
|
+
queuedForRemoval: boolean;
|
|
1900
|
+
statsIncomplete: boolean;
|
|
1901
|
+
isShutdown: boolean;
|
|
1902
|
+
shutdownStatus: number;
|
|
1903
|
+
autoPoolOwnsShares: bigint;
|
|
1904
|
+
actualLPTotalSupply: bigint;
|
|
1905
|
+
dexPool: `0x${string}`;
|
|
1906
|
+
lpTokenAddress: `0x${string}`;
|
|
1907
|
+
lpTokenSymbol: string;
|
|
1908
|
+
lpTokenName: string;
|
|
1909
|
+
statsSafeLPTotalSupply: bigint;
|
|
1910
|
+
statsIncentiveCredits: number;
|
|
1911
|
+
rewardsTokens: readonly {
|
|
1912
|
+
tokenAddress: `0x${string}`;
|
|
1913
|
+
}[];
|
|
1914
|
+
underlyingTokenSymbols: readonly {
|
|
1915
|
+
symbol: string;
|
|
1916
|
+
}[];
|
|
1917
|
+
lstStatsData: readonly {
|
|
1918
|
+
lastSnapshotTimestamp: bigint;
|
|
1919
|
+
baseApr: bigint;
|
|
1920
|
+
discount: bigint;
|
|
1921
|
+
discountHistory: readonly [number, number, number, number, number, number, number, number, number, number];
|
|
1922
|
+
discountTimestampByPercent: number;
|
|
1923
|
+
}[];
|
|
1924
|
+
underlyingTokenValueHeld: readonly {
|
|
1925
|
+
valueHeldInEth: bigint;
|
|
1926
|
+
}[];
|
|
1927
|
+
reservesInEth: readonly bigint[];
|
|
1928
|
+
statsPeriodFinishForRewards: readonly number[];
|
|
1929
|
+
statsAnnualizedRewardAmounts: readonly bigint[];
|
|
1930
|
+
}[];
|
|
1931
|
+
autopools: ({
|
|
1932
|
+
name: string;
|
|
1933
|
+
symbol: string;
|
|
1934
|
+
poolAddress: `0x${string}`;
|
|
1935
|
+
shares: number;
|
|
1936
|
+
nav: {
|
|
1937
|
+
denom: number;
|
|
1938
|
+
ETH: number;
|
|
1939
|
+
WETH: number;
|
|
1940
|
+
USDC: number;
|
|
1941
|
+
DOLA: number;
|
|
1942
|
+
PXETH: number;
|
|
1943
|
+
S: number;
|
|
1944
|
+
TOKE: number;
|
|
1945
|
+
WS: number;
|
|
1946
|
+
baseAsset: number;
|
|
1947
|
+
USD: number;
|
|
1948
|
+
};
|
|
1949
|
+
returns: {
|
|
1950
|
+
denom: number;
|
|
1951
|
+
ETH: number;
|
|
1952
|
+
WETH: number;
|
|
1953
|
+
USDC: number;
|
|
1954
|
+
DOLA: number;
|
|
1955
|
+
PXETH: number;
|
|
1956
|
+
S: number;
|
|
1957
|
+
TOKE: number;
|
|
1958
|
+
WS: number;
|
|
1959
|
+
baseAsset: number;
|
|
1960
|
+
USD: number;
|
|
1961
|
+
};
|
|
1962
|
+
supplied: {
|
|
1963
|
+
denom: number;
|
|
1964
|
+
ETH: number;
|
|
1965
|
+
WETH: number;
|
|
1966
|
+
USDC: number;
|
|
1967
|
+
DOLA: number;
|
|
1968
|
+
PXETH: number;
|
|
1969
|
+
S: number;
|
|
1970
|
+
TOKE: number;
|
|
1971
|
+
WS: number;
|
|
1972
|
+
baseAsset: number;
|
|
1973
|
+
USD: number;
|
|
1974
|
+
};
|
|
1975
|
+
idle: {
|
|
1976
|
+
denom: number;
|
|
1977
|
+
ETH: number;
|
|
1978
|
+
WETH: number;
|
|
1979
|
+
USDC: number;
|
|
1980
|
+
DOLA: number;
|
|
1981
|
+
PXETH: number;
|
|
1982
|
+
S: number;
|
|
1983
|
+
TOKE: number;
|
|
1984
|
+
WS: number;
|
|
1985
|
+
baseAsset: number;
|
|
1986
|
+
USD: number;
|
|
1987
|
+
};
|
|
1988
|
+
totalDeposits: number;
|
|
1989
|
+
totalWithdrawals: number;
|
|
1990
|
+
staked: {
|
|
1991
|
+
balance: bigint;
|
|
1992
|
+
shares: number;
|
|
1993
|
+
nav: Currencies;
|
|
1994
|
+
};
|
|
1995
|
+
unstaked: {
|
|
1996
|
+
balance: bigint;
|
|
1997
|
+
shares: number;
|
|
1998
|
+
nav: Currencies;
|
|
1999
|
+
};
|
|
2000
|
+
useDenomination: boolean;
|
|
2001
|
+
blendedApr: number;
|
|
2002
|
+
rewardsClaimed: any;
|
|
2003
|
+
lastDeposit: string | undefined;
|
|
2004
|
+
baseAsset: IToken;
|
|
2005
|
+
denomination: {
|
|
2006
|
+
price: number;
|
|
2007
|
+
address: Address;
|
|
2008
|
+
chainId: number;
|
|
2009
|
+
decimals: number;
|
|
2010
|
+
logoURI: string;
|
|
2011
|
+
name: string;
|
|
2012
|
+
symbol: string;
|
|
2013
|
+
audits?: string;
|
|
2014
|
+
extensions?: {
|
|
2015
|
+
bridgeMainnetAdapter?: Address;
|
|
2016
|
+
bridgeInfo?: {
|
|
2017
|
+
[chainId: number]: {
|
|
2018
|
+
tokenAddress: Address;
|
|
2019
|
+
};
|
|
2020
|
+
};
|
|
2021
|
+
rebasing?: boolean;
|
|
2022
|
+
parentAsset?: string;
|
|
2023
|
+
};
|
|
2024
|
+
};
|
|
2025
|
+
category: AutopoolCategory;
|
|
2026
|
+
} | undefined)[];
|
|
2027
|
+
avgDailyReturnsUsd: number;
|
|
2028
|
+
useDenomination: boolean;
|
|
2029
|
+
denominatedToken: IToken;
|
|
2030
|
+
weightedApr: number;
|
|
2031
|
+
lowestApr: number;
|
|
2032
|
+
highestApr: number;
|
|
2033
|
+
hasMultipleBaseAssets: boolean;
|
|
2034
|
+
} | undefined>;
|
|
2035
|
+
type IUserAutopools = NonNullable<Awaited<ReturnType<typeof getUserAutopools>>>;
|
|
2036
|
+
type IUserAutopool = IUserAutopools["autopools"][number];
|
|
2037
|
+
|
|
2038
|
+
declare const getChainUserAutopools: ({ address, chainId, }: {
|
|
2039
|
+
address: Address;
|
|
2040
|
+
chainId?: SupportedChainIds;
|
|
2041
|
+
}) => Promise<{
|
|
2042
|
+
__typename?: "UserVault";
|
|
2043
|
+
vaultAddress: any;
|
|
2044
|
+
totalShares: any;
|
|
2045
|
+
walletShares: any;
|
|
2046
|
+
stakedShares: any;
|
|
2047
|
+
rewardsClaimed: any;
|
|
2048
|
+
}[]>;
|
|
2049
|
+
|
|
2050
|
+
declare const getUserAutopool: (wagmiConfig: Config, { address, autopool, }: {
|
|
2051
|
+
address?: Address;
|
|
2052
|
+
autopool?: IAutopool;
|
|
2053
|
+
}) => Promise<{
|
|
2054
|
+
staked: {
|
|
2055
|
+
balance: bigint;
|
|
2056
|
+
shares: number;
|
|
2057
|
+
nav: number;
|
|
2058
|
+
navUsd: number;
|
|
2059
|
+
};
|
|
2060
|
+
unstaked: {
|
|
2061
|
+
balance: bigint;
|
|
2062
|
+
shares: number;
|
|
2063
|
+
nav: number;
|
|
2064
|
+
navUsd: number;
|
|
2065
|
+
};
|
|
2066
|
+
pastRewarderBalances: {
|
|
2067
|
+
rewarderContract: `0x${string}`;
|
|
2068
|
+
balance: bigint;
|
|
2069
|
+
shares: number;
|
|
2070
|
+
nav: number;
|
|
2071
|
+
navUsd: number;
|
|
2072
|
+
}[];
|
|
2073
|
+
totalShares: number;
|
|
2074
|
+
totalNav: number;
|
|
2075
|
+
totalNavUsd: number;
|
|
2076
|
+
totalNavDenominated: number;
|
|
2077
|
+
useDenomination: boolean;
|
|
2078
|
+
denomination: {
|
|
2079
|
+
price: number;
|
|
2080
|
+
address: Address;
|
|
2081
|
+
chainId: number;
|
|
2082
|
+
decimals: number;
|
|
2083
|
+
logoURI: string;
|
|
2084
|
+
name: string;
|
|
2085
|
+
symbol: string;
|
|
2086
|
+
audits?: string;
|
|
2087
|
+
extensions?: {
|
|
2088
|
+
bridgeMainnetAdapter?: Address;
|
|
2089
|
+
bridgeInfo?: {
|
|
2090
|
+
[chainId: number]: {
|
|
2091
|
+
tokenAddress: Address;
|
|
2092
|
+
};
|
|
2093
|
+
};
|
|
2094
|
+
rebasing?: boolean;
|
|
2095
|
+
parentAsset?: string;
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
2098
|
+
} | {
|
|
2099
|
+
staked: {
|
|
2100
|
+
balance: bigint;
|
|
2101
|
+
shares: number;
|
|
2102
|
+
nav: number;
|
|
2103
|
+
navUsd: number;
|
|
2104
|
+
};
|
|
2105
|
+
unstaked: {
|
|
2106
|
+
balance: bigint;
|
|
2107
|
+
shares: number;
|
|
2108
|
+
nav: number;
|
|
2109
|
+
navUsd: number;
|
|
2110
|
+
};
|
|
2111
|
+
totalNavDenominated: number;
|
|
2112
|
+
totalShares: number;
|
|
2113
|
+
totalNav: number;
|
|
2114
|
+
totalNavUsd: number;
|
|
2115
|
+
pastRewarderBalances?: undefined;
|
|
2116
|
+
useDenomination?: undefined;
|
|
2117
|
+
denomination?: undefined;
|
|
2118
|
+
} | undefined>;
|
|
2119
|
+
|
|
2120
|
+
type TokenBalances = Record<string, bigint | null>;
|
|
2121
|
+
declare const getUserTokenBalances: ({ address, apiKey, chainId, }: {
|
|
2122
|
+
address: Address;
|
|
2123
|
+
apiKey: string;
|
|
2124
|
+
chainId: number;
|
|
2125
|
+
}) => Promise<TokenBalances>;
|
|
2126
|
+
|
|
2127
|
+
declare const getTokenList: () => Promise<IToken[]>;
|
|
2128
|
+
|
|
2129
|
+
declare const getTopAutopoolHolders: (autopoolAddress: Address, chainId?: SupportedChainIds) => Promise<{
|
|
2130
|
+
__typename?: "Holder";
|
|
2131
|
+
sharesHeld: any;
|
|
2132
|
+
user: any;
|
|
2133
|
+
lastUpdated: any;
|
|
2134
|
+
}[]>;
|
|
2135
|
+
type ITopAutopoolHolders = Awaited<ReturnType<typeof getTopAutopoolHolders>>;
|
|
2136
|
+
type ITopAutopoolHolder = ITopAutopoolHolders[number];
|
|
2137
|
+
|
|
2138
|
+
declare const getAllowance: (wagmiConfig: Config, { token, address, spender, }: {
|
|
2139
|
+
token: Address;
|
|
2140
|
+
address: Address;
|
|
2141
|
+
spender: Address;
|
|
2142
|
+
}) => Promise<bigint | undefined>;
|
|
2143
|
+
|
|
2144
|
+
type rewardsData = {
|
|
2145
|
+
chainId: number | SupportedChainIds;
|
|
2146
|
+
autopools: {
|
|
2147
|
+
[autopool: `0x${string}`]: {
|
|
2148
|
+
formattedBalance: number;
|
|
2149
|
+
balanceUsd: string;
|
|
2150
|
+
symbol: string;
|
|
2151
|
+
logoURI: string;
|
|
2152
|
+
address: `0x${string}`;
|
|
2153
|
+
amount: bigint;
|
|
2154
|
+
};
|
|
2155
|
+
};
|
|
2156
|
+
rewards: {
|
|
2157
|
+
[tokenAddress: `0x${string}`]: bigint;
|
|
2158
|
+
};
|
|
2159
|
+
rewardsUsd: number;
|
|
2160
|
+
};
|
|
2161
|
+
declare const getUserAutopoolsRewards: (wagmiConfig: Config$1, { address, tokenPrices, includeTestnet, }: {
|
|
2162
|
+
address: Address;
|
|
2163
|
+
tokenPrices: TokenPrices;
|
|
2164
|
+
includeTestnet?: boolean;
|
|
2165
|
+
}) => Promise<{
|
|
2166
|
+
chains: {
|
|
2167
|
+
[k: string]: {
|
|
2168
|
+
autopools: {
|
|
2169
|
+
[autopool: `0x${string}`]: {
|
|
2170
|
+
[tokenAddress: `0x${string}`]: bigint;
|
|
2171
|
+
};
|
|
2172
|
+
};
|
|
2173
|
+
rewards: {
|
|
2174
|
+
[tokenSymbol: string]: {
|
|
2175
|
+
amount: bigint;
|
|
2176
|
+
USD: number;
|
|
2177
|
+
formattedAmount: number;
|
|
2178
|
+
decimals?: number;
|
|
2179
|
+
logoURI?: string;
|
|
2180
|
+
};
|
|
2181
|
+
};
|
|
2182
|
+
};
|
|
2183
|
+
};
|
|
2184
|
+
rewardsByToken: {
|
|
2185
|
+
[tokenSymbol: string]: {
|
|
2186
|
+
amount: bigint;
|
|
2187
|
+
USD: number;
|
|
2188
|
+
formattedAmount: number;
|
|
2189
|
+
logoURI?: string;
|
|
2190
|
+
};
|
|
2191
|
+
};
|
|
2192
|
+
totalRewardsUSD: number;
|
|
2193
|
+
} | undefined>;
|
|
2194
|
+
|
|
2195
|
+
declare const getAmountWithdrawn: ({ address, slippage, user, chainId, amount, decimals, buyToken, isSwap, config, sellToken, autopool, }: minAmountWithdrawnFunctionConfig) => Promise<{
|
|
2196
|
+
minAmount: string;
|
|
2197
|
+
dynamicSwap: {
|
|
2198
|
+
standardPreviewRedeem: boolean;
|
|
2199
|
+
dynamicSwapsResults: {
|
|
2200
|
+
fromToken: Address;
|
|
2201
|
+
toToken: Address;
|
|
2202
|
+
target: Address;
|
|
2203
|
+
data: Address;
|
|
2204
|
+
}[] | undefined;
|
|
2205
|
+
previewRedeem: bigint;
|
|
2206
|
+
};
|
|
2207
|
+
quote: SwapQuoteResponse | undefined;
|
|
2208
|
+
convertedAssets: bigint | undefined;
|
|
2209
|
+
dynamicSwapsResults?: undefined;
|
|
2210
|
+
standardPreviewRedeem?: undefined;
|
|
2211
|
+
} | {
|
|
2212
|
+
minAmount: string;
|
|
2213
|
+
dynamicSwapsResults: never[];
|
|
2214
|
+
standardPreviewRedeem: boolean;
|
|
2215
|
+
dynamicSwap: undefined;
|
|
2216
|
+
quote: undefined;
|
|
2217
|
+
convertedAssets?: undefined;
|
|
2218
|
+
} | undefined>;
|
|
2219
|
+
|
|
2220
|
+
declare const getAmountDeposited: ({ address, chainId, amount, isSwap, slippage, config, }: minAmountDepositedFunctionConfig) => Promise<number | undefined>;
|
|
2221
|
+
|
|
2222
|
+
declare const getBridgeFee: (wagmiConfig: Config, { sourceAddress, destAddress, sourceChainId, destChainId, amount, from, }: {
|
|
2223
|
+
amount: bigint;
|
|
2224
|
+
from: Address;
|
|
2225
|
+
sourceAddress: Address;
|
|
2226
|
+
destChainId: number;
|
|
2227
|
+
destAddress: Address;
|
|
2228
|
+
sourceChainId: number;
|
|
2229
|
+
}) => Promise<{
|
|
2230
|
+
feeQuote: {
|
|
2231
|
+
nativeFee: bigint;
|
|
2232
|
+
lzTokenFee: bigint;
|
|
2233
|
+
};
|
|
2234
|
+
sendParams: SendParam;
|
|
2235
|
+
} | undefined>;
|
|
2236
|
+
|
|
2237
|
+
declare enum MessageStatus {
|
|
2238
|
+
INFLIGHT = "INFLIGHT",
|
|
2239
|
+
DELIVERED = "DELIVERED",
|
|
2240
|
+
FAILED = "FAILED",
|
|
2241
|
+
PAYLOAD_STORED = "PAYLOAD_STORED",
|
|
2242
|
+
BLOCKED = "BLOCKED",
|
|
2243
|
+
CONFIRMING = "CONFIRMING"
|
|
2244
|
+
}
|
|
2245
|
+
type LayerzeroStatus = {
|
|
2246
|
+
status: {
|
|
2247
|
+
name: MessageStatus;
|
|
2248
|
+
message: string;
|
|
2249
|
+
};
|
|
2250
|
+
};
|
|
2251
|
+
type GetLayerzeroStatusConfig = {
|
|
2252
|
+
txHash: string;
|
|
2253
|
+
};
|
|
2254
|
+
declare const getLayerzeroStatus: ({ txHash, }: GetLayerzeroStatusConfig) => Promise<LayerzeroStatus | undefined>;
|
|
2255
|
+
declare const waitForMessageReceived: ({ txHash, interval, timeout, }: {
|
|
2256
|
+
txHash: string;
|
|
2257
|
+
interval?: number;
|
|
2258
|
+
timeout?: number;
|
|
2259
|
+
}) => Promise<LayerzeroStatus>;
|
|
2260
|
+
|
|
2261
|
+
declare const getUserSToke: (wagmiConfig: Config$1, { address, tokePrice, includeTestnet, }: {
|
|
2262
|
+
address: Address;
|
|
2263
|
+
tokePrice: number;
|
|
2264
|
+
includeTestnet?: boolean;
|
|
2265
|
+
}) => Promise<{
|
|
2266
|
+
chains: {
|
|
2267
|
+
[x: number]: {
|
|
2268
|
+
balance: bigint;
|
|
2269
|
+
balanceUSD: string;
|
|
2270
|
+
balanceExcludingWithdrawal: string;
|
|
2271
|
+
balanceExcludingWithdrawalUsd: string;
|
|
2272
|
+
hasBalanceExcludingWithdrawal: boolean;
|
|
2273
|
+
timeLeftBeforeUnlockRequestAvailable: string;
|
|
2274
|
+
timeLeftBeforeUnlockRequestUnavailable: string;
|
|
2275
|
+
withdrawalAmount: bigint;
|
|
2276
|
+
withdrawalAmountUsd: string;
|
|
2277
|
+
hasUnlockableBalance: boolean;
|
|
2278
|
+
isUnlockRequestAvailable: boolean;
|
|
2279
|
+
hasRequestedUnlock: boolean;
|
|
2280
|
+
hasAddedLockedToke: boolean;
|
|
2281
|
+
addedLockedToke: bigint;
|
|
2282
|
+
unlockPeriodDateRange: string;
|
|
2283
|
+
unlockPeriodStartFullDate: string;
|
|
2284
|
+
unlockRenewalFullDate: string;
|
|
2285
|
+
unlockPeriodStartDate: string | undefined;
|
|
2286
|
+
unlockRenewalDate: string | undefined;
|
|
2287
|
+
lockDurationInMonths: number;
|
|
2288
|
+
boost: number;
|
|
2289
|
+
points: number;
|
|
2290
|
+
totalActiveCredits: number;
|
|
2291
|
+
totalCredits: number;
|
|
2292
|
+
} | undefined;
|
|
2293
|
+
};
|
|
2294
|
+
totalBalance: number;
|
|
2295
|
+
totalBalanceUsd: string;
|
|
2296
|
+
hasBalance: boolean;
|
|
2297
|
+
} | undefined>;
|
|
2298
|
+
|
|
2299
|
+
declare const getSToke: (wagmiConfig: Config$1, { tokePrice, includeTestnet, }: {
|
|
2300
|
+
tokePrice: number;
|
|
2301
|
+
includeTestnet?: boolean;
|
|
2302
|
+
}) => Promise<{
|
|
2303
|
+
totalSupply: string;
|
|
2304
|
+
tvl: string;
|
|
2305
|
+
rawTVL: number;
|
|
2306
|
+
chains: {
|
|
2307
|
+
[x: number]: {
|
|
2308
|
+
rawTotalSupply: bigint | undefined;
|
|
2309
|
+
totalSupply: string;
|
|
2310
|
+
tvl: string;
|
|
2311
|
+
rawTVL: number;
|
|
2312
|
+
currentCycle: bigint | undefined;
|
|
2313
|
+
chain: _tokemak_tokenlist.INetwork | undefined;
|
|
2314
|
+
timeBeforeNextCycle: string;
|
|
2315
|
+
} | undefined;
|
|
2316
|
+
};
|
|
2317
|
+
}>;
|
|
2318
|
+
type IStoke = Awaited<ReturnType<typeof getSToke>>;
|
|
2319
|
+
|
|
2320
|
+
type ChainSTokeType = Awaited<ReturnType<typeof getChainSToke>>;
|
|
2321
|
+
declare const getChainSToke: (wagmiConfig: Config, { tokePrice, chainId, }: {
|
|
2322
|
+
tokePrice: number;
|
|
2323
|
+
chainId: number;
|
|
2324
|
+
}) => Promise<{
|
|
2325
|
+
rawTotalSupply: bigint | undefined;
|
|
2326
|
+
totalSupply: string;
|
|
2327
|
+
tvl: string;
|
|
2328
|
+
rawTVL: number;
|
|
2329
|
+
currentCycle: bigint | undefined;
|
|
2330
|
+
chain: _tokemak_tokenlist.INetwork | undefined;
|
|
2331
|
+
timeBeforeNextCycle: string;
|
|
2332
|
+
} | undefined>;
|
|
2333
|
+
|
|
2334
|
+
declare const getChainUserSToke: (wagmiConfig: Config$1, { address, tokePrice, chainId, }: {
|
|
2335
|
+
address: Address;
|
|
2336
|
+
tokePrice: number;
|
|
2337
|
+
chainId: number;
|
|
2338
|
+
}) => Promise<{
|
|
2339
|
+
balance: bigint;
|
|
2340
|
+
balanceUSD: string;
|
|
2341
|
+
balanceExcludingWithdrawal: string;
|
|
2342
|
+
balanceExcludingWithdrawalUsd: string;
|
|
2343
|
+
hasBalanceExcludingWithdrawal: boolean;
|
|
2344
|
+
timeLeftBeforeUnlockRequestAvailable: string;
|
|
2345
|
+
timeLeftBeforeUnlockRequestUnavailable: string;
|
|
2346
|
+
withdrawalAmount: bigint;
|
|
2347
|
+
withdrawalAmountUsd: string;
|
|
2348
|
+
hasUnlockableBalance: boolean;
|
|
2349
|
+
isUnlockRequestAvailable: boolean;
|
|
2350
|
+
hasRequestedUnlock: boolean;
|
|
2351
|
+
hasAddedLockedToke: boolean;
|
|
2352
|
+
addedLockedToke: bigint;
|
|
2353
|
+
unlockPeriodDateRange: string;
|
|
2354
|
+
unlockPeriodStartFullDate: string;
|
|
2355
|
+
unlockRenewalFullDate: string;
|
|
2356
|
+
unlockPeriodStartDate: string | undefined;
|
|
2357
|
+
unlockRenewalDate: string | undefined;
|
|
2358
|
+
lockDurationInMonths: number;
|
|
2359
|
+
boost: number;
|
|
2360
|
+
points: number;
|
|
2361
|
+
totalActiveCredits: number;
|
|
2362
|
+
totalCredits: number;
|
|
2363
|
+
} | undefined>;
|
|
2364
|
+
|
|
2365
|
+
declare const getChainCycleRolloverBlockNumber: (wagmiConfig: Config, { stoke, chainId, }: {
|
|
2366
|
+
stoke: Address;
|
|
2367
|
+
chainId: number;
|
|
2368
|
+
}) => Promise<bigint | undefined>;
|
|
2369
|
+
|
|
2370
|
+
declare const getChainSTokeVotes: ({ chainId, includeTestnet, }: {
|
|
2371
|
+
chainId: SupportedChainIds;
|
|
2372
|
+
includeTestnet?: boolean;
|
|
2373
|
+
}) => Promise<{
|
|
2374
|
+
rawData: {
|
|
2375
|
+
globalVoted: bigint;
|
|
2376
|
+
globalNotVoted: bigint;
|
|
2377
|
+
globalSystemVotes: bigint;
|
|
2378
|
+
};
|
|
2379
|
+
totalSystemVotesNum: number;
|
|
2380
|
+
totalSystemVotes: string;
|
|
2381
|
+
autopoolVotes: {
|
|
2382
|
+
[k: string]: {
|
|
2383
|
+
rawVotes: string;
|
|
2384
|
+
formattedVotes: string;
|
|
2385
|
+
};
|
|
2386
|
+
};
|
|
2387
|
+
}>;
|
|
2388
|
+
|
|
2389
|
+
type ChainSTokeVotes = Awaited<ReturnType<typeof getChainSTokeVotes>>;
|
|
2390
|
+
type STokeVotes = Awaited<ReturnType<typeof getSTokeVotes>>;
|
|
2391
|
+
declare const getSTokeVotes: ({ includeTestnet, }: {
|
|
2392
|
+
includeTestnet?: boolean;
|
|
2393
|
+
}) => Promise<Record<number, {
|
|
2394
|
+
rawData: {
|
|
2395
|
+
globalVoted: bigint;
|
|
2396
|
+
globalNotVoted: bigint;
|
|
2397
|
+
globalSystemVotes: bigint;
|
|
2398
|
+
};
|
|
2399
|
+
totalSystemVotesNum: number;
|
|
2400
|
+
totalSystemVotes: string;
|
|
2401
|
+
autopoolVotes: {
|
|
2402
|
+
[k: string]: {
|
|
2403
|
+
rawVotes: string;
|
|
2404
|
+
formattedVotes: string;
|
|
2405
|
+
};
|
|
2406
|
+
};
|
|
2407
|
+
}> | undefined>;
|
|
2408
|
+
|
|
2409
|
+
type ChainSTokeRewardsType = Awaited<ReturnType<typeof getChainSTokeRewards>>;
|
|
2410
|
+
declare const getChainSTokeRewards: ({ chainId, }: {
|
|
2411
|
+
chainId: SupportedChainIds;
|
|
2412
|
+
}) => Promise<{
|
|
2413
|
+
autopools: Record<string, {
|
|
2414
|
+
balance: number;
|
|
2415
|
+
balanceUSD: number;
|
|
2416
|
+
currentAprPerCredit: number;
|
|
2417
|
+
}>;
|
|
2418
|
+
totalEarnings: number;
|
|
2419
|
+
totalEarningsUsd: number;
|
|
2420
|
+
historicalRewards: AggregatedDayData[];
|
|
2421
|
+
aprRange: number[];
|
|
2422
|
+
} | null>;
|
|
2423
|
+
|
|
2424
|
+
interface UserAutopoolsVotes {
|
|
2425
|
+
[autopool: string]: {
|
|
2426
|
+
weight: number;
|
|
2427
|
+
percentWeight: number;
|
|
2428
|
+
votes: number;
|
|
2429
|
+
};
|
|
2430
|
+
}
|
|
2431
|
+
declare const getChainUserSTokeVotes: ({ address, chainId, stokeVotes, stokeRewards, }: {
|
|
2432
|
+
address: Address;
|
|
2433
|
+
chainId?: SupportedChainIds;
|
|
2434
|
+
stokeVotes: ChainSTokeVotes | undefined;
|
|
2435
|
+
stokeRewards: ChainSTokeRewardsType | undefined;
|
|
2436
|
+
}) => Promise<{
|
|
2437
|
+
rawVoteData: {
|
|
2438
|
+
__typename?: "UserVote";
|
|
2439
|
+
id: string;
|
|
2440
|
+
weights: Array<any>;
|
|
2441
|
+
pools: Array<any>;
|
|
2442
|
+
};
|
|
2443
|
+
stakedToke: number;
|
|
2444
|
+
totalVotes: number;
|
|
2445
|
+
weightedAprPerCredits: number;
|
|
2446
|
+
autopools: UserAutopoolsVotes;
|
|
2447
|
+
evenlySpread: boolean;
|
|
2448
|
+
} | {
|
|
2449
|
+
rawVoteData?: undefined;
|
|
2450
|
+
stakedToke?: undefined;
|
|
2451
|
+
totalVotes?: undefined;
|
|
2452
|
+
weightedAprPerCredits?: undefined;
|
|
2453
|
+
autopools?: undefined;
|
|
2454
|
+
evenlySpread?: undefined;
|
|
2455
|
+
}>;
|
|
2456
|
+
|
|
2457
|
+
declare const getSTokeRewards: ({ includeTestnet, }: {
|
|
2458
|
+
includeTestnet?: boolean;
|
|
2459
|
+
}) => Promise<{
|
|
2460
|
+
chains: {
|
|
2461
|
+
[x: number]: {
|
|
2462
|
+
autopools: Record<string, {
|
|
2463
|
+
balance: number;
|
|
2464
|
+
balanceUSD: number;
|
|
2465
|
+
currentAprPerCredit: number;
|
|
2466
|
+
}>;
|
|
2467
|
+
totalEarnings: number;
|
|
2468
|
+
totalEarningsUsd: number;
|
|
2469
|
+
historicalRewards: AggregatedDayData[];
|
|
2470
|
+
aprRange: number[];
|
|
2471
|
+
} | null;
|
|
2472
|
+
};
|
|
2473
|
+
totalEarnings: number;
|
|
2474
|
+
totalEarningsUsd: number;
|
|
2475
|
+
historicalRewards: AggregatedDayData[];
|
|
2476
|
+
}>;
|
|
2477
|
+
type IStokeRewards = Awaited<ReturnType<typeof getSTokeRewards>>;
|
|
2478
|
+
|
|
2479
|
+
type UserSTokeVotes = Awaited<ReturnType<typeof getChainUserSTokeVotes>>;
|
|
2480
|
+
declare const getUserSTokeVotes: ({ address, includeTestnet, stokeVotes, stokeRewards, }: {
|
|
2481
|
+
address: Address | undefined;
|
|
2482
|
+
includeTestnet?: boolean;
|
|
2483
|
+
stokeVotes: STokeVotes | undefined;
|
|
2484
|
+
stokeRewards: IStokeRewards | undefined;
|
|
2485
|
+
}) => Promise<Record<number, {
|
|
2486
|
+
rawVoteData: {
|
|
2487
|
+
__typename?: "UserVote";
|
|
2488
|
+
id: string;
|
|
2489
|
+
weights: Array<any>;
|
|
2490
|
+
pools: Array<any>;
|
|
2491
|
+
};
|
|
2492
|
+
stakedToke: number;
|
|
2493
|
+
totalVotes: number;
|
|
2494
|
+
weightedAprPerCredits: number;
|
|
2495
|
+
autopools: UserAutopoolsVotes;
|
|
2496
|
+
evenlySpread: boolean;
|
|
2497
|
+
} | {
|
|
2498
|
+
rawVoteData?: undefined;
|
|
2499
|
+
stakedToke?: undefined;
|
|
2500
|
+
totalVotes?: undefined;
|
|
2501
|
+
weightedAprPerCredits?: undefined;
|
|
2502
|
+
autopools?: undefined;
|
|
2503
|
+
evenlySpread?: undefined;
|
|
2504
|
+
}> | undefined>;
|
|
2505
|
+
|
|
2506
|
+
declare const getChainUserSTokeRewards: (wagmiConfig: Config$1, { address, chainId, tokePrice, }: {
|
|
2507
|
+
address: Address;
|
|
2508
|
+
chainId: number;
|
|
2509
|
+
tokePrice: number;
|
|
2510
|
+
}) => Promise<{
|
|
2511
|
+
claimable: bigint;
|
|
2512
|
+
rewardsPayload: IUserReward | null;
|
|
2513
|
+
latestClaimablePayload: IUserReward;
|
|
2514
|
+
claimableUsd: number;
|
|
2515
|
+
claimableNum: number;
|
|
2516
|
+
hasClaimable: boolean;
|
|
2517
|
+
pendingRewards: number;
|
|
2518
|
+
pendingRewardsUsd: number;
|
|
2519
|
+
totalRewardsReceived: number;
|
|
2520
|
+
totalRewardsReceivedUsd: number;
|
|
2521
|
+
} | {
|
|
2522
|
+
rewardsPayload: IUserReward | null;
|
|
2523
|
+
latestClaimablePayload: null;
|
|
2524
|
+
claimable?: undefined;
|
|
2525
|
+
claimableUsd: number;
|
|
2526
|
+
claimableNum: number;
|
|
2527
|
+
hasClaimable: boolean;
|
|
2528
|
+
pendingRewards: number;
|
|
2529
|
+
pendingRewardsUsd: number;
|
|
2530
|
+
totalRewardsReceived: number;
|
|
2531
|
+
totalRewardsReceivedUsd: number;
|
|
2532
|
+
}>;
|
|
2533
|
+
|
|
2534
|
+
declare const getCurrentCycleId: (wagmiConfig: Config$1, { stoke, chainId, }: {
|
|
2535
|
+
stoke: Address;
|
|
2536
|
+
chainId: number;
|
|
2537
|
+
}) => Promise<bigint>;
|
|
2538
|
+
|
|
2539
|
+
declare const getAutopilotRouter: (wagmiConfig: Config, { chainId }: {
|
|
2540
|
+
chainId: number;
|
|
2541
|
+
}) => Promise<void | `0x${string}`>;
|
|
2542
|
+
|
|
2543
|
+
declare const getAddressFromSystemRegistry: (wagmiConfig: Config, { chainId, functionName, }: {
|
|
2544
|
+
functionName: ExtractAbiFunctionNames<typeof systemRegistryAbi>;
|
|
2545
|
+
chainId: number;
|
|
2546
|
+
}) => Promise<void | `0x${string}`>;
|
|
2547
|
+
|
|
2548
|
+
interface SwapQuoteParams {
|
|
2549
|
+
chainId: number;
|
|
2550
|
+
slippageBps: number;
|
|
2551
|
+
sellToken: Address | undefined;
|
|
2552
|
+
buyToken: Address | undefined;
|
|
2553
|
+
sellAmount: bigint;
|
|
2554
|
+
includeSources?: string;
|
|
2555
|
+
excludeSources?: string;
|
|
2556
|
+
timeoutMS?: number;
|
|
2557
|
+
sellAll?: boolean;
|
|
2558
|
+
}
|
|
2559
|
+
declare const getSwapQuote: (config: Config$1, { chainId, ...params }: SwapQuoteParams) => Promise<SwapQuoteResponse | undefined>;
|
|
2560
|
+
|
|
2561
|
+
declare const getDynamicSwap: ({ address, amount, chainId, config, slippage, user, }: {
|
|
2562
|
+
address: Address;
|
|
2563
|
+
amount: bigint;
|
|
2564
|
+
chainId: number;
|
|
2565
|
+
config: any;
|
|
2566
|
+
slippage: number;
|
|
2567
|
+
user: Address | undefined;
|
|
2568
|
+
}) => Promise<{
|
|
2569
|
+
standardPreviewRedeem: boolean;
|
|
2570
|
+
dynamicSwapsResults: {
|
|
2571
|
+
fromToken: Address;
|
|
2572
|
+
toToken: Address;
|
|
2573
|
+
target: Address;
|
|
2574
|
+
data: Address;
|
|
2575
|
+
}[] | undefined;
|
|
2576
|
+
previewRedeem: bigint;
|
|
2577
|
+
}>;
|
|
2578
|
+
|
|
2579
|
+
interface GetTokenPriceConfig {
|
|
2580
|
+
chainId?: number;
|
|
2581
|
+
}
|
|
2582
|
+
type AutopoolAddress = string;
|
|
2583
|
+
type DestinationAddress = string;
|
|
2584
|
+
type GenStratAprs = Record<AutopoolAddress, Record<DestinationAddress, {
|
|
2585
|
+
name: string;
|
|
2586
|
+
apr: number;
|
|
2587
|
+
}>>;
|
|
2588
|
+
declare const getGenStratAprs: ({ chainId, }: GetTokenPriceConfig) => Promise<GenStratAprs | undefined>;
|
|
2589
|
+
|
|
2590
|
+
declare const getDefillamaPrice: (tokenAddress: string) => Promise<number>;
|
|
2591
|
+
|
|
2592
|
+
declare const getSubgraphStatus: (includeTestnet?: boolean) => Promise<{
|
|
2593
|
+
isOutOfSync: boolean;
|
|
2594
|
+
errorMessage: string;
|
|
2595
|
+
}>;
|
|
2596
|
+
|
|
2597
|
+
declare const getPoolsAndDestinations: (wagmiConfig: Config, { chainId }: {
|
|
2598
|
+
chainId: SupportedChainIds;
|
|
2599
|
+
}) => Promise<({
|
|
2600
|
+
poolAddress: `0x${string}`;
|
|
2601
|
+
name: string;
|
|
2602
|
+
symbol: string;
|
|
2603
|
+
vaultType: `0x${string}`;
|
|
2604
|
+
baseAsset: `0x${string}`;
|
|
2605
|
+
streamingFeeBps: bigint;
|
|
2606
|
+
periodicFeeBps: bigint;
|
|
2607
|
+
feeHighMarkEnabled: boolean;
|
|
2608
|
+
feeSettingsIncomplete: boolean;
|
|
2609
|
+
isShutdown: boolean;
|
|
2610
|
+
shutdownStatus: number;
|
|
2611
|
+
rewarder: `0x${string}`;
|
|
2612
|
+
strategy: `0x${string}`;
|
|
2613
|
+
totalSupply: bigint;
|
|
2614
|
+
totalAssets: bigint;
|
|
2615
|
+
totalIdle: bigint;
|
|
2616
|
+
totalDebt: bigint;
|
|
2617
|
+
navPerShare: bigint;
|
|
2618
|
+
} & Record<string, {
|
|
2619
|
+
vaultAddress: `0x${string}`;
|
|
2620
|
+
exchangeName: string;
|
|
2621
|
+
totalSupply: bigint;
|
|
2622
|
+
lastSnapshotTimestamp: bigint;
|
|
2623
|
+
feeApr: bigint;
|
|
2624
|
+
lastDebtReportTime: bigint;
|
|
2625
|
+
minDebtValue: bigint;
|
|
2626
|
+
maxDebtValue: bigint;
|
|
2627
|
+
debtValueHeldByVault: bigint;
|
|
2628
|
+
queuedForRemoval: boolean;
|
|
2629
|
+
statsIncomplete: boolean;
|
|
2630
|
+
isShutdown: boolean;
|
|
2631
|
+
shutdownStatus: number;
|
|
2632
|
+
autoPoolOwnsShares: bigint;
|
|
2633
|
+
actualLPTotalSupply: bigint;
|
|
2634
|
+
dexPool: `0x${string}`;
|
|
2635
|
+
lpTokenAddress: `0x${string}`;
|
|
2636
|
+
lpTokenSymbol: string;
|
|
2637
|
+
lpTokenName: string;
|
|
2638
|
+
statsSafeLPTotalSupply: bigint;
|
|
2639
|
+
statsIncentiveCredits: number;
|
|
2640
|
+
compositeReturn: bigint;
|
|
2641
|
+
rewardsTokens: readonly {
|
|
2642
|
+
tokenAddress: `0x${string}`;
|
|
2643
|
+
}[];
|
|
2644
|
+
underlyingTokens: readonly {
|
|
2645
|
+
tokenAddress: `0x${string}`;
|
|
2646
|
+
}[];
|
|
2647
|
+
underlyingTokenSymbols: readonly {
|
|
2648
|
+
symbol: string;
|
|
2649
|
+
}[];
|
|
2650
|
+
lstStatsData: readonly {
|
|
2651
|
+
lastSnapshotTimestamp: bigint;
|
|
2652
|
+
baseApr: bigint;
|
|
2653
|
+
discount: bigint;
|
|
2654
|
+
discountHistory: readonly [number, number, number, number, number, number, number, number, number, number];
|
|
2655
|
+
discountTimestampByPercent: number;
|
|
2656
|
+
}[];
|
|
2657
|
+
underlyingTokenValueHeld: readonly {
|
|
2658
|
+
valueHeldInEth: bigint;
|
|
2659
|
+
}[];
|
|
2660
|
+
reservesInEth: readonly bigint[];
|
|
2661
|
+
statsPeriodFinishForRewards: readonly number[];
|
|
2662
|
+
statsAnnualizedRewardAmounts: readonly bigint[];
|
|
2663
|
+
}[]>)[] | undefined>;
|
|
2664
|
+
|
|
2665
|
+
declare const getChainSubgraphStatus: (chain: INetwork) => Promise<{
|
|
2666
|
+
chainId: number;
|
|
2667
|
+
chainName: string;
|
|
2668
|
+
timestamp: number;
|
|
2669
|
+
isSynced: boolean;
|
|
2670
|
+
syncDelay: number;
|
|
2671
|
+
error: null;
|
|
2672
|
+
} | {
|
|
2673
|
+
chainId: number;
|
|
2674
|
+
timestamp: number;
|
|
2675
|
+
error: string;
|
|
2676
|
+
chainName?: undefined;
|
|
2677
|
+
isSynced?: undefined;
|
|
2678
|
+
syncDelay?: undefined;
|
|
2679
|
+
}>;
|
|
2680
|
+
|
|
2681
|
+
declare const getCycleV1: (wagmiConfig: Config, { currentBlockNumber, chainId, }: {
|
|
2682
|
+
currentBlockNumber: BigInt;
|
|
2683
|
+
chainId: number;
|
|
2684
|
+
}) => Promise<{
|
|
2685
|
+
currentCycleIndex: bigint;
|
|
2686
|
+
cycleRolloverBlockNumber: bigint | BigInt;
|
|
2687
|
+
timeBeforeNextCycle: string;
|
|
2688
|
+
} | undefined>;
|
|
2689
|
+
|
|
2690
|
+
declare const getProtocolStats: (autopools: IAutopools | undefined, stoke: IStoke | undefined, sushiLP: ISushiLP | undefined) => Promise<{
|
|
2691
|
+
autopools: {
|
|
2692
|
+
tvl: string;
|
|
2693
|
+
tvlNum: number;
|
|
2694
|
+
categories: {
|
|
2695
|
+
[k: string]: {
|
|
2696
|
+
tvl: string;
|
|
2697
|
+
supply: string;
|
|
2698
|
+
};
|
|
2699
|
+
};
|
|
2700
|
+
};
|
|
2701
|
+
stoke: {
|
|
2702
|
+
tvl: string;
|
|
2703
|
+
totalSupply: string;
|
|
2704
|
+
};
|
|
2705
|
+
sushiLP: {
|
|
2706
|
+
tvl: string;
|
|
2707
|
+
totalSupply: number | bigint;
|
|
2708
|
+
};
|
|
2709
|
+
tvl: string;
|
|
2710
|
+
totalDestinations: number;
|
|
2711
|
+
} | null>;
|
|
2712
|
+
|
|
2713
|
+
declare const BATCH_SIZE = 500;
|
|
2714
|
+
type IRebalance = {
|
|
2715
|
+
timestamp: number;
|
|
2716
|
+
blockNumber: number;
|
|
2717
|
+
chainId: number;
|
|
2718
|
+
valueInUsd: number;
|
|
2719
|
+
};
|
|
2720
|
+
type RawRebalance = {
|
|
2721
|
+
timestamp: number;
|
|
2722
|
+
blockNumber: number;
|
|
2723
|
+
tokenOutValueInEth: string;
|
|
2724
|
+
tokenOutValueBaseAsset: string;
|
|
2725
|
+
};
|
|
2726
|
+
declare const fetchChainRebalances: (chainId: number) => Promise<RawRebalance[]>;
|
|
2727
|
+
declare const processRebalance: (rebalance: RawRebalance, chainId: number, wagmiConfig: Config$1) => Promise<IRebalance>;
|
|
2728
|
+
declare const processRebalancesInBatches: (rebalances: RawRebalance[], chainId: number, wagmiConfig: Config$1) => Promise<IRebalance[]>;
|
|
2729
|
+
declare const calculateRebalanceStats: (rebalances: IRebalance[]) => {
|
|
2730
|
+
totalRebalances: number;
|
|
2731
|
+
totalRebalanceVolume: number;
|
|
2732
|
+
rebalances: IRebalance[];
|
|
2733
|
+
};
|
|
2734
|
+
declare const getRebalanceStats: (wagmiConfig: Config$1, { includeTestnet, }: {
|
|
2735
|
+
includeTestnet?: boolean;
|
|
2736
|
+
}) => Promise<{
|
|
2737
|
+
totalRebalances: number;
|
|
2738
|
+
totalRebalanceVolume: number;
|
|
2739
|
+
rebalances: IRebalance[];
|
|
2740
|
+
}>;
|
|
2741
|
+
|
|
2742
|
+
declare const getEthPriceAtBlock: (wagmiConfig: Config, blockNumber: bigint, chainId: SupportedChainIds) => Promise<bigint>;
|
|
2743
|
+
|
|
2744
|
+
declare const updateRebalanceStats: (wagmiConfig: Config$1, { currentRebalances, includeTestnet, }: {
|
|
2745
|
+
currentRebalances: IRebalance[];
|
|
2746
|
+
includeTestnet?: boolean;
|
|
2747
|
+
}) => Promise<{
|
|
2748
|
+
totalRebalances: number;
|
|
2749
|
+
totalRebalanceVolume: number;
|
|
2750
|
+
rebalances: IRebalance[];
|
|
2751
|
+
}>;
|
|
2752
|
+
|
|
2753
|
+
export { AggregatedDayData, AutopoolCategory, BASE_ASSETS, BATCH_SIZE, BaseAsset, BaseDataEntry, ChainSTokeRewardsType, ChainSTokeType, ChainSTokeVotes, Currencies, CurveLP, ETH_BASE_ASSETS, EnhancedUserHistoryEntry, ExtraReward, FillData, GetLayerzeroStatusConfig, IAutopool, IAutopools, IAutopoolsHistory, IRebalance, IStoke, IStokeRewards, ISushiLP, ITopAutopoolHolder, ITopAutopoolHolders, IUserActivity, IUserAutopool, IUserAutopools, IUserReward, LayerzeroStatus, MessageStatus, Order, PRICED_TOKENS, PoolRewardsBalanceDayData, QuoteAndPriceBaseConfig, QuoteAndPriceBaseResult, QuoteResult, RawRebalance, STokeVotes, SendParam, SwapQuoteParams, SwapQuoteResponse, TokenPrices, USD_BASE_ASSETS, UserActivity, UserAutopoolsVotes, UserDayDataEntry, UserSTokeVotes, VaultAddedMapping, aggregateSTokeRewardsDayData, arraysToObject, calculateRebalanceStats, convertBaseAssetToTokenPrices, convertBaseAssetToTokenPricesAndDenom, fetchChainDataMap, fetchChainRebalances, fillMissingDates, findClosestDateEntry, findClosestEntry, findClosestTimestampEntry, formatDateRange, getAddressFromSystemRegistry, getAllowance, getAmountDeposited, getAmountWithdrawn, getAutopilotRouter, getAutopoolCategory, getAutopoolDayData, getAutopoolInfo, getAutopoolRebalances, getAutopools, getAutopoolsHistory, getAutopoolsRebalances, getBridgeFee, getChainAutopools, getChainCycleRolloverBlockNumber, getChainSToke, getChainSTokeRewards, getChainSubgraphStatus, getChainUserActivity, getChainUserAutopools, getChainUserSToke, getChainUserSTokeRewards, getChainUserSTokeVotes, getChainsForEnv, getCurrentCycleId, getCurveLP, getCycleV1, getDefillamaPrice, getDynamicSwap, getEthPrice, getEthPriceAtBlock, getExchangeNames, getGenStratAprs, getLayerzeroStatus, getMutlipleAutopoolRebalances, getPoolStats, getPoolsAndDestinations, getProtocolStats, getRebalanceStats, getRewardsPayloadV1, getSToke, getSTokeChainsForEnv, getSTokeRewards, getSTokeVotes, getSubgraphStatus, getSushiLP, getSwapQuote, getSystemConfig, getTimestampDaysFromStart, getTokePrice, getTokenList, getTokenPrice, getTokenPrices, getTopAutopoolHolders, getUserActivity, getUserAutoEthRewards, getUserAutopool, getUserAutopools, getUserAutopoolsHistory, getUserAutopoolsRewards, getUserCurveLP, getUserRewardsV1, getUserSToke, getUserSTokeVotes, getUserSushiLP, getUserTokenBalances, getUserV1, mergeArrays, mergeArraysWithKey, mergeStringArrays, minAmountDepositedBaseConfig, minAmountDepositedFunctionConfig, minAmountWithdrawnBaseConfig, minAmountWithdrawnFunctionConfig, modifyAutopoolName, nestedArrayToObject, paginateQuery, processRebalance, processRebalancesInBatches, rewardsData, systemRegistryFunctionNames, updateRebalanceStats, waitForMessageReceived };
|