@lifi/widget 3.30.0 → 3.30.1
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/CHANGELOG.md +12 -0
- package/dist/esm/AppProvider.d.ts +0 -1
- package/dist/esm/AppProvider.js +1 -1
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.d.ts +0 -9
- package/dist/esm/components/AmountInput/AmountInput.js +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +0 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +1 -6
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.d.ts +0 -6
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +0 -4
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +0 -15
- package/dist/esm/components/Avatar/TokenAvatar.js +2 -2
- package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.d.ts +0 -1
- package/dist/esm/components/Card/CardButton.style.js +0 -7
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.d.ts +2 -3
- package/dist/esm/components/FeeBreakdownTooltip.js +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
- package/dist/esm/components/Header/Header.d.ts +1 -2
- package/dist/esm/components/Header/Header.js +1 -1
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
- package/dist/esm/components/Header/WalletHeader.js +1 -1
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.d.ts +1 -10
- package/dist/esm/components/StepActions/StepActions.js +6 -6
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.d.ts +0 -1
- package/dist/esm/components/Tabs/Tabs.style.js +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/TimerContent.js +1 -2
- package/dist/esm/components/Timer/TimerContent.js.map +1 -1
- package/dist/esm/components/Token/Token.d.ts +0 -2
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.d.ts +1 -4
- package/dist/esm/components/TokenList/TokenListItem.js +3 -3
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +2 -1
- package/dist/esm/components/TokenList/useTokenSelect.d.ts +0 -4
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js +1 -3
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/hooks/timer/time.d.ts +0 -8
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.d.ts +3 -2
- package/dist/esm/hooks/useAccountsBalancesData.js +1 -1
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.d.ts +2 -1
- package/dist/esm/hooks/useChain.d.ts +1 -1
- package/dist/esm/hooks/useChains.d.ts +1 -1
- package/dist/esm/hooks/useExplorer.d.ts +2 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.d.ts +2 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +12 -3
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useListHeight.d.ts +0 -2
- package/dist/esm/hooks/useListHeight.js +2 -2
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +2 -2
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.d.ts +2 -1
- package/dist/esm/hooks/useToken.js +4 -3
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +3 -2
- package/dist/esm/hooks/useTokenAddressBalance.js +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +1 -1
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +3 -3
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.d.ts +1 -1
- package/dist/esm/hooks/useTokens.js +27 -6
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/i18n/pt.json +4 -4
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +27 -17
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +2 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.d.ts +0 -5
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +4 -3
- package/dist/esm/providers/WalletProvider/EVMProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +1 -2
- package/dist/esm/stores/bookmarks/BookmarkStore.js +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.d.ts +0 -5
- package/dist/esm/stores/chains/ChainOrderStore.js +2 -2
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/types.d.ts +2 -1
- package/dist/esm/stores/header/types.d.ts +2 -1
- package/dist/esm/stores/header/useHeaderStore.d.ts +1 -4
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -2
- package/dist/esm/stores/routes/RouteExecutionStore.js +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +3 -3
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsStore.d.ts +1 -2
- package/dist/esm/stores/settings/useSettingsStore.js +1 -1
- package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/useSplitSubvariantStore.d.ts +1 -4
- package/dist/esm/stores/settings/useSplitSubvariantStore.js +3 -3
- package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
- package/dist/esm/types/events.d.ts +0 -4
- package/dist/esm/types/events.js +0 -4
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/utils/fees.d.ts +1 -4
- package/dist/esm/utils/fees.js +3 -3
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.js +1 -1
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/navigationRoutes.d.ts +2 -1
- package/dist/esm/utils/token.js +2 -2
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.d.ts +0 -4
- package/dist/esm/utils/tokenList.js +3 -3
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +7 -7
- package/package.json.tmp +6 -6
- package/src/AppProvider.tsx +1 -1
- package/src/components/AmountInput/AmountInput.tsx +1 -1
- package/src/components/AmountInput/AmountInputAdornment.style.tsx +1 -7
- package/src/components/AmountInput/PriceFormHelperText.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Avatar/TokenAvatar.tsx +2 -2
- package/src/components/Card/CardButton.style.tsx +0 -8
- package/src/components/FeeBreakdownTooltip.tsx +2 -5
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/WalletHeader.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +0 -1
- package/src/components/StepActions/StepActions.tsx +6 -6
- package/src/components/Tabs/Tabs.style.tsx +1 -1
- package/src/components/Timer/TimerContent.tsx +1 -2
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenListItem.tsx +17 -19
- package/src/components/TokenList/types.ts +1 -1
- package/src/components/TokenList/useTokenSelect.ts +0 -5
- package/src/components/TokenRate/TokenRate.tsx +0 -1
- package/src/components/TransactionDetails.tsx +0 -1
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +0 -10
- package/src/hooks/timer/useTimer.ts +2 -2
- package/src/hooks/useAccountsBalancesData.ts +1 -1
- package/src/hooks/useAvailableChains.ts +1 -1
- package/src/hooks/useExplorer.ts +1 -1
- package/src/hooks/useFilteredByTokenBalances.ts +32 -3
- package/src/hooks/useListHeight.ts +2 -2
- package/src/hooks/useRoutes.ts +4 -2
- package/src/hooks/useToAddressAutoPopulate.ts +1 -1
- package/src/hooks/useToken.ts +10 -4
- package/src/hooks/useTokenAddressBalance.ts +2 -1
- package/src/hooks/useTokenBalances.ts +1 -1
- package/src/hooks/useTokenSearch.ts +4 -7
- package/src/hooks/useTokens.ts +44 -6
- package/src/i18n/pt.json +4 -4
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +0 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +33 -30
- package/src/pages/TransactionPage/RouteTracker.tsx +1 -1
- package/src/pages/TransactionPage/StatusBottomSheet.tsx +5 -3
- package/src/providers/I18nProvider/types.ts +3 -3
- package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SuiProvider.tsx +1 -1
- package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
- package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
- package/src/stores/bookmarks/BookmarkStore.tsx +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +3 -7
- package/src/stores/chains/types.ts +1 -1
- package/src/stores/header/types.ts +1 -1
- package/src/stores/header/useHeaderStore.tsx +3 -3
- package/src/stores/inputMode/useInputModeStore.ts +1 -1
- package/src/stores/routes/RouteExecutionStore.tsx +4 -3
- package/src/stores/settings/types.ts +2 -6
- package/src/stores/settings/useSettingsStore.ts +1 -1
- package/src/stores/settings/useSplitSubvariantStore.tsx +5 -4
- package/src/types/events.ts +0 -4
- package/src/utils/fees.ts +3 -3
- package/src/utils/format.ts +2 -1
- package/src/utils/navigationRoutes.ts +1 -1
- package/src/utils/token.ts +4 -2
- package/src/utils/tokenList.ts +4 -4
- package/dist/esm/AppDrawer.style.d.ts +0 -1
- package/dist/esm/AppDrawer.style.js +0 -12
- package/dist/esm/AppDrawer.style.js.map +0 -1
- package/dist/esm/components/Select.d.ts +0 -3
- package/dist/esm/components/Select.js +0 -35
- package/dist/esm/components/Select.js.map +0 -1
- package/dist/esm/components/StepActions/StepFees.d.ts +0 -5
- package/dist/esm/components/StepActions/StepFees.js +0 -32
- package/dist/esm/components/StepActions/StepFees.js.map +0 -1
- package/dist/esm/pages/MainPage/MainPage.style.d.ts +0 -1
- package/dist/esm/pages/MainPage/MainPage.style.js +0 -8
- package/dist/esm/pages/MainPage/MainPage.style.js.map +0 -1
- package/dist/esm/pages/SelectNativeTokenPage.d.ts +0 -2
- package/dist/esm/pages/SelectNativeTokenPage.js +0 -23
- package/dist/esm/pages/SelectNativeTokenPage.js.map +0 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.d.ts +0 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js +0 -6
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js.map +0 -1
- package/dist/esm/pages/SelectTokenPage/types.d.ts +0 -4
- package/dist/esm/pages/SelectTokenPage/types.js +0 -6
- package/dist/esm/pages/SelectTokenPage/types.js.map +0 -1
- package/dist/esm/providers/WidgetProvider/utils.d.ts +0 -5
- package/dist/esm/providers/WidgetProvider/utils.js +0 -17
- package/dist/esm/providers/WidgetProvider/utils.js.map +0 -1
- package/dist/esm/stores/form/useFieldController.d.ts +0 -11
- package/dist/esm/stores/form/useFieldController.js +0 -20
- package/dist/esm/stores/form/useFieldController.js.map +0 -1
- package/dist/esm/stores/form/useValidation.d.ts +0 -2
- package/dist/esm/stores/form/useValidation.js +0 -14
- package/dist/esm/stores/form/useValidation.js.map +0 -1
- package/dist/esm/stores/form/useValidationActions.d.ts +0 -2
- package/dist/esm/stores/form/useValidationActions.js +0 -10
- package/dist/esm/stores/form/useValidationActions.js.map +0 -1
- package/src/AppDrawer.style.tsx +0 -12
- package/src/components/Select.tsx +0 -42
- package/src/components/StepActions/StepFees.tsx +0 -49
- package/src/pages/MainPage/MainPage.style.tsx +0 -8
- package/src/pages/SelectNativeTokenPage.tsx +0 -47
- package/src/pages/SelectTokenPage/SearchTokenInput.style.tsx +0 -6
- package/src/pages/SelectTokenPage/types.ts +0 -4
- package/src/providers/WidgetProvider/utils.ts +0 -26
- package/src/stores/form/useFieldController.ts +0 -31
- package/src/stores/form/useValidation.ts +0 -15
- package/src/stores/form/useValidationActions.ts +0 -12
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { inputBaseClasses, listItemIconClasses, Select as MuiSelect, outlinedInputClasses, selectClasses, styled, } from '@mui/material';
|
|
2
|
-
export const Select = styled(MuiSelect, {
|
|
3
|
-
shouldForwardProp: (prop) => prop !== 'dense',
|
|
4
|
-
})(({ theme }) => ({
|
|
5
|
-
backgroundColor: theme.vars.palette.common.white,
|
|
6
|
-
[`.${inputBaseClasses.input}`]: {
|
|
7
|
-
padding: theme.spacing(2),
|
|
8
|
-
display: 'flex',
|
|
9
|
-
alignItems: 'center',
|
|
10
|
-
},
|
|
11
|
-
[`.${selectClasses.icon}`]: {
|
|
12
|
-
right: 10,
|
|
13
|
-
color: theme.vars.palette.text.primary,
|
|
14
|
-
},
|
|
15
|
-
[`.${listItemIconClasses.root}`]: {
|
|
16
|
-
minWidth: 38,
|
|
17
|
-
},
|
|
18
|
-
[`.${outlinedInputClasses.notchedOutline}`]: {
|
|
19
|
-
display: 'none',
|
|
20
|
-
},
|
|
21
|
-
...theme.applyStyles('dark', {
|
|
22
|
-
backgroundColor: theme.vars.palette.background.paper,
|
|
23
|
-
}),
|
|
24
|
-
variants: [
|
|
25
|
-
{
|
|
26
|
-
props: ({ dense }) => dense,
|
|
27
|
-
style: {
|
|
28
|
-
[`.${inputBaseClasses.input}`]: {
|
|
29
|
-
padding: theme.spacing(1.625, 2, 1.5, 2),
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}));
|
|
35
|
-
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,IAAI,SAAS,EACnB,oBAAoB,EACpB,aAAa,EACb,MAAM,GACP,MAAM,eAAe,CAAA;AAEtB,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE;IACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO;CAC9C,CAAC,CAAsB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACtC,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;IAChD,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACzB,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;KACrB;IACD,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE;QAC1B,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO;KACvC;IACD,CAAC,IAAI,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE;QAChC,QAAQ,EAAE,EAAE;KACb;IACD,CAAC,IAAI,oBAAoB,CAAC,cAAc,EAAE,CAAC,EAAE;QAC3C,OAAO,EAAE,MAAM;KAChB;IACD,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE;QAC3B,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK;KACrD,CAAC;IACF,QAAQ,EAAE;QACR;YACE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;YAC3B,KAAK,EAAE;gBACL,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,CAAC,EAAE;oBAC9B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;iBACzC;aACF;SACF;KACF;CACF,CAAC,CAAC,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Typography } from '@mui/material';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { getStepFeeCostsBreakdown } from '../../utils/fees.js';
|
|
5
|
-
export const StepFees = ({ step, ...other }) => {
|
|
6
|
-
const { t } = useTranslation();
|
|
7
|
-
const isDone = step.execution?.status === 'DONE';
|
|
8
|
-
const gasCosts = step.execution?.gasCosts ?? step.estimate.gasCosts;
|
|
9
|
-
const feeCosts = step.execution?.feeCosts ?? step.estimate.feeCosts;
|
|
10
|
-
let fees = 0;
|
|
11
|
-
if (gasCosts) {
|
|
12
|
-
const { amountUSD } = getStepFeeCostsBreakdown(gasCosts);
|
|
13
|
-
fees += amountUSD;
|
|
14
|
-
}
|
|
15
|
-
if (feeCosts) {
|
|
16
|
-
const filteredfeeCosts = feeCosts?.filter((fee) => !fee.included);
|
|
17
|
-
if (filteredfeeCosts?.length) {
|
|
18
|
-
const { amountUSD } = getStepFeeCostsBreakdown(filteredfeeCosts);
|
|
19
|
-
fees += amountUSD;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return (_jsxs(Typography, { ...other, sx: [
|
|
23
|
-
{
|
|
24
|
-
fontSize: 12,
|
|
25
|
-
fontWeight: '500',
|
|
26
|
-
color: 'text.secondary',
|
|
27
|
-
lineHeight: 1.3334,
|
|
28
|
-
},
|
|
29
|
-
...(Array.isArray(other.sx) ? other.sx : [other.sx]),
|
|
30
|
-
], children: [t('format.currency', { value: fees }), ' ', isDone ? t('main.fees.paid') : t('main.fees.estimated')] }));
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=StepFees.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepFees.js","sourceRoot":"","sources":["../../../../src/components/StepActions/StepFees.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,MAAM,CAAC,MAAM,QAAQ,GAIjB,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACzB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAE9B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAA;IAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;IACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;IACnE,IAAI,IAAI,GAAG,CAAC,CAAA;IAEZ,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA;QACxD,IAAI,IAAI,SAAS,CAAA;IACnB,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,gBAAgB,GAAG,QAAQ,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACjE,IAAI,gBAAgB,EAAE,MAAM,EAAE,CAAC;YAC7B,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAA;YAChE,IAAI,IAAI,SAAS,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,CACL,MAAC,UAAU,OACL,KAAK,EACT,EAAE,EAAE;YACF;gBACE,QAAQ,EAAE,EAAE;gBACZ,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,gBAAgB;gBACvB,UAAU,EAAE,MAAM;aACnB;YACD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;SACrD,aAEA,CAAC,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAC1C,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAC7C,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FormContainer: import("@emotion/styled").StyledComponent<import("@mui/material").ContainerOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "fixed" | "maxWidth" | "children" | "sx" | "style" | "className" | "classes" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MainPage.style.js","sourceRoot":"","sources":["../../../../src/pages/MainPage/MainPage.style.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,UAAU;CACrB,CAAC,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { List, ListItemAvatar } from '@mui/material';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { TokenAvatar } from '../components/Avatar/TokenAvatar.js';
|
|
5
|
-
import { ListItemButton } from '../components/ListItemButton.js';
|
|
6
|
-
import { ListItemText } from '../components/ListItemText.js';
|
|
7
|
-
import { PageContainer } from '../components/PageContainer.js';
|
|
8
|
-
import { useTokenSelect } from '../components/TokenList/useTokenSelect.js';
|
|
9
|
-
import { useChains } from '../hooks/useChains.js';
|
|
10
|
-
import { useNavigateBack } from '../hooks/useNavigateBack.js';
|
|
11
|
-
export const SelectNativeTokenPage = ({ formType, }) => {
|
|
12
|
-
const { t } = useTranslation();
|
|
13
|
-
const { navigateBack } = useNavigateBack();
|
|
14
|
-
const { chains } = useChains();
|
|
15
|
-
const selectToken = useTokenSelect(formType, navigateBack);
|
|
16
|
-
return (_jsx(PageContainer, { disableGutters: true, children: _jsx(List, { sx: {
|
|
17
|
-
paddingTop: 0,
|
|
18
|
-
paddingLeft: 1.5,
|
|
19
|
-
paddingRight: 1.5,
|
|
20
|
-
paddingBottom: 1.5,
|
|
21
|
-
}, children: chains?.map((chain) => (_jsxs(ListItemButton, { onClick: () => selectToken(chain.nativeToken.address, chain.id), children: [_jsx(ListItemAvatar, { children: _jsx(TokenAvatar, { token: chain.nativeToken, chain: chain }) }), _jsx(ListItemText, { primary: chain.nativeToken.symbol, secondary: t('main.onChain', { chainName: chain.name }) })] }, chain.id))) }) }));
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=SelectNativeTokenPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectNativeTokenPage.js","sourceRoot":"","sources":["../../../src/pages/SelectNativeTokenPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAG7D,MAAM,CAAC,MAAM,qBAAqB,GAA4B,CAAC,EAC7D,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAA;IAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAA;IAC9B,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;IAE1D,OAAO,CACL,KAAC,aAAa,IAAC,cAAc,kBAC3B,KAAC,IAAI,IACH,EAAE,EAAE;gBACF,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,GAAG;gBAChB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,GAAG;aACnB,YAEA,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,MAAC,cAAc,IAEb,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,aAE/D,KAAC,cAAc,cACb,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,GAAI,GACxC,EACjB,KAAC,YAAY,IACX,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM,EACjC,SAAS,EAAE,CAAC,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,GACvD,KATG,KAAK,CAAC,EAAE,CAUE,CAClB,CAAC,GACG,GACO,CACjB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Input: import("@emotion/styled").StyledComponent<import("@mui/material").InputBaseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchTokenInput.style.js","sourceRoot":"","sources":["../../../../src/pages/SelectTokenPage/SearchTokenInput.style.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE9D,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACrD,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;CACjC,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/pages/SelectTokenPage/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,iDAAM,CAAA;IACN,mDAAO,CAAA;AACT,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { WidgetConfig } from '../../types/widget.js';
|
|
2
|
-
export declare const attemptToFindMatchingToAddressInConfig: (address: string, config: WidgetConfig) => import("../../index.js").ToAddress | {
|
|
3
|
-
address: string;
|
|
4
|
-
chainType: import("@lifi/sdk").ChainType | undefined;
|
|
5
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getChainTypeFromAddress } from '../../utils/chainType.js';
|
|
2
|
-
export const attemptToFindMatchingToAddressInConfig = (address, config) => {
|
|
3
|
-
if (config.toAddress && config.toAddress.address === address) {
|
|
4
|
-
return config.toAddress;
|
|
5
|
-
}
|
|
6
|
-
if (config.toAddresses?.length) {
|
|
7
|
-
const matchingToAddress = config.toAddresses.find((toAddress) => toAddress.address === address);
|
|
8
|
-
if (matchingToAddress) {
|
|
9
|
-
return matchingToAddress;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
address: address,
|
|
14
|
-
chainType: getChainTypeFromAddress(address),
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/providers/WidgetProvider/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAElE,MAAM,CAAC,MAAM,sCAAsC,GAAG,CACpD,OAAe,EACf,MAAoB,EACpB,EAAE;IACF,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAC7D,OAAO,MAAM,CAAC,SAAS,CAAA;IACzB,CAAC;IAED,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;QAC/B,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAC/C,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,KAAK,OAAO,CAC7C,CAAA;QAED,IAAI,iBAAiB,EAAE,CAAC;YACtB,OAAO,iBAAiB,CAAA;QAC1B,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,SAAS,EAAE,uBAAuB,CAAC,OAAO,CAAC;KAC5C,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { FormFieldNames } from './types.js';
|
|
2
|
-
interface UseFieldControllerProps {
|
|
3
|
-
name: FormFieldNames;
|
|
4
|
-
}
|
|
5
|
-
export declare const useFieldController: ({ name }: UseFieldControllerProps) => {
|
|
6
|
-
onChange: (newValue: string | number | undefined) => void;
|
|
7
|
-
onBlur: () => void;
|
|
8
|
-
name: keyof import("./types.js").DefaultValues;
|
|
9
|
-
value: string | number | import("@lifi/sdk").ContractCall[] | undefined;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import { useFieldActions } from './useFieldActions.js';
|
|
3
|
-
import { useFieldValues } from './useFieldValues.js';
|
|
4
|
-
export const useFieldController = ({ name }) => {
|
|
5
|
-
const [fieldValue] = useFieldValues(name);
|
|
6
|
-
const { setFieldValue, setAsTouched } = useFieldActions();
|
|
7
|
-
const onChange = useCallback((newValue) => {
|
|
8
|
-
setFieldValue(name, newValue, { isDirty: true, isTouched: true });
|
|
9
|
-
}, [name, setFieldValue]);
|
|
10
|
-
const onBlur = useCallback(() => {
|
|
11
|
-
setAsTouched(name);
|
|
12
|
-
}, [name, setAsTouched]);
|
|
13
|
-
return {
|
|
14
|
-
onChange,
|
|
15
|
-
onBlur,
|
|
16
|
-
name,
|
|
17
|
-
value: fieldValue,
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=useFieldController.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFieldController.js","sourceRoot":"","sources":["../../../../src/stores/form/useFieldController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAMpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,IAAI,EAA2B,EAAE,EAAE;IACtE,MAAM,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAA;IAEzD,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,QAAqC,EAAE,EAAE;QACxC,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACnE,CAAC,EACD,CAAC,IAAI,EAAE,aAAa,CAAC,CACtB,CAAA;IAED,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,YAAY,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAA;IAExB,OAAO;QACL,QAAQ;QACR,MAAM;QACN,IAAI;QACJ,KAAK,EAAE,UAAU;KAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { useFormStore } from './useFormStore.js';
|
|
2
|
-
export const useValidation = () => {
|
|
3
|
-
const [isValid, isValidating, errors] = useFormStore((store) => [
|
|
4
|
-
store.isValid,
|
|
5
|
-
store.isValidating,
|
|
6
|
-
store.errors,
|
|
7
|
-
]);
|
|
8
|
-
return {
|
|
9
|
-
isValid,
|
|
10
|
-
isValidating,
|
|
11
|
-
errors,
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=useValidation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useValidation.js","sourceRoot":"","sources":["../../../../src/stores/form/useValidation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAwC,EAAE;IACrE,MAAM,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QAC9D,KAAK,CAAC,OAAO;QACb,KAAK,CAAC,YAAY;QAClB,KAAK,CAAC,MAAM;KACb,CAAC,CAAA;IAEF,OAAO;QACL,OAAO;QACP,YAAY;QACZ,MAAM;KACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useFormStore } from './useFormStore.js';
|
|
2
|
-
export const useValidationActions = () => {
|
|
3
|
-
const actions = useFormStore((store) => ({
|
|
4
|
-
addFieldValidation: store.addFieldValidation,
|
|
5
|
-
triggerFieldValidation: store.triggerFieldValidation,
|
|
6
|
-
clearErrors: store.clearErrors,
|
|
7
|
-
}));
|
|
8
|
-
return actions;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=useValidationActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useValidationActions.js","sourceRoot":"","sources":["../../../../src/stores/form/useValidationActions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,MAAM,OAAO,GAAG,YAAY,CAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC1D,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;QACpD,WAAW,EAAE,KAAK,CAAC,WAAW;KAC/B,CAAC,CAAC,CAAA;IAEH,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
package/src/AppDrawer.style.tsx
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IconButton, styled } from '@mui/material'
|
|
2
|
-
|
|
3
|
-
export const CloseButtonLayout = styled(IconButton)(() => ({
|
|
4
|
-
position: 'absolute',
|
|
5
|
-
top: '12px',
|
|
6
|
-
right: '26px',
|
|
7
|
-
zIndex: 1,
|
|
8
|
-
height: '40px',
|
|
9
|
-
width: '40px',
|
|
10
|
-
alignItems: 'center',
|
|
11
|
-
justifyContent: 'center',
|
|
12
|
-
}))
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
inputBaseClasses,
|
|
3
|
-
listItemIconClasses,
|
|
4
|
-
Select as MuiSelect,
|
|
5
|
-
outlinedInputClasses,
|
|
6
|
-
selectClasses,
|
|
7
|
-
styled,
|
|
8
|
-
} from '@mui/material'
|
|
9
|
-
|
|
10
|
-
export const Select = styled(MuiSelect, {
|
|
11
|
-
shouldForwardProp: (prop) => prop !== 'dense',
|
|
12
|
-
})<{ dense?: boolean }>(({ theme }) => ({
|
|
13
|
-
backgroundColor: theme.vars.palette.common.white,
|
|
14
|
-
[`.${inputBaseClasses.input}`]: {
|
|
15
|
-
padding: theme.spacing(2),
|
|
16
|
-
display: 'flex',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
},
|
|
19
|
-
[`.${selectClasses.icon}`]: {
|
|
20
|
-
right: 10,
|
|
21
|
-
color: theme.vars.palette.text.primary,
|
|
22
|
-
},
|
|
23
|
-
[`.${listItemIconClasses.root}`]: {
|
|
24
|
-
minWidth: 38,
|
|
25
|
-
},
|
|
26
|
-
[`.${outlinedInputClasses.notchedOutline}`]: {
|
|
27
|
-
display: 'none',
|
|
28
|
-
},
|
|
29
|
-
...theme.applyStyles('dark', {
|
|
30
|
-
backgroundColor: theme.vars.palette.background.paper,
|
|
31
|
-
}),
|
|
32
|
-
variants: [
|
|
33
|
-
{
|
|
34
|
-
props: ({ dense }) => dense,
|
|
35
|
-
style: {
|
|
36
|
-
[`.${inputBaseClasses.input}`]: {
|
|
37
|
-
padding: theme.spacing(1.625, 2, 1.5, 2),
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
}))
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { LiFiStepExtended } from '@lifi/sdk'
|
|
2
|
-
import type { TypographyProps } from '@mui/material'
|
|
3
|
-
import { Typography } from '@mui/material'
|
|
4
|
-
import { useTranslation } from 'react-i18next'
|
|
5
|
-
import { getStepFeeCostsBreakdown } from '../../utils/fees.js'
|
|
6
|
-
|
|
7
|
-
export const StepFees: React.FC<
|
|
8
|
-
TypographyProps & {
|
|
9
|
-
step: LiFiStepExtended
|
|
10
|
-
}
|
|
11
|
-
> = ({ step, ...other }) => {
|
|
12
|
-
const { t } = useTranslation()
|
|
13
|
-
|
|
14
|
-
const isDone = step.execution?.status === 'DONE'
|
|
15
|
-
const gasCosts = step.execution?.gasCosts ?? step.estimate.gasCosts
|
|
16
|
-
const feeCosts = step.execution?.feeCosts ?? step.estimate.feeCosts
|
|
17
|
-
let fees = 0
|
|
18
|
-
|
|
19
|
-
if (gasCosts) {
|
|
20
|
-
const { amountUSD } = getStepFeeCostsBreakdown(gasCosts)
|
|
21
|
-
fees += amountUSD
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (feeCosts) {
|
|
25
|
-
const filteredfeeCosts = feeCosts?.filter((fee) => !fee.included)
|
|
26
|
-
if (filteredfeeCosts?.length) {
|
|
27
|
-
const { amountUSD } = getStepFeeCostsBreakdown(filteredfeeCosts)
|
|
28
|
-
fees += amountUSD
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Typography
|
|
34
|
-
{...other}
|
|
35
|
-
sx={[
|
|
36
|
-
{
|
|
37
|
-
fontSize: 12,
|
|
38
|
-
fontWeight: '500',
|
|
39
|
-
color: 'text.secondary',
|
|
40
|
-
lineHeight: 1.3334,
|
|
41
|
-
},
|
|
42
|
-
...(Array.isArray(other.sx) ? other.sx : [other.sx]),
|
|
43
|
-
]}
|
|
44
|
-
>
|
|
45
|
-
{t('format.currency', { value: fees })}{' '}
|
|
46
|
-
{isDone ? t('main.fees.paid') : t('main.fees.estimated')}
|
|
47
|
-
</Typography>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { List, ListItemAvatar } from '@mui/material'
|
|
2
|
-
import { useTranslation } from 'react-i18next'
|
|
3
|
-
import { TokenAvatar } from '../components/Avatar/TokenAvatar.js'
|
|
4
|
-
import { ListItemButton } from '../components/ListItemButton.js'
|
|
5
|
-
import { ListItemText } from '../components/ListItemText.js'
|
|
6
|
-
import { PageContainer } from '../components/PageContainer.js'
|
|
7
|
-
import { useTokenSelect } from '../components/TokenList/useTokenSelect.js'
|
|
8
|
-
import { useChains } from '../hooks/useChains.js'
|
|
9
|
-
import { useNavigateBack } from '../hooks/useNavigateBack.js'
|
|
10
|
-
import type { FormTypeProps } from '../stores/form/types.js'
|
|
11
|
-
|
|
12
|
-
export const SelectNativeTokenPage: React.FC<FormTypeProps> = ({
|
|
13
|
-
formType,
|
|
14
|
-
}) => {
|
|
15
|
-
const { t } = useTranslation()
|
|
16
|
-
const { navigateBack } = useNavigateBack()
|
|
17
|
-
const { chains } = useChains()
|
|
18
|
-
const selectToken = useTokenSelect(formType, navigateBack)
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<PageContainer disableGutters>
|
|
22
|
-
<List
|
|
23
|
-
sx={{
|
|
24
|
-
paddingTop: 0,
|
|
25
|
-
paddingLeft: 1.5,
|
|
26
|
-
paddingRight: 1.5,
|
|
27
|
-
paddingBottom: 1.5,
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
{chains?.map((chain) => (
|
|
31
|
-
<ListItemButton
|
|
32
|
-
key={chain.id}
|
|
33
|
-
onClick={() => selectToken(chain.nativeToken.address, chain.id)}
|
|
34
|
-
>
|
|
35
|
-
<ListItemAvatar>
|
|
36
|
-
<TokenAvatar token={chain.nativeToken} chain={chain} />
|
|
37
|
-
</ListItemAvatar>
|
|
38
|
-
<ListItemText
|
|
39
|
-
primary={chain.nativeToken.symbol}
|
|
40
|
-
secondary={t('main.onChain', { chainName: chain.name })}
|
|
41
|
-
/>
|
|
42
|
-
</ListItemButton>
|
|
43
|
-
))}
|
|
44
|
-
</List>
|
|
45
|
-
</PageContainer>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { WidgetConfig } from '../../types/widget.js'
|
|
2
|
-
import { getChainTypeFromAddress } from '../../utils/chainType.js'
|
|
3
|
-
|
|
4
|
-
export const attemptToFindMatchingToAddressInConfig = (
|
|
5
|
-
address: string,
|
|
6
|
-
config: WidgetConfig
|
|
7
|
-
) => {
|
|
8
|
-
if (config.toAddress && config.toAddress.address === address) {
|
|
9
|
-
return config.toAddress
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (config.toAddresses?.length) {
|
|
13
|
-
const matchingToAddress = config.toAddresses.find(
|
|
14
|
-
(toAddress) => toAddress.address === address
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
if (matchingToAddress) {
|
|
18
|
-
return matchingToAddress
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
address: address,
|
|
24
|
-
chainType: getChainTypeFromAddress(address),
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react'
|
|
2
|
-
import type { FormFieldNames } from './types.js'
|
|
3
|
-
import { useFieldActions } from './useFieldActions.js'
|
|
4
|
-
import { useFieldValues } from './useFieldValues.js'
|
|
5
|
-
|
|
6
|
-
interface UseFieldControllerProps {
|
|
7
|
-
name: FormFieldNames
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const useFieldController = ({ name }: UseFieldControllerProps) => {
|
|
11
|
-
const [fieldValue] = useFieldValues(name)
|
|
12
|
-
const { setFieldValue, setAsTouched } = useFieldActions()
|
|
13
|
-
|
|
14
|
-
const onChange = useCallback(
|
|
15
|
-
(newValue: string | number | undefined) => {
|
|
16
|
-
setFieldValue(name, newValue, { isDirty: true, isTouched: true })
|
|
17
|
-
},
|
|
18
|
-
[name, setFieldValue]
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
const onBlur = useCallback(() => {
|
|
22
|
-
setAsTouched(name)
|
|
23
|
-
}, [name, setAsTouched])
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
onChange,
|
|
27
|
-
onBlur,
|
|
28
|
-
name,
|
|
29
|
-
value: fieldValue,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ValidationProps } from './types.js'
|
|
2
|
-
import { useFormStore } from './useFormStore.js'
|
|
3
|
-
export const useValidation = (): Omit<ValidationProps, 'validation'> => {
|
|
4
|
-
const [isValid, isValidating, errors] = useFormStore((store) => [
|
|
5
|
-
store.isValid,
|
|
6
|
-
store.isValidating,
|
|
7
|
-
store.errors,
|
|
8
|
-
])
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
isValid,
|
|
12
|
-
isValidating,
|
|
13
|
-
errors,
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ValidationActions } from './types.js'
|
|
2
|
-
import { useFormStore } from './useFormStore.js'
|
|
3
|
-
|
|
4
|
-
export const useValidationActions = () => {
|
|
5
|
-
const actions = useFormStore<ValidationActions>((store) => ({
|
|
6
|
-
addFieldValidation: store.addFieldValidation,
|
|
7
|
-
triggerFieldValidation: store.triggerFieldValidation,
|
|
8
|
-
clearErrors: store.clearErrors,
|
|
9
|
-
}))
|
|
10
|
-
|
|
11
|
-
return actions
|
|
12
|
-
}
|