@jup-ag/lend 0.1.9 → 0.1.10-beta.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/dist/borrow/index.d.mts +8 -5
- package/dist/borrow/index.d.ts +8 -5
- package/dist/borrow/index.mjs +4 -5
- package/dist/earn/index.d.mts +25 -15
- package/dist/earn/index.d.ts +25 -15
- package/dist/earn/index.mjs +2247 -84
- package/dist/flashloan/index.d.mts +11 -7
- package/dist/flashloan/index.d.ts +11 -7
- package/dist/flashloan/index.mjs +759 -31
- package/dist/index.d.mts +39 -36
- package/dist/index.d.ts +39 -36
- package/dist/index.mjs +5 -6
- package/dist/refinance/index.d.mts +1 -1
- package/dist/refinance/index.d.ts +1 -1
- package/dist/refinance/index.mjs +4 -5
- package/dist/shared/lend.0Rjy1SRf.mjs +70 -0
- package/dist/shared/{lend.B1GEdPEJ.d.mts → lend.34CmCyWr.d.mts} +10 -7
- package/dist/shared/{lend.B1GEdPEJ.d.ts → lend.34CmCyWr.d.ts} +10 -7
- package/dist/shared/lend.BKZOr4CM.mjs +67 -0
- package/dist/shared/{lend.BzG5ldOV.mjs → lend.BjhqzIWk.mjs} +17 -16
- package/dist/shared/lend.COO39gwN.mjs +7900 -0
- package/dist/shared/lend.tU-yHdcH.mjs +204 -0
- package/package.json +1 -1
- package/dist/shared/lend.BaZsInAi.mjs +0 -3020
- package/dist/shared/lend.CioR9-te.mjs +0 -5
- package/dist/shared/lend.Cr2l14_0.mjs +0 -741
- package/dist/shared/lend.Cw-khlBI.mjs +0 -5014
- package/dist/shared/lend.DS0KoPpL.mjs +0 -2175
|
@@ -1,741 +0,0 @@
|
|
|
1
|
-
import { PublicKey } from '@solana/web3.js';
|
|
2
|
-
import { a as address$1 } from './lend.CioR9-te.mjs';
|
|
3
|
-
|
|
4
|
-
const address = "jupgfSgfuAXv4B6R2Uxu85Z1qdzgju79s6MfZekN6XS";
|
|
5
|
-
const metadata = {
|
|
6
|
-
name: "flashloan",
|
|
7
|
-
version: "0.1.0",
|
|
8
|
-
spec: "0.1.0",
|
|
9
|
-
description: "Created with Anchor"
|
|
10
|
-
};
|
|
11
|
-
const instructions = [
|
|
12
|
-
{
|
|
13
|
-
name: "activate_protocol",
|
|
14
|
-
discriminator: [
|
|
15
|
-
230,
|
|
16
|
-
235,
|
|
17
|
-
188,
|
|
18
|
-
19,
|
|
19
|
-
120,
|
|
20
|
-
91,
|
|
21
|
-
11,
|
|
22
|
-
94
|
|
23
|
-
],
|
|
24
|
-
accounts: [
|
|
25
|
-
{
|
|
26
|
-
name: "authority",
|
|
27
|
-
signer: true
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "flashloan_admin",
|
|
31
|
-
writable: true
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
args: [
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "flashloan_borrow",
|
|
39
|
-
discriminator: [
|
|
40
|
-
103,
|
|
41
|
-
19,
|
|
42
|
-
78,
|
|
43
|
-
24,
|
|
44
|
-
240,
|
|
45
|
-
9,
|
|
46
|
-
135,
|
|
47
|
-
63
|
|
48
|
-
],
|
|
49
|
-
accounts: [
|
|
50
|
-
{
|
|
51
|
-
name: "signer",
|
|
52
|
-
writable: true,
|
|
53
|
-
signer: true
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: "flashloan_admin",
|
|
57
|
-
writable: true
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: "signer_borrow_token_account",
|
|
61
|
-
writable: true,
|
|
62
|
-
pda: {
|
|
63
|
-
seeds: [
|
|
64
|
-
{
|
|
65
|
-
kind: "account",
|
|
66
|
-
path: "signer"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
kind: "account",
|
|
70
|
-
path: "token_program"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
kind: "account",
|
|
74
|
-
path: "mint"
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
program: {
|
|
78
|
-
kind: "const",
|
|
79
|
-
value: [
|
|
80
|
-
140,
|
|
81
|
-
151,
|
|
82
|
-
37,
|
|
83
|
-
143,
|
|
84
|
-
78,
|
|
85
|
-
36,
|
|
86
|
-
137,
|
|
87
|
-
241,
|
|
88
|
-
187,
|
|
89
|
-
61,
|
|
90
|
-
16,
|
|
91
|
-
41,
|
|
92
|
-
20,
|
|
93
|
-
142,
|
|
94
|
-
13,
|
|
95
|
-
131,
|
|
96
|
-
11,
|
|
97
|
-
90,
|
|
98
|
-
19,
|
|
99
|
-
153,
|
|
100
|
-
218,
|
|
101
|
-
255,
|
|
102
|
-
16,
|
|
103
|
-
132,
|
|
104
|
-
4,
|
|
105
|
-
142,
|
|
106
|
-
123,
|
|
107
|
-
216,
|
|
108
|
-
219,
|
|
109
|
-
233,
|
|
110
|
-
248,
|
|
111
|
-
89
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "mint"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "flashloan_token_reserves_liquidity",
|
|
121
|
-
writable: true
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: "flashloan_borrow_position_on_liquidity",
|
|
125
|
-
writable: true
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: "rate_model"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
name: "vault",
|
|
132
|
-
writable: true
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "liquidity"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: "liquidity_program",
|
|
139
|
-
relations: [
|
|
140
|
-
"flashloan_admin"
|
|
141
|
-
]
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
name: "token_program"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "associated_token_program",
|
|
148
|
-
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: "system_program",
|
|
152
|
-
address: "11111111111111111111111111111111"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: "instruction_sysvar",
|
|
156
|
-
address: "Sysvar1nstructions1111111111111111111111111"
|
|
157
|
-
}
|
|
158
|
-
],
|
|
159
|
-
args: [
|
|
160
|
-
{
|
|
161
|
-
name: "amount",
|
|
162
|
-
type: "u64"
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: "flashloan_payback",
|
|
168
|
-
discriminator: [
|
|
169
|
-
213,
|
|
170
|
-
47,
|
|
171
|
-
153,
|
|
172
|
-
137,
|
|
173
|
-
84,
|
|
174
|
-
243,
|
|
175
|
-
94,
|
|
176
|
-
232
|
|
177
|
-
],
|
|
178
|
-
accounts: [
|
|
179
|
-
{
|
|
180
|
-
name: "signer",
|
|
181
|
-
writable: true,
|
|
182
|
-
signer: true
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: "flashloan_admin",
|
|
186
|
-
writable: true
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: "signer_borrow_token_account",
|
|
190
|
-
writable: true,
|
|
191
|
-
pda: {
|
|
192
|
-
seeds: [
|
|
193
|
-
{
|
|
194
|
-
kind: "account",
|
|
195
|
-
path: "signer"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
kind: "account",
|
|
199
|
-
path: "token_program"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
kind: "account",
|
|
203
|
-
path: "mint"
|
|
204
|
-
}
|
|
205
|
-
],
|
|
206
|
-
program: {
|
|
207
|
-
kind: "const",
|
|
208
|
-
value: [
|
|
209
|
-
140,
|
|
210
|
-
151,
|
|
211
|
-
37,
|
|
212
|
-
143,
|
|
213
|
-
78,
|
|
214
|
-
36,
|
|
215
|
-
137,
|
|
216
|
-
241,
|
|
217
|
-
187,
|
|
218
|
-
61,
|
|
219
|
-
16,
|
|
220
|
-
41,
|
|
221
|
-
20,
|
|
222
|
-
142,
|
|
223
|
-
13,
|
|
224
|
-
131,
|
|
225
|
-
11,
|
|
226
|
-
90,
|
|
227
|
-
19,
|
|
228
|
-
153,
|
|
229
|
-
218,
|
|
230
|
-
255,
|
|
231
|
-
16,
|
|
232
|
-
132,
|
|
233
|
-
4,
|
|
234
|
-
142,
|
|
235
|
-
123,
|
|
236
|
-
216,
|
|
237
|
-
219,
|
|
238
|
-
233,
|
|
239
|
-
248,
|
|
240
|
-
89
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
name: "mint"
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
name: "flashloan_token_reserves_liquidity",
|
|
250
|
-
writable: true
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
name: "flashloan_borrow_position_on_liquidity",
|
|
254
|
-
writable: true
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: "rate_model"
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: "vault",
|
|
261
|
-
writable: true
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
name: "liquidity"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: "liquidity_program",
|
|
268
|
-
relations: [
|
|
269
|
-
"flashloan_admin"
|
|
270
|
-
]
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
name: "token_program"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
name: "associated_token_program",
|
|
277
|
-
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
name: "system_program",
|
|
281
|
-
address: "11111111111111111111111111111111"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
name: "instruction_sysvar",
|
|
285
|
-
address: "Sysvar1nstructions1111111111111111111111111"
|
|
286
|
-
}
|
|
287
|
-
],
|
|
288
|
-
args: [
|
|
289
|
-
{
|
|
290
|
-
name: "amount",
|
|
291
|
-
type: "u64"
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
name: "init_flashloan_admin",
|
|
297
|
-
discriminator: [
|
|
298
|
-
185,
|
|
299
|
-
117,
|
|
300
|
-
154,
|
|
301
|
-
56,
|
|
302
|
-
95,
|
|
303
|
-
12,
|
|
304
|
-
187,
|
|
305
|
-
139
|
|
306
|
-
],
|
|
307
|
-
accounts: [
|
|
308
|
-
{
|
|
309
|
-
name: "signer",
|
|
310
|
-
writable: true,
|
|
311
|
-
signer: true
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
name: "flashloan_admin",
|
|
315
|
-
writable: true,
|
|
316
|
-
pda: {
|
|
317
|
-
seeds: [
|
|
318
|
-
{
|
|
319
|
-
kind: "const",
|
|
320
|
-
value: [
|
|
321
|
-
102,
|
|
322
|
-
108,
|
|
323
|
-
97,
|
|
324
|
-
115,
|
|
325
|
-
104,
|
|
326
|
-
108,
|
|
327
|
-
111,
|
|
328
|
-
97,
|
|
329
|
-
110,
|
|
330
|
-
95,
|
|
331
|
-
97,
|
|
332
|
-
100,
|
|
333
|
-
109,
|
|
334
|
-
105,
|
|
335
|
-
110
|
|
336
|
-
]
|
|
337
|
-
}
|
|
338
|
-
]
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
name: "system_program",
|
|
343
|
-
address: "11111111111111111111111111111111"
|
|
344
|
-
}
|
|
345
|
-
],
|
|
346
|
-
args: [
|
|
347
|
-
{
|
|
348
|
-
name: "authority",
|
|
349
|
-
type: "pubkey"
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
name: "flashloan_fee",
|
|
353
|
-
type: "u16"
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
name: "liquidity_program",
|
|
357
|
-
type: "pubkey"
|
|
358
|
-
}
|
|
359
|
-
]
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
name: "pause_protocol",
|
|
363
|
-
discriminator: [
|
|
364
|
-
144,
|
|
365
|
-
95,
|
|
366
|
-
0,
|
|
367
|
-
107,
|
|
368
|
-
119,
|
|
369
|
-
39,
|
|
370
|
-
248,
|
|
371
|
-
141
|
|
372
|
-
],
|
|
373
|
-
accounts: [
|
|
374
|
-
{
|
|
375
|
-
name: "authority",
|
|
376
|
-
signer: true
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
name: "flashloan_admin",
|
|
380
|
-
writable: true
|
|
381
|
-
}
|
|
382
|
-
],
|
|
383
|
-
args: [
|
|
384
|
-
]
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
name: "set_flashloan_fee",
|
|
388
|
-
discriminator: [
|
|
389
|
-
120,
|
|
390
|
-
248,
|
|
391
|
-
221,
|
|
392
|
-
70,
|
|
393
|
-
84,
|
|
394
|
-
216,
|
|
395
|
-
0,
|
|
396
|
-
149
|
|
397
|
-
],
|
|
398
|
-
accounts: [
|
|
399
|
-
{
|
|
400
|
-
name: "authority",
|
|
401
|
-
signer: true
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
name: "flashloan_admin",
|
|
405
|
-
writable: true
|
|
406
|
-
}
|
|
407
|
-
],
|
|
408
|
-
args: [
|
|
409
|
-
{
|
|
410
|
-
name: "flashloan_fee",
|
|
411
|
-
type: "u16"
|
|
412
|
-
}
|
|
413
|
-
]
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
name: "update_authority",
|
|
417
|
-
discriminator: [
|
|
418
|
-
32,
|
|
419
|
-
46,
|
|
420
|
-
64,
|
|
421
|
-
28,
|
|
422
|
-
149,
|
|
423
|
-
75,
|
|
424
|
-
243,
|
|
425
|
-
88
|
|
426
|
-
],
|
|
427
|
-
accounts: [
|
|
428
|
-
{
|
|
429
|
-
name: "authority",
|
|
430
|
-
signer: true
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
name: "flashloan_admin",
|
|
434
|
-
writable: true
|
|
435
|
-
}
|
|
436
|
-
],
|
|
437
|
-
args: [
|
|
438
|
-
{
|
|
439
|
-
name: "new_authority",
|
|
440
|
-
type: "pubkey"
|
|
441
|
-
}
|
|
442
|
-
]
|
|
443
|
-
}
|
|
444
|
-
];
|
|
445
|
-
const accounts = [
|
|
446
|
-
{
|
|
447
|
-
name: "FlashloanAdmin",
|
|
448
|
-
discriminator: [
|
|
449
|
-
162,
|
|
450
|
-
161,
|
|
451
|
-
45,
|
|
452
|
-
28,
|
|
453
|
-
131,
|
|
454
|
-
91,
|
|
455
|
-
202,
|
|
456
|
-
88
|
|
457
|
-
]
|
|
458
|
-
}
|
|
459
|
-
];
|
|
460
|
-
const events = [
|
|
461
|
-
{
|
|
462
|
-
name: "ActivateProtocol",
|
|
463
|
-
discriminator: [
|
|
464
|
-
70,
|
|
465
|
-
178,
|
|
466
|
-
173,
|
|
467
|
-
151,
|
|
468
|
-
180,
|
|
469
|
-
166,
|
|
470
|
-
68,
|
|
471
|
-
102
|
|
472
|
-
]
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
name: "LogUpdateAuthority",
|
|
476
|
-
discriminator: [
|
|
477
|
-
150,
|
|
478
|
-
152,
|
|
479
|
-
157,
|
|
480
|
-
143,
|
|
481
|
-
6,
|
|
482
|
-
135,
|
|
483
|
-
193,
|
|
484
|
-
101
|
|
485
|
-
]
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
name: "PauseProtocol",
|
|
489
|
-
discriminator: [
|
|
490
|
-
66,
|
|
491
|
-
229,
|
|
492
|
-
166,
|
|
493
|
-
147,
|
|
494
|
-
152,
|
|
495
|
-
13,
|
|
496
|
-
42,
|
|
497
|
-
29
|
|
498
|
-
]
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
name: "SetFlashloanFee",
|
|
502
|
-
discriminator: [
|
|
503
|
-
112,
|
|
504
|
-
164,
|
|
505
|
-
66,
|
|
506
|
-
251,
|
|
507
|
-
191,
|
|
508
|
-
56,
|
|
509
|
-
0,
|
|
510
|
-
47
|
|
511
|
-
]
|
|
512
|
-
}
|
|
513
|
-
];
|
|
514
|
-
const errors = [
|
|
515
|
-
{
|
|
516
|
-
code: 6000,
|
|
517
|
-
name: "FlashloanInvalidAuthority",
|
|
518
|
-
msg: "FLASHLOAN_INVALID_AUTHORITY"
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
code: 6001,
|
|
522
|
-
name: "FlashloanFeeTooHigh",
|
|
523
|
-
msg: "FLASHLOAN_FEE_TOO_HIGH"
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
code: 6002,
|
|
527
|
-
name: "FlashloanInvalidParams",
|
|
528
|
-
msg: "FLASHLOAN_INVALID_PARAMS"
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
code: 6003,
|
|
532
|
-
name: "FlashloanAlreadyActive",
|
|
533
|
-
msg: "FLASHLOAN_ALREADY_ACTIVE"
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
code: 6004,
|
|
537
|
-
name: "FlashloanAlreadyInactive",
|
|
538
|
-
msg: "FLASHLOAN_ALREADY_INACTIVE"
|
|
539
|
-
},
|
|
540
|
-
{
|
|
541
|
-
code: 6005,
|
|
542
|
-
name: "FlashloanCpiToLiquidityFailed",
|
|
543
|
-
msg: "FLASHLOAN_CPI_TO_LIQUIDITY_FAILED"
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
code: 6006,
|
|
547
|
-
name: "FlashloanNotAllowedInThisSlot",
|
|
548
|
-
msg: "FLASHLOAN_NOT_ALLOWED_IN_THIS_SLOT"
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
code: 6007,
|
|
552
|
-
name: "FlashloanInvalidInstructionSysvar",
|
|
553
|
-
msg: "FLASHLOAN_INVALID_INSTRUCTION_SYSVAR"
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
code: 6008,
|
|
557
|
-
name: "FlashloanInvalidInstructionData",
|
|
558
|
-
msg: "FLASHLOAN_INVALID_INSTRUCTION_DATA"
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
code: 6009,
|
|
562
|
-
name: "FlashloanPaybackNotFound",
|
|
563
|
-
msg: "FLASHLOAN_PAYBACK_NOT_FOUND"
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
code: 6010,
|
|
567
|
-
name: "FlashloanInvalidInstruction",
|
|
568
|
-
msg: "FLASHLOAN_INVALID_INSTRUCTION"
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
code: 6011,
|
|
572
|
-
name: "FlashloanPaused",
|
|
573
|
-
msg: "FLASHLOAN_PAUSED"
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
code: 6012,
|
|
577
|
-
name: "FlashloanCPICallNotAllowed",
|
|
578
|
-
msg: "FLASHLOAN_CPICALL_NOT_ALLOWED"
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
code: 6013,
|
|
582
|
-
name: "FlashloanMultiplePaybacksFound",
|
|
583
|
-
msg: "FLASHLOAN_MULTIPLE_PAYBACKS_FOUND"
|
|
584
|
-
}
|
|
585
|
-
];
|
|
586
|
-
const types = [
|
|
587
|
-
{
|
|
588
|
-
name: "ActivateProtocol",
|
|
589
|
-
type: {
|
|
590
|
-
kind: "struct",
|
|
591
|
-
fields: [
|
|
592
|
-
]
|
|
593
|
-
}
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
name: "FlashloanAdmin",
|
|
597
|
-
type: {
|
|
598
|
-
kind: "struct",
|
|
599
|
-
fields: [
|
|
600
|
-
{
|
|
601
|
-
name: "authority",
|
|
602
|
-
type: "pubkey"
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
name: "liquidity_program",
|
|
606
|
-
type: "pubkey"
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
name: "status",
|
|
610
|
-
type: "bool"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
name: "flashloan_fee",
|
|
614
|
-
type: "u16"
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
name: "flashloan_timestamp",
|
|
618
|
-
type: "u64"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
name: "is_flashloan_active",
|
|
622
|
-
type: "bool"
|
|
623
|
-
},
|
|
624
|
-
{
|
|
625
|
-
name: "active_flashloan_amount",
|
|
626
|
-
type: "u64"
|
|
627
|
-
},
|
|
628
|
-
{
|
|
629
|
-
name: "bump",
|
|
630
|
-
type: "u8"
|
|
631
|
-
}
|
|
632
|
-
]
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
name: "LogUpdateAuthority",
|
|
637
|
-
type: {
|
|
638
|
-
kind: "struct",
|
|
639
|
-
fields: [
|
|
640
|
-
{
|
|
641
|
-
name: "new_authority",
|
|
642
|
-
type: "pubkey"
|
|
643
|
-
}
|
|
644
|
-
]
|
|
645
|
-
}
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
name: "PauseProtocol",
|
|
649
|
-
type: {
|
|
650
|
-
kind: "struct",
|
|
651
|
-
fields: [
|
|
652
|
-
]
|
|
653
|
-
}
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
name: "SetFlashloanFee",
|
|
657
|
-
type: {
|
|
658
|
-
kind: "struct",
|
|
659
|
-
fields: [
|
|
660
|
-
{
|
|
661
|
-
name: "flashloan_fee",
|
|
662
|
-
type: "u16"
|
|
663
|
-
}
|
|
664
|
-
]
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
];
|
|
668
|
-
const flashloan$1 = {
|
|
669
|
-
address: address,
|
|
670
|
-
metadata: metadata,
|
|
671
|
-
instructions: instructions,
|
|
672
|
-
accounts: accounts,
|
|
673
|
-
events: events,
|
|
674
|
-
errors: errors,
|
|
675
|
-
types: types
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
const FLASHLOAN_PROGRAM_ID = new PublicKey(address);
|
|
679
|
-
const LIQUIDITY_PROGRAM_ID = new PublicKey(address$1);
|
|
680
|
-
const getFlashloanAdmin = () => {
|
|
681
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
682
|
-
[Buffer.from("flashloan_admin")],
|
|
683
|
-
FLASHLOAN_PROGRAM_ID
|
|
684
|
-
);
|
|
685
|
-
return pda;
|
|
686
|
-
};
|
|
687
|
-
const getLiquidityReserve = (asset) => {
|
|
688
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
689
|
-
[Buffer.from("reserve"), asset.toBuffer()],
|
|
690
|
-
LIQUIDITY_PROGRAM_ID
|
|
691
|
-
);
|
|
692
|
-
return pda;
|
|
693
|
-
};
|
|
694
|
-
const getLiquidity = () => {
|
|
695
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
696
|
-
[Buffer.from("liquidity")],
|
|
697
|
-
LIQUIDITY_PROGRAM_ID
|
|
698
|
-
);
|
|
699
|
-
return pda;
|
|
700
|
-
};
|
|
701
|
-
const getRateModel = (asset) => {
|
|
702
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
703
|
-
[Buffer.from("rate_model"), asset.toBuffer()],
|
|
704
|
-
LIQUIDITY_PROGRAM_ID
|
|
705
|
-
);
|
|
706
|
-
return pda;
|
|
707
|
-
};
|
|
708
|
-
const getFlashloanSupplyPosition = (asset) => {
|
|
709
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
710
|
-
[
|
|
711
|
-
Buffer.from("user_supply_position"),
|
|
712
|
-
asset.toBuffer(),
|
|
713
|
-
getFlashloanAdmin().toBuffer()
|
|
714
|
-
],
|
|
715
|
-
LIQUIDITY_PROGRAM_ID
|
|
716
|
-
);
|
|
717
|
-
return pda;
|
|
718
|
-
};
|
|
719
|
-
const getFlashloanBorrowPosition = (asset) => {
|
|
720
|
-
const [pda] = PublicKey.findProgramAddressSync(
|
|
721
|
-
[
|
|
722
|
-
Buffer.from("user_borrow_position"),
|
|
723
|
-
asset.toBuffer(),
|
|
724
|
-
getFlashloanAdmin().toBuffer()
|
|
725
|
-
],
|
|
726
|
-
LIQUIDITY_PROGRAM_ID
|
|
727
|
-
);
|
|
728
|
-
return pda;
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
const flashloan = {
|
|
732
|
-
__proto__: null,
|
|
733
|
-
getFlashloanAdmin: getFlashloanAdmin,
|
|
734
|
-
getFlashloanBorrowPosition: getFlashloanBorrowPosition,
|
|
735
|
-
getFlashloanSupplyPosition: getFlashloanSupplyPosition,
|
|
736
|
-
getLiquidity: getLiquidity,
|
|
737
|
-
getLiquidityReserve: getLiquidityReserve,
|
|
738
|
-
getRateModel: getRateModel
|
|
739
|
-
};
|
|
740
|
-
|
|
741
|
-
export { getRateModel as a, getFlashloanBorrowPosition as b, getLiquidityReserve as c, getFlashloanAdmin as d, flashloan$1 as e, flashloan as f, getLiquidity as g };
|