@jup-ag/lend 0.1.7 → 0.1.9
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 +45 -23
- package/dist/borrow/index.d.ts +45 -23
- package/dist/borrow/index.mjs +3 -3
- package/dist/earn/index.d.mts +19 -15
- package/dist/earn/index.d.ts +19 -15
- package/dist/earn/index.mjs +46 -43
- package/dist/flashloan/index.d.mts +4 -4
- package/dist/flashloan/index.d.ts +4 -4
- package/dist/index.mjs +2 -2
- package/dist/merkle-distributor/index.d.mts +2 -2
- package/dist/merkle-distributor/index.d.ts +2 -2
- package/dist/refinance/index.d.mts +1 -1
- package/dist/refinance/index.d.ts +1 -1
- package/dist/refinance/index.mjs +2 -2
- package/dist/shared/{lend.D69BluYU.d.mts → lend.B1GEdPEJ.d.mts} +11 -8
- package/dist/shared/{lend.D69BluYU.d.ts → lend.B1GEdPEJ.d.ts} +11 -8
- package/dist/shared/{lend.Bh9Wk7OH.mjs → lend.BaZsInAi.mjs} +711 -14
- package/dist/shared/{lend.CsYeVtpe.mjs → lend.Cw-khlBI.mjs} +4 -1
- package/package.json +1 -1
package/dist/earn/index.mjs
CHANGED
|
@@ -3,9 +3,12 @@ import { getAssociatedTokenAddress, getAccount, createAssociatedTokenAccountInst
|
|
|
3
3
|
import { l as liquidity } from '../shared/lend.CioR9-te.mjs';
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
import { b as lending, g as getLendingToken, c as getLending, d as getLendingRewardsRateModel, e as getClaimAccount, f as getLendingAdmin } from '../shared/lend.DS0KoPpL.mjs';
|
|
6
|
+
import BN$1, { BN } from 'bn.js';
|
|
6
7
|
import { g as getLiquidity, a as getRateModel, b as getUserBorrowPosition, c as getUserSupplyPosition, d as getTokenReserveFromAsset, e as getReserve } from '../shared/lend.BzG5ldOV.mjs';
|
|
7
|
-
import BN from 'bn.js';
|
|
8
8
|
|
|
9
|
+
const U64_MAX = new BN("18446744073709551615");
|
|
10
|
+
const MAX_DEPOSIT = U64_MAX;
|
|
11
|
+
const MAX_WITHDRAW = U64_MAX;
|
|
9
12
|
const getLendingProgram = ({
|
|
10
13
|
connection,
|
|
11
14
|
signer
|
|
@@ -265,10 +268,10 @@ const getRedeemIxs = async ({
|
|
|
265
268
|
};
|
|
266
269
|
|
|
267
270
|
const LENDING_CONSTANTS = {
|
|
268
|
-
EXCHANGE_PRICES_PRECISION: new BN(1e12),
|
|
271
|
+
EXCHANGE_PRICES_PRECISION: new BN$1(1e12),
|
|
269
272
|
// 1e12
|
|
270
|
-
SECONDS_PER_YEAR: new BN(31536e3),
|
|
271
|
-
MAX_REWARDS_RATE: new BN(50 * 1e12)
|
|
273
|
+
SECONDS_PER_YEAR: new BN$1(31536e3),
|
|
274
|
+
MAX_REWARDS_RATE: new BN$1(50 * 1e12)
|
|
272
275
|
// 50%
|
|
273
276
|
};
|
|
274
277
|
async function getLendingData(address, program) {
|
|
@@ -287,8 +290,8 @@ async function getLendingData(address, program) {
|
|
|
287
290
|
return lendingRes.account;
|
|
288
291
|
}
|
|
289
292
|
function calculateTotalAssets(lending, totalSupply) {
|
|
290
|
-
const tokenExchangePrice = new BN(lending.tokenExchangePrice.toString());
|
|
291
|
-
const totalSupplyBN = typeof totalSupply === "number" || typeof totalSupply === "string" ? new BN(String(totalSupply)) : totalSupply;
|
|
293
|
+
const tokenExchangePrice = new BN$1(lending.tokenExchangePrice.toString());
|
|
294
|
+
const totalSupplyBN = typeof totalSupply === "number" || typeof totalSupply === "string" ? new BN$1(String(totalSupply)) : totalSupply;
|
|
292
295
|
return Number.parseInt(
|
|
293
296
|
tokenExchangePrice.mul(totalSupplyBN).div(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION).toString()
|
|
294
297
|
);
|
|
@@ -326,7 +329,7 @@ async function getRewardsRate(asset, totalAssets, connection) {
|
|
|
326
329
|
);
|
|
327
330
|
if (totalAssets.lt(currentRateModel.startTvl)) {
|
|
328
331
|
return {
|
|
329
|
-
rate: new BN(0),
|
|
332
|
+
rate: new BN$1(0),
|
|
330
333
|
rewardsEnded: false,
|
|
331
334
|
rewardsStartTime: currentRateModel.startTime
|
|
332
335
|
};
|
|
@@ -354,11 +357,11 @@ async function getLiquidityExchangePricesAndConfig(assetAddress, connection) {
|
|
|
354
357
|
mint: account.mint,
|
|
355
358
|
supplyExchangePrice: account.supplyExchangePrice,
|
|
356
359
|
borrowExchangePrice: account.borrowExchangePrice,
|
|
357
|
-
borrowRate: new BN(account.borrowRate || 0),
|
|
358
|
-
fee: new BN(account.feeOnInterest || 0),
|
|
359
|
-
lastStoredUtilization: new BN(account.lastUtilization || 0),
|
|
360
|
+
borrowRate: new BN$1(account.borrowRate || 0),
|
|
361
|
+
fee: new BN$1(account.feeOnInterest || 0),
|
|
362
|
+
lastStoredUtilization: new BN$1(account.lastUtilization || 0),
|
|
360
363
|
lastUpdateTimestamp: account.lastUpdateTimestamp,
|
|
361
|
-
maxUtilization: new BN(account.maxUtilization || 9500),
|
|
364
|
+
maxUtilization: new BN$1(account.maxUtilization || 9500),
|
|
362
365
|
supplyInterest: account.totalSupplyWithInterest,
|
|
363
366
|
supplyInterestFree: account.totalSupplyInterestFree,
|
|
364
367
|
borrowInterest: account.totalBorrowWithInterest,
|
|
@@ -371,41 +374,41 @@ async function getLiquidityExchangePricesAndConfig(assetAddress, connection) {
|
|
|
371
374
|
fee: tokenReserve.fee,
|
|
372
375
|
lastStoredUtilization: tokenReserve.lastStoredUtilization,
|
|
373
376
|
lastUpdateTimestamp: tokenReserve.lastUpdateTimestamp,
|
|
374
|
-
maxUtilization: tokenReserve.maxUtilization || new BN(9500)
|
|
377
|
+
maxUtilization: tokenReserve.maxUtilization || new BN$1(9500)
|
|
375
378
|
};
|
|
376
379
|
}
|
|
377
380
|
async function getNewExchangePrice(lending, connection) {
|
|
378
381
|
const { supplyExchangePrice: liquidityExchangePrice } = await getLiquidityExchangePricesAndConfig(lending.mint, connection);
|
|
379
|
-
const oldTokenExchangePrice = new BN(lending.tokenExchangePrice.toString());
|
|
380
|
-
const oldLiquidityExchangePrice = new BN(
|
|
382
|
+
const oldTokenExchangePrice = new BN$1(lending.tokenExchangePrice.toString());
|
|
383
|
+
const oldLiquidityExchangePrice = new BN$1(
|
|
381
384
|
lending.liquidityExchangePrice.toString()
|
|
382
385
|
);
|
|
383
|
-
let totalReturnPercent = new BN(0);
|
|
386
|
+
let totalReturnPercent = new BN$1(0);
|
|
384
387
|
const totalSupply = await getTokenTotalSupply(lending.fTokenMint, connection);
|
|
385
|
-
const totalAssets = oldTokenExchangePrice.mul(new BN(totalSupply)).div(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION);
|
|
388
|
+
const totalAssets = oldTokenExchangePrice.mul(new BN$1(totalSupply)).div(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION);
|
|
386
389
|
let rewardsRate = await getRewardsRate(lending.mint, totalAssets, connection);
|
|
387
390
|
if (rewardsRate.rate.gt(LENDING_CONSTANTS.MAX_REWARDS_RATE)) {
|
|
388
|
-
rewardsRate.rate = new BN(0);
|
|
391
|
+
rewardsRate.rate = new BN$1(0);
|
|
389
392
|
}
|
|
390
|
-
let lastUpdateTime = new BN(lending.lastUpdateTimestamp.toString());
|
|
393
|
+
let lastUpdateTime = new BN$1(lending.lastUpdateTimestamp.toString());
|
|
391
394
|
if (lastUpdateTime < rewardsRate.rewardsStartTime) {
|
|
392
395
|
lastUpdateTime = rewardsRate.rewardsStartTime;
|
|
393
396
|
}
|
|
394
|
-
totalReturnPercent = rewardsRate.rate.mul(new BN(Math.floor(Date.now() / 1e3)).sub(lastUpdateTime)).div(LENDING_CONSTANTS.SECONDS_PER_YEAR);
|
|
395
|
-
const delta = new BN(liquidityExchangePrice).sub(oldLiquidityExchangePrice);
|
|
397
|
+
totalReturnPercent = rewardsRate.rate.mul(new BN$1(Math.floor(Date.now() / 1e3)).sub(lastUpdateTime)).div(LENDING_CONSTANTS.SECONDS_PER_YEAR);
|
|
398
|
+
const delta = new BN$1(liquidityExchangePrice).sub(oldLiquidityExchangePrice);
|
|
396
399
|
totalReturnPercent = totalReturnPercent.add(
|
|
397
|
-
delta.mul(new BN(1e14)).div(oldLiquidityExchangePrice)
|
|
400
|
+
delta.mul(new BN$1(1e14)).div(oldLiquidityExchangePrice)
|
|
398
401
|
);
|
|
399
402
|
return oldTokenExchangePrice.add(
|
|
400
|
-
oldTokenExchangePrice.mul(totalReturnPercent).div(new BN(1e14))
|
|
403
|
+
oldTokenExchangePrice.mul(totalReturnPercent).div(new BN$1(1e14))
|
|
401
404
|
);
|
|
402
405
|
}
|
|
403
406
|
async function calculateRewardsRate(currentModel, totalAssets) {
|
|
404
|
-
const currentTimestamp = new BN(Math.floor(Date.now() / 1e3));
|
|
407
|
+
const currentTimestamp = new BN$1(Math.floor(Date.now() / 1e3));
|
|
405
408
|
const defaultResult = {
|
|
406
|
-
rewardsRate: new BN(0),
|
|
409
|
+
rewardsRate: new BN$1(0),
|
|
407
410
|
rewardsEnded: false,
|
|
408
|
-
rewardsStartTime: new BN(currentModel.startTime.toString())
|
|
411
|
+
rewardsStartTime: new BN$1(currentModel.startTime.toString())
|
|
409
412
|
};
|
|
410
413
|
if (currentModel.startTime.isZero() || currentModel.duration.isZero()) {
|
|
411
414
|
return defaultResult;
|
|
@@ -416,21 +419,21 @@ async function calculateRewardsRate(currentModel, totalAssets) {
|
|
|
416
419
|
rewardsEnded: true
|
|
417
420
|
};
|
|
418
421
|
}
|
|
419
|
-
if (new BN(totalAssets).lt(currentModel.startTvl)) {
|
|
422
|
+
if (new BN$1(totalAssets).lt(currentModel.startTvl)) {
|
|
420
423
|
return defaultResult;
|
|
421
424
|
}
|
|
422
|
-
let rewardsRate = new BN(currentModel.yearlyReward.toString()).mul(new BN(1e4)).div(new BN(totalAssets.toString()));
|
|
425
|
+
let rewardsRate = new BN$1(currentModel.yearlyReward.toString()).mul(new BN$1(1e4)).div(new BN$1(totalAssets.toString()));
|
|
423
426
|
if (rewardsRate.gt(LENDING_CONSTANTS.MAX_REWARDS_RATE)) {
|
|
424
427
|
rewardsRate = LENDING_CONSTANTS.MAX_REWARDS_RATE;
|
|
425
428
|
}
|
|
426
429
|
return {
|
|
427
430
|
rewardsRate,
|
|
428
431
|
rewardsEnded: false,
|
|
429
|
-
rewardsStartTime: new BN(currentModel.startTime.toString())
|
|
432
|
+
rewardsStartTime: new BN$1(currentModel.startTime.toString())
|
|
430
433
|
};
|
|
431
434
|
}
|
|
432
435
|
async function getLendingTokenRewards(lending, connection) {
|
|
433
|
-
let rewardsRate = new BN(0);
|
|
436
|
+
let rewardsRate = new BN$1(0);
|
|
434
437
|
if (!lending.rewardsRateModel.equals(PublicKey.default)) {
|
|
435
438
|
try {
|
|
436
439
|
const fTokenSupply = await getTokenTotalSupply(
|
|
@@ -491,11 +494,11 @@ async function getTokenReserveAccount(asset, connection) {
|
|
|
491
494
|
mint: account.mint,
|
|
492
495
|
supplyExchangePrice: account.supplyExchangePrice,
|
|
493
496
|
borrowExchangePrice: account.borrowExchangePrice,
|
|
494
|
-
borrowRate: new BN(account.borrowRate || 0),
|
|
495
|
-
fee: new BN(account.feeOnInterest || 0),
|
|
496
|
-
lastStoredUtilization: new BN(account.lastUtilization || 0),
|
|
497
|
+
borrowRate: new BN$1(account.borrowRate || 0),
|
|
498
|
+
fee: new BN$1(account.feeOnInterest || 0),
|
|
499
|
+
lastStoredUtilization: new BN$1(account.lastUtilization || 0),
|
|
497
500
|
lastUpdateTimestamp: account.lastUpdateTimestamp,
|
|
498
|
-
maxUtilization: new BN(account.maxUtilization || 9500),
|
|
501
|
+
maxUtilization: new BN$1(account.maxUtilization || 9500),
|
|
499
502
|
supplyInterest: account.totalSupplyWithInterest,
|
|
500
503
|
supplyInterestFree: account.totalSupplyInterestFree,
|
|
501
504
|
borrowInterest: account.totalBorrowWithInterest,
|
|
@@ -522,7 +525,7 @@ async function getLiquidityAssetSupplyRate(asset, connection) {
|
|
|
522
525
|
getLiquidityExchangePricesAndConfig(asset, connection),
|
|
523
526
|
getTotalAmounts(asset, connection)
|
|
524
527
|
]);
|
|
525
|
-
let supplyRate = new BN(0);
|
|
528
|
+
let supplyRate = new BN$1(0);
|
|
526
529
|
if (!totalAmounts) {
|
|
527
530
|
return supplyRate;
|
|
528
531
|
}
|
|
@@ -532,7 +535,7 @@ async function getLiquidityAssetSupplyRate(asset, connection) {
|
|
|
532
535
|
const borrowWithInterestForRate = totalAmounts.borrowRawInterest.mul(exchangePricesAndConfig.borrowExchangePrice).div(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION);
|
|
533
536
|
const supplyWithInterestForRate = totalAmounts.supplyRawInterest.mul(exchangePricesAndConfig.supplyExchangePrice).div(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION);
|
|
534
537
|
if (!supplyWithInterestForRate.isZero()) {
|
|
535
|
-
supplyRate = borrowRate.mul(new BN(1e4).sub(fee)).mul(borrowWithInterestForRate).div(supplyWithInterestForRate.mul(new BN(1e4)));
|
|
538
|
+
supplyRate = borrowRate.mul(new BN$1(1e4).sub(fee)).mul(borrowWithInterestForRate).div(supplyWithInterestForRate.mul(new BN$1(1e4)));
|
|
536
539
|
}
|
|
537
540
|
}
|
|
538
541
|
return supplyRate;
|
|
@@ -558,16 +561,16 @@ const getLendingTokenDetails = async ({
|
|
|
558
561
|
getNewExchangePrice(lendingData, connection),
|
|
559
562
|
getLendingTokenRewards(lendingData, connection)
|
|
560
563
|
]);
|
|
561
|
-
const convertToShares = new BN(10).pow(new BN(lendingData.decimals)).mul(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION).divRound(exchangePrice);
|
|
562
|
-
const convertToAssets2 = new BN(10).pow(new BN(lendingData.decimals)).mul(exchangePrice).divRound(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION);
|
|
564
|
+
const convertToShares = new BN$1(10).pow(new BN$1(lendingData.decimals)).mul(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION).divRound(exchangePrice);
|
|
565
|
+
const convertToAssets2 = new BN$1(10).pow(new BN$1(lendingData.decimals)).mul(exchangePrice).divRound(LENDING_CONSTANTS.EXCHANGE_PRICES_PRECISION);
|
|
563
566
|
const totalAssets = calculateTotalAssets(lendingData, assetTotalSupply);
|
|
564
567
|
return {
|
|
565
568
|
id: lendingData.lendingId,
|
|
566
569
|
address: lendingData.fTokenMint,
|
|
567
570
|
asset: lendingData.mint,
|
|
568
571
|
decimals: lendingData.decimals,
|
|
569
|
-
totalAssets: new BN(totalAssets.toString()),
|
|
570
|
-
totalSupply: new BN(assetTotalSupply),
|
|
572
|
+
totalAssets: new BN$1(totalAssets.toString()),
|
|
573
|
+
totalSupply: new BN$1(assetTotalSupply),
|
|
571
574
|
convertToShares,
|
|
572
575
|
convertToAssets: convertToAssets2,
|
|
573
576
|
rewardsRate,
|
|
@@ -587,14 +590,14 @@ const getUserLendingPositionByAsset = async ({
|
|
|
587
590
|
const underlyingBalance = await getTokenBalance(user, asset, connection);
|
|
588
591
|
const assets = await convertToAssets(
|
|
589
592
|
asset,
|
|
590
|
-
new BN(lendingTokenBalance.toString()),
|
|
593
|
+
new BN$1(lendingTokenBalance.toString()),
|
|
591
594
|
connection
|
|
592
595
|
);
|
|
593
596
|
return {
|
|
594
|
-
lendingTokenShares: new BN(lendingTokenBalance.toString()),
|
|
597
|
+
lendingTokenShares: new BN$1(lendingTokenBalance.toString()),
|
|
595
598
|
underlyingAssets: assets,
|
|
596
|
-
underlyingBalance: new BN(underlyingBalance.toString())
|
|
599
|
+
underlyingBalance: new BN$1(underlyingBalance.toString())
|
|
597
600
|
};
|
|
598
601
|
};
|
|
599
602
|
|
|
600
|
-
export { getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
|
|
603
|
+
export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import BN__default from 'bn.js';
|
|
4
4
|
|
|
5
5
|
type ConnectionParams = {
|
|
6
6
|
connection: Connection;
|
|
@@ -11,13 +11,13 @@ type FlashloanContextParams = {
|
|
|
11
11
|
signer: PublicKey;
|
|
12
12
|
} & ConnectionParams;
|
|
13
13
|
type FlashloanParams = {
|
|
14
|
-
amount:
|
|
14
|
+
amount: BN__default;
|
|
15
15
|
} & FlashloanContextParams;
|
|
16
16
|
type FlashPaybackParams = {
|
|
17
|
-
amount:
|
|
17
|
+
amount: BN__default;
|
|
18
18
|
} & FlashloanContextParams;
|
|
19
19
|
type FlashBorrowParams = {
|
|
20
|
-
amount:
|
|
20
|
+
amount: BN__default;
|
|
21
21
|
} & FlashloanContextParams;
|
|
22
22
|
declare function getFlashloanContext({ signer, asset, connection, }: FlashloanContextParams): Promise<{
|
|
23
23
|
signer: PublicKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import BN__default from 'bn.js';
|
|
4
4
|
|
|
5
5
|
type ConnectionParams = {
|
|
6
6
|
connection: Connection;
|
|
@@ -11,13 +11,13 @@ type FlashloanContextParams = {
|
|
|
11
11
|
signer: PublicKey;
|
|
12
12
|
} & ConnectionParams;
|
|
13
13
|
type FlashloanParams = {
|
|
14
|
-
amount:
|
|
14
|
+
amount: BN__default;
|
|
15
15
|
} & FlashloanContextParams;
|
|
16
16
|
type FlashPaybackParams = {
|
|
17
|
-
amount:
|
|
17
|
+
amount: BN__default;
|
|
18
18
|
} & FlashloanContextParams;
|
|
19
19
|
type FlashBorrowParams = {
|
|
20
|
-
amount:
|
|
20
|
+
amount: BN__default;
|
|
21
21
|
} & FlashloanContextParams;
|
|
22
22
|
declare function getFlashloanContext({ signer, asset, connection, }: FlashloanContextParams): Promise<{
|
|
23
23
|
signer: PublicKey;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { l as lendingPda, a as lendingRewardRateModelPda } from './shared/lend.DS0KoPpL.mjs';
|
|
2
2
|
export { l as liquidityPda } from './shared/lend.BzG5ldOV.mjs';
|
|
3
|
-
export { b as borrowPda } from './shared/lend.
|
|
3
|
+
export { b as borrowPda } from './shared/lend.Cw-khlBI.mjs';
|
|
4
4
|
export { f as flashloanPda } from './shared/lend.Cr2l14_0.mjs';
|
|
5
5
|
export { m as merkleDistributorPda } from './shared/lend.Bpqe1Iia.mjs';
|
|
6
6
|
import '@solana/web3.js';
|
|
@@ -8,6 +8,6 @@ import './shared/lend.CioR9-te.mjs';
|
|
|
8
8
|
import '@solana/spl-token';
|
|
9
9
|
import 'bn.js';
|
|
10
10
|
|
|
11
|
-
const version = "0.1.
|
|
11
|
+
const version = "0.1.9";
|
|
12
12
|
|
|
13
13
|
export { version };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import BN__default from 'bn.js';
|
|
4
4
|
|
|
5
5
|
type ConnectionParams = {
|
|
6
6
|
connection: Connection;
|
|
@@ -12,7 +12,7 @@ type ClaimContextParams = {
|
|
|
12
12
|
positionId: PublicKey;
|
|
13
13
|
} & ConnectionParams;
|
|
14
14
|
type ClaimParams = {
|
|
15
|
-
cumulativeAmount:
|
|
15
|
+
cumulativeAmount: BN__default;
|
|
16
16
|
positionType: number;
|
|
17
17
|
cycle: number;
|
|
18
18
|
merkleProof: Uint8Array<ArrayBufferLike>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import BN__default from 'bn.js';
|
|
4
4
|
|
|
5
5
|
type ConnectionParams = {
|
|
6
6
|
connection: Connection;
|
|
@@ -12,7 +12,7 @@ type ClaimContextParams = {
|
|
|
12
12
|
positionId: PublicKey;
|
|
13
13
|
} & ConnectionParams;
|
|
14
14
|
type ClaimParams = {
|
|
15
|
-
cumulativeAmount:
|
|
15
|
+
cumulativeAmount: BN__default;
|
|
16
16
|
positionType: number;
|
|
17
17
|
cycle: number;
|
|
18
18
|
merkleProof: Uint8Array<ArrayBufferLike>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey } from '@solana/web3.js';
|
|
3
|
-
import { O as OperateContextParams } from '../shared/lend.
|
|
3
|
+
import { O as OperateContextParams } from '../shared/lend.B1GEdPEJ.mjs';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '@coral-xyz/anchor';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey } from '@solana/web3.js';
|
|
3
|
-
import { O as OperateContextParams } from '../shared/lend.
|
|
3
|
+
import { O as OperateContextParams } from '../shared/lend.B1GEdPEJ.js';
|
|
4
4
|
import 'bn.js';
|
|
5
5
|
import '@coral-xyz/anchor';
|
|
6
6
|
|
package/dist/refinance/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as vaultsIdl } from '../shared/lend.
|
|
2
|
-
import { e as getOperateIx } from '../shared/lend.
|
|
1
|
+
import { v as vaultsIdl } from '../shared/lend.Cw-khlBI.mjs';
|
|
2
|
+
import { e as getOperateIx } from '../shared/lend.BaZsInAi.mjs';
|
|
3
3
|
import { PublicKey } from '@solana/web3.js';
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
import '../shared/lend.CioR9-te.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import BN__default from 'bn.js';
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -13,7 +13,7 @@ type Vaults = {
|
|
|
13
13
|
address: "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi";
|
|
14
14
|
metadata: {
|
|
15
15
|
name: "vaults";
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.2";
|
|
17
17
|
spec: "0.1.0";
|
|
18
18
|
description: "Created with Anchor";
|
|
19
19
|
};
|
|
@@ -3324,6 +3324,9 @@ type Vaults = {
|
|
|
3324
3324
|
},
|
|
3325
3325
|
{
|
|
3326
3326
|
name: "jupLend";
|
|
3327
|
+
},
|
|
3328
|
+
{
|
|
3329
|
+
name: "chainlinkDataStreams";
|
|
3327
3330
|
}
|
|
3328
3331
|
];
|
|
3329
3332
|
};
|
|
@@ -4004,8 +4007,8 @@ type ConnectionParams = {
|
|
|
4004
4007
|
type OperateContextParams = {
|
|
4005
4008
|
vaultId: number;
|
|
4006
4009
|
positionId: number;
|
|
4007
|
-
colAmount:
|
|
4008
|
-
debtAmount:
|
|
4010
|
+
colAmount: BN__default;
|
|
4011
|
+
debtAmount: BN__default;
|
|
4009
4012
|
recipient?: PublicKey;
|
|
4010
4013
|
positionOwner?: PublicKey;
|
|
4011
4014
|
program?: Program<Vaults>;
|
|
@@ -4013,8 +4016,8 @@ type OperateContextParams = {
|
|
|
4013
4016
|
type OperateParams = {
|
|
4014
4017
|
vaultId: number;
|
|
4015
4018
|
positionId: number;
|
|
4016
|
-
colAmount:
|
|
4017
|
-
debtAmount:
|
|
4019
|
+
colAmount: BN__default;
|
|
4020
|
+
debtAmount: BN__default;
|
|
4018
4021
|
recipient?: PublicKey;
|
|
4019
4022
|
positionOwner?: PublicKey;
|
|
4020
4023
|
} & ConnectionParams;
|
|
@@ -4142,8 +4145,8 @@ declare const getOperateIx: ({ vaultId, positionId, colAmount, debtAmount, conne
|
|
|
4142
4145
|
}>;
|
|
4143
4146
|
type LiquidateParams = {
|
|
4144
4147
|
vaultId: number;
|
|
4145
|
-
debtAmount:
|
|
4146
|
-
colPerUnitDebt?:
|
|
4148
|
+
debtAmount: BN__default;
|
|
4149
|
+
colPerUnitDebt?: BN__default;
|
|
4147
4150
|
absorb?: boolean;
|
|
4148
4151
|
to?: PublicKey;
|
|
4149
4152
|
} & ConnectionParams;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import BN__default from 'bn.js';
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -13,7 +13,7 @@ type Vaults = {
|
|
|
13
13
|
address: "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi";
|
|
14
14
|
metadata: {
|
|
15
15
|
name: "vaults";
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.2";
|
|
17
17
|
spec: "0.1.0";
|
|
18
18
|
description: "Created with Anchor";
|
|
19
19
|
};
|
|
@@ -3324,6 +3324,9 @@ type Vaults = {
|
|
|
3324
3324
|
},
|
|
3325
3325
|
{
|
|
3326
3326
|
name: "jupLend";
|
|
3327
|
+
},
|
|
3328
|
+
{
|
|
3329
|
+
name: "chainlinkDataStreams";
|
|
3327
3330
|
}
|
|
3328
3331
|
];
|
|
3329
3332
|
};
|
|
@@ -4004,8 +4007,8 @@ type ConnectionParams = {
|
|
|
4004
4007
|
type OperateContextParams = {
|
|
4005
4008
|
vaultId: number;
|
|
4006
4009
|
positionId: number;
|
|
4007
|
-
colAmount:
|
|
4008
|
-
debtAmount:
|
|
4010
|
+
colAmount: BN__default;
|
|
4011
|
+
debtAmount: BN__default;
|
|
4009
4012
|
recipient?: PublicKey;
|
|
4010
4013
|
positionOwner?: PublicKey;
|
|
4011
4014
|
program?: Program<Vaults>;
|
|
@@ -4013,8 +4016,8 @@ type OperateContextParams = {
|
|
|
4013
4016
|
type OperateParams = {
|
|
4014
4017
|
vaultId: number;
|
|
4015
4018
|
positionId: number;
|
|
4016
|
-
colAmount:
|
|
4017
|
-
debtAmount:
|
|
4019
|
+
colAmount: BN__default;
|
|
4020
|
+
debtAmount: BN__default;
|
|
4018
4021
|
recipient?: PublicKey;
|
|
4019
4022
|
positionOwner?: PublicKey;
|
|
4020
4023
|
} & ConnectionParams;
|
|
@@ -4142,8 +4145,8 @@ declare const getOperateIx: ({ vaultId, positionId, colAmount, debtAmount, conne
|
|
|
4142
4145
|
}>;
|
|
4143
4146
|
type LiquidateParams = {
|
|
4144
4147
|
vaultId: number;
|
|
4145
|
-
debtAmount:
|
|
4146
|
-
colPerUnitDebt?:
|
|
4148
|
+
debtAmount: BN__default;
|
|
4149
|
+
colPerUnitDebt?: BN__default;
|
|
4147
4150
|
absorb?: boolean;
|
|
4148
4151
|
to?: PublicKey;
|
|
4149
4152
|
} & ConnectionParams;
|