@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huma-finance/widgets",
3
- "version": "0.0.43-beta.109+4cd368f",
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.42",
34
- "@huma-finance/shared": "^0.0.42",
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": "4cd368f1f2c3be12011352c650d5f718d71831e3"
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 = envUtil.checkIsDev()
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(envUtil.checkIsDev()),
115
- env: envUtil.checkIsDev() ? 'Development' : 'Production',
114
+ tenantId: getNotifiDappId(checkIsDev()),
115
+ env: checkIsDev() ? 'Development' : 'Production',
116
116
  walletBlockchain: getBlockchainConfigFromChain(chainId),
117
117
  })
118
118
 
@@ -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(envUtil.checkIsDev())
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) {
@@ -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: envUtil.checkIsDev() ? 'Development' : 'Production',
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, envUtil.checkIsDev(), account),
62
+ doesChainSupportNotifi(chainId, checkIsDev(), account),
63
63
  )
64
64
  }
65
65
  }
package/src/utils/env.ts DELETED
@@ -1,8 +0,0 @@
1
- const checkIsDev = () =>
2
- window.location.hostname.startsWith('dev') ||
3
- window.location.hostname.startsWith('deploy-preview') ||
4
- process.env.NODE_ENV === 'development'
5
-
6
- export const envUtil = {
7
- checkIsDev,
8
- }