@lavarage/sdk 7.1.0 → 7.1.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/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/idl/lavarage.ts +8 -2
- package/lending.ts +12 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -48,7 +48,7 @@ type Lavarage$1 = {
|
|
|
48
48
|
{
|
|
49
49
|
"name": "nodeWallet";
|
|
50
50
|
"isMut": true;
|
|
51
|
-
"isSigner":
|
|
51
|
+
"isSigner": false;
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"name": "operator";
|
|
@@ -1269,6 +1269,9 @@ type Lavarage$1 = {
|
|
|
1269
1269
|
},
|
|
1270
1270
|
{
|
|
1271
1271
|
"name": "UnauthorizedWithdrawal";
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"name": "AccountAlreadyInitialized";
|
|
1272
1275
|
}
|
|
1273
1276
|
];
|
|
1274
1277
|
};
|
|
@@ -3345,6 +3348,7 @@ declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lava
|
|
|
3345
3348
|
interestRate: number;
|
|
3346
3349
|
maxExposure: number;
|
|
3347
3350
|
computeBudgetMicroLamports?: number;
|
|
3351
|
+
maxBorrow?: number;
|
|
3348
3352
|
}): Promise<VersionedTransaction>;
|
|
3349
3353
|
declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
3350
3354
|
tradingPool: PublicKey;
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ type Lavarage$1 = {
|
|
|
48
48
|
{
|
|
49
49
|
"name": "nodeWallet";
|
|
50
50
|
"isMut": true;
|
|
51
|
-
"isSigner":
|
|
51
|
+
"isSigner": false;
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"name": "operator";
|
|
@@ -1269,6 +1269,9 @@ type Lavarage$1 = {
|
|
|
1269
1269
|
},
|
|
1270
1270
|
{
|
|
1271
1271
|
"name": "UnauthorizedWithdrawal";
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"name": "AccountAlreadyInitialized";
|
|
1272
1275
|
}
|
|
1273
1276
|
];
|
|
1274
1277
|
};
|
|
@@ -3345,6 +3348,7 @@ declare function createOffer(lavarageProgram: Program<Lavarage$1> | Program<Lava
|
|
|
3345
3348
|
interestRate: number;
|
|
3346
3349
|
maxExposure: number;
|
|
3347
3350
|
computeBudgetMicroLamports?: number;
|
|
3351
|
+
maxBorrow?: number;
|
|
3348
3352
|
}): Promise<VersionedTransaction>;
|
|
3349
3353
|
declare function updateMaxExposure(lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, params: {
|
|
3350
3354
|
tradingPool: PublicKey;
|
package/dist/index.js
CHANGED
|
@@ -1338,7 +1338,7 @@ function withdrawFunds(lavarageProgram, params) {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
function createOffer(lavarageProgram, params) {
|
|
1340
1340
|
return __async(this, null, function* () {
|
|
1341
|
-
var _a;
|
|
1341
|
+
var _a, _b;
|
|
1342
1342
|
let nodeWalletAccount, nodeWalletSigner, createNodeWalletInstruction = [], nodeWalletPubKey;
|
|
1343
1343
|
if (params.quoteMint === "So11111111111111111111111111111111111111112") {
|
|
1344
1344
|
const nodeWallets = yield lavarageProgram.account.nodeWallet.all();
|
|
@@ -1400,6 +1400,12 @@ function createOffer(lavarageProgram, params) {
|
|
|
1400
1400
|
toPubkey: new import_web3.PublicKey("BMME51pfWdBfakTEMuQbNP4NG3wCY4Fo47dKatThhXGQ"),
|
|
1401
1401
|
lamports: 0.3 * import_web3.LAMPORTS_PER_SOL
|
|
1402
1402
|
});
|
|
1403
|
+
const updateMaxBorrowInstruction = yield lavarageProgram.methods.lpOperatorUpdateMaxBorrow(new import_anchor.BN((_b = params.maxBorrow) != null ? _b : 0)).accountsStrict({
|
|
1404
|
+
tradingPool: params.tradingPool,
|
|
1405
|
+
nodeWallet: nodeWalletPubKey,
|
|
1406
|
+
operator: params.poolOwner,
|
|
1407
|
+
systemProgram: import_web3.SystemProgram.programId
|
|
1408
|
+
}).instruction();
|
|
1403
1409
|
const messageV0 = new import_web3.TransactionMessage({
|
|
1404
1410
|
payerKey: lavarageProgram.provider.publicKey,
|
|
1405
1411
|
recentBlockhash: blockhash,
|
|
@@ -1408,6 +1414,7 @@ function createOffer(lavarageProgram, params) {
|
|
|
1408
1414
|
instruction,
|
|
1409
1415
|
updateMaxExposureInstruction,
|
|
1410
1416
|
transferInstruction,
|
|
1417
|
+
params.maxBorrow ? updateMaxBorrowInstruction : void 0,
|
|
1411
1418
|
computeFeeIx
|
|
1412
1419
|
].filter(Boolean)
|
|
1413
1420
|
}).compileToV0Message();
|
|
@@ -1607,7 +1614,7 @@ var IDL = {
|
|
|
1607
1614
|
{
|
|
1608
1615
|
"name": "nodeWallet",
|
|
1609
1616
|
"isMut": true,
|
|
1610
|
-
"isSigner":
|
|
1617
|
+
"isSigner": false
|
|
1611
1618
|
},
|
|
1612
1619
|
{
|
|
1613
1620
|
"name": "operator",
|
|
@@ -2828,6 +2835,9 @@ var IDL = {
|
|
|
2828
2835
|
},
|
|
2829
2836
|
{
|
|
2830
2837
|
"name": "UnauthorizedWithdrawal"
|
|
2838
|
+
},
|
|
2839
|
+
{
|
|
2840
|
+
"name": "AccountAlreadyInitialized"
|
|
2831
2841
|
}
|
|
2832
2842
|
]
|
|
2833
2843
|
}
|