@xswap-link/sdk 0.2.5 → 0.2.6
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 +6 -0
- package/dist/index.css +234 -263
- package/dist/index.js +264 -253
- package/dist/index.mjs +264 -253
- package/package.json +1 -1
- package/src/components/Alert/index.tsx +1 -1
- package/src/components/Skeleton/index.tsx +3 -1
- package/src/components/TxConfigForm/BalanceComponent.tsx +1 -1
- package/src/components/TxConfigForm/Button.tsx +1 -1
- package/src/components/TxConfigForm/ChainListElement.tsx +2 -2
- package/src/components/TxConfigForm/Description.tsx +2 -2
- package/src/components/TxConfigForm/ErrorField.tsx +4 -2
- package/src/components/TxConfigForm/FeesDetails.tsx +21 -21
- package/src/components/TxConfigForm/Form.tsx +2 -2
- package/src/components/TxConfigForm/History.tsx +5 -5
- package/src/components/TxConfigForm/HistoryCard.tsx +33 -40
- package/src/components/TxConfigForm/PoweredBy.tsx +2 -2
- package/src/components/TxConfigForm/Settings.tsx +33 -27
- package/src/components/TxConfigForm/Summary.tsx +24 -23
- package/src/components/TxConfigForm/SwapPanel.tsx +11 -11
- package/src/components/TxConfigForm/TokenPicker.tsx +36 -34
- package/src/components/TxConfigForm/TopBar.tsx +8 -8
- package/src/components/TxConfigForm/UsdPrice.tsx +2 -2
- package/src/components/TxConfigForm/index.tsx +6 -6
- package/src/components/TxStatusButton/index.tsx +31 -27
- package/src/components/UnknownTokenLogo/UnknownTokenLogo.tsx +1 -1
- package/src/components/global.css +7 -5
- package/src/components/icons/CircularProgressIcon.tsx +1 -1
- package/src/config/init.tsx +19 -18
- package/tailwind.config.js +1 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
|
|
3
3
|
export const Alert = ({ desc }: { desc: string }) => {
|
|
4
4
|
return (
|
|
5
|
-
<div className="border border-solid border-x_alert rounded-3xl text-x_alert_light text-xs py-0.5 px-2">
|
|
5
|
+
<div className="xpay-border xpay-border-solid xpay-border-x_alert xpay-rounded-3xl xpay-text-x_alert_light xpay-text-xs xpay-py-0.5 xpay-px-2">
|
|
6
6
|
⚠️ {desc}
|
|
7
7
|
</div>
|
|
8
8
|
);
|
|
@@ -8,6 +8,8 @@ type Props = {
|
|
|
8
8
|
|
|
9
9
|
export const Skeleton = ({ width, height }: Props) => {
|
|
10
10
|
return (
|
|
11
|
-
<div
|
|
11
|
+
<div
|
|
12
|
+
className={`xpay-bg-current xpay-rounded xpay-animate-pulse ${width} ${height}`}
|
|
13
|
+
/>
|
|
12
14
|
);
|
|
13
15
|
};
|
|
@@ -43,7 +43,7 @@ export const BalanceComponent: FC<Props> = ({ srcToken, balances }) => {
|
|
|
43
43
|
precisionFractionalPlaces: 4,
|
|
44
44
|
})
|
|
45
45
|
: 0}
|
|
46
|
-
<span className="bg-gradient-to-r from-x_blue_light to-x_blue_dark bg-clip-text text-transparent">
|
|
46
|
+
<span className="xpay-bg-gradient-to-r xpay-from-x_blue_light xpay-to-x_blue_dark xpay-bg-clip-text xpay-text-transparent">
|
|
47
47
|
Max
|
|
48
48
|
</span>
|
|
49
49
|
</>
|
|
@@ -9,7 +9,7 @@ interface Props {
|
|
|
9
9
|
export const Button: FC<Props> = ({ children, onClick, type, disabled }) => {
|
|
10
10
|
return (
|
|
11
11
|
<button
|
|
12
|
-
className="text-white border-none rounded-2xl text-xl py-4 cursor-pointer w-full bg-gradient-to-r from-[#3681c6] to-[#2b4a9d] disabled:opacity-25"
|
|
12
|
+
className="xpay-text-white xpay-border-none xpay-rounded-2xl xpay-text-xl xpay-py-4 xpay-cursor-pointer xpay-w-full xpay-bg-gradient-to-r xpay-from-[#3681c6] xpay-to-[#2b4a9d] disabled:xpay-opacity-25"
|
|
13
13
|
onClick={onClick}
|
|
14
14
|
type={type}
|
|
15
15
|
disabled={disabled}
|
|
@@ -19,7 +19,7 @@ export const ChainListElement: FC<Props> = ({
|
|
|
19
19
|
return (
|
|
20
20
|
<div key={`${chain.ecosystem}-${chain.chainId}`}>
|
|
21
21
|
<li
|
|
22
|
-
className="bg-transparent border-none flex gap-1 items-center cursor-pointer py-2 w-full"
|
|
22
|
+
className="xpay-bg-transparent xpay-border-none xpay-flex xpay-gap-1 xpay-items-center xpay-cursor-pointer xpay-py-2 xpay-w-full"
|
|
23
23
|
onClick={() => {
|
|
24
24
|
setSrcChain(chain);
|
|
25
25
|
setChainListShown(false);
|
|
@@ -29,7 +29,7 @@ export const ChainListElement: FC<Props> = ({
|
|
|
29
29
|
{chain.displayName}
|
|
30
30
|
</li>
|
|
31
31
|
{index !== length - 1 && (
|
|
32
|
-
<div className="h-px mx-2 bg-[rgba(255,255,255,0.15)]"></div>
|
|
32
|
+
<div className="xpay-h-px xpay-mx-2 xpay-bg-[rgba(255,255,255,0.15)]"></div>
|
|
33
33
|
)}
|
|
34
34
|
</div>
|
|
35
35
|
);
|
|
@@ -6,8 +6,8 @@ interface Props {
|
|
|
6
6
|
|
|
7
7
|
export const Description: FC<Props> = ({ description }) => {
|
|
8
8
|
return (
|
|
9
|
-
<div className="flex flex-col items-start rounded-lg px-4 py-2">
|
|
10
|
-
<div className="w-full flex gap-4 items-start justify-between text-xl">
|
|
9
|
+
<div className="xpay-flex xpay-flex-col xpay-items-start xpay-rounded-lg xpay-px-4 xpay-py-2">
|
|
10
|
+
<div className="xpay-w-full xpay-flex xpay-gap-4 xpay-items-start xpay-justify-between xpay-text-xl">
|
|
11
11
|
{description}
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
@@ -7,8 +7,10 @@ interface Props {
|
|
|
7
7
|
export const ErrorField: FC<Props> = ({ error }) => {
|
|
8
8
|
return (
|
|
9
9
|
<div
|
|
10
|
-
className={`flex justify-center mb-1 items-center w-full rounded-2xl bg-x_error_background border border-solid ${
|
|
11
|
-
error.length > 0
|
|
10
|
+
className={`xpay-flex xpay-justify-center xpay-mb-1 xpay-items-center xpay-w-full xpay-rounded-2xl xpay-bg-x_error_background xpay-border xpay-border-solid ${
|
|
11
|
+
error.length > 0
|
|
12
|
+
? "xpay-border-x_error_border"
|
|
13
|
+
: "xpay-border-transparent"
|
|
12
14
|
}`}
|
|
13
15
|
>
|
|
14
16
|
{error}
|
|
@@ -32,13 +32,13 @@ export const FeesDetails: FC<Props> = ({
|
|
|
32
32
|
}, [expressChecked, exceedsExpressDeliveryLimit]);
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<div className="flex flex-col gap-3
|
|
36
|
-
<div className="flex w-full items-center justify-between text-xs sm:text-sm">
|
|
37
|
-
<div className="flex items-center gap-1 font-medium text-white opacity-60">
|
|
35
|
+
<div className="xpay-flex xpay-flex-col xpay-gap-3 xpay-global-border xpay-rounded-lg xpay-bg-[rgba(15,15,15,1)] xpay-p-2 sm:xpay-p-4 xpay-mb-1">
|
|
36
|
+
<div className="xpay-flex xpay-w-full xpay-items-center xpay-justify-between xpay-text-xs sm:xpay-text-sm">
|
|
37
|
+
<div className="xpay-flex xpay-items-center xpay-gap-1 xpay-font-medium xpay-text-white xpay-opacity-60">
|
|
38
38
|
<CoinsIcon />
|
|
39
|
-
<div className="mr-1">Fees:</div>
|
|
39
|
+
<div className="xpay-mr-1">Fees:</div>
|
|
40
40
|
{isGettingRoute ? (
|
|
41
|
-
<Skeleton width="w-20" height="h-4" />
|
|
41
|
+
<Skeleton width="xpay-w-20" height="xpay-h-4" />
|
|
42
42
|
) : (
|
|
43
43
|
` ${weiToHumanReadable({
|
|
44
44
|
amount: safeBigNumberFrom(
|
|
@@ -54,13 +54,13 @@ export const FeesDetails: FC<Props> = ({
|
|
|
54
54
|
})} ${paymentToken?.symbol}`
|
|
55
55
|
)}
|
|
56
56
|
</div>
|
|
57
|
-
<div className="flex gap-1 items-center">
|
|
57
|
+
<div className="xpay-flex xpay-gap-1 xpay-items-center">
|
|
58
58
|
{route?.xSwapFees.expressDeliveryFee && !isGettingRoute && (
|
|
59
59
|
<div
|
|
60
|
-
className={`flex gap-1 items-center font-medium ${
|
|
60
|
+
className={`xpay-flex xpay-gap-1 xpay-items-center xpay-font-medium ${
|
|
61
61
|
isExpressDeliveryPossible
|
|
62
|
-
? "text-x_green"
|
|
63
|
-
: "text-white opacity-60"
|
|
62
|
+
? "xpay-text-x_green"
|
|
63
|
+
: "xpay-text-white xpay-opacity-60"
|
|
64
64
|
}`}
|
|
65
65
|
>
|
|
66
66
|
<TimerIcon />
|
|
@@ -69,18 +69,18 @@ export const FeesDetails: FC<Props> = ({
|
|
|
69
69
|
)}
|
|
70
70
|
<div
|
|
71
71
|
onClick={() => setFeesDetailsShown((x) => !x)}
|
|
72
|
-
className="font-medium text-white opacity-60 cursor-pointer flex items-center w-[15px] h-[9px]"
|
|
72
|
+
className="xpay-font-medium xpay-text-white xpay-opacity-60 xpay-cursor-pointer xpay-flex xpay-items-center xpay-w-[15px] xpay-h-[9px]"
|
|
73
73
|
>
|
|
74
74
|
{feesDetailsShown ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
|
75
75
|
</div>
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
{feesDetailsShown && (
|
|
79
|
-
<div className="flex w-full items-center justify-between gap-2">
|
|
80
|
-
<div className="flex flex-col text-[10px] gap-1">
|
|
81
|
-
<div className="flex justify-between font-medium text-white opacity-60 gap-1">
|
|
79
|
+
<div className="xpay-flex xpay-w-full xpay-items-center xpay-justify-between xpay-gap-2">
|
|
80
|
+
<div className="xpay-flex xpay-flex-col xpay-text-[10px] xpay-gap-1">
|
|
81
|
+
<div className="xpay-flex xpay-justify-between xpay-font-medium xpay-text-white xpay-opacity-60 xpay-gap-1">
|
|
82
82
|
<div>CCIP Fee:</div>
|
|
83
|
-
<div className="whitespace-nowrap">
|
|
83
|
+
<div className="xpay-whitespace-nowrap">
|
|
84
84
|
{` ${weiToHumanReadable({
|
|
85
85
|
amount: route?.xSwapFees.ccipFee || "0",
|
|
86
86
|
decimals: 18,
|
|
@@ -88,9 +88,9 @@ export const FeesDetails: FC<Props> = ({
|
|
|
88
88
|
})} ${paymentToken?.symbol}`}
|
|
89
89
|
</div>
|
|
90
90
|
</div>
|
|
91
|
-
<div className="flex justify-between font-medium text-white opacity-60 gap-1">
|
|
91
|
+
<div className="xpay-flex xpay-justify-between xpay-font-medium xpay-text-white xpay-opacity-60 xpay-gap-1">
|
|
92
92
|
<div>Native Fee:</div>
|
|
93
|
-
<div className="whitespace-nowrap">
|
|
93
|
+
<div className="xpay-whitespace-nowrap">
|
|
94
94
|
{` ${weiToHumanReadable({
|
|
95
95
|
amount: route?.xSwapFees.xSwapFee.nativeFee || "0",
|
|
96
96
|
decimals: 18,
|
|
@@ -99,14 +99,14 @@ export const FeesDetails: FC<Props> = ({
|
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
</div>
|
|
102
|
-
<div className="flex flex-col text-[10px] gap-1">
|
|
103
|
-
<div className="flex justify-between font-medium text-white opacity-60 gap-1">
|
|
102
|
+
<div className="xpay-flex xpay-flex-col xpay-text-[10px] xpay-gap-1">
|
|
103
|
+
<div className="xpay-flex xpay-justify-between xpay-font-medium xpay-text-white xpay-opacity-60 xpay-gap-1">
|
|
104
104
|
<div>Slippage:</div>
|
|
105
|
-
<div className="whitespace-nowrap">{`${slippage}%`}</div>
|
|
105
|
+
<div className="xpay-whitespace-nowrap">{`${slippage}%`}</div>
|
|
106
106
|
</div>
|
|
107
|
-
<div className="flex justify-between font-medium text-white opacity-60 gap-1">
|
|
107
|
+
<div className="xpay-flex xpay-justify-between xpay-font-medium xpay-text-white xpay-opacity-60 xpay-gap-1">
|
|
108
108
|
<div>Min amount out:</div>
|
|
109
|
-
<div className="whitespace-nowrap">
|
|
109
|
+
<div className="xpay-whitespace-nowrap">
|
|
110
110
|
{weiToHumanReadable({
|
|
111
111
|
amount: route?.minAmountOut || "0",
|
|
112
112
|
decimals: dstToken?.decimals || 18,
|
|
@@ -202,7 +202,7 @@ export const Form = ({
|
|
|
202
202
|
|
|
203
203
|
return (
|
|
204
204
|
<form
|
|
205
|
-
className="flex flex-col gap-2 z-10 my-0 p-2 md:p-4 rounded-3xl overflow-hidden font-light sm:w-x_desktop"
|
|
205
|
+
className="xpay-flex xpay-flex-col xpay-gap-2 xpay-z-10 xpay-my-0 xpay-p-2 md:xpay-p-4 xpay-rounded-3xl xpay-overflow-hidden xpay-font-light sm:xpay-w-x_desktop"
|
|
206
206
|
onSubmit={handleSubmit}
|
|
207
207
|
>
|
|
208
208
|
<TopBar
|
|
@@ -224,7 +224,7 @@ export const Form = ({
|
|
|
224
224
|
{historyTabShown ? (
|
|
225
225
|
<History signer={signer} supportedChains={supportedChains} />
|
|
226
226
|
) : (
|
|
227
|
-
<div className="flex flex-col gap-2">
|
|
227
|
+
<div className="xpay-flex xpay-flex-col xpay-gap-2">
|
|
228
228
|
{desc && <Description description={desc} />}
|
|
229
229
|
<SwapPanel
|
|
230
230
|
amount={amount}
|
|
@@ -100,21 +100,21 @@ export const History: FC<Props> = ({ signer, supportedChains }) => {
|
|
|
100
100
|
|
|
101
101
|
if (!signer)
|
|
102
102
|
return (
|
|
103
|
-
<div className="flex items-center justify-center w-full h-[30vh]">
|
|
103
|
+
<div className="xpay-flex xpay-items-center xpay-justify-center xpay-w-full xpay-h-[30vh]">
|
|
104
104
|
Connect a wallet to browse history
|
|
105
105
|
</div>
|
|
106
106
|
);
|
|
107
107
|
|
|
108
108
|
return (
|
|
109
|
-
<div className="flex items-center justify-center w-full">
|
|
110
|
-
<div className="w-full h-96 overflow-scroll overflow-x-hidden">
|
|
109
|
+
<div className="xpay-flex xpay-items-center xpay-justify-center xpay-w-full">
|
|
110
|
+
<div className="xpay-w-full xpay-h-96 xpay-overflow-scroll xpay-overflow-x-hidden">
|
|
111
111
|
{fetchedHistory?.length === 0 && historyLoadedOnce && (
|
|
112
|
-
<div className="w-full text-center py-4 px-0 text-[rgb(158,158,158)]">
|
|
112
|
+
<div className="xpay-w-full xpay-text-center xpay-py-4 xpay-px-0 xpay-text-[rgb(158,158,158)]">
|
|
113
113
|
Your history is empty...
|
|
114
114
|
</div>
|
|
115
115
|
)}
|
|
116
116
|
{!fetchedHistory && !historyLoadedOnce && (
|
|
117
|
-
<div className="flex w-full h-full items-center justify-center">
|
|
117
|
+
<div className="xpay-flex xpay-w-full xpay-h-full xpay-items-center xpay-justify-center">
|
|
118
118
|
<CircularProgressIcon />
|
|
119
119
|
</div>
|
|
120
120
|
)}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { FC, useCallback, useMemo } from "react";
|
|
2
|
-
import { getDate } from "@src/utils";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
ArrowRightIcon,
|
|
7
|
-
ArrowUpRightIcon,
|
|
8
|
-
CheckIcon,
|
|
9
|
-
HourGlassIcon,
|
|
10
|
-
XMarkIcon,
|
|
11
|
-
} from "@src/components/icons";
|
|
2
|
+
import { deepMergeObjects, getDate, weiToHumanReadable } from "@src/utils";
|
|
3
|
+
import { Chain, Token, Transaction } from "@src/models";
|
|
4
|
+
import { ArrowRightIcon, ArrowUpRightIcon } from "@src/components/icons";
|
|
12
5
|
import { MINIMUM_DISPLAYED_TOKEN_AMOUNT } from "@src/constants";
|
|
13
6
|
|
|
14
7
|
interface Props {
|
|
@@ -75,25 +68,25 @@ export const HistoryCard: FC<Props> = ({ transaction, supportedChains }) => {
|
|
|
75
68
|
);
|
|
76
69
|
|
|
77
70
|
return (
|
|
78
|
-
<div className="flex flex-col
|
|
79
|
-
<div className="flex w-full items-center justify-between">
|
|
80
|
-
<div className="text-sm sm:text-base">{date}</div>
|
|
81
|
-
<div className="flex items-center">
|
|
71
|
+
<div className="xpay-flex xpay-flex-col xpay-global-border xpay-rounded-xl xpay-bg-[rgb(15,15,15)] xpay-text-white xpay-text-xs sm:xpay-text-sm xpay-p-4 xpay-gap-3 xpay-mb-2">
|
|
72
|
+
<div className="xpay-flex xpay-w-full xpay-items-center xpay-justify-between">
|
|
73
|
+
<div className="xpay-text-sm sm:xpay-text-base">{date}</div>
|
|
74
|
+
<div className="xpay-flex xpay-items-center">
|
|
82
75
|
{transaction.status === "IN_PROGRESS" && (
|
|
83
|
-
<div className="flex items-center">
|
|
84
|
-
<div className="text-[rgb(250,200,100)]">In progress</div>
|
|
76
|
+
<div className="xpay-flex xpay-items-center">
|
|
77
|
+
<div className="xpay-text-[rgb(250,200,100)]">In progress</div>
|
|
85
78
|
</div>
|
|
86
79
|
)}
|
|
87
80
|
|
|
88
81
|
{transaction.status === "DONE" && (
|
|
89
|
-
<div className="flex items-center">
|
|
90
|
-
<div className="text-[rgb(100,200,100)]">Done</div>
|
|
82
|
+
<div className="xpay-flex xpay-items-center">
|
|
83
|
+
<div className="xpay-text-[rgb(100,200,100)]">Done</div>
|
|
91
84
|
</div>
|
|
92
85
|
)}
|
|
93
86
|
|
|
94
87
|
{transaction.status === "REVERTED" && (
|
|
95
|
-
<div className="flex items-center">
|
|
96
|
-
<div className="text-[rgb(255,100,100)]">Reverted</div>
|
|
88
|
+
<div className="xpay-flex xpay-items-center">
|
|
89
|
+
<div className="xpay-text-[rgb(255,100,100)]">Reverted</div>
|
|
97
90
|
</div>
|
|
98
91
|
)}
|
|
99
92
|
|
|
@@ -105,76 +98,76 @@ export const HistoryCard: FC<Props> = ({ transaction, supportedChains }) => {
|
|
|
105
98
|
}/${transaction.hash}`}
|
|
106
99
|
target="_blank"
|
|
107
100
|
rel="noreferrer"
|
|
108
|
-
className="ml-2 no-underline"
|
|
101
|
+
className="xpay-ml-2 xpay-no-underline"
|
|
109
102
|
aria-label="Show the transaction in the chain explorer"
|
|
110
103
|
>
|
|
111
|
-
<div className="w-3.5 h-3.5">
|
|
104
|
+
<div className="xpay-w-3.5 xpay-h-3.5">
|
|
112
105
|
<ArrowUpRightIcon />
|
|
113
106
|
</div>
|
|
114
107
|
</a>
|
|
115
108
|
</div>
|
|
116
109
|
</div>
|
|
117
|
-
<div className="flex justify-between flex-wrap gap-2">
|
|
118
|
-
<div className="flex items-center">
|
|
119
|
-
<div className="flex items-center">
|
|
110
|
+
<div className="xpay-flex xpay-justify-between xpay-flex-wrap xpay-gap-2">
|
|
111
|
+
<div className="xpay-flex xpay-items-center">
|
|
112
|
+
<div className="xpay-flex xpay-items-center">
|
|
120
113
|
<img
|
|
121
114
|
src={sourceChainData?.image}
|
|
122
115
|
alt={`${sourceChainData?.name} logo`}
|
|
123
|
-
className="w-5 h-5 mr-1"
|
|
116
|
+
className="xpay-w-5 xpay-h-5 xpay-mr-1"
|
|
124
117
|
/>
|
|
125
118
|
<div>{sourceChainData?.displayName}</div>
|
|
126
119
|
</div>
|
|
127
120
|
|
|
128
|
-
<div className="w-3.5 h-3.5 my-0 mx-1.5">
|
|
121
|
+
<div className="xpay-w-3.5 xpay-h-3.5 xpay-my-0 xpay-mx-1.5">
|
|
129
122
|
<ArrowRightIcon />
|
|
130
123
|
</div>
|
|
131
124
|
|
|
132
|
-
<div className="flex items-center">
|
|
125
|
+
<div className="xpay-flex xpay-items-center">
|
|
133
126
|
<img
|
|
134
127
|
src={targetChainData?.image}
|
|
135
128
|
alt={`${targetChainData?.name} logo`}
|
|
136
|
-
className="w-5 h-5 mr-1"
|
|
129
|
+
className="xpay-w-5 xpay-h-5 xpay-mr-1"
|
|
137
130
|
/>
|
|
138
131
|
<div>{targetChainData?.displayName}</div>
|
|
139
132
|
</div>
|
|
140
133
|
</div>
|
|
141
134
|
|
|
142
|
-
<div className="flex items-center mb-2 last:mb-0">
|
|
143
|
-
<div className="flex items-center flex-wrap">
|
|
144
|
-
<div className="flex items-center">
|
|
135
|
+
<div className="xpay-flex xpay-items-center xpay-mb-2 last:xpay-mb-0">
|
|
136
|
+
<div className="xpay-flex xpay-items-center xpay-flex-wrap">
|
|
137
|
+
<div className="xpay-flex xpay-items-center">
|
|
145
138
|
{Number(transferredAmount) < MINIMUM_DISPLAYED_TOKEN_AMOUNT
|
|
146
139
|
? `<${MINIMUM_DISPLAYED_TOKEN_AMOUNT}`
|
|
147
140
|
: transferredAmount}
|
|
148
|
-
<div className="ml-1">{tokenData?.symbol}</div>
|
|
141
|
+
<div className="xpay-ml-1">{tokenData?.symbol}</div>
|
|
149
142
|
{tokenData?.image ? (
|
|
150
143
|
<img
|
|
151
144
|
src={tokenData?.image}
|
|
152
145
|
alt={tokenData?.name || ""}
|
|
153
|
-
className="w-5 h-5 ml-1"
|
|
146
|
+
className="xpay-w-5 xpay-h-5 xpay-ml-1"
|
|
154
147
|
/>
|
|
155
148
|
) : (
|
|
156
|
-
<div className="flex items-center justify-center w-5 h-5 text-[10px] ml-1 rounded-full bg-[#272e40] text-[#e0e7fa]">
|
|
149
|
+
<div className="xpay-flex xpay-items-center xpay-justify-center xpay-w-5 xpay-h-5 xpay-text-[10px] xpay-ml-1 xpay-rounded-full xpay-bg-[#272e40] xpay-text-[#e0e7fa]">
|
|
157
150
|
{tokenData?.symbol.substring(0, 1)}
|
|
158
151
|
</div>
|
|
159
152
|
)}
|
|
160
153
|
</div>
|
|
161
154
|
{transaction.tokenOutAddress && (
|
|
162
155
|
<>
|
|
163
|
-
<div className="w-3.5 h-3.5 my-0 mx-1.5">
|
|
156
|
+
<div className="xpay-w-3.5 xpay-h-3.5 xpay-my-0 xpay-mx-1.5">
|
|
164
157
|
<ArrowRightIcon />
|
|
165
158
|
</div>
|
|
166
|
-
<div className="flex items-center">
|
|
159
|
+
<div className="xpay-flex xpay-items-center">
|
|
167
160
|
{Number(receivedAmount) < 0.0001 ? "<0.0001" : receivedAmount}
|
|
168
|
-
<div className="ml-1">{tokenOutData?.symbol}</div>
|
|
161
|
+
<div className="xpay-ml-1">{tokenOutData?.symbol}</div>
|
|
169
162
|
|
|
170
163
|
{tokenOutData?.image ? (
|
|
171
164
|
<img
|
|
172
165
|
src={tokenOutData?.image}
|
|
173
166
|
alt={tokenOutData?.name || ""}
|
|
174
|
-
className="w-5 h-5 ml-1"
|
|
167
|
+
className="xpay-w-5 xpay-h-5 xpay-ml-1"
|
|
175
168
|
/>
|
|
176
169
|
) : (
|
|
177
|
-
<div className="flex items-center justify-center w-5 h-5 text-[10px] ml-1 rounded-full bg-[#272e40] text-[#e0e7fa]">
|
|
170
|
+
<div className="xpay-flex xpay-items-center xpay-justify-center xpay-w-5 xpay-h-5 xpay-text-[10px] xpay-ml-1 xpay-rounded-full xpay-bg-[#272e40] xpay-text-[#e0e7fa]">
|
|
178
171
|
{tokenData?.symbol.substring(0, 1)}
|
|
179
172
|
</div>
|
|
180
173
|
)}
|
|
@@ -2,8 +2,8 @@ import { ChainlinkCCIPIcon, XSwapBadgeIcon } from "@src/components/icons";
|
|
|
2
2
|
|
|
3
3
|
export const PoweredBy = () => {
|
|
4
4
|
return (
|
|
5
|
-
<div className="flex justify-center items-center gap-2 my-3">
|
|
6
|
-
<span className="text-x_grey">Powered by</span>
|
|
5
|
+
<div className="xpay-flex xpay-justify-center xpay-items-center xpay-gap-2 xpay-my-3">
|
|
6
|
+
<span className="xpay-text-x_grey">Powered by</span>
|
|
7
7
|
<XSwapBadgeIcon />
|
|
8
8
|
<span>✕</span>
|
|
9
9
|
<ChainlinkCCIPIcon />
|
|
@@ -30,42 +30,46 @@ export const Settings: FC<Props> = ({
|
|
|
30
30
|
}, [slippageActivePresetIndex, usingSlippageInput]);
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<div className="absolute w-[310px] right-0 top-[46px] z-10 bg-black border border-solid border-[rgba(54,129,198,1)] p-4 rounded-xl">
|
|
34
|
-
<div className="flex flex-col gap-4 justify-between">
|
|
35
|
-
<div className="flex justify-between">
|
|
36
|
-
<div className="text-base">Settings</div>
|
|
33
|
+
<div className="xpay-absolute xpay-w-[310px] xpay-right-0 xpay-top-[46px] xpay-z-10 xpay-bg-black xpay-border xpay-border-solid xpay-border-[rgba(54,129,198,1)] xpay-p-4 xpay-rounded-xl">
|
|
34
|
+
<div className="xpay-flex xpay-flex-col xpay-gap-4 xpay-justify-between">
|
|
35
|
+
<div className="xpay-flex xpay-justify-between">
|
|
36
|
+
<div className="xpay-text-base">Settings</div>
|
|
37
37
|
<div
|
|
38
|
-
className="cursor-pointer"
|
|
38
|
+
className="xpay-cursor-pointer"
|
|
39
39
|
onClick={() => setSettingsShown(false)}
|
|
40
40
|
>
|
|
41
41
|
<CloseIcon />
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
44
|
<div>
|
|
45
|
-
<div className="flex gap-2 items-center">
|
|
46
|
-
<div className="text-sm text-[rgba(255,255,255,0.6)]">
|
|
45
|
+
<div className="xpay-flex xpay-gap-2 xpay-items-center">
|
|
46
|
+
<div className="xpay-text-sm xpay-text-[rgba(255,255,255,0.6)]">
|
|
47
47
|
Express delivery
|
|
48
48
|
</div>
|
|
49
49
|
<div>
|
|
50
50
|
<span
|
|
51
|
-
className="inline-flex w-14 h-9 p-3 relative align-middle box-border overflow-hidden cursor-pointer"
|
|
51
|
+
className="xpay-inline-flex xpay-w-14 xpay-h-9 xpay-p-3 xpay-relative xpay-align-middle xpay-box-border xpay-overflow-hidden xpay-cursor-pointer"
|
|
52
52
|
onClick={() => {
|
|
53
53
|
setExpressChecked((x) => !x);
|
|
54
54
|
}}
|
|
55
55
|
>
|
|
56
|
-
<span className="h-full, w-full rounded-lg bg-[rgba(255,255,255,0.3)]"></span>
|
|
56
|
+
<span className="xpay-h-full, xpay-w-full xpay-rounded-lg xpay-bg-[rgba(255,255,255,0.3)]"></span>
|
|
57
57
|
<span
|
|
58
|
-
className={`transition-all w-5 h-5 rounded-full absolute translate-y-[-4px]
|
|
59
|
-
${
|
|
58
|
+
className={`xpay-transition-all xpay-w-5 xpay-h-5 xpay-rounded-full xpay-absolute xpay-translate-y-[-4px]
|
|
59
|
+
${
|
|
60
|
+
expressChecked
|
|
61
|
+
? "xpay-translate-x-[12px] xpay-bg-x_blue"
|
|
62
|
+
: "xpay-bg-white"
|
|
63
|
+
} `}
|
|
60
64
|
></span>
|
|
61
65
|
</span>
|
|
62
66
|
</div>
|
|
63
67
|
</div>
|
|
64
|
-
<div className="flex gap-4">
|
|
65
|
-
<div className="min-w-[26px] min-h-[26px] text-[#ffa726]">
|
|
68
|
+
<div className="xpay-flex xpay-gap-4">
|
|
69
|
+
<div className="xpay-min-w-[26px] xpay-min-h-[26px] xpay-text-[#ffa726]">
|
|
66
70
|
<InfoIcon />
|
|
67
71
|
</div>
|
|
68
|
-
<div className="text-xs text-left">
|
|
72
|
+
<div className="xpay-text-xs xpay-text-left">
|
|
69
73
|
Express delivery is a special feature of XSwap that reduces
|
|
70
74
|
transaction time across chains to around 30 seconds. It is
|
|
71
75
|
currently available for swaps below a value of $ 1000 USD.
|
|
@@ -73,20 +77,22 @@ export const Settings: FC<Props> = ({
|
|
|
73
77
|
</div>
|
|
74
78
|
</div>
|
|
75
79
|
|
|
76
|
-
<div className="flex flex-col gap-2
|
|
77
|
-
<div className="
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
<div className="xpay-flex xpay-flex-col xpay-gap-2">
|
|
81
|
+
<div className="xpay-text-[rgba(255,255,255,0.6)] xpay-text-sm">
|
|
82
|
+
Slippage
|
|
83
|
+
</div>
|
|
84
|
+
<div className="xpay-flex xpay-gap-2">
|
|
85
|
+
<div className="xpay-flex xpay-items-center xpay-bg-[rgba(15,15,15,1)] p-1 xpay-global-border xpay-rounded-xl">
|
|
80
86
|
{SLIPPAGE_PRESETS.map((preset, index) => (
|
|
81
87
|
<div
|
|
82
88
|
key={index}
|
|
83
|
-
className={`transition-all cursor-pointer block rounded-lg p-2 border-none text-sm leading-[10px] ${
|
|
89
|
+
className={`xpay-transition-all xpay-cursor-pointer xpay-block xpay-rounded-lg xpay-p-2 xpay-border-none xpay-text-sm xpay-leading-[10px] ${
|
|
84
90
|
index === slippageActivePresetIndex && !usingSlippageInput
|
|
85
|
-
? "text-white"
|
|
86
|
-
: "text-[rgba(255,255,255,0.2)]"
|
|
91
|
+
? "xpay-text-white"
|
|
92
|
+
: "xpay-text-[rgba(255,255,255,0.2)]"
|
|
87
93
|
} ${
|
|
88
94
|
index === slippageActivePresetIndex && !usingSlippageInput
|
|
89
|
-
? "bg-gradient-to-r from-[#3681c6] to-[#2b4a9d]"
|
|
95
|
+
? "xpay-bg-gradient-to-r xpay-from-[#3681c6] xpay-to-[#2b4a9d]"
|
|
90
96
|
: ""
|
|
91
97
|
}`}
|
|
92
98
|
onClick={() => {
|
|
@@ -98,9 +104,9 @@ export const Settings: FC<Props> = ({
|
|
|
98
104
|
</div>
|
|
99
105
|
))}
|
|
100
106
|
</div>
|
|
101
|
-
<div className="bg-[rgba(39,39,39,1)] p-2 border border-solid border-[rgba(82,82,82,1)] rounded-xl text-white flex items-center">
|
|
107
|
+
<div className="xpay-bg-[rgba(39,39,39,1)] xpay-p-2 xpay-border xpay-border-solid xpay-border-[rgba(82,82,82,1)] xpay-rounded-xl xpay-text-white xpay-flex xpay-items-center">
|
|
102
108
|
<input
|
|
103
|
-
className="text-white border-none bg-[rgba(39,39,39,1)] w-10 placeholder:text-[rgba(255,255,255,0.2)] focus:outline-none text-sm leading-none"
|
|
109
|
+
className="xpay-text-white xpay-border-none xpay-bg-[rgba(39,39,39,1)] xpay-w-10 placeholder:xpay-text-[rgba(255,255,255,0.2)] focus:xpay-outline-none xpay-text-sm xpay-leading-none"
|
|
104
110
|
placeholder="1.5"
|
|
105
111
|
value={usingSlippageInput ? slippage : ""}
|
|
106
112
|
onChange={(e) => {
|
|
@@ -118,11 +124,11 @@ export const Settings: FC<Props> = ({
|
|
|
118
124
|
<PercentageIcon />
|
|
119
125
|
</div>
|
|
120
126
|
</div>
|
|
121
|
-
<div className="flex gap-4">
|
|
122
|
-
<div className="min-w-[26px] min-h-[26px] text-[#ffa726]">
|
|
127
|
+
<div className="xpay-flex xpay-gap-4">
|
|
128
|
+
<div className="xpay-min-w-[26px] xpay-min-h-[26px] xpay-text-[#ffa726]">
|
|
123
129
|
<InfoIcon />
|
|
124
130
|
</div>
|
|
125
|
-
<div className="text-xs text-left">
|
|
131
|
+
<div className="xpay-text-xs xpay-text-left">
|
|
126
132
|
Slippage is the price variation you are willing to accept in the
|
|
127
133
|
event that the price of the trade changes while it is processing.
|
|
128
134
|
<br /> <br />
|
|
@@ -41,44 +41,45 @@ export const Summary: FC<Props> = ({
|
|
|
41
41
|
}, [dstChain]);
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
|
-
<div className="flex flex-col
|
|
45
|
-
<div className="flex justify-between">
|
|
46
|
-
<div className="flex flex-col gap-1">
|
|
47
|
-
<p className="text-[rgba(255,255,255,0.6)] text-sm">
|
|
44
|
+
<div className="xpay-flex xpay-flex-col xpay-global-border xpay-rounded-lg xpay-bg-[rgba(15,15,15,1)] xpay-p-4 xpay-relative">
|
|
45
|
+
<div className="xpay-flex xpay-justify-between">
|
|
46
|
+
<div className="xpay-flex xpay-flex-col xpay-gap-1">
|
|
47
|
+
<p className="xpay-text-[rgba(255,255,255,0.6)] xpay-text-sm">
|
|
48
|
+
You receive
|
|
49
|
+
</p>
|
|
48
50
|
{isGettingRoute ? (
|
|
49
51
|
<Skeleton
|
|
50
|
-
width="w-[100px]"
|
|
51
|
-
height="h-[36px]"
|
|
52
|
-
other="sm:w-[190px]"
|
|
52
|
+
width="xpay-w-[100px]"
|
|
53
|
+
height="xpay-h-[36px]"
|
|
54
|
+
other="sm:xpay-w-[190px]"
|
|
53
55
|
/>
|
|
54
56
|
) : (
|
|
55
|
-
<div className="flex gap-2 items-center text-white text-xl sm:text-3xl">
|
|
57
|
+
<div className="xpay-flex xpay-gap-2 xpay-items-center xpay-text-white xpay-text-xl sm:xpay-text-3xl">
|
|
56
58
|
{amountReadable}
|
|
57
59
|
</div>
|
|
58
60
|
)}
|
|
59
61
|
</div>
|
|
60
|
-
<div className="flex flex-col items-end gap-1 text-sm">
|
|
61
|
-
<div className="flex justify-center items-center gap-1">
|
|
62
|
-
<div className="w-5 h-5">
|
|
62
|
+
<div className="xpay-flex xpay-flex-col xpay-items-end xpay-gap-1 xpay-text-sm">
|
|
63
|
+
<div className="xpay-flex xpay-justify-center xpay-items-center xpay-gap-1">
|
|
64
|
+
<div className="xpay-w-5 xpay-h-5">
|
|
63
65
|
{dstToken?.image ? (
|
|
64
66
|
<img
|
|
65
|
-
className="w-5 h-5"
|
|
67
|
+
className="xpay-w-5 xpay-h-5"
|
|
66
68
|
src={dstToken?.image}
|
|
67
69
|
alt={dstToken?.name}
|
|
68
70
|
/>
|
|
69
71
|
) : (
|
|
70
|
-
<UnknownTokenLogo
|
|
71
|
-
tokenName={"?"}
|
|
72
|
-
className="token-select__generated-logo"
|
|
73
|
-
/>
|
|
72
|
+
<UnknownTokenLogo tokenName={"?"} />
|
|
74
73
|
)}
|
|
75
74
|
</div>
|
|
76
|
-
<p className="text-base sm:text-xl">{dstToken?.name}</p>
|
|
75
|
+
<p className="xpay-text-base sm:xpay-text-xl">{dstToken?.name}</p>
|
|
77
76
|
</div>
|
|
78
|
-
<div className="flex justify-center items-center gap-1">
|
|
79
|
-
<p className="text-[rgba(255,255,255,0.6)] text-right">
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
<div className="xpay-flex xpay-justify-center xpay-items-center xpay-gap-1">
|
|
78
|
+
<p className="xpay-text-[rgba(255,255,255,0.6)] xpay-text-right">
|
|
79
|
+
on{" "}
|
|
80
|
+
</p>
|
|
81
|
+
<div className="xpay-flex xpay-items-center xpay-gap-1 xpay-text-white">
|
|
82
|
+
<div className="xpay-w-4 xpay-h-4">
|
|
82
83
|
<img src={dstChain?.image} alt={dstChain?.name} />
|
|
83
84
|
</div>
|
|
84
85
|
<div>{dstChain?.displayName}</div>
|
|
@@ -93,8 +94,8 @@ export const Summary: FC<Props> = ({
|
|
|
93
94
|
loading={isGettingRoute}
|
|
94
95
|
type="dst"
|
|
95
96
|
/>
|
|
96
|
-
<div className="absolute right-[50%] top-0 translate-x-1/2 translate-y-[-60%]
|
|
97
|
-
<div className="
|
|
97
|
+
<div className="xpay-absolute xpay-right-[50%] xpay-top-0 xpay-translate-x-1/2 xpay-translate-y-[-60%] xpay-global-border xpay-rounded-xl p-[5px] xpay-bg-[rgba(15,15,15,1)]">
|
|
98
|
+
<div className="xpay-flex xpay-items-center xpay-justify-center xpay-rounded-lg xpay-w-8 xpay-h-8 xpay-bg-gradient-to-l xpay-from-[rgba(54,129,198,1)] xpay-to-[rgba(43,74,157,1)] ">
|
|
98
99
|
<ArrowDownIcon />
|
|
99
100
|
</div>
|
|
100
101
|
</div>
|