@lavarage/sdk 6.4.6 → 6.5.0
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/abi/borrowerOperations.ts +248 -0
- package/abi/tokenHolderAbi.ts +443 -0
- package/dist/index.d.mts +131 -1
- package/dist/index.d.ts +131 -1
- package/dist/index.js +1409 -196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1423 -198
- package/dist/index.mjs.map +1 -1
- package/evm.ts +318 -0
- package/index.ts +1295 -773
- package/interfaces/evm.ts +42 -0
- package/package.json +4 -3
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
export const borrowerOperationsAbi = [
|
|
2
|
+
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
3
|
+
{ inputs: [], name: "NotInitializing", type: "error" },
|
|
4
|
+
{ inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
|
|
5
|
+
{
|
|
6
|
+
anonymous: false,
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
indexed: true,
|
|
10
|
+
internalType: "address",
|
|
11
|
+
name: "buyer",
|
|
12
|
+
type: "address",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
indexed: true,
|
|
16
|
+
internalType: "address",
|
|
17
|
+
name: "tokenCollateral",
|
|
18
|
+
type: "address",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
indexed: true,
|
|
22
|
+
internalType: "uint256",
|
|
23
|
+
name: "loanId",
|
|
24
|
+
type: "uint256",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
indexed: false,
|
|
28
|
+
internalType: "uint256",
|
|
29
|
+
name: "openingPositionSize",
|
|
30
|
+
type: "uint256",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
indexed: false,
|
|
34
|
+
internalType: "uint256",
|
|
35
|
+
name: "collateralAmount",
|
|
36
|
+
type: "uint256",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
indexed: false,
|
|
40
|
+
internalType: "uint256",
|
|
41
|
+
name: "initialMargin",
|
|
42
|
+
type: "uint256",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
name: "Buy",
|
|
46
|
+
type: "event",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
anonymous: false,
|
|
50
|
+
inputs: [
|
|
51
|
+
{
|
|
52
|
+
indexed: false,
|
|
53
|
+
internalType: "uint64",
|
|
54
|
+
name: "version",
|
|
55
|
+
type: "uint64",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
name: "Initialized",
|
|
59
|
+
type: "event",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
anonymous: false,
|
|
63
|
+
inputs: [
|
|
64
|
+
{
|
|
65
|
+
indexed: true,
|
|
66
|
+
internalType: "address",
|
|
67
|
+
name: "borrower",
|
|
68
|
+
type: "address",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
indexed: true,
|
|
72
|
+
internalType: "address",
|
|
73
|
+
name: "tokenCollateral",
|
|
74
|
+
type: "address",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
indexed: true,
|
|
78
|
+
internalType: "uint256",
|
|
79
|
+
name: "loanId",
|
|
80
|
+
type: "uint256",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
indexed: false,
|
|
84
|
+
internalType: "uint256",
|
|
85
|
+
name: "closingPositionSize",
|
|
86
|
+
type: "uint256",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
indexed: false,
|
|
90
|
+
internalType: "uint256",
|
|
91
|
+
name: "liquidatorRepaidAmount",
|
|
92
|
+
type: "uint256",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
name: "Liquidation",
|
|
96
|
+
type: "event",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
anonymous: false,
|
|
100
|
+
inputs: [
|
|
101
|
+
{
|
|
102
|
+
indexed: true,
|
|
103
|
+
internalType: "address",
|
|
104
|
+
name: "buyer",
|
|
105
|
+
type: "address",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
indexed: true,
|
|
109
|
+
internalType: "address",
|
|
110
|
+
name: "tokenCollateral",
|
|
111
|
+
type: "address",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
indexed: true,
|
|
115
|
+
internalType: "uint256",
|
|
116
|
+
name: "loanId",
|
|
117
|
+
type: "uint256",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
indexed: false,
|
|
121
|
+
internalType: "uint256",
|
|
122
|
+
name: "closingPositionSize",
|
|
123
|
+
type: "uint256",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
indexed: false,
|
|
127
|
+
internalType: "uint256",
|
|
128
|
+
name: "profit",
|
|
129
|
+
type: "uint256",
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
name: "Sell",
|
|
133
|
+
type: "event",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
inputs: [],
|
|
137
|
+
name: "admin",
|
|
138
|
+
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
139
|
+
stateMutability: "view",
|
|
140
|
+
type: "function",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
inputs: [
|
|
144
|
+
{ internalType: "bytes", name: "buyingCode", type: "bytes" },
|
|
145
|
+
{
|
|
146
|
+
internalType: "contract IERC20",
|
|
147
|
+
name: "tokenCollateral",
|
|
148
|
+
type: "address",
|
|
149
|
+
},
|
|
150
|
+
{ internalType: "uint256", name: "borrowAmount", type: "uint256" },
|
|
151
|
+
{
|
|
152
|
+
internalType: "contract TokenHolder",
|
|
153
|
+
name: "tokenHolder",
|
|
154
|
+
type: "address",
|
|
155
|
+
},
|
|
156
|
+
{ internalType: "address", name: "inchRouter", type: "address" },
|
|
157
|
+
{
|
|
158
|
+
internalType: "address",
|
|
159
|
+
name: "integratorFeeAddress",
|
|
160
|
+
type: "address",
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
name: "buy",
|
|
164
|
+
outputs: [],
|
|
165
|
+
stateMutability: "payable",
|
|
166
|
+
type: "function",
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
inputs: [
|
|
170
|
+
{ internalType: "contract IERC20", name: "_weth", type: "address" },
|
|
171
|
+
],
|
|
172
|
+
name: "initialize",
|
|
173
|
+
outputs: [],
|
|
174
|
+
stateMutability: "nonpayable",
|
|
175
|
+
type: "function",
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
inputs: [
|
|
179
|
+
{ internalType: "uint256", name: "loanId", type: "uint256" },
|
|
180
|
+
{
|
|
181
|
+
internalType: "contract TokenHolder",
|
|
182
|
+
name: "tokenHolder",
|
|
183
|
+
type: "address",
|
|
184
|
+
},
|
|
185
|
+
{ internalType: "uint256", name: "closingPositionSize", type: "uint256" },
|
|
186
|
+
],
|
|
187
|
+
name: "liquidate",
|
|
188
|
+
outputs: [],
|
|
189
|
+
stateMutability: "nonpayable",
|
|
190
|
+
type: "function",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
inputs: [],
|
|
194
|
+
name: "openingFee",
|
|
195
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
196
|
+
stateMutability: "view",
|
|
197
|
+
type: "function",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
inputs: [],
|
|
201
|
+
name: "profitFee",
|
|
202
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
203
|
+
stateMutability: "view",
|
|
204
|
+
type: "function",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
inputs: [
|
|
208
|
+
{ internalType: "uint256", name: "loanId", type: "uint256" },
|
|
209
|
+
{ internalType: "bytes", name: "sellingCode", type: "bytes" },
|
|
210
|
+
{
|
|
211
|
+
internalType: "contract TokenHolder",
|
|
212
|
+
name: "tokenHolder",
|
|
213
|
+
type: "address",
|
|
214
|
+
},
|
|
215
|
+
{ internalType: "address", name: "inchRouter", type: "address" },
|
|
216
|
+
{
|
|
217
|
+
internalType: "address",
|
|
218
|
+
name: "integratorFeeAddress",
|
|
219
|
+
type: "address",
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
name: "sell",
|
|
223
|
+
outputs: [],
|
|
224
|
+
stateMutability: "nonpayable",
|
|
225
|
+
type: "function",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
inputs: [{ internalType: "address", name: "_admin", type: "address" }],
|
|
229
|
+
name: "setAdmin",
|
|
230
|
+
outputs: [],
|
|
231
|
+
stateMutability: "nonpayable",
|
|
232
|
+
type: "function",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
inputs: [{ internalType: "uint256", name: "_openingFee", type: "uint256" }],
|
|
236
|
+
name: "setOpeningFee",
|
|
237
|
+
outputs: [],
|
|
238
|
+
stateMutability: "nonpayable",
|
|
239
|
+
type: "function",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
inputs: [{ internalType: "uint256", name: "_profitFee", type: "uint256" }],
|
|
243
|
+
name: "setProfitFee",
|
|
244
|
+
outputs: [],
|
|
245
|
+
stateMutability: "nonpayable",
|
|
246
|
+
type: "function",
|
|
247
|
+
},
|
|
248
|
+
];
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
export const tokenHolderAbi = [
|
|
2
|
+
{ inputs: [], name: "AccessControlBadConfirmation", type: "error" },
|
|
3
|
+
{
|
|
4
|
+
inputs: [
|
|
5
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
6
|
+
{ internalType: "bytes32", name: "neededRole", type: "bytes32" },
|
|
7
|
+
],
|
|
8
|
+
name: "AccessControlUnauthorizedAccount",
|
|
9
|
+
type: "error",
|
|
10
|
+
},
|
|
11
|
+
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
12
|
+
{ inputs: [], name: "NotInitializing", type: "error" },
|
|
13
|
+
{
|
|
14
|
+
anonymous: false,
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
indexed: false,
|
|
18
|
+
internalType: "uint64",
|
|
19
|
+
name: "version",
|
|
20
|
+
type: "uint64",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
name: "Initialized",
|
|
24
|
+
type: "event",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
anonymous: false,
|
|
28
|
+
inputs: [
|
|
29
|
+
{
|
|
30
|
+
indexed: false,
|
|
31
|
+
internalType: "uint256",
|
|
32
|
+
name: "newInterestRate",
|
|
33
|
+
type: "uint256",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
name: "InterestRateSet",
|
|
37
|
+
type: "event",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
anonymous: false,
|
|
41
|
+
inputs: [
|
|
42
|
+
{
|
|
43
|
+
indexed: false,
|
|
44
|
+
internalType: "uint256",
|
|
45
|
+
name: "loanId",
|
|
46
|
+
type: "uint256",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
indexed: false,
|
|
50
|
+
internalType: "uint256",
|
|
51
|
+
name: "amount",
|
|
52
|
+
type: "uint256",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
indexed: false,
|
|
56
|
+
internalType: "uint256",
|
|
57
|
+
name: "timestamp",
|
|
58
|
+
type: "uint256",
|
|
59
|
+
},
|
|
60
|
+
{ indexed: false, internalType: "bool", name: "repaid", type: "bool" },
|
|
61
|
+
],
|
|
62
|
+
name: "LoanCreated",
|
|
63
|
+
type: "event",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
anonymous: false,
|
|
67
|
+
inputs: [
|
|
68
|
+
{
|
|
69
|
+
indexed: false,
|
|
70
|
+
internalType: "uint256",
|
|
71
|
+
name: "loanId",
|
|
72
|
+
type: "uint256",
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
name: "LoanRepaid",
|
|
76
|
+
type: "event",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
anonymous: false,
|
|
80
|
+
inputs: [
|
|
81
|
+
{
|
|
82
|
+
indexed: false,
|
|
83
|
+
internalType: "address",
|
|
84
|
+
name: "collateralAddress",
|
|
85
|
+
type: "address",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
indexed: false,
|
|
89
|
+
internalType: "uint256",
|
|
90
|
+
name: "oldValue",
|
|
91
|
+
type: "uint256",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
indexed: false,
|
|
95
|
+
internalType: "uint256",
|
|
96
|
+
name: "newValue",
|
|
97
|
+
type: "uint256",
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
name: "MaxLendPerTokenUpdated",
|
|
101
|
+
type: "event",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
anonymous: false,
|
|
105
|
+
inputs: [
|
|
106
|
+
{
|
|
107
|
+
indexed: false,
|
|
108
|
+
internalType: "address",
|
|
109
|
+
name: "borrower",
|
|
110
|
+
type: "address",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
indexed: false,
|
|
114
|
+
internalType: "uint256",
|
|
115
|
+
name: "amount",
|
|
116
|
+
type: "uint256",
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
name: "PrivilegedLoan",
|
|
120
|
+
type: "event",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
anonymous: false,
|
|
124
|
+
inputs: [
|
|
125
|
+
{
|
|
126
|
+
indexed: false,
|
|
127
|
+
internalType: "address",
|
|
128
|
+
name: "borrower",
|
|
129
|
+
type: "address",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
indexed: false,
|
|
133
|
+
internalType: "uint256",
|
|
134
|
+
name: "amount",
|
|
135
|
+
type: "uint256",
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
name: "PrivilegedLoanRepaid",
|
|
139
|
+
type: "event",
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
anonymous: false,
|
|
143
|
+
inputs: [
|
|
144
|
+
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
145
|
+
{
|
|
146
|
+
indexed: true,
|
|
147
|
+
internalType: "bytes32",
|
|
148
|
+
name: "previousAdminRole",
|
|
149
|
+
type: "bytes32",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
indexed: true,
|
|
153
|
+
internalType: "bytes32",
|
|
154
|
+
name: "newAdminRole",
|
|
155
|
+
type: "bytes32",
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
name: "RoleAdminChanged",
|
|
159
|
+
type: "event",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
anonymous: false,
|
|
163
|
+
inputs: [
|
|
164
|
+
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
165
|
+
{
|
|
166
|
+
indexed: true,
|
|
167
|
+
internalType: "address",
|
|
168
|
+
name: "account",
|
|
169
|
+
type: "address",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
indexed: true,
|
|
173
|
+
internalType: "address",
|
|
174
|
+
name: "sender",
|
|
175
|
+
type: "address",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
name: "RoleGranted",
|
|
179
|
+
type: "event",
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
anonymous: false,
|
|
183
|
+
inputs: [
|
|
184
|
+
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
185
|
+
{
|
|
186
|
+
indexed: true,
|
|
187
|
+
internalType: "address",
|
|
188
|
+
name: "account",
|
|
189
|
+
type: "address",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
indexed: true,
|
|
193
|
+
internalType: "address",
|
|
194
|
+
name: "sender",
|
|
195
|
+
type: "address",
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
name: "RoleRevoked",
|
|
199
|
+
type: "event",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
inputs: [],
|
|
203
|
+
name: "BORROWER_ROUTER_ROLE",
|
|
204
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
205
|
+
stateMutability: "view",
|
|
206
|
+
type: "function",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
inputs: [],
|
|
210
|
+
name: "DEFAULT_ADMIN_ROLE",
|
|
211
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
212
|
+
stateMutability: "view",
|
|
213
|
+
type: "function",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
inputs: [
|
|
217
|
+
{ internalType: "address", name: "collateralAddress", type: "address" },
|
|
218
|
+
{ internalType: "uint256", name: "_interestRate", type: "uint256" },
|
|
219
|
+
{ internalType: "uint256", name: "maxLendPerToken", type: "uint256" },
|
|
220
|
+
{ internalType: "uint256", name: "minAmount", type: "uint256" },
|
|
221
|
+
],
|
|
222
|
+
name: "addCollateral",
|
|
223
|
+
outputs: [],
|
|
224
|
+
stateMutability: "nonpayable",
|
|
225
|
+
type: "function",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
inputs: [{ internalType: "address", name: "", type: "address" }],
|
|
229
|
+
name: "collateralMapping",
|
|
230
|
+
outputs: [
|
|
231
|
+
{ internalType: "address", name: "collateralAddress", type: "address" },
|
|
232
|
+
{ internalType: "uint256", name: "maxLendPerToken", type: "uint256" },
|
|
233
|
+
{ internalType: "uint256", name: "interestRate", type: "uint256" },
|
|
234
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
235
|
+
{ internalType: "uint256", name: "minAmount", type: "uint256" },
|
|
236
|
+
],
|
|
237
|
+
stateMutability: "view",
|
|
238
|
+
type: "function",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
|
242
|
+
name: "deposit",
|
|
243
|
+
outputs: [],
|
|
244
|
+
stateMutability: "nonpayable",
|
|
245
|
+
type: "function",
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
inputs: [],
|
|
249
|
+
name: "getBalance",
|
|
250
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
251
|
+
stateMutability: "view",
|
|
252
|
+
type: "function",
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
256
|
+
name: "getRoleAdmin",
|
|
257
|
+
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
258
|
+
stateMutability: "view",
|
|
259
|
+
type: "function",
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
263
|
+
name: "grantBorrowerRouterRole",
|
|
264
|
+
outputs: [],
|
|
265
|
+
stateMutability: "nonpayable",
|
|
266
|
+
type: "function",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
inputs: [
|
|
270
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
271
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
272
|
+
],
|
|
273
|
+
name: "grantRole",
|
|
274
|
+
outputs: [],
|
|
275
|
+
stateMutability: "nonpayable",
|
|
276
|
+
type: "function",
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
inputs: [
|
|
280
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
281
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
282
|
+
],
|
|
283
|
+
name: "hasRole",
|
|
284
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
285
|
+
stateMutability: "view",
|
|
286
|
+
type: "function",
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
inputs: [
|
|
290
|
+
{ internalType: "address", name: "_tokenAddress", type: "address" },
|
|
291
|
+
],
|
|
292
|
+
name: "initialize",
|
|
293
|
+
outputs: [],
|
|
294
|
+
stateMutability: "nonpayable",
|
|
295
|
+
type: "function",
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
inputs: [
|
|
299
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
300
|
+
{ internalType: "uint256", name: "collateralAmount", type: "uint256" },
|
|
301
|
+
{ internalType: "address", name: "collateralAddress", type: "address" },
|
|
302
|
+
{ internalType: "address", name: "borrower", type: "address" },
|
|
303
|
+
{ internalType: "uint256", name: "userPaid", type: "uint256" },
|
|
304
|
+
],
|
|
305
|
+
name: "loanConfirmation",
|
|
306
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
307
|
+
stateMutability: "nonpayable",
|
|
308
|
+
type: "function",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
312
|
+
name: "loans",
|
|
313
|
+
outputs: [
|
|
314
|
+
{ internalType: "uint256", name: "id", type: "uint256" },
|
|
315
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
316
|
+
{
|
|
317
|
+
components: [
|
|
318
|
+
{
|
|
319
|
+
internalType: "address",
|
|
320
|
+
name: "collateralAddress",
|
|
321
|
+
type: "address",
|
|
322
|
+
},
|
|
323
|
+
{ internalType: "uint256", name: "maxLendPerToken", type: "uint256" },
|
|
324
|
+
{ internalType: "uint256", name: "interestRate", type: "uint256" },
|
|
325
|
+
{ internalType: "bool", name: "active", type: "bool" },
|
|
326
|
+
{ internalType: "uint256", name: "minAmount", type: "uint256" },
|
|
327
|
+
],
|
|
328
|
+
internalType: "struct Collateral",
|
|
329
|
+
name: "collateral",
|
|
330
|
+
type: "tuple",
|
|
331
|
+
},
|
|
332
|
+
{ internalType: "uint256", name: "collateralAmount", type: "uint256" },
|
|
333
|
+
{ internalType: "uint256", name: "timestamp", type: "uint256" },
|
|
334
|
+
{ internalType: "address", name: "borrower", type: "address" },
|
|
335
|
+
{ internalType: "uint256", name: "userPaid", type: "uint256" },
|
|
336
|
+
],
|
|
337
|
+
stateMutability: "view",
|
|
338
|
+
type: "function",
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
inputs: [],
|
|
342
|
+
name: "nextLoanId",
|
|
343
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
344
|
+
stateMutability: "view",
|
|
345
|
+
type: "function",
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
inputs: [
|
|
349
|
+
{
|
|
350
|
+
internalType: "contract IERC20",
|
|
351
|
+
name: "flashLoanToken",
|
|
352
|
+
type: "address",
|
|
353
|
+
},
|
|
354
|
+
{ internalType: "uint256", name: "amount", type: "uint256" },
|
|
355
|
+
],
|
|
356
|
+
name: "privilegedLoan",
|
|
357
|
+
outputs: [],
|
|
358
|
+
stateMutability: "nonpayable",
|
|
359
|
+
type: "function",
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
inputs: [
|
|
363
|
+
{ internalType: "address", name: "collateralAddress", type: "address" },
|
|
364
|
+
],
|
|
365
|
+
name: "removeCollateral",
|
|
366
|
+
outputs: [],
|
|
367
|
+
stateMutability: "nonpayable",
|
|
368
|
+
type: "function",
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
inputs: [
|
|
372
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
373
|
+
{ internalType: "address", name: "callerConfirmation", type: "address" },
|
|
374
|
+
],
|
|
375
|
+
name: "renounceRole",
|
|
376
|
+
outputs: [],
|
|
377
|
+
stateMutability: "nonpayable",
|
|
378
|
+
type: "function",
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
inputs: [{ internalType: "uint256", name: "loanId", type: "uint256" }],
|
|
382
|
+
name: "repayLoan",
|
|
383
|
+
outputs: [],
|
|
384
|
+
stateMutability: "nonpayable",
|
|
385
|
+
type: "function",
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
389
|
+
name: "revokeBorrowerRouterRole",
|
|
390
|
+
outputs: [],
|
|
391
|
+
stateMutability: "nonpayable",
|
|
392
|
+
type: "function",
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
inputs: [
|
|
396
|
+
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
397
|
+
{ internalType: "address", name: "account", type: "address" },
|
|
398
|
+
],
|
|
399
|
+
name: "revokeRole",
|
|
400
|
+
outputs: [],
|
|
401
|
+
stateMutability: "nonpayable",
|
|
402
|
+
type: "function",
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
406
|
+
name: "supportsInterface",
|
|
407
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
408
|
+
stateMutability: "view",
|
|
409
|
+
type: "function",
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
inputs: [],
|
|
413
|
+
name: "tokenHolded",
|
|
414
|
+
outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
|
|
415
|
+
stateMutability: "view",
|
|
416
|
+
type: "function",
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
inputs: [
|
|
420
|
+
{
|
|
421
|
+
internalType: "address[]",
|
|
422
|
+
name: "collateralAddresses",
|
|
423
|
+
type: "address[]",
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
internalType: "uint256[]",
|
|
427
|
+
name: "newMaxLendPerTokens",
|
|
428
|
+
type: "uint256[]",
|
|
429
|
+
},
|
|
430
|
+
],
|
|
431
|
+
name: "updateMaxLendPerTokenBulk",
|
|
432
|
+
outputs: [],
|
|
433
|
+
stateMutability: "nonpayable",
|
|
434
|
+
type: "function",
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
inputs: [{ internalType: "uint256", name: "amount", type: "uint256" }],
|
|
438
|
+
name: "withdraw",
|
|
439
|
+
outputs: [],
|
|
440
|
+
stateMutability: "nonpayable",
|
|
441
|
+
type: "function",
|
|
442
|
+
},
|
|
443
|
+
];
|