-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetchers.interfaces.ts
83 lines (69 loc) · 1.96 KB
/
fetchers.interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { BigNumber } from "ethers";
import { BlockTag } from "@ethersproject/providers";
import {
MorphoEpochDistribution,
RewardsData,
} from "../helpers/rewards/rewards.types";
import {
Address,
GlobalData,
MarketConfig,
ScaledMarketData,
ScaledUserMarketData,
ScaledMarketSupply,
StEthData,
} from "../types";
import { Fetcher } from "./Fetcher";
export interface MarketFetcher extends Fetcher {
fetchMarketConfig: (
underlyingAddress: Address,
blockTag?: BlockTag
) => Promise<MarketConfig>;
fetchMarketData: (
underlyingAddress: Address,
configuration: { priceSource: Address },
blockTag?: BlockTag
) => Promise<ScaledMarketData>;
fetchAllMarkets: (blockTag?: BlockTag) => Promise<string[]>;
}
export interface UserFetcher extends Fetcher {
fetchUserMarketData: (
underlyingAddress: Address,
userAddress: Address,
blockTag?: BlockTag
) => Promise<ScaledUserMarketData>;
fetchUserETHBalance: (
userAddress: Address,
blockTag?: BlockTag
) => Promise<BigNumber>;
fetchManagerApproval: (
userAddress: Address,
managerAddress: Address,
blockTag?: BlockTag
) => Promise<{ isBulkerManaging: boolean; nonce: BigNumber }>;
fetchStethData: (
userAddress: Address,
blockTag?: BlockTag
) => Promise<StEthData>;
}
export interface GlobalDataFetcher extends Fetcher {
fetchGlobalData: (blockTag?: BlockTag) => Promise<GlobalData>;
}
/**
* @deprecated We are not using a static market supply anymore. We consider that one of collateral or poolSupply is equal to zero.
*/
export interface MarketSupplyFetcher extends Fetcher {
fetchMarketSupply: (
underlyingAddress: Address,
blockTag?: BlockTag
) => Promise<ScaledMarketSupply>;
}
export interface RewardsFetcher extends Fetcher {
fetchRewardsData: (
userAddress: Address,
root: string
) => Promise<RewardsData | null>;
fetchMarketsRewardsDistribution: () => Promise<
MorphoEpochDistribution | undefined
>;
}