@jup-ag/lend 0.1.8 → 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 +25 -5
- package/dist/borrow/index.d.ts +25 -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.Cg37G_AM.d.mts → lend.34CmCyWr.d.mts} +14 -8
- package/dist/shared/{lend.Cg37G_AM.d.ts → lend.34CmCyWr.d.ts} +14 -8
- 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.BSHVKmia.mjs +0 -2327
- package/dist/shared/lend.CioR9-te.mjs +0 -5
- package/dist/shared/lend.Cr2l14_0.mjs +0 -741
- package/dist/shared/lend.CsYeVtpe.mjs +0 -5011
- package/dist/shared/lend.DS0KoPpL.mjs +0 -2175
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.34CmCyWr.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.34CmCyWr.mjs';
|
|
3
3
|
import { Program } from '@coral-xyz/anchor';
|
|
4
4
|
import BN__default from 'bn.js';
|
|
5
5
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
@@ -11,15 +11,17 @@ type GetCurrentPositionParams = {
|
|
|
11
11
|
vaultId: number;
|
|
12
12
|
positionId: number;
|
|
13
13
|
connection: Connection;
|
|
14
|
+
market: "main" | "ethena";
|
|
14
15
|
};
|
|
15
16
|
type GetCurrentPositionStateParams = {
|
|
16
17
|
vaultId: number;
|
|
17
18
|
position: PositionData;
|
|
18
19
|
program: Program<Vaults>;
|
|
19
20
|
};
|
|
20
|
-
declare const getVaultsProgram: ({ connection, signer, }: {
|
|
21
|
+
declare const getVaultsProgram: ({ connection, signer, market, }: {
|
|
21
22
|
connection: Connection;
|
|
22
23
|
signer: PublicKey;
|
|
24
|
+
market: "main" | "ethena";
|
|
23
25
|
}) => Program<Vaults>;
|
|
24
26
|
declare const INIT_TICK = -2147483648;
|
|
25
27
|
declare const MIN_I128: BN__default;
|
|
@@ -28,7 +30,7 @@ declare const MAX_REPAY_AMOUNT: BN__default;
|
|
|
28
30
|
/** Use as `colAmount` in getOperateIx to withdraw all collateral (subject to LTV). */
|
|
29
31
|
declare const MAX_WITHDRAW_AMOUNT: BN__default;
|
|
30
32
|
declare const getAccountOwner: (account: PublicKey, connection: Connection) => Promise<PublicKey>;
|
|
31
|
-
declare const getCurrentPosition: ({ vaultId, positionId, connection, }: GetCurrentPositionParams) => Promise<{
|
|
33
|
+
declare const getCurrentPosition: ({ vaultId, positionId, connection, market, }: GetCurrentPositionParams) => Promise<{
|
|
32
34
|
tick: number;
|
|
33
35
|
tickId: number;
|
|
34
36
|
colRaw: BN__default;
|
|
@@ -96,6 +98,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
96
98
|
chainlink?: undefined;
|
|
97
99
|
singlePool?: undefined;
|
|
98
100
|
jupLend?: undefined;
|
|
101
|
+
chainlinkDataStreams?: undefined;
|
|
99
102
|
} & {
|
|
100
103
|
pyth: Record<string, never>;
|
|
101
104
|
}) | ({
|
|
@@ -105,6 +108,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
105
108
|
chainlink?: undefined;
|
|
106
109
|
singlePool?: undefined;
|
|
107
110
|
jupLend?: undefined;
|
|
111
|
+
chainlinkDataStreams?: undefined;
|
|
108
112
|
} & {
|
|
109
113
|
stakePool: Record<string, never>;
|
|
110
114
|
}) | ({
|
|
@@ -114,6 +118,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
114
118
|
chainlink?: undefined;
|
|
115
119
|
singlePool?: undefined;
|
|
116
120
|
jupLend?: undefined;
|
|
121
|
+
chainlinkDataStreams?: undefined;
|
|
117
122
|
} & {
|
|
118
123
|
msolPool: Record<string, never>;
|
|
119
124
|
}) | ({
|
|
@@ -123,6 +128,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
123
128
|
chainlink?: undefined;
|
|
124
129
|
singlePool?: undefined;
|
|
125
130
|
jupLend?: undefined;
|
|
131
|
+
chainlinkDataStreams?: undefined;
|
|
126
132
|
} & {
|
|
127
133
|
redstone: Record<string, never>;
|
|
128
134
|
}) | ({
|
|
@@ -132,6 +138,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
132
138
|
redstone?: undefined;
|
|
133
139
|
singlePool?: undefined;
|
|
134
140
|
jupLend?: undefined;
|
|
141
|
+
chainlinkDataStreams?: undefined;
|
|
135
142
|
} & {
|
|
136
143
|
chainlink: Record<string, never>;
|
|
137
144
|
}) | ({
|
|
@@ -141,6 +148,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
141
148
|
redstone?: undefined;
|
|
142
149
|
chainlink?: undefined;
|
|
143
150
|
jupLend?: undefined;
|
|
151
|
+
chainlinkDataStreams?: undefined;
|
|
144
152
|
} & {
|
|
145
153
|
singlePool: Record<string, never>;
|
|
146
154
|
}) | ({
|
|
@@ -150,11 +158,23 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
150
158
|
redstone?: undefined;
|
|
151
159
|
chainlink?: undefined;
|
|
152
160
|
singlePool?: undefined;
|
|
161
|
+
chainlinkDataStreams?: undefined;
|
|
153
162
|
} & {
|
|
154
163
|
jupLend: Record<string, never>;
|
|
164
|
+
}) | ({
|
|
165
|
+
pyth?: undefined;
|
|
166
|
+
stakePool?: undefined;
|
|
167
|
+
msolPool?: undefined;
|
|
168
|
+
redstone?: undefined;
|
|
169
|
+
chainlink?: undefined;
|
|
170
|
+
singlePool?: undefined;
|
|
171
|
+
jupLend?: undefined;
|
|
172
|
+
} & {
|
|
173
|
+
chainlinkDataStreams: Record<string, never>;
|
|
155
174
|
});
|
|
156
175
|
}[];
|
|
157
176
|
}>;
|
|
177
|
+
declare const getLiquidityProgramId: (market: "main" | "ethena") => PublicKey;
|
|
158
178
|
|
|
159
179
|
declare const MIN_TICK = -16383;
|
|
160
180
|
declare const MAX_TICK = 16383;
|
|
@@ -201,4 +221,4 @@ declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" |
|
|
|
201
221
|
}[];
|
|
202
222
|
}[]>;
|
|
203
223
|
|
|
204
|
-
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 };
|
|
224
|
+
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, getLiquidityProgramId, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
|
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.34CmCyWr.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.34CmCyWr.js';
|
|
3
3
|
import { Program } from '@coral-xyz/anchor';
|
|
4
4
|
import BN__default from 'bn.js';
|
|
5
5
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
@@ -11,15 +11,17 @@ type GetCurrentPositionParams = {
|
|
|
11
11
|
vaultId: number;
|
|
12
12
|
positionId: number;
|
|
13
13
|
connection: Connection;
|
|
14
|
+
market: "main" | "ethena";
|
|
14
15
|
};
|
|
15
16
|
type GetCurrentPositionStateParams = {
|
|
16
17
|
vaultId: number;
|
|
17
18
|
position: PositionData;
|
|
18
19
|
program: Program<Vaults>;
|
|
19
20
|
};
|
|
20
|
-
declare const getVaultsProgram: ({ connection, signer, }: {
|
|
21
|
+
declare const getVaultsProgram: ({ connection, signer, market, }: {
|
|
21
22
|
connection: Connection;
|
|
22
23
|
signer: PublicKey;
|
|
24
|
+
market: "main" | "ethena";
|
|
23
25
|
}) => Program<Vaults>;
|
|
24
26
|
declare const INIT_TICK = -2147483648;
|
|
25
27
|
declare const MIN_I128: BN__default;
|
|
@@ -28,7 +30,7 @@ declare const MAX_REPAY_AMOUNT: BN__default;
|
|
|
28
30
|
/** Use as `colAmount` in getOperateIx to withdraw all collateral (subject to LTV). */
|
|
29
31
|
declare const MAX_WITHDRAW_AMOUNT: BN__default;
|
|
30
32
|
declare const getAccountOwner: (account: PublicKey, connection: Connection) => Promise<PublicKey>;
|
|
31
|
-
declare const getCurrentPosition: ({ vaultId, positionId, connection, }: GetCurrentPositionParams) => Promise<{
|
|
33
|
+
declare const getCurrentPosition: ({ vaultId, positionId, connection, market, }: GetCurrentPositionParams) => Promise<{
|
|
32
34
|
tick: number;
|
|
33
35
|
tickId: number;
|
|
34
36
|
colRaw: BN__default;
|
|
@@ -96,6 +98,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
96
98
|
chainlink?: undefined;
|
|
97
99
|
singlePool?: undefined;
|
|
98
100
|
jupLend?: undefined;
|
|
101
|
+
chainlinkDataStreams?: undefined;
|
|
99
102
|
} & {
|
|
100
103
|
pyth: Record<string, never>;
|
|
101
104
|
}) | ({
|
|
@@ -105,6 +108,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
105
108
|
chainlink?: undefined;
|
|
106
109
|
singlePool?: undefined;
|
|
107
110
|
jupLend?: undefined;
|
|
111
|
+
chainlinkDataStreams?: undefined;
|
|
108
112
|
} & {
|
|
109
113
|
stakePool: Record<string, never>;
|
|
110
114
|
}) | ({
|
|
@@ -114,6 +118,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
114
118
|
chainlink?: undefined;
|
|
115
119
|
singlePool?: undefined;
|
|
116
120
|
jupLend?: undefined;
|
|
121
|
+
chainlinkDataStreams?: undefined;
|
|
117
122
|
} & {
|
|
118
123
|
msolPool: Record<string, never>;
|
|
119
124
|
}) | ({
|
|
@@ -123,6 +128,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
123
128
|
chainlink?: undefined;
|
|
124
129
|
singlePool?: undefined;
|
|
125
130
|
jupLend?: undefined;
|
|
131
|
+
chainlinkDataStreams?: undefined;
|
|
126
132
|
} & {
|
|
127
133
|
redstone: Record<string, never>;
|
|
128
134
|
}) | ({
|
|
@@ -132,6 +138,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
132
138
|
redstone?: undefined;
|
|
133
139
|
singlePool?: undefined;
|
|
134
140
|
jupLend?: undefined;
|
|
141
|
+
chainlinkDataStreams?: undefined;
|
|
135
142
|
} & {
|
|
136
143
|
chainlink: Record<string, never>;
|
|
137
144
|
}) | ({
|
|
@@ -141,6 +148,7 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
141
148
|
redstone?: undefined;
|
|
142
149
|
chainlink?: undefined;
|
|
143
150
|
jupLend?: undefined;
|
|
151
|
+
chainlinkDataStreams?: undefined;
|
|
144
152
|
} & {
|
|
145
153
|
singlePool: Record<string, never>;
|
|
146
154
|
}) | ({
|
|
@@ -150,11 +158,23 @@ declare function readOraclePrice({ connection, signer, oracle, }: {
|
|
|
150
158
|
redstone?: undefined;
|
|
151
159
|
chainlink?: undefined;
|
|
152
160
|
singlePool?: undefined;
|
|
161
|
+
chainlinkDataStreams?: undefined;
|
|
153
162
|
} & {
|
|
154
163
|
jupLend: Record<string, never>;
|
|
164
|
+
}) | ({
|
|
165
|
+
pyth?: undefined;
|
|
166
|
+
stakePool?: undefined;
|
|
167
|
+
msolPool?: undefined;
|
|
168
|
+
redstone?: undefined;
|
|
169
|
+
chainlink?: undefined;
|
|
170
|
+
singlePool?: undefined;
|
|
171
|
+
jupLend?: undefined;
|
|
172
|
+
} & {
|
|
173
|
+
chainlinkDataStreams: Record<string, never>;
|
|
155
174
|
});
|
|
156
175
|
}[];
|
|
157
176
|
}>;
|
|
177
|
+
declare const getLiquidityProgramId: (market: "main" | "ethena") => PublicKey;
|
|
158
178
|
|
|
159
179
|
declare const MIN_TICK = -16383;
|
|
160
180
|
declare const MAX_TICK = 16383;
|
|
@@ -201,4 +221,4 @@ declare const getAllLiquidations: (params: Omit<LiquidateParams, "debtAmount" |
|
|
|
201
221
|
}[];
|
|
202
222
|
}[]>;
|
|
203
223
|
|
|
204
|
-
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 };
|
|
224
|
+
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, getLiquidityProgramId, getRatioAtTick, getTickAtRatio, getTickIndices, getVaultsProgram, loadRelevantBranches, loadRelevantBranchesForLiquidate, loadRelevantTicksHasDebtArrays, loadRelevantTicksHasDebtArraysLiquidate, readOraclePrice, readTickHasDebtArray, simulateLiquidate };
|
package/dist/borrow/index.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { g as getLiquidateIx, a as getVaultsProgram } from '../shared/lend.
|
|
2
|
-
export { I as INIT_TICK, h as MAX_REPAY_AMOUNT,
|
|
1
|
+
import { g as getLiquidateIx, a as getVaultsProgram } from '../shared/lend.COO39gwN.mjs';
|
|
2
|
+
export { I as INIT_TICK, h as MAX_REPAY_AMOUNT, u as MAX_TICK, i as MAX_WITHDRAW_AMOUNT, M as MIN_I128, t as MIN_TICK, v as TICKS_PER_TICK_HAS_DEBT, T as TICK_HAS_DEBT_ARRAY_SIZE, w as TICK_HAS_DEBT_CHILDREN_SIZE, x as TICK_HAS_DEBT_CHILDREN_SIZE_IN_BITS, y as TOTAL_INDICES_NEEDED, Z as ZERO_TICK_SCALED_RATIO, E as findNextTickWithDebt, j as getAccountOwner, k as getCurrentPosition, l as getCurrentPositionState, m as getFinalPosition, B as getFirstTickForIndex, d as getInitPositionContext, c as getInitPositionIx, f as getLiquidateContext, s as getLiquidityProgramId, b as getOperateContext, e as getOperateIx, z as getRatioAtTick, A as getTickAtRatio, C as getTickIndices, n as loadRelevantBranches, q as loadRelevantBranchesForLiquidate, o as loadRelevantTicksHasDebtArrays, p as loadRelevantTicksHasDebtArraysLiquidate, r as readOraclePrice, D as readTickHasDebtArray } from '../shared/lend.COO39gwN.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.tU-yHdcH.mjs';
|
|
6
6
|
import '@coral-xyz/anchor';
|
|
7
|
-
import '../shared/lend.CioR9-te.mjs';
|
|
8
7
|
import '@solana/spl-token';
|
|
9
|
-
import '../shared/lend.
|
|
8
|
+
import '../shared/lend.BjhqzIWk.mjs';
|
|
10
9
|
|
|
11
10
|
const simulateLiquidate = async (params) => {
|
|
12
11
|
const { connection, signer } = params;
|
package/dist/earn/index.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ import { Program } from '@coral-xyz/anchor';
|
|
|
6
6
|
type ConnectionParams = {
|
|
7
7
|
connection: Connection;
|
|
8
8
|
signer: PublicKey;
|
|
9
|
+
market: "main" | "ethena";
|
|
9
10
|
};
|
|
10
11
|
type DepositContextParams = {
|
|
11
12
|
asset: PublicKey;
|
|
@@ -13,11 +14,13 @@ type DepositContextParams = {
|
|
|
13
14
|
} & ConnectionParams;
|
|
14
15
|
type DepositParams = {
|
|
15
16
|
amount: BN__default;
|
|
16
|
-
|
|
17
|
+
market?: "main" | "ethena";
|
|
18
|
+
} & Omit<DepositContextParams, "market">;
|
|
17
19
|
type MintParams = {
|
|
18
20
|
shares: BN__default;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
market?: "main" | "ethena";
|
|
22
|
+
} & Omit<DepositContextParams, "market">;
|
|
23
|
+
declare function getDepositContext({ asset, signer, connection, market, }: DepositContextParams): Promise<{
|
|
21
24
|
signer: PublicKey;
|
|
22
25
|
depositorTokenAccount: PublicKey;
|
|
23
26
|
recipientTokenAccount: PublicKey;
|
|
@@ -47,7 +50,7 @@ declare function getDepositContext({ asset, signer, connection, }: DepositContex
|
|
|
47
50
|
* @param connection - The connection
|
|
48
51
|
* @returns { ixs: TransactionInstruction[] } - The instructions to deposit the assets
|
|
49
52
|
*/
|
|
50
|
-
declare const getDepositIxs: ({ amount, asset, signer, connection, }: DepositParams) => Promise<{
|
|
53
|
+
declare const getDepositIxs: ({ amount, asset, signer, connection, market, }: DepositParams) => Promise<{
|
|
51
54
|
ixs: TransactionInstruction[];
|
|
52
55
|
}>;
|
|
53
56
|
/**
|
|
@@ -57,7 +60,7 @@ declare const getDepositIxs: ({ amount, asset, signer, connection, }: DepositPar
|
|
|
57
60
|
* @param connection - The connection
|
|
58
61
|
* @returns { ixs: TransactionInstruction[] } - The instructions to mint the shares
|
|
59
62
|
*/
|
|
60
|
-
declare const getMintIxs: ({ shares, asset, signer, connection, }: MintParams) => Promise<{
|
|
63
|
+
declare const getMintIxs: ({ shares, asset, signer, connection, market, }: MintParams) => Promise<{
|
|
61
64
|
ixs: TransactionInstruction[];
|
|
62
65
|
}>;
|
|
63
66
|
type WithdrawContextParams = {
|
|
@@ -66,11 +69,13 @@ type WithdrawContextParams = {
|
|
|
66
69
|
} & ConnectionParams;
|
|
67
70
|
type WithdrawParams = {
|
|
68
71
|
amount: BN__default;
|
|
69
|
-
|
|
72
|
+
market?: "main" | "ethena";
|
|
73
|
+
} & Omit<WithdrawContextParams, "market">;
|
|
70
74
|
type RedeemParams = {
|
|
71
75
|
shares: BN__default;
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
market?: "main" | "ethena";
|
|
77
|
+
} & Omit<WithdrawContextParams, "market">;
|
|
78
|
+
declare function getWithdrawContext({ asset, signer, connection, market, }: WithdrawContextParams): Promise<{
|
|
74
79
|
signer: PublicKey;
|
|
75
80
|
ownerTokenAccount: PublicKey;
|
|
76
81
|
recipientTokenAccount: PublicKey;
|
|
@@ -98,7 +103,7 @@ declare function getWithdrawContext({ asset, signer, connection, }: WithdrawCont
|
|
|
98
103
|
* @param connection - The connection
|
|
99
104
|
* @returns { ixs: TransactionInstruction[] } - The instructions to withdraw the assets
|
|
100
105
|
*/
|
|
101
|
-
declare const getWithdrawIxs: ({ amount, asset, signer, connection, }: WithdrawParams) => Promise<{
|
|
106
|
+
declare const getWithdrawIxs: ({ amount, asset, signer, connection, market, }: WithdrawParams) => Promise<{
|
|
102
107
|
ixs: TransactionInstruction[];
|
|
103
108
|
}>;
|
|
104
109
|
/**
|
|
@@ -108,7 +113,7 @@ declare const getWithdrawIxs: ({ amount, asset, signer, connection, }: WithdrawP
|
|
|
108
113
|
* @param connection - The connection
|
|
109
114
|
* @returns { ixs: TransactionInstruction[] } - The instructions to redeem the shares
|
|
110
115
|
*/
|
|
111
|
-
declare const getRedeemIxs: ({ shares, asset, signer, connection, }: RedeemParams) => Promise<{
|
|
116
|
+
declare const getRedeemIxs: ({ shares, asset, signer, connection, market, }: RedeemParams) => Promise<{
|
|
112
117
|
ixs: TransactionInstruction[];
|
|
113
118
|
}>;
|
|
114
119
|
|
|
@@ -1858,19 +1863,23 @@ type Lending = {
|
|
|
1858
1863
|
declare const U64_MAX: BN;
|
|
1859
1864
|
declare const MAX_DEPOSIT: BN;
|
|
1860
1865
|
declare const MAX_WITHDRAW: BN;
|
|
1861
|
-
declare const getLendingProgram: ({ connection, signer, }: {
|
|
1866
|
+
declare const getLendingProgram: ({ connection, signer, market, }: {
|
|
1862
1867
|
connection: Connection;
|
|
1863
1868
|
signer?: PublicKey;
|
|
1869
|
+
market: "main" | "ethena";
|
|
1864
1870
|
}) => Program<Lending>;
|
|
1865
1871
|
declare const getAccountOwner: (account: PublicKey, connection: Connection) => Promise<PublicKey>;
|
|
1866
1872
|
declare const getOrCreateATAInstruction: (owner: PublicKey, mint: PublicKey, connection: Connection) => Promise<TransactionInstruction[]>;
|
|
1873
|
+
declare const getLiquidityProgramId: (market: "main" | "ethena") => PublicKey;
|
|
1867
1874
|
|
|
1868
|
-
declare const getLendingTokens: ({ connection, }: {
|
|
1875
|
+
declare const getLendingTokens: ({ connection, market, }: {
|
|
1869
1876
|
connection: Connection;
|
|
1877
|
+
market: "main" | "ethena";
|
|
1870
1878
|
}) => Promise<PublicKey[]>;
|
|
1871
|
-
declare const getLendingTokenDetails: ({ lendingToken, connection, }: {
|
|
1879
|
+
declare const getLendingTokenDetails: ({ lendingToken, connection, market, }: {
|
|
1872
1880
|
lendingToken: PublicKey;
|
|
1873
1881
|
connection: Connection;
|
|
1882
|
+
market: "main" | "ethena";
|
|
1874
1883
|
}) => Promise<{
|
|
1875
1884
|
id: number;
|
|
1876
1885
|
address: PublicKey;
|
|
@@ -1883,15 +1892,16 @@ declare const getLendingTokenDetails: ({ lendingToken, connection, }: {
|
|
|
1883
1892
|
rewardsRate: BN__default;
|
|
1884
1893
|
supplyRate: BN__default;
|
|
1885
1894
|
}>;
|
|
1886
|
-
declare const getUserLendingPositionByAsset: ({ user, asset, connection, }: {
|
|
1895
|
+
declare const getUserLendingPositionByAsset: ({ user, asset, connection, market, }: {
|
|
1887
1896
|
user: PublicKey;
|
|
1888
1897
|
asset: PublicKey;
|
|
1889
1898
|
connection: Connection;
|
|
1899
|
+
market: "main" | "ethena";
|
|
1890
1900
|
}) => Promise<{
|
|
1891
1901
|
lendingTokenShares: BN__default;
|
|
1892
1902
|
underlyingAssets: BN__default;
|
|
1893
1903
|
underlyingBalance: BN__default;
|
|
1894
1904
|
}>;
|
|
1895
1905
|
|
|
1896
|
-
export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
|
|
1906
|
+
export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getLiquidityProgramId, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
|
|
1897
1907
|
export type { ConnectionParams, DepositContextParams, DepositParams, MintParams, RedeemParams, WithdrawContextParams, WithdrawParams };
|
package/dist/earn/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Program } from '@coral-xyz/anchor';
|
|
|
6
6
|
type ConnectionParams = {
|
|
7
7
|
connection: Connection;
|
|
8
8
|
signer: PublicKey;
|
|
9
|
+
market: "main" | "ethena";
|
|
9
10
|
};
|
|
10
11
|
type DepositContextParams = {
|
|
11
12
|
asset: PublicKey;
|
|
@@ -13,11 +14,13 @@ type DepositContextParams = {
|
|
|
13
14
|
} & ConnectionParams;
|
|
14
15
|
type DepositParams = {
|
|
15
16
|
amount: BN__default;
|
|
16
|
-
|
|
17
|
+
market?: "main" | "ethena";
|
|
18
|
+
} & Omit<DepositContextParams, "market">;
|
|
17
19
|
type MintParams = {
|
|
18
20
|
shares: BN__default;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
market?: "main" | "ethena";
|
|
22
|
+
} & Omit<DepositContextParams, "market">;
|
|
23
|
+
declare function getDepositContext({ asset, signer, connection, market, }: DepositContextParams): Promise<{
|
|
21
24
|
signer: PublicKey;
|
|
22
25
|
depositorTokenAccount: PublicKey;
|
|
23
26
|
recipientTokenAccount: PublicKey;
|
|
@@ -47,7 +50,7 @@ declare function getDepositContext({ asset, signer, connection, }: DepositContex
|
|
|
47
50
|
* @param connection - The connection
|
|
48
51
|
* @returns { ixs: TransactionInstruction[] } - The instructions to deposit the assets
|
|
49
52
|
*/
|
|
50
|
-
declare const getDepositIxs: ({ amount, asset, signer, connection, }: DepositParams) => Promise<{
|
|
53
|
+
declare const getDepositIxs: ({ amount, asset, signer, connection, market, }: DepositParams) => Promise<{
|
|
51
54
|
ixs: TransactionInstruction[];
|
|
52
55
|
}>;
|
|
53
56
|
/**
|
|
@@ -57,7 +60,7 @@ declare const getDepositIxs: ({ amount, asset, signer, connection, }: DepositPar
|
|
|
57
60
|
* @param connection - The connection
|
|
58
61
|
* @returns { ixs: TransactionInstruction[] } - The instructions to mint the shares
|
|
59
62
|
*/
|
|
60
|
-
declare const getMintIxs: ({ shares, asset, signer, connection, }: MintParams) => Promise<{
|
|
63
|
+
declare const getMintIxs: ({ shares, asset, signer, connection, market, }: MintParams) => Promise<{
|
|
61
64
|
ixs: TransactionInstruction[];
|
|
62
65
|
}>;
|
|
63
66
|
type WithdrawContextParams = {
|
|
@@ -66,11 +69,13 @@ type WithdrawContextParams = {
|
|
|
66
69
|
} & ConnectionParams;
|
|
67
70
|
type WithdrawParams = {
|
|
68
71
|
amount: BN__default;
|
|
69
|
-
|
|
72
|
+
market?: "main" | "ethena";
|
|
73
|
+
} & Omit<WithdrawContextParams, "market">;
|
|
70
74
|
type RedeemParams = {
|
|
71
75
|
shares: BN__default;
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
market?: "main" | "ethena";
|
|
77
|
+
} & Omit<WithdrawContextParams, "market">;
|
|
78
|
+
declare function getWithdrawContext({ asset, signer, connection, market, }: WithdrawContextParams): Promise<{
|
|
74
79
|
signer: PublicKey;
|
|
75
80
|
ownerTokenAccount: PublicKey;
|
|
76
81
|
recipientTokenAccount: PublicKey;
|
|
@@ -98,7 +103,7 @@ declare function getWithdrawContext({ asset, signer, connection, }: WithdrawCont
|
|
|
98
103
|
* @param connection - The connection
|
|
99
104
|
* @returns { ixs: TransactionInstruction[] } - The instructions to withdraw the assets
|
|
100
105
|
*/
|
|
101
|
-
declare const getWithdrawIxs: ({ amount, asset, signer, connection, }: WithdrawParams) => Promise<{
|
|
106
|
+
declare const getWithdrawIxs: ({ amount, asset, signer, connection, market, }: WithdrawParams) => Promise<{
|
|
102
107
|
ixs: TransactionInstruction[];
|
|
103
108
|
}>;
|
|
104
109
|
/**
|
|
@@ -108,7 +113,7 @@ declare const getWithdrawIxs: ({ amount, asset, signer, connection, }: WithdrawP
|
|
|
108
113
|
* @param connection - The connection
|
|
109
114
|
* @returns { ixs: TransactionInstruction[] } - The instructions to redeem the shares
|
|
110
115
|
*/
|
|
111
|
-
declare const getRedeemIxs: ({ shares, asset, signer, connection, }: RedeemParams) => Promise<{
|
|
116
|
+
declare const getRedeemIxs: ({ shares, asset, signer, connection, market, }: RedeemParams) => Promise<{
|
|
112
117
|
ixs: TransactionInstruction[];
|
|
113
118
|
}>;
|
|
114
119
|
|
|
@@ -1858,19 +1863,23 @@ type Lending = {
|
|
|
1858
1863
|
declare const U64_MAX: BN;
|
|
1859
1864
|
declare const MAX_DEPOSIT: BN;
|
|
1860
1865
|
declare const MAX_WITHDRAW: BN;
|
|
1861
|
-
declare const getLendingProgram: ({ connection, signer, }: {
|
|
1866
|
+
declare const getLendingProgram: ({ connection, signer, market, }: {
|
|
1862
1867
|
connection: Connection;
|
|
1863
1868
|
signer?: PublicKey;
|
|
1869
|
+
market: "main" | "ethena";
|
|
1864
1870
|
}) => Program<Lending>;
|
|
1865
1871
|
declare const getAccountOwner: (account: PublicKey, connection: Connection) => Promise<PublicKey>;
|
|
1866
1872
|
declare const getOrCreateATAInstruction: (owner: PublicKey, mint: PublicKey, connection: Connection) => Promise<TransactionInstruction[]>;
|
|
1873
|
+
declare const getLiquidityProgramId: (market: "main" | "ethena") => PublicKey;
|
|
1867
1874
|
|
|
1868
|
-
declare const getLendingTokens: ({ connection, }: {
|
|
1875
|
+
declare const getLendingTokens: ({ connection, market, }: {
|
|
1869
1876
|
connection: Connection;
|
|
1877
|
+
market: "main" | "ethena";
|
|
1870
1878
|
}) => Promise<PublicKey[]>;
|
|
1871
|
-
declare const getLendingTokenDetails: ({ lendingToken, connection, }: {
|
|
1879
|
+
declare const getLendingTokenDetails: ({ lendingToken, connection, market, }: {
|
|
1872
1880
|
lendingToken: PublicKey;
|
|
1873
1881
|
connection: Connection;
|
|
1882
|
+
market: "main" | "ethena";
|
|
1874
1883
|
}) => Promise<{
|
|
1875
1884
|
id: number;
|
|
1876
1885
|
address: PublicKey;
|
|
@@ -1883,15 +1892,16 @@ declare const getLendingTokenDetails: ({ lendingToken, connection, }: {
|
|
|
1883
1892
|
rewardsRate: BN__default;
|
|
1884
1893
|
supplyRate: BN__default;
|
|
1885
1894
|
}>;
|
|
1886
|
-
declare const getUserLendingPositionByAsset: ({ user, asset, connection, }: {
|
|
1895
|
+
declare const getUserLendingPositionByAsset: ({ user, asset, connection, market, }: {
|
|
1887
1896
|
user: PublicKey;
|
|
1888
1897
|
asset: PublicKey;
|
|
1889
1898
|
connection: Connection;
|
|
1899
|
+
market: "main" | "ethena";
|
|
1890
1900
|
}) => Promise<{
|
|
1891
1901
|
lendingTokenShares: BN__default;
|
|
1892
1902
|
underlyingAssets: BN__default;
|
|
1893
1903
|
underlyingBalance: BN__default;
|
|
1894
1904
|
}>;
|
|
1895
1905
|
|
|
1896
|
-
export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
|
|
1906
|
+
export { MAX_DEPOSIT, MAX_WITHDRAW, U64_MAX, getAccountOwner, getDepositContext, getDepositIxs, getLendingProgram, getLendingTokenDetails, getLendingTokens, getLiquidityProgramId, getMintIxs, getOrCreateATAInstruction, getRedeemIxs, getUserLendingPositionByAsset, getWithdrawContext, getWithdrawIxs };
|
|
1897
1907
|
export type { ConnectionParams, DepositContextParams, DepositParams, MintParams, RedeemParams, WithdrawContextParams, WithdrawParams };
|