@huma-finance/widgets 0.0.43-beta.109 → 0.0.43-beta.112
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/cjs/index.cjs +7 -14
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +8 -15
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +2 -2
- package/src/components/Notifi/NotifiSubscriptionModal.tsx +3 -3
- package/src/hooks/useEA.ts +3 -7
- package/src/hooks/useNotifi.ts +3 -3
- package/src/utils/env.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huma-finance/widgets",
|
|
3
|
-
"version": "0.0.43-beta.
|
|
3
|
+
"version": "0.0.43-beta.112+6bf486b",
|
|
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.
|
|
34
|
-
"@huma-finance/shared": "^0.0.
|
|
33
|
+
"@huma-finance/sdk": "^0.0.43-beta.112+6bf486b",
|
|
34
|
+
"@huma-finance/shared": "^0.0.43-beta.112+6bf486b",
|
|
35
35
|
"@mui/icons-material": "^5.3.0",
|
|
36
36
|
"@mui/material": "^5.0.6",
|
|
37
37
|
"@mui/styles": "^5.0.2",
|
|
@@ -192,5 +192,5 @@
|
|
|
192
192
|
"optionalDependencies": {
|
|
193
193
|
"encoding": "^0.1.13"
|
|
194
194
|
},
|
|
195
|
-
"gitHead": "
|
|
195
|
+
"gitHead": "6bf486be701344cfbb3a6c8aa6b662d64c3ba096"
|
|
196
196
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAINS,
|
|
3
|
+
checkIsDev,
|
|
3
4
|
configUtil,
|
|
4
5
|
DocSignatureStatus,
|
|
5
6
|
IdentityService,
|
|
@@ -15,7 +16,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
|
15
16
|
|
|
16
17
|
import { useAppDispatch } from '../../../../hooks/useRedux'
|
|
17
18
|
import { setError } from '../../../../store/widgets.reducers'
|
|
18
|
-
import { envUtil } from '../../../../utils/env'
|
|
19
19
|
import { BottomButton } from '../../../BottomButton'
|
|
20
20
|
import { HumaSnackBar } from '../../../HumaSnackBar'
|
|
21
21
|
import { ApproveLenderImg } from '../../../images'
|
|
@@ -84,7 +84,7 @@ export function EvaluationKYC({
|
|
|
84
84
|
}: Props): React.ReactElement | null {
|
|
85
85
|
const theme = useTheme()
|
|
86
86
|
const dispatch = useAppDispatch()
|
|
87
|
-
const isDev =
|
|
87
|
+
const isDev = checkIsDev()
|
|
88
88
|
const { account, chainId } = useWeb3React()
|
|
89
89
|
const { kycProvider, code, kycPool } = useParamsSearch()
|
|
90
90
|
const { isWalletOwnershipVerified, setError: setAuthError } =
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
BroadcastEventTypeItem,
|
|
12
12
|
} from '@notifi-network/notifi-frontend-client'
|
|
13
13
|
import {
|
|
14
|
+
checkIsDev,
|
|
14
15
|
getBlockchainConfigFromChain,
|
|
15
16
|
txAtom,
|
|
16
17
|
getNotifiDappId,
|
|
@@ -28,7 +29,6 @@ import Email from '@mui/icons-material/Email'
|
|
|
28
29
|
import { useResetAtom } from 'jotai/utils'
|
|
29
30
|
|
|
30
31
|
import { WrapperModal } from '../WrapperModal'
|
|
31
|
-
import { envUtil } from '../../utils/env'
|
|
32
32
|
import { BottomButton } from '../BottomButton'
|
|
33
33
|
import { LoadingModal } from '../LoadingModal'
|
|
34
34
|
import { CheckIcon } from '../icons'
|
|
@@ -111,8 +111,8 @@ export function NotifiSubscriptionModal({
|
|
|
111
111
|
if (account != null && chainId != null) {
|
|
112
112
|
const client = newFrontendClient({
|
|
113
113
|
account: { publicKey: account },
|
|
114
|
-
tenantId: getNotifiDappId(
|
|
115
|
-
env:
|
|
114
|
+
tenantId: getNotifiDappId(checkIsDev()),
|
|
115
|
+
env: checkIsDev() ? 'Development' : 'Production',
|
|
116
116
|
walletBlockchain: getBlockchainConfigFromChain(chainId),
|
|
117
117
|
})
|
|
118
118
|
|
package/src/hooks/useEA.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
checkIsDev,
|
|
2
3
|
EAPayload,
|
|
3
4
|
EARejectionError,
|
|
4
5
|
EARejectMessage,
|
|
@@ -11,7 +12,6 @@ import { useCallback } from 'react'
|
|
|
11
12
|
|
|
12
13
|
import { setApproval, setError } from '../store/widgets.reducers'
|
|
13
14
|
import { WIDGET_STEP } from '../store/widgets.store'
|
|
14
|
-
import { envUtil } from '../utils/env'
|
|
15
15
|
import { useAppDispatch } from './useRedux'
|
|
16
16
|
|
|
17
17
|
const useEA = () => {
|
|
@@ -21,16 +21,12 @@ const useEA = () => {
|
|
|
21
21
|
isWalletOwnershipVerificationRequired,
|
|
22
22
|
isWalletOwnershipVerified,
|
|
23
23
|
setError: setAuthError,
|
|
24
|
-
} = useAuthErrorHandling(
|
|
24
|
+
} = useAuthErrorHandling(checkIsDev())
|
|
25
25
|
|
|
26
26
|
const checkingEA = useCallback(
|
|
27
27
|
async (payload: EAPayload, nextStep: WIDGET_STEP) => {
|
|
28
28
|
try {
|
|
29
|
-
const result = await EAService.approve(
|
|
30
|
-
payload,
|
|
31
|
-
chainId!,
|
|
32
|
-
envUtil.checkIsDev(),
|
|
33
|
-
)
|
|
29
|
+
const result = await EAService.approve(payload, chainId!, checkIsDev())
|
|
34
30
|
dispatch(setApproval({ ...result, nextStep }))
|
|
35
31
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
32
|
} catch (e: any) {
|
package/src/hooks/useNotifi.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
import {
|
|
3
|
+
checkIsDev,
|
|
3
4
|
doesChainSupportNotifi,
|
|
4
5
|
getBlockchainConfigFromChain,
|
|
5
6
|
} from '@huma-finance/shared'
|
|
6
7
|
import { newFrontendClient } from '@notifi-network/notifi-frontend-client'
|
|
7
|
-
import { envUtil } from '../utils/env'
|
|
8
8
|
|
|
9
9
|
export const useIsFirstTimeNotifiUser = (
|
|
10
10
|
account: string | undefined,
|
|
@@ -18,7 +18,7 @@ export const useIsFirstTimeNotifiUser = (
|
|
|
18
18
|
const client = newFrontendClient({
|
|
19
19
|
account: { publicKey: account },
|
|
20
20
|
tenantId: 'humadapp',
|
|
21
|
-
env:
|
|
21
|
+
env: checkIsDev() ? 'Development' : 'Production',
|
|
22
22
|
walletBlockchain: getBlockchainConfigFromChain(chainId),
|
|
23
23
|
})
|
|
24
24
|
|
|
@@ -59,7 +59,7 @@ export const useDoesChainSupportNotifi = (
|
|
|
59
59
|
const checkNotifiChainSupported = async () => {
|
|
60
60
|
if (account != null && chainId != null) {
|
|
61
61
|
setNotifiChainSupported(
|
|
62
|
-
doesChainSupportNotifi(chainId,
|
|
62
|
+
doesChainSupportNotifi(chainId, checkIsDev(), account),
|
|
63
63
|
)
|
|
64
64
|
}
|
|
65
65
|
}
|