@jup-ag/lend 0.0.3 → 0.0.5

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.
@@ -8,22 +8,22 @@ type ConnectionParams = {
8
8
  };
9
9
  type DepositContextParams = {
10
10
  asset: PublicKey;
11
- receipient?: PublicKey;
11
+ recipient?: PublicKey;
12
12
  signer: PublicKey;
13
13
  };
14
14
  type DepositParams = {
15
15
  amount: BN;
16
16
  } & DepositContextParams & ConnectionParams;
17
- declare const getDepositIx: ({ amount, asset, receipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
17
+ declare const getDepositIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
18
18
  type WithdrawContextParams = {
19
19
  asset: PublicKey;
20
- receipient?: PublicKey;
20
+ recipient?: PublicKey;
21
21
  signer: PublicKey;
22
22
  };
23
23
  type WithdrawParams = {
24
24
  amount: BN;
25
25
  } & WithdrawContextParams & ConnectionParams;
26
- declare const getWithdrawIx: ({ amount, asset, receipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
26
+ declare const getWithdrawIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
27
27
 
28
28
  export { getDepositIx, getWithdrawIx };
29
29
  export type { ConnectionParams, DepositContextParams, DepositParams, WithdrawContextParams, WithdrawParams };
@@ -8,22 +8,22 @@ type ConnectionParams = {
8
8
  };
9
9
  type DepositContextParams = {
10
10
  asset: PublicKey;
11
- receipient?: PublicKey;
11
+ recipient?: PublicKey;
12
12
  signer: PublicKey;
13
13
  };
14
14
  type DepositParams = {
15
15
  amount: BN;
16
16
  } & DepositContextParams & ConnectionParams;
17
- declare const getDepositIx: ({ amount, asset, receipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
17
+ declare const getDepositIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
18
18
  type WithdrawContextParams = {
19
19
  asset: PublicKey;
20
- receipient?: PublicKey;
20
+ recipient?: PublicKey;
21
21
  signer: PublicKey;
22
22
  };
23
23
  type WithdrawParams = {
24
24
  amount: BN;
25
25
  } & WithdrawContextParams & ConnectionParams;
26
- declare const getWithdrawIx: ({ amount, asset, receipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
26
+ declare const getWithdrawIx: ({ amount, asset, recipient, signer, connection, }: DepositParams) => Promise<_solana_web3_js.TransactionInstruction>;
27
27
 
28
28
  export { getDepositIx, getWithdrawIx };
29
29
  export type { ConnectionParams, DepositContextParams, DepositParams, WithdrawContextParams, WithdrawParams };
@@ -3,21 +3,17 @@ import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, getAssociatedTokenAddres
3
3
  import { Program } from '@coral-xyz/anchor';
4
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';
5
5
 
6
- function getDepositContext({
7
- receipient,
8
- asset,
9
- signer
10
- }) {
6
+ function getDepositContext({ recipient, asset, signer }) {
11
7
  const lendingToken = getLendingToken(asset);
12
8
  const lending2 = getLending(asset);
13
9
  const liquidityKey = getLiquidity();
14
- receipient = receipient ?? signer;
10
+ recipient = recipient ?? signer;
15
11
  return {
16
12
  signer,
17
13
  depositorTokenAccount: getAssociatedTokenAddressSync(asset, signer),
18
- receipientTokenAccount: getAssociatedTokenAddressSync(
14
+ recipientTokenAccount: getAssociatedTokenAddressSync(
19
15
  lendingToken,
20
- receipient,
16
+ recipient,
21
17
  false
22
18
  ),
23
19
  lendingAdmin: getLendingAdmin(),
@@ -56,7 +52,7 @@ function getDepositContext({
56
52
  const getDepositIx = async ({
57
53
  amount,
58
54
  asset,
59
- receipient,
55
+ recipient,
60
56
  signer,
61
57
  connection
62
58
  }) => {
@@ -67,26 +63,26 @@ const getDepositIx = async ({
67
63
  return await program.methods.deposit(amount).accounts(
68
64
  getDepositContext({
69
65
  asset,
70
- receipient,
66
+ recipient,
71
67
  signer
72
68
  })
73
69
  ).instruction();
74
70
  };
75
71
  function getWithdrawContext({
76
72
  asset,
77
- receipient,
73
+ recipient,
78
74
  signer
79
75
  }) {
80
76
  const lendingToken = getLendingToken(asset);
81
77
  const lending2 = getLending(asset);
82
78
  const liquidityKey = getLiquidity();
83
- receipient = receipient ?? signer;
79
+ recipient = recipient ?? signer;
84
80
  return {
85
81
  signer,
86
82
  ownerTokenAccount: getAssociatedTokenAddressSync(lendingToken, signer),
87
- receipientTokenAccount: getAssociatedTokenAddressSync(
83
+ recipientTokenAccount: getAssociatedTokenAddressSync(
88
84
  asset,
89
- receipient,
85
+ recipient,
90
86
  false
91
87
  ),
92
88
  lendingAdmin: getLendingAdmin(),
@@ -126,7 +122,7 @@ function getWithdrawContext({
126
122
  const getWithdrawIx = async ({
127
123
  amount,
128
124
  asset,
129
- receipient,
125
+ recipient,
130
126
  signer,
131
127
  connection
132
128
  }) => {
@@ -137,7 +133,7 @@ const getWithdrawIx = async ({
137
133
  return await program.methods.withdraw(amount).accounts(
138
134
  getWithdrawContext({
139
135
  asset,
140
- receipient,
136
+ recipient,
141
137
  signer
142
138
  })
143
139
  ).instruction();
@@ -1,3 +1,3 @@
1
- export { default as lendingIdl } from "./lending.json";
2
- export { default as liquidityIdl } from "./liquidity.json";
3
- export { default as lendingRewardRateModelIdl } from "./lending_reward_rate_model.json";
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" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",