@lavarage/sdk 6.9.2 → 6.9.3
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 +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +25 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -9
- package/dist/index.mjs.map +1 -1
- package/index.ts +34 -6
- package/lending.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3017,7 +3017,7 @@ declare const openTradeV1: (lavarageProgram: Program<Lavarage$1>, offer: Program
|
|
|
3017
3017
|
swapInstruction: Record<string, unknown>;
|
|
3018
3018
|
addressLookupTableAddresses: string[];
|
|
3019
3019
|
};
|
|
3020
|
-
}, marginSOL: BN, leverage: number, randomSeed: Keypair, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3020
|
+
}, marginSOL: BN, leverage: number, randomSeed: Keypair, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3021
3021
|
declare const openTradeV2: (lavarageProgram: Program<Lavarage>, offer: ProgramAccount<{
|
|
3022
3022
|
nodeWallet: PublicKey;
|
|
3023
3023
|
interestRate: number;
|
|
@@ -3028,7 +3028,7 @@ declare const openTradeV2: (lavarageProgram: Program<Lavarage>, offer: ProgramAc
|
|
|
3028
3028
|
swapInstruction: Record<string, unknown>;
|
|
3029
3029
|
addressLookupTableAddresses: string[];
|
|
3030
3030
|
};
|
|
3031
|
-
}, marginSOL: BN, leverage: number, randomSeed: Keypair, quoteToken: PublicKey, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3031
|
+
}, marginSOL: BN, leverage: number, randomSeed: Keypair, quoteToken: PublicKey, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3032
3032
|
declare const createTpDelegate: (lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, position: ProgramAccount<{
|
|
3033
3033
|
pool: PublicKey;
|
|
3034
3034
|
seed: PublicKey;
|
|
@@ -3077,7 +3077,7 @@ declare const closeTradeV1: (lavarageProgram: Program<Lavarage$1>, position: Pro
|
|
|
3077
3077
|
tokenLedgerInstruction?: Record<string, unknown>;
|
|
3078
3078
|
};
|
|
3079
3079
|
quoteResponse: any;
|
|
3080
|
-
}, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3080
|
+
}, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3081
3081
|
declare const closeTradeV2: (lavarageProgram: Program<Lavarage>, position: ProgramAccount<{
|
|
3082
3082
|
pool: PublicKey;
|
|
3083
3083
|
seed: PublicKey;
|
|
@@ -3096,7 +3096,7 @@ declare const closeTradeV2: (lavarageProgram: Program<Lavarage>, position: Progr
|
|
|
3096
3096
|
tokenLedgerInstruction?: Record<string, unknown>;
|
|
3097
3097
|
};
|
|
3098
3098
|
quoteResponse: any;
|
|
3099
|
-
}, quoteToken: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3099
|
+
}, quoteToken: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3100
3100
|
declare const getDelegateAccounts: (lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, userPubKey?: PublicKey) => Promise<{
|
|
3101
3101
|
parsed: {
|
|
3102
3102
|
tpPrice: any;
|
package/dist/index.d.ts
CHANGED
|
@@ -3017,7 +3017,7 @@ declare const openTradeV1: (lavarageProgram: Program<Lavarage$1>, offer: Program
|
|
|
3017
3017
|
swapInstruction: Record<string, unknown>;
|
|
3018
3018
|
addressLookupTableAddresses: string[];
|
|
3019
3019
|
};
|
|
3020
|
-
}, marginSOL: BN, leverage: number, randomSeed: Keypair, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3020
|
+
}, marginSOL: BN, leverage: number, randomSeed: Keypair, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3021
3021
|
declare const openTradeV2: (lavarageProgram: Program<Lavarage>, offer: ProgramAccount<{
|
|
3022
3022
|
nodeWallet: PublicKey;
|
|
3023
3023
|
interestRate: number;
|
|
@@ -3028,7 +3028,7 @@ declare const openTradeV2: (lavarageProgram: Program<Lavarage>, offer: ProgramAc
|
|
|
3028
3028
|
swapInstruction: Record<string, unknown>;
|
|
3029
3029
|
addressLookupTableAddresses: string[];
|
|
3030
3030
|
};
|
|
3031
|
-
}, marginSOL: BN, leverage: number, randomSeed: Keypair, quoteToken: PublicKey, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3031
|
+
}, marginSOL: BN, leverage: number, randomSeed: Keypair, quoteToken: PublicKey, tokenProgram: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3032
3032
|
declare const createTpDelegate: (lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, position: ProgramAccount<{
|
|
3033
3033
|
pool: PublicKey;
|
|
3034
3034
|
seed: PublicKey;
|
|
@@ -3077,7 +3077,7 @@ declare const closeTradeV1: (lavarageProgram: Program<Lavarage$1>, position: Pro
|
|
|
3077
3077
|
tokenLedgerInstruction?: Record<string, unknown>;
|
|
3078
3078
|
};
|
|
3079
3079
|
quoteResponse: any;
|
|
3080
|
-
}, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3080
|
+
}, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3081
3081
|
declare const closeTradeV2: (lavarageProgram: Program<Lavarage>, position: ProgramAccount<{
|
|
3082
3082
|
pool: PublicKey;
|
|
3083
3083
|
seed: PublicKey;
|
|
@@ -3096,7 +3096,7 @@ declare const closeTradeV2: (lavarageProgram: Program<Lavarage>, position: Progr
|
|
|
3096
3096
|
tokenLedgerInstruction?: Record<string, unknown>;
|
|
3097
3097
|
};
|
|
3098
3098
|
quoteResponse: any;
|
|
3099
|
-
}, quoteToken: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number) => Promise<VersionedTransaction>;
|
|
3099
|
+
}, quoteToken: PublicKey, partnerFeeRecipient?: PublicKey, partnerFeeMarkup?: number, computeBudgetMicroLamports?: number) => Promise<VersionedTransaction>;
|
|
3100
3100
|
declare const getDelegateAccounts: (lavarageProgram: Program<Lavarage$1> | Program<Lavarage>, userPubKey?: PublicKey) => Promise<{
|
|
3101
3101
|
parsed: {
|
|
3102
3102
|
tpPrice: any;
|
package/dist/index.js
CHANGED
|
@@ -1466,7 +1466,7 @@ function updateMaxBorrow(lavarageProgram, params) {
|
|
|
1466
1466
|
return __async(this, null, function* () {
|
|
1467
1467
|
var _a;
|
|
1468
1468
|
const { blockhash } = yield lavarageProgram.provider.connection.getLatestBlockhash("finalized");
|
|
1469
|
-
const instruction = yield lavarageProgram.methods.lpOperatorUpdateMaxBorrow(new import_anchor.BN(params.maxBorrow)).
|
|
1469
|
+
const instruction = yield lavarageProgram.methods.lpOperatorUpdateMaxBorrow(new import_anchor.BN(params.maxBorrow)).accountsStrict({
|
|
1470
1470
|
tradingPool: params.tradingPool,
|
|
1471
1471
|
nodeWallet: new import_web3.PublicKey(params.nodeWallet),
|
|
1472
1472
|
operator: params.oracle,
|
|
@@ -4227,7 +4227,7 @@ var getLiquidatedPositions = (lavarageProgram) => {
|
|
|
4227
4227
|
var getAllPositions = (lavarageProgram) => {
|
|
4228
4228
|
return lavarageProgram.account.position.all([{ dataSize: 178 }]);
|
|
4229
4229
|
};
|
|
4230
|
-
var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, tokenProgram, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
|
|
4230
|
+
var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, tokenProgram, partnerFeeRecipient, partnerFeeMarkup, computeBudgetMicroLamports) => __async(void 0, null, function* () {
|
|
4231
4231
|
let partnerFeeMarkupAsPkey;
|
|
4232
4232
|
if (partnerFeeMarkup) {
|
|
4233
4233
|
const feeBuffer = Buffer.alloc(8);
|
|
@@ -4343,12 +4343,16 @@ var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
4343
4343
|
...setupInstructions.map(deserializeInstruction),
|
|
4344
4344
|
deserializeInstruction(swapInstructionPayload)
|
|
4345
4345
|
];
|
|
4346
|
+
const computeFeeIx = import_web32.ComputeBudgetProgram.setComputeUnitPrice({
|
|
4347
|
+
microLamports: computeBudgetMicroLamports != null ? computeBudgetMicroLamports : 1e5
|
|
4348
|
+
});
|
|
4346
4349
|
const allInstructions = [
|
|
4347
4350
|
fromTokenAccount.instruction,
|
|
4348
4351
|
toTokenAccount.instruction,
|
|
4349
4352
|
tradingOpenBorrowInstruction,
|
|
4350
4353
|
...jupiterIxs,
|
|
4351
|
-
openAddCollateralInstruction
|
|
4354
|
+
openAddCollateralInstruction,
|
|
4355
|
+
computeBudgetMicroLamports ? computeFeeIx : void 0
|
|
4352
4356
|
].filter(Boolean);
|
|
4353
4357
|
const messageV0 = new import_web32.TransactionMessage({
|
|
4354
4358
|
payerKey: lavarageProgram.provider.publicKey,
|
|
@@ -4358,7 +4362,7 @@ var openTradeV1 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
4358
4362
|
const tx = new import_web32.VersionedTransaction(messageV0);
|
|
4359
4363
|
return tx;
|
|
4360
4364
|
});
|
|
4361
|
-
var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, quoteToken, tokenProgram, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
|
|
4365
|
+
var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage, randomSeed, quoteToken, tokenProgram, partnerFeeRecipient, partnerFeeMarkup, computeBudgetMicroLamports) => __async(void 0, null, function* () {
|
|
4362
4366
|
let partnerFeeMarkupAsPkey;
|
|
4363
4367
|
if (partnerFeeMarkup) {
|
|
4364
4368
|
const feeBuffer = Buffer.alloc(8);
|
|
@@ -4500,12 +4504,16 @@ var openTradeV2 = (lavarageProgram, offer, jupInstruction, marginSOL, leverage,
|
|
|
4500
4504
|
...setupInstructions.map(deserializeInstruction),
|
|
4501
4505
|
deserializeInstruction(swapInstructionPayload)
|
|
4502
4506
|
];
|
|
4507
|
+
const computeFeeIx = import_web32.ComputeBudgetProgram.setComputeUnitPrice({
|
|
4508
|
+
microLamports: computeBudgetMicroLamports != null ? computeBudgetMicroLamports : 1e5
|
|
4509
|
+
});
|
|
4503
4510
|
const allInstructions = [
|
|
4504
4511
|
fromTokenAccount.instruction,
|
|
4505
4512
|
toTokenAccount.instruction,
|
|
4506
4513
|
tradingOpenBorrowInstruction,
|
|
4507
4514
|
...jupiterIxs,
|
|
4508
|
-
openAddCollateralInstruction
|
|
4515
|
+
openAddCollateralInstruction,
|
|
4516
|
+
computeBudgetMicroLamports ? computeFeeIx : void 0
|
|
4509
4517
|
].filter(Boolean);
|
|
4510
4518
|
const messageV0 = new import_web32.TransactionMessage({
|
|
4511
4519
|
payerKey: lavarageProgram.provider.publicKey,
|
|
@@ -4676,7 +4684,7 @@ var partialRepayV2 = (lavarageProgram, position, repaymentBps) => __async(void 0
|
|
|
4676
4684
|
}).compileToV0Message();
|
|
4677
4685
|
return new import_web32.VersionedTransaction(messageV0);
|
|
4678
4686
|
});
|
|
4679
|
-
var closeTradeV1 = (lavarageProgram, position, offer, jupInstruction, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
|
|
4687
|
+
var closeTradeV1 = (lavarageProgram, position, offer, jupInstruction, partnerFeeRecipient, partnerFeeMarkup, computeBudgetMicroLamports) => __async(void 0, null, function* () {
|
|
4680
4688
|
var _a, _b;
|
|
4681
4689
|
let partnerFeeMarkupAsPkey;
|
|
4682
4690
|
if (partnerFeeMarkup) {
|
|
@@ -4835,6 +4843,9 @@ var closeTradeV1 = (lavarageProgram, position, offer, jupInstruction, partnerFee
|
|
|
4835
4843
|
offer.account.collateralType,
|
|
4836
4844
|
tokenProgram
|
|
4837
4845
|
);
|
|
4846
|
+
const computeFeeIx = import_web32.ComputeBudgetProgram.setComputeUnitPrice({
|
|
4847
|
+
microLamports: computeBudgetMicroLamports != null ? computeBudgetMicroLamports : 1e5
|
|
4848
|
+
});
|
|
4838
4849
|
const allInstructions = [
|
|
4839
4850
|
((_a = jupInstruction.instructions) == null ? void 0 : _a.tokenLedgerInstruction) ? createAssociatedTokenAccountInstruction2 : null,
|
|
4840
4851
|
((_b = jupInstruction.instructions) == null ? void 0 : _b.tokenLedgerInstruction) ? deserializeInstruction(
|
|
@@ -4843,7 +4854,8 @@ var closeTradeV1 = (lavarageProgram, position, offer, jupInstruction, partnerFee
|
|
|
4843
4854
|
toTokenAccount.instruction,
|
|
4844
4855
|
closePositionIx,
|
|
4845
4856
|
...jupiterIxs,
|
|
4846
|
-
repaySolIx
|
|
4857
|
+
repaySolIx,
|
|
4858
|
+
computeBudgetMicroLamports ? computeFeeIx : void 0
|
|
4847
4859
|
].filter((i) => !!i);
|
|
4848
4860
|
const messageV0 = new import_web32.TransactionMessage({
|
|
4849
4861
|
payerKey: lavarageProgram.provider.publicKey,
|
|
@@ -4853,7 +4865,7 @@ var closeTradeV1 = (lavarageProgram, position, offer, jupInstruction, partnerFee
|
|
|
4853
4865
|
const tx = new import_web32.VersionedTransaction(messageV0);
|
|
4854
4866
|
return tx;
|
|
4855
4867
|
});
|
|
4856
|
-
var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken, partnerFeeRecipient, partnerFeeMarkup) => __async(void 0, null, function* () {
|
|
4868
|
+
var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken, partnerFeeRecipient, partnerFeeMarkup, computeBudgetMicroLamports) => __async(void 0, null, function* () {
|
|
4857
4869
|
var _a, _b;
|
|
4858
4870
|
let partnerFeeMarkupAsPkey;
|
|
4859
4871
|
if (partnerFeeMarkup) {
|
|
@@ -5058,6 +5070,9 @@ var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken
|
|
|
5058
5070
|
offer.account.collateralType,
|
|
5059
5071
|
tokenProgram
|
|
5060
5072
|
);
|
|
5073
|
+
const computeFeeIx = import_web32.ComputeBudgetProgram.setComputeUnitPrice({
|
|
5074
|
+
microLamports: computeBudgetMicroLamports != null ? computeBudgetMicroLamports : 1e5
|
|
5075
|
+
});
|
|
5061
5076
|
const allInstructions = [
|
|
5062
5077
|
((_a = jupInstruction.instructions) == null ? void 0 : _a.tokenLedgerInstruction) ? createAssociatedTokenAccountInstruction2 : null,
|
|
5063
5078
|
((_b = jupInstruction.instructions) == null ? void 0 : _b.tokenLedgerInstruction) ? deserializeInstruction(
|
|
@@ -5066,7 +5081,8 @@ var closeTradeV2 = (lavarageProgram, position, offer, jupInstruction, quoteToken
|
|
|
5066
5081
|
toTokenAccount.instruction,
|
|
5067
5082
|
closePositionIx,
|
|
5068
5083
|
...jupiterIxs,
|
|
5069
|
-
repaySolIx
|
|
5084
|
+
repaySolIx,
|
|
5085
|
+
computeBudgetMicroLamports ? computeFeeIx : void 0
|
|
5070
5086
|
].filter((i) => !!i);
|
|
5071
5087
|
const messageV0 = new import_web32.TransactionMessage({
|
|
5072
5088
|
payerKey: lavarageProgram.provider.publicKey,
|