@huma-finance/widgets 0.0.62-beta.716 → 0.0.62-beta.718
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
|
@@ -3,7 +3,7 @@ import { useTheme, css, Box, Typography, Tooltip, Button, Dialog, Slider, Input,
|
|
|
3
3
|
import { useAtom, Provider as Provider$1 } from 'jotai';
|
|
4
4
|
import React, { useCallback, useState, useEffect, useMemo, useRef } from 'react';
|
|
5
5
|
import { useSelector, useDispatch, Provider } from 'react-redux';
|
|
6
|
-
import { supportedChainId, isTxFailed, getExplorerUrl, openInNewTab, TxStateType, decodeLogs, ERC20_ABI, downScale, formatMoney, POOL_NAME, POOL_TYPE, getERC20Contract, checkIsDev, EAService, EARejectionError, EARejectMessage, EARejectReason, timeUtil, formatNumber, doesChainSupportNotifi, CreditState, isEmpty, CreditStateV2, upScale, toBigNumber, TRANSFER_ABI, FirstLossCoverIndex, combineStyles, timestampToLL, getTrancheAssetsAndShares, IdentityService, CHAINS, configUtil, IdentityServiceV2, IdentityVerificationStatusV2, CampaignService, CAMPAIGN_REFERENCE_CODE, KYC_PROVIDER, CHAIN_TYPE, formatAmount, getTrancheVaultContractV2, getTrancheRedemptionStatusV2, getPoolContractV2, CURRENCY_CODE, SuperfluidPoolProcessor_ABI, PoolMap, SOLANA_CHAIN_INFO, SolanaTokenUtils, getSolanaExplorerUrl,
|
|
6
|
+
import { supportedChainId, isTxFailed, getExplorerUrl, openInNewTab, TxStateType, decodeLogs, ERC20_ABI, downScale, formatMoney, POOL_NAME, POOL_TYPE, getERC20Contract, checkIsDev, EAService, EARejectionError, EARejectMessage, EARejectReason, timeUtil, formatNumber, doesChainSupportNotifi, CreditState, isEmpty, CreditStateV2, upScale, toBigNumber, TRANSFER_ABI, FirstLossCoverIndex, combineStyles, timestampToLL, getTrancheAssetsAndShares, IdentityService, CHAINS, configUtil, IdentityServiceV2, IdentityVerificationStatusV2, CampaignService, CAMPAIGN_REFERENCE_CODE, KYC_PROVIDER, CHAIN_TYPE, formatAmount, getTrancheVaultContractV2, getTrancheRedemptionStatusV2, getPoolContractV2, CURRENCY_CODE, SuperfluidPoolProcessor_ABI, PoolMap, SOLANA_CHAIN_INFO, SolanaTokenUtils, getSolanaExplorerUrl, getTokenAccounts, convertToShares, getSentinelAddress, getCreditAccounts, ChainEnum, getBlockchainConfigFromChain } from '@huma-finance/shared';
|
|
7
7
|
import { useWeb3React } from '@web3-react/core';
|
|
8
8
|
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
|
|
9
9
|
import { txAtom, useMQ, sendTxAtom, usePoolUnderlyingTokenContract, useMount, usePoolInfo, useAccountStats, usePoolInfoV2, usePoolUnderlyingTokenInfoV2, usePoolSafeAllowanceV2, useAuthErrorHandling, useCLFeeManager, useCLPoolAllowance, usePoolContract, useCreditContractV2, useCreditStatsV2, useFirstLossCoverContractV2, useFirstLossCoverRequirementV2, useFirstLossCoverAllowanceV2, useFeeManager, useInvoiceNFTContract, useRFPoolAllowance, useLenderDepositRecordV2, useLPConfigV2, useNextEpochStartTimeV2, useTrancheVaultContractV2, useCancellableRedemptionInfoV2, useParamsSearch, usePoolAllowance, useLenderApproved, useLenderPosition, useWithdrawlLockoutInSeconds, usePoolUnderlyingTokenBalance, useChainInfo, usePoolUnderlyingTokenBalanceV2, useLenderApprovedV2, useTrancheVaultAssetsV2, useLastDepositTime, usePoolBalance, useReceivableInfoV2, useReceivableContractV2, useERC2612Permit, useMultiSendContract, useFactoring, useLenderAccounts, useHumaProgram, useTokenAccount, useTrancheMintAccounts, useTrancheTokenAccounts, useBorrowerAccounts } from '@huma-finance/web-shared';
|
|
@@ -8772,7 +8772,6 @@ function Transfer$4(_ref) {
|
|
|
8772
8772
|
const {
|
|
8773
8773
|
publicKey
|
|
8774
8774
|
} = useWallet();
|
|
8775
|
-
const sentinel = getSentinelAddress(poolInfo.chainId);
|
|
8776
8775
|
const {
|
|
8777
8776
|
supplyAmount
|
|
8778
8777
|
} = useAppSelector(selectWidgetState);
|
|
@@ -8843,7 +8842,7 @@ function Transfer$4(_ref) {
|
|
|
8843
8842
|
|
|
8844
8843
|
// Approve automatic redemptions
|
|
8845
8844
|
const sharesAmount = convertToShares(selectedTranche === 'senior' ? new BN((_poolState$seniorTran = poolState.seniorTrancheAssets) !== null && _poolState$seniorTran !== void 0 ? _poolState$seniorTran : 0) : new BN((_poolState$juniorTran = poolState.juniorTrancheAssets) !== null && _poolState$juniorTran !== void 0 ? _poolState$juniorTran : 0), selectedTranche === 'senior' ? seniorTrancheMintSupply !== null && seniorTrancheMintSupply !== void 0 ? seniorTrancheMintSupply : new BN(0) : juniorTrancheMintSupply !== null && juniorTrancheMintSupply !== void 0 ? juniorTrancheMintSupply : new BN(0), supplyBigNumber);
|
|
8846
|
-
tx.add(createApproveCheckedInstruction(selectedTranche === 'senior' ? seniorTrancheATA : juniorTrancheATA, new PublicKey(selectedTranche === 'senior' ? poolInfo.seniorTrancheMint : poolInfo.juniorTrancheMint), new PublicKey(
|
|
8845
|
+
tx.add(createApproveCheckedInstruction(selectedTranche === 'senior' ? seniorTrancheATA : juniorTrancheATA, new PublicKey(selectedTranche === 'senior' ? poolInfo.seniorTrancheMint : poolInfo.juniorTrancheMint), new PublicKey(poolInfo.poolAuthority),
|
|
8847
8846
|
// delegate
|
|
8848
8847
|
publicKey,
|
|
8849
8848
|
// owner of the wallet
|
|
@@ -8855,7 +8854,7 @@ function Transfer$4(_ref) {
|
|
|
8855
8854
|
setTransaction(tx);
|
|
8856
8855
|
}
|
|
8857
8856
|
getTx();
|
|
8858
|
-
}, [isLoadingLenderAccounts, juniorLenderApprovedAccountPDA, juniorLenderStateAccount, juniorTrancheMintSupply, poolInfo, poolState.juniorTrancheAssets, poolState.seniorTrancheAssets, program.methods, publicKey, selectedTranche, seniorLenderApprovedAccountPDA, seniorLenderStateAccount, seniorTrancheMintSupply,
|
|
8857
|
+
}, [isLoadingLenderAccounts, juniorLenderApprovedAccountPDA, juniorLenderStateAccount, juniorTrancheMintSupply, poolInfo, poolState.juniorTrancheAssets, poolState.seniorTrancheAssets, program.methods, publicKey, selectedTranche, seniorLenderApprovedAccountPDA, seniorLenderStateAccount, seniorTrancheMintSupply, supplyBigNumber, transaction]);
|
|
8859
8858
|
if (isLoadingLenderAccounts) {
|
|
8860
8859
|
return jsx(LoadingModal, {
|
|
8861
8860
|
title: "Supply"
|