@huma-finance/widgets 0.0.72-beta.895 → 0.0.72-beta.901

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
@@ -6,7 +6,7 @@ import { useSelector, useDispatch, Provider } from 'react-redux';
6
6
  import { openInNewTab, supportedChainId, isTxFailed, getExplorerUrl, 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, SolanaTokenUtils, getSolanaExplorerUrl, sleep, getSentinelAddress, getTokenAccounts, getCreditAccounts, FirstLossCoverIndex, combineStyles, timestampToLL, getTrancheAssetsAndShares, IdentityServiceV2, IdentityVerificationStatusV2, CHAIN_TYPE, COMMON_ERROR_MESSAGE, SOLANA_TRANSACTION_EXPIRED_BLOCKHEIGHT_EXCEEDED_ERROR, SOLANA_CHAIN_INFO, getSolanaNetworkType, CampaignService, convertToShares, formatMoneyFixed, formatNumberFixed, tokenDecimalUtils, STELLAR_CHAINS_INFO, getStellarExplorerUrl, IdentityService, CHAINS, configUtil, KYC_PROVIDER, getEvmNetworkType, formatAmount, getTrancheVaultContractV2, getTrancheRedemptionStatusV2, getPoolContractV2, ChainEnum, getBlockchainConfigFromChain, CURRENCY_CODE, SuperfluidPoolProcessor_ABI, PoolMap } from '@huma-finance/shared';
7
7
  import { useWeb3React } from '@web3-react/core';
8
8
  import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
9
- import { txAtom, useMQ, sendTxAtom, usePoolUnderlyingTokenContract, useMount, usePoolInfo, useAccountStats, usePoolInfoV2, usePoolUnderlyingTokenInfoV2, usePoolSafeAllowanceV2, useAuthErrorHandling, useCLFeeManager, useCLPoolAllowance, usePoolContract, useCreditContractV2, useCreditStatsV2, useForceRefresh, useHumaProgram, useBorrowerAccounts, useFirstLossCoverContractV2, useFirstLossCoverRequirementV2, useFirstLossCoverAllowanceV2, useFeeManager, useInvoiceNFTContract, useRFPoolAllowance, useLenderDepositRecordV2, useLPConfigV2, useNextEpochStartTimeV2, useTrancheVaultContractV2, useCancellableRedemptionInfoV2, useTrancheMintAccounts, useTrancheTokenAccounts, useLenderAccounts, notEnabledAutoRedeem, getLenderLockupDates, useChainInfo, useTokenAccount, StellarConnectionContext, getClientCommonParams, useStellarLender, useStellarTokenBalance, useParamsSearch, usePoolAllowance, useLenderApproved, useLenderPosition, useWithdrawlLockoutInSeconds, usePoolUnderlyingTokenBalance, usePoolUnderlyingTokenBalanceV2, useLenderApprovedV2, useTrancheVaultAssetsV2, useLastDepositTime, usePoolBalance, useReceivableInfoV2, useReceivableContractV2, useERC2612Permit, useMultiSendContract, useFactoring } from '@huma-finance/web-shared';
9
+ import { txAtom, useMQ, sendTxAtom, usePoolUnderlyingTokenContract, useMount, usePoolInfo, useAccountStats, usePoolInfoV2, usePoolUnderlyingTokenInfoV2, usePoolSafeAllowanceV2, useAuthErrorHandling, useCLFeeManager, useCLPoolAllowance, usePoolContract, useCreditContractV2, useCreditStatsV2, useForceRefresh, useHumaProgram, useBorrowerAccounts, useFirstLossCoverContractV2, useFirstLossCoverRequirementV2, useFirstLossCoverAllowanceV2, useFeeManager, useInvoiceNFTContract, useRFPoolAllowance, useLenderDepositRecordV2, useLPConfigV2, useNextEpochStartTimeV2, useTrancheVaultContractV2, useCancellableRedemptionInfoV2, useTrancheMintAccounts, useTrancheTokenAccounts, useLenderAccounts, notEnabledAutoRedeem, getLenderLockupDates, AUTH_ERROR_TYPE, useChainInfo, useTokenAccount, StellarConnectionContext, getClientCommonParams, useStellarLender, useStellarTokenBalance, useParamsSearch, usePoolAllowance, useLenderApproved, useLenderPosition, useWithdrawlLockoutInSeconds, usePoolUnderlyingTokenBalance, usePoolUnderlyingTokenBalanceV2, useLenderApprovedV2, useTrancheVaultAssetsV2, useLastDepositTime, usePoolBalance, useReceivableInfoV2, useReceivableContractV2, useERC2612Permit, useMultiSendContract, useFactoring } from '@huma-finance/web-shared';
10
10
  import { useResetAtom } from 'jotai/utils';
11
11
  import { createSlice, configureStore } from '@reduxjs/toolkit';
12
12
  import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
@@ -2224,7 +2224,7 @@ const useEA = () => {
2224
2224
  const {
2225
2225
  isWalletOwnershipVerificationRequired,
2226
2226
  isWalletOwnershipVerified,
2227
- setError: setAuthError
2227
+ setAuthError
2228
2228
  } = useAuthErrorHandling(checkIsDev());
2229
2229
  const checkingEA = useCallback(async (payload, nextStep) => {
2230
2230
  try {
@@ -6320,8 +6320,8 @@ function PersonaEvaluation(_ref) {
6320
6320
  const isDev = checkIsDev();
6321
6321
  const dispatch = useAppDispatch();
6322
6322
  const {
6323
- errorType,
6324
- setError: setAuthError,
6323
+ authErrorType,
6324
+ setAuthError,
6325
6325
  isWalletOwnershipVerified,
6326
6326
  isWalletOwnershipVerificationRequired
6327
6327
  } = useAuthErrorHandling(isDev, chainType);
@@ -6447,19 +6447,19 @@ function PersonaEvaluation(_ref) {
6447
6447
  return () => clearInterval(interval);
6448
6448
  }, [checkVerificationStatus, verificationStatus === null || verificationStatus === void 0 ? void 0 : verificationStatus.status]);
6449
6449
  useEffect(() => {
6450
- if (errorType === 'NotSignedIn') {
6450
+ if (authErrorType === AUTH_ERROR_TYPE.NotSignedIn) {
6451
6451
  setLoadingType(undefined);
6452
6452
  setKYCCopy(KYCCopies.signInRequired);
6453
- } else if (errorType === 'UserRejected') {
6453
+ } else if (authErrorType === AUTH_ERROR_TYPE.UserRejected) {
6454
6454
  dispatch(setError({
6455
6455
  errorMessage: 'User has rejected the transaction.'
6456
6456
  }));
6457
- } else if (errorType === 'Other') {
6457
+ } else if (authErrorType === AUTH_ERROR_TYPE.Other) {
6458
6458
  dispatch(setError({
6459
6459
  errorMessage: 'Something went wrong. Please try again later.'
6460
6460
  }));
6461
6461
  }
6462
- }, [KYCCopies.signInRequired, dispatch, errorType]);
6462
+ }, [KYCCopies.signInRequired, dispatch, authErrorType]);
6463
6463
  useEffect(() => {
6464
6464
  const modalElement = document.getElementById('huma-modal');
6465
6465
  if (modalElement) {
@@ -7942,8 +7942,8 @@ function EvaluationKYC(_ref) {
7942
7942
  } = useParamsSearch();
7943
7943
  const {
7944
7944
  isWalletOwnershipVerified,
7945
- setError: setAuthError,
7946
- error: authError
7945
+ setAuthError,
7946
+ authError
7947
7947
  } = useAuthErrorHandling(isDev);
7948
7948
  const [loadingType, setLoadingType] = useState();
7949
7949
  const [kycCopy, setKYCCopy] = useState(JiaPoolCopies.verifyIdentity);
@@ -8486,8 +8486,8 @@ function SecuritizeEvaluation(_ref) {
8486
8486
  } = useParamsSearch();
8487
8487
  const {
8488
8488
  isWalletOwnershipVerified,
8489
- setError: setAuthError,
8490
- error: authError
8489
+ setAuthError,
8490
+ authError
8491
8491
  } = useAuthErrorHandling(isDev);
8492
8492
  const [loadingType, setLoadingType] = useState();
8493
8493
  const KYCCopies = poolInfo.KYC.Securitize;