@huma-finance/widgets 0.0.62-beta.719 → 0.0.62-beta.722

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.
@@ -8726,6 +8726,7 @@ function SolanaViewOnExplorer(_ref) {
8726
8726
  });
8727
8727
  }
8728
8728
 
8729
+ /* eslint-disable no-await-in-loop */
8729
8730
  function SolanaTxSendModal(_ref) {
8730
8731
  let {
8731
8732
  chainId,
@@ -8746,18 +8747,28 @@ function SolanaTxSendModal(_ref) {
8746
8747
  return;
8747
8748
  }
8748
8749
  try {
8749
- const latestBlockHash = await connection.getLatestBlockhash();
8750
8750
  const signature = await sendTransaction(tx, connection);
8751
8751
  setSignature(signature);
8752
8752
  dispatch(setSolanaSignature(signature));
8753
- await connection.confirmTransaction({
8754
- blockhash: latestBlockHash.blockhash,
8755
- lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8756
- signature
8757
- });
8758
- handleSuccess({
8759
- signature
8760
- });
8753
+ let transactionConfirmed = false;
8754
+ for (let i = 0; i < 30; i += 1) {
8755
+ var _result$value;
8756
+ shared.timeUtil.sleep(1000);
8757
+ const result = await connection.getSignatureStatus(signature);
8758
+ if (result !== null && result !== void 0 && (_result$value = result.value) !== null && _result$value !== void 0 && _result$value.confirmations) {
8759
+ transactionConfirmed = true;
8760
+ break;
8761
+ }
8762
+ }
8763
+ if (transactionConfirmed) {
8764
+ handleSuccess({
8765
+ signature
8766
+ });
8767
+ } else {
8768
+ dispatch(setError({
8769
+ errorMessage: 'Transaction failed to confirm in time'
8770
+ }));
8771
+ }
8761
8772
  } catch (error) {
8762
8773
  const err = error;
8763
8774
  dispatch(setError({
@@ -10235,8 +10246,10 @@ function ApproveAllowance(_ref) {
10235
10246
  iconWrapper: material.css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n margin-top: ", ";\n & > img {\n width: 220px;\n }\n "])), theme.cssMixins.rowCentered, theme.spacing(6)),
10236
10247
  description: material.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-top: ", ";\n font-weight: 400;\n font-size: 16px;\n color: ", ";\n padding: ", ";\n "])), theme.spacing(4), theme.palette.text.secondary, theme.spacing(0, 1))
10237
10248
  };
10238
- const lockupEndTime = dayjs__default["default"]().add((_poolState$withdrawal = poolState.withdrawalLockupPeriodDays) !== null && _poolState$withdrawal !== void 0 ? _poolState$withdrawal : 0, 'day').date(1);
10239
- const withdrawTime = lockupEndTime.add(1, 'month');
10249
+ const {
10250
+ lockupEndTimeUnix,
10251
+ withdrawTimeUnix
10252
+ } = webShared.getLenderLockupDates((_poolState$withdrawal = poolState.withdrawalLockupPeriodDays) !== null && _poolState$withdrawal !== void 0 ? _poolState$withdrawal : 0);
10240
10253
  return jsxRuntime.jsxs(WrapperModal, {
10241
10254
  title: "Auto-Redemption",
10242
10255
  children: [jsxRuntime.jsx(material.Box, {
@@ -10247,7 +10260,7 @@ function ApproveAllowance(_ref) {
10247
10260
  })
10248
10261
  }), jsxRuntime.jsxs(material.Box, {
10249
10262
  css: styles.description,
10250
- children: ["This allowance transaction will enable auto-redemption for your existing tranche shares. Redemption requests will be automatically submitted on", ' ', shared.timeUtil.timestampToLL(lockupEndTime.unix()), ". Your deposit can be redeemed and yield rewards will stop on", ' ', shared.timeUtil.timestampToLL(withdrawTime.unix()), "."]
10263
+ children: ["This allowance transaction will enable auto-redemption for your existing tranche shares. Redemption requests will be automatically submitted on", ' ', shared.timeUtil.timestampToLL(lockupEndTimeUnix), ". Your deposit can be redeemed and yield rewards will stop on", ' ', shared.timeUtil.timestampToLL(withdrawTimeUnix), "."]
10251
10264
  }), jsxRuntime.jsx(BottomButton, {
10252
10265
  variant: "contained",
10253
10266
  onClick: handleNext,