@jup-ag/lend 0.0.5 → 0.0.7

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.
@@ -14,6 +14,28 @@ type DepositContextParams = {
14
14
  type DepositParams = {
15
15
  amount: BN;
16
16
  } & DepositContextParams & ConnectionParams;
17
+ declare function getDepositContext({ recipient, asset, signer, }: DepositContextParams): {
18
+ signer: PublicKey;
19
+ depositorTokenAccount: PublicKey;
20
+ recipientTokenAccount: PublicKey;
21
+ lendingAdmin: PublicKey;
22
+ lending: PublicKey;
23
+ fTokenMint: PublicKey;
24
+ claimAccount: PublicKey;
25
+ supplyTokenReservesLiquidity: PublicKey;
26
+ borrowTokenReservesLiquidity: PublicKey;
27
+ lendingSupplyPositionOnLiquidity: PublicKey;
28
+ lendingBorrowPositionOnLiquidity: PublicKey;
29
+ rateModel: PublicKey;
30
+ vault: PublicKey;
31
+ liquidity: PublicKey;
32
+ liquidityProgram: PublicKey;
33
+ rewardsRateModel: PublicKey;
34
+ tokenProgram: PublicKey;
35
+ associatedTokenProgram: PublicKey;
36
+ systemProgram: PublicKey;
37
+ sysvarInstruction: PublicKey;
38
+ };
17
39
  declare const getDepositIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
18
40
  type WithdrawContextParams = {
19
41
  asset: PublicKey;
@@ -23,7 +45,28 @@ type WithdrawContextParams = {
23
45
  type WithdrawParams = {
24
46
  amount: BN;
25
47
  } & WithdrawContextParams & ConnectionParams;
48
+ declare function getWithdrawContext({ asset, recipient, signer, }: WithdrawContextParams): {
49
+ signer: PublicKey;
50
+ ownerTokenAccount: PublicKey;
51
+ recipientTokenAccount: PublicKey;
52
+ lendingAdmin: PublicKey;
53
+ lending: PublicKey;
54
+ mint: PublicKey;
55
+ claimAccount: PublicKey;
56
+ fTokenMint: PublicKey;
57
+ supplyTokenReservesLiquidity: PublicKey;
58
+ lendingSupplyPositionOnLiquidity: PublicKey;
59
+ rateModel: PublicKey;
60
+ vault: PublicKey;
61
+ liquidity: PublicKey;
62
+ liquidityProgram: PublicKey;
63
+ rewardsRateModel: PublicKey;
64
+ tokenProgram: PublicKey;
65
+ associatedTokenProgram: PublicKey;
66
+ systemProgram: PublicKey;
67
+ sysvarInstruction: PublicKey;
68
+ };
26
69
  declare const getWithdrawIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
27
70
 
28
- export { getDepositIx, getWithdrawIx };
71
+ export { getDepositContext, getDepositIx, getWithdrawContext, getWithdrawIx };
29
72
  export type { ConnectionParams, DepositContextParams, DepositParams, WithdrawContextParams, WithdrawParams };
@@ -14,6 +14,28 @@ type DepositContextParams = {
14
14
  type DepositParams = {
15
15
  amount: BN;
16
16
  } & DepositContextParams & ConnectionParams;
17
+ declare function getDepositContext({ recipient, asset, signer, }: DepositContextParams): {
18
+ signer: PublicKey;
19
+ depositorTokenAccount: PublicKey;
20
+ recipientTokenAccount: PublicKey;
21
+ lendingAdmin: PublicKey;
22
+ lending: PublicKey;
23
+ fTokenMint: PublicKey;
24
+ claimAccount: PublicKey;
25
+ supplyTokenReservesLiquidity: PublicKey;
26
+ borrowTokenReservesLiquidity: PublicKey;
27
+ lendingSupplyPositionOnLiquidity: PublicKey;
28
+ lendingBorrowPositionOnLiquidity: PublicKey;
29
+ rateModel: PublicKey;
30
+ vault: PublicKey;
31
+ liquidity: PublicKey;
32
+ liquidityProgram: PublicKey;
33
+ rewardsRateModel: PublicKey;
34
+ tokenProgram: PublicKey;
35
+ associatedTokenProgram: PublicKey;
36
+ systemProgram: PublicKey;
37
+ sysvarInstruction: PublicKey;
38
+ };
17
39
  declare const getDepositIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
18
40
  type WithdrawContextParams = {
19
41
  asset: PublicKey;
@@ -23,7 +45,28 @@ type WithdrawContextParams = {
23
45
  type WithdrawParams = {
24
46
  amount: BN;
25
47
  } & WithdrawContextParams & ConnectionParams;
48
+ declare function getWithdrawContext({ asset, recipient, signer, }: WithdrawContextParams): {
49
+ signer: PublicKey;
50
+ ownerTokenAccount: PublicKey;
51
+ recipientTokenAccount: PublicKey;
52
+ lendingAdmin: PublicKey;
53
+ lending: PublicKey;
54
+ mint: PublicKey;
55
+ claimAccount: PublicKey;
56
+ fTokenMint: PublicKey;
57
+ supplyTokenReservesLiquidity: PublicKey;
58
+ lendingSupplyPositionOnLiquidity: PublicKey;
59
+ rateModel: PublicKey;
60
+ vault: PublicKey;
61
+ liquidity: PublicKey;
62
+ liquidityProgram: PublicKey;
63
+ rewardsRateModel: PublicKey;
64
+ tokenProgram: PublicKey;
65
+ associatedTokenProgram: PublicKey;
66
+ systemProgram: PublicKey;
67
+ sysvarInstruction: PublicKey;
68
+ };
26
69
  declare const getWithdrawIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
27
70
 
28
- export { getDepositIx, getWithdrawIx };
71
+ export { getDepositContext, getDepositIx, getWithdrawContext, getWithdrawIx };
29
72
  export type { ConnectionParams, DepositContextParams, DepositParams, WithdrawContextParams, WithdrawParams };
@@ -1,9 +1,13 @@
1
1
  import { SYSVAR_INSTRUCTIONS_PUBKEY, SystemProgram, PublicKey } from '@solana/web3.js';
2
2
  import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync } from '@solana/spl-token';
3
3
  import { Program } from '@coral-xyz/anchor';
4
- import { c as lending, g as getLendingToken, d as getLending, e as getLiquidity, f as getLendingRewardsRateModel, h as getRateModel, i as getUserBorrowPosition, j as getUserSupplyPosition, k as getTokenReserveFromAsset, m as getClaimAccount, n as getLendingAdmin, o as liquidity } from '../shared/lend.CjksRhKO.mjs';
4
+ import { g as getLendingToken, c as getLending, d as getLiquidity, e as getLendingRewardsRateModel, f as getRateModel, h as getUserBorrowPosition, i as getUserSupplyPosition, j as getTokenReserveFromAsset, k as getClaimAccount, m as getLendingAdmin, n as liquidity, o as lending } from '../shared/lend.CVUdR9IA.mjs';
5
5
 
6
- function getDepositContext({ recipient, asset, signer }) {
6
+ function getDepositContext({
7
+ recipient,
8
+ asset,
9
+ signer
10
+ }) {
7
11
  const lendingToken = getLendingToken(asset);
8
12
  const lending2 = getLending(asset);
9
13
  const liquidityKey = getLiquidity();
@@ -88,21 +92,16 @@ function getWithdrawContext({
88
92
  lendingAdmin: getLendingAdmin(),
89
93
  lending: lending2,
90
94
  mint: asset,
91
- fTokenMint: lendingToken,
92
95
  claimAccount: getClaimAccount(
93
96
  asset,
94
97
  getLendingAdmin()
95
98
  ),
99
+ fTokenMint: lendingToken,
96
100
  supplyTokenReservesLiquidity: getTokenReserveFromAsset(asset),
97
- borrowTokenReservesLiquidity: getTokenReserveFromAsset(asset),
98
101
  lendingSupplyPositionOnLiquidity: getUserSupplyPosition(
99
102
  asset,
100
103
  lending2
101
104
  ),
102
- lendingBorrowPositionOnLiquidity: getUserBorrowPosition(
103
- asset,
104
- lending2
105
- ),
106
105
  rateModel: getRateModel(asset),
107
106
  vault: getAssociatedTokenAddressSync(
108
107
  asset,
@@ -139,4 +138,4 @@ const getWithdrawIx = async ({
139
138
  ).instruction();
140
139
  };
141
140
 
142
- export { getDepositIx, getWithdrawIx };
141
+ export { getDepositContext, getDepositIx, getWithdrawContext, getWithdrawIx };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { l as lendingPda, b as lendingRewardRateModelPda, a as liquidityPda } from './shared/lend.CjksRhKO.mjs';
1
+ export { l as lendingPda, b as lendingRewardRateModelPda, a as liquidityPda } from './shared/lend.CVUdR9IA.mjs';
2
2
  import '@solana/web3.js';
@@ -3022,4 +3022,4 @@ const lendingRewardRateModel = {
3022
3022
  getLendingRewardsRateModel: getLendingRewardsRateModel
3023
3023
  };
3024
3024
 
3025
- export { liquidity as a, lendingRewardRateModel as b, lending$1 as c, getLending as d, getLiquidity as e, getLendingRewardsRateModel as f, getLendingToken as g, getRateModel as h, getUserBorrowPosition as i, getUserSupplyPosition as j, getTokenReserveFromAsset as k, lending as l, getClaimAccount as m, getLendingAdmin as n, liquidity$1 as o };
3025
+ export { liquidity as a, lendingRewardRateModel as b, getLending as c, getLiquidity as d, getLendingRewardsRateModel as e, getRateModel as f, getLendingToken as g, getUserBorrowPosition as h, getUserSupplyPosition as i, getTokenReserveFromAsset as j, getClaimAccount as k, lending as l, getLendingAdmin as m, liquidity$1 as n, lending$1 as o };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -13,10 +13,6 @@
13
13
  "./earn": {
14
14
  "types": "./dist/earn/index.d.mts",
15
15
  "default": "./dist/earn/index.mjs"
16
- },
17
- "./idl": {
18
- "types": "./dist/idl/index.d.ts",
19
- "default": "./dist/idl/index.mjs"
20
16
  }
21
17
  },
22
18
  "files": [
@@ -1,6 +0,0 @@
1
- export { default as lendingIdl } from "./lending.json";
2
- export type { Lending as LendingIdl } from "./types/lending";
3
- export { default as liquidityIdl } from "./liquidity.json";
4
- export type { Liquidity as LiquidityIdl } from "./types/liquidity";
5
- export { default as lendingRewardRateModelIdl } from "./lending_reward_rate_model.json";
6
- export type { LendingRewardRateModel as LendingRewardRateModelIdl } from "./types/lendingRewardRateModel";
@@ -1,3 +0,0 @@
1
- export { default as lendingIdl } from "./lending.json" with { type: "json" };
2
- export { default as liquidityIdl } from "./liquidity.json" with { type: "json" };
3
- export { default as lendingRewardRateModelIdl } from "./lending_reward_rate_model.json" with { type: "json" };