@huma-finance/widgets 0.0.63-beta.757 → 0.0.63

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
@@ -27,7 +27,7 @@ import { drawdownWithReceivable, HumaContext, HumaReceivableFactory, makePayment
27
27
  import moment from 'moment';
28
28
  import { getAddress } from '@ethersproject/address';
29
29
  import { BN } from '@coral-xyz/anchor';
30
- import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, createApproveCheckedInstruction, getAccount, TokenAccountNotFoundError, TokenInvalidAccountOwnerError, createAssociatedTokenAccountInstruction, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
30
+ import { TOKEN_2022_PROGRAM_ID, createApproveCheckedInstruction, TOKEN_PROGRAM_ID, getAccount, TokenAccountNotFoundError, TokenInvalidAccountOwnerError, createAssociatedTokenAccountInstruction, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
31
31
  import { useWallet, useConnection } from '@solana/wallet-adapter-react';
32
32
  import { Transaction, PublicKey } from '@solana/web3.js';
33
33
  import { arrayify } from '@ethersproject/bytes';
@@ -8954,19 +8954,6 @@ function Transfer$6(_ref) {
8954
8954
  }).transaction();
8955
8955
  tx.add(createLenderAccountsTx);
8956
8956
  }
8957
- const depositTx = await program.methods.deposit(supplyBigNumber).accountsPartial({
8958
- approvedLender,
8959
- depositor: publicKey,
8960
- poolConfig: poolInfo.poolConfig,
8961
- underlyingMint: poolInfo.underlyingMint.address,
8962
- trancheMint: selectedTranche === 'senior' ? poolInfo.seniorTrancheMint : poolInfo.juniorTrancheMint,
8963
- poolUnderlyingToken: poolInfo.poolUnderlyingTokenAccount,
8964
- depositorUnderlyingToken: underlyingTokenATA,
8965
- depositorTrancheToken: selectedTranche === 'senior' ? seniorTrancheATA : juniorTrancheATA,
8966
- humaConfig: poolInfo.humaConfig,
8967
- underlyingTokenProgram: TOKEN_PROGRAM_ID
8968
- }).transaction();
8969
- tx.add(depositTx);
8970
8957
 
8971
8958
  // Approve automatic redemptions
8972
8959
  const sharesAmount = convertToShares(selectedTranche === 'senior' ? BigInt((_poolState$seniorTran = poolState.seniorTrancheAssets) !== null && _poolState$seniorTran !== void 0 ? _poolState$seniorTran : 0) : BigInt((_poolState$juniorTran = poolState.juniorTrancheAssets) !== null && _poolState$juniorTran !== void 0 ? _poolState$juniorTran : 0), selectedTranche === 'senior' ? BigInt((_seniorTrancheMintSup = seniorTrancheMintSupply === null || seniorTrancheMintSupply === void 0 ? void 0 : seniorTrancheMintSupply.toString()) !== null && _seniorTrancheMintSup !== void 0 ? _seniorTrancheMintSup : 0) : BigInt((_juniorTrancheMintSup = juniorTrancheMintSupply === null || juniorTrancheMintSupply === void 0 ? void 0 : juniorTrancheMintSupply.toString()) !== null && _juniorTrancheMintSup !== void 0 ? _juniorTrancheMintSup : 0), BigInt(supplyBigNumber.toString()));
@@ -8980,6 +8967,19 @@ function Transfer$6(_ref) {
8980
8967
  poolInfo.trancheDecimals, undefined,
8981
8968
  // multiSigners
8982
8969
  TOKEN_2022_PROGRAM_ID));
8970
+ const depositTx = await program.methods.deposit(supplyBigNumber).accountsPartial({
8971
+ approvedLender,
8972
+ depositor: publicKey,
8973
+ poolConfig: poolInfo.poolConfig,
8974
+ underlyingMint: poolInfo.underlyingMint.address,
8975
+ trancheMint: selectedTranche === 'senior' ? poolInfo.seniorTrancheMint : poolInfo.juniorTrancheMint,
8976
+ poolUnderlyingToken: poolInfo.poolUnderlyingTokenAccount,
8977
+ depositorUnderlyingToken: underlyingTokenATA,
8978
+ depositorTrancheToken: selectedTranche === 'senior' ? seniorTrancheATA : juniorTrancheATA,
8979
+ humaConfig: poolInfo.humaConfig,
8980
+ underlyingTokenProgram: TOKEN_PROGRAM_ID
8981
+ }).transaction();
8982
+ tx.add(depositTx);
8983
8983
  setTransaction(tx);
8984
8984
  }
8985
8985
  getTx();
@@ -9411,8 +9411,8 @@ function Transfer$5(_ref) {
9411
9411
  poolSeniorTrancheATA,
9412
9412
  poolJuniorTrancheATA
9413
9413
  } = getTokenAccounts(poolInfo, publicKey);
9414
- const tx = await program.methods.addRedemptionRequest(redeemBN).accountsPartial({
9415
- lender: publicKey,
9414
+ const tx = await program.methods.addRedemptionRequest(publicKey, redeemBN).accountsPartial({
9415
+ signer: publicKey,
9416
9416
  humaConfig: poolInfo.humaConfig,
9417
9417
  poolConfig: poolInfo.poolConfig,
9418
9418
  trancheMint: selectedTranche === 'senior' ? poolInfo.seniorTrancheMint : poolInfo.juniorTrancheMint,