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

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.393+9ca76ed",
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.393+9ca76ed",
34
+ "@huma-finance/shared": "^0.0.51-beta.393+9ca76ed",
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": "9ca76ed4e8bd517901b7f8e0016e216ff0b6db47"
197
197
  }
@@ -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))