@lifi/widget 3.2.2 → 3.3.0
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/_esm/components/ActiveTransactions/ActiveTransactionItem.js +1 -1
- package/_esm/components/Card/CardIconButton.d.ts +4 -1
- package/_esm/components/Card/CardIconButton.js.map +1 -1
- package/_esm/components/FeeBreakdownTooltip.d.ts +0 -2
- package/_esm/components/FeeBreakdownTooltip.js +2 -5
- package/_esm/components/FeeBreakdownTooltip.js.map +1 -1
- package/_esm/components/IconTypography.d.ts +3 -3
- package/_esm/components/IconTypography.js +2 -2
- package/_esm/components/IconTypography.js.map +1 -1
- package/_esm/components/RouteCard/RouteCardEssentials.js +10 -11
- package/_esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/_esm/components/Step/DestinationWalletAddress.js +2 -2
- package/_esm/components/Step/DestinationWalletAddress.js.map +1 -1
- package/_esm/components/Step/Step.js +1 -1
- package/_esm/components/Step/StepProcess.js +3 -3
- package/_esm/components/Step/StepProcess.js.map +1 -1
- package/_esm/components/Step/StepTimer.js +44 -27
- package/_esm/components/Step/StepTimer.js.map +1 -1
- package/_esm/components/StepActions/StepActions.style.d.ts +0 -3
- package/_esm/components/StepActions/StepActions.style.js +0 -6
- package/_esm/components/StepActions/StepActions.style.js.map +1 -1
- package/_esm/components/TransactionDetails.js +4 -8
- package/_esm/components/TransactionDetails.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/hooks/timer/useTimer.js +2 -2
- package/_esm/hooks/timer/useTimer.js.map +1 -1
- package/_esm/i18n/en.json +1 -2
- package/_esm/i18n/index.js +15 -15
- package/_esm/i18n/index.js.map +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +3 -2
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_esm/pages/TransactionPage/TokenValueBottomSheet.d.ts +0 -1
- package/_esm/pages/TransactionPage/TokenValueBottomSheet.js +7 -14
- package/_esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/_esm/pages/TransactionPage/TransactionPage.js +16 -8
- package/_esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/_esm/pages/TransactionPage/utils.d.ts +2 -2
- package/_esm/pages/TransactionPage/utils.js +9 -5
- package/_esm/pages/TransactionPage/utils.js.map +1 -1
- package/_esm/stores/routes/types.d.ts +6 -6
- package/_esm/stores/routes/types.js +6 -6
- package/_esm/stores/routes/types.js.map +1 -1
- package/_esm/types/events.d.ts +5 -4
- package/_esm/utils/converters.js +1 -1
- package/_esm/utils/converters.js.map +1 -1
- package/_esm/utils/fees.d.ts +7 -0
- package/_esm/utils/fees.js +14 -0
- package/_esm/utils/fees.js.map +1 -1
- package/components/ActiveTransactions/ActiveTransactionItem.tsx +1 -1
- package/components/Card/CardIconButton.tsx +4 -1
- package/components/FeeBreakdownTooltip.tsx +4 -10
- package/components/IconTypography.ts +2 -2
- package/components/RouteCard/RouteCardEssentials.tsx +19 -15
- package/components/Step/DestinationWalletAddress.tsx +3 -3
- package/components/Step/Step.tsx +1 -1
- package/components/Step/StepProcess.tsx +6 -6
- package/components/Step/StepTimer.tsx +77 -32
- package/components/StepActions/StepActions.style.tsx +0 -8
- package/components/TransactionDetails.tsx +8 -25
- package/config/version.ts +1 -1
- package/hooks/timer/useTimer.ts +4 -2
- package/i18n/en.json +1 -2
- package/i18n/index.ts +15 -15
- package/package.json +10 -10
- package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +6 -5
- package/pages/TransactionPage/TokenValueBottomSheet.tsx +32 -19
- package/pages/TransactionPage/TransactionPage.tsx +27 -10
- package/pages/TransactionPage/utils.ts +23 -8
- package/stores/routes/types.ts +6 -6
- package/types/events.ts +5 -4
- package/utils/converters.ts +1 -1
- package/utils/fees.ts +24 -0
- package/_esm/components/Step/StepProcess.style.d.ts +0 -9
- package/_esm/components/Step/StepProcess.style.js +0 -6
- package/_esm/components/Step/StepProcess.style.js.map +0 -1
- package/components/Step/StepProcess.style.tsx +0 -9
package/utils/fees.ts
CHANGED
|
@@ -7,6 +7,30 @@ export interface FeesBreakdown {
|
|
|
7
7
|
token: Token;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export const getAccumulatedFeeCostsBreakdown = (
|
|
11
|
+
route: RouteExtended,
|
|
12
|
+
included: boolean = false,
|
|
13
|
+
) => {
|
|
14
|
+
const gasCosts = getGasCostsBreakdown(route);
|
|
15
|
+
const feeCosts = getFeeCostsBreakdown(route, included);
|
|
16
|
+
const gasCostUSD = gasCosts.reduce(
|
|
17
|
+
(sum, gasCost) => sum + gasCost.amountUSD,
|
|
18
|
+
0,
|
|
19
|
+
);
|
|
20
|
+
const feeCostUSD = feeCosts.reduce(
|
|
21
|
+
(sum, feeCost) => sum + feeCost.amountUSD,
|
|
22
|
+
0,
|
|
23
|
+
);
|
|
24
|
+
const combinedFeesUSD = gasCostUSD + feeCostUSD;
|
|
25
|
+
return {
|
|
26
|
+
gasCosts,
|
|
27
|
+
feeCosts,
|
|
28
|
+
gasCostUSD,
|
|
29
|
+
feeCostUSD,
|
|
30
|
+
combinedFeesUSD,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
10
34
|
export const getGasCostsBreakdown = (route: RouteExtended): FeesBreakdown[] => {
|
|
11
35
|
return Array.from(
|
|
12
36
|
route.steps
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const LinkButton: import("@emotion/styled").StyledComponent<import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
2
|
-
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
3
|
-
}, "color" | "children" | "sx" | "style" | "className" | "tabIndex" | "disabled" | "action" | "size" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
|
-
component?: import("react").ElementType;
|
|
5
|
-
} & import("@mui/material").LinkOwnProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: HTMLAnchorElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLAnchorElement> | null | undefined;
|
|
7
|
-
}, "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "style" | "className" | "align" | "classes" | "gutterBottom" | "noWrap" | "paragraph" | "variant" | "variantMapping" | "TypographyClasses" | "underline"> & {
|
|
8
|
-
component?: import("react").ElementType;
|
|
9
|
-
}, {}, {}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepProcess.style.js","sourceRoot":"","sources":["../../../components/Step/StepProcess.style.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,CAC9C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;CAC5B,CAAC,CACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IconButtonProps, LinkProps } from '@mui/material';
|
|
2
|
-
import { styled } from '@mui/material';
|
|
3
|
-
import { CardIconButton } from '../Card/CardIconButton.js';
|
|
4
|
-
|
|
5
|
-
export const LinkButton = styled(CardIconButton)<IconButtonProps & LinkProps>(
|
|
6
|
-
({ theme }) => ({
|
|
7
|
-
padding: theme.spacing(0.5),
|
|
8
|
-
}),
|
|
9
|
-
);
|