@jup-ag/lend 0.0.44 → 0.0.46

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.
@@ -0,0 +1,119 @@
1
+ type Token = {
2
+ address: string;
3
+ chainId: string;
4
+ name: string;
5
+ symbol: string;
6
+ decimals: number;
7
+ logoUrl?: string;
8
+ price: string;
9
+ coingeckoId?: string;
10
+ stakingApr?: number;
11
+ };
12
+
13
+ type LendingToken = {
14
+ id: number;
15
+ address: string;
16
+ name: string;
17
+ symbol: string;
18
+ decimals: number;
19
+ assetAddress: string;
20
+ asset: Token;
21
+ totalAssets: string;
22
+ totalSupply: string;
23
+ convertToShares: string;
24
+ convertToAssets: string;
25
+ rewardsRate: string;
26
+ supplyRate: string;
27
+ totalRate: string;
28
+ rebalanceDifference: string;
29
+ liquiditySupplyData: {
30
+ modeWithInterest: boolean;
31
+ supply: string;
32
+ withdrawalLimit: string;
33
+ lastUpdateTimestamp: string;
34
+ expandPercent: string;
35
+ expandDuration: string;
36
+ baseWithdrawalLimit: string;
37
+ withdrawableUntilLimit: string;
38
+ withdrawable: string;
39
+ };
40
+ };
41
+ declare const getLendingTokens: ({ apiKey, }: {
42
+ apiKey?: string;
43
+ }) => Promise<LendingToken[]>;
44
+
45
+ type Vault = {
46
+ id: number;
47
+ address: string;
48
+ supplyToken: Token;
49
+ borrowToken: Token;
50
+ totalSupply: string;
51
+ totalSupplyLiquidity: string;
52
+ totalBorrow: string;
53
+ totalBorrowLiquidity: string;
54
+ absorbedSupply: string;
55
+ absorbedBorrow: string;
56
+ supplyRateMagnifier: string;
57
+ borrowRateMagnifier: string;
58
+ borrowFee: string;
59
+ collateralFactor: string;
60
+ liquidationThreshold: string;
61
+ liquidationMaxLimit: string;
62
+ liquidationPenalty: string;
63
+ withdrawalGap: string;
64
+ supplyRate: string;
65
+ supplyRateLiquidity: string;
66
+ borrowRate: string;
67
+ borrowRateLiquidity: string;
68
+ withdrawLimit: string;
69
+ withdrawableUntilLimit: string;
70
+ withdrawable: string;
71
+ borrowLimit: string;
72
+ borrowableUntilLimit: string;
73
+ borrowable: string;
74
+ borrowLimitUtilization: string;
75
+ minimumBorrowing: string;
76
+ totalPositions: number;
77
+ oracle: string;
78
+ oraclePriceOperate: string;
79
+ oraclePriceLiquidate: string;
80
+ oracleSources: Array<{
81
+ source: string;
82
+ invert: boolean;
83
+ multiplier: string;
84
+ divisor: string;
85
+ sourceType: {} & {
86
+ pyth: Record<string, never>;
87
+ };
88
+ }>;
89
+ liquiditySupplyData: {
90
+ modeWithInterest: boolean;
91
+ supply: string;
92
+ withdrawalLimit: string;
93
+ lastUpdateTimestamp: string;
94
+ expandPercent: string;
95
+ expandDuration: string;
96
+ baseWithdrawalLimit: string;
97
+ withdrawableUntilLimit: string;
98
+ withdrawable: string;
99
+ };
100
+ liquidityBorrowData: {
101
+ modeWithInterest: boolean;
102
+ borrow: string;
103
+ borrowLimit: string;
104
+ lastUpdateTimestamp: string;
105
+ expandPercent: number;
106
+ expandDuration: number;
107
+ baseBorrowLimit: string;
108
+ maxBorrowLimit: string;
109
+ borrowLimitUtilization: string;
110
+ borrowableUntilLimit: string;
111
+ borrowable: string;
112
+ };
113
+ };
114
+ declare const getVaults: ({ apiKey, }: {
115
+ apiKey?: string;
116
+ }) => Promise<Vault[]>;
117
+
118
+ export { getLendingTokens, getVaults };
119
+ export type { LendingToken, Token, Vault };
@@ -0,0 +1,119 @@
1
+ type Token = {
2
+ address: string;
3
+ chainId: string;
4
+ name: string;
5
+ symbol: string;
6
+ decimals: number;
7
+ logoUrl?: string;
8
+ price: string;
9
+ coingeckoId?: string;
10
+ stakingApr?: number;
11
+ };
12
+
13
+ type LendingToken = {
14
+ id: number;
15
+ address: string;
16
+ name: string;
17
+ symbol: string;
18
+ decimals: number;
19
+ assetAddress: string;
20
+ asset: Token;
21
+ totalAssets: string;
22
+ totalSupply: string;
23
+ convertToShares: string;
24
+ convertToAssets: string;
25
+ rewardsRate: string;
26
+ supplyRate: string;
27
+ totalRate: string;
28
+ rebalanceDifference: string;
29
+ liquiditySupplyData: {
30
+ modeWithInterest: boolean;
31
+ supply: string;
32
+ withdrawalLimit: string;
33
+ lastUpdateTimestamp: string;
34
+ expandPercent: string;
35
+ expandDuration: string;
36
+ baseWithdrawalLimit: string;
37
+ withdrawableUntilLimit: string;
38
+ withdrawable: string;
39
+ };
40
+ };
41
+ declare const getLendingTokens: ({ apiKey, }: {
42
+ apiKey?: string;
43
+ }) => Promise<LendingToken[]>;
44
+
45
+ type Vault = {
46
+ id: number;
47
+ address: string;
48
+ supplyToken: Token;
49
+ borrowToken: Token;
50
+ totalSupply: string;
51
+ totalSupplyLiquidity: string;
52
+ totalBorrow: string;
53
+ totalBorrowLiquidity: string;
54
+ absorbedSupply: string;
55
+ absorbedBorrow: string;
56
+ supplyRateMagnifier: string;
57
+ borrowRateMagnifier: string;
58
+ borrowFee: string;
59
+ collateralFactor: string;
60
+ liquidationThreshold: string;
61
+ liquidationMaxLimit: string;
62
+ liquidationPenalty: string;
63
+ withdrawalGap: string;
64
+ supplyRate: string;
65
+ supplyRateLiquidity: string;
66
+ borrowRate: string;
67
+ borrowRateLiquidity: string;
68
+ withdrawLimit: string;
69
+ withdrawableUntilLimit: string;
70
+ withdrawable: string;
71
+ borrowLimit: string;
72
+ borrowableUntilLimit: string;
73
+ borrowable: string;
74
+ borrowLimitUtilization: string;
75
+ minimumBorrowing: string;
76
+ totalPositions: number;
77
+ oracle: string;
78
+ oraclePriceOperate: string;
79
+ oraclePriceLiquidate: string;
80
+ oracleSources: Array<{
81
+ source: string;
82
+ invert: boolean;
83
+ multiplier: string;
84
+ divisor: string;
85
+ sourceType: {} & {
86
+ pyth: Record<string, never>;
87
+ };
88
+ }>;
89
+ liquiditySupplyData: {
90
+ modeWithInterest: boolean;
91
+ supply: string;
92
+ withdrawalLimit: string;
93
+ lastUpdateTimestamp: string;
94
+ expandPercent: string;
95
+ expandDuration: string;
96
+ baseWithdrawalLimit: string;
97
+ withdrawableUntilLimit: string;
98
+ withdrawable: string;
99
+ };
100
+ liquidityBorrowData: {
101
+ modeWithInterest: boolean;
102
+ borrow: string;
103
+ borrowLimit: string;
104
+ lastUpdateTimestamp: string;
105
+ expandPercent: number;
106
+ expandDuration: number;
107
+ baseBorrowLimit: string;
108
+ maxBorrowLimit: string;
109
+ borrowLimitUtilization: string;
110
+ borrowableUntilLimit: string;
111
+ borrowable: string;
112
+ };
113
+ };
114
+ declare const getVaults: ({ apiKey, }: {
115
+ apiKey?: string;
116
+ }) => Promise<Vault[]>;
117
+
118
+ export { getLendingTokens, getVaults };
119
+ export type { LendingToken, Token, Vault };
@@ -0,0 +1,29 @@
1
+ const getLendingTokens = async ({
2
+ apiKey
3
+ }) => {
4
+ const response = await fetch(
5
+ apiKey ? `https://api.jup.ag/lend/v1/earn/tokens` : "https://lite-api.jup.ag/lend/v1/earn/tokens",
6
+ {
7
+ headers: {
8
+ "x-api-key": apiKey || ""
9
+ }
10
+ }
11
+ );
12
+ return await response.json();
13
+ };
14
+
15
+ const getVaults = async ({
16
+ apiKey
17
+ }) => {
18
+ const response = await fetch(
19
+ apiKey ? `https://api.jup.ag/lend/v1/borrow/vaults` : "https://lite-api.jup.ag/lend/v1/borrow/vaults",
20
+ {
21
+ headers: {
22
+ "x-api-key": apiKey || ""
23
+ }
24
+ }
25
+ );
26
+ return await response.json();
27
+ };
28
+
29
+ export { getLendingTokens, getVaults };
@@ -75,55 +75,5 @@ declare function getWithdrawContext({ asset, signer }: WithdrawContextParams): {
75
75
  declare const getWithdrawIx: ({ amount, asset, signer, connection, }: WithdrawParams) => Promise<_solana_web3_js.TransactionInstruction>;
76
76
  declare const getRedeemIx: ({ shares, asset, signer, connection, }: RedeemParams) => Promise<_solana_web3_js.TransactionInstruction>;
77
77
 
78
- type Token = {
79
- address: string;
80
- chainId: string;
81
- name: string;
82
- symbol: string;
83
- decimals: number;
84
- logoUrl?: string;
85
- price: string;
86
- coingeckoId?: string;
87
- };
88
- type LendingToken = {
89
- id: number;
90
- address: string;
91
- name: string;
92
- symbol: string;
93
- decimals: number;
94
- assetAddress: string;
95
- asset: {
96
- address: string;
97
- name: string;
98
- symbol: string;
99
- decimals: number;
100
- logoUrl: string;
101
- price: string;
102
- stakingApr?: number;
103
- };
104
- totalAssets: string;
105
- totalSupply: string;
106
- convertToShares: string;
107
- convertToAssets: string;
108
- rewardsRate: string;
109
- supplyRate: string;
110
- totalRate: string;
111
- rebalanceDifference: string;
112
- liquiditySupplyData: {
113
- modeWithInterest: boolean;
114
- supply: string;
115
- withdrawalLimit: string;
116
- lastUpdateTimestamp: string;
117
- expandPercent: string;
118
- expandDuration: string;
119
- baseWithdrawalLimit: string;
120
- withdrawableUntilLimit: string;
121
- withdrawable: string;
122
- };
123
- };
124
- declare const getLendingTokens: ({ apiKey, }: {
125
- apiKey?: string;
126
- }) => Promise<LendingToken[]>;
127
-
128
- export { getDepositContext, getDepositIx, getLendingTokens, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
129
- export type { ConnectionParams, DepositContextParams, DepositParams, LendingToken, MintParams, RedeemParams, Token, WithdrawContextParams, WithdrawParams };
78
+ export { getDepositContext, getDepositIx, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
79
+ export type { ConnectionParams, DepositContextParams, DepositParams, MintParams, RedeemParams, WithdrawContextParams, WithdrawParams };
@@ -75,55 +75,5 @@ declare function getWithdrawContext({ asset, signer }: WithdrawContextParams): {
75
75
  declare const getWithdrawIx: ({ amount, asset, signer, connection, }: WithdrawParams) => Promise<_solana_web3_js.TransactionInstruction>;
76
76
  declare const getRedeemIx: ({ shares, asset, signer, connection, }: RedeemParams) => Promise<_solana_web3_js.TransactionInstruction>;
77
77
 
78
- type Token = {
79
- address: string;
80
- chainId: string;
81
- name: string;
82
- symbol: string;
83
- decimals: number;
84
- logoUrl?: string;
85
- price: string;
86
- coingeckoId?: string;
87
- };
88
- type LendingToken = {
89
- id: number;
90
- address: string;
91
- name: string;
92
- symbol: string;
93
- decimals: number;
94
- assetAddress: string;
95
- asset: {
96
- address: string;
97
- name: string;
98
- symbol: string;
99
- decimals: number;
100
- logoUrl: string;
101
- price: string;
102
- stakingApr?: number;
103
- };
104
- totalAssets: string;
105
- totalSupply: string;
106
- convertToShares: string;
107
- convertToAssets: string;
108
- rewardsRate: string;
109
- supplyRate: string;
110
- totalRate: string;
111
- rebalanceDifference: string;
112
- liquiditySupplyData: {
113
- modeWithInterest: boolean;
114
- supply: string;
115
- withdrawalLimit: string;
116
- lastUpdateTimestamp: string;
117
- expandPercent: string;
118
- expandDuration: string;
119
- baseWithdrawalLimit: string;
120
- withdrawableUntilLimit: string;
121
- withdrawable: string;
122
- };
123
- };
124
- declare const getLendingTokens: ({ apiKey, }: {
125
- apiKey?: string;
126
- }) => Promise<LendingToken[]>;
127
-
128
- export { getDepositContext, getDepositIx, getLendingTokens, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
129
- export type { ConnectionParams, DepositContextParams, DepositParams, LendingToken, MintParams, RedeemParams, Token, WithdrawContextParams, WithdrawParams };
78
+ export { getDepositContext, getDepositIx, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
79
+ export type { ConnectionParams, DepositContextParams, DepositParams, MintParams, RedeemParams, WithdrawContextParams, WithdrawParams };
@@ -164,18 +164,4 @@ const getRedeemIx = async ({
164
164
  ).instruction();
165
165
  };
166
166
 
167
- const getLendingTokens = async ({
168
- apiKey
169
- }) => {
170
- const response = await fetch(
171
- apiKey ? `https://api.jup.ag/lend/v1/earn/tokens` : "https://lite-api.jup.ag/lend/v1/earn/tokens",
172
- {
173
- headers: {
174
- "x-api-key": apiKey || ""
175
- }
176
- }
177
- );
178
- return await response.json();
179
- };
180
-
181
- export { getDepositContext, getDepositIx, getLendingTokens, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
167
+ export { getDepositContext, getDepositIx, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
package/dist/index.mjs CHANGED
@@ -5,6 +5,6 @@ import '@solana/web3.js';
5
5
  import '@solana/spl-token';
6
6
  import 'bn.js';
7
7
 
8
- const version = "0.0.44";
8
+ const version = "0.0.46";
9
9
 
10
10
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jup-ag/lend",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -17,6 +17,10 @@
17
17
  "./borrow": {
18
18
  "types": "./dist/borrow/index.d.mts",
19
19
  "default": "./dist/borrow/index.mjs"
20
+ },
21
+ "./api": {
22
+ "types": "./dist/api/index.d.mts",
23
+ "default": "./dist/api/index.mjs"
20
24
  }
21
25
  },
22
26
  "files": [