@lavarage/sdk 6.8.2 → 6.8.3
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 +3759 -3489
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3730 -3449
- package/dist/index.mjs.map +1 -1
- package/index.ts +3 -2
- package/interfaces/sol.ts +9 -0
- package/lending.ts +456 -0
- package/package.json +1 -1
- package/playground.ts +0 -28
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 = {
|
|
@@ -2852,6 +2852,78 @@ declare const updateMaxLendPerTokenBatchEvm: (provider: Provider, tokenHolderCon
|
|
|
2852
2852
|
gasPrice?: string | number;
|
|
2853
2853
|
}) => Promise<ContractTransaction>;
|
|
2854
2854
|
|
|
2855
|
+
declare function getNodeWalletPDA(operatorPublicKey: PublicKey, mintPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2856
|
+
declare function getTradingPoolPDA(poolOwnerPublicKey: PublicKey, tokenPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2857
|
+
declare function depositFunds(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2858
|
+
nodeWallet: PublicKey;
|
|
2859
|
+
mint?: string;
|
|
2860
|
+
funder: PublicKey;
|
|
2861
|
+
amount: number;
|
|
2862
|
+
}): Promise<VersionedTransaction>;
|
|
2863
|
+
declare function withdrawFundsV1(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2864
|
+
nodeWallet: PublicKey;
|
|
2865
|
+
funder: PublicKey;
|
|
2866
|
+
amount: number;
|
|
2867
|
+
}): Promise<VersionedTransaction>;
|
|
2868
|
+
declare function withdrawFundsV2(lavarageProgram: Program<Lavarage>, params: {
|
|
2869
|
+
nodeWallet: PublicKey;
|
|
2870
|
+
funder: PublicKey;
|
|
2871
|
+
mint: string;
|
|
2872
|
+
amount: number;
|
|
2873
|
+
fromTokenAccount?: PublicKey;
|
|
2874
|
+
toTokenAccount?: PublicKey;
|
|
2875
|
+
}): Promise<VersionedTransaction>;
|
|
2876
|
+
declare function withdrawFunds(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2877
|
+
nodeWallet: PublicKey;
|
|
2878
|
+
funder: PublicKey;
|
|
2879
|
+
amount: number;
|
|
2880
|
+
mint?: string;
|
|
2881
|
+
fromTokenAccount?: PublicKey;
|
|
2882
|
+
toTokenAccount?: PublicKey;
|
|
2883
|
+
}): Promise<VersionedTransaction>;
|
|
2884
|
+
declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2885
|
+
tradingPool: PublicKey;
|
|
2886
|
+
poolOwner: PublicKey;
|
|
2887
|
+
nodeWallet: string;
|
|
2888
|
+
mint?: string;
|
|
2889
|
+
interestRate: number;
|
|
2890
|
+
maxExposure: number;
|
|
2891
|
+
}): Promise<VersionedTransaction>;
|
|
2892
|
+
declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2893
|
+
tradingPool: PublicKey;
|
|
2894
|
+
nodeWallet: string;
|
|
2895
|
+
poolOwner: PublicKey;
|
|
2896
|
+
maxExposure: number;
|
|
2897
|
+
}): Promise<VersionedTransaction>;
|
|
2898
|
+
declare function updateInterestRate(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2899
|
+
tradingPool: PublicKey;
|
|
2900
|
+
nodeWallet: string;
|
|
2901
|
+
poolOwner: PublicKey;
|
|
2902
|
+
interestRate: number;
|
|
2903
|
+
}): Promise<VersionedTransaction>;
|
|
2904
|
+
declare function updateOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2905
|
+
tradingPool: PublicKey;
|
|
2906
|
+
poolOwner: PublicKey;
|
|
2907
|
+
nodeWallet: string;
|
|
2908
|
+
mint: string;
|
|
2909
|
+
interestRate: number;
|
|
2910
|
+
maxExposure: number;
|
|
2911
|
+
}): Promise<VersionedTransaction>;
|
|
2912
|
+
|
|
2913
|
+
declare const lending_createOffer: typeof createOffer;
|
|
2914
|
+
declare const lending_depositFunds: typeof depositFunds;
|
|
2915
|
+
declare const lending_getNodeWalletPDA: typeof getNodeWalletPDA;
|
|
2916
|
+
declare const lending_getTradingPoolPDA: typeof getTradingPoolPDA;
|
|
2917
|
+
declare const lending_updateInterestRate: typeof updateInterestRate;
|
|
2918
|
+
declare const lending_updateMaxExposure: typeof updateMaxExposure;
|
|
2919
|
+
declare const lending_updateOffer: typeof updateOffer;
|
|
2920
|
+
declare const lending_withdrawFunds: typeof withdrawFunds;
|
|
2921
|
+
declare const lending_withdrawFundsV1: typeof withdrawFundsV1;
|
|
2922
|
+
declare const lending_withdrawFundsV2: typeof withdrawFundsV2;
|
|
2923
|
+
declare namespace lending {
|
|
2924
|
+
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 };
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2855
2927
|
declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
|
|
2856
2928
|
declare function getPositionAccountPDA(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, offer: ProgramAccount, seed: PublicKey): PublicKey;
|
|
2857
2929
|
|
|
@@ -3053,4 +3125,4 @@ declare const mergePositionV2: (lavarageProgram: Program<Lavarage>, position1: P
|
|
|
3053
3125
|
collateralType: PublicKey;
|
|
3054
3126
|
}>, quoteToken: PublicKey) => Promise<VersionedTransaction>;
|
|
3055
3127
|
|
|
3056
|
-
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, updateMaxLendPerTokenBatchEvm };
|
|
3128
|
+
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, updateMaxLendPerTokenBatchEvm };
|
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 = {
|
|
@@ -2852,6 +2852,78 @@ declare const updateMaxLendPerTokenBatchEvm: (provider: Provider, tokenHolderCon
|
|
|
2852
2852
|
gasPrice?: string | number;
|
|
2853
2853
|
}) => Promise<ContractTransaction>;
|
|
2854
2854
|
|
|
2855
|
+
declare function getNodeWalletPDA(operatorPublicKey: PublicKey, mintPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2856
|
+
declare function getTradingPoolPDA(poolOwnerPublicKey: PublicKey, tokenPublicKey: PublicKey, programId: PublicKey): PublicKey;
|
|
2857
|
+
declare function depositFunds(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2858
|
+
nodeWallet: PublicKey;
|
|
2859
|
+
mint?: string;
|
|
2860
|
+
funder: PublicKey;
|
|
2861
|
+
amount: number;
|
|
2862
|
+
}): Promise<VersionedTransaction>;
|
|
2863
|
+
declare function withdrawFundsV1(lavarageProgram: Program<Lavarage$1>, params: {
|
|
2864
|
+
nodeWallet: PublicKey;
|
|
2865
|
+
funder: PublicKey;
|
|
2866
|
+
amount: number;
|
|
2867
|
+
}): Promise<VersionedTransaction>;
|
|
2868
|
+
declare function withdrawFundsV2(lavarageProgram: Program<Lavarage>, params: {
|
|
2869
|
+
nodeWallet: PublicKey;
|
|
2870
|
+
funder: PublicKey;
|
|
2871
|
+
mint: string;
|
|
2872
|
+
amount: number;
|
|
2873
|
+
fromTokenAccount?: PublicKey;
|
|
2874
|
+
toTokenAccount?: PublicKey;
|
|
2875
|
+
}): Promise<VersionedTransaction>;
|
|
2876
|
+
declare function withdrawFunds(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2877
|
+
nodeWallet: PublicKey;
|
|
2878
|
+
funder: PublicKey;
|
|
2879
|
+
amount: number;
|
|
2880
|
+
mint?: string;
|
|
2881
|
+
fromTokenAccount?: PublicKey;
|
|
2882
|
+
toTokenAccount?: PublicKey;
|
|
2883
|
+
}): Promise<VersionedTransaction>;
|
|
2884
|
+
declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2885
|
+
tradingPool: PublicKey;
|
|
2886
|
+
poolOwner: PublicKey;
|
|
2887
|
+
nodeWallet: string;
|
|
2888
|
+
mint?: string;
|
|
2889
|
+
interestRate: number;
|
|
2890
|
+
maxExposure: number;
|
|
2891
|
+
}): Promise<VersionedTransaction>;
|
|
2892
|
+
declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2893
|
+
tradingPool: PublicKey;
|
|
2894
|
+
nodeWallet: string;
|
|
2895
|
+
poolOwner: PublicKey;
|
|
2896
|
+
maxExposure: number;
|
|
2897
|
+
}): Promise<VersionedTransaction>;
|
|
2898
|
+
declare function updateInterestRate(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2899
|
+
tradingPool: PublicKey;
|
|
2900
|
+
nodeWallet: string;
|
|
2901
|
+
poolOwner: PublicKey;
|
|
2902
|
+
interestRate: number;
|
|
2903
|
+
}): Promise<VersionedTransaction>;
|
|
2904
|
+
declare function updateOffer(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
2905
|
+
tradingPool: PublicKey;
|
|
2906
|
+
poolOwner: PublicKey;
|
|
2907
|
+
nodeWallet: string;
|
|
2908
|
+
mint: string;
|
|
2909
|
+
interestRate: number;
|
|
2910
|
+
maxExposure: number;
|
|
2911
|
+
}): Promise<VersionedTransaction>;
|
|
2912
|
+
|
|
2913
|
+
declare const lending_createOffer: typeof createOffer;
|
|
2914
|
+
declare const lending_depositFunds: typeof depositFunds;
|
|
2915
|
+
declare const lending_getNodeWalletPDA: typeof getNodeWalletPDA;
|
|
2916
|
+
declare const lending_getTradingPoolPDA: typeof getTradingPoolPDA;
|
|
2917
|
+
declare const lending_updateInterestRate: typeof updateInterestRate;
|
|
2918
|
+
declare const lending_updateMaxExposure: typeof updateMaxExposure;
|
|
2919
|
+
declare const lending_updateOffer: typeof updateOffer;
|
|
2920
|
+
declare const lending_withdrawFunds: typeof withdrawFunds;
|
|
2921
|
+
declare const lending_withdrawFundsV1: typeof withdrawFundsV1;
|
|
2922
|
+
declare const lending_withdrawFundsV2: typeof withdrawFundsV2;
|
|
2923
|
+
declare namespace lending {
|
|
2924
|
+
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 };
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2855
2927
|
declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
|
|
2856
2928
|
declare function getPositionAccountPDA(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, offer: ProgramAccount, seed: PublicKey): PublicKey;
|
|
2857
2929
|
|
|
@@ -3053,4 +3125,4 @@ declare const mergePositionV2: (lavarageProgram: Program<Lavarage>, position1: P
|
|
|
3053
3125
|
collateralType: PublicKey;
|
|
3054
3126
|
}>, quoteToken: PublicKey) => Promise<VersionedTransaction>;
|
|
3055
3127
|
|
|
3056
|
-
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, updateMaxLendPerTokenBatchEvm };
|
|
3128
|
+
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, updateMaxLendPerTokenBatchEvm };
|