@huma-finance/widgets 0.0.51-beta.387 → 0.0.51-beta.394

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huma-finance/widgets",
3
- "version": "0.0.51-beta.387+54d1176",
3
+ "version": "0.0.51-beta.394+a9ecca8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,8 +30,8 @@
30
30
  "@ethersproject/experimental": "^5.7.0",
31
31
  "@ethersproject/providers": "^5.6.0",
32
32
  "@ethersproject/units": "^5.6.0",
33
- "@huma-finance/sdk": "^0.0.51-beta.387+54d1176",
34
- "@huma-finance/shared": "^0.0.51-beta.387+54d1176",
33
+ "@huma-finance/sdk": "^0.0.51-beta.394+a9ecca8",
34
+ "@huma-finance/shared": "^0.0.51-beta.394+a9ecca8",
35
35
  "@mui/icons-material": "^5.3.0",
36
36
  "@mui/material": "^5.0.6",
37
37
  "@mui/styles": "^5.0.2",
@@ -193,5 +193,5 @@
193
193
  "optionalDependencies": {
194
194
  "encoding": "^0.1.13"
195
195
  },
196
- "gitHead": "54d11768cfe919b7011e3b8302cad8f8a006ad12"
196
+ "gitHead": "a9ecca8548a06abb382e3e1a3ed4cad06b9911e0"
197
197
  }
@@ -1,4 +1,4 @@
1
- import { UnderlyingTokenInfo } from '@huma-finance/shared'
1
+ import { formatNumber, UnderlyingTokenInfo } from '@huma-finance/shared'
2
2
  import { ethers } from 'ethers'
3
3
  import React from 'react'
4
4
 
@@ -22,7 +22,9 @@ export function Done({
22
22
  )
23
23
 
24
24
  const content = [
25
- `You successfully canceled ${shares} shares redemption request.`,
25
+ `Your request to cancel the redemption of ${formatNumber(
26
+ shares,
27
+ )} shares has been successfully processed.`,
26
28
  ]
27
29
 
28
30
  return <TxDoneModal handleAction={handleAction} content={content} />
@@ -1,10 +1,5 @@
1
1
  import { BigNumber } from 'ethers'
2
- import {
3
- PoolInfoType,
4
- timeUtil,
5
- toBigNumber,
6
- upScale,
7
- } from '@huma-finance/shared'
2
+ import { PoolInfoType, timeUtil, upScale } from '@huma-finance/shared'
8
3
  import React, { useCallback, useState } from 'react'
9
4
 
10
5
  import { useAppDispatch } from '../../../hooks/useRedux'
@@ -30,8 +25,11 @@ export function ChooseAmount({
30
25
  const { poolUnderlyingToken } = poolInfo
31
26
  const { symbol, decimals } = poolUnderlyingToken
32
27
  const [currentAmount, setCurrentAmount] = useState(0)
33
- const depositAmount = upScale<number>(currentAmount, decimals)
34
- const needApprove = toBigNumber(depositAmount).gt(allowance)
28
+ const depositAmount = upScale<BigNumber>(
29
+ BigNumber.from(currentAmount),
30
+ decimals,
31
+ )
32
+ const needApprove = depositAmount.gt(allowance)
35
33
  const withdrawlLockoutDays = timeUtil.secondsToDays(withdrawlLockoutSeconds)
36
34
 
37
35
  const handleChangeAmount = useCallback(
@@ -1,6 +1,7 @@
1
- import { PoolInfoType, toBigNumber, upScale } from '@huma-finance/shared'
1
+ import { PoolInfoType, upScale } from '@huma-finance/shared'
2
2
  import React, { useCallback } from 'react'
3
3
 
4
+ import { BigNumber } from 'ethers'
4
5
  import { useAppDispatch, useAppSelector } from '../../../hooks/useRedux'
5
6
  import { setStep } from '../../../store/widgets.reducers'
6
7
  import { selectWidgetState } from '../../../store/widgets.selectors'
@@ -15,7 +16,10 @@ export function Transfer({ poolInfo }: Props): React.ReactElement {
15
16
  const dispatch = useAppDispatch()
16
17
  const { supplyAmount } = useAppSelector(selectWidgetState)
17
18
  const { decimals } = poolInfo.poolUnderlyingToken
18
- const supplyBigNumber = toBigNumber(upScale(supplyAmount!, decimals))
19
+ const supplyBigNumber = upScale<BigNumber>(
20
+ BigNumber.from(supplyAmount!),
21
+ decimals,
22
+ )
19
23
 
20
24
  const handleSuccess = useCallback(() => {
21
25
  dispatch(setStep(WIDGET_STEP.Done))
@@ -92,10 +92,12 @@ export function LendSupplyV2({
92
92
 
93
93
  if (poolInfo.supplyLink) {
94
94
  openInNewTab(poolInfo.supplyLink)
95
+ handleClose()
95
96
  }
96
97
  }
97
98
  }, [
98
99
  dispatch,
100
+ handleClose,
99
101
  lenderApproveStatusFetched,
100
102
  lenderApprovedJunior,
101
103
  lenderApprovedSenior,