@huma-finance/widgets 0.0.48-beta.290 → 0.0.48-beta.291

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
@@ -1,5 +1,5 @@
1
1
  import { JsonRpcProvider } from '@ethersproject/providers';
2
- import { txAtom, useMQ, supportedChainId, sendTxAtom, isTxFailed, getExplorerUrl, openInNewTab, usePoolUnderlyingTokenContract, TxStateType, useMount, decodeLogs, ERC20_ABI, downScale, formatMoney, POOL_NAME, POOL_TYPE, usePoolInfo, useAccountStats, getERC20Contract, usePoolInfoV2, usePoolUnderlyingTokenInfoV2, usePoolSafeAllowanceV2, useAuthErrorHandling, checkIsDev, EAService, EARejectionError, EARejectMessage, EARejectReason, useCLFeeManager, useCLPoolAllowance, usePoolContract, timeUtil, doesChainSupportNotifi, getNotifiDappId, getBlockchainConfigFromChain, CreditState, formatNumber, useCreditContractV2, useCreditStatsV2, CreditStateV2, upScale, toBigNumber, TRANSFER_ABI, FirstLossCoverIndex, useFirstLossCoverContractV2, useFirstLossCoverRequirementV2, useFirstLossCoverAllowanceV2, useFeeManager, combineStyles, isEmpty, useInvoiceNFTContract, useRFPoolAllowance, useLenderDepositRecordV2, useLPConfigV2, useNextEpochStartTimeV2, timestampToLL, getTrancheVaultContractV2, useTrancheVaultContractV2, useCancellableRedemptionInfoV2, useLenderPositionV2, useParamsSearch, IdentityService, CHAINS, configUtil, usePoolAllowance, useLenderApproved, useLenderPosition, useWithdrawlLockoutInSeconds, usePoolUnderlyingTokenBalance, usePoolUnderlyingTokenBalanceV2, useLenderApprovedV2, useLastDepositTime, formatBNFixed, useWithdrawableAssetsV2, useReceivableInfoV2, useReceivableContractV2, CreditEventText, useERC2612Permit, ERC2612_ABI, SuperfluidPoolProcessor_ABI, useMultiSendContract, usePoolUnderlyingToken, hasRFActiveLoan, getWalletAddressAbbr, useFactoring, PoolMap, PoolSubgraphMap, CreditEvent, CURRENCY_CODE, Provider as Provider$1 } from '@huma-finance/shared';
2
+ import { txAtom, useMQ, supportedChainId, sendTxAtom, isTxFailed, getExplorerUrl, openInNewTab, usePoolUnderlyingTokenContract, TxStateType, useMount, decodeLogs, ERC20_ABI, downScale, formatMoney, POOL_NAME, POOL_TYPE, usePoolInfo, useAccountStats, getERC20Contract, usePoolInfoV2, usePoolUnderlyingTokenInfoV2, usePoolSafeAllowanceV2, useAuthErrorHandling, checkIsDev, EAService, EARejectionError, EARejectMessage, EARejectReason, useCLFeeManager, useCLPoolAllowance, usePoolContract, timeUtil, formatNumber, doesChainSupportNotifi, getNotifiDappId, getBlockchainConfigFromChain, CreditState, useCreditContractV2, useCreditStatsV2, CreditStateV2, upScale, toBigNumber, TRANSFER_ABI, FirstLossCoverIndex, useFirstLossCoverContractV2, useFirstLossCoverRequirementV2, useFirstLossCoverAllowanceV2, useFeeManager, combineStyles, isEmpty, useInvoiceNFTContract, useRFPoolAllowance, useLenderDepositRecordV2, useLPConfigV2, useNextEpochStartTimeV2, timestampToLL, getTrancheVaultContractV2, useTrancheVaultContractV2, useCancellableRedemptionInfoV2, useLenderPositionV2, useParamsSearch, IdentityService, CHAINS, configUtil, usePoolAllowance, useLenderApproved, useLenderPosition, useWithdrawlLockoutInSeconds, usePoolUnderlyingTokenBalance, usePoolUnderlyingTokenBalanceV2, useLenderApprovedV2, useLastDepositTime, formatBNFixed, useWithdrawableAssetsV2, useReceivableInfoV2, useReceivableContractV2, CreditEventText, useERC2612Permit, ERC2612_ABI, SuperfluidPoolProcessor_ABI, useMultiSendContract, usePoolUnderlyingToken, hasRFActiveLoan, getWalletAddressAbbr, useFactoring, PoolMap, PoolSubgraphMap, CreditEvent, CURRENCY_CODE, Provider as Provider$1 } from '@huma-finance/shared';
3
3
  import { useTheme, css, Box, Typography, Tooltip, Button, Dialog, Slider, Input, Divider, TextField, FormControl, FormLabel, RadioGroup, FormControlLabel, Radio, Snackbar, Alert, Skeleton, TablePagination, LinearProgress, createTheme, ThemeProvider } from '@mui/material';
4
4
  import { useAtom, Provider as Provider$2 } from 'jotai';
5
5
  import * as React from 'react';
@@ -2597,7 +2597,7 @@ function Success$c(_ref) {
2597
2597
  symbol
2598
2598
  } = poolUnderlyingToken;
2599
2599
  const dueDate = timeUtil.timestampToLL(creditRecord === null || creditRecord === void 0 ? void 0 : creditRecord.dueDate.toNumber());
2600
- const content = ["".concat(borrowAmountNet, " ").concat(symbol, " is now in your wallet."), "Note: your payment will be automatically deducted on ".concat(dueDate, ".")];
2600
+ const content = ["".concat(formatNumber(borrowAmountNet), " ").concat(symbol, " is now in your wallet."), "Note: your payment will be automatically deducted on ".concat(dueDate, ".")];
2601
2601
  return jsx(TxDoneModal, {
2602
2602
  handleAction: handleAction,
2603
2603
  content: content,
@@ -3165,7 +3165,7 @@ function Success$b(_ref) {
3165
3165
  symbol
3166
3166
  } = poolUnderlyingToken;
3167
3167
  const dueDate = timeUtil.timestampToLL(creditRecord === null || creditRecord === void 0 ? void 0 : creditRecord.nextDueDate.toNumber());
3168
- const content = ["".concat(borrowAmountNet, " ").concat(symbol, " is now in your wallet."), "Note: your payment will be automatically deducted on ".concat(dueDate, ".")];
3168
+ const content = ["".concat(formatNumber(borrowAmountNet), " ").concat(symbol, " is now in your wallet."), "Note: your payment will be automatically deducted on ".concat(dueDate, ".")];
3169
3169
  return jsx(TxDoneModal, {
3170
3170
  handleAction: handleAction,
3171
3171
  content: content,
@@ -3385,7 +3385,7 @@ function Success$a(_ref) {
3385
3385
  }
3386
3386
  }
3387
3387
  }, [decimals, txReceipt]);
3388
- const content = ["You successfully paid ".concat(formatMoney(payedAmount), " ").concat(symbol, ".")];
3388
+ const content = ["You successfully paid ".concat(formatNumber(payedAmount), " ").concat(symbol, ".")];
3389
3389
  return jsx(TxDoneModal, {
3390
3390
  handleAction: handleAction,
3391
3391
  content: content
@@ -3588,7 +3588,7 @@ function Success$9(_ref) {
3588
3588
  }
3589
3589
  }
3590
3590
  }, [decimals, txReceipt]);
3591
- const content = ["You successfully paid ".concat(formatMoney(paidAmount), " ").concat(symbol, ".")];
3591
+ const content = ["You successfully paid ".concat(formatNumber(paidAmount), " ").concat(symbol, ".")];
3592
3592
  return jsx(TxDoneModal, {
3593
3593
  handleAction: handleAction,
3594
3594
  content: content
@@ -4069,7 +4069,7 @@ function Success$7(_ref) {
4069
4069
  remainder,
4070
4070
  approval
4071
4071
  } = useAppSelector(selectWidgetState);
4072
- const content = ["".concat(borrowAmountNet, " ").concat(approval === null || approval === void 0 ? void 0 : approval.token.symbol, " is now in your wallet."), "The remaining ".concat(remainder, " ").concat(approval === null || approval === void 0 ? void 0 : approval.token.symbol, " will be sent to your wallet when the invoice is paid.")];
4072
+ const content = ["".concat(formatNumber(borrowAmountNet), " ").concat(approval === null || approval === void 0 ? void 0 : approval.token.symbol, " is now in your wallet."), "The remaining ".concat(remainder, " ").concat(approval === null || approval === void 0 ? void 0 : approval.token.symbol, " will be sent to your wallet when the invoice is paid.")];
4073
4073
  return jsx(TxDoneModal, {
4074
4074
  handleAction: handleAction,
4075
4075
  content: content
@@ -6428,7 +6428,7 @@ function Success$2(_ref) {
6428
6428
  symbol
6429
6429
  } = poolUnderlyingToken;
6430
6430
  const dueDate = timeUtil.timestampToLL(creditRecord === null || creditRecord === void 0 ? void 0 : creditRecord.nextDueDate.toNumber());
6431
- const content = ["".concat(borrowAmountNet, " ").concat(symbol, " is now in your wallet."), "Note: your payment will be automatically deducted on ".concat(dueDate, ".")];
6431
+ const content = ["".concat(formatNumber(borrowAmountNet), " ").concat(symbol, " is now in your wallet."), "Note: your payment will be automatically deducted on ".concat(dueDate, ".")];
6432
6432
  return jsx(TxDoneModal, {
6433
6433
  handleAction: handleAction,
6434
6434
  content: content,
@@ -7090,7 +7090,7 @@ function Success$1(_ref) {
7090
7090
  borrowAmount,
7091
7091
  approval
7092
7092
  } = useAppSelector(selectWidgetState);
7093
- const content = ["".concat(borrowAmount === null || borrowAmount === void 0 ? void 0 : borrowAmount.toFixed(2), " ").concat(approval === null || approval === void 0 ? void 0 : approval.token.symbol, " is now in your wallet.")];
7093
+ const content = ["".concat(formatNumber(borrowAmount), " ").concat(approval === null || approval === void 0 ? void 0 : approval.token.symbol, " is now in your wallet.")];
7094
7094
  return jsx(TxDoneModal, {
7095
7095
  handleAction: handleAction,
7096
7096
  content: content
@@ -8242,8 +8242,8 @@ function Success(_ref) {
8242
8242
  }
8243
8243
  }
8244
8244
  }, [decimals, successTxReceipt]);
8245
- const amoutFormatted = formatMoney(paidAmount);
8246
- const content = paymentType === PaymentType.PaymentWithReceivable ? ["You successfully paid ".concat(amoutFormatted, " ").concat(symbol, ".")] : ["You successfully paid ".concat(amoutFormatted, " ").concat(symbol, " and borrowed ").concat(amoutFormatted, " ").concat(symbol, ".")];
8245
+ const amountFormatted = formatNumber(paidAmount);
8246
+ const content = paymentType === PaymentType.PaymentWithReceivable ? ["You successfully paid ".concat(amountFormatted, " ").concat(symbol, ".")] : ["You successfully paid ".concat(amountFormatted, " ").concat(symbol, " and borrowed ").concat(amountFormatted, " ").concat(symbol, ".")];
8247
8247
  return jsx(TxDoneModal, {
8248
8248
  handleAction: handleAction,
8249
8249
  content: content