@pyron-finance/pyron-client 2.3.0 → 2.3.1

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 CHANGED
@@ -10108,19 +10108,19 @@ function fetchLatestIdl() {
10108
10108
  async function makeInitLendrAccountIx(ldProgram, accounts$2) {
10109
10109
  return ldProgram.methods.lendrAccountInitialize().accounts(accounts$2).instruction();
10110
10110
  }
10111
- async function makeInitLendrAccountWithSessionIx(ldProgram, { lendrGroup, session: session$1, feePayer }, accountIndex, thirdPartyId) {
10111
+ async function makeInitLendrAccountWithSessionIx(ldProgram, { lendrGroup, session, feePayer }, accountIndex, thirdPartyId) {
10112
10112
  const thirdPartyIdValue = thirdPartyId ?? 0;
10113
10113
  const [lendrAccount] = PublicKey.findProgramAddressSync([
10114
10114
  Buffer.from("lendr_account"),
10115
10115
  lendrGroup.toBuffer(),
10116
- session$1.walletPublicKey.toBuffer(),
10116
+ session.walletPublicKey.toBuffer(),
10117
10117
  Buffer.from(new Uint16Array([accountIndex]).buffer),
10118
10118
  Buffer.from(new Uint16Array([thirdPartyIdValue]).buffer)
10119
10119
  ], ldProgram.programId);
10120
- return ldProgram.methods.lendrAccountInitializeWithSession(session$1.walletPublicKey, accountIndex, thirdPartyId ?? null).accounts({
10120
+ return ldProgram.methods.lendrAccountInitializeWithSession(session.walletPublicKey, accountIndex, thirdPartyId ?? null).accounts({
10121
10121
  lendrGroup,
10122
10122
  lendrAccount,
10123
- sessionKey: session$1.sessionPublicKey,
10123
+ sessionKey: session.sessionPublicKey,
10124
10124
  feePayer
10125
10125
  }).instruction();
10126
10126
  }
@@ -22697,7 +22697,7 @@ var LendrAccount = class LendrAccount {
22697
22697
  keys: []
22698
22698
  };
22699
22699
  }
22700
- async makeDepositWithSessionIx(program, banks, mintDatas, amount, bankAddress, session$1, opts = {}) {
22700
+ async makeDepositWithSessionIx(program, banks, mintDatas, amount, bankAddress, session, opts = {}) {
22701
22701
  const bank = banks.get(bankAddress.toBase58());
22702
22702
  if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
22703
22703
  const { depositIxs, ixArguments, userTokenAtaPk, mintData, remainingAccounts } = await this.prepareDepositIx(banks, mintDatas, amount, bankAddress, {
@@ -22705,7 +22705,7 @@ var LendrAccount = class LendrAccount {
22705
22705
  wrapAndUnwrapSol: false
22706
22706
  });
22707
22707
  const accounts$2 = {
22708
- sessionKey: session$1.sessionPublicKey,
22708
+ sessionKey: session.sessionPublicKey,
22709
22709
  lendrAccount: this.address,
22710
22710
  bank: bankAddress,
22711
22711
  signerTokenAccount: userTokenAtaPk,
@@ -22717,7 +22717,7 @@ var LendrAccount = class LendrAccount {
22717
22717
  if (bank.mint.equals(NATIVE_MINT)) {
22718
22718
  const wSolBalanceUi = opts.wSolBalanceUi ?? 0;
22719
22719
  const wrapAmount = new BigNumber(amount).minus(wSolBalanceUi);
22720
- const wrapIxs = makeSessionWrapSolIxs(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer, wrapAmount, wSolBalanceUi);
22720
+ const wrapIxs = makeSessionWrapSolIxs(session.walletPublicKey, session.sessionPublicKey, session.payer, wrapAmount, wSolBalanceUi);
22721
22721
  depositIxs.push(...wrapIxs);
22722
22722
  }
22723
22723
  depositIxs.push(depositIx);
@@ -22789,7 +22789,7 @@ var LendrAccount = class LendrAccount {
22789
22789
  keys: []
22790
22790
  };
22791
22791
  }
22792
- async makeRepayWithSessionIx(program, banks, mintDatas, amount, bankAddress, session$1, repayAll = false, opts = {}) {
22792
+ async makeRepayWithSessionIx(program, banks, mintDatas, amount, bankAddress, session, repayAll = false, opts = {}) {
22793
22793
  const bank = banks.get(bankAddress.toBase58());
22794
22794
  if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
22795
22795
  const { repayIxs, ixArguments, userAta, mintData, remainingAccounts } = await this.prepareRepayInstruction(program, banks, mintDatas, amount, bankAddress, repayAll, {
@@ -22797,7 +22797,7 @@ var LendrAccount = class LendrAccount {
22797
22797
  wrapAndUnwrapSol: false
22798
22798
  });
22799
22799
  const repayIx = await instructions_default.makeRepayWithSessionIx(program, {
22800
- sessionKey: session$1.sessionPublicKey,
22800
+ sessionKey: session.sessionPublicKey,
22801
22801
  lendrAccount: this.address,
22802
22802
  signerTokenAccount: userAta,
22803
22803
  bank: bankAddress,
@@ -22812,7 +22812,7 @@ var LendrAccount = class LendrAccount {
22812
22812
  if (bank.mint.equals(NATIVE_MINT)) {
22813
22813
  const wSolBalanceUi = opts.wSolBalanceUi ?? 0;
22814
22814
  const wrapAmount = new BigNumber(amount).minus(wSolBalanceUi);
22815
- const wrapIxs = makeSessionWrapSolIxs(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer, wrapAmount, wSolBalanceUi);
22815
+ const wrapIxs = makeSessionWrapSolIxs(session.walletPublicKey, session.sessionPublicKey, session.payer, wrapAmount, wSolBalanceUi);
22816
22816
  repayIxs.push(...wrapIxs);
22817
22817
  }
22818
22818
  repayIxs.push(repayIx);
@@ -22900,13 +22900,13 @@ var LendrAccount = class LendrAccount {
22900
22900
  keys: []
22901
22901
  };
22902
22902
  }
22903
- async makeWithdrawWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
22903
+ async makeWithdrawWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
22904
22904
  const { withdrawIxs, wrapAndUnwrapSol, userAta, mintData, bank, remainingAccounts } = await this.prepareWithdrawInstruction(program, bankMap, mintDatas, bankMetadataMap, bankAddress, withdrawAll, {
22905
22905
  ...withdrawOpts,
22906
- createAtaPayer: session$1.payer
22906
+ createAtaPayer: session.payer
22907
22907
  });
22908
22908
  const withdrawIx = await instructions_default.makeWithdrawWithSessionIx(program, {
22909
- sessionKey: session$1.sessionPublicKey,
22909
+ sessionKey: session.sessionPublicKey,
22910
22910
  lendrAccount: this.address,
22911
22911
  bank: bank.address,
22912
22912
  destinationTokenAccount: userAta,
@@ -22918,7 +22918,7 @@ var LendrAccount = class LendrAccount {
22918
22918
  }, remainingAccounts);
22919
22919
  withdrawIxs.push(withdrawIx);
22920
22920
  if (wrapAndUnwrapSol && bank.mint.equals(NATIVE_MINT)) {
22921
- withdrawIxs.push(makeSessionUnwrapSolIx(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer));
22921
+ withdrawIxs.push(makeSessionUnwrapSolIx(session.walletPublicKey, session.sessionPublicKey, session.payer));
22922
22922
  }
22923
22923
  return {
22924
22924
  instructions: withdrawIxs,
@@ -22984,13 +22984,13 @@ var LendrAccount = class LendrAccount {
22984
22984
  keys: []
22985
22985
  };
22986
22986
  }
22987
- async makeBorrowWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session$1, borrowOpts = {}) {
22987
+ async makeBorrowWithSessionIx(program, bankMap, mintDatas, bankMetadataMap, amount, bankAddress, session, borrowOpts = {}) {
22988
22988
  const { borrowIxs, bank, mintData, userAta, remainingAccounts, wrapAndUnwrapSol } = await this.prepareBorrowInstrcution(bankMap, mintDatas, bankMetadataMap, bankAddress, {
22989
22989
  ...borrowOpts,
22990
- createAtaPayer: session$1.payer
22990
+ createAtaPayer: session.payer
22991
22991
  });
22992
22992
  const borrowIx = await instructions_default.makeBorrowWithSessionIx(program, {
22993
- sessionKey: session$1.sessionPublicKey,
22993
+ sessionKey: session.sessionPublicKey,
22994
22994
  lendrAccount: this.address,
22995
22995
  bank: bank.address,
22996
22996
  destinationTokenAccount: userAta,
@@ -22999,7 +22999,7 @@ var LendrAccount = class LendrAccount {
22999
22999
  }, { amount: uiToNative(amount, bank.mintDecimals) }, remainingAccounts);
23000
23000
  borrowIxs.push(borrowIx);
23001
23001
  if (bank.mint.equals(NATIVE_MINT) && wrapAndUnwrapSol) {
23002
- borrowIxs.push(makeSessionUnwrapSolIx(session$1.walletPublicKey, session$1.sessionPublicKey, session$1.payer));
23002
+ borrowIxs.push(makeSessionUnwrapSolIx(session.walletPublicKey, session.sessionPublicKey, session.payer));
23003
23003
  }
23004
23004
  return {
23005
23005
  instructions: borrowIxs,
@@ -23762,8 +23762,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
23762
23762
  async makeDepositIx(amount, bankAddress, depositOpts = {}) {
23763
23763
  return this._lendrAccount.makeDepositIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, depositOpts);
23764
23764
  }
23765
- async makeDepositWithSessionIx(amount, bankAddress, session$1, depositOpts = {}) {
23766
- return this._lendrAccount.makeDepositWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, session$1, depositOpts);
23765
+ async makeDepositWithSessionIx(amount, bankAddress, session, depositOpts = {}) {
23766
+ return this._lendrAccount.makeDepositWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, session, depositOpts);
23767
23767
  }
23768
23768
  /**
23769
23769
  * Creates a transaction for depositing native stake into a lendr staked asset bank account.
@@ -23890,15 +23890,15 @@ var LendrAccountWrapper = class LendrAccountWrapper {
23890
23890
  }, "[lendr:lendr-account:deposit] Depositing successful");
23891
23891
  return sig;
23892
23892
  }
23893
- async depositWithSession(amount, bankAddress, session$1, depositOpts = {}) {
23893
+ async depositWithSession(amount, bankAddress, session, depositOpts = {}) {
23894
23894
  this.client.logger.debug({
23895
23895
  address: this.address.toBase58(),
23896
23896
  amount,
23897
23897
  bankAddress: bankAddress.toBase58(),
23898
- sessionKey: session$1.sessionPublicKey
23898
+ sessionKey: session.sessionPublicKey
23899
23899
  }, "[lendr:lendr-account:depositWithSession] Depositing into lendr account, using sessions.");
23900
- const { instructions: instructions$3 } = await this.makeDepositWithSessionTx(amount, bankAddress, session$1, depositOpts);
23901
- const txResult = await session$1.sendTransaction(instructions$3, { variation: "LendingAccountDeposit" });
23900
+ const { instructions: instructions$3 } = await this.makeDepositWithSessionTx(amount, bankAddress, session, depositOpts);
23901
+ const txResult = await session.sendTransaction(instructions$3, { variation: "LendingAccountDeposit" });
23902
23902
  this.client.logger.debug({
23903
23903
  address: this.address.toBase58(),
23904
23904
  txResult
@@ -23924,8 +23924,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
23924
23924
  });
23925
23925
  return solanaTx;
23926
23926
  }
23927
- async makeDepositWithSessionTx(amount, bankAddress, session$1, depositOpts = {}) {
23928
- const ixs = await this.makeDepositWithSessionIx(amount, bankAddress, session$1, depositOpts);
23927
+ async makeDepositWithSessionTx(amount, bankAddress, session, depositOpts = {}) {
23928
+ const ixs = await this.makeDepositWithSessionIx(amount, bankAddress, session, depositOpts);
23929
23929
  const tx = new Transaction().add(...ixs.instructions);
23930
23930
  const clientLookupTables = await getClientAddressLookupTableAccounts(this.client);
23931
23931
  const solanaTx = addTransactionMetadata(tx, {
@@ -24017,7 +24017,7 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24017
24017
  * @returns An InstructionsWrapper containing the deposit instructions
24018
24018
  * @throws Will throw an error if the repay mint is not found
24019
24019
  */
24020
- async makeRepayWithSessionIx(amount, bankAddress, sessionKey, repayAll = false, repayOpts = {}) {
24020
+ async makeRepayWithSessionIx(amount, bankAddress, session, repayAll = false, repayOpts = {}) {
24021
24021
  const tokenProgramAddress = this.client.mintDatas.get(bankAddress.toBase58())?.tokenProgram;
24022
24022
  if (!tokenProgramAddress) throw Error("Repay mint not found");
24023
24023
  return this._lendrAccount.makeRepayWithSessionIx(this._program, this.client.banks, this.client.mintDatas, amount, bankAddress, session, repayAll, repayOpts);
@@ -24058,16 +24058,16 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24058
24058
  * @param repayOpts - Optional parameters for the repay instruction
24059
24059
  * @returns The transaction signature of the repayment
24060
24060
  */
24061
- async repayWithSession(amount, bankAddress, session$1, repayAll = false, repayOpts = {}) {
24061
+ async repayWithSession(amount, bankAddress, session, repayAll = false, repayOpts = {}) {
24062
24062
  this.client.logger.debug({
24063
24063
  address: this.address.toBase58(),
24064
- sessionKey: session$1.sessionPublicKey,
24064
+ sessionKey: session.sessionPublicKey,
24065
24065
  amount,
24066
24066
  bankAddress,
24067
24067
  repayAll
24068
24068
  }, "[lendr:lendr-account:repayWithSession] Repaying into lendr account");
24069
- const tx = await this.makeRepayWithSessionTx(amount, bankAddress, session$1, repayAll, repayOpts);
24070
- const result = await session$1.sendTransaction(tx.instructions, { variation: "LendingAccountRepay" });
24069
+ const tx = await this.makeRepayWithSessionTx(amount, bankAddress, session, repayAll, repayOpts);
24070
+ const result = await session.sendTransaction(tx.instructions, { variation: "LendingAccountRepay" });
24071
24071
  this.client.logger.debug({
24072
24072
  address: this.address.toBase58(),
24073
24073
  result
@@ -24103,8 +24103,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24103
24103
  * @param repayOpts - Optional parameters for the repay instruction
24104
24104
  * @returns A transaction object containing the repay instructions
24105
24105
  */
24106
- async makeRepayWithSessionTx(amount, bankAddress, session$1, repayAll = false, repayOpts = {}) {
24107
- const ixs = await this.makeRepayWithSessionIx(amount, bankAddress, session$1, repayAll, repayOpts);
24106
+ async makeRepayWithSessionTx(amount, bankAddress, session, repayAll = false, repayOpts = {}) {
24107
+ const ixs = await this.makeRepayWithSessionIx(amount, bankAddress, session, repayAll, repayOpts);
24108
24108
  const tx = new Transaction().add(...ixs.instructions);
24109
24109
  const clientLookupTables = await getClientAddressLookupTableAccounts(this.client);
24110
24110
  const solanaTx = addTransactionMetadata(tx, {
@@ -24141,11 +24141,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24141
24141
  * @returns An InstructionsWrapper containing the withdraw instructions and signers
24142
24142
  * @throws Will throw an error if the withdraw mint is not found
24143
24143
  */
24144
- async makeWithdrawWithSessionIx(amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
24144
+ async makeWithdrawWithSessionIx(amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
24145
24145
  const tokenProgramAddress = this.client.mintDatas.get(bankAddress.toBase58())?.tokenProgram;
24146
24146
  if (!tokenProgramAddress) throw Error("Withdraw mint not found");
24147
24147
  if (!this.client.bankMetadataMap) throw Error("Bank metadata map not found");
24148
- return this._lendrAccount.makeWithdrawWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session$1, withdrawAll, withdrawOpts);
24148
+ return this._lendrAccount.makeWithdrawWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session, withdrawAll, withdrawOpts);
24149
24149
  }
24150
24150
  /**
24151
24151
  * Creates a transaction for withdrawing tokens from a lendr bank account and staking them.
@@ -24239,9 +24239,9 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24239
24239
  * @param withdrawOpts - Optional parameters for the withdraw instructions
24240
24240
  * @returns A transaction object ready to be signed and sent
24241
24241
  */
24242
- async makeWithdrawAllWithSessionTx(banks, session$1, withdrawOpts = {}) {
24242
+ async makeWithdrawAllWithSessionTx(banks, session, withdrawOpts = {}) {
24243
24243
  this.client.logger.debug({ address: this.address.toBase58() }, "[lendr:lendr-account:withdraw-all-with-session] Withdrawing all from lendr account");
24244
- const withdrawIxsWrapped = await Promise.all(banks.map((bank) => this.makeWithdrawWithSessionIx(bank.amount, bank.bankAddress, session$1, true, withdrawOpts)));
24244
+ const withdrawIxsWrapped = await Promise.all(banks.map((bank) => this.makeWithdrawWithSessionIx(bank.amount, bank.bankAddress, session, true, withdrawOpts)));
24245
24245
  return this.finalizeWithdrawAllTransaction(withdrawIxsWrapped);
24246
24246
  }
24247
24247
  async finalizeWithdrawAllTransaction(withdrawIxsWrapped) {
@@ -24290,14 +24290,14 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24290
24290
  * @param withdrawOpts - Optional withdraw configuration parameters
24291
24291
  * @returns Array of transaction signatures - includes signatures for any required oracle feed updates followed by the withdraw transaction
24292
24292
  */
24293
- async withdrawWithSession(amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
24293
+ async withdrawWithSession(amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
24294
24294
  this.client.logger.debug({
24295
24295
  address: this.address.toBase58(),
24296
24296
  amount,
24297
- sessionKey: session$1.sessionPublicKey
24297
+ sessionKey: session.sessionPublicKey
24298
24298
  }, "[lendr:lendr-account:withdrawWithSession] Withdrawing from lendr account");
24299
- const { instructions: instructions$3 } = await this.makeWithdrawWithSessionTx(amount, bankAddress, session$1, withdrawAll, withdrawOpts);
24300
- const txResult = await session$1.sendTransaction(instructions$3, { variation: "LendingAccountWithdraw" });
24299
+ const { instructions: instructions$3 } = await this.makeWithdrawWithSessionTx(amount, bankAddress, session, withdrawAll, withdrawOpts);
24300
+ const txResult = await session.sendTransaction(instructions$3, { variation: "LendingAccountWithdraw" });
24301
24301
  this.client.logger.debug({
24302
24302
  address: this.address.toBase58(),
24303
24303
  txResult
@@ -24355,10 +24355,10 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24355
24355
  * @param withdrawOpts - Optional withdraw configuration parameters
24356
24356
  * @returns Object containing feed crank transactions and the withdraw transaction
24357
24357
  */
24358
- async makeWithdrawWithSessionTx(amount, bankAddress, session$1, withdrawAll = false, withdrawOpts = {}) {
24358
+ async makeWithdrawWithSessionTx(amount, bankAddress, session, withdrawAll = false, withdrawOpts = {}) {
24359
24359
  const cuRequestIxs = this.makeComputeBudgetIx();
24360
24360
  const { instructions: updateFeedIxs, luts: feedLuts } = await this.makeUpdateFeedIx([]);
24361
- const withdrawIxs = await this.makeWithdrawWithSessionIx(amount, bankAddress, session$1, withdrawAll, withdrawOpts);
24361
+ const withdrawIxs = await this.makeWithdrawWithSessionIx(amount, bankAddress, session, withdrawAll, withdrawOpts);
24362
24362
  const { value: { blockhash } } = await this._program.provider.connection.getLatestBlockhashAndContext("confirmed");
24363
24363
  const feedCrankTxs = [];
24364
24364
  if (updateFeedIxs.length > 0) {
@@ -24415,11 +24415,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24415
24415
  * @param borrowOpts - Optional borrow configuration parameters
24416
24416
  * @returns An InstructionsWrapper containing the borrow instructions
24417
24417
  */
24418
- async makeBorrowWithSessionIx(amount, bankAddress, session$1, borrowOpts = {}) {
24418
+ async makeBorrowWithSessionIx(amount, bankAddress, session, borrowOpts = {}) {
24419
24419
  const tokenProgramAddress = this.client.mintDatas.get(bankAddress.toBase58())?.tokenProgram;
24420
24420
  if (!tokenProgramAddress) throw Error("Borrow mint not found");
24421
24421
  if (!this.client.bankMetadataMap) throw Error("Bank metadata map not found");
24422
- return this._lendrAccount.makeBorrowWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session$1, borrowOpts);
24422
+ return this._lendrAccount.makeBorrowWithSessionIx(this._program, this.client.banks, this.client.mintDatas, this.client.bankMetadataMap, amount, bankAddress, session, borrowOpts);
24423
24423
  }
24424
24424
  /**
24425
24425
  * Borrows tokens from a lendr bank account.
@@ -24453,14 +24453,14 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24453
24453
  * @param borrowOpts - Optional borrow configuration parameters
24454
24454
  * @returns Array of transaction signatures from the borrow operation
24455
24455
  */
24456
- async borrowWithSession(amount, bankAddress, session$1, borrowOpts = {}) {
24456
+ async borrowWithSession(amount, bankAddress, session, borrowOpts = {}) {
24457
24457
  this.client.logger.debug({
24458
24458
  address: this.address.toBase58(),
24459
24459
  amount,
24460
- sessionKey: session$1.sessionPublicKey
24460
+ sessionKey: session.sessionPublicKey
24461
24461
  }, "[lendr:lendr-account:borrowWithSession] Borrowing from lendr account");
24462
- const { instructions: instructions$3 } = await this.makeBorrowWithSessionTx(amount, bankAddress, session$1, borrowOpts);
24463
- const txResult = await session$1.sendTransaction(instructions$3, { variation: "LendingAccountBorrow" });
24462
+ const { instructions: instructions$3 } = await this.makeBorrowWithSessionTx(amount, bankAddress, session, borrowOpts);
24463
+ const txResult = await session.sendTransaction(instructions$3, { variation: "LendingAccountBorrow" });
24464
24464
  this.client.logger.debug({
24465
24465
  address: this.address.toBase58(),
24466
24466
  txResult
@@ -24516,10 +24516,10 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24516
24516
  * @param borrowOpts - Optional borrow configuration parameters
24517
24517
  * @returns Object containing feed crank transactions and the borrow transaction
24518
24518
  */
24519
- async makeBorrowWithSessionTx(amount, bankAddress, session$1, borrowOpts = {}) {
24519
+ async makeBorrowWithSessionTx(amount, bankAddress, session, borrowOpts = {}) {
24520
24520
  const cuRequestIxs = this.makeComputeBudgetIx();
24521
24521
  const { instructions: updateFeedIxs, luts: feedLuts } = await this.makeUpdateFeedIx([bankAddress]);
24522
- const borrowIxs = await this.makeBorrowWithSessionIx(amount, bankAddress, session$1, borrowOpts);
24522
+ const borrowIxs = await this.makeBorrowWithSessionIx(amount, bankAddress, session, borrowOpts);
24523
24523
  const { value: { blockhash } } = await this._program.provider.connection.getLatestBlockhashAndContext("confirmed");
24524
24524
  const feedCrankTxs = [];
24525
24525
  if (updateFeedIxs.length > 0) {
@@ -24671,8 +24671,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24671
24671
  * @param session - established session state
24672
24672
  * @returns An InstructionsWrapper containing the begin flash loan instruction
24673
24673
  */
24674
- async makeBeginFlashLoanWithSessionIx(endIndex, session$1) {
24675
- return this._lendrAccount.makeBeginFlashLoanWithSessionIx(this._program, endIndex, session$1.sessionPublicKey);
24674
+ async makeBeginFlashLoanWithSessionIx(endIndex, session) {
24675
+ return this._lendrAccount.makeBeginFlashLoanWithSessionIx(this._program, endIndex, session.sessionPublicKey);
24676
24676
  }
24677
24677
  /**
24678
24678
  * Creates an instruction to end a flash loan operation.
@@ -24690,8 +24690,8 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24690
24690
  * @param session - established session state
24691
24691
  * @returns An InstructionsWrapper containing the end flash loan instruction
24692
24692
  */
24693
- async makeEndFlashLoanWithSessionIx(projectedActiveBalances, session$1) {
24694
- return this._lendrAccount.makeEndFlashLoanWithSessionIx(this._program, this.client.banks, projectedActiveBalances, session$1.sessionPublicKey);
24693
+ async makeEndFlashLoanWithSessionIx(projectedActiveBalances, session) {
24694
+ return this._lendrAccount.makeEndFlashLoanWithSessionIx(this._program, this.client.banks, projectedActiveBalances, session.sessionPublicKey);
24695
24695
  }
24696
24696
  async flashLoan(args, processOpts, txOpts) {
24697
24697
  this.client.logger.debug({ address: this.address.toBase58() }, "[lendr:lendr-account:flashLoan] Executing flashloan from lendr account");
@@ -24704,11 +24704,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24704
24704
  }, "[lendr:lendr-account:flashLoan] Flashloan successful");
24705
24705
  return sig;
24706
24706
  }
24707
- async flashLoanWithSession(args, session$1) {
24707
+ async flashLoanWithSession(args, session) {
24708
24708
  this.client.logger.debug({ address: this.address.toBase58() }, "[lendr:lendr-account:flashLoanWithSession] Executing flashloan from lendr account using session");
24709
24709
  const clientLookupTables = await getClientAddressLookupTableAccounts(this.client);
24710
- const tx = await this.buildFlashLoanWithSessionTx(args, session$1, clientLookupTables);
24711
- const txResult = await session$1.sendTransaction(tx);
24710
+ const tx = await this.buildFlashLoanWithSessionTx(args, session, clientLookupTables);
24711
+ const txResult = await session.sendTransaction(tx);
24712
24712
  this.client.logger.debug({
24713
24713
  address: this.address.toBase58(),
24714
24714
  sig: txResult.signature
@@ -24741,11 +24741,11 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24741
24741
  }
24742
24742
  return tx;
24743
24743
  }
24744
- async buildFlashLoanWithSessionTx(args, session$1, lookupTables) {
24744
+ async buildFlashLoanWithSessionTx(args, session, lookupTables) {
24745
24745
  const endIndex = args.ixs.length + 1;
24746
24746
  const projectedActiveBalances = this._lendrAccount.projectActiveBalancesNoCpi(this._program, args.ixs);
24747
- const beginFlashLoanIx = await this.makeBeginFlashLoanWithSessionIx(endIndex, session$1);
24748
- const endFlashLoanIx = await this.makeEndFlashLoanWithSessionIx(projectedActiveBalances, session$1);
24747
+ const beginFlashLoanIx = await this.makeBeginFlashLoanWithSessionIx(endIndex, session);
24748
+ const endFlashLoanIx = await this.makeEndFlashLoanWithSessionIx(projectedActiveBalances, session);
24749
24749
  const flashloanIxs = [
24750
24750
  ...beginFlashLoanIx.instructions,
24751
24751
  ...args.ixs,
@@ -24754,7 +24754,7 @@ var LendrAccountWrapper = class LendrAccountWrapper {
24754
24754
  const totalLookupTables = lookupTables || [];
24755
24755
  const blockhash = args.blockhash ?? (await this._program.provider.connection.getLatestBlockhash("confirmed")).blockhash;
24756
24756
  const message = new TransactionMessage({
24757
- payerKey: session$1.payer,
24757
+ payerKey: session.payer,
24758
24758
  recentBlockhash: blockhash,
24759
24759
  instructions: flashloanIxs
24760
24760
  }).compileToV0Message(totalLookupTables);
@@ -25488,12 +25488,12 @@ var LendrClient = class LendrClient {
25488
25488
  keys: []
25489
25489
  };
25490
25490
  }
25491
- async makeCreateLendrAccountWithSessionIx(session$1, accountIndex, thirdPartyId) {
25492
- this.logger.debug({ for: session$1.walletPublicKey.toBase58() }, "Generating lendr account init with session ix");
25491
+ async makeCreateLendrAccountWithSessionIx(session, accountIndex, thirdPartyId) {
25492
+ this.logger.debug({ for: session.walletPublicKey.toBase58() }, "Generating lendr account init with session ix");
25493
25493
  const initLendrAccountIx = await instructions_default.makeInitLendrAccountWithSessionIx(this.program, {
25494
25494
  lendrGroup: this.groupAddress,
25495
- session: session$1,
25496
- feePayer: session$1.payer
25495
+ session,
25496
+ feePayer: session.payer
25497
25497
  }, accountIndex, thirdPartyId);
25498
25498
  const ixs = [initLendrAccountIx];
25499
25499
  this.logger.debug({
@@ -25536,15 +25536,15 @@ var LendrClient = class LendrClient {
25536
25536
  *
25537
25537
  * @returns Object containing the transaction signature and the created LendrAccount instance
25538
25538
  */
25539
- async createLendrAccountWithSession(session$1, commitment, accountIndex = 0, thirdPartyId) {
25540
- const tx = await this.createLendrAccountWithSessionTx(session$1, accountIndex, thirdPartyId);
25541
- const txResult = await session$1.sendTransaction(tx, { variation: "LendrAccountInitialize" });
25539
+ async createLendrAccountWithSession(session, commitment, accountIndex = 0, thirdPartyId) {
25540
+ const tx = await this.createLendrAccountWithSessionTx(session, accountIndex, thirdPartyId);
25541
+ const txResult = await session.sendTransaction(tx, { variation: "LendrAccountInitialize" });
25542
25542
  this.logger.debug({ txResult }, "Created Lendr account (using session)");
25543
25543
  const thirdPartyIdValue = thirdPartyId ?? 0;
25544
25544
  const [accountPublicKey] = PublicKey.findProgramAddressSync([
25545
25545
  Buffer.from("lendr_account"),
25546
25546
  this.groupAddress.toBuffer(),
25547
- session$1.walletPublicKey.toBuffer(),
25547
+ session.walletPublicKey.toBuffer(),
25548
25548
  Buffer.from(new Uint16Array([accountIndex]).buffer),
25549
25549
  Buffer.from(new Uint16Array([thirdPartyIdValue]).buffer)
25550
25550
  ], this.programId);
@@ -25607,9 +25607,9 @@ var LendrClient = class LendrClient {
25607
25607
  }
25608
25608
  return tx;
25609
25609
  }
25610
- async createLendrAccountWithSessionTx(session$1, accountIndex, thirdPartyId) {
25611
- const ixs = await this.makeCreateLendrAccountWithSessionIx(session$1, accountIndex, thirdPartyId);
25612
- return this.createVersionTransaction(ixs.instructions, session$1.payer, [...ixs.keys], { type: TransactionType.CREATE_ACCOUNT });
25610
+ async createLendrAccountWithSessionTx(session, accountIndex, thirdPartyId) {
25611
+ const ixs = await this.makeCreateLendrAccountWithSessionIx(session, accountIndex, thirdPartyId);
25612
+ return this.createVersionTransaction(ixs.instructions, session.payer, [...ixs.keys], { type: TransactionType.CREATE_ACCOUNT });
25613
25613
  }
25614
25614
  /**
25615
25615
  * Create transaction instruction to initialize a new group.