@jup-ag/lend 0.0.44 → 0.0.45

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.
@@ -4704,5 +4704,89 @@ declare function loadRelevantTicksHasDebtArrays(vaultId: number, program: Progra
4704
4704
  declare function getRatioAtTick(tick: number): BN;
4705
4705
  declare function getTickAtRatio(ratioX48: BN): number;
4706
4706
 
4707
- export { getCurrentPosition, getCurrentPositionState, getFinalPosition, getInitPositionContext, getOperateContext, getOperateIx, getRatioAtTick, getTickAtRatio, getVaultsProgram, loadRelevantBranches, loadRelevantTicksHasDebtArrays };
4708
- export type { ConnectionParams, OperateContextParams, OperateParams };
4707
+ type Token = {
4708
+ address: string;
4709
+ chainId: string;
4710
+ name: string;
4711
+ symbol: string;
4712
+ decimals: number;
4713
+ logoUrl?: string;
4714
+ price: string;
4715
+ coingeckoId?: string;
4716
+ stakingApr?: number;
4717
+ };
4718
+ type Vault = {
4719
+ id: number;
4720
+ address: string;
4721
+ supplyToken: Token;
4722
+ borrowToken: Token;
4723
+ totalSupply: string;
4724
+ totalSupplyLiquidity: string;
4725
+ totalBorrow: string;
4726
+ totalBorrowLiquidity: string;
4727
+ absorbedSupply: string;
4728
+ absorbedBorrow: string;
4729
+ supplyRateMagnifier: string;
4730
+ borrowRateMagnifier: string;
4731
+ borrowFee: string;
4732
+ collateralFactor: string;
4733
+ liquidationThreshold: string;
4734
+ liquidationMaxLimit: string;
4735
+ liquidationPenalty: string;
4736
+ withdrawalGap: string;
4737
+ supplyRate: string;
4738
+ supplyRateLiquidity: string;
4739
+ borrowRate: string;
4740
+ borrowRateLiquidity: string;
4741
+ withdrawLimit: string;
4742
+ withdrawableUntilLimit: string;
4743
+ withdrawable: string;
4744
+ borrowLimit: string;
4745
+ borrowableUntilLimit: string;
4746
+ borrowable: string;
4747
+ borrowLimitUtilization: string;
4748
+ minimumBorrowing: string;
4749
+ totalPositions: number;
4750
+ oracle: string;
4751
+ oraclePriceOperate: string;
4752
+ oraclePriceLiquidate: string;
4753
+ oracleSources: Array<{
4754
+ source: string;
4755
+ invert: boolean;
4756
+ multiplier: string;
4757
+ divisor: string;
4758
+ sourceType: {} & {
4759
+ pyth: Record<string, never>;
4760
+ };
4761
+ }>;
4762
+ liquiditySupplyData: {
4763
+ modeWithInterest: boolean;
4764
+ supply: string;
4765
+ withdrawalLimit: string;
4766
+ lastUpdateTimestamp: string;
4767
+ expandPercent: string;
4768
+ expandDuration: string;
4769
+ baseWithdrawalLimit: string;
4770
+ withdrawableUntilLimit: string;
4771
+ withdrawable: string;
4772
+ };
4773
+ liquidityBorrowData: {
4774
+ modeWithInterest: boolean;
4775
+ borrow: string;
4776
+ borrowLimit: string;
4777
+ lastUpdateTimestamp: string;
4778
+ expandPercent: number;
4779
+ expandDuration: number;
4780
+ baseBorrowLimit: string;
4781
+ maxBorrowLimit: string;
4782
+ borrowLimitUtilization: string;
4783
+ borrowableUntilLimit: string;
4784
+ borrowable: string;
4785
+ };
4786
+ };
4787
+ declare const getVaults: ({ apiKey, }: {
4788
+ apiKey?: string;
4789
+ }) => Promise<Vault[]>;
4790
+
4791
+ export { getCurrentPosition, getCurrentPositionState, getFinalPosition, getInitPositionContext, getOperateContext, getOperateIx, getRatioAtTick, getTickAtRatio, getVaults, getVaultsProgram, loadRelevantBranches, loadRelevantTicksHasDebtArrays };
4792
+ export type { ConnectionParams, OperateContextParams, OperateParams, Token, Vault };
@@ -4704,5 +4704,89 @@ declare function loadRelevantTicksHasDebtArrays(vaultId: number, program: Progra
4704
4704
  declare function getRatioAtTick(tick: number): BN;
4705
4705
  declare function getTickAtRatio(ratioX48: BN): number;
4706
4706
 
4707
- export { getCurrentPosition, getCurrentPositionState, getFinalPosition, getInitPositionContext, getOperateContext, getOperateIx, getRatioAtTick, getTickAtRatio, getVaultsProgram, loadRelevantBranches, loadRelevantTicksHasDebtArrays };
4708
- export type { ConnectionParams, OperateContextParams, OperateParams };
4707
+ type Token = {
4708
+ address: string;
4709
+ chainId: string;
4710
+ name: string;
4711
+ symbol: string;
4712
+ decimals: number;
4713
+ logoUrl?: string;
4714
+ price: string;
4715
+ coingeckoId?: string;
4716
+ stakingApr?: number;
4717
+ };
4718
+ type Vault = {
4719
+ id: number;
4720
+ address: string;
4721
+ supplyToken: Token;
4722
+ borrowToken: Token;
4723
+ totalSupply: string;
4724
+ totalSupplyLiquidity: string;
4725
+ totalBorrow: string;
4726
+ totalBorrowLiquidity: string;
4727
+ absorbedSupply: string;
4728
+ absorbedBorrow: string;
4729
+ supplyRateMagnifier: string;
4730
+ borrowRateMagnifier: string;
4731
+ borrowFee: string;
4732
+ collateralFactor: string;
4733
+ liquidationThreshold: string;
4734
+ liquidationMaxLimit: string;
4735
+ liquidationPenalty: string;
4736
+ withdrawalGap: string;
4737
+ supplyRate: string;
4738
+ supplyRateLiquidity: string;
4739
+ borrowRate: string;
4740
+ borrowRateLiquidity: string;
4741
+ withdrawLimit: string;
4742
+ withdrawableUntilLimit: string;
4743
+ withdrawable: string;
4744
+ borrowLimit: string;
4745
+ borrowableUntilLimit: string;
4746
+ borrowable: string;
4747
+ borrowLimitUtilization: string;
4748
+ minimumBorrowing: string;
4749
+ totalPositions: number;
4750
+ oracle: string;
4751
+ oraclePriceOperate: string;
4752
+ oraclePriceLiquidate: string;
4753
+ oracleSources: Array<{
4754
+ source: string;
4755
+ invert: boolean;
4756
+ multiplier: string;
4757
+ divisor: string;
4758
+ sourceType: {} & {
4759
+ pyth: Record<string, never>;
4760
+ };
4761
+ }>;
4762
+ liquiditySupplyData: {
4763
+ modeWithInterest: boolean;
4764
+ supply: string;
4765
+ withdrawalLimit: string;
4766
+ lastUpdateTimestamp: string;
4767
+ expandPercent: string;
4768
+ expandDuration: string;
4769
+ baseWithdrawalLimit: string;
4770
+ withdrawableUntilLimit: string;
4771
+ withdrawable: string;
4772
+ };
4773
+ liquidityBorrowData: {
4774
+ modeWithInterest: boolean;
4775
+ borrow: string;
4776
+ borrowLimit: string;
4777
+ lastUpdateTimestamp: string;
4778
+ expandPercent: number;
4779
+ expandDuration: number;
4780
+ baseBorrowLimit: string;
4781
+ maxBorrowLimit: string;
4782
+ borrowLimitUtilization: string;
4783
+ borrowableUntilLimit: string;
4784
+ borrowable: string;
4785
+ };
4786
+ };
4787
+ declare const getVaults: ({ apiKey, }: {
4788
+ apiKey?: string;
4789
+ }) => Promise<Vault[]>;
4790
+
4791
+ export { getCurrentPosition, getCurrentPositionState, getFinalPosition, getInitPositionContext, getOperateContext, getOperateIx, getRatioAtTick, getTickAtRatio, getVaults, getVaultsProgram, loadRelevantBranches, loadRelevantTicksHasDebtArrays };
4792
+ export type { ConnectionParams, OperateContextParams, OperateParams, Token, Vault };
@@ -1512,4 +1512,18 @@ async function getInitTickIdLiquidationContext(vaultId, tick, signer, program) {
1512
1512
  };
1513
1513
  }
1514
1514
 
1515
- export { getCurrentPosition, getCurrentPositionState, getFinalPosition, getInitPositionContext, getOperateContext, getOperateIx, getRatioAtTick, getTickAtRatio, getVaultsProgram, loadRelevantBranches, loadRelevantTicksHasDebtArrays };
1515
+ const getVaults = async ({
1516
+ apiKey
1517
+ }) => {
1518
+ const response = await fetch(
1519
+ apiKey ? `https://api.jup.ag/lend/v1/borrow/vaults` : "https://lite-api.jup.ag/lend/v1/borrow/vaults",
1520
+ {
1521
+ headers: {
1522
+ "x-api-key": apiKey || ""
1523
+ }
1524
+ }
1525
+ );
1526
+ return await response.json();
1527
+ };
1528
+
1529
+ export { getCurrentPosition, getCurrentPositionState, getFinalPosition, getInitPositionContext, getOperateContext, getOperateIx, getRatioAtTick, getTickAtRatio, getVaults, getVaultsProgram, loadRelevantBranches, loadRelevantTicksHasDebtArrays };
@@ -84,6 +84,7 @@ type Token = {
84
84
  logoUrl?: string;
85
85
  price: string;
86
86
  coingeckoId?: string;
87
+ stakingApr?: number;
87
88
  };
88
89
  type LendingToken = {
89
90
  id: number;
@@ -92,15 +93,7 @@ type LendingToken = {
92
93
  symbol: string;
93
94
  decimals: number;
94
95
  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
- };
96
+ asset: Token;
104
97
  totalAssets: string;
105
98
  totalSupply: string;
106
99
  convertToShares: string;
@@ -84,6 +84,7 @@ type Token = {
84
84
  logoUrl?: string;
85
85
  price: string;
86
86
  coingeckoId?: string;
87
+ stakingApr?: number;
87
88
  };
88
89
  type LendingToken = {
89
90
  id: number;
@@ -92,15 +93,7 @@ type LendingToken = {
92
93
  symbol: string;
93
94
  decimals: number;
94
95
  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
- };
96
+ asset: Token;
104
97
  totalAssets: string;
105
98
  totalSupply: string;
106
99
  convertToShares: string;
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.45";
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.45",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",