@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.
package/dist/index.js CHANGED
@@ -8709,6 +8709,7 @@ function SolanaViewOnExplorer(_ref) {
8709
8709
  });
8710
8710
  }
8711
8711
 
8712
+ /* eslint-disable no-await-in-loop */
8712
8713
  function SolanaTxSendModal(_ref) {
8713
8714
  let {
8714
8715
  chainId,
@@ -8729,18 +8730,28 @@ function SolanaTxSendModal(_ref) {
8729
8730
  return;
8730
8731
  }
8731
8732
  try {
8732
- const latestBlockHash = await connection.getLatestBlockhash();
8733
8733
  const signature = await sendTransaction(tx, connection);
8734
8734
  setSignature(signature);
8735
8735
  dispatch(setSolanaSignature(signature));
8736
- await connection.confirmTransaction({
8737
- blockhash: latestBlockHash.blockhash,
8738
- lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
8739
- signature
8740
- });
8741
- handleSuccess({
8742
- signature
8743
- });
8736
+ let transactionConfirmed = false;
8737
+ for (let i = 0; i < 30; i += 1) {
8738
+ var _result$value;
8739
+ timeUtil.sleep(1000);
8740
+ const result = await connection.getSignatureStatus(signature);
8741
+ if (result !== null && result !== void 0 && (_result$value = result.value) !== null && _result$value !== void 0 && _result$value.confirmations) {
8742
+ transactionConfirmed = true;
8743
+ break;
8744
+ }
8745
+ }
8746
+ if (transactionConfirmed) {
8747
+ handleSuccess({
8748
+ signature
8749
+ });
8750
+ } else {
8751
+ dispatch(setError({
8752
+ errorMessage: 'Transaction failed to confirm in time'
8753
+ }));
8754
+ }
8744
8755
  } catch (error) {
8745
8756
  const err = error;
8746
8757
  dispatch(setError({
@@ -10218,8 +10229,10 @@ function ApproveAllowance(_ref) {
10218
10229
  iconWrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n margin-top: ", ";\n & > img {\n width: 220px;\n }\n "])), theme.cssMixins.rowCentered, theme.spacing(6)),
10219
10230
  description: 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))
10220
10231
  };
10221
- const lockupEndTime = dayjs().add((_poolState$withdrawal = poolState.withdrawalLockupPeriodDays) !== null && _poolState$withdrawal !== void 0 ? _poolState$withdrawal : 0, 'day').date(1);
10222
- const withdrawTime = lockupEndTime.add(1, 'month');
10232
+ const {
10233
+ lockupEndTimeUnix,
10234
+ withdrawTimeUnix
10235
+ } = getLenderLockupDates((_poolState$withdrawal = poolState.withdrawalLockupPeriodDays) !== null && _poolState$withdrawal !== void 0 ? _poolState$withdrawal : 0);
10223
10236
  return jsxs(WrapperModal, {
10224
10237
  title: "Auto-Redemption",
10225
10238
  children: [jsx(Box, {
@@ -10230,7 +10243,7 @@ function ApproveAllowance(_ref) {
10230
10243
  })
10231
10244
  }), jsxs(Box, {
10232
10245
  css: styles.description,
10233
- children: ["This allowance transaction will enable auto-redemption for your existing tranche shares. Redemption requests will be automatically submitted on", ' ', timeUtil.timestampToLL(lockupEndTime.unix()), ". Your deposit can be redeemed and yield rewards will stop on", ' ', timeUtil.timestampToLL(withdrawTime.unix()), "."]
10246
+ children: ["This allowance transaction will enable auto-redemption for your existing tranche shares. Redemption requests will be automatically submitted on", ' ', timeUtil.timestampToLL(lockupEndTimeUnix), ". Your deposit can be redeemed and yield rewards will stop on", ' ', timeUtil.timestampToLL(withdrawTimeUnix), "."]
10234
10247
  }), jsx(BottomButton, {
10235
10248
  variant: "contained",
10236
10249
  onClick: handleNext,