@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/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
 
3
- declare const getLendingToken: (assetAddress: PublicKey) => PublicKey;
4
- declare const getLendingAdmin: () => PublicKey;
5
- declare const getLending: (assetAddress: PublicKey) => PublicKey;
6
- declare const getClaimAccount$1: (assetAddress: PublicKey, user: PublicKey) => PublicKey;
3
+ declare const getLendingToken: (assetAddress: PublicKey, market: "main" | "ethena") => PublicKey;
4
+ declare const getLendingAdmin: (market: "main" | "ethena") => PublicKey;
5
+ declare const getLending: (assetAddress: PublicKey, market: "main" | "ethena") => PublicKey;
6
+ declare const getClaimAccount$1: (assetAddress: PublicKey, user: PublicKey, market: "main" | "ethena") => PublicKey;
7
7
 
8
8
  declare const lending_getLending: typeof getLending;
9
9
  declare const lending_getLendingAdmin: typeof getLendingAdmin;
@@ -17,13 +17,13 @@ declare namespace lending {
17
17
  };
18
18
  }
19
19
 
20
- declare const getSupportedTokenList: () => PublicKey;
21
- declare const getTokenReserveFromAsset: (asset: PublicKey) => PublicKey;
22
- declare const getUserSupplyPosition$1: (asset: PublicKey, protocol: PublicKey) => PublicKey;
23
- declare const getUserBorrowPosition$1: (asset: PublicKey, protocol: PublicKey) => PublicKey;
24
- declare const getRateModel$2: (asset: PublicKey) => PublicKey;
25
- declare const getReserve: (asset: PublicKey) => PublicKey;
26
- declare const getLiquidity$2: () => PublicKey;
20
+ declare const getSupportedTokenList: (market: "main" | "ethena") => PublicKey;
21
+ declare const getTokenReserveFromAsset: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
22
+ declare const getUserSupplyPosition$1: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
23
+ declare const getUserBorrowPosition$1: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
24
+ declare const getRateModel$2: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
25
+ declare const getReserve: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
26
+ declare const getLiquidity$2: (market: "main" | "ethena") => PublicKey;
27
27
 
28
28
  declare const liquidity_getReserve: typeof getReserve;
29
29
  declare const liquidity_getSupportedTokenList: typeof getSupportedTokenList;
@@ -40,33 +40,36 @@ declare namespace liquidity {
40
40
  };
41
41
  }
42
42
 
43
- declare const getLendingRewardsRateModel: (assetAddress: PublicKey) => PublicKey;
43
+ declare const getLendingRewardRateModelProgramId: (market: "main" | "ethena") => PublicKey;
44
+ declare const getLendingRewardsRateModel: (assetAddress: PublicKey, market: "main" | "ethena") => PublicKey;
44
45
 
46
+ declare const lendingRewardRateModel_getLendingRewardRateModelProgramId: typeof getLendingRewardRateModelProgramId;
45
47
  declare const lendingRewardRateModel_getLendingRewardsRateModel: typeof getLendingRewardsRateModel;
46
48
  declare namespace lendingRewardRateModel {
47
49
  export {
50
+ lendingRewardRateModel_getLendingRewardRateModelProgramId as getLendingRewardRateModelProgramId,
48
51
  lendingRewardRateModel_getLendingRewardsRateModel as getLendingRewardsRateModel,
49
52
  };
50
53
  }
51
54
 
52
- declare const getVaultConfig: (vaultId: number) => PublicKey;
53
- declare const getVaultMetadata: (vaultId: number) => PublicKey;
54
- declare const getVaultAdmin: () => PublicKey;
55
- declare const getVaultState: (vaultId: number) => PublicKey;
56
- declare const getLiquidity$1: () => PublicKey;
57
- declare const getBranch: (vaultId: number, branchId: number) => PublicKey;
58
- declare const getPositionMetadata: (vaultId: number, positionId: number) => PublicKey;
59
- declare const getPosition: (vaultId: number, positionId: number) => PublicKey;
60
- declare const getTick: (vaultId: number, tick: number) => PublicKey;
61
- declare const getTickIdLiquidation: (vaultId: number, tick: number, totalIds: number) => PublicKey;
62
- declare const getPositionMint: (vaultId: number, positionId: number) => PublicKey;
63
- declare const getPositionTokenAccount: (vaultId: number, positionId: number, user: PublicKey) => PublicKey;
64
- declare const getLiquidityReserve$1: (asset: PublicKey) => PublicKey;
65
- declare const getRateModel$1: (asset: PublicKey) => PublicKey;
66
- declare const getClaimAccount: (asset: PublicKey, user: PublicKey) => PublicKey;
67
- declare const getUserSupplyPosition: (asset: PublicKey, protocol: PublicKey) => PublicKey;
68
- declare const getUserBorrowPosition: (asset: PublicKey, protocol: PublicKey) => PublicKey;
69
- declare const getTickHasDebt: (vaultId: number, index: number) => PublicKey;
55
+ declare const getVaultConfig: (vaultId: number, market: "main" | "ethena") => PublicKey;
56
+ declare const getVaultMetadata: (vaultId: number, market: "main" | "ethena") => PublicKey;
57
+ declare const getVaultAdmin: (market: "main" | "ethena") => PublicKey;
58
+ declare const getVaultState: (vaultId: number, market: "main" | "ethena") => PublicKey;
59
+ declare const getLiquidity$1: (market: "main" | "ethena") => PublicKey;
60
+ declare const getBranch: (vaultId: number, branchId: number, market: "main" | "ethena") => PublicKey;
61
+ declare const getPositionMetadata: (vaultId: number, positionId: number, market: "main" | "ethena") => PublicKey;
62
+ declare const getPosition: (vaultId: number, positionId: number, market: "main" | "ethena") => PublicKey;
63
+ declare const getTick: (vaultId: number, tick: number, market: "main" | "ethena") => PublicKey;
64
+ declare const getTickIdLiquidation: (vaultId: number, tick: number, totalIds: number, market: "main" | "ethena") => PublicKey;
65
+ declare const getPositionMint: (vaultId: number, positionId: number, market: "main" | "ethena") => PublicKey;
66
+ declare const getPositionTokenAccount: (vaultId: number, positionId: number, user: PublicKey, market: "main" | "ethena") => PublicKey;
67
+ declare const getLiquidityReserve$1: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
68
+ declare const getRateModel$1: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
69
+ declare const getClaimAccount: (asset: PublicKey, user: PublicKey, market: "main" | "ethena") => PublicKey;
70
+ declare const getUserSupplyPosition: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
71
+ declare const getUserBorrowPosition: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
72
+ declare const getTickHasDebt: (vaultId: number, index: number, market: "main" | "ethena") => PublicKey;
70
73
 
71
74
  declare const borrow_getBranch: typeof getBranch;
72
75
  declare const borrow_getClaimAccount: typeof getClaimAccount;
@@ -106,12 +109,12 @@ declare namespace borrow {
106
109
  };
107
110
  }
108
111
 
109
- declare const getFlashloanAdmin: () => PublicKey;
110
- declare const getLiquidityReserve: (asset: PublicKey) => PublicKey;
111
- declare const getLiquidity: () => PublicKey;
112
- declare const getRateModel: (asset: PublicKey) => PublicKey;
113
- declare const getFlashloanSupplyPosition: (asset: PublicKey) => PublicKey;
114
- declare const getFlashloanBorrowPosition: (asset: PublicKey) => PublicKey;
112
+ declare const getFlashloanAdmin: (market: "main" | "ethena") => PublicKey;
113
+ declare const getLiquidityReserve: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
114
+ declare const getLiquidity: (market: "main" | "ethena") => PublicKey;
115
+ declare const getRateModel: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
116
+ declare const getFlashloanSupplyPosition: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
117
+ declare const getFlashloanBorrowPosition: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
115
118
 
116
119
  declare const flashloan_getFlashloanAdmin: typeof getFlashloanAdmin;
117
120
  declare const flashloan_getFlashloanBorrowPosition: typeof getFlashloanBorrowPosition;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
 
3
- declare const getLendingToken: (assetAddress: PublicKey) => PublicKey;
4
- declare const getLendingAdmin: () => PublicKey;
5
- declare const getLending: (assetAddress: PublicKey) => PublicKey;
6
- declare const getClaimAccount$1: (assetAddress: PublicKey, user: PublicKey) => PublicKey;
3
+ declare const getLendingToken: (assetAddress: PublicKey, market: "main" | "ethena") => PublicKey;
4
+ declare const getLendingAdmin: (market: "main" | "ethena") => PublicKey;
5
+ declare const getLending: (assetAddress: PublicKey, market: "main" | "ethena") => PublicKey;
6
+ declare const getClaimAccount$1: (assetAddress: PublicKey, user: PublicKey, market: "main" | "ethena") => PublicKey;
7
7
 
8
8
  declare const lending_getLending: typeof getLending;
9
9
  declare const lending_getLendingAdmin: typeof getLendingAdmin;
@@ -17,13 +17,13 @@ declare namespace lending {
17
17
  };
18
18
  }
19
19
 
20
- declare const getSupportedTokenList: () => PublicKey;
21
- declare const getTokenReserveFromAsset: (asset: PublicKey) => PublicKey;
22
- declare const getUserSupplyPosition$1: (asset: PublicKey, protocol: PublicKey) => PublicKey;
23
- declare const getUserBorrowPosition$1: (asset: PublicKey, protocol: PublicKey) => PublicKey;
24
- declare const getRateModel$2: (asset: PublicKey) => PublicKey;
25
- declare const getReserve: (asset: PublicKey) => PublicKey;
26
- declare const getLiquidity$2: () => PublicKey;
20
+ declare const getSupportedTokenList: (market: "main" | "ethena") => PublicKey;
21
+ declare const getTokenReserveFromAsset: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
22
+ declare const getUserSupplyPosition$1: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
23
+ declare const getUserBorrowPosition$1: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
24
+ declare const getRateModel$2: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
25
+ declare const getReserve: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
26
+ declare const getLiquidity$2: (market: "main" | "ethena") => PublicKey;
27
27
 
28
28
  declare const liquidity_getReserve: typeof getReserve;
29
29
  declare const liquidity_getSupportedTokenList: typeof getSupportedTokenList;
@@ -40,33 +40,36 @@ declare namespace liquidity {
40
40
  };
41
41
  }
42
42
 
43
- declare const getLendingRewardsRateModel: (assetAddress: PublicKey) => PublicKey;
43
+ declare const getLendingRewardRateModelProgramId: (market: "main" | "ethena") => PublicKey;
44
+ declare const getLendingRewardsRateModel: (assetAddress: PublicKey, market: "main" | "ethena") => PublicKey;
44
45
 
46
+ declare const lendingRewardRateModel_getLendingRewardRateModelProgramId: typeof getLendingRewardRateModelProgramId;
45
47
  declare const lendingRewardRateModel_getLendingRewardsRateModel: typeof getLendingRewardsRateModel;
46
48
  declare namespace lendingRewardRateModel {
47
49
  export {
50
+ lendingRewardRateModel_getLendingRewardRateModelProgramId as getLendingRewardRateModelProgramId,
48
51
  lendingRewardRateModel_getLendingRewardsRateModel as getLendingRewardsRateModel,
49
52
  };
50
53
  }
51
54
 
52
- declare const getVaultConfig: (vaultId: number) => PublicKey;
53
- declare const getVaultMetadata: (vaultId: number) => PublicKey;
54
- declare const getVaultAdmin: () => PublicKey;
55
- declare const getVaultState: (vaultId: number) => PublicKey;
56
- declare const getLiquidity$1: () => PublicKey;
57
- declare const getBranch: (vaultId: number, branchId: number) => PublicKey;
58
- declare const getPositionMetadata: (vaultId: number, positionId: number) => PublicKey;
59
- declare const getPosition: (vaultId: number, positionId: number) => PublicKey;
60
- declare const getTick: (vaultId: number, tick: number) => PublicKey;
61
- declare const getTickIdLiquidation: (vaultId: number, tick: number, totalIds: number) => PublicKey;
62
- declare const getPositionMint: (vaultId: number, positionId: number) => PublicKey;
63
- declare const getPositionTokenAccount: (vaultId: number, positionId: number, user: PublicKey) => PublicKey;
64
- declare const getLiquidityReserve$1: (asset: PublicKey) => PublicKey;
65
- declare const getRateModel$1: (asset: PublicKey) => PublicKey;
66
- declare const getClaimAccount: (asset: PublicKey, user: PublicKey) => PublicKey;
67
- declare const getUserSupplyPosition: (asset: PublicKey, protocol: PublicKey) => PublicKey;
68
- declare const getUserBorrowPosition: (asset: PublicKey, protocol: PublicKey) => PublicKey;
69
- declare const getTickHasDebt: (vaultId: number, index: number) => PublicKey;
55
+ declare const getVaultConfig: (vaultId: number, market: "main" | "ethena") => PublicKey;
56
+ declare const getVaultMetadata: (vaultId: number, market: "main" | "ethena") => PublicKey;
57
+ declare const getVaultAdmin: (market: "main" | "ethena") => PublicKey;
58
+ declare const getVaultState: (vaultId: number, market: "main" | "ethena") => PublicKey;
59
+ declare const getLiquidity$1: (market: "main" | "ethena") => PublicKey;
60
+ declare const getBranch: (vaultId: number, branchId: number, market: "main" | "ethena") => PublicKey;
61
+ declare const getPositionMetadata: (vaultId: number, positionId: number, market: "main" | "ethena") => PublicKey;
62
+ declare const getPosition: (vaultId: number, positionId: number, market: "main" | "ethena") => PublicKey;
63
+ declare const getTick: (vaultId: number, tick: number, market: "main" | "ethena") => PublicKey;
64
+ declare const getTickIdLiquidation: (vaultId: number, tick: number, totalIds: number, market: "main" | "ethena") => PublicKey;
65
+ declare const getPositionMint: (vaultId: number, positionId: number, market: "main" | "ethena") => PublicKey;
66
+ declare const getPositionTokenAccount: (vaultId: number, positionId: number, user: PublicKey, market: "main" | "ethena") => PublicKey;
67
+ declare const getLiquidityReserve$1: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
68
+ declare const getRateModel$1: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
69
+ declare const getClaimAccount: (asset: PublicKey, user: PublicKey, market: "main" | "ethena") => PublicKey;
70
+ declare const getUserSupplyPosition: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
71
+ declare const getUserBorrowPosition: (asset: PublicKey, protocol: PublicKey, market: "main" | "ethena") => PublicKey;
72
+ declare const getTickHasDebt: (vaultId: number, index: number, market: "main" | "ethena") => PublicKey;
70
73
 
71
74
  declare const borrow_getBranch: typeof getBranch;
72
75
  declare const borrow_getClaimAccount: typeof getClaimAccount;
@@ -106,12 +109,12 @@ declare namespace borrow {
106
109
  };
107
110
  }
108
111
 
109
- declare const getFlashloanAdmin: () => PublicKey;
110
- declare const getLiquidityReserve: (asset: PublicKey) => PublicKey;
111
- declare const getLiquidity: () => PublicKey;
112
- declare const getRateModel: (asset: PublicKey) => PublicKey;
113
- declare const getFlashloanSupplyPosition: (asset: PublicKey) => PublicKey;
114
- declare const getFlashloanBorrowPosition: (asset: PublicKey) => PublicKey;
112
+ declare const getFlashloanAdmin: (market: "main" | "ethena") => PublicKey;
113
+ declare const getLiquidityReserve: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
114
+ declare const getLiquidity: (market: "main" | "ethena") => PublicKey;
115
+ declare const getRateModel: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
116
+ declare const getFlashloanSupplyPosition: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
117
+ declare const getFlashloanBorrowPosition: (asset: PublicKey, market: "main" | "ethena") => PublicKey;
115
118
 
116
119
  declare const flashloan_getFlashloanAdmin: typeof getFlashloanAdmin;
117
120
  declare const flashloan_getFlashloanBorrowPosition: typeof getFlashloanBorrowPosition;
package/dist/index.mjs CHANGED
@@ -1,13 +1,12 @@
1
- export { l as lendingPda, a as lendingRewardRateModelPda } from './shared/lend.DS0KoPpL.mjs';
2
- export { l as liquidityPda } from './shared/lend.BzG5ldOV.mjs';
3
- export { b as borrowPda } from './shared/lend.CsYeVtpe.mjs';
4
- export { f as flashloanPda } from './shared/lend.Cr2l14_0.mjs';
1
+ export { l as lendingPda, a as lendingRewardRateModelPda } from './shared/lend.BKZOr4CM.mjs';
2
+ export { l as liquidityPda } from './shared/lend.BjhqzIWk.mjs';
3
+ export { b as borrowPda } from './shared/lend.tU-yHdcH.mjs';
4
+ export { f as flashloanPda } from './shared/lend.0Rjy1SRf.mjs';
5
5
  export { m as merkleDistributorPda } from './shared/lend.Bpqe1Iia.mjs';
6
6
  import '@solana/web3.js';
7
- import './shared/lend.CioR9-te.mjs';
8
7
  import '@solana/spl-token';
9
8
  import 'bn.js';
10
9
 
11
- const version = "0.1.8";
10
+ const version = "0.1.10-beta.0";
12
11
 
13
12
  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.Cg37G_AM.mjs';
3
+ import { O as OperateContextParams } from '../shared/lend.34CmCyWr.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.Cg37G_AM.js';
3
+ import { O as OperateContextParams } from '../shared/lend.34CmCyWr.js';
4
4
  import 'bn.js';
5
5
  import '@coral-xyz/anchor';
6
6
 
@@ -1,11 +1,10 @@
1
- import { v as vaultsIdl } from '../shared/lend.CsYeVtpe.mjs';
2
- import { e as getOperateIx } from '../shared/lend.BSHVKmia.mjs';
1
+ import { e as getOperateIx, F as vaultsIdl } from '../shared/lend.COO39gwN.mjs';
3
2
  import { PublicKey } from '@solana/web3.js';
4
3
  import { Program } from '@coral-xyz/anchor';
5
- import '../shared/lend.CioR9-te.mjs';
6
- import '@solana/spl-token';
7
4
  import 'bn.js';
8
- import '../shared/lend.BzG5ldOV.mjs';
5
+ import '@solana/spl-token';
6
+ import '../shared/lend.tU-yHdcH.mjs';
7
+ import '../shared/lend.BjhqzIWk.mjs';
9
8
 
10
9
  const address = "jup8QcdtqecBGw1iXHW3hQAsHQbTgEqbLbNMvvULmeK";
11
10
  const metadata = {
@@ -0,0 +1,70 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+
3
+ const getFlashloanProgramId = (market) => {
4
+ return market === "ethena" ? new PublicKey("jupKxkab7RTnQJ6wXStXg6WY4rcReV3maiUNwByciFF") : new PublicKey("jupgfSgfuAXv4B6R2Uxu85Z1qdzgju79s6MfZekN6XS");
5
+ };
6
+ const getLiquidityProgramId = (market) => {
7
+ return market === "ethena" ? new PublicKey("jup6QF1sNDGpkkcu6F4qaFHcRBmnSS1VgyB4uFbBvNS") : new PublicKey("jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC");
8
+ };
9
+ const getFlashloanAdmin = (market) => {
10
+ const [pda] = PublicKey.findProgramAddressSync(
11
+ [Buffer.from("flashloan_admin")],
12
+ getFlashloanProgramId(market)
13
+ );
14
+ return pda;
15
+ };
16
+ const getLiquidityReserve = (asset, market) => {
17
+ const [pda] = PublicKey.findProgramAddressSync(
18
+ [Buffer.from("reserve"), asset.toBuffer()],
19
+ getLiquidityProgramId(market)
20
+ );
21
+ return pda;
22
+ };
23
+ const getLiquidity = (market) => {
24
+ const [pda] = PublicKey.findProgramAddressSync(
25
+ [Buffer.from("liquidity")],
26
+ getLiquidityProgramId(market)
27
+ );
28
+ return pda;
29
+ };
30
+ const getRateModel = (asset, market) => {
31
+ const [pda] = PublicKey.findProgramAddressSync(
32
+ [Buffer.from("rate_model"), asset.toBuffer()],
33
+ getLiquidityProgramId(market)
34
+ );
35
+ return pda;
36
+ };
37
+ const getFlashloanSupplyPosition = (asset, market) => {
38
+ const [pda] = PublicKey.findProgramAddressSync(
39
+ [
40
+ Buffer.from("user_supply_position"),
41
+ asset.toBuffer(),
42
+ getFlashloanAdmin(market).toBuffer()
43
+ ],
44
+ getLiquidityProgramId(market)
45
+ );
46
+ return pda;
47
+ };
48
+ const getFlashloanBorrowPosition = (asset, market) => {
49
+ const [pda] = PublicKey.findProgramAddressSync(
50
+ [
51
+ Buffer.from("user_borrow_position"),
52
+ asset.toBuffer(),
53
+ getFlashloanAdmin(market).toBuffer()
54
+ ],
55
+ getLiquidityProgramId(market)
56
+ );
57
+ return pda;
58
+ };
59
+
60
+ const flashloan = {
61
+ __proto__: null,
62
+ getFlashloanAdmin: getFlashloanAdmin,
63
+ getFlashloanBorrowPosition: getFlashloanBorrowPosition,
64
+ getFlashloanSupplyPosition: getFlashloanSupplyPosition,
65
+ getLiquidity: getLiquidity,
66
+ getLiquidityReserve: getLiquidityReserve,
67
+ getRateModel: getRateModel
68
+ };
69
+
70
+ export { getRateModel as a, getFlashloanBorrowPosition as b, getLiquidityReserve as c, getFlashloanAdmin as d, flashloan as f, getLiquidity as g };
@@ -13,7 +13,7 @@ type Vaults = {
13
13
  address: "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi";
14
14
  metadata: {
15
15
  name: "vaults";
16
- version: "0.1.0";
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
  };
@@ -4000,6 +4003,7 @@ type Vaults = {
4000
4003
  type ConnectionParams = {
4001
4004
  connection: Connection;
4002
4005
  signer: PublicKey;
4006
+ market: "main" | "ethena";
4003
4007
  };
4004
4008
  type OperateContextParams = {
4005
4009
  vaultId: number;
@@ -4017,8 +4021,9 @@ type OperateParams = {
4017
4021
  debtAmount: BN__default;
4018
4022
  recipient?: PublicKey;
4019
4023
  positionOwner?: PublicKey;
4020
- } & ConnectionParams;
4021
- declare function getOperateContext({ vaultId, positionId, program, connection, signer, positionOwner, colAmount: newCol, debtAmount: newDebt, recipient, }: OperateContextParams): Promise<{
4024
+ market?: "main" | "ethena";
4025
+ } & Omit<ConnectionParams, "market">;
4026
+ declare function getOperateContext({ vaultId, positionId, program, connection, signer, positionOwner, colAmount: newCol, debtAmount: newDebt, recipient, market, }: OperateContextParams): Promise<{
4022
4027
  nftId: number;
4023
4028
  accounts: {
4024
4029
  signer: PublicKey;
@@ -4071,12 +4076,13 @@ type InitPositionIxParams = {
4071
4076
  vaultId: number;
4072
4077
  connection: Connection;
4073
4078
  signer: PublicKey;
4079
+ market: "main" | "ethena";
4074
4080
  };
4075
- declare function getInitPositionIx({ vaultId, connection, signer, }: InitPositionIxParams): Promise<{
4081
+ declare function getInitPositionIx({ vaultId, connection, signer, market, }: InitPositionIxParams): Promise<{
4076
4082
  ix: TransactionInstruction;
4077
4083
  nftId: number;
4078
4084
  }>;
4079
- declare function getInitPositionContext(vaultId: number, positionId: number, signer: PublicKey): {
4085
+ declare function getInitPositionContext(vaultId: number, positionId: number, signer: PublicKey, market: "main" | "ethena"): {
4080
4086
  signer: PublicKey;
4081
4087
  vaultAdmin: PublicKey;
4082
4088
  vaultState: PublicKey;
@@ -4091,7 +4097,7 @@ declare function getInitPositionContext(vaultId: number, positionId: number, sig
4091
4097
  metadataProgram: PublicKey;
4092
4098
  rent: PublicKey;
4093
4099
  };
4094
- declare const getOperateIx: ({ vaultId, positionId, colAmount, debtAmount, connection, signer, recipient, positionOwner, }: OperateParams) => Promise<{
4100
+ declare const getOperateIx: ({ vaultId, positionId, colAmount, debtAmount, connection, signer, recipient, positionOwner, market, }: OperateParams) => Promise<{
4095
4101
  nftId: number;
4096
4102
  accounts: {
4097
4103
  signer: PublicKey;
@@ -4152,7 +4158,7 @@ type LiquidateContextParams = {
4152
4158
  to: PublicKey;
4153
4159
  program: Program<Vaults>;
4154
4160
  } & ConnectionParams;
4155
- declare function getLiquidateContext({ vaultId, to, program, connection, signer, }: LiquidateContextParams): Promise<{
4161
+ declare function getLiquidateContext({ vaultId, to, program, connection, signer, market, }: LiquidateContextParams): Promise<{
4156
4162
  accounts: {
4157
4163
  signer: PublicKey;
4158
4164
  signerTokenAccount: PublicKey;
@@ -4193,7 +4199,7 @@ declare function getLiquidateContext({ vaultId, to, program, connection, signer,
4193
4199
  remainingAccountsIndices: number[];
4194
4200
  lookupTable: PublicKey;
4195
4201
  }>;
4196
- declare const getLiquidateIx: ({ vaultId, debtAmount, colPerUnitDebt, absorb, signer, to, connection, }: LiquidateParams) => Promise<{
4202
+ declare const getLiquidateIx: ({ vaultId, debtAmount, colPerUnitDebt, absorb, signer, to, connection, market, }: LiquidateParams) => Promise<{
4197
4203
  accounts: {
4198
4204
  signer: PublicKey;
4199
4205
  signerTokenAccount: PublicKey;
@@ -13,7 +13,7 @@ type Vaults = {
13
13
  address: "jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi";
14
14
  metadata: {
15
15
  name: "vaults";
16
- version: "0.1.0";
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
  };
@@ -4000,6 +4003,7 @@ type Vaults = {
4000
4003
  type ConnectionParams = {
4001
4004
  connection: Connection;
4002
4005
  signer: PublicKey;
4006
+ market: "main" | "ethena";
4003
4007
  };
4004
4008
  type OperateContextParams = {
4005
4009
  vaultId: number;
@@ -4017,8 +4021,9 @@ type OperateParams = {
4017
4021
  debtAmount: BN__default;
4018
4022
  recipient?: PublicKey;
4019
4023
  positionOwner?: PublicKey;
4020
- } & ConnectionParams;
4021
- declare function getOperateContext({ vaultId, positionId, program, connection, signer, positionOwner, colAmount: newCol, debtAmount: newDebt, recipient, }: OperateContextParams): Promise<{
4024
+ market?: "main" | "ethena";
4025
+ } & Omit<ConnectionParams, "market">;
4026
+ declare function getOperateContext({ vaultId, positionId, program, connection, signer, positionOwner, colAmount: newCol, debtAmount: newDebt, recipient, market, }: OperateContextParams): Promise<{
4022
4027
  nftId: number;
4023
4028
  accounts: {
4024
4029
  signer: PublicKey;
@@ -4071,12 +4076,13 @@ type InitPositionIxParams = {
4071
4076
  vaultId: number;
4072
4077
  connection: Connection;
4073
4078
  signer: PublicKey;
4079
+ market: "main" | "ethena";
4074
4080
  };
4075
- declare function getInitPositionIx({ vaultId, connection, signer, }: InitPositionIxParams): Promise<{
4081
+ declare function getInitPositionIx({ vaultId, connection, signer, market, }: InitPositionIxParams): Promise<{
4076
4082
  ix: TransactionInstruction;
4077
4083
  nftId: number;
4078
4084
  }>;
4079
- declare function getInitPositionContext(vaultId: number, positionId: number, signer: PublicKey): {
4085
+ declare function getInitPositionContext(vaultId: number, positionId: number, signer: PublicKey, market: "main" | "ethena"): {
4080
4086
  signer: PublicKey;
4081
4087
  vaultAdmin: PublicKey;
4082
4088
  vaultState: PublicKey;
@@ -4091,7 +4097,7 @@ declare function getInitPositionContext(vaultId: number, positionId: number, sig
4091
4097
  metadataProgram: PublicKey;
4092
4098
  rent: PublicKey;
4093
4099
  };
4094
- declare const getOperateIx: ({ vaultId, positionId, colAmount, debtAmount, connection, signer, recipient, positionOwner, }: OperateParams) => Promise<{
4100
+ declare const getOperateIx: ({ vaultId, positionId, colAmount, debtAmount, connection, signer, recipient, positionOwner, market, }: OperateParams) => Promise<{
4095
4101
  nftId: number;
4096
4102
  accounts: {
4097
4103
  signer: PublicKey;
@@ -4152,7 +4158,7 @@ type LiquidateContextParams = {
4152
4158
  to: PublicKey;
4153
4159
  program: Program<Vaults>;
4154
4160
  } & ConnectionParams;
4155
- declare function getLiquidateContext({ vaultId, to, program, connection, signer, }: LiquidateContextParams): Promise<{
4161
+ declare function getLiquidateContext({ vaultId, to, program, connection, signer, market, }: LiquidateContextParams): Promise<{
4156
4162
  accounts: {
4157
4163
  signer: PublicKey;
4158
4164
  signerTokenAccount: PublicKey;
@@ -4193,7 +4199,7 @@ declare function getLiquidateContext({ vaultId, to, program, connection, signer,
4193
4199
  remainingAccountsIndices: number[];
4194
4200
  lookupTable: PublicKey;
4195
4201
  }>;
4196
- declare const getLiquidateIx: ({ vaultId, debtAmount, colPerUnitDebt, absorb, signer, to, connection, }: LiquidateParams) => Promise<{
4202
+ declare const getLiquidateIx: ({ vaultId, debtAmount, colPerUnitDebt, absorb, signer, to, connection, market, }: LiquidateParams) => Promise<{
4197
4203
  accounts: {
4198
4204
  signer: PublicKey;
4199
4205
  signerTokenAccount: PublicKey;
@@ -0,0 +1,67 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+
3
+ const getLendingProgramId = (market) => {
4
+ return market === "ethena" ? new PublicKey("jup97Zx1NixM8UJMQFw8TtKzqTiRT3ETAJR7cVx3PfQ") : new PublicKey("jup3YeL8QhtSx1e253b2FDvsMNC87fDrgQZivbrndc9");
5
+ };
6
+ const getLiquidityProgramId = (market) => {
7
+ return market === "ethena" ? new PublicKey("jup6QF1sNDGpkkcu6F4qaFHcRBmnSS1VgyB4uFbBvNS") : new PublicKey("jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC");
8
+ };
9
+ const getLendingToken = (assetAddress, market) => {
10
+ const [pda] = PublicKey.findProgramAddressSync(
11
+ [Buffer.from("f_token_mint"), assetAddress.toBuffer()],
12
+ getLendingProgramId(market)
13
+ );
14
+ return pda;
15
+ };
16
+ const getLendingAdmin = (market) => {
17
+ const [pda] = PublicKey.findProgramAddressSync(
18
+ [Buffer.from("lending_admin")],
19
+ getLendingProgramId(market)
20
+ );
21
+ return pda;
22
+ };
23
+ const getLending = (assetAddress, market) => {
24
+ const [pda] = PublicKey.findProgramAddressSync(
25
+ [
26
+ Buffer.from("lending"),
27
+ assetAddress.toBuffer(),
28
+ getLendingToken(assetAddress, market).toBuffer()
29
+ ],
30
+ getLendingProgramId(market)
31
+ );
32
+ return pda;
33
+ };
34
+ const getClaimAccount = (assetAddress, user, market) => {
35
+ const [pda] = PublicKey.findProgramAddressSync(
36
+ [Buffer.from("user_claim"), user.toBuffer(), assetAddress.toBuffer()],
37
+ getLiquidityProgramId(market)
38
+ );
39
+ return pda;
40
+ };
41
+
42
+ const lending = {
43
+ __proto__: null,
44
+ getClaimAccount: getClaimAccount,
45
+ getLending: getLending,
46
+ getLendingAdmin: getLendingAdmin,
47
+ getLendingToken: getLendingToken
48
+ };
49
+
50
+ const getLendingRewardRateModelProgramId = (market) => {
51
+ return market === "ethena" ? new PublicKey("jupGBUJYXuzz2hVSoqjrxoEwJUB6uuHJsQqkzmYyQ7n") : new PublicKey("jup7TthsMgcR9Y3L277b8Eo9uboVSmu1utkuXHNUKar");
52
+ };
53
+ const getLendingRewardsRateModel = (assetAddress, market) => {
54
+ const [pda] = PublicKey.findProgramAddressSync(
55
+ [Buffer.from("lending_rewards_rate_model"), assetAddress.toBuffer()],
56
+ getLendingRewardRateModelProgramId(market)
57
+ );
58
+ return pda;
59
+ };
60
+
61
+ const lendingRewardRateModel = {
62
+ __proto__: null,
63
+ getLendingRewardRateModelProgramId: getLendingRewardRateModelProgramId,
64
+ getLendingRewardsRateModel: getLendingRewardsRateModel
65
+ };
66
+
67
+ export { lendingRewardRateModel as a, getLending as b, getLendingRewardsRateModel as c, getClaimAccount as d, getLendingAdmin as e, getLendingToken as g, lending as l };
@@ -1,55 +1,56 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- import { a as address } from './lend.CioR9-te.mjs';
3
2
 
4
- const LIQUIDITY_PROGRAM_ID = new PublicKey(address);
5
- const getSupportedTokenList = () => {
3
+ const getLiquidityProgramId = (market) => {
4
+ return market === "ethena" ? new PublicKey("jup6QF1sNDGpkkcu6F4qaFHcRBmnSS1VgyB4uFbBvNS") : new PublicKey("jupeiUmn818Jg1ekPURTpr4mFo29p46vygyykFJ3wZC");
5
+ };
6
+ const getSupportedTokenList = (market) => {
6
7
  return PublicKey.findProgramAddressSync(
7
8
  [Buffer.from("supported_token_list")],
8
- LIQUIDITY_PROGRAM_ID
9
+ getLiquidityProgramId(market)
9
10
  )[0];
10
11
  };
11
- const getTokenReserveFromAsset = (asset) => {
12
+ const getTokenReserveFromAsset = (asset, market) => {
12
13
  return PublicKey.findProgramAddressSync(
13
14
  [Buffer.from("reserve"), asset.toBuffer()],
14
- LIQUIDITY_PROGRAM_ID
15
+ getLiquidityProgramId(market)
15
16
  )[0];
16
17
  };
17
- const getUserSupplyPosition = (asset, protocol) => {
18
+ const getUserSupplyPosition = (asset, protocol, market) => {
18
19
  return PublicKey.findProgramAddressSync(
19
20
  [
20
21
  Buffer.from("user_supply_position"),
21
22
  asset.toBuffer(),
22
23
  protocol.toBuffer()
23
24
  ],
24
- LIQUIDITY_PROGRAM_ID
25
+ getLiquidityProgramId(market)
25
26
  )[0];
26
27
  };
27
- const getUserBorrowPosition = (asset, protocol) => {
28
+ const getUserBorrowPosition = (asset, protocol, market) => {
28
29
  return PublicKey.findProgramAddressSync(
29
30
  [
30
31
  Buffer.from("user_borrow_position"),
31
32
  asset.toBuffer(),
32
33
  protocol.toBuffer()
33
34
  ],
34
- LIQUIDITY_PROGRAM_ID
35
+ getLiquidityProgramId(market)
35
36
  )[0];
36
37
  };
37
- const getRateModel = (asset) => {
38
+ const getRateModel = (asset, market) => {
38
39
  return PublicKey.findProgramAddressSync(
39
40
  [Buffer.from("rate_model"), asset.toBuffer()],
40
- LIQUIDITY_PROGRAM_ID
41
+ getLiquidityProgramId(market)
41
42
  )[0];
42
43
  };
43
- const getReserve = (asset) => {
44
+ const getReserve = (asset, market) => {
44
45
  return PublicKey.findProgramAddressSync(
45
46
  [Buffer.from("reserve"), asset.toBuffer()],
46
- LIQUIDITY_PROGRAM_ID
47
+ getLiquidityProgramId(market)
47
48
  )[0];
48
49
  };
49
- const getLiquidity = () => {
50
+ const getLiquidity = (market) => {
50
51
  return PublicKey.findProgramAddressSync(
51
52
  [Buffer.from("liquidity")],
52
- LIQUIDITY_PROGRAM_ID
53
+ getLiquidityProgramId(market)
53
54
  )[0];
54
55
  };
55
56