@huma-finance/widgets 0.0.73-beta.924 → 0.0.73-beta.946
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 +220513 -11012
- 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/useLogOnFirstMount.d.ts +3 -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 +58 -0
- package/dist/src/store/widgets.selectors.d.ts +4 -0
- package/dist/src/store/widgets.store.d.ts +61 -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/1-Evaluation.tsx +3 -0
- package/src/components/Lend/solanaSupply/2-ApproveLender.tsx +3 -0
- package/src/components/Lend/solanaSupply/3-ChooseTranche.tsx +2 -0
- package/src/components/Lend/solanaSupply/4-ChooseAmount.tsx +2 -0
- package/src/components/Lend/solanaSupply/5-ApproveAllowance.tsx +2 -0
- package/src/components/Lend/solanaSupply/6-Transfer.tsx +3 -1
- package/src/components/Lend/solanaSupply/7-Success.tsx +2 -0
- package/src/components/Lend/solanaSupply/8-PointsEarned.tsx +8 -2
- package/src/components/Lend/solanaSupply/index.tsx +47 -8
- package/src/components/Lend/solanaWithdraw/1-ConfirmTransfer.tsx +2 -0
- package/src/components/Lend/solanaWithdraw/2-Transfer.tsx +2 -0
- package/src/components/Lend/solanaWithdraw/3-Done.tsx +2 -0
- package/src/components/Lend/solanaWithdraw/index.tsx +32 -7
- 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/SolanaTxSendModal.tsx +23 -1
- 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/useLogOnFirstMount.ts +19 -0
- package/src/hooks/useNotifi.ts +1 -1
- package/src/index.tsx +4 -7
- package/src/store/widgets.reducers.ts +6 -0
- package/src/store/widgets.selectors.ts +20 -0
- package/src/store/widgets.store.ts +2 -0
- 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 -11781
- 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.946+41e004f",
|
|
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.946+41e004f",
|
|
26
|
+
"@huma-finance/shared": "^0.0.73-beta.946+41e004f",
|
|
27
|
+
"@huma-finance/web-shared": "^0.0.73-beta.946+41e004f",
|
|
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": "41e004f81d708016545a4991f3d78e849ff54a39"
|
|
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'
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { PersonaEvaluation } from '../components/PersonaEvaluation'
|
|
5
5
|
import { Campaign } from '../supplyV2'
|
|
6
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
6
7
|
|
|
7
8
|
type Props = {
|
|
8
9
|
poolInfo: SolanaPoolInfo
|
|
@@ -19,6 +20,8 @@ export function Evaluation({
|
|
|
19
20
|
documentHash,
|
|
20
21
|
handleClose,
|
|
21
22
|
}: Props): React.ReactElement | null {
|
|
23
|
+
useLogOnFirstMount('Evaluation')
|
|
24
|
+
|
|
22
25
|
if (poolInfo.KYC?.Persona) {
|
|
23
26
|
return (
|
|
24
27
|
<PersonaEvaluation
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import React from 'react'
|
|
9
9
|
|
|
10
10
|
import { ApproveLenderBase } from '../components/ApproveLenderBase'
|
|
11
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
11
12
|
|
|
12
13
|
type Props = {
|
|
13
14
|
poolInfo: SolanaPoolInfo
|
|
@@ -22,6 +23,8 @@ export function ApproveLender({
|
|
|
22
23
|
documentHash,
|
|
23
24
|
changeTranche,
|
|
24
25
|
}: Props): React.ReactElement | null {
|
|
26
|
+
useLogOnFirstMount('ApproveLender')
|
|
27
|
+
|
|
25
28
|
const solanaChainInfo = SOLANA_CHAIN_INFO[poolInfo.chainId]
|
|
26
29
|
|
|
27
30
|
return (
|
|
@@ -15,6 +15,7 @@ import { setStep } from '../../../store/widgets.reducers'
|
|
|
15
15
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
16
16
|
import { BottomButton } from '../../BottomButton'
|
|
17
17
|
import { WrapperModal } from '../../WrapperModal'
|
|
18
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
18
19
|
|
|
19
20
|
type Props = {
|
|
20
21
|
poolUnderlyingToken: UnderlyingTokenInfo
|
|
@@ -27,6 +28,7 @@ export function ChooseTranche({
|
|
|
27
28
|
selectedTranche,
|
|
28
29
|
changeTranche,
|
|
29
30
|
}: Props): React.ReactElement | null {
|
|
31
|
+
useLogOnFirstMount('ChooseTranche')
|
|
30
32
|
const theme = useTheme()
|
|
31
33
|
const dispatch = useAppDispatch()
|
|
32
34
|
|
|
@@ -12,6 +12,7 @@ import { useAppDispatch } from '../../../hooks/useRedux'
|
|
|
12
12
|
import { setStep, setSupplyAmount } from '../../../store/widgets.reducers'
|
|
13
13
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
14
14
|
import { InputAmountModal } from '../../InputAmountModal'
|
|
15
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
15
16
|
|
|
16
17
|
type Props = {
|
|
17
18
|
poolInfo: SolanaPoolInfo
|
|
@@ -28,6 +29,7 @@ export function ChooseAmount({
|
|
|
28
29
|
selectedTranche,
|
|
29
30
|
isUniTranche,
|
|
30
31
|
}: Props): React.ReactElement | null {
|
|
32
|
+
useLogOnFirstMount('ChooseAmount')
|
|
31
33
|
const dispatch = useAppDispatch()
|
|
32
34
|
const { symbol, decimals } = poolInfo.underlyingMint
|
|
33
35
|
const [currentAmount, setCurrentAmount] = useState<number | string>(0)
|
|
@@ -8,12 +8,14 @@ import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
|
8
8
|
import { setStep } from '../../../store/widgets.reducers'
|
|
9
9
|
import { BottomButton } from '../../BottomButton'
|
|
10
10
|
import { AutoPaybackImg } from '../../images'
|
|
11
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
11
12
|
|
|
12
13
|
type Props = {
|
|
13
14
|
poolState: SolanaPoolState
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export function ApproveAllowance({ poolState }: Props): React.ReactElement {
|
|
18
|
+
useLogOnFirstMount('ApproveAllowance')
|
|
17
19
|
const theme = useTheme()
|
|
18
20
|
const dispatch = useAppDispatch()
|
|
19
21
|
const handleNext = useCallback(() => {
|
|
@@ -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,
|
|
@@ -28,6 +28,7 @@ import { selectWidgetState } from '../../../store/widgets.selectors'
|
|
|
28
28
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
29
29
|
import { LoadingModal } from '../../LoadingModal'
|
|
30
30
|
import { SolanaTxSendModal } from '../../SolanaTxSendModal'
|
|
31
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
31
32
|
|
|
32
33
|
type Props = {
|
|
33
34
|
poolInfo: SolanaPoolInfo
|
|
@@ -42,6 +43,7 @@ export function Transfer({
|
|
|
42
43
|
selectedTranche,
|
|
43
44
|
networkType,
|
|
44
45
|
}: Props): React.ReactElement | null {
|
|
46
|
+
useLogOnFirstMount('Transaction')
|
|
45
47
|
const isDev = checkIsDev()
|
|
46
48
|
const dispatch = useAppDispatch()
|
|
47
49
|
const { publicKey } = useWallet()
|
|
@@ -14,6 +14,7 @@ import { setStep } from '../../../store/widgets.reducers'
|
|
|
14
14
|
import { selectWidgetState } from '../../../store/widgets.selectors'
|
|
15
15
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
16
16
|
import { SolanaTxDoneModal } from '../../SolanaTxDoneModal'
|
|
17
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
17
18
|
|
|
18
19
|
type Props = {
|
|
19
20
|
poolInfo: SolanaPoolInfo
|
|
@@ -28,6 +29,7 @@ export function Success({
|
|
|
28
29
|
campaign,
|
|
29
30
|
handleAction,
|
|
30
31
|
}: Props): React.ReactElement {
|
|
32
|
+
useLogOnFirstMount('Success')
|
|
31
33
|
const dispatch = useDispatch()
|
|
32
34
|
const { supplyAmount, solanaSignature } = useAppSelector(selectWidgetState)
|
|
33
35
|
const { symbol } = poolInfo.underlyingMint
|
|
@@ -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'
|
|
@@ -18,6 +22,7 @@ import { BottomButton } from '../../BottomButton'
|
|
|
18
22
|
import { CongratulationsIcon, HumaPointsIcon, RibbonIcon } from '../../icons'
|
|
19
23
|
import { LoadingModal } from '../../LoadingModal'
|
|
20
24
|
import { SignIn } from '../../SignIn'
|
|
25
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
21
26
|
|
|
22
27
|
enum STATE {
|
|
23
28
|
Loading = 'Loading',
|
|
@@ -38,6 +43,7 @@ export function PointsEarned({
|
|
|
38
43
|
networkType,
|
|
39
44
|
handleAction,
|
|
40
45
|
}: Props): React.ReactElement {
|
|
46
|
+
useLogOnFirstMount('PointsEarned')
|
|
41
47
|
const theme = useTheme()
|
|
42
48
|
const isDev = checkIsDev()
|
|
43
49
|
const dispatch = useDispatch()
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
TrancheType,
|
|
6
6
|
} from '@huma-finance/shared'
|
|
7
7
|
import {
|
|
8
|
+
LoggingContext,
|
|
9
|
+
LoggingContextHelper,
|
|
8
10
|
SolanaPoolState,
|
|
9
11
|
useLenderAccounts,
|
|
10
12
|
useTokenAccount,
|
|
@@ -13,8 +15,11 @@ import React, { useEffect, useState } from 'react'
|
|
|
13
15
|
import { useDispatch } from 'react-redux'
|
|
14
16
|
|
|
15
17
|
import { useAppSelector } from '../../../hooks/useRedux'
|
|
16
|
-
import { setStep } from '../../../store/widgets.reducers'
|
|
17
|
-
import {
|
|
18
|
+
import { setLoggingContext, setStep } from '../../../store/widgets.reducers'
|
|
19
|
+
import {
|
|
20
|
+
selectWidgetLoggingContext,
|
|
21
|
+
selectWidgetState,
|
|
22
|
+
} from '../../../store/widgets.selectors'
|
|
18
23
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
19
24
|
import { PointsEarned } from '../../PointsEarned'
|
|
20
25
|
import { WidgetWrapper } from '../../WidgetWrapper'
|
|
@@ -65,33 +70,67 @@ export function SolanaLendSupply({
|
|
|
65
70
|
} = useLenderAccounts(poolInfo.chainId, poolInfo.poolName)
|
|
66
71
|
const [tokenAccount, isLoadingTokenAccount] = useTokenAccount(poolInfo)
|
|
67
72
|
const { step, errorMessage } = useAppSelector(selectWidgetState)
|
|
73
|
+
const loggingHelper = useAppSelector(selectWidgetLoggingContext)
|
|
68
74
|
const [selectedTranche, setSelectedTranche] = useState<TrancheType>()
|
|
69
75
|
|
|
76
|
+
const handleCloseFlow = () => {
|
|
77
|
+
loggingHelper.logAction('ExitFlow', {})
|
|
78
|
+
handleClose()
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
useEffect(() => {
|
|
71
82
|
if (!step && !isLoadingLenderAccounts && !isLoadingTokenAccount) {
|
|
83
|
+
// Set initial logging context
|
|
84
|
+
const context: LoggingContext = {
|
|
85
|
+
flow: 'Supply',
|
|
86
|
+
chainId: poolInfo.chainId,
|
|
87
|
+
poolName: poolInfo.poolName,
|
|
88
|
+
poolType: poolInfo.poolType,
|
|
89
|
+
}
|
|
90
|
+
const loggingHelperInit = new LoggingContextHelper(context)
|
|
91
|
+
loggingHelperInit.logAction('StartFlow', {})
|
|
92
|
+
dispatch(setLoggingContext(context))
|
|
93
|
+
|
|
72
94
|
if (!juniorLenderApproved && !seniorLenderApproved) {
|
|
95
|
+
loggingHelperInit.logAction('SetInitialStep', {
|
|
96
|
+
step: WIDGET_STEP.Evaluation,
|
|
97
|
+
})
|
|
73
98
|
dispatch(setStep(WIDGET_STEP.Evaluation))
|
|
74
99
|
return
|
|
75
100
|
}
|
|
76
101
|
|
|
77
102
|
if (!isUniTranche && (!juniorLenderApproved || !seniorLenderApproved)) {
|
|
103
|
+
loggingHelperInit.logAction('SetInitialStep', {
|
|
104
|
+
step: WIDGET_STEP.ApproveLender,
|
|
105
|
+
})
|
|
78
106
|
dispatch(setStep(WIDGET_STEP.ApproveLender))
|
|
79
107
|
return
|
|
80
108
|
}
|
|
81
109
|
|
|
82
110
|
if (juniorLenderApproved && !seniorLenderApproved) {
|
|
111
|
+
loggingHelperInit.logAction('SetInitialStep', {
|
|
112
|
+
step: WIDGET_STEP.ChooseAmount,
|
|
113
|
+
tranche: 'junior',
|
|
114
|
+
})
|
|
83
115
|
setSelectedTranche('junior')
|
|
84
116
|
dispatch(setStep(WIDGET_STEP.ChooseAmount))
|
|
85
117
|
return
|
|
86
118
|
}
|
|
87
119
|
|
|
88
120
|
if (seniorLenderApproved && !juniorLenderApproved) {
|
|
121
|
+
loggingHelperInit.logAction('SetInitialStep', {
|
|
122
|
+
step: WIDGET_STEP.ChooseAmount,
|
|
123
|
+
tranche: 'senior',
|
|
124
|
+
})
|
|
89
125
|
setSelectedTranche('senior')
|
|
90
126
|
dispatch(setStep(WIDGET_STEP.ChooseAmount))
|
|
91
127
|
return
|
|
92
128
|
}
|
|
93
129
|
|
|
94
130
|
if (juniorLenderApproved && seniorLenderApproved) {
|
|
131
|
+
loggingHelperInit.logAction('SetInitialStep', {
|
|
132
|
+
step: WIDGET_STEP.ChooseTranche,
|
|
133
|
+
})
|
|
95
134
|
dispatch(setStep(WIDGET_STEP.ChooseTranche))
|
|
96
135
|
}
|
|
97
136
|
}
|
|
@@ -113,7 +152,7 @@ export function SolanaLendSupply({
|
|
|
113
152
|
isOpen
|
|
114
153
|
isLoading
|
|
115
154
|
loadingTitle='Supply'
|
|
116
|
-
handleClose={
|
|
155
|
+
handleClose={handleCloseFlow}
|
|
117
156
|
handleSuccess={handleSuccess}
|
|
118
157
|
/>
|
|
119
158
|
)
|
|
@@ -123,7 +162,7 @@ export function SolanaLendSupply({
|
|
|
123
162
|
<WidgetWrapper
|
|
124
163
|
isOpen
|
|
125
164
|
loadingTitle={`Supply ${poolInfo.underlyingMint.symbol}`}
|
|
126
|
-
handleClose={
|
|
165
|
+
handleClose={handleCloseFlow}
|
|
127
166
|
handleSuccess={handleSuccess}
|
|
128
167
|
>
|
|
129
168
|
{step === WIDGET_STEP.Evaluation && (
|
|
@@ -132,7 +171,7 @@ export function SolanaLendSupply({
|
|
|
132
171
|
campaign={poolState.campaign}
|
|
133
172
|
documentHash={documentHash}
|
|
134
173
|
networkType={getSolanaNetworkType(poolInfo.chainId)}
|
|
135
|
-
handleClose={
|
|
174
|
+
handleClose={handleCloseFlow}
|
|
136
175
|
/>
|
|
137
176
|
)}
|
|
138
177
|
{step === WIDGET_STEP.ApproveLender && (
|
|
@@ -175,11 +214,11 @@ export function SolanaLendSupply({
|
|
|
175
214
|
poolInfo={poolInfo}
|
|
176
215
|
poolState={poolState}
|
|
177
216
|
campaign={poolState.campaign}
|
|
178
|
-
handleAction={
|
|
217
|
+
handleAction={handleCloseFlow}
|
|
179
218
|
/>
|
|
180
219
|
)}
|
|
181
220
|
{step === WIDGET_STEP.PointsEarned && (
|
|
182
|
-
<PointsEarned lpConfig={poolState} handleAction={
|
|
221
|
+
<PointsEarned lpConfig={poolState} handleAction={handleCloseFlow} />
|
|
183
222
|
)}
|
|
184
223
|
{step === WIDGET_STEP.Error && (
|
|
185
224
|
<SolanaErrorModal
|
|
@@ -187,7 +226,7 @@ export function SolanaLendSupply({
|
|
|
187
226
|
title='Supply'
|
|
188
227
|
errorReason='Sorry there was an error'
|
|
189
228
|
errorMessage={errorMessage}
|
|
190
|
-
handleOk={
|
|
229
|
+
handleOk={handleCloseFlow}
|
|
191
230
|
/>
|
|
192
231
|
)}
|
|
193
232
|
</WidgetWrapper>
|
|
@@ -6,6 +6,7 @@ import { setStep } from '../../../store/widgets.reducers'
|
|
|
6
6
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
7
7
|
import { BottomButton } from '../../BottomButton'
|
|
8
8
|
import { WrapperModal } from '../../WrapperModal'
|
|
9
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
9
10
|
|
|
10
11
|
type Props = {
|
|
11
12
|
poolUnderlyingToken: UnderlyingTokenInfo
|
|
@@ -18,6 +19,7 @@ export function ConfirmTransfer({
|
|
|
18
19
|
withdrawableAmountFormatted,
|
|
19
20
|
sharePrice,
|
|
20
21
|
}: Props): React.ReactElement {
|
|
22
|
+
useLogOnFirstMount('ConfirmTransfer')
|
|
21
23
|
const theme = useTheme()
|
|
22
24
|
const dispatch = useDispatch()
|
|
23
25
|
const { symbol } = poolUnderlyingToken
|
|
@@ -12,6 +12,7 @@ import { useAppDispatch } from '../../../hooks/useRedux'
|
|
|
12
12
|
import { setStep } from '../../../store/widgets.reducers'
|
|
13
13
|
import { WIDGET_STEP } from '../../../store/widgets.store'
|
|
14
14
|
import { SolanaTxSendModal } from '../../SolanaTxSendModal'
|
|
15
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
15
16
|
|
|
16
17
|
type Props = {
|
|
17
18
|
poolInfo: SolanaPoolInfo
|
|
@@ -24,6 +25,7 @@ export function Transfer({
|
|
|
24
25
|
selectedTranche,
|
|
25
26
|
poolIsClosed,
|
|
26
27
|
}: Props): React.ReactElement | null {
|
|
28
|
+
useLogOnFirstMount('Transaction')
|
|
27
29
|
const { publicKey } = useWallet()
|
|
28
30
|
const dispatch = useAppDispatch()
|
|
29
31
|
const program = useHumaProgram(poolInfo.chainId)
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from '@huma-finance/shared'
|
|
7
7
|
import React from 'react'
|
|
8
8
|
import { TxDoneModal } from '../../TxDoneModal'
|
|
9
|
+
import useLogOnFirstMount from '../../../hooks/useLogOnFirstMount'
|
|
9
10
|
|
|
10
11
|
type Props = {
|
|
11
12
|
poolUnderlyingToken: UnderlyingTokenInfo
|
|
@@ -18,6 +19,7 @@ export function Done({
|
|
|
18
19
|
withdrawAmount,
|
|
19
20
|
handleAction,
|
|
20
21
|
}: Props): React.ReactElement {
|
|
22
|
+
useLogOnFirstMount('Success')
|
|
21
23
|
const { symbol } = poolUnderlyingToken
|
|
22
24
|
const withdrawAmountFormatted = formatMoneyFixed(
|
|
23
25
|
SolanaTokenUtils.formatUnits(withdrawAmount, poolUnderlyingToken.decimals),
|