@ensofinance/checkout-widget 0.0.12 → 0.0.14

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.
Files changed (149) hide show
  1. package/dist/checkout-widget.es.js +14486 -13826
  2. package/dist/checkout-widget.es.js.map +1 -1
  3. package/dist/checkout-widget.umd.js +44 -43
  4. package/dist/checkout-widget.umd.js.map +1 -1
  5. package/dist/index.d.ts +7 -0
  6. package/orval.config.ts +40 -6
  7. package/package.json +1 -1
  8. package/src/components/BridgeFee.tsx +3 -3
  9. package/src/components/Checkout.tsx +5 -53
  10. package/src/components/ExchangeConfirmSecurity.tsx +16 -3
  11. package/src/components/QuoteParameters.tsx +84 -65
  12. package/src/components/TransactionDetailRow.tsx +6 -5
  13. package/src/components/cards/AssetCard.tsx +2 -2
  14. package/src/components/cards/OptionCard.tsx +2 -0
  15. package/src/components/steps/ExchangeFlow.tsx +414 -135
  16. package/src/components/steps/{InitialStep.tsx → FlowSelector.tsx} +76 -33
  17. package/src/components/steps/WalletFlow/WalletAmountStep.tsx +214 -0
  18. package/src/components/steps/{WalletConfirmStep.tsx → WalletFlow/WalletConfirmStep.tsx} +107 -156
  19. package/src/components/steps/WalletFlow/WalletFlow.tsx +116 -0
  20. package/src/components/steps/{QuoteStep.tsx → WalletFlow/WalletQuoteStep.tsx} +9 -58
  21. package/src/components/steps/WalletFlow/WalletTokenStep.tsx +75 -0
  22. package/src/components/ui/index.tsx +0 -3
  23. package/src/enso-api/api.ts +192 -3
  24. package/src/enso-api/custom-instance.ts +1 -0
  25. package/src/enso-api/index.ts +29 -118
  26. package/src/enso-api/model/approveActionDto.ts +17 -0
  27. package/src/enso-api/model/approveArgsDto.ts +22 -0
  28. package/src/enso-api/model/approveArgsDtoAmount.ts +16 -0
  29. package/src/enso-api/model/balanceActionDto.ts +17 -0
  30. package/src/enso-api/model/balanceArgsDto.ts +15 -0
  31. package/src/enso-api/model/borrowActionDto.ts +18 -0
  32. package/src/enso-api/model/borrowArgsDto.ts +22 -0
  33. package/src/enso-api/model/borrowArgsDtoAmountOut.ts +16 -0
  34. package/src/enso-api/model/bridgeActionDto.ts +19 -0
  35. package/src/enso-api/model/bridgeArgsDto.ts +29 -0
  36. package/src/enso-api/model/bridgeArgsDtoAmountIn.ts +16 -0
  37. package/src/enso-api/model/bridgeArgsDtoCallbackItem.ts +64 -0
  38. package/src/enso-api/model/bundleControllerBundleShortcutTransactionBodyItem.ts +69 -0
  39. package/src/enso-api/model/callActionDto.ts +18 -0
  40. package/src/enso-api/model/callArgsDto.ts +29 -0
  41. package/src/enso-api/model/callArgsDtoArgsItem.ts +17 -0
  42. package/src/enso-api/model/callArgsDtoArgsItemAnyOf.ts +12 -0
  43. package/src/enso-api/model/callArgsDtoValue.ts +16 -0
  44. package/src/enso-api/model/callOutput.ts +15 -0
  45. package/src/enso-api/model/depositActionDto.ts +18 -0
  46. package/src/enso-api/model/depositArgsDto.ts +28 -0
  47. package/src/enso-api/model/depositArgsDtoAmountIn.ts +20 -0
  48. package/src/enso-api/model/depositArgsDtoAmountInOneOfItem.ts +13 -0
  49. package/src/enso-api/model/depositArgsDtoTokenIn.ts +15 -0
  50. package/src/enso-api/model/depositArgsDtoTokenOut.ts +15 -0
  51. package/src/enso-api/model/depositCLMMActionDto.ts +18 -0
  52. package/src/enso-api/model/depositCLMMArgsDto.ts +30 -0
  53. package/src/enso-api/model/depositCLMMArgsDtoAmountInItem.ts +17 -0
  54. package/src/enso-api/model/depositCLMMArgsDtoAmountInItemAnyOf.ts +12 -0
  55. package/src/enso-api/model/ensoFeeActionDto.ts +17 -0
  56. package/src/enso-api/model/ensoFeeArgsDto.ts +20 -0
  57. package/src/enso-api/model/ensoFeeArgsDtoAmount.ts +16 -0
  58. package/src/enso-api/model/feeActionDto.ts +17 -0
  59. package/src/enso-api/model/feeArgsDto.ts +22 -0
  60. package/src/enso-api/model/feeArgsDtoAmount.ts +16 -0
  61. package/src/enso-api/model/harvestActionDto.ts +19 -0
  62. package/src/enso-api/model/harvestArgsDto.ts +17 -0
  63. package/src/enso-api/model/index.ts +115 -4
  64. package/src/enso-api/model/mergeActionDto.ts +17 -0
  65. package/src/enso-api/model/mergeArgsDto.ts +22 -0
  66. package/src/enso-api/model/mergeArgsDtoAmountInItem.ts +13 -0
  67. package/src/enso-api/model/minAmountOutActionDto.ts +17 -0
  68. package/src/enso-api/model/minAmountOutArgsDto.ts +19 -0
  69. package/src/enso-api/model/minAmountOutArgsDtoAmountOut.ts +16 -0
  70. package/src/enso-api/model/minAmountOutArgsDtoMinAmountOut.ts +16 -0
  71. package/src/enso-api/model/multiDepositActionDto.ts +18 -0
  72. package/src/enso-api/model/multiDepositArgsDto.ts +24 -0
  73. package/src/enso-api/model/multiDepositArgsDtoAmountInItem.ts +17 -0
  74. package/src/enso-api/model/multiDepositArgsDtoAmountInItemAnyOf.ts +12 -0
  75. package/src/enso-api/model/multiOutSingleDepositActionDto.ts +18 -0
  76. package/src/enso-api/model/multiOutSingleDepositArgsDto.ts +24 -0
  77. package/src/enso-api/model/multiOutSingleDepositArgsDtoAmountIn.ts +16 -0
  78. package/src/enso-api/model/multiRedeemActionDto.ts +18 -0
  79. package/src/enso-api/model/multiRedeemArgs2Dto.ts +24 -0
  80. package/src/enso-api/model/multiRedeemArgs2DtoAmountIn.ts +16 -0
  81. package/src/enso-api/model/nontokenizedControllerRouteNontokenizedShorcutTransactionParams.ts +8 -0
  82. package/src/enso-api/model/nontokenizedControllerRouteNontokenizedShorcutTransactionRoutingStrategy.ts +1 -0
  83. package/src/enso-api/model/nontokenizedRouteShortcutTransaction.ts +31 -0
  84. package/src/enso-api/model/paymasterFeeActionDto.ts +17 -0
  85. package/src/enso-api/model/paymasterFeeArgsDto.ts +18 -0
  86. package/src/enso-api/model/paymasterFeeArgsDtoAmount.ts +16 -0
  87. package/src/enso-api/model/permitTransferFromActionDto.ts +18 -0
  88. package/src/enso-api/model/permitTransferFromArgsDto.ts +29 -0
  89. package/src/enso-api/model/permitTransferFromArgsDtoAmount.ts +20 -0
  90. package/src/enso-api/model/permitTransferFromArgsDtoAmountOneOfItem.ts +13 -0
  91. package/src/enso-api/model/permitTransferFromArgsDtoToken.ts +15 -0
  92. package/src/enso-api/model/positionModel.ts +14 -0
  93. package/src/enso-api/model/redeemActionDto.ts +18 -0
  94. package/src/enso-api/model/redeemArgsDto.ts +25 -0
  95. package/src/enso-api/model/redeemArgsDtoAmountIn.ts +16 -0
  96. package/src/enso-api/model/redeemArgsDtoTokenOut.ts +15 -0
  97. package/src/enso-api/model/redeemCLMMActionDto.ts +18 -0
  98. package/src/enso-api/model/redeemCLMMArgsDto.ts +24 -0
  99. package/src/enso-api/model/redeemCLMMArgsDtoLiquidity.ts +16 -0
  100. package/src/enso-api/model/repayActionDto.ts +18 -0
  101. package/src/enso-api/model/repayArgsDto.ts +22 -0
  102. package/src/enso-api/model/repayArgsDtoAmountIn.ts +16 -0
  103. package/src/enso-api/model/routeActionDto.ts +20 -0
  104. package/src/enso-api/model/routeArgsDto.ts +38 -0
  105. package/src/enso-api/model/routeArgsDtoAmountIn.ts +16 -0
  106. package/src/enso-api/model/singleDepositActionDto.ts +18 -0
  107. package/src/enso-api/model/singleDepositArgsDto.ts +24 -0
  108. package/src/enso-api/model/singleDepositArgsDtoAmountIn.ts +16 -0
  109. package/src/enso-api/model/singleRedeemActionDto.ts +18 -0
  110. package/src/enso-api/model/singleRedeemArgs2Dto.ts +24 -0
  111. package/src/enso-api/model/singleRedeemArgs2DtoAmountIn.ts +16 -0
  112. package/src/enso-api/model/slippageActionDto.ts +17 -0
  113. package/src/enso-api/model/slippageArgsDto.ts +18 -0
  114. package/src/enso-api/model/slippageArgsDtoAmountOut.ts +16 -0
  115. package/src/enso-api/model/splitActionDto.ts +17 -0
  116. package/src/enso-api/model/splitArgsDto.ts +22 -0
  117. package/src/enso-api/model/splitArgsDtoAmountIn.ts +16 -0
  118. package/src/enso-api/model/swapActionDto.ts +18 -0
  119. package/src/enso-api/model/swapArgsDto.ts +30 -0
  120. package/src/enso-api/model/swapArgsDtoAmountIn.ts +16 -0
  121. package/src/enso-api/model/tokenizedMultiDepositActionDto.ts +18 -0
  122. package/src/enso-api/model/tokenizedMultiDepositArgsDto.ts +24 -0
  123. package/src/enso-api/model/tokenizedMultiDepositArgsDtoAmountInItem.ts +17 -0
  124. package/src/enso-api/model/tokenizedMultiDepositArgsDtoAmountInItemAnyOf.ts +14 -0
  125. package/src/enso-api/model/tokenizedMultiRedeemActionDto.ts +18 -0
  126. package/src/enso-api/model/tokenizedMultiRedeemArgsDto.ts +24 -0
  127. package/src/enso-api/model/tokenizedMultiRedeemArgsDtoAmountIn.ts +16 -0
  128. package/src/enso-api/model/tokenizedSingleDepositActionDto.ts +18 -0
  129. package/src/enso-api/model/tokenizedSingleDepositArgsDto.ts +24 -0
  130. package/src/enso-api/model/tokenizedSingleDepositArgsDtoAmountIn.ts +16 -0
  131. package/src/enso-api/model/tokenizedSingleRedeemActionDto.ts +18 -0
  132. package/src/enso-api/model/tokenizedSingleRedeemArgsDto.ts +24 -0
  133. package/src/enso-api/model/tokenizedSingleRedeemArgsDtoAmountIn.ts +16 -0
  134. package/src/enso-api/model/tokensControllerTokensLiquidityType.ts +19 -0
  135. package/src/enso-api/model/tokensControllerTokensParams.ts +6 -0
  136. package/src/enso-api/model/transferActionDto.ts +18 -0
  137. package/src/enso-api/model/transferArgsDto.ts +22 -0
  138. package/src/enso-api/model/transferArgsDtoAmount.ts +16 -0
  139. package/src/enso-api/model/transferFromActionDto.ts +18 -0
  140. package/src/enso-api/model/transferFromArgsDto.ts +24 -0
  141. package/src/enso-api/model/transferFromArgsDtoAmount.ts +16 -0
  142. package/src/index.ts +1 -0
  143. package/src/store.ts +13 -5
  144. package/src/types/index.ts +9 -3
  145. package/src/util/common.tsx +4 -1
  146. package/src/util/enso-hooks.tsx +137 -14
  147. package/src/util/wallet.tsx +2 -69
  148. package/src/components/steps/WalletAmountStep.tsx +0 -267
  149. package/src/components/steps/WalletTokenStep.tsx +0 -128
package/dist/index.d.ts CHANGED
@@ -16,6 +16,13 @@ export declare const CheckoutModal: ({ config, setIsActive, isActive, onClose, }
16
16
 
17
17
  export { CheckoutModalProps }
18
18
 
19
+ export declare enum SupportedExchanges {
20
+ Binance = "binance",
21
+ Kraken = "kraken",
22
+ Coinbase = "coinbase",
23
+ Bybit = "bybit"
24
+ }
25
+
19
26
  export { WidgetTheme }
20
27
 
21
28
  export { }
package/orval.config.ts CHANGED
@@ -8,11 +8,9 @@ export default {
8
8
  schemas: "src/enso-api/model",
9
9
  client: "react-query",
10
10
  override: {
11
- query: {
12
- options: {
13
- refetchInterval: 30_000,
14
- retry: 2,
15
- },
11
+ queryOptions: {
12
+ refetchInterval: 30_000,
13
+ retry: 2,
16
14
  },
17
15
  mutator: {
18
16
  path: "./src/enso-api/custom-instance.ts",
@@ -20,6 +18,42 @@ export default {
20
18
  },
21
19
  },
22
20
  },
23
- input: "https://api.enso.finance/api-yaml",
21
+ input: {
22
+ target: "https://api.enso.finance/api-yaml",
23
+ override: {
24
+ transformer: (spec: any) => {
25
+ // Fix all malformed array schemas that have items: { type: 'array' } without proper definition
26
+ const fixArraySchema = (obj: any) => {
27
+ if (!obj || typeof obj !== 'object') return;
28
+
29
+ // Fix array items that are themselves arrays without proper items definition
30
+ if (obj.type === 'array' && obj.items?.type === 'array' && !obj.items.items) {
31
+ obj.items = {
32
+ anyOf: [
33
+ { type: 'string' },
34
+ { type: 'number' },
35
+ { type: 'boolean' },
36
+ { type: 'object' },
37
+ ]
38
+ };
39
+ }
40
+
41
+ // Recursively fix nested objects
42
+ for (const key in obj) {
43
+ if (obj.hasOwnProperty(key)) {
44
+ fixArraySchema(obj[key]);
45
+ }
46
+ }
47
+ };
48
+
49
+ // Apply fix to all schemas
50
+ if (spec.components?.schemas) {
51
+ fixArraySchema(spec.components.schemas);
52
+ }
53
+
54
+ return spec;
55
+ }
56
+ }
57
+ },
24
58
  },
25
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ensofinance/checkout-widget",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "homepage": "https://www.enso.build/",
6
6
  "repository": {
@@ -13,7 +13,7 @@ import { Fuel } from "lucide-react";
13
13
  import { Tooltip } from "./ui/tooltip";
14
14
 
15
15
  const BridgingFee = () => {
16
- const { routerData } = useRouteData();
16
+ const { routeData } = useRouteData();
17
17
  const { tokenIn, chainIdIn, amountIn } = useAppDetails();
18
18
  const { data: nativeTokenPriceData } = useEnsoPrice(chainIdIn, ETH_ADDRESS);
19
19
  const {
@@ -21,14 +21,14 @@ const BridgingFee = () => {
21
21
  } = useEnsoToken(ETH_ADDRESS, chainIdIn);
22
22
 
23
23
  const gasValue = useMemo(() => {
24
- let txCost = +(routerData?.tx?.value ?? 0);
24
+ let txCost = +(routeData?.tx?.value ?? 0);
25
25
 
26
26
  if (compareCaseInsensitive(tokenIn, ETH_ADDRESS)) {
27
27
  txCost -= +amountIn;
28
28
  }
29
29
 
30
30
  return normalizeValue(Math.max(0, txCost).toString(), 18);
31
- }, [routerData?.tx?.value, tokenIn, amountIn]);
31
+ }, [routeData?.tx?.value, tokenIn, amountIn]);
32
32
 
33
33
  const gasCostUSD = +gasValue * +(nativeTokenPriceData ?? 0);
34
34
 
@@ -1,54 +1,15 @@
1
- import {
2
- createContext,
3
- ReactElement,
4
- useEffect,
5
- useMemo,
6
- useState,
7
- ComponentType,
8
- } from "react";
1
+ import { createContext, useEffect, useMemo, ComponentType } from "react";
9
2
  import { Box } from "@chakra-ui/react";
10
- import InitialStep from "./steps/InitialStep";
11
- import SelectTokenStep from "./steps/WalletTokenStep";
12
- import SelectAmountStep from "./steps/WalletAmountStep";
13
- import QuoteStep from "./steps/QuoteStep";
14
- import WalletConfirmStep from "./steps/WalletConfirmStep";
15
- import ExchangeFlow from "./steps/ExchangeFlow";
3
+ import FlowSelector from "./steps/FlowSelector";
16
4
  import { useAppStore } from "@/store";
17
5
  import { TxTracker } from "@/util/tx-tracker";
18
6
  import ChakraProvider from "./ChakraProvider";
19
7
  import { type CheckoutConfig, type SupportedExchanges } from "@/types";
20
8
 
21
9
  type ICheckoutContext = {
22
- step: string;
23
- setStep: (step: string) => void;
24
-
25
- flow: string;
26
- setFlow: (flow: string) => void;
27
-
28
10
  handleClose: () => void;
29
11
 
30
- enableExchanges?: SupportedExchanges[];
31
- };
32
-
33
- const FLOWS: Record<
34
- string,
35
- {
36
- steps: Record<string, ReactElement>;
37
- }
38
- > = {
39
- mainFlow: {
40
- steps: {
41
- selectToken: <SelectTokenStep />,
42
- selectAmount: <SelectAmountStep />,
43
- quote: <QuoteStep />,
44
- confirmTransfer: <WalletConfirmStep />,
45
- },
46
- },
47
- exchangeFlow: {
48
- steps: {
49
- connectExchange: <ExchangeFlow />,
50
- },
51
- },
12
+ enableExchange?: SupportedExchanges[];
52
13
  };
53
14
 
54
15
  const CheckoutContext = createContext<ICheckoutContext>({} as ICheckoutContext);
@@ -62,9 +23,6 @@ const Checkout = ({
62
23
  wrapper?: ComponentType;
63
24
  onClose?: () => void;
64
25
  }) => {
65
- const [step, setStep] = useState("");
66
- const [flow, setFlow] = useState("");
67
-
68
26
  const setEnsoApiToken = useAppStore((state) => state.setEnsoApiToken);
69
27
  const setTokenOut = useAppStore((state) => state.setTokenOut);
70
28
  const setChainIdOut = useAppStore((state) => state.setChainIdOut);
@@ -76,8 +34,6 @@ const Checkout = ({
76
34
  if (onClose) {
77
35
  onClose();
78
36
  }
79
- setStep("");
80
- setFlow("");
81
37
  }
82
38
  : undefined,
83
39
  [onClose],
@@ -107,18 +63,14 @@ const Checkout = ({
107
63
  return (
108
64
  <CheckoutContext.Provider
109
65
  value={{
110
- step,
111
- setStep,
112
- flow,
113
- setFlow,
114
66
  handleClose,
115
- enableExchanges: enableExchange,
67
+ enableExchange,
116
68
  }}
117
69
  >
118
70
  <ChakraProvider themeConfig={theme}>
119
71
  <WrapperComponent>
120
72
  <TxTracker />
121
- {!flow && !step ? <InitialStep /> : FLOWS[flow].steps[step]}
73
+ <FlowSelector />
122
74
  </WrapperComponent>
123
75
  </ChakraProvider>
124
76
  </CheckoutContext.Provider>
@@ -45,11 +45,24 @@ const SecurityFeature = ({
45
45
  </Box>
46
46
  );
47
47
 
48
- const ConfirmExchangeStep = ({ onConfirm }: { onConfirm: () => void }) => {
48
+ const ConfirmExchangeStep = ({
49
+ onConfirm,
50
+ exchangeName = "your exchange",
51
+ exchangeIcon,
52
+ }: {
53
+ onConfirm: () => void;
54
+ exchangeName?: string;
55
+ exchangeIcon?: string;
56
+ }) => {
49
57
  return (
50
58
  <BodyWrapper>
51
59
  <Box display="flex" justifyContent="center" width="100%">
52
- <Image w={"48px"} src={BinanceIcon} />
60
+ <Image
61
+ w={"48px"}
62
+ h={"48px"}
63
+ borderRadius={"full"}
64
+ src={exchangeIcon || BinanceIcon}
65
+ />
53
66
  </Box>
54
67
 
55
68
  <Box
@@ -59,7 +72,7 @@ const ConfirmExchangeStep = ({ onConfirm }: { onConfirm: () => void }) => {
59
72
  color="fg"
60
73
  textAlign="center"
61
74
  >
62
- Enso Checkout uses a 3rd party to connect your Binance account.
75
+ Enso Checkout uses a 3rd party to connect your {exchangeName} account.
63
76
  </Box>
64
77
 
65
78
  <Box display="flex" flexDirection="column" gap="12px" width="100%">
@@ -4,23 +4,28 @@ import {
4
4
  Flex,
5
5
  Icon,
6
6
  Image,
7
+ Link,
7
8
  Skeleton,
8
- Text,
9
9
  Table,
10
- Link,
10
+ Text,
11
11
  } from "@chakra-ui/react";
12
12
  import { ExternalLink } from "lucide-react";
13
13
  import { useAppDetails, useRouteData, useWalletIcon } from "@/util/enso-hooks";
14
- import { formatNumber, getChainIcon, normalizeValue } from "@/util";
15
- import { shortenAddress } from "@/util";
16
- import { getChainName, Token } from "@/util/common";
14
+ import {
15
+ formatNumber,
16
+ getChainIcon,
17
+ normalizeValue,
18
+ shortenAddress,
19
+ } from "@/util";
20
+ import { getChainEtherscanUrl, getChainName, Token } from "@/util/common";
17
21
  import { Tooltip } from "@/components/ui/tooltip";
18
- import { getChainEtherscanUrl } from "@/util/common";
19
- import { MOCK_IMAGE_URL, SupportedChainId } from "@/util/constants";
20
- import { STARGATE_CHAIN_NAMES } from "@/util/constants";
21
- import { useAppStore } from "@/store";
22
- // @ts-ignore
23
- import BinanceBadge from "../assets/BinanceBadge.svg";
22
+ import {
23
+ MOCK_IMAGE_URL,
24
+ STARGATE_CHAIN_NAMES,
25
+ SupportedChainId,
26
+ } from "@/util/constants";
27
+ import { useMemo } from "react";
28
+ import { EXCHANGE_ICON_BY_TYPE } from "@/components/steps/ExchangeFlow";
24
29
 
25
30
  export const ERROR_MSG =
26
31
  "Swap not found for a required underlying of defi route, please make sure your amount is within an acceptable range";
@@ -93,11 +98,16 @@ const TokenIcon = ({
93
98
  const QuoteParameters = () => {
94
99
  const { address } = useAccount();
95
100
  const { walletIcon, walletDisplayName } = useWalletIcon();
96
- const { chainIdOut, tokenOutData, tokenInData, amountIn, chainIdIn } =
97
- useAppDetails();
101
+ const {
102
+ chainIdOut,
103
+ effectiveTokenOutData,
104
+ tokenInData,
105
+ amountIn,
106
+ chainIdIn,
107
+ selectedIntegration,
108
+ } = useAppDetails();
98
109
  const { routeLoading, routeData, routeFetched, routerError } =
99
110
  useRouteData();
100
- const { isCheckout } = useAppStore();
101
111
  const showRouteLoading = routeLoading || (!routeFetched && !routerError);
102
112
 
103
113
  const routeErrorMessage: string | null =
@@ -117,6 +127,60 @@ const QuoteParameters = () => {
117
127
  type: "/address",
118
128
  });
119
129
 
130
+ const sourceInfo = useMemo(() => {
131
+ if (selectedIntegration?.type) {
132
+ const icon = EXCHANGE_ICON_BY_TYPE[selectedIntegration.type];
133
+ const name = selectedIntegration.name || selectedIntegration.type;
134
+ return (
135
+ <>
136
+ {icon && (
137
+ <Image
138
+ src={icon}
139
+ width={"16px"}
140
+ height={"16px"}
141
+ borderRadius={"full"}
142
+ />
143
+ )}
144
+ <Text>{name}</Text>
145
+ </>
146
+ );
147
+ }
148
+
149
+ return (
150
+ <>
151
+ {typeof walletIcon === "string" ? (
152
+ <Image src={walletIcon} width={"16px"} height={"16px"} />
153
+ ) : (
154
+ walletIcon
155
+ )}
156
+ <Tooltip content={walletDisplayName}>
157
+ <Text>
158
+ {address &&
159
+ walletDisplayName +
160
+ " " +
161
+ shortenAddress(address, true)}
162
+ </Text>
163
+ </Tooltip>
164
+ {inWalletUrl && (
165
+ <Link href={inWalletUrl} target="_blank">
166
+ <Icon
167
+ as={ExternalLink}
168
+ color="fg.muted"
169
+ width={"16px"}
170
+ height={"16px"}
171
+ />
172
+ </Link>
173
+ )}
174
+ </>
175
+ );
176
+ }, [
177
+ selectedIntegration,
178
+ walletIcon,
179
+ walletDisplayName,
180
+ address,
181
+ inWalletUrl,
182
+ ]);
183
+
120
184
  return (
121
185
  <>
122
186
  <Table.Root
@@ -126,7 +190,7 @@ const QuoteParameters = () => {
126
190
  width={"100%"}
127
191
  borderRadius={"sm"}
128
192
  >
129
- <Table.Body >
193
+ <Table.Body>
130
194
  <Table.Row>
131
195
  <Table.Cell>Source</Table.Cell>
132
196
  <Table.Cell
@@ -139,52 +203,7 @@ const QuoteParameters = () => {
139
203
  gap={"8px"}
140
204
  alignItems={"center"}
141
205
  >
142
- {isCheckout ? (
143
- <>
144
- <Image
145
- src={BinanceBadge}
146
- width={"16px"}
147
- height={"16px"}
148
- />
149
- <Text>Binance</Text>
150
- </>
151
- ) : (
152
- <>
153
- {typeof walletIcon === "string" ? (
154
- <Image
155
- src={walletIcon}
156
- width={"16px"}
157
- height={"16px"}
158
- />
159
- ) : (
160
- walletIcon
161
- )}
162
- <Tooltip content={walletDisplayName}>
163
- <Text>
164
- {address &&
165
- walletDisplayName +
166
- " " +
167
- shortenAddress(
168
- address,
169
- true,
170
- )}
171
- </Text>
172
- </Tooltip>
173
- {inWalletUrl && (
174
- <Link
175
- href={inWalletUrl}
176
- target="_blank"
177
- >
178
- <Icon
179
- as={ExternalLink}
180
- color="fg.muted"
181
- width={"16px"}
182
- height={"16px"}
183
- />
184
- </Link>
185
- )}
186
- </>
187
- )}
206
+ {sourceInfo}
188
207
  </Box>
189
208
  </Table.Cell>
190
209
  </Table.Row>
@@ -243,7 +262,7 @@ const QuoteParameters = () => {
243
262
  width={showRouteLoading ? "80px" : "auto"}
244
263
  >
245
264
  <Text>
246
- {isCheckout
265
+ {selectedIntegration?.type
247
266
  ? `~2min`
248
267
  : chainIdIn !== chainIdOut
249
268
  ? `~1 min`
@@ -317,13 +336,13 @@ const QuoteParameters = () => {
317
336
  {formatNumber(
318
337
  normalizeValue(
319
338
  routeData?.amountOut,
320
- tokenOutData?.decimals,
339
+ effectiveTokenOutData?.decimals,
321
340
  ),
322
341
  )}{" "}
323
- {tokenOutData?.symbol}
342
+ {effectiveTokenOutData?.symbol}
324
343
  </Text>
325
344
  <TokenIcon
326
- token={tokenOutData}
345
+ token={effectiveTokenOutData}
327
346
  chainId={chainIdOut}
328
347
  size={24}
329
348
  />
@@ -19,13 +19,14 @@ export const DetailRowContainer = chakra("div", {
19
19
  });
20
20
 
21
21
  export const TransactionDetailRow = () => {
22
- const { routerData } = useRouteData();
23
- const { chainIdIn, chainIdOut, isCheckout } = useAppDetails();
22
+ const { routeData } = useRouteData();
23
+ const { chainIdIn, chainIdOut, selectedIntegration } = useAppDetails();
24
+
24
25
  const slippage = useAppStore((state) => state.slippage);
25
26
  const [isExpanded, setIsExpanded] = useState(false);
26
27
 
27
- const formattedPriceImpact = routerData?.priceImpact
28
- ? (-routerData?.priceImpact / 100).toFixed(2)
28
+ const formattedPriceImpact = routeData?.priceImpact
29
+ ? (-routeData?.priceImpact / 100).toFixed(2)
29
30
  : "0.00";
30
31
 
31
32
  const detailItems = [
@@ -38,7 +39,7 @@ export const TransactionDetailRow = () => {
38
39
  label: "Max. slippage",
39
40
  },
40
41
  {
41
- detail: isCheckout
42
+ detail: selectedIntegration?.type
42
43
  ? `~2min`
43
44
  : chainIdIn !== chainIdOut
44
45
  ? `~1 min`
@@ -80,13 +80,13 @@ const AssetCard = ({
80
80
  }: {
81
81
  icon?: ReactElement | string;
82
82
  title: string;
83
- balance: string | number;
83
+ balance?: string | number;
84
84
  usdBalance: string;
85
85
  tag: string;
86
86
  loading: boolean;
87
87
  selected: boolean;
88
88
  onClick: () => void;
89
- chainId: number;
89
+ chainId?: number;
90
90
  }) => {
91
91
  return (
92
92
  <Card
@@ -38,6 +38,8 @@ const OptionCard = ({
38
38
  {icons.map((icon, index) => (
39
39
  <Image
40
40
  w={"32px"}
41
+ h={"32px"}
42
+ borderRadius={"full"}
41
43
  position={"relative"}
42
44
  zIndex={index}
43
45
  right={`${0 - (icons.length - 1 - index) * 10}px`}