@lavarage/sdk 6.7.5 → 6.8.0
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/index.d.mts +74 -2
- package/dist/index.d.ts +74 -2
- package/dist/index.js +4049 -3779
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4044 -3763
- package/dist/index.mjs.map +1 -1
- package/evm.ts +1 -1
- package/index.ts +3 -2
- package/interfaces/sol.ts +9 -0
- package/lending.ts +456 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Program, ProgramAccount, BN } from '@coral-xyz/anchor';
|
|
2
|
-
import { PublicKey,
|
|
2
|
+
import { PublicKey, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
3
3
|
import { Provider, BigNumberish, ContractTransaction } from 'ethers';
|
|
4
4
|
|
|
5
5
|
type Lavarage$1 = {
|
|
@@ -2836,6 +2836,78 @@ declare function getCollateralExposureEvm(provider: Provider, tokenHolderContrac
|
|
|
2836
2836
|
*/
|
|
2837
2837
|
declare function getAvailableExposureEvm(provider: Provider, tokenHolderContractAddress: string, collateralAddress: string): Promise<bigint>;
|
|
2838
2838
|
|
|
2839
|
+
declare function getNodeWalletPDA(operatorPublicKey: PublicKey, mintPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2840
|
+
declare function getTradingPoolPDA(poolOwnerPublicKey: PublicKey, tokenPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2841
|
+
declare function depositFunds(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2842
|
+
nodeWallet: PublicKey;
|
|
2843
|
+
mint?: string;
|
|
2844
|
+
funder: PublicKey;
|
|
2845
|
+
amount: number;
|
|
2846
|
+
}): Promise<VersionedTransaction>;
|
|
2847
|
+
declare function withdrawFundsV1(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2848
|
+
nodeWallet: PublicKey;
|
|
2849
|
+
funder: PublicKey;
|
|
2850
|
+
amount: number;
|
|
2851
|
+
}): Promise<VersionedTransaction>;
|
|
2852
|
+
declare function withdrawFundsV2(lavarageProgram: Program<Lavarage>, params: {
|
|
2853
|
+
nodeWallet: PublicKey;
|
|
2854
|
+
funder: PublicKey;
|
|
2855
|
+
mint: string;
|
|
2856
|
+
amount: number;
|
|
2857
|
+
fromTokenAccount?: PublicKey;
|
|
2858
|
+
toTokenAccount?: PublicKey;
|
|
2859
|
+
}): Promise<VersionedTransaction>;
|
|
2860
|
+
declare function withdrawFunds(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2861
|
+
nodeWallet: PublicKey;
|
|
2862
|
+
funder: PublicKey;
|
|
2863
|
+
amount: number;
|
|
2864
|
+
mint?: string;
|
|
2865
|
+
fromTokenAccount?: PublicKey;
|
|
2866
|
+
toTokenAccount?: PublicKey;
|
|
2867
|
+
}): Promise<VersionedTransaction>;
|
|
2868
|
+
declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2869
|
+
tradingPool: PublicKey;
|
|
2870
|
+
poolOwner: PublicKey;
|
|
2871
|
+
nodeWallet: string;
|
|
2872
|
+
mint?: string;
|
|
2873
|
+
interestRate: number;
|
|
2874
|
+
maxExposure: number;
|
|
2875
|
+
}): Promise<VersionedTransaction>;
|
|
2876
|
+
declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2877
|
+
tradingPool: PublicKey;
|
|
2878
|
+
nodeWallet: string;
|
|
2879
|
+
poolOwner: PublicKey;
|
|
2880
|
+
maxExposure: number;
|
|
2881
|
+
}): Promise<VersionedTransaction>;
|
|
2882
|
+
declare function updateInterestRate(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2883
|
+
tradingPool: PublicKey;
|
|
2884
|
+
nodeWallet: string;
|
|
2885
|
+
poolOwner: PublicKey;
|
|
2886
|
+
interestRate: number;
|
|
2887
|
+
}): Promise<VersionedTransaction>;
|
|
2888
|
+
declare function updateOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2889
|
+
tradingPool: PublicKey;
|
|
2890
|
+
poolOwner: PublicKey;
|
|
2891
|
+
nodeWallet: string;
|
|
2892
|
+
mint: string;
|
|
2893
|
+
interestRate: number;
|
|
2894
|
+
maxExposure: number;
|
|
2895
|
+
}): Promise<VersionedTransaction>;
|
|
2896
|
+
|
|
2897
|
+
declare const lending_createOffer: typeof createOffer;
|
|
2898
|
+
declare const lending_depositFunds: typeof depositFunds;
|
|
2899
|
+
declare const lending_getNodeWalletPDA: typeof getNodeWalletPDA;
|
|
2900
|
+
declare const lending_getTradingPoolPDA: typeof getTradingPoolPDA;
|
|
2901
|
+
declare const lending_updateInterestRate: typeof updateInterestRate;
|
|
2902
|
+
declare const lending_updateMaxExposure: typeof updateMaxExposure;
|
|
2903
|
+
declare const lending_updateOffer: typeof updateOffer;
|
|
2904
|
+
declare const lending_withdrawFunds: typeof withdrawFunds;
|
|
2905
|
+
declare const lending_withdrawFundsV1: typeof withdrawFundsV1;
|
|
2906
|
+
declare const lending_withdrawFundsV2: typeof withdrawFundsV2;
|
|
2907
|
+
declare namespace lending {
|
|
2908
|
+
export { lending_createOffer as createOffer, lending_depositFunds as depositFunds, lending_getNodeWalletPDA as getNodeWalletPDA, lending_getTradingPoolPDA as getTradingPoolPDA, lending_updateInterestRate as updateInterestRate, lending_updateMaxExposure as updateMaxExposure, lending_updateOffer as updateOffer, lending_withdrawFunds as withdrawFunds, lending_withdrawFundsV1 as withdrawFundsV1, lending_withdrawFundsV2 as withdrawFundsV2 };
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2839
2911
|
declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
|
|
2840
2912
|
declare function getPositionAccountPDA(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, offer: ProgramAccount, seed: PublicKey): PublicKey;
|
|
2841
2913
|
|
|
@@ -3037,4 +3109,4 @@ declare const mergePositionV2: (lavarageProgram: Program<Lavarage>, position1: P
|
|
|
3037
3109
|
collateralType: PublicKey;
|
|
3038
3110
|
}>, quoteToken: PublicKey) => Promise<VersionedTransaction>;
|
|
3039
3111
|
|
|
3040
|
-
export { IDL$1 as IDL, lavaragev2 as IDLV2, type Lavarage$1 as Lavarage, closePositionEvm, closeTradeV1, closeTradeV2, createTpDelegate, getActiveLoanCountEvm, getActiveLoansBatchEvm, getAllPositions, getAvailableExposureEvm, getClosedPositions, getClosedPositionsEvm, getCollateralExposureEvm, getCollateralInfoEvm, getDelegateAccounts, getLiquidatedPositions, getLiquidatedPositionsEvm, getLoanEvm, getLoansByBorrowerEvm, getOffers, getOffersEvm, getOpenPositions, getOpeningFeeEvm, getPda, getPositionAccountPDA, getPositionsEvm, getProfitFeeEvm, getTokenBalanceEvm, getUserLoansEvm, mergePositionV2, modifyTpDelegate, openPositionEvm, openTradeV1, openTradeV2, partialRepayV1, partialRepayV2, removeTpDelegate, splitPositionV2 };
|
|
3112
|
+
export { IDL$1 as IDL, lavaragev2 as IDLV2, type Lavarage$1 as Lavarage, closePositionEvm, closeTradeV1, closeTradeV2, createTpDelegate, getActiveLoanCountEvm, getActiveLoansBatchEvm, getAllPositions, getAvailableExposureEvm, getClosedPositions, getClosedPositionsEvm, getCollateralExposureEvm, getCollateralInfoEvm, getDelegateAccounts, getLiquidatedPositions, getLiquidatedPositionsEvm, getLoanEvm, getLoansByBorrowerEvm, getOffers, getOffersEvm, getOpenPositions, getOpeningFeeEvm, getPda, getPositionAccountPDA, getPositionsEvm, getProfitFeeEvm, getTokenBalanceEvm, getUserLoansEvm, lending, mergePositionV2, modifyTpDelegate, openPositionEvm, openTradeV1, openTradeV2, partialRepayV1, partialRepayV2, removeTpDelegate, splitPositionV2 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Program, ProgramAccount, BN } from '@coral-xyz/anchor';
|
|
2
|
-
import { PublicKey,
|
|
2
|
+
import { PublicKey, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
3
3
|
import { Provider, BigNumberish, ContractTransaction } from 'ethers';
|
|
4
4
|
|
|
5
5
|
type Lavarage$1 = {
|
|
@@ -2836,6 +2836,78 @@ declare function getCollateralExposureEvm(provider: Provider, tokenHolderContrac
|
|
|
2836
2836
|
*/
|
|
2837
2837
|
declare function getAvailableExposureEvm(provider: Provider, tokenHolderContractAddress: string, collateralAddress: string): Promise<bigint>;
|
|
2838
2838
|
|
|
2839
|
+
declare function getNodeWalletPDA(operatorPublicKey: PublicKey, mintPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2840
|
+
declare function getTradingPoolPDA(poolOwnerPublicKey: PublicKey, tokenPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2841
|
+
declare function depositFunds(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2842
|
+
nodeWallet: PublicKey;
|
|
2843
|
+
mint?: string;
|
|
2844
|
+
funder: PublicKey;
|
|
2845
|
+
amount: number;
|
|
2846
|
+
}): Promise<VersionedTransaction>;
|
|
2847
|
+
declare function withdrawFundsV1(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2848
|
+
nodeWallet: PublicKey;
|
|
2849
|
+
funder: PublicKey;
|
|
2850
|
+
amount: number;
|
|
2851
|
+
}): Promise<VersionedTransaction>;
|
|
2852
|
+
declare function withdrawFundsV2(lavarageProgram: Program<Lavarage>, params: {
|
|
2853
|
+
nodeWallet: PublicKey;
|
|
2854
|
+
funder: PublicKey;
|
|
2855
|
+
mint: string;
|
|
2856
|
+
amount: number;
|
|
2857
|
+
fromTokenAccount?: PublicKey;
|
|
2858
|
+
toTokenAccount?: PublicKey;
|
|
2859
|
+
}): Promise<VersionedTransaction>;
|
|
2860
|
+
declare function withdrawFunds(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2861
|
+
nodeWallet: PublicKey;
|
|
2862
|
+
funder: PublicKey;
|
|
2863
|
+
amount: number;
|
|
2864
|
+
mint?: string;
|
|
2865
|
+
fromTokenAccount?: PublicKey;
|
|
2866
|
+
toTokenAccount?: PublicKey;
|
|
2867
|
+
}): Promise<VersionedTransaction>;
|
|
2868
|
+
declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2869
|
+
tradingPool: PublicKey;
|
|
2870
|
+
poolOwner: PublicKey;
|
|
2871
|
+
nodeWallet: string;
|
|
2872
|
+
mint?: string;
|
|
2873
|
+
interestRate: number;
|
|
2874
|
+
maxExposure: number;
|
|
2875
|
+
}): Promise<VersionedTransaction>;
|
|
2876
|
+
declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2877
|
+
tradingPool: PublicKey;
|
|
2878
|
+
nodeWallet: string;
|
|
2879
|
+
poolOwner: PublicKey;
|
|
2880
|
+
maxExposure: number;
|
|
2881
|
+
}): Promise<VersionedTransaction>;
|
|
2882
|
+
declare function updateInterestRate(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2883
|
+
tradingPool: PublicKey;
|
|
2884
|
+
nodeWallet: string;
|
|
2885
|
+
poolOwner: PublicKey;
|
|
2886
|
+
interestRate: number;
|
|
2887
|
+
}): Promise<VersionedTransaction>;
|
|
2888
|
+
declare function updateOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2889
|
+
tradingPool: PublicKey;
|
|
2890
|
+
poolOwner: PublicKey;
|
|
2891
|
+
nodeWallet: string;
|
|
2892
|
+
mint: string;
|
|
2893
|
+
interestRate: number;
|
|
2894
|
+
maxExposure: number;
|
|
2895
|
+
}): Promise<VersionedTransaction>;
|
|
2896
|
+
|
|
2897
|
+
declare const lending_createOffer: typeof createOffer;
|
|
2898
|
+
declare const lending_depositFunds: typeof depositFunds;
|
|
2899
|
+
declare const lending_getNodeWalletPDA: typeof getNodeWalletPDA;
|
|
2900
|
+
declare const lending_getTradingPoolPDA: typeof getTradingPoolPDA;
|
|
2901
|
+
declare const lending_updateInterestRate: typeof updateInterestRate;
|
|
2902
|
+
declare const lending_updateMaxExposure: typeof updateMaxExposure;
|
|
2903
|
+
declare const lending_updateOffer: typeof updateOffer;
|
|
2904
|
+
declare const lending_withdrawFunds: typeof withdrawFunds;
|
|
2905
|
+
declare const lending_withdrawFundsV1: typeof withdrawFundsV1;
|
|
2906
|
+
declare const lending_withdrawFundsV2: typeof withdrawFundsV2;
|
|
2907
|
+
declare namespace lending {
|
|
2908
|
+
export { lending_createOffer as createOffer, lending_depositFunds as depositFunds, lending_getNodeWalletPDA as getNodeWalletPDA, lending_getTradingPoolPDA as getTradingPoolPDA, lending_updateInterestRate as updateInterestRate, lending_updateMaxExposure as updateMaxExposure, lending_updateOffer as updateOffer, lending_withdrawFunds as withdrawFunds, lending_withdrawFundsV1 as withdrawFundsV1, lending_withdrawFundsV2 as withdrawFundsV2 };
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2839
2911
|
declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
|
|
2840
2912
|
declare function getPositionAccountPDA(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, offer: ProgramAccount, seed: PublicKey): PublicKey;
|
|
2841
2913
|
|
|
@@ -3037,4 +3109,4 @@ declare const mergePositionV2: (lavarageProgram: Program<Lavarage>, position1: P
|
|
|
3037
3109
|
collateralType: PublicKey;
|
|
3038
3110
|
}>, quoteToken: PublicKey) => Promise<VersionedTransaction>;
|
|
3039
3111
|
|
|
3040
|
-
export { IDL$1 as IDL, lavaragev2 as IDLV2, type Lavarage$1 as Lavarage, closePositionEvm, closeTradeV1, closeTradeV2, createTpDelegate, getActiveLoanCountEvm, getActiveLoansBatchEvm, getAllPositions, getAvailableExposureEvm, getClosedPositions, getClosedPositionsEvm, getCollateralExposureEvm, getCollateralInfoEvm, getDelegateAccounts, getLiquidatedPositions, getLiquidatedPositionsEvm, getLoanEvm, getLoansByBorrowerEvm, getOffers, getOffersEvm, getOpenPositions, getOpeningFeeEvm, getPda, getPositionAccountPDA, getPositionsEvm, getProfitFeeEvm, getTokenBalanceEvm, getUserLoansEvm, mergePositionV2, modifyTpDelegate, openPositionEvm, openTradeV1, openTradeV2, partialRepayV1, partialRepayV2, removeTpDelegate, splitPositionV2 };
|
|
3112
|
+
export { IDL$1 as IDL, lavaragev2 as IDLV2, type Lavarage$1 as Lavarage, closePositionEvm, closeTradeV1, closeTradeV2, createTpDelegate, getActiveLoanCountEvm, getActiveLoansBatchEvm, getAllPositions, getAvailableExposureEvm, getClosedPositions, getClosedPositionsEvm, getCollateralExposureEvm, getCollateralInfoEvm, getDelegateAccounts, getLiquidatedPositions, getLiquidatedPositionsEvm, getLoanEvm, getLoansByBorrowerEvm, getOffers, getOffersEvm, getOpenPositions, getOpeningFeeEvm, getPda, getPositionAccountPDA, getPositionsEvm, getProfitFeeEvm, getTokenBalanceEvm, getUserLoansEvm, lending, mergePositionV2, modifyTpDelegate, openPositionEvm, openTradeV1, openTradeV2, partialRepayV1, partialRepayV2, removeTpDelegate, splitPositionV2 };
|