-
Notifications
You must be signed in to change notification settings - Fork 17
/
types.ts
249 lines (225 loc) · 4.27 KB
/
types.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
import { ContractInterface, providers, Signer } from 'ethers'
export type Provider = providers.BaseProvider
export interface ITransactionSuccess {
hash: string
wait: () => Promise<{
status?: number | undefined
events: Array<{ address: string }>
}>
}
export interface ITransactionError {
message: string
}
export interface IContractReadConfig {
address: string
abi: ContractInterface
provider: Provider
}
export interface IContractWriteConfig {
address: string
abi: ContractInterface
signer: Signer | null
}
export interface INftApiResponse {
ownedNfts: {
id: {
tokenId: string
}
metadata: {
image: string
}
media: { gateway: string }[]
}[]
}
export interface INftItem {
tokenId: string
imgUrl: string
}
export interface IOracleResponse {
deadline: number
normalizedNftContract: string
price: string
signature: {
r: string
s: string
v: number
}
}
export interface IBorrowPool {
name: string
symbol: string
address: string
maxLoanLength: number
ltv: string
nftContract: string
collectionName: string
poolBalance: string
totalBorrowed: string
totalDeposited: string
maxVariableInterestPerEthPerSecond: string
owner: string
pricePerNft: string
maxNftsToBorrow: string
currentAnnualInterest: string
oracle: string
oraclePrice?: string
maxPrice: number
maxInstantBorrow: number
dailyBorrows: number
maxDailyBorrows: number
adminPoolInfo: {
key: string
maxLoanLength: number
minimumInterest: string
maximumInterest: string
liquidators: Array<string>
}
}
export interface IBorrowPoolData {
name: string
symbol: string
maxLoanLength: string
currentAnnualInterest: string
maxVariableInterestPerEthPerSecond: string
ltv: string
nftContract: string
collectionName: string
owner: string
pricePerNft: string
maxNftsToBorrow: string
}
export interface IGetAdminPoolDataArgs {
poolAddress: string
nftContractAddress: string
provider: Provider
graphEndpoint: string
}
export interface ILoan {
id: string
loanId: number | string
nftId: string
interest: string
startTime: string
borrowed: string
toPay: {
initialBorrowed: number
apr: number
interestAccrued: number
lateFees: number
total: number
buffer: string
totalPayable: string
}
deadline: number
imgUrl: string
owner: string
pool: {
name: string
owner: string
address: string
}
}
export interface ILoanValidity {
poolAddress: string
loanId: number | string
provider: Provider
poolABI: ContractInterface
}
export interface ICollection {
address: string
name: string
totalDeposited: string
imgUrl: string
sortIndex: number
}
export interface IArcadeQuote {
borrowableToken: string
principal: string
interestRate: string
loanDuration: string
offerDeadline: number
loanInstallments: string
offerTimestamp: number
loanUrl: string
}
export interface IBendDaoQuote {
floorInEth: string
borrowableToken: string
currentVariableBorrowRate: string
availableBorrow: string
ltv: string
liquidationThreshold: string
loanUrl: string
}
export interface IJpegdQuote {
vaultName: string
floorInEth: string
pToken: string
credit: string
liquidationLimit: string
loanUrl: string
}
export interface INFTFiQuote {
token: string
principal: string
repayment: string
duration: string
expiry: string
interest: string
url: string
}
export interface IX2Y2Quote {
token: string
amount: string
repayment: string
apr: string
expires: string
adminFee: string
duration: string
url: string
}
export interface ILlamaLendQuote {
pricePerNft: string
maxLoanLength: number
currentAnnualInterest: string
url: string
}
export type IParaSpaceQuote = {
floorInEth: string
borrowableToken: string
availableBorrow: string
borrowableTokenVariableBorrowRate: string
ltv: string
liquidationThreshold: string
loanUrl: string
}
export interface ICyanQuote {
currency: string
amount: string
interestRate: number
interestRateApr: number
totalNumOfPayments: number
term: number
url: string
}
export interface IZhartaQuote {
currency: string
minBorrowableAmount: string
maxBorrowableAmount: string
interestRate: number
interestRateApr: number
ltv: number
duration: number
url: string
}
export interface IGoblinSaxQuote {
token: string
price: string
url: string
ltv: string
apr: string
fee: string
loanPrincipal: string
loanRepayment: string
duration: string
}