@huma-finance/widgets 0.0.73-beta.922 → 0.0.73-beta.939
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/.env.example +3 -3
- package/{.eslintrc.js → .eslintrc.cjs} +1 -2
- package/.prettierrc.json +16 -0
- package/API.md +1 -1
- package/dist/index.js +220452 -11016
- package/dist/src/components/ApolloWrapper.d.ts +4 -0
- package/dist/src/components/ApproveAllowanceModal.d.ts +13 -0
- package/dist/src/components/ApproveAllowanceModalV2.d.ts +14 -0
- package/dist/src/components/BottomButton.d.ts +9 -0
- package/dist/src/components/ChainSupportProvider.d.ts +2 -0
- package/dist/src/components/ChooseAmountModal.d.ts +23 -0
- package/dist/src/components/ConfirmTransferModal.d.ts +19 -0
- package/dist/src/components/CreditLine/approve/1-ApproveAllowance.d.ts +9 -0
- package/dist/src/components/CreditLine/approve/2-Success.d.ts +8 -0
- package/dist/src/components/CreditLine/approve/index.d.ts +20 -0
- package/dist/src/components/CreditLine/autoPaybackV2/1-ApproveAllowance.d.ts +8 -0
- package/dist/src/components/CreditLine/autoPaybackV2/2-Success.d.ts +6 -0
- package/dist/src/components/CreditLine/autoPaybackV2/index.d.ts +15 -0
- package/dist/src/components/CreditLine/borrow/1-Evaluation.d.ts +8 -0
- package/dist/src/components/CreditLine/borrow/2-ChooseAmount.d.ts +8 -0
- package/dist/src/components/CreditLine/borrow/3-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/CreditLine/borrow/4-Transfer.d.ts +7 -0
- package/dist/src/components/CreditLine/borrow/5-Success.d.ts +10 -0
- package/dist/src/components/CreditLine/borrow/6-Notifications.d.ts +6 -0
- package/dist/src/components/CreditLine/borrow/index.d.ts +19 -0
- package/dist/src/components/CreditLine/borrowV2/1-ChooseAmount.d.ts +9 -0
- package/dist/src/components/CreditLine/borrowV2/2-ApproveAllowance.d.ts +8 -0
- package/dist/src/components/CreditLine/borrowV2/3-Transfer.d.ts +7 -0
- package/dist/src/components/CreditLine/borrowV2/4-Success.d.ts +10 -0
- package/dist/src/components/CreditLine/borrowV2/5-Notifications.d.ts +6 -0
- package/dist/src/components/CreditLine/borrowV2/index.d.ts +15 -0
- package/dist/src/components/CreditLine/payment/1-ChooseAmount.d.ts +9 -0
- package/dist/src/components/CreditLine/payment/2-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/CreditLine/payment/3-Transfer.d.ts +7 -0
- package/dist/src/components/CreditLine/payment/4-Success.d.ts +8 -0
- package/dist/src/components/CreditLine/payment/index.d.ts +17 -0
- package/dist/src/components/CreditLine/paymentV2/1-ChooseAmount.d.ts +11 -0
- package/dist/src/components/CreditLine/paymentV2/2-ApproveAllowance.d.ts +8 -0
- package/dist/src/components/CreditLine/paymentV2/3-Transfer.d.ts +8 -0
- package/dist/src/components/CreditLine/paymentV2/4-Success.d.ts +8 -0
- package/dist/src/components/CreditLine/paymentV2/index.d.ts +15 -0
- package/dist/src/components/CreditLine/solanaBorrow/1-ChooseAmount.d.ts +9 -0
- package/dist/src/components/CreditLine/solanaBorrow/2-Transfer.d.ts +7 -0
- package/dist/src/components/CreditLine/solanaBorrow/3-Done.d.ts +10 -0
- package/dist/src/components/CreditLine/solanaBorrow/index.d.ts +17 -0
- package/dist/src/components/CreditLine/solanaPayment/1-ChooseAmount.d.ts +9 -0
- package/dist/src/components/CreditLine/solanaPayment/2-Transfer.d.ts +7 -0
- package/dist/src/components/CreditLine/solanaPayment/3-Done.d.ts +8 -0
- package/dist/src/components/CreditLine/solanaPayment/index.d.ts +14 -0
- package/dist/src/components/CreditLine/supplyFLC/1-ApproveAllowance.d.ts +10 -0
- package/dist/src/components/CreditLine/supplyFLC/2-Transfer.d.ts +10 -0
- package/dist/src/components/CreditLine/supplyFLC/3-Success.d.ts +10 -0
- package/dist/src/components/CreditLine/supplyFLC/index.d.ts +15 -0
- package/dist/src/components/ErrorModal.d.ts +12 -0
- package/dist/src/components/HumaLoading.d.ts +7 -0
- package/dist/src/components/HumaSnackBar.d.ts +10 -0
- package/dist/src/components/InputAmountModal.d.ts +18 -0
- package/dist/src/components/InvoiceFactoring/borrow/1-Evaluation.d.ts +8 -0
- package/dist/src/components/InvoiceFactoring/borrow/2-ChooseAmount.d.ts +8 -0
- package/dist/src/components/InvoiceFactoring/borrow/3-ConfirmTransfer.d.ts +2 -0
- package/dist/src/components/InvoiceFactoring/borrow/4-ApproveNFT.d.ts +8 -0
- package/dist/src/components/InvoiceFactoring/borrow/5-Transfer.d.ts +8 -0
- package/dist/src/components/InvoiceFactoring/borrow/6-Success.d.ts +6 -0
- package/dist/src/components/InvoiceFactoring/borrow/index.d.ts +20 -0
- package/dist/src/components/InvoiceFactoring/payment/1-ChooseAmount.d.ts +8 -0
- package/dist/src/components/InvoiceFactoring/payment/2-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/InvoiceFactoring/payment/3-Transfer.d.ts +7 -0
- package/dist/src/components/InvoiceFactoring/payment/4-Success.d.ts +8 -0
- package/dist/src/components/InvoiceFactoring/payment/index.d.ts +17 -0
- package/dist/src/components/Lend/addRedemptionV2/1-ChooseTranche.d.ts +8 -0
- package/dist/src/components/Lend/addRedemptionV2/2-ChooseAmount.d.ts +10 -0
- package/dist/src/components/Lend/addRedemptionV2/3-Transfer.d.ts +10 -0
- package/dist/src/components/Lend/addRedemptionV2/4-Done.d.ts +6 -0
- package/dist/src/components/Lend/addRedemptionV2/index.d.ts +23 -0
- package/dist/src/components/Lend/cancelRedemptionV2 /1-Transfer.d.ts +10 -0
- package/dist/src/components/Lend/cancelRedemptionV2 /2-Done.d.ts +10 -0
- package/dist/src/components/Lend/cancelRedemptionV2 /index.d.ts +22 -0
- package/dist/src/components/Lend/components/ApproveLenderBase.d.ts +14 -0
- package/dist/src/components/Lend/components/PersonaEvaluation.d.ts +17 -0
- package/dist/src/components/Lend/components/SecuritizeEvaluation.d.ts +8 -0
- package/dist/src/components/Lend/solanaAddRedemption/1-ChooseTranche.d.ts +8 -0
- package/dist/src/components/Lend/solanaAddRedemption/2-ChooseAmount.d.ts +11 -0
- package/dist/src/components/Lend/solanaAddRedemption/3-Transfer.d.ts +8 -0
- package/dist/src/components/Lend/solanaAddRedemption/4-Done.d.ts +8 -0
- package/dist/src/components/Lend/solanaAddRedemption/index.d.ts +19 -0
- package/dist/src/components/Lend/solanaCancelRedemption/1-ChooseTranche.d.ts +8 -0
- package/dist/src/components/Lend/solanaCancelRedemption/2-Transfer.d.ts +11 -0
- package/dist/src/components/Lend/solanaCancelRedemption/3-Done.d.ts +11 -0
- package/dist/src/components/Lend/solanaCancelRedemption/index.d.ts +16 -0
- package/dist/src/components/Lend/solanaEnableAutoRedemption/1-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/Lend/solanaEnableAutoRedemption/2-Transfer.d.ts +9 -0
- package/dist/src/components/Lend/solanaEnableAutoRedemption/3-Success.d.ts +10 -0
- package/dist/src/components/Lend/solanaEnableAutoRedemption/index.d.ts +18 -0
- package/dist/src/components/Lend/solanaSupply/1-Evaluation.d.ts +12 -0
- package/dist/src/components/Lend/solanaSupply/2-ApproveLender.d.ts +10 -0
- package/dist/src/components/Lend/solanaSupply/3-ChooseTranche.d.ts +9 -0
- package/dist/src/components/Lend/solanaSupply/4-ChooseAmount.d.ts +13 -0
- package/dist/src/components/Lend/solanaSupply/5-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/Lend/solanaSupply/6-Transfer.d.ts +11 -0
- package/dist/src/components/Lend/solanaSupply/7-Success.d.ts +12 -0
- package/dist/src/components/Lend/solanaSupply/8-PointsEarned.d.ts +11 -0
- package/dist/src/components/Lend/solanaSupply/index.d.ts +24 -0
- package/dist/src/components/Lend/solanaWithdraw/1-ConfirmTransfer.d.ts +9 -0
- package/dist/src/components/Lend/solanaWithdraw/2-Transfer.d.ts +9 -0
- package/dist/src/components/Lend/solanaWithdraw/3-Done.d.ts +10 -0
- package/dist/src/components/Lend/solanaWithdraw/index.d.ts +25 -0
- package/dist/src/components/Lend/stellarSupply/1-Evaluation.d.ts +4 -0
- package/dist/src/components/Lend/stellarSupply/2-ChooseTranche.d.ts +9 -0
- package/dist/src/components/Lend/stellarSupply/3-ChooseAmount.d.ts +12 -0
- package/dist/src/components/Lend/stellarSupply/4-Transfer.d.ts +8 -0
- package/dist/src/components/Lend/stellarSupply/5-Success.d.ts +10 -0
- package/dist/src/components/Lend/stellarSupply/index.d.ts +22 -0
- package/dist/src/components/Lend/supply/1-Evaluation/EvaluationEA.d.ts +8 -0
- package/dist/src/components/Lend/supply/1-Evaluation/EvaluationKYC.d.ts +8 -0
- package/dist/src/components/Lend/supply/1-Evaluation/index.d.ts +9 -0
- package/dist/src/components/Lend/supply/2-ChooseAmount.d.ts +11 -0
- package/dist/src/components/Lend/supply/3-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/Lend/supply/4-Transfer.d.ts +7 -0
- package/dist/src/components/Lend/supply/5-Success.d.ts +9 -0
- package/dist/src/components/Lend/supply/6-Notifications.d.ts +6 -0
- package/dist/src/components/Lend/supply/index.d.ts +17 -0
- package/dist/src/components/Lend/supplyV2/1-ChooseTranche.d.ts +9 -0
- package/dist/src/components/Lend/supplyV2/2-Evaluation.d.ts +12 -0
- package/dist/src/components/Lend/supplyV2/3-ApproveLender.d.ts +10 -0
- package/dist/src/components/Lend/supplyV2/4-ChooseAmount.d.ts +14 -0
- package/dist/src/components/Lend/supplyV2/5-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/Lend/supplyV2/6-Transfer.d.ts +11 -0
- package/dist/src/components/Lend/supplyV2/7-Success.d.ts +13 -0
- package/dist/src/components/Lend/supplyV2/8-Notifications.d.ts +8 -0
- package/dist/src/components/Lend/supplyV2/index.d.ts +23 -0
- package/dist/src/components/Lend/withdraw/1-CheckWithdrawble.d.ts +8 -0
- package/dist/src/components/Lend/withdraw/2-ChooseAmount.d.ts +10 -0
- package/dist/src/components/Lend/withdraw/3-Transfer.d.ts +7 -0
- package/dist/src/components/Lend/withdraw/4-Success.d.ts +8 -0
- package/dist/src/components/Lend/withdraw/index.d.ts +17 -0
- package/dist/src/components/Lend/withdrawV2/1-ConfirmTransfer.d.ts +11 -0
- package/dist/src/components/Lend/withdrawV2/2-Transfer.d.ts +9 -0
- package/dist/src/components/Lend/withdrawV2/3-Done.d.ts +10 -0
- package/dist/src/components/Lend/withdrawV2/index.d.ts +17 -0
- package/dist/src/components/LoadingModal.d.ts +9 -0
- package/dist/src/components/Notifi/NotifiContextWrapper.d.ts +7 -0
- package/dist/src/components/Notifi/NotifiSubscriptionModal.d.ts +7 -0
- package/dist/src/components/NumericFormatCustom.d.ts +14 -0
- package/dist/src/components/PointsEarned.d.ts +10 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/1-ChooseAmount.d.ts +10 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/2-ApproveAllowance.d.ts +8 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/3-ApproveReceivable.d.ts +8 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/4-Transfer.d.ts +8 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/5-Success.d.ts +10 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/6-Notifications.d.ts +6 -0
- package/dist/src/components/ReceivableBackedCreditLine/borrow/index.d.ts +17 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/1-ChoosePaymentType.d.ts +8 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/2-ChooseAmount.d.ts +12 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/3-ApproveAllowance.d.ts +10 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/4-CreateReceivable.d.ts +9 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/5-ApproveReceivable.d.ts +8 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/6-Transfer.d.ts +14 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/7-Success.d.ts +12 -0
- package/dist/src/components/ReceivableBackedCreditLine/payment/index.d.ts +21 -0
- package/dist/src/components/SignIn.d.ts +6 -0
- package/dist/src/components/SolanaErrorModal.d.ts +13 -0
- package/dist/src/components/SolanaTxDoneModal.d.ts +12 -0
- package/dist/src/components/SolanaTxSendModal.d.ts +12 -0
- package/dist/src/components/SolanaViewOnExplorer.d.ts +8 -0
- package/dist/src/components/StellarTxDoneModal.d.ts +12 -0
- package/dist/src/components/StellarTxSendModal.d.ts +8 -0
- package/dist/src/components/StellarViewOnExplorer.d.ts +8 -0
- package/dist/src/components/StreamFactoring/borrow/1-Evaluation.d.ts +9 -0
- package/dist/src/components/StreamFactoring/borrow/2-ChooseAmount.d.ts +8 -0
- package/dist/src/components/StreamFactoring/borrow/3-ConfirmTransfer.d.ts +2 -0
- package/dist/src/components/StreamFactoring/borrow/4-ApproveAllowance.d.ts +7 -0
- package/dist/src/components/StreamFactoring/borrow/5-Permit.d.ts +10 -0
- package/dist/src/components/StreamFactoring/borrow/6-Transfer.d.ts +7 -0
- package/dist/src/components/StreamFactoring/borrow/7-Success.d.ts +6 -0
- package/dist/src/components/StreamFactoring/borrow/index.d.ts +13 -0
- package/dist/src/components/StreamFactoring/payment/ChooseAmount.d.ts +8 -0
- package/dist/src/components/StreamFactoring/payment/Success.d.ts +8 -0
- package/dist/src/components/StreamFactoring/payment/Transfer.d.ts +7 -0
- package/dist/src/components/StreamFactoring/payment/index.d.ts +10 -0
- package/dist/src/components/SuperfluidFactoring/index.d.ts +12 -0
- package/dist/src/components/TxDoneModal.d.ts +9 -0
- package/dist/src/components/TxSendModal.d.ts +13 -0
- package/dist/src/components/TxSendModalV2.d.ts +13 -0
- package/dist/src/components/ViewOnExplorer.d.ts +6 -0
- package/dist/src/components/WidgetWrapper.d.ts +11 -0
- package/dist/src/components/WrapperModal.d.ts +8 -0
- package/dist/src/components/buttons/TableActionButton.d.ts +8 -0
- package/dist/src/components/buttons/index.d.ts +1 -0
- package/dist/src/components/humaModal/HumaModal.d.ts +13 -0
- package/dist/src/components/humaModal/HumaModalHeader.d.ts +12 -0
- package/dist/src/components/humaModal/index.d.ts +2 -0
- package/dist/src/components/icons/index.d.ts +23 -0
- package/dist/src/components/images/index.d.ts +3 -0
- package/dist/src/cosmos/CreditLineBorrow.fixture.d.ts +2 -0
- package/dist/src/cosmos/CreditLinePayment.fixture.d.ts +2 -0
- package/dist/src/cosmos/InvoiceFactoringBorrow.fixture.d.ts +2 -0
- package/dist/src/cosmos/InvoiceFactoringPayment.fixture.d.ts +2 -0
- package/dist/src/cosmos/LendSupply.fixture.d.ts +2 -0
- package/dist/src/cosmos/LendWithdraw.fixture.d.ts +2 -0
- package/dist/src/cosmos/SDKTesting.fixture.d.ts +2 -0
- package/dist/src/cosmos/SuperfluidFactoringBorrow.fixture.d.ts +2 -0
- package/dist/src/cosmos/WalletWrapper.d.ts +3 -0
- package/dist/src/cosmos/utils/index.d.ts +18 -0
- package/dist/src/hooks/useEA.d.ts +8 -0
- package/dist/src/hooks/useElementDimensions.d.ts +5 -0
- package/dist/src/hooks/useNotifi.d.ts +10 -0
- package/dist/src/hooks/useRedux.d.ts +6 -0
- package/dist/src/index.d.ts +385 -0
- package/dist/src/reportWebVitals.d.ts +3 -0
- package/dist/src/setupTests.d.ts +0 -0
- package/dist/src/store/index.d.ts +10 -0
- package/dist/src/store/widgets.reducers.d.ts +56 -0
- package/dist/src/store/widgets.selectors.d.ts +2 -0
- package/dist/src/store/widgets.store.d.ts +59 -0
- package/dist/src/theme/breakpoints.d.ts +5 -0
- package/dist/src/theme/components.d.ts +2 -0
- package/dist/src/theme/coreThemeConstants.d.ts +18 -0
- package/dist/src/theme/cssMixins.d.ts +20 -0
- package/dist/src/theme/hooks/useGetSizes.d.ts +12 -0
- package/dist/src/theme/index.d.ts +2 -0
- package/dist/src/theme/palette.d.ts +53 -0
- package/dist/src/theme/shape.d.ts +2 -0
- package/dist/src/theme/theme.types.d.ts +71 -0
- package/dist/src/theme/typography.d.ts +2 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +21 -34
- package/src/components/Lend/components/ApproveLenderBase.tsx +6 -3
- package/src/components/Lend/components/PersonaEvaluation.tsx +5 -2
- package/src/components/Lend/components/SecuritizeEvaluation.tsx +5 -2
- package/src/components/Lend/solanaSupply/6-Transfer.tsx +1 -1
- package/src/components/Lend/solanaSupply/8-PointsEarned.tsx +6 -2
- package/src/components/Lend/supply/1-Evaluation/EvaluationKYC.tsx +5 -2
- package/src/components/Lend/supplyV2/2-Evaluation.tsx +2 -2
- package/src/components/Lend/supplyV2/3-ApproveLender.tsx +1 -1
- package/src/components/Lend/supplyV2/6-Transfer.tsx +1 -2
- package/src/components/Lend/supplyV2/index.tsx +1 -1
- package/src/components/Notifi/NotifiContextWrapper.tsx +3 -3
- package/src/components/PointsEarned.tsx +3 -3
- package/src/components/icons/index.tsx +21 -21
- package/src/cosmos/InvoiceFactoringBorrow.fixture.tsx +1 -1
- package/src/cosmos/SuperfluidFactoringBorrow.fixture.tsx +2 -4
- package/src/cosmos/utils/index.ts +4 -2
- package/src/hooks/useEA.ts +1 -2
- package/src/hooks/useNotifi.ts +1 -1
- package/src/index.tsx +4 -7
- package/tsconfig.json +20 -17
- package/vite-env.d.ts +2 -0
- package/vite.config.ts +48 -0
- package/webpack.cosmos.js +1 -1
- package/.prettierrc.js +0 -16
- package/babel.config.js +0 -15
- package/config-overrides.js +0 -9
- package/dist/cjs/index.cjs +0 -11779
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -758
- package/dist/index.js.map +0 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -40
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/rollup.config.js +0 -81
- package/src/cosmos/utils/env.ts +0 -6
- package/src/react-app-env.d.ts +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Theme as MUITheme, PaletteColorOptions } from '@mui/material/styles';
|
|
2
|
+
import { cssMixins } from './cssMixins';
|
|
3
|
+
declare module '@mui/material/styles/createPalette' {
|
|
4
|
+
interface TypeText {
|
|
5
|
+
quaternary: string;
|
|
6
|
+
tertiary: string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
declare module '@mui/material/styles' {
|
|
10
|
+
interface Theme {
|
|
11
|
+
cssMixins: typeof cssMixins;
|
|
12
|
+
}
|
|
13
|
+
interface ThemeOptions {
|
|
14
|
+
cssMixins: typeof cssMixins;
|
|
15
|
+
}
|
|
16
|
+
interface PaletteColor {
|
|
17
|
+
superDark?: string;
|
|
18
|
+
superLight?: string;
|
|
19
|
+
}
|
|
20
|
+
interface SimplePaletteColorOptions {
|
|
21
|
+
contrastText?: string;
|
|
22
|
+
dark?: string;
|
|
23
|
+
faded?: string;
|
|
24
|
+
light?: string;
|
|
25
|
+
main: string;
|
|
26
|
+
superDark?: string;
|
|
27
|
+
superLight?: string;
|
|
28
|
+
}
|
|
29
|
+
interface Palette {
|
|
30
|
+
alert: SimplePaletteColorOptions;
|
|
31
|
+
default: SimplePaletteColorOptions;
|
|
32
|
+
}
|
|
33
|
+
interface PaletteOptions {
|
|
34
|
+
alert?: PaletteColorOptions;
|
|
35
|
+
default?: PaletteColorOptions;
|
|
36
|
+
}
|
|
37
|
+
interface TypographyVariants {
|
|
38
|
+
body2Small: React.CSSProperties;
|
|
39
|
+
h3Large: React.CSSProperties;
|
|
40
|
+
labsSmall: React.CSSProperties;
|
|
41
|
+
nav: React.CSSProperties;
|
|
42
|
+
navSub: React.CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
interface TypographyVariantsOptions {
|
|
45
|
+
body2Small: React.CSSProperties;
|
|
46
|
+
h3Large: React.CSSProperties;
|
|
47
|
+
labsSmall: React.CSSProperties;
|
|
48
|
+
nav: React.CSSProperties;
|
|
49
|
+
navSub: React.CSSProperties;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
declare module '@mui/material/Typography' {
|
|
53
|
+
interface TypographyPropsVariantOverrides {
|
|
54
|
+
body2Small: true;
|
|
55
|
+
h3Large: true;
|
|
56
|
+
labsSmall: true;
|
|
57
|
+
nav: true;
|
|
58
|
+
navSub: true;
|
|
59
|
+
sceneHeader: true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
declare module '@mui/material/Button' {
|
|
63
|
+
interface ButtonPropsColorOverrides {
|
|
64
|
+
alert: PaletteColorOptions | true;
|
|
65
|
+
default: PaletteColorOptions | true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
declare module '@emotion/react' {
|
|
69
|
+
interface Theme extends MUITheme {
|
|
70
|
+
}
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huma-finance/widgets",
|
|
3
|
-
"version": "0.0.73-beta.
|
|
3
|
+
"version": "0.0.73-beta.939+8b148f9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,16 +8,10 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/00labs/huma-js.git"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
11
|
+
"type": "module",
|
|
12
|
+
"types": "dist/src/index.d.ts",
|
|
12
13
|
"main": "dist/cjs/index.cjs",
|
|
13
14
|
"module": "dist/index.js",
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"import": "./dist/index.js",
|
|
18
|
-
"require": "./dist/cjs/index.cjs"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
15
|
"dependencies": {
|
|
22
16
|
"@apollo/client": "^3.7.2",
|
|
23
17
|
"@coinbase/wallet-sdk": "^3.5.3",
|
|
@@ -27,11 +21,10 @@
|
|
|
27
21
|
"@ethersproject/constants": "^5.7.0",
|
|
28
22
|
"@ethersproject/contracts": "^5.7.0",
|
|
29
23
|
"@ethersproject/experimental": "^5.7.0",
|
|
30
|
-
"@ethersproject/providers": "^5.6.0",
|
|
31
24
|
"@ethersproject/units": "^5.6.0",
|
|
32
|
-
"@huma-finance/sdk": "^0.0.73-beta.
|
|
33
|
-
"@huma-finance/shared": "^0.0.73-beta.
|
|
34
|
-
"@huma-finance/web-shared": "^0.0.73-beta.
|
|
25
|
+
"@huma-finance/sdk": "^0.0.73-beta.939+8b148f9",
|
|
26
|
+
"@huma-finance/shared": "^0.0.73-beta.939+8b148f9",
|
|
27
|
+
"@huma-finance/web-shared": "^0.0.73-beta.939+8b148f9",
|
|
35
28
|
"@mui/x-date-pickers": "^5.0.7",
|
|
36
29
|
"@notifi-network/notifi-frontend-client": "^1.1.2",
|
|
37
30
|
"@notifi-network/notifi-react": "^1.1.2",
|
|
@@ -75,8 +68,7 @@
|
|
|
75
68
|
},
|
|
76
69
|
"scripts": {
|
|
77
70
|
"start": "tsc -w",
|
|
78
|
-
"
|
|
79
|
-
"build": "rollup -c",
|
|
71
|
+
"build": "vite build",
|
|
80
72
|
"cosmos": "cosmos",
|
|
81
73
|
"prettier": "prettier --write \"src/**/*.{js,ts,tsx,graphql}\"",
|
|
82
74
|
"lint": "eslint --max-warnings=0 \"src/**/*.{js,ts,tsx,graphql}\"",
|
|
@@ -114,15 +106,6 @@
|
|
|
114
106
|
"@babel/preset-react": "^7.14.5",
|
|
115
107
|
"@emotion/babel-plugin": "^11.10.2",
|
|
116
108
|
"@emotion/babel-preset-css-prop": "^11.2.0",
|
|
117
|
-
"@rollup/plugin-babel": "^6.0.3",
|
|
118
|
-
"@rollup/plugin-commonjs": "^24.0.1",
|
|
119
|
-
"@rollup/plugin-image": "^3.0.2",
|
|
120
|
-
"@rollup/plugin-inject": "^5.0.3",
|
|
121
|
-
"@rollup/plugin-json": "^6.0.0",
|
|
122
|
-
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
123
|
-
"@rollup/plugin-typescript": "^11.0.0",
|
|
124
|
-
"@rollup/plugin-url": "^8.0.1",
|
|
125
|
-
"@svgr/rollup": "^6.5.1",
|
|
126
109
|
"@svgr/webpack": "^6.5.1",
|
|
127
110
|
"@testing-library/cypress": "^9.0.0",
|
|
128
111
|
"@testing-library/jest-dom": "^5.16.5",
|
|
@@ -165,12 +148,6 @@
|
|
|
165
148
|
"path-browserify": "^1.0.1",
|
|
166
149
|
"prettier": "^2.7.1",
|
|
167
150
|
"react-cosmos": "^5.7.2",
|
|
168
|
-
"rollup-plugin-dts": "^5.2.0",
|
|
169
|
-
"rollup-plugin-node-externals": "^5.1.2",
|
|
170
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
171
|
-
"rollup-plugin-polyfill-node": "^0.12.0",
|
|
172
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
173
|
-
"rollup-plugin-scss": "^4.0.0",
|
|
174
151
|
"sass": "^1.77.6",
|
|
175
152
|
"stream-browserify": "^3.0.0",
|
|
176
153
|
"typechain": "^8.1.0",
|
|
@@ -181,6 +158,7 @@
|
|
|
181
158
|
"@coral-xyz/anchor": "^0.30.1",
|
|
182
159
|
"@emotion/react": "^11.5.0",
|
|
183
160
|
"@emotion/styled": "^11.3.0",
|
|
161
|
+
"@ethersproject/providers": "5.7.2",
|
|
184
162
|
"@huma-finance/soroban-tranche-vault": "0.0.18",
|
|
185
163
|
"@mui/icons-material": "^5.3.0",
|
|
186
164
|
"@mui/material": "^5.0.6",
|
|
@@ -188,18 +166,27 @@
|
|
|
188
166
|
"@mui/system": "^5.0.6",
|
|
189
167
|
"@mui/x-date-pickers": "^5.0.7",
|
|
190
168
|
"@solana/spl-token": "^0.4.8",
|
|
191
|
-
"@solana/wallet-adapter-base": "
|
|
192
|
-
"@solana/wallet-adapter-react": "
|
|
169
|
+
"@solana/wallet-adapter-base": "0.9.23",
|
|
170
|
+
"@solana/wallet-adapter-react": "0.15.35",
|
|
193
171
|
"@solana/web3.js": "^1.95.3",
|
|
194
172
|
"@soroban-react/core": "^9.3.0",
|
|
173
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
174
|
+
"arweave": "^1.10.0",
|
|
175
|
+
"bs58": "6.0.0",
|
|
195
176
|
"ethers": "^5.6.1",
|
|
196
177
|
"react": ">=16.8.0",
|
|
197
178
|
"react-dom": ">=16.8.0",
|
|
198
179
|
"react-redux": ">=7.2.2",
|
|
199
|
-
"redux": ">=4.1.2"
|
|
180
|
+
"redux": ">=4.1.2",
|
|
181
|
+
"vite": "6.0.11",
|
|
182
|
+
"vite-plugin-commonjs": "0.10.4",
|
|
183
|
+
"vite-plugin-dts": "4.5.0",
|
|
184
|
+
"vite-plugin-node-polyfills": "0.23.0",
|
|
185
|
+
"vite-plugin-svgr": "4.3.0",
|
|
186
|
+
"vite-tsconfig-paths": "5.1.4"
|
|
200
187
|
},
|
|
201
188
|
"optionalDependencies": {
|
|
202
189
|
"encoding": "^0.1.13"
|
|
203
190
|
},
|
|
204
|
-
"gitHead": "
|
|
191
|
+
"gitHead": "8b148f9340a401b544aa2739c82bcf839301a6d0"
|
|
205
192
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
2
|
import {
|
|
3
3
|
CHAIN_TYPE,
|
|
4
|
-
checkIsDev,
|
|
5
4
|
COMMON_ERROR_MESSAGE,
|
|
6
5
|
IdentityServiceV2,
|
|
7
6
|
NETWORK_TYPE,
|
|
@@ -9,7 +8,7 @@ import {
|
|
|
9
8
|
timeUtil,
|
|
10
9
|
TrancheType,
|
|
11
10
|
} from '@huma-finance/shared'
|
|
12
|
-
import { useChainInfo } from '@huma-finance/web-shared'
|
|
11
|
+
import { useChainInfo, checkIsDev } from '@huma-finance/web-shared'
|
|
13
12
|
import React, { useCallback, useEffect } from 'react'
|
|
14
13
|
import { useAppDispatch } from '../../../hooks/useRedux'
|
|
15
14
|
import { setError, setStep } from '../../../store/widgets.reducers'
|
|
@@ -22,7 +21,7 @@ type Props = {
|
|
|
22
21
|
chainType: CHAIN_TYPE
|
|
23
22
|
networkType: NETWORK_TYPE
|
|
24
23
|
isUniTranche: boolean
|
|
25
|
-
documentHash
|
|
24
|
+
documentHash?: string
|
|
26
25
|
chainSpecificData?: Record<string, unknown>
|
|
27
26
|
changeTranche: (tranche: TrancheType) => void
|
|
28
27
|
}
|
|
@@ -43,6 +42,10 @@ export function ApproveLenderBase({
|
|
|
43
42
|
|
|
44
43
|
const approveLender = useCallback(
|
|
45
44
|
async (trancheVault: string) => {
|
|
45
|
+
if (!documentHash) {
|
|
46
|
+
throw new Error('No document hash provided')
|
|
47
|
+
}
|
|
48
|
+
|
|
46
49
|
let tryAttempts = 2
|
|
47
50
|
|
|
48
51
|
while (tryAttempts > 0) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAIN_TYPE,
|
|
3
|
-
checkIsDev,
|
|
4
3
|
CloseModalOptions,
|
|
5
4
|
IdentityServiceV2,
|
|
6
5
|
IdentityVerificationStatusV2,
|
|
@@ -9,7 +8,11 @@ import {
|
|
|
9
8
|
NETWORK_TYPE,
|
|
10
9
|
VerificationStatusResultV2,
|
|
11
10
|
} from '@huma-finance/shared'
|
|
12
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
AUTH_ERROR_TYPE,
|
|
13
|
+
useAuthErrorHandling,
|
|
14
|
+
checkIsDev,
|
|
15
|
+
} from '@huma-finance/web-shared'
|
|
13
16
|
import { Box, css, useTheme } from '@mui/material'
|
|
14
17
|
import Persona, { Client } from 'persona'
|
|
15
18
|
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAINS,
|
|
3
|
-
checkIsDev,
|
|
4
3
|
configUtil,
|
|
5
4
|
DocSignatureStatus,
|
|
6
5
|
IdentityService,
|
|
@@ -10,7 +9,11 @@ import {
|
|
|
10
9
|
timeUtil,
|
|
11
10
|
VerificationStatusResult,
|
|
12
11
|
} from '@huma-finance/shared'
|
|
13
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
useAuthErrorHandling,
|
|
14
|
+
useParamsSearch,
|
|
15
|
+
checkIsDev,
|
|
16
|
+
} from '@huma-finance/web-shared'
|
|
14
17
|
import { Box, css, useTheme } from '@mui/material'
|
|
15
18
|
import { useWeb3React } from '@web3-react/core'
|
|
16
19
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CampaignService,
|
|
3
|
-
checkIsDev,
|
|
4
3
|
convertToShares,
|
|
5
4
|
getTokenAccounts,
|
|
6
5
|
NETWORK_TYPE,
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
useHumaProgram,
|
|
14
13
|
useLenderAccounts,
|
|
15
14
|
useTrancheTokenAccounts,
|
|
15
|
+
checkIsDev,
|
|
16
16
|
} from '@huma-finance/web-shared'
|
|
17
17
|
import {
|
|
18
18
|
createApproveCheckedInstruction,
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CampaignService,
|
|
3
3
|
CHAIN_TYPE,
|
|
4
|
-
checkIsDev,
|
|
5
4
|
CloseModalOptions,
|
|
6
5
|
formatNumber,
|
|
7
6
|
isEmpty,
|
|
8
7
|
NETWORK_TYPE,
|
|
9
8
|
} from '@huma-finance/shared'
|
|
10
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
SolanaPoolState,
|
|
11
|
+
txAtom,
|
|
12
|
+
useChainInfo,
|
|
13
|
+
checkIsDev,
|
|
14
|
+
} from '@huma-finance/web-shared'
|
|
11
15
|
import { Box, css, useTheme } from '@mui/material'
|
|
12
16
|
import { useResetAtom } from 'jotai/utils'
|
|
13
17
|
import React, { useCallback, useEffect, useState } from 'react'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAINS,
|
|
3
|
-
checkIsDev,
|
|
4
3
|
configUtil,
|
|
5
4
|
DocSignatureStatus,
|
|
6
5
|
IdentityService,
|
|
@@ -8,7 +7,11 @@ import {
|
|
|
8
7
|
timeUtil,
|
|
9
8
|
VerificationStatusResult,
|
|
10
9
|
} from '@huma-finance/shared'
|
|
11
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
useAuthErrorHandling,
|
|
12
|
+
useParamsSearch,
|
|
13
|
+
checkIsDev,
|
|
14
|
+
} from '@huma-finance/web-shared'
|
|
12
15
|
import { Box, css, useTheme } from '@mui/material'
|
|
13
16
|
import { useWeb3React } from '@web3-react/core'
|
|
14
17
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
@@ -14,7 +14,7 @@ type Props = {
|
|
|
14
14
|
poolInfo: PoolInfoV2
|
|
15
15
|
networkType: NETWORK_TYPE
|
|
16
16
|
campaign?: Campaign
|
|
17
|
-
documentHash
|
|
17
|
+
documentHash?: string
|
|
18
18
|
handleClose: (options?: CloseModalOptions) => void
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ export function Evaluation({
|
|
|
30
30
|
<SecuritizeEvaluation poolInfo={poolInfo} handleClose={handleClose} />
|
|
31
31
|
)
|
|
32
32
|
}
|
|
33
|
-
if (poolInfo.KYC?.Persona) {
|
|
33
|
+
if (poolInfo.KYC?.Persona && documentHash) {
|
|
34
34
|
return (
|
|
35
35
|
<PersonaEvaluation
|
|
36
36
|
poolInfo={poolInfo}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CampaignService,
|
|
3
|
-
checkIsDev,
|
|
4
3
|
NETWORK_TYPE,
|
|
5
4
|
PoolInfoV2,
|
|
6
5
|
TrancheType,
|
|
7
6
|
} from '@huma-finance/shared'
|
|
8
|
-
import { useTrancheVaultContractV2 } from '@huma-finance/web-shared'
|
|
7
|
+
import { useTrancheVaultContractV2, checkIsDev } from '@huma-finance/web-shared'
|
|
9
8
|
import { useWeb3React } from '@web3-react/core'
|
|
10
9
|
import { ethers } from 'ethers'
|
|
11
10
|
import React, { useCallback } from 'react'
|
|
@@ -47,7 +47,7 @@ export interface Campaign {
|
|
|
47
47
|
export interface LendSupplyPropsV2 {
|
|
48
48
|
poolName: keyof typeof POOL_NAME
|
|
49
49
|
campaign?: Campaign
|
|
50
|
-
documentHash
|
|
50
|
+
documentHash?: string
|
|
51
51
|
handleClose: (options?: CloseModalOptions) => void
|
|
52
52
|
handleSuccess?: (blockNumber?: number) => void
|
|
53
53
|
}
|
|
@@ -29,14 +29,14 @@ export function NotifiContextWrapper({
|
|
|
29
29
|
|
|
30
30
|
let cardId = ''
|
|
31
31
|
if (chainId === ChainEnum.Celo || chainId === ChainEnum.Alfajores) {
|
|
32
|
-
cardId =
|
|
32
|
+
cardId = import.meta.env.VITE_NOTIFI_CONFIG_ID_CELO ?? ''
|
|
33
33
|
} else if (chainId === ChainEnum.Polygon || chainId === ChainEnum.Amoy) {
|
|
34
|
-
cardId =
|
|
34
|
+
cardId = import.meta.env.VITE_NOTIFI_CONFIG_ID_POLYGON ?? ''
|
|
35
35
|
} else if (
|
|
36
36
|
chainId === ChainEnum.Scroll ||
|
|
37
37
|
chainId === ChainEnum.ScrollSepolia
|
|
38
38
|
) {
|
|
39
|
-
cardId =
|
|
39
|
+
cardId = import.meta.env.VITE_NOTIFI_CONFIG_ID_SCROLL ?? ''
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (!cardId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatNumber, isEmpty } from '@huma-finance/shared'
|
|
1
|
+
import { CloseModalOptions, formatNumber, isEmpty } from '@huma-finance/shared'
|
|
2
2
|
import { txAtom } from '@huma-finance/web-shared'
|
|
3
3
|
import { Box, css, useTheme } from '@mui/material'
|
|
4
4
|
import { useResetAtom } from 'jotai/utils'
|
|
@@ -13,7 +13,7 @@ import { CongratulationsIcon, HumaPointsIcon, RibbonIcon } from './icons'
|
|
|
13
13
|
|
|
14
14
|
type Props = {
|
|
15
15
|
lpConfig: { withdrawalLockupPeriodDays?: number }
|
|
16
|
-
handleAction: () => void
|
|
16
|
+
handleAction: (options?: CloseModalOptions) => void
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function PointsEarned({
|
|
@@ -35,7 +35,7 @@ export function PointsEarned({
|
|
|
35
35
|
const handleCloseModal = useCallback(() => {
|
|
36
36
|
reset()
|
|
37
37
|
dispatch(resetState())
|
|
38
|
-
handleAction()
|
|
38
|
+
handleAction({ isSuccess: true })
|
|
39
39
|
}, [dispatch, handleAction, reset])
|
|
40
40
|
|
|
41
41
|
const styles = {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { SvgIconProps } from '@mui/material'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
2
|
+
import HumaLogoSvg from './huma.svg?react'
|
|
3
|
+
import HumaFullLogoSvg from './huma-full.svg?react'
|
|
4
|
+
import MetamaskSvg from './metamask.svg?react'
|
|
5
|
+
import WalletConnectSvg from './wallet-connect.svg?react'
|
|
6
|
+
import EthereumSvg from './ethereum.svg?react'
|
|
7
|
+
import PolygonSvg from './polygon.svg?react'
|
|
8
|
+
import ReceiptSvg from './receipt.svg?react'
|
|
9
|
+
import SeparatorSvg from './separator.svg?react'
|
|
10
|
+
import LoaderSvg from './loader.svg?react'
|
|
11
|
+
import SorrySvg from './sorry.svg?react'
|
|
12
|
+
import CheckSvg from './check.svg?react'
|
|
13
|
+
import CheckGreenSvg from './check-green.svg?react'
|
|
14
|
+
import CheckCircleSvg from './check-circle.svg?react'
|
|
15
|
+
import AutoPaybackSvg from './auto-payback.svg?react'
|
|
16
|
+
import ApproveLenderSvg from './approve-lender.svg?react'
|
|
17
|
+
import DonutSvg from './donut.svg?react'
|
|
18
|
+
import UsdcSvg from './usdc.svg?react'
|
|
19
|
+
import CeloSvg from './celo.svg?react'
|
|
20
|
+
import CongratulationsSvg from './congratulations.svg?react'
|
|
21
|
+
import RibbonSvg from './ribbon.svg?react'
|
|
22
|
+
import HumaPointsSvg from './huma-points.svg?react'
|
|
23
23
|
|
|
24
24
|
export function HumaIcon(props: SvgIconProps): React.ReactElement {
|
|
25
25
|
return <HumaLogoSvg {...props} />
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { JsonRpcProvider } from '@ethersproject/providers'
|
|
1
2
|
import { SuperfluidFactoringWidget } from '..'
|
|
2
|
-
import { initEnv } from './utils/env'
|
|
3
3
|
import { WalletWrapper } from './WalletWrapper'
|
|
4
4
|
|
|
5
|
-
initEnv()
|
|
6
|
-
|
|
7
5
|
function Fixture() {
|
|
8
|
-
return <SuperfluidFactoringWidget />
|
|
6
|
+
return <SuperfluidFactoringWidget provider={new JsonRpcProvider()} />
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
export default (
|
|
@@ -138,11 +138,13 @@ export const getProvider = (chainId = ChainEnum.Goerli) => {
|
|
|
138
138
|
const rpcUrlMap: { [x: number]: { name: string; url: string } } = {
|
|
139
139
|
[ChainEnum.Goerli]: {
|
|
140
140
|
name: 'Goerli',
|
|
141
|
-
url: `https://goerli.infura.io/v3/${
|
|
141
|
+
url: `https://goerli.infura.io/v3/${import.meta.env.VITE_INFURA_API_KEY}`,
|
|
142
142
|
},
|
|
143
143
|
[ChainEnum.Mumbai]: {
|
|
144
144
|
name: 'Mumbai',
|
|
145
|
-
url: `https://polygon-mumbai.g.alchemy.com/v2/${
|
|
145
|
+
url: `https://polygon-mumbai.g.alchemy.com/v2/${
|
|
146
|
+
import.meta.env.VITE_ALCHEMY_API_KEY
|
|
147
|
+
}`,
|
|
146
148
|
},
|
|
147
149
|
}
|
|
148
150
|
return new JsonRpcProvider(rpcUrlMap[chainId].url, {
|
package/src/hooks/useEA.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
checkIsDev,
|
|
3
2
|
EAPayload,
|
|
4
3
|
EARejectionError,
|
|
5
4
|
EARejectMessage,
|
|
6
5
|
EARejectReason,
|
|
7
6
|
EAService,
|
|
8
7
|
} from '@huma-finance/shared'
|
|
9
|
-
import { useAuthErrorHandling } from '@huma-finance/web-shared'
|
|
8
|
+
import { useAuthErrorHandling, checkIsDev } from '@huma-finance/web-shared'
|
|
10
9
|
import { useWeb3React } from '@web3-react/core'
|
|
11
10
|
import { useCallback } from 'react'
|
|
12
11
|
|
package/src/hooks/useNotifi.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
import {
|
|
3
|
-
checkIsDev,
|
|
4
3
|
doesChainSupportNotifi,
|
|
5
4
|
getBlockchainConfigFromChain,
|
|
6
5
|
} from '@huma-finance/shared'
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
useNotifiFrontendClientContext,
|
|
14
13
|
useNotifiUserSettingContext,
|
|
15
14
|
} from '@notifi-network/notifi-react'
|
|
15
|
+
import { checkIsDev } from '@huma-finance/web-shared'
|
|
16
16
|
|
|
17
17
|
export const useDoesChainSupportNotifi = (chainId: number | undefined) => {
|
|
18
18
|
const [notifiChainSupported, setNotifiChainSupported] = useState(false)
|
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JsonRpcProvider } from '@ethersproject/providers'
|
|
2
2
|
import { ThemeProvider } from '@mui/material'
|
|
3
|
-
import { Provider as Eip1193Provider } from '@web3-react/types'
|
|
4
3
|
import { Provider as AtomProvider } from 'jotai'
|
|
5
4
|
import { useEffect, useState } from 'react'
|
|
6
5
|
import { Provider as ReduxProvider } from 'react-redux'
|
|
@@ -117,13 +116,13 @@ type JsonRpcConnectionMap = {
|
|
|
117
116
|
* @typedef {Object} WidgetProps
|
|
118
117
|
* @property {desiredChainId|undefined} desiredChainId Optional desired chain id, will trigger the switch network action if different from the current chain id
|
|
119
118
|
* @property {JsonRpcConnectionMap|undefined} jsonRpcUrlMap Optional mapping of your JSON-RPC connections indexed by chainId
|
|
120
|
-
* @property {
|
|
119
|
+
* @property {JsonRpcProvider} provider EIP-1193 provider or JsonRpc Provider
|
|
121
120
|
*/
|
|
122
121
|
type WidgetProps = {
|
|
123
122
|
handleClose?: () => void
|
|
124
123
|
desiredChainId?: number
|
|
125
124
|
jsonRpcUrlMap?: JsonRpcConnectionMap
|
|
126
|
-
provider:
|
|
125
|
+
provider: JsonRpcProvider
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
function Widget(props: WCProps<WidgetProps>) {
|
|
@@ -132,10 +131,8 @@ function Widget(props: WCProps<WidgetProps>) {
|
|
|
132
131
|
|
|
133
132
|
useEffect(() => {
|
|
134
133
|
const getChainId = async () => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
setChainId(network?.chainId)
|
|
138
|
-
}
|
|
134
|
+
const network = await provider.getNetwork()
|
|
135
|
+
setChainId(network?.chainId)
|
|
139
136
|
}
|
|
140
137
|
getChainId()
|
|
141
138
|
}, [provider])
|
package/tsconfig.json
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
3
|
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"
|
|
4
|
+
"composite": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationDir": "dts",
|
|
7
|
+
"emitDeclarationOnly": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
10
9
|
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"jsxImportSource": "@emotion/react",
|
|
13
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
12
14
|
"module": "esnext",
|
|
13
15
|
"moduleResolution": "node",
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
17
|
"resolveJsonModule": true,
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"strict": true,
|
|
20
|
+
"target": "ES2020",
|
|
21
|
+
"paths": {
|
|
22
|
+
"@huma-finance/web-shared": ["../huma-web-shared/src"],
|
|
23
|
+
"@huma-finance/shared": ["../huma-shared/src"]
|
|
24
|
+
}
|
|
22
25
|
},
|
|
23
|
-
"include": ["src/**/*", "src/**/*.json"],
|
|
26
|
+
"include": ["src/**/*", "src/**/*.json", "./*.ts", "./*.d.ts"],
|
|
24
27
|
"references": [
|
|
25
28
|
{
|
|
26
29
|
"path": "../huma-shared"
|
|
27
30
|
},
|
|
28
31
|
{
|
|
29
|
-
"path": "../huma-
|
|
32
|
+
"path": "../huma-sdk"
|
|
30
33
|
},
|
|
31
34
|
{
|
|
32
|
-
"path": "../huma-
|
|
35
|
+
"path": "../huma-web-shared"
|
|
33
36
|
}
|
|
34
37
|
]
|
|
35
38
|
}
|
package/vite-env.d.ts
ADDED