@lavarage/sdk 6.1.3 → 6.1.9
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.js +7 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -31
- package/dist/index.mjs.map +1 -1
- package/index.ts +37 -31
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -200,11 +200,12 @@ export const openTradeV1 = async (lavarageProgram: Program<Lavarage>, offer: Pro
|
|
|
200
200
|
clock: SYSVAR_CLOCK_PUBKEY,
|
|
201
201
|
randomAccountAsId: randomSeed.publicKey.toBase58(),
|
|
202
202
|
feeReceipient: '6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF',
|
|
203
|
-
})
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
})
|
|
204
|
+
// .remainingAccounts(partnerFeeRecipient ? [{
|
|
205
|
+
// pubkey: partnerFeeRecipient,
|
|
206
|
+
// isSigner: false,
|
|
207
|
+
// isWritable: true,
|
|
208
|
+
// }] : [])
|
|
208
209
|
.instruction()
|
|
209
210
|
|
|
210
211
|
const openAddCollateralInstruction = await lavarageProgram.methods
|
|
@@ -333,11 +334,12 @@ export const openTradeV2 = async (lavarageProgram: Program<LavarageV2>, offer: P
|
|
|
333
334
|
toTokenAccount: getAssociatedTokenAddressSync(quoteToken, lavarageProgram.provider.publicKey!, true, quoteTokenProgram),
|
|
334
335
|
tokenProgram: tokenProgram!,
|
|
335
336
|
fromTokenAccount: getAssociatedTokenAddressSync(quoteToken, offer.account.nodeWallet, true, tokenProgram),
|
|
336
|
-
})
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
337
|
+
})
|
|
338
|
+
// .remainingAccounts(partnerFeeRecipient ? [{
|
|
339
|
+
// pubkey: partnerFeeRecipient,
|
|
340
|
+
// isSigner: false,
|
|
341
|
+
// isWritable: true,
|
|
342
|
+
// }] : [])
|
|
341
343
|
.instruction()
|
|
342
344
|
|
|
343
345
|
const openAddCollateralInstruction = await lavarageProgram.methods
|
|
@@ -533,7 +535,7 @@ export const partialRepayV2 = async (lavarageProgram: Program<LavarageV2>, posit
|
|
|
533
535
|
clock: SYSVAR_CLOCK_PUBKEY,
|
|
534
536
|
randomAccountAsId: position.account.seed,
|
|
535
537
|
fromTokenAccount: getAssociatedTokenAddressSync(pool.qtType, lavarageProgram.provider.publicKey!),
|
|
536
|
-
toTokenAccount: getAssociatedTokenAddressSync(pool.qtType, pool.nodeWallet),
|
|
538
|
+
toTokenAccount: getAssociatedTokenAddressSync(pool.qtType, pool.nodeWallet, true),
|
|
537
539
|
mint: pool.qtType,
|
|
538
540
|
feeTokenAccount: getAssociatedTokenAddressSync(pool.qtType, new PublicKey('6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF')),
|
|
539
541
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
@@ -658,11 +660,12 @@ export const closeTradeV1 = async (lavarageProgram: Program<Lavarage>, position:
|
|
|
658
660
|
clock: SYSVAR_CLOCK_PUBKEY,
|
|
659
661
|
randomAccountAsId: position.account.seed,
|
|
660
662
|
feeReceipient: '6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF',
|
|
661
|
-
})
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
})
|
|
664
|
+
// .remainingAccounts(partnerFeeRecipient ? [{
|
|
665
|
+
// pubkey: partnerFeeRecipient,
|
|
666
|
+
// isSigner: false,
|
|
667
|
+
// isWritable: true,
|
|
668
|
+
// }] : [])
|
|
666
669
|
.instruction()
|
|
667
670
|
} else {
|
|
668
671
|
repaySolIx = await lavarageProgram.methods
|
|
@@ -676,11 +679,12 @@ export const closeTradeV1 = async (lavarageProgram: Program<Lavarage>, position:
|
|
|
676
679
|
clock: SYSVAR_CLOCK_PUBKEY,
|
|
677
680
|
randomAccountAsId: position.account.seed,
|
|
678
681
|
feeReceipient: '6JfTobDvwuwZxZP6FR5JPmjdvQ4h4MovkEVH2FPsMSrF',
|
|
679
|
-
})
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
})
|
|
683
|
+
// .remainingAccounts(partnerFeeRecipient ? [{
|
|
684
|
+
// pubkey: partnerFeeRecipient,
|
|
685
|
+
// isSigner: false,
|
|
686
|
+
// isWritable: true,
|
|
687
|
+
// }] : [])
|
|
684
688
|
.instruction()
|
|
685
689
|
const { setupInstructions, swapInstruction: swapInstructionPayload, cleanupInstruction, addressLookupTableAddresses } = jupiterSellIx!
|
|
686
690
|
jupiterIxs = [
|
|
@@ -824,11 +828,12 @@ export const closeTradeV2 = async (lavarageProgram: Program<LavarageV2>, positio
|
|
|
824
828
|
tokenProgram: quoteTokenProgram!,
|
|
825
829
|
toTokenAccount: getAssociatedTokenAddressSync(quoteToken, pool.account.nodeWallet, true, quoteTokenProgram),
|
|
826
830
|
mint: quoteToken,
|
|
827
|
-
})
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
831
|
+
})
|
|
832
|
+
// .remainingAccounts(partnerFeeRecipient ? [{
|
|
833
|
+
// pubkey: partnerFeeRecipient,
|
|
834
|
+
// isSigner: false,
|
|
835
|
+
// isWritable: true,
|
|
836
|
+
// }] : [])
|
|
832
837
|
.instruction()
|
|
833
838
|
} else {
|
|
834
839
|
repaySolIx = await lavarageProgram.methods
|
|
@@ -846,11 +851,12 @@ export const closeTradeV2 = async (lavarageProgram: Program<LavarageV2>, positio
|
|
|
846
851
|
tokenProgram: quoteTokenProgram!,
|
|
847
852
|
toTokenAccount: getAssociatedTokenAddressSync(quoteToken, pool.account.nodeWallet, true, quoteTokenProgram),
|
|
848
853
|
mint: quoteToken,
|
|
849
|
-
})
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
+
})
|
|
855
|
+
// .remainingAccounts(partnerFeeRecipient ? [{
|
|
856
|
+
// pubkey: partnerFeeRecipient,
|
|
857
|
+
// isSigner: false,
|
|
858
|
+
// isWritable: true,
|
|
859
|
+
// }] : [])
|
|
854
860
|
.instruction()
|
|
855
861
|
const { setupInstructions, swapInstruction: swapInstructionPayload, cleanupInstruction, addressLookupTableAddresses } = jupiterSellIx!
|
|
856
862
|
jupiterIxs = [
|