@jup-ag/lend 0.0.43 → 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.
- package/dist/borrow/index.d.mts +86 -2
- package/dist/borrow/index.d.ts +86 -2
- package/dist/borrow/index.mjs +15 -1
- package/dist/earn/index.d.mts +45 -2
- package/dist/earn/index.d.ts +45 -2
- package/dist/earn/index.mjs +15 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/borrow/index.d.mts
CHANGED
|
@@ -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
|
-
|
|
4708
|
-
|
|
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 };
|
package/dist/borrow/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
4708
|
-
|
|
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 };
|
package/dist/borrow/index.mjs
CHANGED
|
@@ -1512,4 +1512,18 @@ async function getInitTickIdLiquidationContext(vaultId, tick, signer, program) {
|
|
|
1512
1512
|
};
|
|
1513
1513
|
}
|
|
1514
1514
|
|
|
1515
|
-
|
|
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 };
|
package/dist/earn/index.d.mts
CHANGED
|
@@ -75,5 +75,48 @@ 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
|
-
|
|
79
|
-
|
|
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
|
+
stakingApr?: number;
|
|
88
|
+
};
|
|
89
|
+
type LendingToken = {
|
|
90
|
+
id: number;
|
|
91
|
+
address: string;
|
|
92
|
+
name: string;
|
|
93
|
+
symbol: string;
|
|
94
|
+
decimals: number;
|
|
95
|
+
assetAddress: string;
|
|
96
|
+
asset: Token;
|
|
97
|
+
totalAssets: string;
|
|
98
|
+
totalSupply: string;
|
|
99
|
+
convertToShares: string;
|
|
100
|
+
convertToAssets: string;
|
|
101
|
+
rewardsRate: string;
|
|
102
|
+
supplyRate: string;
|
|
103
|
+
totalRate: string;
|
|
104
|
+
rebalanceDifference: string;
|
|
105
|
+
liquiditySupplyData: {
|
|
106
|
+
modeWithInterest: boolean;
|
|
107
|
+
supply: string;
|
|
108
|
+
withdrawalLimit: string;
|
|
109
|
+
lastUpdateTimestamp: string;
|
|
110
|
+
expandPercent: string;
|
|
111
|
+
expandDuration: string;
|
|
112
|
+
baseWithdrawalLimit: string;
|
|
113
|
+
withdrawableUntilLimit: string;
|
|
114
|
+
withdrawable: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
declare const getLendingTokens: ({ apiKey, }: {
|
|
118
|
+
apiKey?: string;
|
|
119
|
+
}) => Promise<LendingToken[]>;
|
|
120
|
+
|
|
121
|
+
export { getDepositContext, getDepositIx, getLendingTokens, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
|
|
122
|
+
export type { ConnectionParams, DepositContextParams, DepositParams, LendingToken, MintParams, RedeemParams, Token, WithdrawContextParams, WithdrawParams };
|
package/dist/earn/index.d.ts
CHANGED
|
@@ -75,5 +75,48 @@ 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
|
-
|
|
79
|
-
|
|
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
|
+
stakingApr?: number;
|
|
88
|
+
};
|
|
89
|
+
type LendingToken = {
|
|
90
|
+
id: number;
|
|
91
|
+
address: string;
|
|
92
|
+
name: string;
|
|
93
|
+
symbol: string;
|
|
94
|
+
decimals: number;
|
|
95
|
+
assetAddress: string;
|
|
96
|
+
asset: Token;
|
|
97
|
+
totalAssets: string;
|
|
98
|
+
totalSupply: string;
|
|
99
|
+
convertToShares: string;
|
|
100
|
+
convertToAssets: string;
|
|
101
|
+
rewardsRate: string;
|
|
102
|
+
supplyRate: string;
|
|
103
|
+
totalRate: string;
|
|
104
|
+
rebalanceDifference: string;
|
|
105
|
+
liquiditySupplyData: {
|
|
106
|
+
modeWithInterest: boolean;
|
|
107
|
+
supply: string;
|
|
108
|
+
withdrawalLimit: string;
|
|
109
|
+
lastUpdateTimestamp: string;
|
|
110
|
+
expandPercent: string;
|
|
111
|
+
expandDuration: string;
|
|
112
|
+
baseWithdrawalLimit: string;
|
|
113
|
+
withdrawableUntilLimit: string;
|
|
114
|
+
withdrawable: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
declare const getLendingTokens: ({ apiKey, }: {
|
|
118
|
+
apiKey?: string;
|
|
119
|
+
}) => Promise<LendingToken[]>;
|
|
120
|
+
|
|
121
|
+
export { getDepositContext, getDepositIx, getLendingTokens, getMintIx, getRedeemIx, getWithdrawContext, getWithdrawIx };
|
|
122
|
+
export type { ConnectionParams, DepositContextParams, DepositParams, LendingToken, MintParams, RedeemParams, Token, WithdrawContextParams, WithdrawParams };
|
package/dist/earn/index.mjs
CHANGED
|
@@ -164,4 +164,18 @@ const getRedeemIx = async ({
|
|
|
164
164
|
).instruction();
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
|
|
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 };
|
package/dist/index.mjs
CHANGED