@huma-finance/widgets 0.0.59-beta.513 → 0.0.59-beta.520

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.
Files changed (76) hide show
  1. package/dist/cjs/index.cjs +135 -134
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/index.js +4 -3
  4. package/dist/index.js.map +1 -1
  5. package/package.json +5 -4
  6. package/src/components/Activity.tsx +1 -1
  7. package/src/components/ApproveAllowanceModal.tsx +2 -3
  8. package/src/components/ApproveAllowanceModalV2.tsx +1 -3
  9. package/src/components/ChooseAmountModal.tsx +1 -1
  10. package/src/components/CreditLine/approve/2-Success.tsx +1 -1
  11. package/src/components/CreditLine/approve/index.tsx +2 -6
  12. package/src/components/CreditLine/autoPaybackV2/index.tsx +2 -2
  13. package/src/components/CreditLine/borrow/2-ChooseAmount.tsx +2 -6
  14. package/src/components/CreditLine/borrow/4-Transfer.tsx +2 -1
  15. package/src/components/CreditLine/borrow/index.tsx +2 -7
  16. package/src/components/CreditLine/borrowV2/1-ChooseAmount.tsx +1 -1
  17. package/src/components/CreditLine/borrowV2/3-Transfer.tsx +2 -1
  18. package/src/components/CreditLine/borrowV2/index.tsx +2 -3
  19. package/src/components/CreditLine/payment/1-ChooseAmount.tsx +2 -6
  20. package/src/components/CreditLine/payment/4-Success.tsx +1 -1
  21. package/src/components/CreditLine/payment/index.tsx +2 -6
  22. package/src/components/CreditLine/paymentV2/1-ChooseAmount.tsx +1 -1
  23. package/src/components/CreditLine/paymentV2/3-Transfer.tsx +1 -1
  24. package/src/components/CreditLine/paymentV2/4-Success.tsx +1 -1
  25. package/src/components/CreditLine/paymentV2/index.tsx +2 -2
  26. package/src/components/CreditLine/supplyFLC/2-Transfer.tsx +2 -5
  27. package/src/components/CreditLine/supplyFLC/index.tsx +2 -3
  28. package/src/components/ErrorModal.tsx +1 -1
  29. package/src/components/Factoring/FactoredList.tsx +1 -2
  30. package/src/components/Factoring/UpcomingList.tsx +1 -1
  31. package/src/components/InvoiceFactoring/borrow/2-ChooseAmount.tsx +2 -1
  32. package/src/components/InvoiceFactoring/borrow/4-ApproveNFT.tsx +2 -3
  33. package/src/components/InvoiceFactoring/borrow/index.tsx +2 -6
  34. package/src/components/InvoiceFactoring/payment/1-ChooseAmount.tsx +1 -1
  35. package/src/components/InvoiceFactoring/payment/index.tsx +2 -6
  36. package/src/components/Lend/addRedemptionV2/2-ChooseAmount.tsx +3 -1
  37. package/src/components/Lend/addRedemptionV2/3-Transfer.tsx +2 -5
  38. package/src/components/Lend/addRedemptionV2/index.tsx +3 -1
  39. package/src/components/Lend/cancelRedemptionV2 /1-Transfer.tsx +2 -5
  40. package/src/components/Lend/cancelRedemptionV2 /index.tsx +2 -3
  41. package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +1 -2
  42. package/src/components/Lend/supply/5-Success.tsx +1 -1
  43. package/src/components/Lend/supply/index.tsx +2 -4
  44. package/src/components/Lend/supplyV2/3-ChooseAmount.tsx +4 -2
  45. package/src/components/Lend/supplyV2/5-Transfer.tsx +1 -1
  46. package/src/components/Lend/supplyV2/6-Success.tsx +2 -2
  47. package/src/components/Lend/supplyV2/8-PointsEarned.tsx +2 -6
  48. package/src/components/Lend/supplyV2/components/PersonaEvaluation.tsx +1 -1
  49. package/src/components/Lend/supplyV2/components/SecuritizeEvaluation.tsx +1 -2
  50. package/src/components/Lend/supplyV2/index.tsx +3 -5
  51. package/src/components/Lend/withdraw/1-CheckWithdrawble.tsx +2 -4
  52. package/src/components/Lend/withdraw/4-Success.tsx +1 -1
  53. package/src/components/Lend/withdraw/index.tsx +2 -3
  54. package/src/components/Lend/withdrawV2/2-Transfer.tsx +2 -5
  55. package/src/components/Lend/withdrawV2/index.tsx +3 -1
  56. package/src/components/Notifi/NotifiSubscriptionModal.tsx +2 -1
  57. package/src/components/ReceivableBackedCreditLine/borrow/1-ChooseAmount.tsx +3 -1
  58. package/src/components/ReceivableBackedCreditLine/borrow/3-ApproveReceivable.tsx +2 -3
  59. package/src/components/ReceivableBackedCreditLine/borrow/index.tsx +2 -3
  60. package/src/components/ReceivableBackedCreditLine/payment/2-ChooseAmount.tsx +1 -1
  61. package/src/components/ReceivableBackedCreditLine/payment/5-ApproveReceivable.tsx +2 -3
  62. package/src/components/ReceivableBackedCreditLine/payment/index.tsx +2 -2
  63. package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +1 -1
  64. package/src/components/StreamFactoring/borrow/5-Permit.tsx +1 -2
  65. package/src/components/StreamFactoring/borrow/6-Transfer.tsx +2 -1
  66. package/src/components/StreamFactoring/borrow/index.tsx +2 -1
  67. package/src/components/StreamFactoring/payment/index.tsx +5 -2
  68. package/src/components/SuperfluidFactoring/index.tsx +1 -1
  69. package/src/components/TxDoneModal.tsx +1 -1
  70. package/src/components/TxSendModal.tsx +2 -7
  71. package/src/components/TxSendModalV2.tsx +2 -1
  72. package/src/components/WidgetWrapper.tsx +2 -1
  73. package/src/components/humaModal/HumaModal.tsx +1 -1
  74. package/src/hooks/useEA.ts +1 -1
  75. package/src/index.tsx +1 -1
  76. package/tsconfig.json +3 -0
@@ -4,9 +4,9 @@ import {
4
4
  downScale,
5
5
  formatMoney,
6
6
  PoolInfoType,
7
- sendTxAtom,
8
7
  TRANSFER_ABI,
9
8
  } from '@huma-finance/shared'
9
+ import { sendTxAtom } from '@huma-finance/web-shared'
10
10
  import { useAtom } from 'jotai'
11
11
  import React, { useEffect, useState } from 'react'
12
12
 
@@ -1,11 +1,10 @@
1
1
  import { useWeb3React } from '@web3-react/core'
2
+ import { POOL_NAME, POOL_TYPE } from '@huma-finance/shared'
2
3
  import {
3
- POOL_NAME,
4
- POOL_TYPE,
5
4
  useLenderPosition,
6
5
  usePoolBalance,
7
6
  usePoolInfo,
8
- } from '@huma-finance/shared'
7
+ } from '@huma-finance/web-shared'
9
8
  import React, { useCallback, useEffect } from 'react'
10
9
  import { useDispatch } from 'react-redux'
11
10
 
@@ -1,8 +1,5 @@
1
- import {
2
- PoolInfoV2,
3
- TrancheType,
4
- useTrancheVaultContractV2,
5
- } from '@huma-finance/shared'
1
+ import { PoolInfoV2, TrancheType } from '@huma-finance/shared'
2
+ import { useTrancheVaultContractV2 } from '@huma-finance/web-shared'
6
3
  import { useWeb3React } from '@web3-react/core'
7
4
  import React, { useCallback } from 'react'
8
5
 
@@ -4,9 +4,11 @@ import {
4
4
  POOL_NAME,
5
5
  TrancheRedemptionStatus,
6
6
  TrancheType,
7
+ } from '@huma-finance/shared'
8
+ import {
7
9
  usePoolInfoV2,
8
10
  usePoolUnderlyingTokenInfoV2,
9
- } from '@huma-finance/shared'
11
+ } from '@huma-finance/web-shared'
10
12
  import { useWeb3React } from '@web3-react/core'
11
13
  import React, { useCallback, useEffect, useState } from 'react'
12
14
  import { useDispatch } from 'react-redux'
@@ -1,4 +1,5 @@
1
- import { getBlockchainConfigFromChain, txAtom } from '@huma-finance/shared'
1
+ import { getBlockchainConfigFromChain } from '@huma-finance/shared'
2
+ import { txAtom } from '@huma-finance/web-shared'
2
3
  import { Box, css, TextField, Typography, useTheme } from '@mui/material'
3
4
  import {
4
5
  BroadcastEventTypeItem,
@@ -2,9 +2,11 @@ import {
2
2
  CreditStatsV2,
3
3
  PoolInfoV2,
4
4
  UnderlyingTokenInfo,
5
+ } from '@huma-finance/shared'
6
+ import {
5
7
  usePoolSafeAllowanceV2,
6
8
  useReceivableInfoV2,
7
- } from '@huma-finance/shared'
9
+ } from '@huma-finance/web-shared'
8
10
  import { useWeb3React } from '@web3-react/core'
9
11
  import { BigNumber, ethers } from 'ethers'
10
12
  import React, { useCallback, useEffect, useState } from 'react'
@@ -1,10 +1,9 @@
1
+ import { PoolInfoV2, TxStateType } from '@huma-finance/shared'
1
2
  import {
2
- PoolInfoV2,
3
3
  sendTxAtom,
4
4
  txAtom,
5
- TxStateType,
6
5
  useReceivableContractV2,
7
- } from '@huma-finance/shared'
6
+ } from '@huma-finance/web-shared'
8
7
  import { useWeb3React } from '@web3-react/core'
9
8
  import { useAtom } from 'jotai'
10
9
  import { useResetAtom } from 'jotai/utils'
@@ -1,10 +1,9 @@
1
+ import { CreditStateV2, POOL_NAME } from '@huma-finance/shared'
1
2
  import {
2
- CreditStateV2,
3
- POOL_NAME,
4
3
  useCreditStatsV2,
5
4
  usePoolInfoV2,
6
5
  usePoolUnderlyingTokenInfoV2,
7
- } from '@huma-finance/shared'
6
+ } from '@huma-finance/web-shared'
8
7
  import { useWeb3React } from '@web3-react/core'
9
8
  import React, { useCallback, useEffect } from 'react'
10
9
  import { useDispatch } from 'react-redux'
@@ -3,8 +3,8 @@ import {
3
3
  toBigNumber,
4
4
  UnderlyingTokenInfo,
5
5
  upScale,
6
- usePoolSafeAllowanceV2,
7
6
  } from '@huma-finance/shared'
7
+ import { usePoolSafeAllowanceV2 } from '@huma-finance/web-shared'
8
8
  import { useWeb3React } from '@web3-react/core'
9
9
  import { BigNumber, ethers } from 'ethers'
10
10
  import React, { useCallback, useState } from 'react'
@@ -1,10 +1,9 @@
1
+ import { PoolInfoV2, TxStateType } from '@huma-finance/shared'
1
2
  import {
2
- PoolInfoV2,
3
3
  sendTxAtom,
4
4
  txAtom,
5
- TxStateType,
6
5
  useReceivableContractV2,
7
- } from '@huma-finance/shared'
6
+ } from '@huma-finance/web-shared'
8
7
  import { useWeb3React } from '@web3-react/core'
9
8
  import { useAtom } from 'jotai'
10
9
  import { useResetAtom } from 'jotai/utils'
@@ -1,10 +1,10 @@
1
+ import { POOL_NAME } from '@huma-finance/shared'
1
2
  import {
2
- POOL_NAME,
3
3
  useCreditStatsV2,
4
4
  usePoolInfoV2,
5
5
  usePoolUnderlyingTokenInfoV2,
6
6
  useReceivableInfoV2,
7
- } from '@huma-finance/shared'
7
+ } from '@huma-finance/web-shared'
8
8
  import { useWeb3React } from '@web3-react/core'
9
9
  import { BigNumber, ethers } from 'ethers'
10
10
  import React, { useEffect, useState } from 'react'
@@ -3,8 +3,8 @@ import {
3
3
  PoolInfoType,
4
4
  toBigNumber,
5
5
  upScale,
6
- useFeeManager,
7
6
  } from '@huma-finance/shared'
7
+ import { useFeeManager } from '@huma-finance/web-shared'
8
8
  import React, { useCallback, useState } from 'react'
9
9
 
10
10
  import { useWeb3React } from '@web3-react/core'
@@ -2,9 +2,8 @@ import {
2
2
  PoolInfoType,
3
3
  SuperfluidPoolProcessor,
4
4
  SuperfluidPoolProcessor_ABI,
5
- useERC2612Permit,
6
- useMount,
7
5
  } from '@huma-finance/shared'
6
+ import { useERC2612Permit, useMount } from '@huma-finance/web-shared'
8
7
  import { BigNumber, Contract, ethers } from 'ethers'
9
8
  import React from 'react'
10
9
  import { useDispatch } from 'react-redux'
@@ -1,4 +1,5 @@
1
- import { PoolInfoType, useMultiSendContract } from '@huma-finance/shared'
1
+ import { PoolInfoType } from '@huma-finance/shared'
2
+ import { useMultiSendContract } from '@huma-finance/web-shared'
2
3
  import React, { useCallback } from 'react'
3
4
 
4
5
  import { useWeb3React } from '@web3-react/core'
@@ -1,5 +1,6 @@
1
1
  import { useWeb3React } from '@web3-react/core'
2
- import { POOL_NAME, POOL_TYPE, usePoolInfo } from '@huma-finance/shared'
2
+ import { POOL_NAME, POOL_TYPE } from '@huma-finance/shared'
3
+ import { usePoolInfo } from '@huma-finance/web-shared'
3
4
  import React, { useEffect } from 'react'
4
5
  import { useDispatch } from 'react-redux'
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { useWeb3React } from '@web3-react/core'
2
- import { PoolInfoType, useAccountStats } from '@huma-finance/shared'
2
+ import { PoolInfoType } from '@huma-finance/shared'
3
+ import { useAccountStats } from '@huma-finance/web-shared'
3
4
  import React, { useEffect } from 'react'
4
5
  import { useDispatch } from 'react-redux'
5
6
 
@@ -27,12 +28,14 @@ export function StreamFactoringPayment({
27
28
  handleSuccess,
28
29
  }: Props): React.ReactElement | null {
29
30
  const dispatch = useDispatch()
30
- const { account } = useWeb3React()
31
+ const { account, chainId, provider } = useWeb3React()
31
32
  const { step, errorMessage } = useAppSelector(selectWidgetState)
32
33
  const [{ creditRecord }] = useAccountStats(
33
34
  poolInfo.poolName,
34
35
  poolInfo.poolType,
36
+ chainId,
35
37
  account,
38
+ provider,
36
39
  )
37
40
 
38
41
  useEffect(() => {
@@ -5,8 +5,8 @@ import {
5
5
  POOL_NAME,
6
6
  POOL_TYPE,
7
7
  PoolMap,
8
- useFactoring,
9
8
  } from '@huma-finance/shared'
9
+ import { useFactoring } from '@huma-finance/web-shared'
10
10
  import React from 'react'
11
11
 
12
12
  import { SubgraphService } from '@huma-finance/sdk'
@@ -1,5 +1,5 @@
1
1
  import { Box, Button, css, Typography, useTheme } from '@mui/material'
2
- import { txAtom } from '@huma-finance/shared'
2
+ import { txAtom } from '@huma-finance/web-shared'
3
3
  import { useResetAtom } from 'jotai/utils'
4
4
  import React, { useCallback } from 'react'
5
5
 
@@ -1,12 +1,7 @@
1
1
  import { useWeb3React } from '@web3-react/core'
2
2
  import { Contract } from 'ethers'
3
- import {
4
- PoolInfoType,
5
- sendTxAtom,
6
- TxStateType,
7
- useMount,
8
- usePoolContract,
9
- } from '@huma-finance/shared'
3
+ import { PoolInfoType, TxStateType } from '@huma-finance/shared'
4
+ import { sendTxAtom, useMount, usePoolContract } from '@huma-finance/web-shared'
10
5
  import { useAtom } from 'jotai'
11
6
  import React, { useEffect } from 'react'
12
7
 
@@ -1,4 +1,5 @@
1
- import { sendTxAtom, TxStateType, useMount } from '@huma-finance/shared'
1
+ import { TxStateType } from '@huma-finance/shared'
2
+ import { sendTxAtom, useMount } from '@huma-finance/web-shared'
2
3
  import { useWeb3React } from '@web3-react/core'
3
4
  import { Contract } from 'ethers'
4
5
  import { useAtom } from 'jotai'
@@ -1,4 +1,5 @@
1
- import { isTxFailed, sendTxAtom, txAtom } from '@huma-finance/shared'
1
+ import { isTxFailed } from '@huma-finance/shared'
2
+ import { sendTxAtom, txAtom } from '@huma-finance/web-shared'
2
3
  import { useAtom } from 'jotai'
3
4
  import { useResetAtom } from 'jotai/utils'
4
5
  import React, { useCallback, useEffect } from 'react'
@@ -1,6 +1,6 @@
1
1
  import { css } from '@emotion/react'
2
2
  import { Dialog } from '@mui/material'
3
- import { useMQ } from '@huma-finance/shared'
3
+ import { useMQ } from '@huma-finance/web-shared'
4
4
  import React from 'react'
5
5
 
6
6
  type HumaModalType = {
@@ -5,8 +5,8 @@ import {
5
5
  EARejectMessage,
6
6
  EARejectReason,
7
7
  EAService,
8
- useAuthErrorHandling,
9
8
  } from '@huma-finance/shared'
9
+ import { useAuthErrorHandling } from '@huma-finance/web-shared'
10
10
  import { useWeb3React } from '@web3-react/core'
11
11
  import { useCallback } from 'react'
12
12
 
package/src/index.tsx CHANGED
@@ -2,7 +2,7 @@ import { JsonRpcProvider } from '@ethersproject/providers'
2
2
  import {
3
3
  Provider as Web3Provider,
4
4
  ProviderProps as Web3Props,
5
- } from '@huma-finance/shared'
5
+ } from '@huma-finance/web-shared'
6
6
  import { ThemeProvider } from '@mui/material'
7
7
  import { Provider as Eip1193Provider } from '@web3-react/types'
8
8
  import { Provider as AtomProvider } from 'jotai'
package/tsconfig.json CHANGED
@@ -25,6 +25,9 @@
25
25
  {
26
26
  "path": "../huma-shared"
27
27
  },
28
+ {
29
+ "path": "../huma-web-shared"
30
+ },
28
31
  {
29
32
  "path": "../huma-sdk"
30
33
  }