@jup-ag/lend 0.1.4 → 0.1.6
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 +2 -2
- package/dist/borrow/index.d.ts +2 -2
- package/dist/borrow/index.mjs +3 -3
- package/dist/earn/index.mjs +15 -4
- package/dist/flashloan/index.mjs +1 -1
- package/dist/index.mjs +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.D6kcj1Qv.mjs → lend.CsYeVtpe.mjs} +42 -4
- package/dist/shared/{lend.DNFQlLzM.d.mts → lend.D69BluYU.d.mts} +31 -2
- package/dist/shared/{lend.DNFQlLzM.d.ts → lend.D69BluYU.d.ts} +31 -2
- package/dist/shared/{lend.8pE8Zw9V.mjs → lend.aTMYZYEH.mjs} +19 -6
- package/package.json +1 -1
package/dist/borrow/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as Vaults, L as LiquidateParams } from '../shared/lend.
|
|
2
|
-
export { C as ConnectionParams, I as InitPositionIxParams, e as LiquidateContextParams, O as OperateContextParams, a as OperateParams, c as getInitPositionContext, b as getInitPositionIx, f as getLiquidateContext, h as getLiquidateIx, g as getOperateContext, d as getOperateIx } from '../shared/lend.
|
|
1
|
+
import { V as Vaults, L as LiquidateParams } from '../shared/lend.D69BluYU.mjs';
|
|
2
|
+
export { C as ConnectionParams, I as InitPositionIxParams, e as LiquidateContextParams, O as OperateContextParams, a as OperateParams, c as getInitPositionContext, b as getInitPositionIx, f as getLiquidateContext, h as getLiquidateIx, g as getOperateContext, d as getOperateIx } from '../shared/lend.D69BluYU.mjs';
|
|
3
3
|
import { Program } from '@coral-xyz/anchor';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
import * as _solana_web3_js from '@solana/web3.js';
|
package/dist/borrow/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as Vaults, L as LiquidateParams } from '../shared/lend.
|
|
2
|
-
export { C as ConnectionParams, I as InitPositionIxParams, e as LiquidateContextParams, O as OperateContextParams, a as OperateParams, c as getInitPositionContext, b as getInitPositionIx, f as getLiquidateContext, h as getLiquidateIx, g as getOperateContext, d as getOperateIx } from '../shared/lend.
|
|
1
|
+
import { V as Vaults, L as LiquidateParams } from '../shared/lend.D69BluYU.js';
|
|
2
|
+
export { C as ConnectionParams, I as InitPositionIxParams, e as LiquidateContextParams, O as OperateContextParams, a as OperateParams, c as getInitPositionContext, b as getInitPositionIx, f as getLiquidateContext, h as getLiquidateIx, g as getOperateContext, d as getOperateIx } from '../shared/lend.D69BluYU.js';
|
|
3
3
|
import { Program } from '@coral-xyz/anchor';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
import * as _solana_web3_js from '@solana/web3.js';
|
package/dist/borrow/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as getLiquidateIx, a as getVaultsProgram } from '../shared/lend.
|
|
2
|
-
export { I as INIT_TICK, p as MAX_TICK, M as MIN_TICK, q as TICKS_PER_TICK_HAS_DEBT, T as TICK_HAS_DEBT_ARRAY_SIZE, s as TICK_HAS_DEBT_CHILDREN_SIZE, t as TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, u as TOTAL_INDICES_NEEDED, Z as ZERO_TICK_SCALED_RATIO, A as findNextTickWithDebt, h as getAccountOwner, i as getCurrentPosition, j as getCurrentPositionState, k as getFinalPosition, x as getFirstTickForIndex, d as getInitPositionContext, c as getInitPositionIx, f as getLiquidateContext, b as getOperateContext, e as getOperateIx, v as getRatioAtTick, w as getTickAtRatio, y as getTickIndices, l as loadRelevantBranches, o as loadRelevantBranchesForLiquidate, m as loadRelevantTicksHasDebtArrays, n as loadRelevantTicksHasDebtArraysLiquidate, r as readOraclePrice, z as readTickHasDebtArray } from '../shared/lend.
|
|
1
|
+
import { g as getLiquidateIx, a as getVaultsProgram } from '../shared/lend.aTMYZYEH.mjs';
|
|
2
|
+
export { I as INIT_TICK, p as MAX_TICK, M as MIN_TICK, q as TICKS_PER_TICK_HAS_DEBT, T as TICK_HAS_DEBT_ARRAY_SIZE, s as TICK_HAS_DEBT_CHILDREN_SIZE, t as TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, u as TOTAL_INDICES_NEEDED, Z as ZERO_TICK_SCALED_RATIO, A as findNextTickWithDebt, h as getAccountOwner, i as getCurrentPosition, j as getCurrentPositionState, k as getFinalPosition, x as getFirstTickForIndex, d as getInitPositionContext, c as getInitPositionIx, f as getLiquidateContext, b as getOperateContext, e as getOperateIx, v as getRatioAtTick, w as getTickAtRatio, y as getTickIndices, l as loadRelevantBranches, o as loadRelevantBranchesForLiquidate, m as loadRelevantTicksHasDebtArrays, n as loadRelevantTicksHasDebtArraysLiquidate, r as readOraclePrice, z as readTickHasDebtArray } from '../shared/lend.aTMYZYEH.mjs';
|
|
3
3
|
import { PublicKey, TransactionMessage, ComputeBudgetProgram, VersionedTransaction } from '@solana/web3.js';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
|
-
import { g as getVaultAdmin } from '../shared/lend.
|
|
5
|
+
import { g as getVaultAdmin } from '../shared/lend.CsYeVtpe.mjs';
|
|
6
6
|
import '@coral-xyz/anchor';
|
|
7
7
|
import '../shared/lend.CioR9-te.mjs';
|
|
8
8
|
import '@solana/spl-token';
|
package/dist/earn/index.mjs
CHANGED
|
@@ -20,10 +20,20 @@ const getAccountOwner = async (account, connection) => {
|
|
|
20
20
|
return info.owner;
|
|
21
21
|
};
|
|
22
22
|
const getOrCreateATAInstruction = async (owner, mint, connection) => {
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const tokenProgram = await getAccountOwner(mint, connection);
|
|
24
|
+
const associatedTokenAccount = await getAssociatedTokenAddress(
|
|
25
|
+
mint,
|
|
26
|
+
owner,
|
|
27
|
+
true,
|
|
28
|
+
// allowOwnerOffCurve - supports PDA owners
|
|
29
|
+
tokenProgram
|
|
26
30
|
);
|
|
31
|
+
const account = await getAccount(
|
|
32
|
+
connection,
|
|
33
|
+
associatedTokenAccount,
|
|
34
|
+
"confirmed",
|
|
35
|
+
tokenProgram
|
|
36
|
+
).catch(() => null);
|
|
27
37
|
const ixs = [];
|
|
28
38
|
if (!account) {
|
|
29
39
|
ixs.push(
|
|
@@ -31,7 +41,8 @@ const getOrCreateATAInstruction = async (owner, mint, connection) => {
|
|
|
31
41
|
owner,
|
|
32
42
|
associatedTokenAccount,
|
|
33
43
|
owner,
|
|
34
|
-
mint
|
|
44
|
+
mint,
|
|
45
|
+
tokenProgram
|
|
35
46
|
)
|
|
36
47
|
);
|
|
37
48
|
}
|
package/dist/flashloan/index.mjs
CHANGED
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.CsYeVtpe.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.6";
|
|
12
12
|
|
|
13
13
|
export { version };
|
|
@@ -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.D69BluYU.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.D69BluYU.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.CsYeVtpe.mjs';
|
|
2
|
+
import { e as getOperateIx } from '../shared/lend.aTMYZYEH.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';
|
|
@@ -776,8 +776,7 @@ const instructions = [
|
|
|
776
776
|
signer: true
|
|
777
777
|
},
|
|
778
778
|
{
|
|
779
|
-
name: "vault_admin"
|
|
780
|
-
writable: true
|
|
779
|
+
name: "vault_admin"
|
|
781
780
|
},
|
|
782
781
|
{
|
|
783
782
|
name: "vault_config",
|
|
@@ -2287,8 +2286,7 @@ const instructions = [
|
|
|
2287
2286
|
writable: true
|
|
2288
2287
|
},
|
|
2289
2288
|
{
|
|
2290
|
-
name: "new_oracle"
|
|
2291
|
-
writable: true
|
|
2289
|
+
name: "new_oracle"
|
|
2292
2290
|
},
|
|
2293
2291
|
{
|
|
2294
2292
|
name: "supply_token_reserves_liquidity",
|
|
@@ -2787,6 +2785,19 @@ const events = [
|
|
|
2787
2785
|
83
|
|
2788
2786
|
]
|
|
2789
2787
|
},
|
|
2788
|
+
{
|
|
2789
|
+
name: "LogLiquidationRoundingDiff",
|
|
2790
|
+
discriminator: [
|
|
2791
|
+
35,
|
|
2792
|
+
189,
|
|
2793
|
+
179,
|
|
2794
|
+
90,
|
|
2795
|
+
218,
|
|
2796
|
+
51,
|
|
2797
|
+
104,
|
|
2798
|
+
128
|
|
2799
|
+
]
|
|
2800
|
+
},
|
|
2790
2801
|
{
|
|
2791
2802
|
name: "LogOperate",
|
|
2792
2803
|
discriminator: [
|
|
@@ -3679,6 +3690,30 @@ const types = [
|
|
|
3679
3690
|
]
|
|
3680
3691
|
}
|
|
3681
3692
|
},
|
|
3693
|
+
{
|
|
3694
|
+
name: "LogLiquidationRoundingDiff",
|
|
3695
|
+
type: {
|
|
3696
|
+
kind: "struct",
|
|
3697
|
+
fields: [
|
|
3698
|
+
{
|
|
3699
|
+
name: "vault_id",
|
|
3700
|
+
type: "u16"
|
|
3701
|
+
},
|
|
3702
|
+
{
|
|
3703
|
+
name: "actual_debt_amt",
|
|
3704
|
+
type: "u64"
|
|
3705
|
+
},
|
|
3706
|
+
{
|
|
3707
|
+
name: "debt_amount",
|
|
3708
|
+
type: "u64"
|
|
3709
|
+
},
|
|
3710
|
+
{
|
|
3711
|
+
name: "diff",
|
|
3712
|
+
type: "u64"
|
|
3713
|
+
}
|
|
3714
|
+
]
|
|
3715
|
+
}
|
|
3716
|
+
},
|
|
3682
3717
|
{
|
|
3683
3718
|
name: "LogOperate",
|
|
3684
3719
|
type: {
|
|
@@ -4081,6 +4116,9 @@ const types = [
|
|
|
4081
4116
|
},
|
|
4082
4117
|
{
|
|
4083
4118
|
name: "SinglePool"
|
|
4119
|
+
},
|
|
4120
|
+
{
|
|
4121
|
+
name: "JupLend"
|
|
4084
4122
|
}
|
|
4085
4123
|
]
|
|
4086
4124
|
}
|
|
@@ -655,7 +655,6 @@ type Vaults = {
|
|
|
655
655
|
},
|
|
656
656
|
{
|
|
657
657
|
name: "vaultAdmin";
|
|
658
|
-
writable: true;
|
|
659
658
|
},
|
|
660
659
|
{
|
|
661
660
|
name: "vaultConfig";
|
|
@@ -1930,7 +1929,6 @@ type Vaults = {
|
|
|
1930
1929
|
},
|
|
1931
1930
|
{
|
|
1932
1931
|
name: "newOracle";
|
|
1933
|
-
writable: true;
|
|
1934
1932
|
},
|
|
1935
1933
|
{
|
|
1936
1934
|
name: "supplyTokenReservesLiquidity";
|
|
@@ -2167,6 +2165,10 @@ type Vaults = {
|
|
|
2167
2165
|
name: "logLiquidateInfo";
|
|
2168
2166
|
discriminator: [169, 150, 46, 42, 178, 89, 98, 83];
|
|
2169
2167
|
},
|
|
2168
|
+
{
|
|
2169
|
+
name: "logLiquidationRoundingDiff";
|
|
2170
|
+
discriminator: [35, 189, 179, 90, 218, 51, 104, 128];
|
|
2171
|
+
},
|
|
2170
2172
|
{
|
|
2171
2173
|
name: "logOperate";
|
|
2172
2174
|
discriminator: [180, 8, 81, 71, 19, 132, 173, 8];
|
|
@@ -2895,6 +2897,30 @@ type Vaults = {
|
|
|
2895
2897
|
];
|
|
2896
2898
|
};
|
|
2897
2899
|
},
|
|
2900
|
+
{
|
|
2901
|
+
name: "logLiquidationRoundingDiff";
|
|
2902
|
+
type: {
|
|
2903
|
+
kind: "struct";
|
|
2904
|
+
fields: [
|
|
2905
|
+
{
|
|
2906
|
+
name: "vaultId";
|
|
2907
|
+
type: "u16";
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
name: "actualDebtAmt";
|
|
2911
|
+
type: "u64";
|
|
2912
|
+
},
|
|
2913
|
+
{
|
|
2914
|
+
name: "debtAmount";
|
|
2915
|
+
type: "u64";
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
name: "diff";
|
|
2919
|
+
type: "u64";
|
|
2920
|
+
}
|
|
2921
|
+
];
|
|
2922
|
+
};
|
|
2923
|
+
},
|
|
2898
2924
|
{
|
|
2899
2925
|
name: "logOperate";
|
|
2900
2926
|
type: {
|
|
@@ -3295,6 +3321,9 @@ type Vaults = {
|
|
|
3295
3321
|
},
|
|
3296
3322
|
{
|
|
3297
3323
|
name: "singlePool";
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
name: "jupLend";
|
|
3298
3327
|
}
|
|
3299
3328
|
];
|
|
3300
3329
|
};
|
|
@@ -655,7 +655,6 @@ type Vaults = {
|
|
|
655
655
|
},
|
|
656
656
|
{
|
|
657
657
|
name: "vaultAdmin";
|
|
658
|
-
writable: true;
|
|
659
658
|
},
|
|
660
659
|
{
|
|
661
660
|
name: "vaultConfig";
|
|
@@ -1930,7 +1929,6 @@ type Vaults = {
|
|
|
1930
1929
|
},
|
|
1931
1930
|
{
|
|
1932
1931
|
name: "newOracle";
|
|
1933
|
-
writable: true;
|
|
1934
1932
|
},
|
|
1935
1933
|
{
|
|
1936
1934
|
name: "supplyTokenReservesLiquidity";
|
|
@@ -2167,6 +2165,10 @@ type Vaults = {
|
|
|
2167
2165
|
name: "logLiquidateInfo";
|
|
2168
2166
|
discriminator: [169, 150, 46, 42, 178, 89, 98, 83];
|
|
2169
2167
|
},
|
|
2168
|
+
{
|
|
2169
|
+
name: "logLiquidationRoundingDiff";
|
|
2170
|
+
discriminator: [35, 189, 179, 90, 218, 51, 104, 128];
|
|
2171
|
+
},
|
|
2170
2172
|
{
|
|
2171
2173
|
name: "logOperate";
|
|
2172
2174
|
discriminator: [180, 8, 81, 71, 19, 132, 173, 8];
|
|
@@ -2895,6 +2897,30 @@ type Vaults = {
|
|
|
2895
2897
|
];
|
|
2896
2898
|
};
|
|
2897
2899
|
},
|
|
2900
|
+
{
|
|
2901
|
+
name: "logLiquidationRoundingDiff";
|
|
2902
|
+
type: {
|
|
2903
|
+
kind: "struct";
|
|
2904
|
+
fields: [
|
|
2905
|
+
{
|
|
2906
|
+
name: "vaultId";
|
|
2907
|
+
type: "u16";
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
name: "actualDebtAmt";
|
|
2911
|
+
type: "u64";
|
|
2912
|
+
},
|
|
2913
|
+
{
|
|
2914
|
+
name: "debtAmount";
|
|
2915
|
+
type: "u64";
|
|
2916
|
+
},
|
|
2917
|
+
{
|
|
2918
|
+
name: "diff";
|
|
2919
|
+
type: "u64";
|
|
2920
|
+
}
|
|
2921
|
+
];
|
|
2922
|
+
};
|
|
2923
|
+
},
|
|
2898
2924
|
{
|
|
2899
2925
|
name: "logOperate";
|
|
2900
2926
|
type: {
|
|
@@ -3295,6 +3321,9 @@ type Vaults = {
|
|
|
3295
3321
|
},
|
|
3296
3322
|
{
|
|
3297
3323
|
name: "singlePool";
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
name: "jupLend";
|
|
3298
3327
|
}
|
|
3299
3328
|
];
|
|
3300
3329
|
};
|
|
@@ -2,14 +2,14 @@ import { PublicKey, Transaction, SystemProgram, SYSVAR_RENT_PUBKEY, SYSVAR_INSTR
|
|
|
2
2
|
import BN from 'bn.js';
|
|
3
3
|
import { Program, AnchorProvider } from '@coral-xyz/anchor';
|
|
4
4
|
import { l as liquidity } from './lend.CioR9-te.mjs';
|
|
5
|
-
import { getAssociatedTokenAddressSync, ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
6
|
-
import { a as getTickHasDebt, v as vaultsIdl, c as getPosition, d as getTick, e as getTickIdLiquidation, f as getVaultConfig, h as getBranch, i as getVaultState, j as getVaultMetadata, k as getLiquidity, l as getRateModel, m as getUserBorrowPosition, n as getUserSupplyPosition, o as getLiquidityReserve, p as getPositionTokenAccount, q as getPositionMetadata, r as getPositionMint, g as getVaultAdmin, s as getClaimAccount } from './lend.
|
|
5
|
+
import { getAssociatedTokenAddressSync, ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, NATIVE_MINT } from '@solana/spl-token';
|
|
6
|
+
import { a as getTickHasDebt, v as vaultsIdl, c as getPosition, d as getTick, e as getTickIdLiquidation, f as getVaultConfig, h as getBranch, i as getVaultState, j as getVaultMetadata, k as getLiquidity, l as getRateModel, m as getUserBorrowPosition, n as getUserSupplyPosition, o as getLiquidityReserve, p as getPositionTokenAccount, q as getPositionMetadata, r as getPositionMint, g as getVaultAdmin, s as getClaimAccount } from './lend.CsYeVtpe.mjs';
|
|
7
7
|
import { e as getReserve } from './lend.BzG5ldOV.mjs';
|
|
8
8
|
|
|
9
9
|
const address = "jupnw4B6Eqs7ft6rxpzYLJZYSnrpRgPcr589n5Kv4oc";
|
|
10
10
|
const metadata = {
|
|
11
11
|
name: "oracle",
|
|
12
|
-
version: "0.1.
|
|
12
|
+
version: "0.1.0",
|
|
13
13
|
spec: "0.1.0",
|
|
14
14
|
description: "Created with Anchor"
|
|
15
15
|
};
|
|
@@ -1575,9 +1575,13 @@ async function getOtherInstructionsOperate(vaultId, vaultState, currentPosition,
|
|
|
1575
1575
|
let newBranchId;
|
|
1576
1576
|
if (vaultState.branchLiquidated) {
|
|
1577
1577
|
newBranchId = vaultState.totalBranchId + 1;
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1578
|
+
let newBranchData = null;
|
|
1579
|
+
try {
|
|
1580
|
+
newBranchData = await program.account.branch.fetch(
|
|
1581
|
+
getBranch(vaultId, newBranchId)
|
|
1582
|
+
);
|
|
1583
|
+
} catch {
|
|
1584
|
+
}
|
|
1581
1585
|
if (!newBranchData) {
|
|
1582
1586
|
const ix = await program.methods.initBranch(vaultId, newBranchId).accounts(getInitBranchContext(vaultId, newBranchId, signer)).instruction();
|
|
1583
1587
|
otherIxs.push(ix);
|
|
@@ -1758,6 +1762,7 @@ async function getOperateContext({
|
|
|
1758
1762
|
});
|
|
1759
1763
|
if (existingPositionTick === -2147483648) {
|
|
1760
1764
|
existingPositionTick = currentPosition.tick;
|
|
1765
|
+
existingPositionTickId = 0;
|
|
1761
1766
|
}
|
|
1762
1767
|
const currentPositionTickPda = getTick(
|
|
1763
1768
|
vaultId,
|
|
@@ -1952,6 +1957,14 @@ const getOperateIx = async ({
|
|
|
1952
1957
|
recipient,
|
|
1953
1958
|
program
|
|
1954
1959
|
});
|
|
1960
|
+
if (accounts.borrowToken.toString() !== NATIVE_MINT.toString()) {
|
|
1961
|
+
const userDebtTokenBalance = await connection.getTokenAccountBalance(
|
|
1962
|
+
accounts.signerBorrowTokenAccount
|
|
1963
|
+
);
|
|
1964
|
+
if (debtAmount.lt(new BN(0)) && userDebtTokenBalance.value.amount === debtAmount.abs().toString()) {
|
|
1965
|
+
debtAmount = debtAmount.add(new BN(1));
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1955
1968
|
const [operateIx, addressLookupTable] = await Promise.all([
|
|
1956
1969
|
program.methods.operate(
|
|
1957
1970
|
colAmount,
|