@lavarage/sdk 7.5.7 → 7.5.8
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/.DS_Store +0 -0
- package/dist/index.d.mts +147 -1
- package/dist/index.d.ts +147 -1
- package/dist/index.js +287 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +287 -3
- package/dist/index.mjs.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +92 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/functions/borrowV1.html +1 -0
- package/docs/functions/borrowV2.html +1 -0
- package/docs/functions/closePositionEvm.html +9 -0
- package/docs/functions/closeTradeV1.html +17 -0
- package/docs/functions/closeTradeV2.html +18 -0
- package/docs/functions/createTpDelegate.html +17 -0
- package/docs/functions/getActiveLoanCountEvm.html +8 -0
- package/docs/functions/getActiveLoansBatchEvm.html +10 -0
- package/docs/functions/getAllPositions.html +17 -0
- package/docs/functions/getAvailableExposureEvm.html +9 -0
- package/docs/functions/getClosedPositions.html +7 -0
- package/docs/functions/getClosedPositionsEvm.html +9 -0
- package/docs/functions/getCollateralExposureEvm.html +9 -0
- package/docs/functions/getCollateralInfoEvm.html +9 -0
- package/docs/functions/getDelegateAccounts.html +13 -0
- package/docs/functions/getLiquidatedPositions.html +13 -0
- package/docs/functions/getLiquidatedPositionsEvm.html +9 -0
- package/docs/functions/getLoanEvm.html +9 -0
- package/docs/functions/getLoansByBorrowerEvm.html +9 -0
- package/docs/functions/getOffers.html +7 -0
- package/docs/functions/getOffersEvm.html +9 -0
- package/docs/functions/getOpenPositions.html +11 -0
- package/docs/functions/getOpeningFeeEvm.html +8 -0
- package/docs/functions/getPda.html +8 -0
- package/docs/functions/getPositionAccountPDA.html +9 -0
- package/docs/functions/getPositionsEvm.html +8 -0
- package/docs/functions/getProfitFeeEvm.html +8 -0
- package/docs/functions/getTokenBalanceEvm.html +8 -0
- package/docs/functions/getUserLoansEvm.html +9 -0
- package/docs/functions/lending.addToWithdrawalAccessList.html +1 -0
- package/docs/functions/lending.createOffer.html +15 -0
- package/docs/functions/lending.depositFunds.html +17 -0
- package/docs/functions/lending.getNodeWalletPDA.html +9 -0
- package/docs/functions/lending.getTradingPoolPDA.html +9 -0
- package/docs/functions/lending.getWithdrawalAccessList.html +1 -0
- package/docs/functions/lending.getWithdrawalAccessListPDA.html +1 -0
- package/docs/functions/lending.removeFromWithdrawalAccessList.html +1 -0
- package/docs/functions/lending.updateInterestRate.html +13 -0
- package/docs/functions/lending.updateMaxBorrow.html +13 -0
- package/docs/functions/lending.updateMaxExposure.html +13 -0
- package/docs/functions/lending.updateOffer.html +19 -0
- package/docs/functions/lending.withdrawFunds.html +20 -0
- package/docs/functions/lending.withdrawFundsV1.html +16 -0
- package/docs/functions/lending.withdrawFundsV2.html +19 -0
- package/docs/functions/liquidatePositionEvm.html +6 -0
- package/docs/functions/mergePositionV2.html +13 -0
- package/docs/functions/modifyTpDelegate.html +17 -0
- package/docs/functions/openPositionEvm.html +9 -0
- package/docs/functions/openTradeV1.html +26 -0
- package/docs/functions/openTradeV2.html +29 -0
- package/docs/functions/partialRepayV1.html +10 -0
- package/docs/functions/partialRepayV2.html +10 -0
- package/docs/functions/removeTpDelegate.html +13 -0
- package/docs/functions/splitPositionV2.html +13 -0
- package/docs/functions/updateMaxLendPerTokenBatchEvm.html +9 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +3 -0
- package/docs/modules/IDLV2.html +2 -0
- package/docs/modules/lending.html +1 -0
- package/docs/modules.html +4 -0
- package/docs/types/IDLV2.Lavarage.html +8 -0
- package/docs/types/Lavarage.html +8 -0
- package/docs/variables/IDL.html +1 -0
- package/docs/variables/IDLV2.IDL.html +1 -0
- package/idl/lavarage.ts +126 -0
- package/idl/lavaragev2.ts +166 -0
- package/index.ts +282 -112
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -2464,8 +2464,12 @@ export const closeTradeV2 = async (
|
|
|
2464
2464
|
computeBudgetMicroLamports?: number,
|
|
2465
2465
|
platformFeeRecipient?: PublicKey,
|
|
2466
2466
|
splitTransactions?: boolean,
|
|
2467
|
+
discountBps?: number,
|
|
2468
|
+
referralBps?: number,
|
|
2467
2469
|
) => {
|
|
2468
2470
|
let partnerFeeMarkupAsPkey;
|
|
2471
|
+
const referralVaultProgram = new Program<UserVault>(userVaultIDL, REFFERAL_VAULT_PROGRAM_ID, lavarageProgram.provider);
|
|
2472
|
+
|
|
2469
2473
|
if (partnerFeeMarkup) {
|
|
2470
2474
|
const feeBuffer = Buffer.alloc(8);
|
|
2471
2475
|
feeBuffer.writeBigUInt64LE(BigInt(partnerFeeMarkup));
|
|
@@ -2556,6 +2560,60 @@ export const closeTradeV2 = async (
|
|
|
2556
2560
|
const { blockhash } =
|
|
2557
2561
|
await lavarageProgram.provider.connection.getLatestBlockhash("finalized");
|
|
2558
2562
|
|
|
2563
|
+
const useReferral = discountBps !== undefined && referralBps !== undefined;
|
|
2564
|
+
|
|
2565
|
+
// Check if partner fee recipient vault and token account need to be created
|
|
2566
|
+
let partnerFeeRecipientVaultCreateIx: TransactionInstruction | undefined;
|
|
2567
|
+
let partnerFeeRecipientTokenAccountCreateIx: TransactionInstruction | undefined;
|
|
2568
|
+
let userVaultPda: PublicKey | undefined;
|
|
2569
|
+
|
|
2570
|
+
if (partnerFeeRecipient && partnerFeeMarkupAsPkey && referralVaultProgram) {
|
|
2571
|
+
// Derive the userVault PDA
|
|
2572
|
+
[userVaultPda] = PublicKey.findProgramAddressSync(
|
|
2573
|
+
[Buffer.from("user_vault"), new PublicKey(partnerFeeRecipient).toBuffer()],
|
|
2574
|
+
referralVaultProgram.programId
|
|
2575
|
+
);
|
|
2576
|
+
|
|
2577
|
+
// Get the vault's associated token account
|
|
2578
|
+
const vaultTokenAccount = getAssociatedTokenAddressSync(
|
|
2579
|
+
quoteToken,
|
|
2580
|
+
userVaultPda,
|
|
2581
|
+
true, // allowOwnerOffCurve for PDA
|
|
2582
|
+
quoteTokenProgram
|
|
2583
|
+
);
|
|
2584
|
+
|
|
2585
|
+
// Check both accounts at the same time
|
|
2586
|
+
const [vaultAccountInfo, vaultTokenAccountInfo] = await lavarageProgram.provider.connection.getMultipleAccountsInfo([
|
|
2587
|
+
userVaultPda,
|
|
2588
|
+
vaultTokenAccount
|
|
2589
|
+
]);
|
|
2590
|
+
|
|
2591
|
+
// Create vault if it doesn't exist
|
|
2592
|
+
if (!vaultAccountInfo) {
|
|
2593
|
+
partnerFeeRecipientVaultCreateIx = await referralVaultProgram.methods
|
|
2594
|
+
.initializeVault()
|
|
2595
|
+
.accountsStrict({
|
|
2596
|
+
userVault: userVaultPda,
|
|
2597
|
+
user: partnerFeeRecipient!,
|
|
2598
|
+
funder: lavarageProgram.provider.publicKey!,
|
|
2599
|
+
systemProgram: SystemProgram.programId,
|
|
2600
|
+
})
|
|
2601
|
+
.instruction();
|
|
2602
|
+
}
|
|
2603
|
+
|
|
2604
|
+
// Create token account if it doesn't exist
|
|
2605
|
+
if (!vaultTokenAccountInfo) {
|
|
2606
|
+
partnerFeeRecipientTokenAccountCreateIx = createAssociatedTokenAccountIdempotentInstruction(
|
|
2607
|
+
lavarageProgram.provider.publicKey!,
|
|
2608
|
+
vaultTokenAccount,
|
|
2609
|
+
userVaultPda,
|
|
2610
|
+
quoteToken,
|
|
2611
|
+
quoteTokenProgram,
|
|
2612
|
+
ASSOCIATED_TOKEN_PROGRAM_ID
|
|
2613
|
+
);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2559
2617
|
const closePositionIx = await lavarageProgram.methods
|
|
2560
2618
|
.tradingCloseBorrowCollateral()
|
|
2561
2619
|
.accountsStrict({
|
|
@@ -2576,119 +2634,227 @@ export const closeTradeV2 = async (
|
|
|
2576
2634
|
let repaySolIx: TransactionInstruction | null = null;
|
|
2577
2635
|
let jupiterIxs: TransactionInstruction[] = [];
|
|
2578
2636
|
if (jupInstruction.instructions == undefined) {
|
|
2579
|
-
repaySolIx =
|
|
2580
|
-
.
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2637
|
+
repaySolIx = useReferral
|
|
2638
|
+
? await lavarageProgram.methods
|
|
2639
|
+
.tradingCloseRepaySolWithReferral(
|
|
2640
|
+
new BN(jupInstruction.quoteResponse.outAmount),
|
|
2641
|
+
new BN(9997),
|
|
2642
|
+
new BN(discountBps),
|
|
2643
|
+
new BN(referralBps)
|
|
2644
|
+
)
|
|
2645
|
+
.accountsStrict({
|
|
2646
|
+
nodeWallet: pool.account.nodeWallet,
|
|
2647
|
+
positionAccount: positionAccountPDA,
|
|
2648
|
+
tradingPool: poolPubKey,
|
|
2649
|
+
trader: lavarageProgram.provider.publicKey!,
|
|
2650
|
+
systemProgram: SystemProgram.programId,
|
|
2651
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
2652
|
+
randomAccountAsId: position.account.seed,
|
|
2653
|
+
feeTokenAccount: getAssociatedTokenAddressSync(
|
|
2654
|
+
quoteToken,
|
|
2655
|
+
new PublicKey("6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF"),
|
|
2656
|
+
false,
|
|
2657
|
+
quoteTokenProgram
|
|
2658
|
+
),
|
|
2659
|
+
fromTokenAccount: getAssociatedTokenAddressSync(
|
|
2660
|
+
quoteToken,
|
|
2661
|
+
lavarageProgram.provider.publicKey!,
|
|
2662
|
+
false,
|
|
2663
|
+
quoteTokenProgram
|
|
2664
|
+
),
|
|
2665
|
+
tokenProgram: quoteTokenProgram!,
|
|
2666
|
+
toTokenAccount: getAssociatedTokenAddressSync(
|
|
2667
|
+
quoteToken,
|
|
2668
|
+
pool.account.nodeWallet,
|
|
2669
|
+
true,
|
|
2670
|
+
quoteTokenProgram
|
|
2671
|
+
),
|
|
2672
|
+
mint: quoteToken,
|
|
2673
|
+
})
|
|
2674
|
+
.remainingAccounts(
|
|
2675
|
+
partnerFeeRecipient && partnerFeeMarkupAsPkey && userVaultPda
|
|
2676
|
+
? [
|
|
2677
|
+
{
|
|
2678
|
+
pubkey: getAssociatedTokenAddressSync(
|
|
2679
|
+
quoteToken,
|
|
2680
|
+
userVaultPda,
|
|
2681
|
+
true, // allowOwnerOffCurve for PDA
|
|
2682
|
+
quoteTokenProgram
|
|
2683
|
+
),
|
|
2684
|
+
isSigner: false,
|
|
2685
|
+
isWritable: true,
|
|
2686
|
+
}
|
|
2687
|
+
]
|
|
2688
|
+
: []
|
|
2689
|
+
)
|
|
2690
|
+
.instruction()
|
|
2691
|
+
: await lavarageProgram.methods
|
|
2692
|
+
.tradingCloseRepaySol(
|
|
2693
|
+
new BN(jupInstruction.quoteResponse.outAmount),
|
|
2694
|
+
new BN(9997)
|
|
2695
|
+
)
|
|
2696
|
+
.accountsStrict({
|
|
2697
|
+
nodeWallet: pool.account.nodeWallet,
|
|
2698
|
+
positionAccount: positionAccountPDA,
|
|
2699
|
+
tradingPool: poolPubKey,
|
|
2700
|
+
trader: lavarageProgram.provider.publicKey!,
|
|
2701
|
+
systemProgram: SystemProgram.programId,
|
|
2702
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
2703
|
+
randomAccountAsId: position.account.seed,
|
|
2704
|
+
feeTokenAccount: getAssociatedTokenAddressSync(
|
|
2705
|
+
quoteToken,
|
|
2706
|
+
new PublicKey("6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF"),
|
|
2707
|
+
false,
|
|
2708
|
+
quoteTokenProgram
|
|
2709
|
+
),
|
|
2710
|
+
fromTokenAccount: getAssociatedTokenAddressSync(
|
|
2711
|
+
quoteToken,
|
|
2712
|
+
lavarageProgram.provider.publicKey!,
|
|
2713
|
+
false,
|
|
2714
|
+
quoteTokenProgram
|
|
2715
|
+
),
|
|
2716
|
+
tokenProgram: quoteTokenProgram!,
|
|
2717
|
+
toTokenAccount: getAssociatedTokenAddressSync(
|
|
2718
|
+
quoteToken,
|
|
2719
|
+
pool.account.nodeWallet,
|
|
2720
|
+
true,
|
|
2721
|
+
quoteTokenProgram
|
|
2722
|
+
),
|
|
2723
|
+
mint: quoteToken,
|
|
2724
|
+
})
|
|
2725
|
+
.remainingAccounts(
|
|
2726
|
+
partnerFeeRecipient && partnerFeeMarkupAsPkey
|
|
2727
|
+
? [
|
|
2728
|
+
{
|
|
2729
|
+
pubkey: getAssociatedTokenAddressSync(
|
|
2730
|
+
quoteToken,
|
|
2731
|
+
partnerFeeRecipient,
|
|
2732
|
+
false,
|
|
2733
|
+
quoteTokenProgram
|
|
2734
|
+
),
|
|
2735
|
+
isSigner: false,
|
|
2736
|
+
isWritable: true,
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
pubkey: partnerFeeMarkupAsPkey,
|
|
2740
|
+
isSigner: false,
|
|
2741
|
+
isWritable: false,
|
|
2742
|
+
},
|
|
2743
|
+
]
|
|
2744
|
+
: []
|
|
2745
|
+
)
|
|
2746
|
+
.instruction();
|
|
2635
2747
|
} else {
|
|
2636
|
-
repaySolIx =
|
|
2637
|
-
.
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2748
|
+
repaySolIx = useReferral
|
|
2749
|
+
? await lavarageProgram.methods
|
|
2750
|
+
.tradingCloseRepaySolWithReferral(
|
|
2751
|
+
new BN(jupInstruction.quoteResponse.outAmount),
|
|
2752
|
+
new BN(9998),
|
|
2753
|
+
new BN(discountBps),
|
|
2754
|
+
new BN(referralBps)
|
|
2755
|
+
)
|
|
2756
|
+
.accountsStrict({
|
|
2757
|
+
nodeWallet: pool.account.nodeWallet,
|
|
2758
|
+
positionAccount: positionAccountPDA,
|
|
2759
|
+
tradingPool: poolPubKey,
|
|
2760
|
+
trader: lavarageProgram.provider.publicKey!,
|
|
2761
|
+
systemProgram: SystemProgram.programId,
|
|
2762
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
2763
|
+
randomAccountAsId: position.account.seed,
|
|
2764
|
+
feeTokenAccount: getAssociatedTokenAddressSync(
|
|
2765
|
+
quoteToken,
|
|
2766
|
+
new PublicKey("6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF"),
|
|
2767
|
+
false,
|
|
2768
|
+
quoteTokenProgram
|
|
2769
|
+
),
|
|
2770
|
+
fromTokenAccount: getAssociatedTokenAddressSync(
|
|
2771
|
+
quoteToken,
|
|
2772
|
+
lavarageProgram.provider.publicKey!,
|
|
2773
|
+
false,
|
|
2774
|
+
quoteTokenProgram
|
|
2775
|
+
),
|
|
2776
|
+
tokenProgram: quoteTokenProgram!,
|
|
2777
|
+
toTokenAccount: getAssociatedTokenAddressSync(
|
|
2778
|
+
quoteToken,
|
|
2779
|
+
pool.account.nodeWallet,
|
|
2780
|
+
true,
|
|
2781
|
+
quoteTokenProgram
|
|
2782
|
+
),
|
|
2783
|
+
mint: quoteToken,
|
|
2784
|
+
})
|
|
2785
|
+
.remainingAccounts(
|
|
2786
|
+
partnerFeeRecipient && partnerFeeMarkupAsPkey && userVaultPda
|
|
2787
|
+
? [
|
|
2788
|
+
{
|
|
2789
|
+
pubkey: getAssociatedTokenAddressSync(
|
|
2790
|
+
quoteToken,
|
|
2791
|
+
userVaultPda,
|
|
2792
|
+
true, // allowOwnerOffCurve for PDA
|
|
2793
|
+
quoteTokenProgram
|
|
2794
|
+
),
|
|
2795
|
+
isSigner: false,
|
|
2796
|
+
isWritable: true,
|
|
2797
|
+
}
|
|
2798
|
+
]
|
|
2799
|
+
: []
|
|
2800
|
+
)
|
|
2801
|
+
.instruction()
|
|
2802
|
+
: await lavarageProgram.methods
|
|
2803
|
+
.tradingCloseRepaySol(
|
|
2804
|
+
new BN(jupInstruction.quoteResponse.outAmount),
|
|
2805
|
+
new BN(9998)
|
|
2806
|
+
)
|
|
2807
|
+
.accountsStrict({
|
|
2808
|
+
nodeWallet: pool.account.nodeWallet,
|
|
2809
|
+
positionAccount: positionAccountPDA,
|
|
2810
|
+
tradingPool: poolPubKey,
|
|
2811
|
+
trader: lavarageProgram.provider.publicKey!,
|
|
2812
|
+
systemProgram: SystemProgram.programId,
|
|
2813
|
+
clock: SYSVAR_CLOCK_PUBKEY,
|
|
2814
|
+
randomAccountAsId: position.account.seed,
|
|
2815
|
+
feeTokenAccount: getAssociatedTokenAddressSync(
|
|
2816
|
+
quoteToken,
|
|
2817
|
+
new PublicKey("6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF"),
|
|
2818
|
+
false,
|
|
2819
|
+
quoteTokenProgram
|
|
2820
|
+
),
|
|
2821
|
+
fromTokenAccount: getAssociatedTokenAddressSync(
|
|
2822
|
+
quoteToken,
|
|
2823
|
+
lavarageProgram.provider.publicKey!,
|
|
2824
|
+
false,
|
|
2825
|
+
quoteTokenProgram
|
|
2826
|
+
),
|
|
2827
|
+
tokenProgram: quoteTokenProgram!,
|
|
2828
|
+
toTokenAccount: getAssociatedTokenAddressSync(
|
|
2829
|
+
quoteToken,
|
|
2830
|
+
pool.account.nodeWallet,
|
|
2831
|
+
true,
|
|
2832
|
+
quoteTokenProgram
|
|
2833
|
+
),
|
|
2834
|
+
mint: quoteToken,
|
|
2835
|
+
})
|
|
2836
|
+
.remainingAccounts(
|
|
2837
|
+
partnerFeeRecipient && partnerFeeMarkupAsPkey
|
|
2838
|
+
? [
|
|
2839
|
+
{
|
|
2840
|
+
pubkey: getAssociatedTokenAddressSync(
|
|
2841
|
+
quoteToken,
|
|
2842
|
+
partnerFeeRecipient,
|
|
2843
|
+
false,
|
|
2844
|
+
quoteTokenProgram
|
|
2845
|
+
),
|
|
2846
|
+
isSigner: false,
|
|
2847
|
+
isWritable: true,
|
|
2848
|
+
},
|
|
2849
|
+
{
|
|
2850
|
+
pubkey: partnerFeeMarkupAsPkey,
|
|
2851
|
+
isSigner: false,
|
|
2852
|
+
isWritable: false,
|
|
2853
|
+
},
|
|
2854
|
+
]
|
|
2855
|
+
: []
|
|
2856
|
+
)
|
|
2857
|
+
.instruction();
|
|
2692
2858
|
const {
|
|
2693
2859
|
setupInstructions,
|
|
2694
2860
|
swapInstruction: swapInstructionPayload,
|
|
@@ -2729,6 +2895,8 @@ export const closeTradeV2 = async (
|
|
|
2729
2895
|
|
|
2730
2896
|
if (splitTransactions) {
|
|
2731
2897
|
const setUpInstructions = [
|
|
2898
|
+
partnerFeeRecipientVaultCreateIx,
|
|
2899
|
+
partnerFeeRecipientTokenAccountCreateIx,
|
|
2732
2900
|
jupInstruction.instructions && platformFeeRecipientAccount?.instruction ? platformFeeRecipientAccount.instruction : null,
|
|
2733
2901
|
createAssociatedTokenAccountInstruction,
|
|
2734
2902
|
].filter((i) => !!i);
|
|
@@ -2765,6 +2933,8 @@ export const closeTradeV2 = async (
|
|
|
2765
2933
|
}
|
|
2766
2934
|
|
|
2767
2935
|
const allInstructions = [
|
|
2936
|
+
partnerFeeRecipientVaultCreateIx,
|
|
2937
|
+
partnerFeeRecipientTokenAccountCreateIx,
|
|
2768
2938
|
jupInstruction.instructions && platformFeeRecipientAccount?.instruction ? platformFeeRecipientAccount.instruction : null,
|
|
2769
2939
|
createAssociatedTokenAccountInstruction,
|
|
2770
2940
|
jupInstruction.instructions?.tokenLedgerInstruction
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lavarage/sdk",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.8",
|
|
4
4
|
"description": "Lavarage SDK",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"tsup": "^8.2.4",
|
|
29
|
-
"typedoc": "^0.28.
|
|
29
|
+
"typedoc": "^0.28.15"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|