@sonarwatch/portfolio-plugins 0.14.33 → 0.14.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/src/index.js +4 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/alphafi/positionsFetcher.js +1 -1
  6. package/src/plugins/alphafi/positionsFetcher.js.map +1 -1
  7. package/src/plugins/cetus/vaultsJob.js +1 -0
  8. package/src/plugins/cetus/vaultsJob.js.map +1 -1
  9. package/src/plugins/ensofi/constants.d.ts +10 -0
  10. package/src/plugins/ensofi/constants.js +24 -0
  11. package/src/plugins/ensofi/constants.js.map +1 -0
  12. package/src/plugins/ensofi/idl.d.ts +103 -0
  13. package/src/plugins/ensofi/idl.js +900 -0
  14. package/src/plugins/ensofi/idl.js.map +1 -0
  15. package/src/plugins/ensofi/index.d.ts +6 -0
  16. package/src/plugins/ensofi/index.js +14 -0
  17. package/src/plugins/ensofi/index.js.map +1 -0
  18. package/src/plugins/ensofi/solanaLoansFetcher.d.ts +3 -0
  19. package/src/plugins/ensofi/solanaLoansFetcher.js +116 -0
  20. package/src/plugins/ensofi/solanaLoansFetcher.js.map +1 -0
  21. package/src/plugins/ensofi/suiLoansFetcher.d.ts +3 -0
  22. package/src/plugins/ensofi/suiLoansFetcher.js +111 -0
  23. package/src/plugins/ensofi/suiLoansFetcher.js.map +1 -0
  24. package/src/plugins/ensofi/suiLoansJob.d.ts +3 -0
  25. package/src/plugins/ensofi/suiLoansJob.js +47 -0
  26. package/src/plugins/ensofi/suiLoansJob.js.map +1 -0
  27. package/src/plugins/ensofi/types.d.ts +71 -0
  28. package/src/plugins/ensofi/types.js +3 -0
  29. package/src/plugins/ensofi/types.js.map +1 -0
  30. package/src/plugins/flash/helpers.d.ts +1 -1
  31. package/src/plugins/flash/helpers.js +2 -2
  32. package/src/plugins/flash/helpers.js.map +1 -1
  33. package/src/plugins/flash/poolJob.js +25 -5
  34. package/src/plugins/flash/poolJob.js.map +1 -1
  35. package/src/plugins/flash/structs.d.ts +4 -0
  36. package/src/plugins/flash/structs.js +4 -0
  37. package/src/plugins/flash/structs.js.map +1 -1
  38. package/src/plugins/flash/types.d.ts +1 -0
  39. package/src/plugins/haedal/vaultFetcher.js +1 -2
  40. package/src/plugins/haedal/vaultFetcher.js.map +1 -1
  41. package/src/plugins/kai/vaultsJob.js +1 -2
  42. package/src/plugins/kai/vaultsJob.js.map +1 -1
  43. package/src/plugins/kriya/vaultsFetcher.js +1 -2
  44. package/src/plugins/kriya/vaultsFetcher.js.map +1 -1
  45. package/src/plugins/mole/depositsFetcher.js +1 -1
  46. package/src/plugins/mole/depositsFetcher.js.map +1 -1
  47. package/src/plugins/thala/farmingPoolsFetcher.js +14 -50
  48. package/src/plugins/thala/farmingPoolsFetcher.js.map +1 -1
  49. package/src/plugins/tokens/fetchers/sui.js +3 -3
  50. package/src/plugins/tokens/fetchers/sui.js.map +1 -1
  51. package/src/plugins/tokens/helpers.d.ts +3 -2
  52. package/src/plugins/tokens/helpers.js +5 -4
  53. package/src/plugins/tokens/helpers.js.map +1 -1
  54. package/src/plugins/turbos/clmmVaultFetcher.js +1 -2
  55. package/src/plugins/turbos/clmmVaultFetcher.js.map +1 -1
  56. package/src/plugins/typus/safuFetcher.js +2 -2
  57. package/src/plugins/typus/safuFetcher.js.map +1 -1
  58. package/src/plugins/typus/vaultsFetcher.js +1 -1
  59. package/src/plugins/typus/vaultsFetcher.js.map +1 -1
  60. package/src/plugins/whalesmarket/depositFetcher.js +0 -1
  61. package/src/plugins/whalesmarket/depositFetcher.js.map +1 -1
  62. package/src/utils/elementbuilder/AssetBuilder.d.ts +2 -1
  63. package/src/utils/elementbuilder/AssetBuilder.js +14 -2
  64. package/src/utils/elementbuilder/AssetBuilder.js.map +1 -1
  65. package/src/utils/elementbuilder/LiquidityBuilder.js +2 -1
  66. package/src/utils/elementbuilder/LiquidityBuilder.js.map +1 -1
@@ -0,0 +1,900 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensofiIdl = void 0;
4
+ exports.ensofiIdl = {
5
+ version: '0.3.2',
6
+ name: 'enso_lending',
7
+ instructions: [
8
+ {
9
+ name: 'initSettingAccount',
10
+ accounts: [
11
+ { name: 'owner', isMut: true, isSigner: true },
12
+ { name: 'receiver', isMut: false, isSigner: false },
13
+ { name: 'settingAccount', isMut: true, isSigner: false },
14
+ { name: 'systemProgram', isMut: false, isSigner: false },
15
+ ],
16
+ args: [
17
+ { name: 'tierId', type: 'string' },
18
+ { name: 'amount', type: 'u64' },
19
+ { name: 'duration', type: 'u64' },
20
+ { name: 'lenderFeePercent', type: 'f64' },
21
+ { name: 'borrowerFeePercent', type: 'f64' },
22
+ ],
23
+ },
24
+ {
25
+ name: 'editSettingAccount',
26
+ accounts: [
27
+ { name: 'owner', isMut: true, isSigner: true },
28
+ { name: 'receiver', isMut: false, isSigner: false },
29
+ { name: 'settingAccount', isMut: true, isSigner: false },
30
+ { name: 'systemProgram', isMut: false, isSigner: false },
31
+ ],
32
+ args: [
33
+ { name: 'tierId', type: 'string' },
34
+ { name: 'amount', type: { option: 'u64' } },
35
+ { name: 'duration', type: { option: 'u64' } },
36
+ { name: 'lenderFeePercent', type: { option: 'f64' } },
37
+ { name: 'borrowerFeePercent', type: { option: 'f64' } },
38
+ ],
39
+ },
40
+ {
41
+ name: 'closeSettingAccount',
42
+ accounts: [
43
+ { name: 'owner', isMut: true, isSigner: true },
44
+ { name: 'settingAccount', isMut: true, isSigner: false },
45
+ { name: 'systemProgram', isMut: false, isSigner: false },
46
+ ],
47
+ args: [{ name: 'tierId', type: 'string' }],
48
+ },
49
+ {
50
+ name: 'initAsset',
51
+ accounts: [
52
+ { name: 'owner', isMut: true, isSigner: true },
53
+ { name: 'tokenMint', isMut: false, isSigner: false },
54
+ { name: 'asset', isMut: true, isSigner: false },
55
+ { name: 'priceFeedAccount', isMut: false, isSigner: false },
56
+ { name: 'systemProgram', isMut: false, isSigner: false },
57
+ ],
58
+ args: [
59
+ { name: 'name', type: 'string' },
60
+ { name: 'isLend', type: 'bool' },
61
+ { name: 'isCollateral', type: 'bool' },
62
+ { name: 'priceFeedId', type: 'string' },
63
+ { name: 'maxPriceAgeSeconds', type: 'u64' },
64
+ ],
65
+ },
66
+ {
67
+ name: 'editAsset',
68
+ accounts: [
69
+ { name: 'owner', isMut: true, isSigner: true },
70
+ { name: 'tokenMint', isMut: false, isSigner: false },
71
+ { name: 'asset', isMut: true, isSigner: false },
72
+ {
73
+ name: 'priceFeedAccount',
74
+ isMut: false,
75
+ isSigner: false,
76
+ isOptional: true,
77
+ },
78
+ ],
79
+ args: [
80
+ { name: 'name', type: { option: 'string' } },
81
+ { name: 'isLend', type: { option: 'bool' } },
82
+ { name: 'isCollateral', type: { option: 'bool' } },
83
+ { name: 'priceFeedId', type: { option: 'string' } },
84
+ { name: 'maxPriceAgeSeconds', type: { option: 'u64' } },
85
+ ],
86
+ },
87
+ {
88
+ name: 'initVaultAuthority',
89
+ accounts: [
90
+ { name: 'borrower', isMut: true, isSigner: true },
91
+ { name: 'vaultAuthority', isMut: true, isSigner: false },
92
+ { name: 'systemProgram', isMut: false, isSigner: false },
93
+ ],
94
+ args: [],
95
+ },
96
+ {
97
+ name: 'createLendOffer',
98
+ accounts: [
99
+ { name: 'lender', isMut: true, isSigner: true },
100
+ { name: 'lendAsset', isMut: false, isSigner: false },
101
+ { name: 'mintAsset', isMut: false, isSigner: false },
102
+ { name: 'lenderAtaAsset', isMut: true, isSigner: false },
103
+ { name: 'settingAccount', isMut: false, isSigner: false },
104
+ { name: 'lendOffer', isMut: true, isSigner: false },
105
+ { name: 'hotWalletAta', isMut: true, isSigner: false },
106
+ { name: 'tokenProgram', isMut: false, isSigner: false },
107
+ { name: 'systemProgram', isMut: false, isSigner: false },
108
+ ],
109
+ args: [
110
+ { name: 'offerId', type: 'string' },
111
+ { name: 'tierId', type: 'string' },
112
+ { name: 'interest', type: 'f64' },
113
+ ],
114
+ },
115
+ {
116
+ name: 'editLendOffer',
117
+ accounts: [
118
+ { name: 'lender', isMut: true, isSigner: true },
119
+ { name: 'lendOffer', isMut: true, isSigner: false },
120
+ ],
121
+ args: [
122
+ { name: 'offerId', type: 'string' },
123
+ { name: 'interest', type: 'f64' },
124
+ ],
125
+ },
126
+ {
127
+ name: 'systemCancelLendOffer',
128
+ accounts: [
129
+ { name: 'lender', isMut: false, isSigner: false },
130
+ { name: 'lenderAtaAsset', isMut: true, isSigner: false },
131
+ { name: 'mintAsset', isMut: false, isSigner: false },
132
+ { name: 'lendOffer', isMut: true, isSigner: false },
133
+ { name: 'system', isMut: true, isSigner: true },
134
+ { name: 'systemAta', isMut: true, isSigner: false },
135
+ { name: 'tokenProgram', isMut: false, isSigner: false },
136
+ ],
137
+ args: [
138
+ { name: 'offerId', type: 'string' },
139
+ { name: 'tierId', type: 'string' },
140
+ { name: 'waitingInterest', type: 'u64' },
141
+ ],
142
+ },
143
+ {
144
+ name: 'cancelLendOffer',
145
+ accounts: [
146
+ { name: 'lender', isMut: true, isSigner: true },
147
+ { name: 'lendOffer', isMut: true, isSigner: false },
148
+ ],
149
+ args: [{ name: 'offerId', type: 'string' }],
150
+ },
151
+ {
152
+ name: 'createLoanOffer',
153
+ accounts: [
154
+ { name: 'borrower', isMut: true, isSigner: true },
155
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
156
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
157
+ { name: 'borrowerAtaAsset', isMut: true, isSigner: false },
158
+ { name: 'lendAsset', isMut: false, isSigner: false },
159
+ { name: 'collateralAsset', isMut: false, isSigner: false },
160
+ { name: 'loanOffer', isMut: true, isSigner: false },
161
+ { name: 'lendOffer', isMut: true, isSigner: false },
162
+ { name: 'vaultAuthority', isMut: true, isSigner: false },
163
+ { name: 'vault', isMut: true, isSigner: false },
164
+ { name: 'lender', isMut: false, isSigner: false },
165
+ { name: 'lendPriceFeedAccount', isMut: false, isSigner: false },
166
+ { name: 'collateralPriceFeedAccount', isMut: false, isSigner: false },
167
+ { name: 'settingAccount', isMut: false, isSigner: false },
168
+ { name: 'associatedTokenProgram', isMut: false, isSigner: false },
169
+ { name: 'tokenProgram', isMut: false, isSigner: false },
170
+ { name: 'systemProgram', isMut: false, isSigner: false },
171
+ ],
172
+ args: [
173
+ { name: 'offerId', type: 'string' },
174
+ { name: 'lendOfferId', type: 'string' },
175
+ { name: 'tierId', type: 'string' },
176
+ { name: 'collateralAmount', type: 'u64' },
177
+ { name: 'interest', type: 'f64' },
178
+ ],
179
+ },
180
+ {
181
+ name: 'createLoanOfferNative',
182
+ accounts: [
183
+ { name: 'borrower', isMut: true, isSigner: true },
184
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
185
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
186
+ { name: 'lendAsset', isMut: false, isSigner: false },
187
+ { name: 'collateralAsset', isMut: false, isSigner: false },
188
+ { name: 'loanOffer', isMut: true, isSigner: false },
189
+ { name: 'lender', isMut: false, isSigner: false },
190
+ { name: 'lendOffer', isMut: true, isSigner: false },
191
+ { name: 'lendPriceFeedAccount', isMut: false, isSigner: false },
192
+ { name: 'collateralPriceFeedAccount', isMut: false, isSigner: false },
193
+ { name: 'settingAccount', isMut: false, isSigner: false },
194
+ { name: 'tokenProgram', isMut: false, isSigner: false },
195
+ { name: 'systemProgram', isMut: false, isSigner: false },
196
+ ],
197
+ args: [
198
+ { name: 'offerId', type: 'string' },
199
+ { name: 'lendOfferId', type: 'string' },
200
+ { name: 'tierId', type: 'string' },
201
+ { name: 'collateralAmount', type: 'u64' },
202
+ { name: 'interest', type: 'f64' },
203
+ ],
204
+ },
205
+ {
206
+ name: 'systemUpdateLoanOffer',
207
+ accounts: [
208
+ { name: 'borrower', isMut: false, isSigner: false },
209
+ { name: 'borrowerAtaAsset', isMut: true, isSigner: false },
210
+ { name: 'mintAsset', isMut: false, isSigner: false },
211
+ { name: 'loanOffer', isMut: true, isSigner: false },
212
+ { name: 'system', isMut: true, isSigner: true },
213
+ { name: 'systemAta', isMut: true, isSigner: false },
214
+ { name: 'tokenProgram', isMut: false, isSigner: false },
215
+ ],
216
+ args: [
217
+ { name: 'offerId', type: 'string' },
218
+ { name: 'tierId', type: 'string' },
219
+ { name: 'borrowAmount', type: 'u64' },
220
+ ],
221
+ },
222
+ {
223
+ name: 'depositCollateralLoanOfferNative',
224
+ accounts: [
225
+ { name: 'borrower', isMut: true, isSigner: true },
226
+ { name: 'loanOffer', isMut: true, isSigner: false },
227
+ { name: 'systemProgram', isMut: false, isSigner: false },
228
+ ],
229
+ args: [
230
+ { name: 'offerId', type: 'string' },
231
+ { name: 'tierId', type: 'string' },
232
+ { name: 'amount', type: 'u64' },
233
+ ],
234
+ },
235
+ {
236
+ name: 'depositCollateralLoanOffer',
237
+ accounts: [
238
+ { name: 'borrower', isMut: true, isSigner: true },
239
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
240
+ { name: 'borrowerAtaAsset', isMut: true, isSigner: false },
241
+ { name: 'loanOffer', isMut: true, isSigner: false },
242
+ { name: 'vaultAuthority', isMut: false, isSigner: false },
243
+ { name: 'vault', isMut: true, isSigner: false },
244
+ { name: 'tokenProgram', isMut: false, isSigner: false },
245
+ ],
246
+ args: [
247
+ { name: 'offerId', type: 'string' },
248
+ { name: 'tierId', type: 'string' },
249
+ { name: 'amount', type: 'u64' },
250
+ ],
251
+ },
252
+ {
253
+ name: 'repayLoanOfferNative',
254
+ accounts: [
255
+ { name: 'borrower', isMut: true, isSigner: true },
256
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
257
+ { name: 'borrowerAtaLendAsset', isMut: true, isSigner: false },
258
+ { name: 'loanOffer', isMut: true, isSigner: false },
259
+ { name: 'hotWalletAtaLendAsset', isMut: true, isSigner: false },
260
+ { name: 'tokenProgram', isMut: false, isSigner: false },
261
+ { name: 'systemProgram', isMut: false, isSigner: false },
262
+ ],
263
+ args: [{ name: 'loanOfferId', type: 'string' }],
264
+ },
265
+ {
266
+ name: 'repayLoanOffer',
267
+ accounts: [
268
+ { name: 'borrower', isMut: true, isSigner: true },
269
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
270
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
271
+ { name: 'borrowerAtaLendAsset', isMut: true, isSigner: false },
272
+ { name: 'borrowerAtaCollateralAsset', isMut: true, isSigner: false },
273
+ { name: 'loanOffer', isMut: true, isSigner: false },
274
+ { name: 'vaultAuthority', isMut: true, isSigner: false },
275
+ { name: 'vault', isMut: true, isSigner: false },
276
+ { name: 'hotWalletAtaLendAsset', isMut: true, isSigner: false },
277
+ { name: 'tokenProgram', isMut: false, isSigner: false },
278
+ ],
279
+ args: [{ name: 'loanOfferId', type: 'string' }],
280
+ },
281
+ {
282
+ name: 'withdrawCollateralLoanOfferNative',
283
+ accounts: [
284
+ { name: 'borrower', isMut: true, isSigner: true },
285
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
286
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
287
+ { name: 'lendAsset', isMut: false, isSigner: false },
288
+ { name: 'collateralAsset', isMut: false, isSigner: false },
289
+ { name: 'loanOffer', isMut: true, isSigner: false },
290
+ { name: 'lendPriceFeedAccount', isMut: false, isSigner: false },
291
+ { name: 'collateralPriceFeedAccount', isMut: false, isSigner: false },
292
+ ],
293
+ args: [
294
+ { name: 'loanOfferId', type: 'string' },
295
+ { name: 'withdrawAmount', type: 'u64' },
296
+ ],
297
+ },
298
+ {
299
+ name: 'withdrawCollateralLoanOffer',
300
+ accounts: [
301
+ { name: 'borrower', isMut: true, isSigner: true },
302
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
303
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
304
+ { name: 'lendAsset', isMut: false, isSigner: false },
305
+ { name: 'collateralAsset', isMut: false, isSigner: false },
306
+ { name: 'borrowerAtaCollateralAsset', isMut: true, isSigner: false },
307
+ { name: 'loanOffer', isMut: true, isSigner: false },
308
+ { name: 'vaultAuthority', isMut: true, isSigner: false },
309
+ { name: 'vault', isMut: true, isSigner: false },
310
+ { name: 'lendPriceFeedAccount', isMut: false, isSigner: false },
311
+ { name: 'collateralPriceFeedAccount', isMut: false, isSigner: false },
312
+ { name: 'tokenProgram', isMut: false, isSigner: false },
313
+ ],
314
+ args: [
315
+ { name: 'loanOfferId', type: 'string' },
316
+ { name: 'withdrawAmount', type: 'u64' },
317
+ ],
318
+ },
319
+ {
320
+ name: 'startLiquidateLoanOfferNativeHealth',
321
+ accounts: [
322
+ { name: 'system', isMut: true, isSigner: true },
323
+ { name: 'borrower', isMut: false, isSigner: false },
324
+ { name: 'loanOffer', isMut: true, isSigner: false },
325
+ { name: 'hotWallet', isMut: true, isSigner: false },
326
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
327
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
328
+ { name: 'lendAsset', isMut: false, isSigner: false },
329
+ { name: 'collateralAsset', isMut: false, isSigner: false },
330
+ { name: 'lendPriceFeedAccount', isMut: false, isSigner: false },
331
+ { name: 'collateralPriceFeedAccount', isMut: false, isSigner: false },
332
+ ],
333
+ args: [{ name: 'offerId', type: 'string' }],
334
+ },
335
+ {
336
+ name: 'startLiquidateLoanOfferHealth',
337
+ accounts: [
338
+ { name: 'system', isMut: true, isSigner: true },
339
+ { name: 'borrower', isMut: false, isSigner: false },
340
+ { name: 'loanOffer', isMut: true, isSigner: false },
341
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
342
+ { name: 'lendMintAsset', isMut: false, isSigner: false },
343
+ { name: 'lendAsset', isMut: false, isSigner: false },
344
+ { name: 'collateralAsset', isMut: false, isSigner: false },
345
+ { name: 'lendPriceFeedAccount', isMut: false, isSigner: false },
346
+ { name: 'collateralPriceFeedAccount', isMut: false, isSigner: false },
347
+ { name: 'hotWalletAtaCollateralAsset', isMut: true, isSigner: false },
348
+ { name: 'vaultAuthority', isMut: true, isSigner: false },
349
+ { name: 'vault', isMut: true, isSigner: false },
350
+ { name: 'tokenProgram', isMut: false, isSigner: false },
351
+ ],
352
+ args: [{ name: 'offerId', type: 'string' }],
353
+ },
354
+ {
355
+ name: 'startLiquidateLoanOfferNativeExpired',
356
+ accounts: [
357
+ { name: 'system', isMut: true, isSigner: true },
358
+ { name: 'borrower', isMut: false, isSigner: false },
359
+ { name: 'loanOffer', isMut: true, isSigner: false },
360
+ { name: 'hotWallet', isMut: true, isSigner: false },
361
+ ],
362
+ args: [{ name: 'offerId', type: 'string' }],
363
+ },
364
+ {
365
+ name: 'startLiquidateLoanOfferExpired',
366
+ accounts: [
367
+ { name: 'system', isMut: true, isSigner: true },
368
+ { name: 'borrower', isMut: false, isSigner: false },
369
+ { name: 'collateralMintAsset', isMut: false, isSigner: false },
370
+ { name: 'loanOffer', isMut: true, isSigner: false },
371
+ { name: 'hotWalletAtaCollateralAsset', isMut: true, isSigner: false },
372
+ { name: 'vaultAuthority', isMut: true, isSigner: false },
373
+ { name: 'vault', isMut: true, isSigner: false },
374
+ { name: 'tokenProgram', isMut: false, isSigner: false },
375
+ ],
376
+ args: [{ name: 'offerId', type: 'string' }],
377
+ },
378
+ {
379
+ name: 'finishLiquidateContract',
380
+ accounts: [
381
+ { name: 'system', isMut: true, isSigner: true },
382
+ { name: 'systemAta', isMut: true, isSigner: false },
383
+ { name: 'mintAsset', isMut: false, isSigner: false },
384
+ { name: 'borrower', isMut: false, isSigner: false },
385
+ { name: 'borrowerAtaAsset', isMut: true, isSigner: false },
386
+ { name: 'loanOffer', isMut: true, isSigner: false },
387
+ { name: 'tokenProgram', isMut: false, isSigner: false },
388
+ ],
389
+ args: [
390
+ { name: 'loanOfferId', type: 'string' },
391
+ { name: 'collateralSwappedAmount', type: 'u64' },
392
+ { name: 'liquidatedPrice', type: 'u64' },
393
+ { name: 'liquidatedTx', type: 'string' },
394
+ ],
395
+ },
396
+ {
397
+ name: 'systemFinishLoanOffer',
398
+ accounts: [
399
+ { name: 'system', isMut: true, isSigner: true },
400
+ { name: 'systemAta', isMut: true, isSigner: false },
401
+ { name: 'mintAsset', isMut: false, isSigner: false },
402
+ { name: 'lender', isMut: false, isSigner: false },
403
+ { name: 'lenderAtaAsset', isMut: true, isSigner: false },
404
+ { name: 'borrower', isMut: true, isSigner: false },
405
+ { name: 'loanOffer', isMut: true, isSigner: false },
406
+ { name: 'tokenProgram', isMut: false, isSigner: false },
407
+ { name: 'systemProgram', isMut: false, isSigner: false },
408
+ ],
409
+ args: [
410
+ { name: 'loanOfferId', type: 'string' },
411
+ { name: 'loanAmount', type: 'u64' },
412
+ { name: 'interestAmount', type: 'u64' },
413
+ ],
414
+ },
415
+ {
416
+ name: 'systemRevertStatus',
417
+ accounts: [
418
+ { name: 'system', isMut: true, isSigner: true },
419
+ { name: 'borrower', isMut: false, isSigner: false },
420
+ { name: 'loanOffer', isMut: true, isSigner: false },
421
+ ],
422
+ args: [{ name: 'offerId', type: 'string' }],
423
+ },
424
+ {
425
+ name: 'closeLendOffer',
426
+ accounts: [
427
+ { name: 'signer', isMut: true, isSigner: true },
428
+ { name: 'lender', isMut: false, isSigner: false },
429
+ { name: 'lendOffer', isMut: true, isSigner: false },
430
+ { name: 'systemProgram', isMut: false, isSigner: false },
431
+ ],
432
+ args: [{ name: 'offerId', type: 'string' }],
433
+ },
434
+ ],
435
+ accounts: [
436
+ {
437
+ name: 'Asset',
438
+ type: {
439
+ kind: 'struct',
440
+ fields: [
441
+ { name: 'tokenMint', type: 'publicKey' },
442
+ { name: 'maxPriceAgeSeconds', type: 'u64' },
443
+ { name: 'decimals', type: 'u8' },
444
+ { name: 'isCollateral', type: 'bool' },
445
+ { name: 'isLend', type: 'bool' },
446
+ { name: 'priceFeedId', type: 'string' },
447
+ { name: 'priceFeedAccount', type: 'publicKey' },
448
+ { name: 'bump', type: 'u8' },
449
+ { name: 'name', type: 'string' },
450
+ ],
451
+ },
452
+ },
453
+ {
454
+ name: 'LendOfferAccount',
455
+ type: {
456
+ kind: 'struct',
457
+ fields: [
458
+ { name: 'interest', type: 'f64' },
459
+ { name: 'lenderFeePercent', type: 'f64' },
460
+ { name: 'duration', type: 'u64' },
461
+ { name: 'offerId', type: 'string' },
462
+ { name: 'lender', type: 'publicKey' },
463
+ { name: 'lendMintToken', type: 'publicKey' },
464
+ { name: 'amount', type: 'u64' },
465
+ { name: 'bump', type: 'u8' },
466
+ { name: 'status', type: { defined: 'LendOfferStatus' } },
467
+ ],
468
+ },
469
+ },
470
+ {
471
+ name: 'LoanOfferAccount',
472
+ type: {
473
+ kind: 'struct',
474
+ fields: [
475
+ { name: 'tierId', type: 'string' },
476
+ { name: 'lendOfferId', type: 'string' },
477
+ { name: 'interest', type: 'f64' },
478
+ { name: 'borrowAmount', type: 'u64' },
479
+ { name: 'lenderFeePercent', type: 'f64' },
480
+ { name: 'duration', type: 'u64' },
481
+ { name: 'lendMintToken', type: 'publicKey' },
482
+ { name: 'lender', type: 'publicKey' },
483
+ { name: 'offerId', type: 'string' },
484
+ { name: 'borrower', type: 'publicKey' },
485
+ { name: 'collateralMintToken', type: 'publicKey' },
486
+ { name: 'collateralAmount', type: 'u64' },
487
+ { name: 'requestWithdrawAmount', type: { option: 'u64' } },
488
+ { name: 'status', type: { defined: 'LoanOfferStatus' } },
489
+ { name: 'borrowerFeePercent', type: 'f64' },
490
+ { name: 'startedAt', type: 'i64' },
491
+ { name: 'liquidatingAt', type: { option: 'i64' } },
492
+ { name: 'liquidatingPrice', type: { option: 'f64' } },
493
+ { name: 'liquidatedTx', type: { option: 'string' } },
494
+ { name: 'liquidatedPrice', type: { option: 'u64' } },
495
+ { name: 'bump', type: 'u8' },
496
+ ],
497
+ },
498
+ },
499
+ {
500
+ name: 'SettingAccount',
501
+ type: {
502
+ kind: 'struct',
503
+ fields: [
504
+ { name: 'amount', type: 'u64' },
505
+ { name: 'duration', type: 'u64' },
506
+ { name: 'owner', type: 'publicKey' },
507
+ { name: 'receiver', type: 'publicKey' },
508
+ { name: 'lendMintAsset', type: 'publicKey' },
509
+ { name: 'collateralMintAsset', type: 'publicKey' },
510
+ { name: 'tierId', type: 'string' },
511
+ { name: 'lenderFeePercent', type: 'f64' },
512
+ { name: 'borrowerFeePercent', type: 'f64' },
513
+ { name: 'lendPriceFeed', type: 'publicKey' },
514
+ { name: 'collateralPriceFeed', type: 'publicKey' },
515
+ { name: 'bump', type: 'u8' },
516
+ ],
517
+ },
518
+ },
519
+ {
520
+ name: 'VaultAuthority',
521
+ type: {
522
+ kind: 'struct',
523
+ fields: [
524
+ { name: 'initializer', type: 'publicKey' },
525
+ { name: 'bump', type: 'u8' },
526
+ ],
527
+ },
528
+ },
529
+ ],
530
+ types: [
531
+ {
532
+ name: 'LendOfferStatus',
533
+ type: {
534
+ kind: 'enum',
535
+ variants: [
536
+ { name: 'Created' },
537
+ { name: 'Canceling' },
538
+ { name: 'Canceled' },
539
+ { name: 'Loaned' },
540
+ ],
541
+ },
542
+ },
543
+ {
544
+ name: 'LoanOfferStatus',
545
+ type: {
546
+ kind: 'enum',
547
+ variants: [
548
+ { name: 'Matched' },
549
+ { name: 'FundTransferred' },
550
+ { name: 'Repay' },
551
+ { name: 'BorrowerPaid' },
552
+ { name: 'Liquidating' },
553
+ { name: 'Liquidated' },
554
+ { name: 'Finished' },
555
+ ],
556
+ },
557
+ },
558
+ {
559
+ name: 'LendOfferError',
560
+ type: {
561
+ kind: 'enum',
562
+ variants: [
563
+ { name: 'InvalidLendAmount' },
564
+ { name: 'NotEnoughAmount' },
565
+ { name: 'InvalidMintAsset' },
566
+ { name: 'InterestGreaterThanZero' },
567
+ { name: 'InvalidLender' },
568
+ { name: 'InvalidOfferStatus' },
569
+ { name: 'InvalidOfferId' },
570
+ { name: 'InvalidReceiver' },
571
+ { name: 'InterestOverLimit' },
572
+ { name: 'InvalidSigner' },
573
+ ],
574
+ },
575
+ },
576
+ {
577
+ name: 'LoanOfferError',
578
+ type: {
579
+ kind: 'enum',
580
+ variants: [
581
+ { name: 'InvalidReceiver' },
582
+ { name: 'CanNotDepositCollateralToContractThatNotAvailable' },
583
+ { name: 'CanNotTakeALoanBecauseHealthRatioIsNotValid' },
584
+ { name: 'InvalidPriceFeedAccountForCollateralAsset' },
585
+ { name: 'InvalidPriceFeedAccountForLendAsset' },
586
+ { name: 'NotEnoughAmount' },
587
+ { name: 'InvalidCollateralMintAsset' },
588
+ { name: 'InvalidLendMintAsset' },
589
+ { name: 'InvalidOfferStatus' },
590
+ { name: 'LendOfferIsNotAvailable' },
591
+ { name: 'HealthRatioLimit' },
592
+ { name: 'LoanOfferExpired' },
593
+ { name: 'LoanOfferNotExpired' },
594
+ { name: 'InvalidHotWallet' },
595
+ { name: 'InvalidSystem' },
596
+ { name: 'InvalidBorrower' },
597
+ { name: 'InvalidLoanOffer' },
598
+ { name: 'InvalidBorrowAmount' },
599
+ { name: 'NotAvailableToWithdraw' },
600
+ { name: 'HealthRatioInvalid' },
601
+ { name: 'CanNotCreateLoanCauseLendInterestUpdated' },
602
+ { name: 'InvalidPriceFeedAccount' },
603
+ { name: 'InvalidAssetAccount' },
604
+ { name: 'NotEnoughCollateral' },
605
+ { name: 'InvalidInitializerVaultAuthority' },
606
+ ],
607
+ },
608
+ },
609
+ {
610
+ name: 'RepayOfferError',
611
+ type: {
612
+ kind: 'enum',
613
+ variants: [
614
+ { name: 'InvalidMintAsset' },
615
+ { name: 'NotEnoughAmount' },
616
+ { name: 'LoanOfferIsNotAvailable' },
617
+ { name: 'InvalidLendAmount' },
618
+ { name: 'InvalidBorrower' },
619
+ { name: 'InvalidCollateralAmount' },
620
+ { name: 'InvalidOfferStatus' },
621
+ { name: 'InvalidLender' },
622
+ { name: 'TimeUnmetException' },
623
+ ],
624
+ },
625
+ },
626
+ {
627
+ name: 'LiquidateOfferError',
628
+ type: {
629
+ kind: 'enum',
630
+ variants: [
631
+ { name: 'InvalidLender' },
632
+ { name: 'InvalidBorrower' },
633
+ { name: 'InvalidOfferStatus' },
634
+ { name: 'InvalidLendAmount' },
635
+ { name: 'NotEnoughAmount' },
636
+ { name: 'InvalidMintAsset' },
637
+ { name: 'InvalidSystem' },
638
+ ],
639
+ },
640
+ },
641
+ ],
642
+ events: [
643
+ {
644
+ name: 'InitSettingAccountEvent',
645
+ fields: [
646
+ { name: 'amount', type: 'u64', index: false },
647
+ { name: 'duration', type: 'u64', index: false },
648
+ { name: 'owner', type: 'publicKey', index: false },
649
+ { name: 'receiver', type: 'publicKey', index: false },
650
+ { name: 'tierId', type: 'string', index: false },
651
+ { name: 'lenderFeePercent', type: 'f64', index: false },
652
+ { name: 'borrowerFeePercent', type: 'f64', index: false },
653
+ ],
654
+ },
655
+ {
656
+ name: 'EditSettingAccountEvent',
657
+ fields: [
658
+ { name: 'receiver', type: 'publicKey', index: false },
659
+ { name: 'tierId', type: 'string', index: false },
660
+ { name: 'amount', type: 'u64', index: false },
661
+ { name: 'duration', type: 'u64', index: false },
662
+ { name: 'lenderFeePercent', type: 'f64', index: false },
663
+ ],
664
+ },
665
+ {
666
+ name: 'CloseSettingAccountEvent',
667
+ fields: [{ name: 'tierId', type: 'string', index: false }],
668
+ },
669
+ {
670
+ name: 'InitAssetEvent',
671
+ fields: [
672
+ { name: 'tokenMint', type: 'publicKey', index: false },
673
+ { name: 'maxPriceAgeSeconds', type: 'u64', index: false },
674
+ { name: 'decimals', type: 'u8', index: false },
675
+ { name: 'isCollateral', type: 'bool', index: false },
676
+ { name: 'isLend', type: 'bool', index: false },
677
+ { name: 'priceFeedId', type: 'string', index: false },
678
+ { name: 'priceFeedAccount', type: 'publicKey', index: false },
679
+ { name: 'bump', type: 'u8', index: false },
680
+ { name: 'name', type: 'string', index: false },
681
+ ],
682
+ },
683
+ {
684
+ name: 'EditAssetEvent',
685
+ fields: [
686
+ { name: 'tokenMint', type: 'publicKey', index: false },
687
+ { name: 'maxPriceAgeSeconds', type: 'u64', index: false },
688
+ { name: 'decimals', type: 'u8', index: false },
689
+ { name: 'isCollateral', type: 'bool', index: false },
690
+ { name: 'isLend', type: 'bool', index: false },
691
+ { name: 'priceFeedId', type: 'string', index: false },
692
+ { name: 'priceFeedAccount', type: 'publicKey', index: false },
693
+ { name: 'bump', type: 'u8', index: false },
694
+ { name: 'name', type: 'string', index: false },
695
+ ],
696
+ },
697
+ {
698
+ name: 'CreateLendOfferEvent',
699
+ fields: [
700
+ { name: 'lender', type: 'publicKey', index: false },
701
+ { name: 'interest', type: 'f64', index: false },
702
+ { name: 'lenderFeePercent', type: 'f64', index: false },
703
+ { name: 'duration', type: 'u64', index: false },
704
+ { name: 'amount', type: 'u64', index: false },
705
+ { name: 'offerId', type: 'string', index: false },
706
+ { name: 'tierId', type: 'string', index: false },
707
+ ],
708
+ },
709
+ {
710
+ name: 'EditLendOfferEvent',
711
+ fields: [
712
+ { name: 'lender', type: 'publicKey', index: false },
713
+ { name: 'interest', type: 'f64', index: false },
714
+ { name: 'lenderFeePercent', type: 'f64', index: false },
715
+ { name: 'duration', type: 'u64', index: false },
716
+ { name: 'amount', type: 'u64', index: false },
717
+ { name: 'offerId', type: 'string', index: false },
718
+ ],
719
+ },
720
+ {
721
+ name: 'LendOfferCancelRequestEvent',
722
+ fields: [
723
+ { name: 'lender', type: 'publicKey', index: false },
724
+ { name: 'interest', type: 'f64', index: false },
725
+ { name: 'lenderFeePercent', type: 'f64', index: false },
726
+ { name: 'duration', type: 'u64', index: false },
727
+ { name: 'amount', type: 'u64', index: false },
728
+ { name: 'offerId', type: 'string', index: false },
729
+ ],
730
+ },
731
+ {
732
+ name: 'LendOfferCanceledEvent',
733
+ fields: [
734
+ { name: 'lender', type: 'publicKey', index: false },
735
+ { name: 'interest', type: 'f64', index: false },
736
+ { name: 'lenderFeePercent', type: 'f64', index: false },
737
+ { name: 'duration', type: 'u64', index: false },
738
+ { name: 'amount', type: 'u64', index: false },
739
+ { name: 'offerId', type: 'string', index: false },
740
+ ],
741
+ },
742
+ {
743
+ name: 'LoanOfferCreateRequestEvent',
744
+ fields: [
745
+ { name: 'tierId', type: 'string', index: false },
746
+ { name: 'lendOfferId', type: 'string', index: false },
747
+ { name: 'interest', type: 'f64', index: false },
748
+ { name: 'borrowAmount', type: 'u64', index: false },
749
+ { name: 'lenderFeePercent', type: 'f64', index: false },
750
+ { name: 'duration', type: 'u64', index: false },
751
+ { name: 'lendMintToken', type: 'publicKey', index: false },
752
+ { name: 'lender', type: 'publicKey', index: false },
753
+ { name: 'offerId', type: 'string', index: false },
754
+ { name: 'borrower', type: 'publicKey', index: false },
755
+ { name: 'collateralMintToken', type: 'publicKey', index: false },
756
+ { name: 'collateralAmount', type: 'u64', index: false },
757
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
758
+ { name: 'borrowerFeePercent', type: 'f64', index: false },
759
+ { name: 'startedAt', type: 'i64', index: false },
760
+ ],
761
+ },
762
+ {
763
+ name: 'LoanOfferUpdateEvent',
764
+ fields: [
765
+ { name: 'tierId', type: 'string', index: false },
766
+ { name: 'lendOfferId', type: 'string', index: false },
767
+ { name: 'interest', type: 'f64', index: false },
768
+ { name: 'borrowAmount', type: 'u64', index: false },
769
+ { name: 'lenderFeePercent', type: 'f64', index: false },
770
+ { name: 'duration', type: 'u64', index: false },
771
+ { name: 'lendMintToken', type: 'publicKey', index: false },
772
+ { name: 'lender', type: 'publicKey', index: false },
773
+ { name: 'offerId', type: 'string', index: false },
774
+ { name: 'borrower', type: 'publicKey', index: false },
775
+ { name: 'collateralMintToken', type: 'publicKey', index: false },
776
+ { name: 'collateralAmount', type: 'u64', index: false },
777
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
778
+ { name: 'borrowerFeePercent', type: 'f64', index: false },
779
+ { name: 'startedAt', type: 'i64', index: false },
780
+ ],
781
+ },
782
+ {
783
+ name: 'WithdrawCollateralEvent',
784
+ fields: [
785
+ { name: 'borrower', type: 'publicKey', index: false },
786
+ { name: 'withdrawAmount', type: 'u64', index: false },
787
+ { name: 'loanOfferId', type: 'string', index: false },
788
+ { name: 'collateralAmount', type: 'u64', index: false },
789
+ ],
790
+ },
791
+ {
792
+ name: 'UnhealthyRatioDetectedEvent',
793
+ fields: [
794
+ { name: 'borrower', type: 'publicKey', index: false },
795
+ { name: 'withdrawAmount', type: 'u64', index: false },
796
+ { name: 'loanOfferId', type: 'string', index: false },
797
+ { name: 'collateralAmount', type: 'u64', index: false },
798
+ ],
799
+ },
800
+ {
801
+ name: 'LoanOfferExpiredEvent',
802
+ fields: [
803
+ { name: 'borrower', type: 'publicKey', index: false },
804
+ { name: 'withdrawAmount', type: 'u64', index: false },
805
+ { name: 'loanOfferId', type: 'string', index: false },
806
+ { name: 'collateralAmount', type: 'u64', index: false },
807
+ ],
808
+ },
809
+ {
810
+ name: 'DepositCollateralLoanOfferEvent',
811
+ fields: [
812
+ { name: 'tierId', type: 'string', index: false },
813
+ { name: 'lendOfferId', type: 'string', index: false },
814
+ { name: 'interest', type: 'f64', index: false },
815
+ { name: 'borrowAmount', type: 'u64', index: false },
816
+ { name: 'lenderFeePercent', type: 'f64', index: false },
817
+ { name: 'duration', type: 'u64', index: false },
818
+ { name: 'lendMintToken', type: 'publicKey', index: false },
819
+ { name: 'lender', type: 'publicKey', index: false },
820
+ { name: 'offerId', type: 'string', index: false },
821
+ { name: 'borrower', type: 'publicKey', index: false },
822
+ { name: 'collateralMintToken', type: 'publicKey', index: false },
823
+ { name: 'collateralAmount', type: 'u64', index: false },
824
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
825
+ { name: 'borrowerFeePercent', type: 'f64', index: false },
826
+ { name: 'startedAt', type: 'i64', index: false },
827
+ ],
828
+ },
829
+ {
830
+ name: 'RepayLoanOfferEvent',
831
+ fields: [
832
+ { name: 'borrower', type: 'publicKey', index: false },
833
+ { name: 'loanOfferId', type: 'string', index: false },
834
+ { name: 'repayAmount', type: 'u64', index: false },
835
+ { name: 'borrowerFeePercent', type: 'f64', index: false },
836
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
837
+ ],
838
+ },
839
+ {
840
+ name: 'LiquidatingCollateralEvent',
841
+ fields: [
842
+ { name: 'offerId', type: 'string', index: false },
843
+ { name: 'liquidatingPrice', type: { option: 'f64' }, index: false },
844
+ { name: 'liquidatingAt', type: { option: 'i64' }, index: false },
845
+ ],
846
+ },
847
+ {
848
+ name: 'LiquidatedCollateralEvent',
849
+ fields: [
850
+ { name: 'loanOfferId', type: 'string', index: false },
851
+ { name: 'liquidatedPrice', type: 'u64', index: false },
852
+ { name: 'liquidatedTx', type: 'string', index: false },
853
+ { name: 'system', type: 'publicKey', index: false },
854
+ { name: 'lender', type: 'publicKey', index: false },
855
+ { name: 'borrower', type: 'publicKey', index: false },
856
+ { name: 'remainingFundToBorrower', type: 'u64', index: false },
857
+ { name: 'collateralSwappedAmount', type: 'u64', index: false },
858
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
859
+ ],
860
+ },
861
+ {
862
+ name: 'SystemRepayLoanOfferEvent',
863
+ fields: [
864
+ { name: 'lender', type: 'publicKey', index: false },
865
+ { name: 'borrower', type: 'publicKey', index: false },
866
+ { name: 'interest', type: 'f64', index: false },
867
+ { name: 'loanAmount', type: 'u64', index: false },
868
+ { name: 'collateralAmount', type: 'u64', index: false },
869
+ { name: 'loanOfferId', type: 'string', index: false },
870
+ { name: 'tierId', type: 'string', index: false },
871
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
872
+ ],
873
+ },
874
+ {
875
+ name: 'SystemFinishLoanOfferEvent',
876
+ fields: [
877
+ { name: 'system', type: 'publicKey', index: false },
878
+ { name: 'lender', type: 'publicKey', index: false },
879
+ { name: 'borrower', type: 'publicKey', index: false },
880
+ { name: 'interest', type: 'f64', index: false },
881
+ { name: 'loanAmount', type: 'u64', index: false },
882
+ { name: 'loanOfferId', type: 'string', index: false },
883
+ { name: 'tierId', type: 'string', index: false },
884
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
885
+ ],
886
+ },
887
+ {
888
+ name: 'SystemRevertEvent',
889
+ fields: [
890
+ { name: 'offerId', type: 'string', index: false },
891
+ { name: 'status', type: { defined: 'LoanOfferStatus' }, index: false },
892
+ ],
893
+ },
894
+ ],
895
+ errors: [
896
+ { code: 6000, name: 'InvalidTierId', msg: 'Invalid tier id' },
897
+ { code: 6001, name: 'InvalidOwner', msg: 'Invalid owner account' },
898
+ ],
899
+ };
900
+ //# sourceMappingURL=idl.js.map