@jup-ag/lend 0.0.101 → 0.0.103
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 +424 -35
- package/dist/borrow/index.d.ts +424 -35
- package/dist/borrow/index.mjs +99 -2
- package/dist/earn/index.d.mts +1011 -1323
- package/dist/earn/index.d.ts +1011 -1323
- package/dist/earn/index.mjs +1 -1
- package/dist/flashloan/index.mjs +1 -1
- package/dist/index.mjs +5 -5
- package/dist/merkle-distributor/index.mjs +1 -1
- package/dist/shared/{lend.qfqiaCtm.mjs → lend.BWTZqUUK.mjs} +496 -35
- package/dist/shared/{lend.CIepsiAe.mjs → lend.Bpqe1Iia.mjs} +319 -15
- package/dist/shared/{lend.BNgjawDo.mjs → lend.C7OmhOS3.mjs} +54 -0
- package/dist/shared/{lend.hlqlrp9r.mjs → lend.Cr2l14_0.mjs} +82 -2
- package/package.json +1 -1
package/dist/borrow/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import BN from 'bn.js';
|
|
|
3
3
|
import { Program, AnchorProvider } from '@coral-xyz/anchor';
|
|
4
4
|
import { l as liquidity } from '../shared/lend.CioR9-te.mjs';
|
|
5
5
|
import { getAssociatedTokenAddressSync, ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
6
|
-
import { g as getTickHasDebt, v as vaults, a as getPosition, c as getTick, d as getTickIdLiquidation, e as getVaultConfig, f as getBranch, h as getVaultState, i as getVaultMetadata, j as getLiquidity, k as getRateModel, l as getUserBorrowPosition, m as getUserSupplyPosition, n as getLiquidityReserve, o as getPositionTokenAccount, p as getPositionMetadata, q as getPositionMint, r as getVaultAdmin, s as getClaimAccount } from '../shared/lend.
|
|
6
|
+
import { g as getTickHasDebt, v as vaults, a as getPosition, c as getTick, d as getTickIdLiquidation, e as getVaultConfig, f as getBranch, h as getVaultState, i as getVaultMetadata, j as getLiquidity, k as getRateModel, l as getUserBorrowPosition, m as getUserSupplyPosition, n as getLiquidityReserve, o as getPositionTokenAccount, p as getPositionMetadata, q as getPositionMint, r as getVaultAdmin, s as getClaimAccount } from '../shared/lend.BWTZqUUK.mjs';
|
|
7
7
|
import { e as getReserve } from '../shared/lend.BzG5ldOV.mjs';
|
|
8
8
|
|
|
9
9
|
const address = "jupnw4B6Eqs7ft6rxpzYLJZYSnrpRgPcr589n5Kv4oc";
|
|
@@ -234,6 +234,35 @@ const instructions = [
|
|
|
234
234
|
}
|
|
235
235
|
]
|
|
236
236
|
},
|
|
237
|
+
{
|
|
238
|
+
name: "update_authority",
|
|
239
|
+
discriminator: [
|
|
240
|
+
32,
|
|
241
|
+
46,
|
|
242
|
+
64,
|
|
243
|
+
28,
|
|
244
|
+
149,
|
|
245
|
+
75,
|
|
246
|
+
243,
|
|
247
|
+
88
|
|
248
|
+
],
|
|
249
|
+
accounts: [
|
|
250
|
+
{
|
|
251
|
+
name: "authority",
|
|
252
|
+
signer: true
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "oracle_admin",
|
|
256
|
+
writable: true
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
args: [
|
|
260
|
+
{
|
|
261
|
+
name: "new_authority",
|
|
262
|
+
type: "pubkey"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
},
|
|
237
266
|
{
|
|
238
267
|
name: "update_auths",
|
|
239
268
|
discriminator: [
|
|
@@ -299,6 +328,19 @@ const accounts = [
|
|
|
299
328
|
}
|
|
300
329
|
];
|
|
301
330
|
const events = [
|
|
331
|
+
{
|
|
332
|
+
name: "LogStakePoolHighFeeDetected",
|
|
333
|
+
discriminator: [
|
|
334
|
+
198,
|
|
335
|
+
106,
|
|
336
|
+
149,
|
|
337
|
+
7,
|
|
338
|
+
25,
|
|
339
|
+
83,
|
|
340
|
+
39,
|
|
341
|
+
155
|
|
342
|
+
]
|
|
343
|
+
},
|
|
302
344
|
{
|
|
303
345
|
name: "LogUpdateAuthority",
|
|
304
346
|
discriminator: [
|
|
@@ -401,6 +443,26 @@ const errors = [
|
|
|
401
443
|
code: 6014,
|
|
402
444
|
name: "InvalidPrice",
|
|
403
445
|
msg: "INVALID_PRICE"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
code: 6015,
|
|
449
|
+
name: "FeeTooHigh",
|
|
450
|
+
msg: "FEE_TOO_HIGH"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
code: 6016,
|
|
454
|
+
name: "RedstonePriceOverflow",
|
|
455
|
+
msg: "REDSTONE_PRICE_OVERFLOW"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
code: 6017,
|
|
459
|
+
name: "TimestampExpected",
|
|
460
|
+
msg: "TIMESTAMP_EXPECTED"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
code: 6018,
|
|
464
|
+
name: "ChainlinkPriceReadError",
|
|
465
|
+
msg: "CHAINLINK_PRICE_READ_ERROR"
|
|
404
466
|
}
|
|
405
467
|
];
|
|
406
468
|
const types = [
|
|
@@ -420,6 +482,22 @@ const types = [
|
|
|
420
482
|
]
|
|
421
483
|
}
|
|
422
484
|
},
|
|
485
|
+
{
|
|
486
|
+
name: "LogStakePoolHighFeeDetected",
|
|
487
|
+
type: {
|
|
488
|
+
kind: "struct",
|
|
489
|
+
fields: [
|
|
490
|
+
{
|
|
491
|
+
name: "stake_pool",
|
|
492
|
+
type: "pubkey"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: "epoch",
|
|
496
|
+
type: "u64"
|
|
497
|
+
}
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
},
|
|
423
501
|
{
|
|
424
502
|
name: "LogUpdateAuthority",
|
|
425
503
|
type: {
|
|
@@ -504,6 +582,15 @@ const types = [
|
|
|
504
582
|
},
|
|
505
583
|
{
|
|
506
584
|
name: "StakePool"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
name: "MsolPool"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "Redstone"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
name: "Chainlink"
|
|
507
594
|
}
|
|
508
595
|
]
|
|
509
596
|
}
|
|
@@ -1305,11 +1392,21 @@ async function getExchangePrices({
|
|
|
1305
1392
|
transaction.recentBlockhash = latestBlockHash.blockhash;
|
|
1306
1393
|
transaction.feePayer = signer;
|
|
1307
1394
|
const raw = await connection.simulateTransaction(transaction);
|
|
1395
|
+
if (raw.value.err && raw.value.err === "InvalidAccountForFee" && signer.toBase58() !== "HEyJLdMfZhhQ7FHCtjD5DWDFNFQhaeAVAsHeWqoY6dSD") {
|
|
1396
|
+
return await getExchangePrices({
|
|
1397
|
+
vaultId,
|
|
1398
|
+
vaultConfig,
|
|
1399
|
+
connection,
|
|
1400
|
+
signer: new PublicKey("HEyJLdMfZhhQ7FHCtjD5DWDFNFQhaeAVAsHeWqoY6dSD")
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1308
1403
|
const returnLog = raw.value.logs?.find(
|
|
1309
1404
|
(log) => log.startsWith("Program return:")
|
|
1310
1405
|
);
|
|
1311
1406
|
if (!returnLog) {
|
|
1312
|
-
|
|
1407
|
+
let error = new Error("No return data found in logs");
|
|
1408
|
+
error.simulation = raw.value;
|
|
1409
|
+
throw error;
|
|
1313
1410
|
}
|
|
1314
1411
|
const base64Data = returnLog.split(" ")[3];
|
|
1315
1412
|
const buffer = Buffer.from(base64Data, "base64");
|