@lavarage/sdk 6.8.0 → 6.8.2
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/abi/borrowerOperations.ts +1 -248
- package/dist/index.d.mts +18 -74
- package/dist/index.d.ts +18 -74
- package/dist/index.js +1480 -1975
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1458 -1965
- package/dist/index.mjs.map +1 -1
- package/evm.ts +43 -0
- package/index.ts +2 -3
- package/package.json +1 -1
- package/playground.ts +28 -0
- package/interfaces/sol.ts +0 -9
- package/lending.ts +0 -456
|
@@ -1,248 +1 @@
|
|
|
1
|
-
export const borrowerOperationsAbi = [
|
|
2
|
-
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
3
|
-
{ inputs: [], name: "NotInitializing", type: "error" },
|
|
4
|
-
{ inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" },
|
|
5
|
-
{
|
|
6
|
-
anonymous: false,
|
|
7
|
-
inputs: [
|
|
8
|
-
{
|
|
9
|
-
indexed: true,
|
|
10
|
-
internalType: "address",
|
|
11
|
-
name: "buyer",
|
|
12
|
-
type: "address",
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
indexed: true,
|
|
16
|
-
internalType: "address",
|
|
17
|
-
name: "tokenCollateral",
|
|
18
|
-
type: "address",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
indexed: true,
|
|
22
|
-
internalType: "uint256",
|
|
23
|
-
name: "loanId",
|
|
24
|
-
type: "uint256",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
indexed: false,
|
|
28
|
-
internalType: "uint256",
|
|
29
|
-
name: "openingPositionSize",
|
|
30
|
-
type: "uint256",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
indexed: false,
|
|
34
|
-
internalType: "uint256",
|
|
35
|
-
name: "collateralAmount",
|
|
36
|
-
type: "uint256",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
indexed: false,
|
|
40
|
-
internalType: "uint256",
|
|
41
|
-
name: "initialMargin",
|
|
42
|
-
type: "uint256",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
name: "Buy",
|
|
46
|
-
type: "event",
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
anonymous: false,
|
|
50
|
-
inputs: [
|
|
51
|
-
{
|
|
52
|
-
indexed: false,
|
|
53
|
-
internalType: "uint64",
|
|
54
|
-
name: "version",
|
|
55
|
-
type: "uint64",
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
name: "Initialized",
|
|
59
|
-
type: "event",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
anonymous: false,
|
|
63
|
-
inputs: [
|
|
64
|
-
{
|
|
65
|
-
indexed: true,
|
|
66
|
-
internalType: "address",
|
|
67
|
-
name: "borrower",
|
|
68
|
-
type: "address",
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
indexed: true,
|
|
72
|
-
internalType: "address",
|
|
73
|
-
name: "tokenCollateral",
|
|
74
|
-
type: "address",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
indexed: true,
|
|
78
|
-
internalType: "uint256",
|
|
79
|
-
name: "loanId",
|
|
80
|
-
type: "uint256",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
indexed: false,
|
|
84
|
-
internalType: "uint256",
|
|
85
|
-
name: "closingPositionSize",
|
|
86
|
-
type: "uint256",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
indexed: false,
|
|
90
|
-
internalType: "uint256",
|
|
91
|
-
name: "liquidatorRepaidAmount",
|
|
92
|
-
type: "uint256",
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
name: "Liquidation",
|
|
96
|
-
type: "event",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
anonymous: false,
|
|
100
|
-
inputs: [
|
|
101
|
-
{
|
|
102
|
-
indexed: true,
|
|
103
|
-
internalType: "address",
|
|
104
|
-
name: "buyer",
|
|
105
|
-
type: "address",
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
indexed: true,
|
|
109
|
-
internalType: "address",
|
|
110
|
-
name: "tokenCollateral",
|
|
111
|
-
type: "address",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
indexed: true,
|
|
115
|
-
internalType: "uint256",
|
|
116
|
-
name: "loanId",
|
|
117
|
-
type: "uint256",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
indexed: false,
|
|
121
|
-
internalType: "uint256",
|
|
122
|
-
name: "closingPositionSize",
|
|
123
|
-
type: "uint256",
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
indexed: false,
|
|
127
|
-
internalType: "uint256",
|
|
128
|
-
name: "profit",
|
|
129
|
-
type: "uint256",
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
name: "Sell",
|
|
133
|
-
type: "event",
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
inputs: [],
|
|
137
|
-
name: "admin",
|
|
138
|
-
outputs: [{ internalType: "address", name: "", type: "address" }],
|
|
139
|
-
stateMutability: "view",
|
|
140
|
-
type: "function",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
inputs: [
|
|
144
|
-
{ internalType: "bytes", name: "buyingCode", type: "bytes" },
|
|
145
|
-
{
|
|
146
|
-
internalType: "contract IERC20",
|
|
147
|
-
name: "tokenCollateral",
|
|
148
|
-
type: "address",
|
|
149
|
-
},
|
|
150
|
-
{ internalType: "uint256", name: "borrowAmount", type: "uint256" },
|
|
151
|
-
{
|
|
152
|
-
internalType: "contract TokenHolder",
|
|
153
|
-
name: "tokenHolder",
|
|
154
|
-
type: "address",
|
|
155
|
-
},
|
|
156
|
-
{ internalType: "address", name: "inchRouter", type: "address" },
|
|
157
|
-
{
|
|
158
|
-
internalType: "address",
|
|
159
|
-
name: "integratorFeeAddress",
|
|
160
|
-
type: "address",
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
name: "buy",
|
|
164
|
-
outputs: [],
|
|
165
|
-
stateMutability: "payable",
|
|
166
|
-
type: "function",
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
inputs: [
|
|
170
|
-
{ internalType: "contract IERC20", name: "_weth", type: "address" },
|
|
171
|
-
],
|
|
172
|
-
name: "initialize",
|
|
173
|
-
outputs: [],
|
|
174
|
-
stateMutability: "nonpayable",
|
|
175
|
-
type: "function",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
inputs: [
|
|
179
|
-
{ internalType: "uint256", name: "loanId", type: "uint256" },
|
|
180
|
-
{
|
|
181
|
-
internalType: "contract TokenHolder",
|
|
182
|
-
name: "tokenHolder",
|
|
183
|
-
type: "address",
|
|
184
|
-
},
|
|
185
|
-
{ internalType: "uint256", name: "closingPositionSize", type: "uint256" },
|
|
186
|
-
],
|
|
187
|
-
name: "liquidate",
|
|
188
|
-
outputs: [],
|
|
189
|
-
stateMutability: "nonpayable",
|
|
190
|
-
type: "function",
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
inputs: [],
|
|
194
|
-
name: "openingFee",
|
|
195
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
196
|
-
stateMutability: "view",
|
|
197
|
-
type: "function",
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
inputs: [],
|
|
201
|
-
name: "profitFee",
|
|
202
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
203
|
-
stateMutability: "view",
|
|
204
|
-
type: "function",
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
inputs: [
|
|
208
|
-
{ internalType: "uint256", name: "loanId", type: "uint256" },
|
|
209
|
-
{ internalType: "bytes", name: "sellingCode", type: "bytes" },
|
|
210
|
-
{
|
|
211
|
-
internalType: "contract TokenHolder",
|
|
212
|
-
name: "tokenHolder",
|
|
213
|
-
type: "address",
|
|
214
|
-
},
|
|
215
|
-
{ internalType: "address", name: "inchRouter", type: "address" },
|
|
216
|
-
{
|
|
217
|
-
internalType: "address",
|
|
218
|
-
name: "integratorFeeAddress",
|
|
219
|
-
type: "address",
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
name: "sell",
|
|
223
|
-
outputs: [],
|
|
224
|
-
stateMutability: "payable",
|
|
225
|
-
type: "function",
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
inputs: [{ internalType: "address", name: "_admin", type: "address" }],
|
|
229
|
-
name: "setAdmin",
|
|
230
|
-
outputs: [],
|
|
231
|
-
stateMutability: "nonpayable",
|
|
232
|
-
type: "function",
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
inputs: [{ internalType: "uint256", name: "_openingFee", type: "uint256" }],
|
|
236
|
-
name: "setOpeningFee",
|
|
237
|
-
outputs: [],
|
|
238
|
-
stateMutability: "nonpayable",
|
|
239
|
-
type: "function",
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
inputs: [{ internalType: "uint256", name: "_profitFee", type: "uint256" }],
|
|
243
|
-
name: "setProfitFee",
|
|
244
|
-
outputs: [],
|
|
245
|
-
stateMutability: "nonpayable",
|
|
246
|
-
type: "function",
|
|
247
|
-
},
|
|
248
|
-
];
|
|
1
|
+
export const borrowerOperationsAbi = [{"type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"buy","inputs":[{"name":"buyingCode","type":"bytes","internalType":"bytes"},{"name":"tokenCollateral","type":"address","internalType":"contract IERC20"},{"name":"borrowAmount","type":"uint256","internalType":"uint256"},{"name":"tokenHolder","type":"address","internalType":"contract TokenHolder"},{"name":"inchRouter","type":"address","internalType":"address"},{"name":"integratorFeeAddress","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"initialize","inputs":[{"name":"_weth","type":"address","internalType":"contract IERC20"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"liquidate","inputs":[{"name":"loanId","type":"uint256","internalType":"uint256"},{"name":"tokenHolder","type":"address","internalType":"contract TokenHolder"},{"name":"closingPositionSize","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"loanRecords","inputs":[{"name":"","type":"address","internalType":"address"},{"name":"","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"id","type":"uint256","internalType":"uint256"},{"name":"tokenHolder","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"openingFee","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"profitFee","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"sell","inputs":[{"name":"loanId","type":"uint256","internalType":"uint256"},{"name":"sellingCode","type":"bytes","internalType":"bytes"},{"name":"tokenHolder","type":"address","internalType":"contract TokenHolder"},{"name":"inchRouter","type":"address","internalType":"address"},{"name":"integratorFeeAddress","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"setAdmin","inputs":[{"name":"_admin","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setOpeningFee","inputs":[{"name":"_openingFee","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"setProfitFee","inputs":[{"name":"_profitFee","type":"uint256","internalType":"uint256"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"Buy","inputs":[{"name":"buyer","type":"address","indexed":true,"internalType":"address"},{"name":"tokenHolder","type":"address","indexed":true,"internalType":"address"},{"name":"tokenCollateral","type":"address","indexed":true,"internalType":"address"},{"name":"loanId","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"openingPositionSize","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"collateralAmount","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"initialMargin","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint64","indexed":false,"internalType":"uint64"}],"anonymous":false},{"type":"event","name":"Liquidation","inputs":[{"name":"borrower","type":"address","indexed":true,"internalType":"address"},{"name":"tokenHolder","type":"address","indexed":true,"internalType":"address"},{"name":"tokenCollateral","type":"address","indexed":true,"internalType":"address"},{"name":"loanId","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"closingPositionSize","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"liquidatorRepaidAmount","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"Sell","inputs":[{"name":"buyer","type":"address","indexed":true,"internalType":"address"},{"name":"tokenHolder","type":"address","indexed":true,"internalType":"address"},{"name":"tokenCollateral","type":"address","indexed":true,"internalType":"address"},{"name":"loanId","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"closingPositionSize","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"profit","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"error","name":"InvalidInitialization","inputs":[]},{"type":"error","name":"NotInitializing","inputs":[]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]}]
|
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, Keypair, VersionedTransaction } from '@solana/web3.js';
|
|
3
3
|
import { Provider, BigNumberish, ContractTransaction } from 'ethers';
|
|
4
4
|
|
|
5
5
|
type Lavarage$1 = {
|
|
@@ -2835,78 +2835,22 @@ declare function getCollateralExposureEvm(provider: Provider, tokenHolderContrac
|
|
|
2835
2835
|
* @returns Available exposure as a BigNumber
|
|
2836
2836
|
*/
|
|
2837
2837
|
declare function getAvailableExposureEvm(provider: Provider, tokenHolderContractAddress: string, collateralAddress: string): Promise<bigint>;
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
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
|
-
}
|
|
2838
|
+
/**
|
|
2839
|
+
* Update max lend per token for multiple collaterals in batch
|
|
2840
|
+
* @param provider - Ethers provider
|
|
2841
|
+
* @param tokenHolderContractAddress - Address of the TokenHolder contract
|
|
2842
|
+
* @param collateralAddresses - Array of collateral token addresses
|
|
2843
|
+
* @param newMaxLendPerTokens - Array of new max lend per token values
|
|
2844
|
+
* @param gasLimit - Optional gas limit
|
|
2845
|
+
* @param gasPrice - Optional gas price
|
|
2846
|
+
* @returns Unsigned transaction object
|
|
2847
|
+
*/
|
|
2848
|
+
declare const updateMaxLendPerTokenBatchEvm: (provider: Provider, tokenHolderContractAddress: string, { collateralAddresses, newMaxLendPerTokens, gasLimit, gasPrice, }: {
|
|
2849
|
+
collateralAddresses: string[];
|
|
2850
|
+
newMaxLendPerTokens: BigNumberish[];
|
|
2851
|
+
gasLimit?: string | number;
|
|
2852
|
+
gasPrice?: string | number;
|
|
2853
|
+
}) => Promise<ContractTransaction>;
|
|
2910
2854
|
|
|
2911
2855
|
declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
|
|
2912
2856
|
declare function getPositionAccountPDA(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, offer: ProgramAccount, seed: PublicKey): PublicKey;
|
|
@@ -3109,4 +3053,4 @@ declare const mergePositionV2: (lavarageProgram: Program<Lavarage>, position1: P
|
|
|
3109
3053
|
collateralType: PublicKey;
|
|
3110
3054
|
}>, quoteToken: PublicKey) => Promise<VersionedTransaction>;
|
|
3111
3055
|
|
|
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,
|
|
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 };
|
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, Keypair, VersionedTransaction } from '@solana/web3.js';
|
|
3
3
|
import { Provider, BigNumberish, ContractTransaction } from 'ethers';
|
|
4
4
|
|
|
5
5
|
type Lavarage$1 = {
|
|
@@ -2835,78 +2835,22 @@ declare function getCollateralExposureEvm(provider: Provider, tokenHolderContrac
|
|
|
2835
2835
|
* @returns Available exposure as a BigNumber
|
|
2836
2836
|
*/
|
|
2837
2837
|
declare function getAvailableExposureEvm(provider: Provider, tokenHolderContractAddress: string, collateralAddress: string): Promise<bigint>;
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
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
|
-
}
|
|
2838
|
+
/**
|
|
2839
|
+
* Update max lend per token for multiple collaterals in batch
|
|
2840
|
+
* @param provider - Ethers provider
|
|
2841
|
+
* @param tokenHolderContractAddress - Address of the TokenHolder contract
|
|
2842
|
+
* @param collateralAddresses - Array of collateral token addresses
|
|
2843
|
+
* @param newMaxLendPerTokens - Array of new max lend per token values
|
|
2844
|
+
* @param gasLimit - Optional gas limit
|
|
2845
|
+
* @param gasPrice - Optional gas price
|
|
2846
|
+
* @returns Unsigned transaction object
|
|
2847
|
+
*/
|
|
2848
|
+
declare const updateMaxLendPerTokenBatchEvm: (provider: Provider, tokenHolderContractAddress: string, { collateralAddresses, newMaxLendPerTokens, gasLimit, gasPrice, }: {
|
|
2849
|
+
collateralAddresses: string[];
|
|
2850
|
+
newMaxLendPerTokens: BigNumberish[];
|
|
2851
|
+
gasLimit?: string | number;
|
|
2852
|
+
gasPrice?: string | number;
|
|
2853
|
+
}) => Promise<ContractTransaction>;
|
|
2910
2854
|
|
|
2911
2855
|
declare function getPda(seed: Buffer | Buffer[], programId: PublicKey): PublicKey;
|
|
2912
2856
|
declare function getPositionAccountPDA(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, offer: ProgramAccount, seed: PublicKey): PublicKey;
|
|
@@ -3109,4 +3053,4 @@ declare const mergePositionV2: (lavarageProgram: Program<Lavarage>, position1: P
|
|
|
3109
3053
|
collateralType: PublicKey;
|
|
3110
3054
|
}>, quoteToken: PublicKey) => Promise<VersionedTransaction>;
|
|
3111
3055
|
|
|
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,
|
|
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 };
|