@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.
@@ -1,7 +1,7 @@
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';
1
+ import { V as Vaults, L as LiquidateParams } from '../shared/lend.B1GEdPEJ.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.B1GEdPEJ.mjs';
3
3
  import { Program } from '@coral-xyz/anchor';
4
- import BN from 'bn.js';
4
+ import BN__default from 'bn.js';
5
5
  import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { Connection, PublicKey } from '@solana/web3.js';
7
7
 
@@ -22,14 +22,19 @@ declare const getVaultsProgram: ({ connection, signer, }: {
22
22
  signer: PublicKey;
23
23
  }) => Program<Vaults>;
24
24
  declare const INIT_TICK = -2147483648;
25
+ declare const MIN_I128: BN__default;
26
+ /** Use as `debtAmount` in getOperateIx to repay all debt. */
27
+ declare const MAX_REPAY_AMOUNT: BN__default;
28
+ /** Use as `colAmount` in getOperateIx to withdraw all collateral (subject to LTV). */
29
+ declare const MAX_WITHDRAW_AMOUNT: BN__default;
25
30
  declare const getAccountOwner: (account: PublicKey, connection: Connection) => Promise<PublicKey>;
26
31
  declare const getCurrentPosition: ({ vaultId, positionId, connection, }: GetCurrentPositionParams) => Promise<{
27
32
  tick: number;
28
33
  tickId: number;
29
- colRaw: BN;
30
- finalAmount: BN;
31
- debtRaw: BN;
32
- dustDebtRaw: BN;
34
+ colRaw: BN__default;
35
+ finalAmount: BN__default;
36
+ debtRaw: BN__default;
37
+ dustDebtRaw: BN__default;
33
38
  isSupplyOnlyPosition: boolean;
34
39
  userLiquidationStatus: boolean;
35
40
  postLiquidationBranchId: number;
@@ -37,10 +42,10 @@ declare const getCurrentPosition: ({ vaultId, positionId, connection, }: GetCurr
37
42
  declare const getCurrentPositionState: ({ vaultId, position, program, }: GetCurrentPositionStateParams) => Promise<{
38
43
  tick: number;
39
44
  tickId: number;
40
- colRaw: BN;
41
- finalAmount: BN;
42
- debtRaw: BN;
43
- dustDebtRaw: BN;
45
+ colRaw: BN__default;
46
+ finalAmount: BN__default;
47
+ debtRaw: BN__default;
48
+ dustDebtRaw: BN__default;
44
49
  isSupplyOnlyPosition: boolean;
45
50
  userLiquidationStatus: boolean;
46
51
  postLiquidationBranchId: number;
@@ -48,18 +53,18 @@ declare const getCurrentPositionState: ({ vaultId, position, program, }: GetCurr
48
53
  declare const getFinalPosition: ({ vaultId, currentPosition, newColAmount, newDebtAmount, program, connection, signer, }: {
49
54
  vaultId: number;
50
55
  currentPosition: Awaited<ReturnType<typeof getCurrentPositionState>>;
51
- newColAmount: BN;
52
- newDebtAmount: BN;
56
+ newColAmount: BN__default;
57
+ newDebtAmount: BN__default;
53
58
  program?: Program<Vaults>;
54
59
  connection: Connection;
55
60
  signer: PublicKey;
56
61
  }) => Promise<{
57
62
  tick: number;
58
63
  tickId: number;
59
- colRaw: BN;
60
- debtRaw: BN;
61
- dustDebtRaw: BN;
62
- finalAmount: BN;
64
+ colRaw: BN__default;
65
+ debtRaw: BN__default;
66
+ dustDebtRaw: BN__default;
67
+ finalAmount: BN__default;
63
68
  isSupplyOnlyPosition: boolean;
64
69
  }>;
65
70
  declare function loadRelevantBranches(vaultId: number, vaultState: VaultState, liquidationStatus: boolean, postLiquidationBranchId: number, program: Program<Vaults>): Promise<number[]>;
@@ -82,8 +87,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
82
87
  oracleSources: {
83
88
  source: PublicKey;
84
89
  invert: boolean;
85
- multiplier: BN;
86
- divisor: BN;
90
+ multiplier: BN__default;
91
+ divisor: BN__default;
87
92
  sourceType: ({
88
93
  stakePool?: undefined;
89
94
  msolPool?: undefined;
@@ -91,6 +96,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
91
96
  chainlink?: undefined;
92
97
  singlePool?: undefined;
93
98
  jupLend?: undefined;
99
+ chainlinkDataStreams?: undefined;
94
100
  } & {
95
101
  pyth: Record<string, never>;
96
102
  }) | ({
@@ -100,6 +106,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
100
106
  chainlink?: undefined;
101
107
  singlePool?: undefined;
102
108
  jupLend?: undefined;
109
+ chainlinkDataStreams?: undefined;
103
110
  } & {
104
111
  stakePool: Record<string, never>;
105
112
  }) | ({
@@ -109,6 +116,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
109
116
  chainlink?: undefined;
110
117
  singlePool?: undefined;
111
118
  jupLend?: undefined;
119
+ chainlinkDataStreams?: undefined;
112
120
  } & {
113
121
  msolPool: Record<string, never>;
114
122
  }) | ({
@@ -118,6 +126,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
118
126
  chainlink?: undefined;
119
127
  singlePool?: undefined;
120
128
  jupLend?: undefined;
129
+ chainlinkDataStreams?: undefined;
121
130
  } & {
122
131
  redstone: Record<string, never>;
123
132
  }) | ({
@@ -127,6 +136,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
127
136
  redstone?: undefined;
128
137
  singlePool?: undefined;
129
138
  jupLend?: undefined;
139
+ chainlinkDataStreams?: undefined;
130
140
  } & {
131
141
  chainlink: Record<string, never>;
132
142
  }) | ({
@@ -136,6 +146,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
136
146
  redstone?: undefined;
137
147
  chainlink?: undefined;
138
148
  jupLend?: undefined;
149
+ chainlinkDataStreams?: undefined;
139
150
  } & {
140
151
  singlePool: Record<string, never>;
141
152
  }) | ({
@@ -145,22 +156,33 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
145
156
  redstone?: undefined;
146
157
  chainlink?: undefined;
147
158
  singlePool?: undefined;
159
+ chainlinkDataStreams?: undefined;
148
160
  } & {
149
161
  jupLend: Record<string, never>;
162
+ }) | ({
163
+ pyth?: undefined;
164
+ stakePool?: undefined;
165
+ msolPool?: undefined;
166
+ redstone?: undefined;
167
+ chainlink?: undefined;
168
+ singlePool?: undefined;
169
+ jupLend?: undefined;
170
+ } & {
171
+ chainlinkDataStreams: Record<string, never>;
150
172
  });
151
173
  }[];
152
174
  }>;
153
175
 
154
176
  declare const MIN_TICK = -16383;
155
177
  declare const MAX_TICK = 16383;
156
- declare const ZERO_TICK_SCALED_RATIO: BN;
178
+ declare const ZERO_TICK_SCALED_RATIO: BN__default;
157
179
  declare const TICK_HAS_DEBT_ARRAY_SIZE = 8;
158
180
  declare const TICKS_PER_TICK_HAS_DEBT: number;
159
181
  declare const TICK_HAS_DEBT_CHILDREN_SIZE = 32;
160
182
  declare const TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS = 256;
161
183
  declare const TOTAL_INDICES_NEEDED = 16;
162
- declare function getRatioAtTick(tick: number): BN;
163
- declare function getTickAtRatio(ratioX48: BN): number;
184
+ declare function getRatioAtTick(tick: number): BN__default;
185
+ declare function getTickAtRatio(ratioX48: BN__default): number;
164
186
  declare function getFirstTickForIndex(index: number): number;
165
187
  declare function getTickIndices(tick: number): {
166
188
  arrayIndex: number;
@@ -196,4 +218,4 @@ declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" |
196
218
  }[];
197
219
  }[]>;
198
220
 
199
- export { INIT_TICK, LiquidateParams, MAX_TICK, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
221
+ export { INIT_TICK, LiquidateParams, MAX_REPAY_AMOUNT, MAX_TICK, MAX_WITHDRAW_AMOUNT, MIN_I128, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
@@ -1,7 +1,7 @@
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';
1
+ import { V as Vaults, L as LiquidateParams } from '../shared/lend.B1GEdPEJ.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.B1GEdPEJ.js';
3
3
  import { Program } from '@coral-xyz/anchor';
4
- import BN from 'bn.js';
4
+ import BN__default from 'bn.js';
5
5
  import * as _solana_web3_js from '@solana/web3.js';
6
6
  import { Connection, PublicKey } from '@solana/web3.js';
7
7
 
@@ -22,14 +22,19 @@ declare const getVaultsProgram: ({ connection, signer, }: {
22
22
  signer: PublicKey;
23
23
  }) => Program<Vaults>;
24
24
  declare const INIT_TICK = -2147483648;
25
+ declare const MIN_I128: BN__default;
26
+ /** Use as `debtAmount` in getOperateIx to repay all debt. */
27
+ declare const MAX_REPAY_AMOUNT: BN__default;
28
+ /** Use as `colAmount` in getOperateIx to withdraw all collateral (subject to LTV). */
29
+ declare const MAX_WITHDRAW_AMOUNT: BN__default;
25
30
  declare const getAccountOwner: (account: PublicKey, connection: Connection) => Promise<PublicKey>;
26
31
  declare const getCurrentPosition: ({ vaultId, positionId, connection, }: GetCurrentPositionParams) => Promise<{
27
32
  tick: number;
28
33
  tickId: number;
29
- colRaw: BN;
30
- finalAmount: BN;
31
- debtRaw: BN;
32
- dustDebtRaw: BN;
34
+ colRaw: BN__default;
35
+ finalAmount: BN__default;
36
+ debtRaw: BN__default;
37
+ dustDebtRaw: BN__default;
33
38
  isSupplyOnlyPosition: boolean;
34
39
  userLiquidationStatus: boolean;
35
40
  postLiquidationBranchId: number;
@@ -37,10 +42,10 @@ declare const getCurrentPosition: ({ vaultId, positionId, connection, }: GetCurr
37
42
  declare const getCurrentPositionState: ({ vaultId, position, program, }: GetCurrentPositionStateParams) => Promise<{
38
43
  tick: number;
39
44
  tickId: number;
40
- colRaw: BN;
41
- finalAmount: BN;
42
- debtRaw: BN;
43
- dustDebtRaw: BN;
45
+ colRaw: BN__default;
46
+ finalAmount: BN__default;
47
+ debtRaw: BN__default;
48
+ dustDebtRaw: BN__default;
44
49
  isSupplyOnlyPosition: boolean;
45
50
  userLiquidationStatus: boolean;
46
51
  postLiquidationBranchId: number;
@@ -48,18 +53,18 @@ declare const getCurrentPositionState: ({ vaultId, position, program, }: GetCurr
48
53
  declare const getFinalPosition: ({ vaultId, currentPosition, newColAmount, newDebtAmount, program, connection, signer, }: {
49
54
  vaultId: number;
50
55
  currentPosition: Awaited<ReturnType<typeof getCurrentPositionState>>;
51
- newColAmount: BN;
52
- newDebtAmount: BN;
56
+ newColAmount: BN__default;
57
+ newDebtAmount: BN__default;
53
58
  program?: Program<Vaults>;
54
59
  connection: Connection;
55
60
  signer: PublicKey;
56
61
  }) => Promise<{
57
62
  tick: number;
58
63
  tickId: number;
59
- colRaw: BN;
60
- debtRaw: BN;
61
- dustDebtRaw: BN;
62
- finalAmount: BN;
64
+ colRaw: BN__default;
65
+ debtRaw: BN__default;
66
+ dustDebtRaw: BN__default;
67
+ finalAmount: BN__default;
63
68
  isSupplyOnlyPosition: boolean;
64
69
  }>;
65
70
  declare function loadRelevantBranches(vaultId: number, vaultState: VaultState, liquidationStatus: boolean, postLiquidationBranchId: number, program: Program<Vaults>): Promise<number[]>;
@@ -82,8 +87,8 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
82
87
  oracleSources: {
83
88
  source: PublicKey;
84
89
  invert: boolean;
85
- multiplier: BN;
86
- divisor: BN;
90
+ multiplier: BN__default;
91
+ divisor: BN__default;
87
92
  sourceType: ({
88
93
  stakePool?: undefined;
89
94
  msolPool?: undefined;
@@ -91,6 +96,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
91
96
  chainlink?: undefined;
92
97
  singlePool?: undefined;
93
98
  jupLend?: undefined;
99
+ chainlinkDataStreams?: undefined;
94
100
  } & {
95
101
  pyth: Record<string, never>;
96
102
  }) | ({
@@ -100,6 +106,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
100
106
  chainlink?: undefined;
101
107
  singlePool?: undefined;
102
108
  jupLend?: undefined;
109
+ chainlinkDataStreams?: undefined;
103
110
  } & {
104
111
  stakePool: Record<string, never>;
105
112
  }) | ({
@@ -109,6 +116,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
109
116
  chainlink?: undefined;
110
117
  singlePool?: undefined;
111
118
  jupLend?: undefined;
119
+ chainlinkDataStreams?: undefined;
112
120
  } & {
113
121
  msolPool: Record<string, never>;
114
122
  }) | ({
@@ -118,6 +126,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
118
126
  chainlink?: undefined;
119
127
  singlePool?: undefined;
120
128
  jupLend?: undefined;
129
+ chainlinkDataStreams?: undefined;
121
130
  } & {
122
131
  redstone: Record<string, never>;
123
132
  }) | ({
@@ -127,6 +136,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
127
136
  redstone?: undefined;
128
137
  singlePool?: undefined;
129
138
  jupLend?: undefined;
139
+ chainlinkDataStreams?: undefined;
130
140
  } & {
131
141
  chainlink: Record<string, never>;
132
142
  }) | ({
@@ -136,6 +146,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
136
146
  redstone?: undefined;
137
147
  chainlink?: undefined;
138
148
  jupLend?: undefined;
149
+ chainlinkDataStreams?: undefined;
139
150
  } & {
140
151
  singlePool: Record<string, never>;
141
152
  }) | ({
@@ -145,22 +156,33 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
145
156
  redstone?: undefined;
146
157
  chainlink?: undefined;
147
158
  singlePool?: undefined;
159
+ chainlinkDataStreams?: undefined;
148
160
  } & {
149
161
  jupLend: Record<string, never>;
162
+ }) | ({
163
+ pyth?: undefined;
164
+ stakePool?: undefined;
165
+ msolPool?: undefined;
166
+ redstone?: undefined;
167
+ chainlink?: undefined;
168
+ singlePool?: undefined;
169
+ jupLend?: undefined;
170
+ } & {
171
+ chainlinkDataStreams: Record<string, never>;
150
172
  });
151
173
  }[];
152
174
  }>;
153
175
 
154
176
  declare const MIN_TICK = -16383;
155
177
  declare const MAX_TICK = 16383;
156
- declare const ZERO_TICK_SCALED_RATIO: BN;
178
+ declare const ZERO_TICK_SCALED_RATIO: BN__default;
157
179
  declare const TICK_HAS_DEBT_ARRAY_SIZE = 8;
158
180
  declare const TICKS_PER_TICK_HAS_DEBT: number;
159
181
  declare const TICK_HAS_DEBT_CHILDREN_SIZE = 32;
160
182
  declare const TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS = 256;
161
183
  declare const TOTAL_INDICES_NEEDED = 16;
162
- declare function getRatioAtTick(tick: number): BN;
163
- declare function getTickAtRatio(ratioX48: BN): number;
184
+ declare function getRatioAtTick(tick: number): BN__default;
185
+ declare function getTickAtRatio(ratioX48: BN__default): number;
164
186
  declare function getFirstTickForIndex(index: number): number;
165
187
  declare function getTickIndices(tick: number): {
166
188
  arrayIndex: number;
@@ -196,4 +218,4 @@ declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" |
196
218
  }[];
197
219
  }[]>;
198
220
 
199
- export { INIT_TICK, LiquidateParams, MAX_TICK, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
221
+ export { INIT_TICK, LiquidateParams, MAX_REPAY_AMOUNT, MAX_TICK, MAX_WITHDRAW_AMOUNT, MIN_I128, MIN_TICK, TICKS_PER_TICK_HAS_DEBT, TICK_HAS_DEBT_ARRAY_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE, TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, TOTAL_INDICES_NEEDED, ZERO_TICK_SCALED_RATIO, findNextTickWithDebt, getAccountOwner, getAllLiquidations, getCurrentPosition, getCurrentPositionState, getFinalPosition, getFirstTickForIndex, getLiquidations, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
@@ -1,8 +1,8 @@
1
- import { g as getLiquidateIx, a as getVaultsProgram } from '../shared/lend.Bh9Wk7OH.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.Bh9Wk7OH.mjs';
1
+ import { g as getLiquidateIx, a as getVaultsProgram } from '../shared/lend.BaZsInAi.mjs';
2
+ export { I as INIT_TICK, h as MAX_REPAY_AMOUNT, t as MAX_TICK, i as MAX_WITHDRAW_AMOUNT, M as MIN_I128, s as MIN_TICK, u as TICKS_PER_TICK_HAS_DEBT, T as TICK_HAS_DEBT_ARRAY_SIZE, v as TICK_HAS_DEBT_CHILDREN_SIZE, w as TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, x as TOTAL_INDICES_NEEDED, Z as ZERO_TICK_SCALED_RATIO, D as findNextTickWithDebt, j as getAccountOwner, k as getCurrentPosition, l as getCurrentPositionState, m as getFinalPosition, A as getFirstTickForIndex, d as getInitPositionContext, c as getInitPositionIx, f as getLiquidateContext, b as getOperateContext, e as getOperateIx, y as getRatioAtTick, z as getTickAtRatio, B as getTickIndices, n as loadRelevantBranches, q as loadRelevantBranchesForLiquidate, o as loadRelevantTicksHasDebtArrays, p as loadRelevantTicksHasDebtArraysLiquidate, r as readOraclePrice, C as readTickHasDebtArray } from '../shared/lend.BaZsInAi.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.CsYeVtpe.mjs';
5
+ import { g as getVaultAdmin } from '../shared/lend.Cw-khlBI.mjs';
6
6
  import '@coral-xyz/anchor';
7
7
  import '../shared/lend.CioR9-te.mjs';
8
8
  import '@solana/spl-token';
@@ -1,5 +1,6 @@
1
1
  import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
2
- import BN from 'bn.js';
2
+ import * as BN from 'bn.js';
3
+ import BN__default from 'bn.js';
3
4
  import { Program } from '@coral-xyz/anchor';
4
5
 
5
6
  type ConnectionParams = {
@@ -11,10 +12,10 @@ type DepositContextParams = {
11
12
  signer: PublicKey;
12
13
  } & ConnectionParams;
13
14
  type DepositParams = {
14
- amount: BN;
15
+ amount: BN__default;
15
16
  } & DepositContextParams;
16
17
  type MintParams = {
17
- shares: BN;
18
+ shares: BN__default;
18
19
  } & DepositContextParams;
19
20
  declare function getDepositContext({ asset, signer, connection, }: DepositContextParams): Promise<{
20
21
  signer: PublicKey;
@@ -64,10 +65,10 @@ type WithdrawContextParams = {
64
65
  signer: PublicKey;
65
66
  } & ConnectionParams;
66
67
  type WithdrawParams = {
67
- amount: BN;
68
+ amount: BN__default;
68
69
  } & WithdrawContextParams;
69
70
  type RedeemParams = {
70
- shares: BN;
71
+ shares: BN__default;
71
72
  } & WithdrawContextParams;
72
73
  declare function getWithdrawContext({ asset, signer, connection, }: WithdrawContextParams): Promise<{
73
74
  signer: PublicKey;
@@ -1854,6 +1855,9 @@ type Lending = {
1854
1855
  ];
1855
1856
  };
1856
1857
 
1858
+ declare const U64_MAX: BN;
1859
+ declare const MAX_DEPOSIT: BN;
1860
+ declare const MAX_WITHDRAW: BN;
1857
1861
  declare const getLendingProgram: ({ connection, signer, }: {
1858
1862
  connection: Connection;
1859
1863
  signer?: PublicKey;
@@ -1872,22 +1876,22 @@ declare const getLendingTokenDetails: ({ lendingToken, connection, }: {
1872
1876
  address: PublicKey;
1873
1877
  asset: PublicKey;
1874
1878
  decimals: number;
1875
- totalAssets: BN;
1876
- totalSupply: BN;
1877
- convertToShares: BN;
1878
- convertToAssets: BN;
1879
- rewardsRate: BN;
1880
- supplyRate: BN;
1879
+ totalAssets: BN__default;
1880
+ totalSupply: BN__default;
1881
+ convertToShares: BN__default;
1882
+ convertToAssets: BN__default;
1883
+ rewardsRate: BN__default;
1884
+ supplyRate: BN__default;
1881
1885
  }>;
1882
1886
  declare const getUserLendingPositionByAsset: ({ user, asset, connection, }: {
1883
1887
  user: PublicKey;
1884
1888
  asset: PublicKey;
1885
1889
  connection: Connection;
1886
1890
  }) => Promise<{
1887
- lendingTokenShares: BN;
1888
- underlyingAssets: BN;
1889
- underlyingBalance: BN;
1891
+ lendingTokenShares: BN__default;
1892
+ underlyingAssets: BN__default;
1893
+ underlyingBalance: BN__default;
1890
1894
  }>;
1891
1895
 
1892
- export { getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
1896
+ export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
1893
1897
  export type { ConnectionParams, DepositContextParams, DepositParams, MintParams, RedeemParams, WithdrawContextParams, WithdrawParams };
@@ -1,5 +1,6 @@
1
1
  import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
2
- import BN from 'bn.js';
2
+ import * as BN from 'bn.js';
3
+ import BN__default from 'bn.js';
3
4
  import { Program } from '@coral-xyz/anchor';
4
5
 
5
6
  type ConnectionParams = {
@@ -11,10 +12,10 @@ type DepositContextParams = {
11
12
  signer: PublicKey;
12
13
  } & ConnectionParams;
13
14
  type DepositParams = {
14
- amount: BN;
15
+ amount: BN__default;
15
16
  } & DepositContextParams;
16
17
  type MintParams = {
17
- shares: BN;
18
+ shares: BN__default;
18
19
  } & DepositContextParams;
19
20
  declare function getDepositContext({ asset, signer, connection, }: DepositContextParams): Promise<{
20
21
  signer: PublicKey;
@@ -64,10 +65,10 @@ type WithdrawContextParams = {
64
65
  signer: PublicKey;
65
66
  } & ConnectionParams;
66
67
  type WithdrawParams = {
67
- amount: BN;
68
+ amount: BN__default;
68
69
  } & WithdrawContextParams;
69
70
  type RedeemParams = {
70
- shares: BN;
71
+ shares: BN__default;
71
72
  } & WithdrawContextParams;
72
73
  declare function getWithdrawContext({ asset, signer, connection, }: WithdrawContextParams): Promise<{
73
74
  signer: PublicKey;
@@ -1854,6 +1855,9 @@ type Lending = {
1854
1855
  ];
1855
1856
  };
1856
1857
 
1858
+ declare const U64_MAX: BN;
1859
+ declare const MAX_DEPOSIT: BN;
1860
+ declare const MAX_WITHDRAW: BN;
1857
1861
  declare const getLendingProgram: ({ connection, signer, }: {
1858
1862
  connection: Connection;
1859
1863
  signer?: PublicKey;
@@ -1872,22 +1876,22 @@ declare const getLendingTokenDetails: ({ lendingToken, connection, }: {
1872
1876
  address: PublicKey;
1873
1877
  asset: PublicKey;
1874
1878
  decimals: number;
1875
- totalAssets: BN;
1876
- totalSupply: BN;
1877
- convertToShares: BN;
1878
- convertToAssets: BN;
1879
- rewardsRate: BN;
1880
- supplyRate: BN;
1879
+ totalAssets: BN__default;
1880
+ totalSupply: BN__default;
1881
+ convertToShares: BN__default;
1882
+ convertToAssets: BN__default;
1883
+ rewardsRate: BN__default;
1884
+ supplyRate: BN__default;
1881
1885
  }>;
1882
1886
  declare const getUserLendingPositionByAsset: ({ user, asset, connection, }: {
1883
1887
  user: PublicKey;
1884
1888
  asset: PublicKey;
1885
1889
  connection: Connection;
1886
1890
  }) => Promise<{
1887
- lendingTokenShares: BN;
1888
- underlyingAssets: BN;
1889
- underlyingBalance: BN;
1891
+ lendingTokenShares: BN__default;
1892
+ underlyingAssets: BN__default;
1893
+ underlyingBalance: BN__default;
1890
1894
  }>;
1891
1895
 
1892
- export { getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
1896
+ export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
1893
1897
  export type { ConnectionParams, DepositContextParams, DepositParams, MintParams, RedeemParams, WithdrawContextParams, WithdrawParams };