@huma-finance/widgets 0.0.61-beta.544 → 0.0.61-beta.546

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.61-beta.544+e3f8572",
3
+ "version": "0.0.61-beta.546+8550ae4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -30,9 +30,9 @@
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.61-beta.544+e3f8572",
34
- "@huma-finance/shared": "^0.0.61-beta.544+e3f8572",
35
- "@huma-finance/web-shared": "^0.0.61-beta.544+e3f8572",
33
+ "@huma-finance/sdk": "^0.0.60",
34
+ "@huma-finance/shared": "^0.0.60",
35
+ "@huma-finance/web-shared": "^0.0.60",
36
36
  "@mui/icons-material": "^5.3.0",
37
37
  "@mui/material": "^5.0.6",
38
38
  "@mui/styles": "^5.0.2",
@@ -195,5 +195,5 @@
195
195
  "optionalDependencies": {
196
196
  "encoding": "^0.1.13"
197
197
  },
198
- "gitHead": "e3f85721970a1379a26063a817646ddc678cac21"
198
+ "gitHead": "8550ae42c179b2a84d0673184cc4971cd2d30c0d"
199
199
  }
@@ -1,16 +1,11 @@
1
- import {
2
- CampaignService,
3
- checkIsDev,
4
- formatNumber,
5
- isEmpty,
6
- } from '@huma-finance/shared'
7
- import { useAuthErrorHandling } from '@huma-finance/web-shared'
1
+ import { checkIsDev, formatNumber, isEmpty } from '@huma-finance/shared'
2
+ // import { useAuthErrorHandling } from '@huma-finance/web-shared'
8
3
  import { Box, css, useTheme } from '@mui/material'
9
4
  import { useWeb3React } from '@web3-react/core'
10
5
  import React, { useEffect, useState } from 'react'
11
6
  import { useDispatch } from 'react-redux'
12
7
 
13
- import { setError } from '../../../store/widgets.reducers'
8
+ // import { setError } from '../../../store/widgets.reducers'
14
9
  import { BottomButton } from '../../BottomButton'
15
10
  import { CongratulationsIcon, HumaPointsIcon, RibbonIcon } from '../../icons'
16
11
  import { LoadingModal } from '../../LoadingModal'
@@ -22,8 +17,8 @@ enum STATE {
22
17
  Congrats = 'Congrats',
23
18
  }
24
19
 
25
- const ERROR_MESSAGE =
26
- 'Failed to update wallet points. Be assured that your points will be added later.'
20
+ // const ERROR_MESSAGE =
21
+ // 'Failed to update wallet points. Be assured that your points will be added later.'
27
22
 
28
23
  type Props = {
29
24
  transactionHash: string
@@ -51,77 +46,78 @@ export function PointsEarned({
51
46
  const monthText =
52
47
  lockupMonths > 1 ? `${lockupMonths} months` : `${lockupMonths} month`
53
48
 
54
- const {
55
- errorType,
56
- setError: setAuthError,
57
- isWalletOwnershipVerified,
58
- isWalletOwnershipVerificationRequired,
59
- } = useAuthErrorHandling(isDev)
60
- const [walletOwnership, setWalletOwnership] = useState<boolean | undefined>()
49
+ // const {
50
+ // errorType,
51
+ // setError: setAuthError,
52
+ // isWalletOwnershipVerified,
53
+ // isWalletOwnershipVerificationRequired,
54
+ // } = useAuthErrorHandling(isDev)
55
+ // const [walletOwnership, setWalletOwnership] = useState<boolean | undefined>()
61
56
  const [state, setState] = useState<STATE>(STATE.Loading)
62
57
 
63
- useEffect(() => {
64
- if (isWalletOwnershipVerificationRequired) {
65
- setState(STATE.Loading)
66
- }
67
- }, [isWalletOwnershipVerificationRequired])
68
-
69
- useEffect(() => {
70
- if (isWalletOwnershipVerified) {
71
- setWalletOwnership(true)
72
- }
73
- }, [isWalletOwnershipVerified])
74
-
75
- useEffect(() => {
76
- const checkWalletOwnership = async () => {
77
- const ownership = await CampaignService.checkWalletOwnership(
78
- account!,
79
- isDev,
80
- pointsTestnetExperience,
81
- )
82
- setWalletOwnership(ownership)
83
- if (!ownership) {
84
- setAuthError('WalletNotSignInException')
85
- }
86
- }
87
- checkWalletOwnership()
88
- }, [account, isDev, pointsTestnetExperience, setAuthError])
89
-
90
- useEffect(() => {
91
- if (errorType === 'NotSignedIn') {
92
- setState(STATE.SignIn)
93
- } else if (errorType === 'UserRejected') {
94
- dispatch(
95
- setError({
96
- errorMessage: 'User has rejected the transaction.',
97
- }),
98
- )
99
- } else if (errorType === 'Other') {
100
- dispatch(
101
- setError({
102
- errorMessage: ERROR_MESSAGE,
103
- }),
104
- )
105
- }
106
- }, [dispatch, errorType])
58
+ // useEffect(() => {
59
+ // if (isWalletOwnershipVerificationRequired) {
60
+ // setState(STATE.Loading)
61
+ // }
62
+ // }, [isWalletOwnershipVerificationRequired])
63
+
64
+ // useEffect(() => {
65
+ // if (isWalletOwnershipVerified) {
66
+ // setWalletOwnership(true)
67
+ // }
68
+ // }, [isWalletOwnershipVerified])
69
+
70
+ // useEffect(() => {
71
+ // const checkWalletOwnership = async () => {
72
+ // const ownership = await CampaignService.checkWalletOwnership(
73
+ // account!,
74
+ // isDev,
75
+ // pointsTestnetExperience,
76
+ // )
77
+ // setWalletOwnership(ownership)
78
+ // if (!ownership) {
79
+ // setAuthError('WalletNotSignInException')
80
+ // }
81
+ // }
82
+ // checkWalletOwnership()
83
+ // }, [account, isDev, pointsTestnetExperience, setAuthError])
84
+
85
+ // useEffect(() => {
86
+ // if (errorType === 'NotSignedIn') {
87
+ // setState(STATE.SignIn)
88
+ // } else if (errorType === 'UserRejected') {
89
+ // dispatch(
90
+ // setError({
91
+ // errorMessage: 'User has rejected the transaction.',
92
+ // }),
93
+ // )
94
+ // } else if (errorType === 'Other') {
95
+ // dispatch(
96
+ // setError({
97
+ // errorMessage: ERROR_MESSAGE,
98
+ // }),
99
+ // )
100
+ // }
101
+ // }, [dispatch, errorType])
107
102
 
108
103
  useEffect(() => {
109
104
  const updateWalletPoints = async () => {
110
- if (walletOwnership) {
111
- try {
112
- const result = await CampaignService.updateWalletPoints(
113
- account!,
114
- transactionHash,
115
- chainId!,
116
- isDev,
117
- pointsTestnetExperience,
118
- )
119
- setPointsAccumulated(result.pointsAccumulated)
120
- setState(STATE.Congrats)
121
- } catch (error) {
122
- console.error('Failed to update wallet points', error)
123
- }
105
+ // if (walletOwnership) {
106
+ try {
107
+ // const result = await CampaignService.updateWalletPoints(
108
+ // account!,
109
+ // transactionHash,
110
+ // chainId!,
111
+ // isDev,
112
+ // pointsTestnetExperience,
113
+ // )
114
+ // setPointsAccumulated(result.pointsAccumulated)
115
+ setPointsAccumulated(5000)
116
+ setState(STATE.Congrats)
117
+ } catch (error) {
118
+ console.error('Failed to update wallet points', error)
124
119
  }
120
+ // }
125
121
  }
126
122
  updateWalletPoints()
127
123
  }, [
@@ -131,7 +127,7 @@ export function PointsEarned({
131
127
  isDev,
132
128
  pointsTestnetExperience,
133
129
  transactionHash,
134
- walletOwnership,
130
+ // walletOwnership,
135
131
  ])
136
132
 
137
133
  const styles = {