@xswap-link/sdk 0.2.3 → 0.2.5
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 +17 -0
- package/dist/index.css +20 -21
- package/dist/index.d.mts +24 -13
- package/dist/index.d.ts +24 -13
- package/dist/index.js +747 -527
- package/dist/index.mjs +645 -425
- package/package.json +1 -1
- package/src/components/TxConfigForm/FeesDetails.tsx +55 -37
- package/src/components/TxConfigForm/Form.tsx +30 -7
- package/src/components/TxConfigForm/History.tsx +31 -4
- package/src/components/TxConfigForm/Summary.tsx +28 -11
- package/src/components/TxConfigForm/SwapPanel.tsx +5 -1
- package/src/components/TxConfigForm/TopBar.tsx +8 -3
- package/src/components/TxConfigForm/UsdPrice.tsx +14 -1
- package/src/components/TxConfigForm/index.tsx +10 -10
- package/src/components/TxStatusButton/index.tsx +21 -13
- package/src/components/UnknownTokenLogo/UnknownTokenLogo.tsx +14 -0
- package/src/components/WaitingForInit/index.tsx +20 -0
- package/src/components/global.css +1 -1
- package/src/config/init.tsx +75 -0
- package/src/constants/index.ts +1 -0
- package/src/index.ts +9 -1
- package/src/models/Route.ts +6 -2
- package/src/models/TokenData.ts +1 -1
- package/src/models/TransactionHistory.ts +12 -8
- package/src/models/payloads/GetRoutePayload.ts +1 -0
- package/src/models/payloads/GetSwapTxPayload.ts +1 -0
- package/src/services/api.ts +9 -0
- package/src/services/blockchain.ts +49 -0
- package/src/services/index.ts +1 -0
- package/src/services/integrations/monitoring.ts +34 -14
- package/src/services/integrations/transactions.ts +8 -3
- package/src/utils/contracts.ts +2 -4
- package/src/utils/strings.ts +4 -0
- package/tailwind.config.js +2 -2
- package/src/config/init.ts +0 -35
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// src/config/init.
|
|
8
|
+
// src/config/init.tsx
|
|
9
9
|
import { createRoot } from "react-dom/client";
|
|
10
10
|
|
|
11
11
|
// xswap.config.ts
|
|
@@ -23,74 +23,92 @@ var xswap_config_default = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
// package.json
|
|
26
|
-
var version = "0.2.
|
|
26
|
+
var version = "0.2.5";
|
|
27
27
|
|
|
28
|
-
// src/
|
|
28
|
+
// src/components/WaitingForInit/index.tsx
|
|
29
|
+
import { jsx } from "react/jsx-runtime";
|
|
30
|
+
var WaitingForInit = () => {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
style: {
|
|
35
|
+
zIndex: 10,
|
|
36
|
+
top: 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
bottom: 0,
|
|
39
|
+
left: 0,
|
|
40
|
+
backgroundColor: "rgba(0,0,0,0.8)",
|
|
41
|
+
position: "fixed",
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center"
|
|
45
|
+
},
|
|
46
|
+
children: "Waiting for XPay initialization ..."
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// src/config/init.tsx
|
|
52
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
53
|
+
var initIndicatorRoot;
|
|
29
54
|
var xswapRoot;
|
|
30
55
|
var txStatusRoot;
|
|
56
|
+
var initCompleted = false;
|
|
31
57
|
var initDocument = () => {
|
|
32
58
|
if (typeof document === "undefined") {
|
|
33
59
|
throw new Error("Can't render XPay components from server side.");
|
|
34
60
|
}
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
createInitIndicatorRoot();
|
|
62
|
+
Promise.all([
|
|
63
|
+
createStyleElement(),
|
|
64
|
+
createXSwapRoot(),
|
|
65
|
+
createTxStatusRoot()
|
|
66
|
+
]).then(() => {
|
|
67
|
+
initCompleted = true;
|
|
37
68
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
};
|
|
70
|
+
var waitForInitialization = async () => {
|
|
71
|
+
if (!initCompleted) {
|
|
72
|
+
displayInitIndicator(true);
|
|
73
|
+
while (!initCompleted) {
|
|
74
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
43
75
|
}
|
|
76
|
+
displayInitIndicator(false);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var createStyleElement = async () => {
|
|
80
|
+
const css = await fetch(
|
|
81
|
+
`${xswap_config_default.apiUrl}/sdk/css?${new URLSearchParams({
|
|
82
|
+
data: JSON.stringify({ version })
|
|
83
|
+
})}`
|
|
44
84
|
);
|
|
85
|
+
const text = await css.text();
|
|
86
|
+
const style = document.createElement("style");
|
|
87
|
+
style.textContent = text;
|
|
88
|
+
document.body.appendChild(style);
|
|
89
|
+
};
|
|
90
|
+
var createXSwapRoot = async () => {
|
|
45
91
|
const xswapElement = document.createElement("div");
|
|
46
92
|
xswapElement.setAttribute("id", "xswap-modal");
|
|
47
93
|
document.body.appendChild(xswapElement);
|
|
48
94
|
xswapRoot = createRoot(xswapElement);
|
|
95
|
+
};
|
|
96
|
+
var createTxStatusRoot = async () => {
|
|
49
97
|
const txStatusElement = document.createElement("div");
|
|
50
98
|
txStatusElement.setAttribute("id", "xswap-tx-status");
|
|
51
99
|
txStatusElement.setAttribute("class", "xswap-tx-status");
|
|
52
100
|
document.body.appendChild(txStatusElement);
|
|
53
101
|
txStatusRoot = createRoot(txStatusElement);
|
|
54
102
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// src/models/Ecosystem.ts
|
|
65
|
-
var Ecosystem = /* @__PURE__ */ ((Ecosystem2) => {
|
|
66
|
-
Ecosystem2["EVM"] = "evm";
|
|
67
|
-
return Ecosystem2;
|
|
68
|
-
})(Ecosystem || {});
|
|
69
|
-
|
|
70
|
-
// src/models/Environment.ts
|
|
71
|
-
var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
72
|
-
Environment2["PROD"] = "production";
|
|
73
|
-
Environment2["DEV"] = "develop";
|
|
74
|
-
Environment2["LOCAL"] = "local";
|
|
75
|
-
return Environment2;
|
|
76
|
-
})(Environment || {});
|
|
77
|
-
|
|
78
|
-
// src/models/Web3Environment.ts
|
|
79
|
-
var Web3Environment = /* @__PURE__ */ ((Web3Environment2) => {
|
|
80
|
-
Web3Environment2["DEVNET"] = "devnet";
|
|
81
|
-
Web3Environment2["TESTNET"] = "testnet";
|
|
82
|
-
Web3Environment2["MAINNET"] = "mainnet";
|
|
83
|
-
return Web3Environment2;
|
|
84
|
-
})(Web3Environment || {});
|
|
85
|
-
|
|
86
|
-
// src/models/XSwapCallType.ts
|
|
87
|
-
var XSwapCallType = /* @__PURE__ */ ((XSwapCallType2) => {
|
|
88
|
-
XSwapCallType2[XSwapCallType2["DEFAULT"] = 0] = "DEFAULT";
|
|
89
|
-
XSwapCallType2[XSwapCallType2["FULL_TOKEN_BALANCE"] = 1] = "FULL_TOKEN_BALANCE";
|
|
90
|
-
XSwapCallType2[XSwapCallType2["FULL_NATIVE_BALANCE"] = 2] = "FULL_NATIVE_BALANCE";
|
|
91
|
-
XSwapCallType2[XSwapCallType2["COLLECT_TOKEN_BALANCE"] = 3] = "COLLECT_TOKEN_BALANCE";
|
|
92
|
-
return XSwapCallType2;
|
|
93
|
-
})(XSwapCallType || {});
|
|
103
|
+
var createInitIndicatorRoot = () => {
|
|
104
|
+
const initIndicatorElement = document.createElement("div");
|
|
105
|
+
initIndicatorElement.setAttribute("id", "xswap-init-indicator");
|
|
106
|
+
document.body.appendChild(initIndicatorElement);
|
|
107
|
+
initIndicatorRoot = createRoot(initIndicatorElement);
|
|
108
|
+
};
|
|
109
|
+
var displayInitIndicator = (display) => {
|
|
110
|
+
display ? initIndicatorRoot.render(/* @__PURE__ */ jsx2(WaitingForInit, {})) : initIndicatorRoot.render("");
|
|
111
|
+
};
|
|
94
112
|
|
|
95
113
|
// src/services/api.ts
|
|
96
114
|
async function _sendRequest(urlPath, options) {
|
|
@@ -134,37 +152,60 @@ async function getPrices(payload) {
|
|
|
134
152
|
})}`
|
|
135
153
|
);
|
|
136
154
|
}
|
|
155
|
+
async function getTxStatus(payload) {
|
|
156
|
+
return await _sendRequest(
|
|
157
|
+
`/getTxStatus?${new URLSearchParams({
|
|
158
|
+
data: JSON.stringify(payload)
|
|
159
|
+
// todo remove once gcp starts working
|
|
160
|
+
})}`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
137
163
|
|
|
138
164
|
// src/services/integrations/customCalls/staking.ts
|
|
139
165
|
import { ethers as ethers2 } from "ethers";
|
|
140
166
|
|
|
167
|
+
// src/models/Addresses.ts
|
|
168
|
+
var ContractName = /* @__PURE__ */ ((ContractName2) => {
|
|
169
|
+
ContractName2["BatchQuery"] = "BatchQuery";
|
|
170
|
+
ContractName2["FeeCollector"] = "FeeCollector";
|
|
171
|
+
ContractName2["XSwapRouter"] = "XSwapRouter";
|
|
172
|
+
return ContractName2;
|
|
173
|
+
})(ContractName || {});
|
|
174
|
+
|
|
175
|
+
// src/models/Ecosystem.ts
|
|
176
|
+
var Ecosystem = /* @__PURE__ */ ((Ecosystem2) => {
|
|
177
|
+
Ecosystem2["EVM"] = "evm";
|
|
178
|
+
return Ecosystem2;
|
|
179
|
+
})(Ecosystem || {});
|
|
180
|
+
|
|
181
|
+
// src/models/Environment.ts
|
|
182
|
+
var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
183
|
+
Environment2["PROD"] = "production";
|
|
184
|
+
Environment2["DEV"] = "develop";
|
|
185
|
+
Environment2["LOCAL"] = "local";
|
|
186
|
+
return Environment2;
|
|
187
|
+
})(Environment || {});
|
|
188
|
+
|
|
189
|
+
// src/models/Web3Environment.ts
|
|
190
|
+
var Web3Environment = /* @__PURE__ */ ((Web3Environment2) => {
|
|
191
|
+
Web3Environment2["DEVNET"] = "devnet";
|
|
192
|
+
Web3Environment2["TESTNET"] = "testnet";
|
|
193
|
+
Web3Environment2["MAINNET"] = "mainnet";
|
|
194
|
+
return Web3Environment2;
|
|
195
|
+
})(Web3Environment || {});
|
|
196
|
+
|
|
197
|
+
// src/models/XSwapCallType.ts
|
|
198
|
+
var XSwapCallType = /* @__PURE__ */ ((XSwapCallType2) => {
|
|
199
|
+
XSwapCallType2[XSwapCallType2["DEFAULT"] = 0] = "DEFAULT";
|
|
200
|
+
XSwapCallType2[XSwapCallType2["FULL_TOKEN_BALANCE"] = 1] = "FULL_TOKEN_BALANCE";
|
|
201
|
+
XSwapCallType2[XSwapCallType2["FULL_NATIVE_BALANCE"] = 2] = "FULL_NATIVE_BALANCE";
|
|
202
|
+
XSwapCallType2[XSwapCallType2["COLLECT_TOKEN_BALANCE"] = 3] = "COLLECT_TOKEN_BALANCE";
|
|
203
|
+
return XSwapCallType2;
|
|
204
|
+
})(XSwapCallType || {});
|
|
205
|
+
|
|
141
206
|
// src/utils/contracts.ts
|
|
142
207
|
import { ethers } from "ethers";
|
|
143
208
|
|
|
144
|
-
// src/utils/numbers.ts
|
|
145
|
-
import { BigNumber as BigNumberJS } from "bignumber.js";
|
|
146
|
-
import { BigNumber, utils } from "ethers";
|
|
147
|
-
var safeBigNumberFrom = (value) => {
|
|
148
|
-
BigNumberJS.config({ DECIMAL_PLACES: 0 });
|
|
149
|
-
return BigNumber.from(new BigNumberJS(value).div(1).toFixed());
|
|
150
|
-
};
|
|
151
|
-
var weiToHumanReadable = ({
|
|
152
|
-
amount,
|
|
153
|
-
decimals,
|
|
154
|
-
precisionFractionalPlaces,
|
|
155
|
-
prettifySmallNumber = false
|
|
156
|
-
}) => {
|
|
157
|
-
const decimalsFactor = Math.pow(10, decimals);
|
|
158
|
-
BigNumberJS.config({ DECIMAL_PLACES: precisionFractionalPlaces });
|
|
159
|
-
const res = new BigNumberJS(amount).div(decimalsFactor).toFixed();
|
|
160
|
-
if (prettifySmallNumber && res === "0" && amount !== "0") {
|
|
161
|
-
return `<${(1 / 10 ** precisionFractionalPlaces).toFixed(
|
|
162
|
-
precisionFractionalPlaces
|
|
163
|
-
)}`;
|
|
164
|
-
}
|
|
165
|
-
return res;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
209
|
// src/contracts/abi/BatchQuery.json
|
|
169
210
|
var BatchQuery_default = [
|
|
170
211
|
{
|
|
@@ -493,6 +534,7 @@ var NUMBER_INPUT_REGEX = /^[0-9]*[.,]?[0-9]*$/;
|
|
|
493
534
|
var SLIPPAGE_PRESETS = [0.5, 1.5, 3];
|
|
494
535
|
var DELIVERY_TIME = 30 * 1e3 * 60;
|
|
495
536
|
var EXPRESS_DELIVERY_TIME = 30 * 1e3;
|
|
537
|
+
var EXPRESS_DELIVERY_LIMIT = 1e3;
|
|
496
538
|
var BALANCES_CHUNK_SIZE = 500;
|
|
497
539
|
var ROUTE_TIMEOUT_MS = 5e3;
|
|
498
540
|
var MINIMUM_DISPLAYED_TOKEN_AMOUNT = 1e-4;
|
|
@@ -561,6 +603,30 @@ var getErc20Balances = async (chain, wallet) => {
|
|
|
561
603
|
return balances;
|
|
562
604
|
};
|
|
563
605
|
|
|
606
|
+
// src/utils/numbers.ts
|
|
607
|
+
import { BigNumber as BigNumberJS } from "bignumber.js";
|
|
608
|
+
import { BigNumber as BigNumber2, utils } from "ethers";
|
|
609
|
+
var safeBigNumberFrom = (value) => {
|
|
610
|
+
BigNumberJS.config({ DECIMAL_PLACES: 0 });
|
|
611
|
+
return BigNumber2.from(new BigNumberJS(value).div(1).toFixed());
|
|
612
|
+
};
|
|
613
|
+
var weiToHumanReadable = ({
|
|
614
|
+
amount,
|
|
615
|
+
decimals,
|
|
616
|
+
precisionFractionalPlaces,
|
|
617
|
+
prettifySmallNumber = false
|
|
618
|
+
}) => {
|
|
619
|
+
const decimalsFactor = Math.pow(10, decimals);
|
|
620
|
+
BigNumberJS.config({ DECIMAL_PLACES: precisionFractionalPlaces });
|
|
621
|
+
const res = new BigNumberJS(amount).div(decimalsFactor).toFixed();
|
|
622
|
+
if (prettifySmallNumber && res === "0" && amount !== "0") {
|
|
623
|
+
return `<${(1 / 10 ** precisionFractionalPlaces).toFixed(
|
|
624
|
+
precisionFractionalPlaces
|
|
625
|
+
)}`;
|
|
626
|
+
}
|
|
627
|
+
return res;
|
|
628
|
+
};
|
|
629
|
+
|
|
564
630
|
// src/utils/strings.ts
|
|
565
631
|
var shortAddress = (address) => {
|
|
566
632
|
return `${address?.substring(0, 5)}...${address?.substring(
|
|
@@ -568,6 +634,9 @@ var shortAddress = (address) => {
|
|
|
568
634
|
address.length
|
|
569
635
|
)}`;
|
|
570
636
|
};
|
|
637
|
+
var isETHAddressValid = (address) => {
|
|
638
|
+
return /^0x[a-fA-F0-9]{40}$/.test(address);
|
|
639
|
+
};
|
|
571
640
|
|
|
572
641
|
// src/utils/index.ts
|
|
573
642
|
import { format } from "date-fns";
|
|
@@ -596,7 +665,7 @@ var getDate = (blockTimestamp) => {
|
|
|
596
665
|
};
|
|
597
666
|
|
|
598
667
|
// src/services/integrations/monitoring.ts
|
|
599
|
-
import { ethers as
|
|
668
|
+
import { ethers as ethers5 } from "ethers";
|
|
600
669
|
|
|
601
670
|
// src/components/Alert/index.tsx
|
|
602
671
|
import { jsxs } from "react/jsx-runtime";
|
|
@@ -608,7 +677,7 @@ var Alert = ({ desc }) => {
|
|
|
608
677
|
};
|
|
609
678
|
|
|
610
679
|
// src/components/TxConfigForm/index.tsx
|
|
611
|
-
import { useMemo as
|
|
680
|
+
import { useMemo as useMemo8 } from "react";
|
|
612
681
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
613
682
|
import { WagmiProvider } from "wagmi";
|
|
614
683
|
|
|
@@ -648,45 +717,24 @@ var mapTransports = (chains) => {
|
|
|
648
717
|
return transports;
|
|
649
718
|
};
|
|
650
719
|
|
|
651
|
-
// src/components/icons/CloseIcon.tsx
|
|
652
|
-
import { jsx } from "react/jsx-runtime";
|
|
653
|
-
var CloseIcon = () => {
|
|
654
|
-
return /* @__PURE__ */ jsx(
|
|
655
|
-
"svg",
|
|
656
|
-
{
|
|
657
|
-
height: "18",
|
|
658
|
-
width: "18",
|
|
659
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
660
|
-
viewBox: "0 0 10.312 8.319",
|
|
661
|
-
children: /* @__PURE__ */ jsx(
|
|
662
|
-
"path",
|
|
663
|
-
{
|
|
664
|
-
fill: "white",
|
|
665
|
-
d: "M6.073 4.078 10.151 0H9.093A1.87 1.87 0 0 0 7.77.548L5.157 3.162 2.543.548A1.87 1.87 0 0 0 1.22 0H.161L4.24 4.078 0 8.318h1.058a1.87 1.87 0 0 0 1.322-.547l2.777-2.777 2.776 2.777a1.869 1.869 0 0 0 1.322.548h1.058Z"
|
|
666
|
-
}
|
|
667
|
-
)
|
|
668
|
-
}
|
|
669
|
-
);
|
|
670
|
-
};
|
|
671
|
-
|
|
672
720
|
// src/components/icons/ArrowRightIcon.tsx
|
|
673
|
-
import { jsx as
|
|
721
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
674
722
|
var ArrowRightIcon = () => {
|
|
675
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ jsx3(
|
|
676
724
|
"svg",
|
|
677
725
|
{
|
|
678
726
|
xmlns: "http://www.w3.org/2000/svg",
|
|
679
727
|
viewBox: "0 0 448 512",
|
|
680
728
|
fill: "currentColor",
|
|
681
|
-
children: /* @__PURE__ */
|
|
729
|
+
children: /* @__PURE__ */ jsx3("path", { d: "M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z" })
|
|
682
730
|
}
|
|
683
731
|
);
|
|
684
732
|
};
|
|
685
733
|
|
|
686
734
|
// src/components/icons/ArrowDownIcon.tsx
|
|
687
|
-
import { jsx as
|
|
735
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
688
736
|
var ArrowDownIcon = () => {
|
|
689
|
-
return /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ jsx4(
|
|
690
738
|
"svg",
|
|
691
739
|
{
|
|
692
740
|
width: "20",
|
|
@@ -694,7 +742,7 @@ var ArrowDownIcon = () => {
|
|
|
694
742
|
viewBox: "0 0 20 20",
|
|
695
743
|
fill: "none",
|
|
696
744
|
xmlns: "http://www.w3.org/2000/svg",
|
|
697
|
-
children: /* @__PURE__ */
|
|
745
|
+
children: /* @__PURE__ */ jsx4(
|
|
698
746
|
"path",
|
|
699
747
|
{
|
|
700
748
|
d: "M12 2.45932L12 12.8957L15.8625 9.15023L18 11.1866L10.5 18.4593L3 11.1866L5.1375 9.15023L9 12.8957L9 2.45932L12 2.45932Z",
|
|
@@ -706,9 +754,9 @@ var ArrowDownIcon = () => {
|
|
|
706
754
|
};
|
|
707
755
|
|
|
708
756
|
// src/components/icons/ArrowLeftIcon.tsx
|
|
709
|
-
import { jsx as
|
|
757
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
710
758
|
var ArrowLeftIcon = () => {
|
|
711
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ jsx5(
|
|
712
760
|
"svg",
|
|
713
761
|
{
|
|
714
762
|
width: "10",
|
|
@@ -716,7 +764,7 @@ var ArrowLeftIcon = () => {
|
|
|
716
764
|
viewBox: "0 0 10 16",
|
|
717
765
|
fill: "none",
|
|
718
766
|
xmlns: "http://www.w3.org/2000/svg",
|
|
719
|
-
children: /* @__PURE__ */
|
|
767
|
+
children: /* @__PURE__ */ jsx5(
|
|
720
768
|
"path",
|
|
721
769
|
{
|
|
722
770
|
d: "M0.5 8L8.13251 15.5L9.5 14.1562L3.20318 8L9.4682 1.84375L8.10071 0.5L0.5 8Z",
|
|
@@ -728,44 +776,44 @@ var ArrowLeftIcon = () => {
|
|
|
728
776
|
};
|
|
729
777
|
|
|
730
778
|
// src/components/icons/ArrowUpRightIcon.tsx
|
|
731
|
-
import { jsx as
|
|
779
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
732
780
|
var ArrowUpRightIcon = () => {
|
|
733
|
-
return /* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ jsx6(
|
|
734
782
|
"svg",
|
|
735
783
|
{
|
|
736
784
|
xmlns: "http://www.w3.org/2000/svg",
|
|
737
785
|
viewBox: "0 0 512 512",
|
|
738
786
|
fill: "currentColor",
|
|
739
|
-
children: /* @__PURE__ */
|
|
787
|
+
children: /* @__PURE__ */ jsx6("path", { d: "M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z" })
|
|
740
788
|
}
|
|
741
789
|
);
|
|
742
790
|
};
|
|
743
791
|
|
|
744
792
|
// src/components/icons/CheckIcon.tsx
|
|
745
|
-
import { jsx as
|
|
793
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
746
794
|
var CheckIcon = () => {
|
|
747
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ jsx7(
|
|
748
796
|
"svg",
|
|
749
797
|
{
|
|
750
798
|
xmlns: "http://www.w3.org/2000/svg",
|
|
751
799
|
viewBox: "0 0 448 512",
|
|
752
800
|
fill: "currentColor",
|
|
753
|
-
children: /* @__PURE__ */
|
|
801
|
+
children: /* @__PURE__ */ jsx7("path", { d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" })
|
|
754
802
|
}
|
|
755
803
|
);
|
|
756
804
|
};
|
|
757
805
|
|
|
758
806
|
// src/components/icons/ChevronDownIcon.tsx
|
|
759
|
-
import { jsx as
|
|
807
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
760
808
|
var ChevronDownIcon = () => {
|
|
761
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ jsx8(
|
|
762
810
|
"svg",
|
|
763
811
|
{
|
|
764
812
|
width: "12",
|
|
765
813
|
height: "12",
|
|
766
814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
767
815
|
viewBox: "0 0 512 512",
|
|
768
|
-
children: /* @__PURE__ */
|
|
816
|
+
children: /* @__PURE__ */ jsx8(
|
|
769
817
|
"path",
|
|
770
818
|
{
|
|
771
819
|
fill: "currentColor",
|
|
@@ -777,9 +825,9 @@ var ChevronDownIcon = () => {
|
|
|
777
825
|
};
|
|
778
826
|
|
|
779
827
|
// src/components/icons/ChevronUpIcon.tsx
|
|
780
|
-
import { jsx as
|
|
828
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
781
829
|
var ChevronUpIcon = () => {
|
|
782
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ jsx9("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: /* @__PURE__ */ jsx9(
|
|
783
831
|
"path",
|
|
784
832
|
{
|
|
785
833
|
fill: "currentColor",
|
|
@@ -789,7 +837,7 @@ var ChevronUpIcon = () => {
|
|
|
789
837
|
};
|
|
790
838
|
|
|
791
839
|
// src/components/icons/CircularProgressIcon.tsx
|
|
792
|
-
import { jsx as
|
|
840
|
+
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
793
841
|
var CircularProgressIcon = () => {
|
|
794
842
|
return /* @__PURE__ */ jsxs2(
|
|
795
843
|
"svg",
|
|
@@ -801,7 +849,7 @@ var CircularProgressIcon = () => {
|
|
|
801
849
|
fill: "none",
|
|
802
850
|
xmlns: "http://www.w3.org/2000/svg",
|
|
803
851
|
children: [
|
|
804
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ jsx10(
|
|
805
853
|
"circle",
|
|
806
854
|
{
|
|
807
855
|
cx: "16.5",
|
|
@@ -812,16 +860,37 @@ var CircularProgressIcon = () => {
|
|
|
812
860
|
strokeWidth: "2"
|
|
813
861
|
}
|
|
814
862
|
),
|
|
815
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ jsx10("path", { d: "M1 16C1 7.71573 7.71573 1 16 1", stroke: "white", strokeWidth: "2" })
|
|
816
864
|
]
|
|
817
865
|
}
|
|
818
866
|
);
|
|
819
867
|
};
|
|
820
868
|
|
|
869
|
+
// src/components/icons/CloseIcon.tsx
|
|
870
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
871
|
+
var CloseIcon = () => {
|
|
872
|
+
return /* @__PURE__ */ jsx11(
|
|
873
|
+
"svg",
|
|
874
|
+
{
|
|
875
|
+
height: "18",
|
|
876
|
+
width: "18",
|
|
877
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
878
|
+
viewBox: "0 0 10.312 8.319",
|
|
879
|
+
children: /* @__PURE__ */ jsx11(
|
|
880
|
+
"path",
|
|
881
|
+
{
|
|
882
|
+
fill: "white",
|
|
883
|
+
d: "M6.073 4.078 10.151 0H9.093A1.87 1.87 0 0 0 7.77.548L5.157 3.162 2.543.548A1.87 1.87 0 0 0 1.22 0H.161L4.24 4.078 0 8.318h1.058a1.87 1.87 0 0 0 1.322-.547l2.777-2.777 2.776 2.777a1.869 1.869 0 0 0 1.322.548h1.058Z"
|
|
884
|
+
}
|
|
885
|
+
)
|
|
886
|
+
}
|
|
887
|
+
);
|
|
888
|
+
};
|
|
889
|
+
|
|
821
890
|
// src/components/icons/CoinsIcon.tsx
|
|
822
|
-
import { jsx as
|
|
891
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
823
892
|
var CoinsIcon = () => {
|
|
824
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ jsx12(
|
|
825
894
|
"svg",
|
|
826
895
|
{
|
|
827
896
|
width: "24",
|
|
@@ -829,7 +898,7 @@ var CoinsIcon = () => {
|
|
|
829
898
|
viewBox: "0 0 24 24",
|
|
830
899
|
fill: "none",
|
|
831
900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
832
|
-
children: /* @__PURE__ */
|
|
901
|
+
children: /* @__PURE__ */ jsx12(
|
|
833
902
|
"path",
|
|
834
903
|
{
|
|
835
904
|
d: "M15 20C12.7667 20 10.875 19.225 9.325 17.675C7.775 16.125 7 14.2333 7 12C7 9.76667 7.775 7.875 9.325 6.325C10.875 4.775 12.7667 4 15 4C17.2333 4 19.125 4.775 20.675 6.325C22.225 7.875 23 9.76667 23 12C23 14.2333 22.225 16.125 20.675 17.675C19.125 19.225 17.2333 20 15 20ZM7 19.75C5.23333 19.2833 3.79167 18.3333 2.675 16.9C1.55833 15.4667 1 13.8333 1 12C1 10.1667 1.55833 8.53333 2.675 7.1C3.79167 5.66667 5.23333 4.71667 7 4.25V6.35C5.8 6.76667 4.83333 7.49167 4.1 8.525C3.36667 9.55833 3 10.7167 3 12C3 13.2833 3.36667 14.4417 4.1 15.475C4.83333 16.5083 5.8 17.2333 7 17.65V19.75ZM15 18C16.6667 18 18.0833 17.4167 19.25 16.25C20.4167 15.0833 21 13.6667 21 12C21 10.3333 20.4167 8.91667 19.25 7.75C18.0833 6.58333 16.6667 6 15 6C13.3333 6 11.9167 6.58333 10.75 7.75C9.58333 8.91667 9 10.3333 9 12C9 13.6667 9.58333 15.0833 10.75 16.25C11.9167 17.4167 13.3333 18 15 18Z",
|
|
@@ -842,9 +911,9 @@ var CoinsIcon = () => {
|
|
|
842
911
|
};
|
|
843
912
|
|
|
844
913
|
// src/components/icons/DownArrorIcon.tsx
|
|
845
|
-
import { jsx as
|
|
914
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
846
915
|
var DownArrowIcon = () => {
|
|
847
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ jsx13(
|
|
848
917
|
"svg",
|
|
849
918
|
{
|
|
850
919
|
width: 16,
|
|
@@ -852,7 +921,7 @@ var DownArrowIcon = () => {
|
|
|
852
921
|
viewBox: "0 0 16 16",
|
|
853
922
|
fill: "none",
|
|
854
923
|
xmlns: "http://www.w3.org/2000/svg",
|
|
855
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ jsx13(
|
|
856
925
|
"path",
|
|
857
926
|
{
|
|
858
927
|
d: "M8.00008 9.76921L5.06421 6.83334H10.9359L8.00008 9.76921Z",
|
|
@@ -865,9 +934,9 @@ var DownArrowIcon = () => {
|
|
|
865
934
|
};
|
|
866
935
|
|
|
867
936
|
// src/components/icons/HistoryIcon.tsx
|
|
868
|
-
import { jsx as
|
|
937
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
869
938
|
var HistoryIcon = () => {
|
|
870
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ jsx14(
|
|
871
940
|
"svg",
|
|
872
941
|
{
|
|
873
942
|
width: "20",
|
|
@@ -875,7 +944,7 @@ var HistoryIcon = () => {
|
|
|
875
944
|
viewBox: "0 0 20 20",
|
|
876
945
|
fill: "none",
|
|
877
946
|
xmlns: "http://www.w3.org/2000/svg",
|
|
878
|
-
children: /* @__PURE__ */
|
|
947
|
+
children: /* @__PURE__ */ jsx14(
|
|
879
948
|
"path",
|
|
880
949
|
{
|
|
881
950
|
d: "M9.98413 17.5C8.1633 17.5 6.57667 16.8646 5.22424 15.5938C3.8718 14.3229 3.09663 12.7361 2.89871 10.8333H4.52163C4.70635 12.2778 5.3166 13.4722 6.35236 14.4167C7.38812 15.3611 8.59871 15.8333 9.98413 15.8333C11.5279 15.8333 12.8374 15.2674 13.9128 14.1354C14.9881 13.0035 15.5258 11.625 15.5258 10C15.5258 8.375 14.9881 6.99653 13.9128 5.86458C12.8374 4.73264 11.5279 4.16667 9.98413 4.16667C9.07371 4.16667 8.22267 4.38889 7.43101 4.83333C6.63934 5.27778 5.97302 5.88889 5.43205 6.66667H7.60913V8.33333H2.85913V3.33333H4.44246V5.29167C5.11538 4.40278 5.93673 3.71528 6.90653 3.22917C7.87632 2.74306 8.90219 2.5 9.98413 2.5C10.9737 2.5 11.9006 2.69792 12.7649 3.09375C13.6291 3.48958 14.3812 4.02431 15.0211 4.69792C15.661 5.37153 16.169 6.16319 16.5451 7.07292C16.9211 7.98264 17.1091 8.95833 17.1091 10C17.1091 11.0417 16.9211 12.0174 16.5451 12.9271C16.169 13.8368 15.661 14.6285 15.0211 15.3021C14.3812 15.9757 13.6291 16.5104 12.7649 16.9062C11.9006 17.3021 10.9737 17.5 9.98413 17.5ZM12.2008 13.5L9.19246 10.3333V5.83333H10.7758V9.66667L13.3091 12.3333L12.2008 13.5Z",
|
|
@@ -887,12 +956,12 @@ var HistoryIcon = () => {
|
|
|
887
956
|
};
|
|
888
957
|
|
|
889
958
|
// src/components/icons/HourGlassIcon.tsx
|
|
890
|
-
import { jsx as
|
|
959
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
891
960
|
|
|
892
961
|
// src/components/icons/SearchIcon.tsx
|
|
893
|
-
import { jsx as
|
|
962
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
894
963
|
var SearchIcon = () => {
|
|
895
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsx16(
|
|
896
965
|
"svg",
|
|
897
966
|
{
|
|
898
967
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -900,16 +969,16 @@ var SearchIcon = () => {
|
|
|
900
969
|
width: "24",
|
|
901
970
|
viewBox: "0 -960 960 960",
|
|
902
971
|
fill: "#ffffffc0",
|
|
903
|
-
children: /* @__PURE__ */
|
|
972
|
+
children: /* @__PURE__ */ jsx16("path", { d: "M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z" })
|
|
904
973
|
}
|
|
905
974
|
);
|
|
906
975
|
};
|
|
907
976
|
|
|
908
977
|
// src/components/icons/XMarkIcon.tsx
|
|
909
|
-
import { jsx as
|
|
978
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
910
979
|
|
|
911
980
|
// src/components/icons/PercentageIcon.tsx
|
|
912
|
-
import { jsx as
|
|
981
|
+
import { jsx as jsx18, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
913
982
|
var PercentageIcon = () => {
|
|
914
983
|
return /* @__PURE__ */ jsxs3(
|
|
915
984
|
"svg",
|
|
@@ -920,14 +989,14 @@ var PercentageIcon = () => {
|
|
|
920
989
|
fill: "none",
|
|
921
990
|
xmlns: "http://www.w3.org/2000/svg",
|
|
922
991
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ jsx18(
|
|
924
993
|
"path",
|
|
925
994
|
{
|
|
926
995
|
d: "M3.00008 5.33329C2.35564 5.33329 1.80564 5.10552 1.35008 4.64996C0.894526 4.1944 0.666748 3.6444 0.666748 2.99996C0.666748 2.35551 0.894526 1.80551 1.35008 1.34996C1.80564 0.894404 2.35564 0.666626 3.00008 0.666626C3.64453 0.666626 4.19453 0.894404 4.65008 1.34996C5.10564 1.80551 5.33342 2.35551 5.33342 2.99996C5.33342 3.6444 5.10564 4.1944 4.65008 4.64996C4.19453 5.10552 3.64453 5.33329 3.00008 5.33329ZM3.00008 3.99996C3.27786 3.99996 3.51397 3.90274 3.70841 3.70829C3.90286 3.51385 4.00008 3.27774 4.00008 2.99996C4.00008 2.72218 3.90286 2.48607 3.70841 2.29163C3.51397 2.09718 3.27786 1.99996 3.00008 1.99996C2.7223 1.99996 2.48619 2.09718 2.29175 2.29163C2.0973 2.48607 2.00008 2.72218 2.00008 2.99996C2.00008 3.27774 2.0973 3.51385 2.29175 3.70829C2.48619 3.90274 2.7223 3.99996 3.00008 3.99996ZM9.00008 11.3333C8.35564 11.3333 7.80564 11.1055 7.35008 10.65C6.89453 10.1944 6.66675 9.6444 6.66675 8.99996C6.66675 8.35552 6.89453 7.80552 7.35008 7.34996C7.80564 6.8944 8.35564 6.66663 9.00008 6.66663C9.64453 6.66663 10.1945 6.8944 10.6501 7.34996C11.1056 7.80552 11.3334 8.35552 11.3334 8.99996C11.3334 9.6444 11.1056 10.1944 10.6501 10.65C10.1945 11.1055 9.64453 11.3333 9.00008 11.3333ZM9.00008 9.99996C9.27786 9.99996 9.51397 9.90274 9.70842 9.70829C9.90286 9.51385 10.0001 9.27774 10.0001 8.99996C10.0001 8.72218 9.90286 8.48607 9.70842 8.29163C9.51397 8.09718 9.27786 7.99996 9.00008 7.99996C8.7223 7.99996 8.48619 8.09718 8.29175 8.29163C8.0973 8.48607 8.00008 8.72218 8.00008 8.99996C8.00008 9.27774 8.0973 9.51385 8.29175 9.70829C8.48619 9.90274 8.7223 9.99996 9.00008 9.99996ZM1.60008 11.3333L0.666748 10.4L10.4001 0.666626L11.3334 1.59996L1.60008 11.3333Z",
|
|
927
996
|
fill: "url(#paint0_linear_32_1164)"
|
|
928
997
|
}
|
|
929
998
|
),
|
|
930
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ jsx18("defs", { children: /* @__PURE__ */ jsxs3(
|
|
931
1000
|
"linearGradient",
|
|
932
1001
|
{
|
|
933
1002
|
id: "paint0_linear_32_1164",
|
|
@@ -937,8 +1006,8 @@ var PercentageIcon = () => {
|
|
|
937
1006
|
y2: "1.31767",
|
|
938
1007
|
gradientUnits: "userSpaceOnUse",
|
|
939
1008
|
children: [
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ jsx18("stop", { stopColor: "#3681C6" }),
|
|
1010
|
+
/* @__PURE__ */ jsx18("stop", { offset: "1", stopColor: "#2B4A9D" })
|
|
942
1011
|
]
|
|
943
1012
|
}
|
|
944
1013
|
) })
|
|
@@ -948,9 +1017,9 @@ var PercentageIcon = () => {
|
|
|
948
1017
|
};
|
|
949
1018
|
|
|
950
1019
|
// src/components/icons/TimerIcon.tsx
|
|
951
|
-
import { jsx as
|
|
1020
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
952
1021
|
var TimerIcon = () => {
|
|
953
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ jsx19(
|
|
954
1023
|
"svg",
|
|
955
1024
|
{
|
|
956
1025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -958,15 +1027,15 @@ var TimerIcon = () => {
|
|
|
958
1027
|
viewBox: "0 -960 960 960",
|
|
959
1028
|
width: "16",
|
|
960
1029
|
fill: "currentColor",
|
|
961
|
-
children: /* @__PURE__ */
|
|
1030
|
+
children: /* @__PURE__ */ jsx19("path", { d: "M360-840v-80h240v80H360Zm80 440h80v-240h-80v240Zm40 320q-74 0-139.5-28.5T226-186q-49-49-77.5-114.5T120-440q0-74 28.5-139.5T226-694q49-49 114.5-77.5T480-800q62 0 119 20t107 58l56-56 56 56-56 56q38 50 58 107t20 119q0 74-28.5 139.5T734-186q-49 49-114.5 77.5T480-80Zm0-80q116 0 198-82t82-198q0-116-82-198t-198-82q-116 0-198 82t-82 198q0 116 82 198t198 82Zm0-280Z" })
|
|
962
1031
|
}
|
|
963
1032
|
);
|
|
964
1033
|
};
|
|
965
1034
|
|
|
966
1035
|
// src/components/icons/InfoIcon.tsx
|
|
967
|
-
import { jsx as
|
|
1036
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
968
1037
|
var InfoIcon = () => {
|
|
969
|
-
return /* @__PURE__ */
|
|
1038
|
+
return /* @__PURE__ */ jsx20(
|
|
970
1039
|
"svg",
|
|
971
1040
|
{
|
|
972
1041
|
width: "28",
|
|
@@ -974,15 +1043,15 @@ var InfoIcon = () => {
|
|
|
974
1043
|
viewBox: "0 0 28 28",
|
|
975
1044
|
xmlns: "http://www.w3.org/2000/svg",
|
|
976
1045
|
fill: "currentColor",
|
|
977
|
-
children: /* @__PURE__ */
|
|
1046
|
+
children: /* @__PURE__ */ jsx20("path", { d: "M12.6667 20.6666H15.3334V12.6666H12.6667V20.6666ZM14.0001 9.99996C14.3779 9.99996 14.6945 9.87218 14.9501 9.61663C15.2056 9.36107 15.3334 9.0444 15.3334 8.66663C15.3334 8.28885 15.2056 7.97218 14.9501 7.71663C14.6945 7.46107 14.3779 7.33329 14.0001 7.33329C13.6223 7.33329 13.3056 7.46107 13.0501 7.71663C12.7945 7.97218 12.6667 8.28885 12.6667 8.66663C12.6667 9.0444 12.7945 9.36107 13.0501 9.61663C13.3056 9.87218 13.6223 9.99996 14.0001 9.99996ZM14.0001 27.3333C12.1556 27.3333 10.4223 26.9833 8.80008 26.2833C7.17786 25.5833 5.76675 24.6333 4.56675 23.4333C3.36675 22.2333 2.41675 20.8222 1.71675 19.2C1.01675 17.5777 0.666748 15.8444 0.666748 14C0.666748 12.1555 1.01675 10.4222 1.71675 8.79996C2.41675 7.17774 3.36675 5.76663 4.56675 4.56663C5.76675 3.36663 7.17786 2.41663 8.80008 1.71663C10.4223 1.01663 12.1556 0.666626 14.0001 0.666626C15.8445 0.666626 17.5779 1.01663 19.2001 1.71663C20.8223 2.41663 22.2334 3.36663 23.4334 4.56663C24.6334 5.76663 25.5834 7.17774 26.2834 8.79996C26.9834 10.4222 27.3334 12.1555 27.3334 14C27.3334 15.8444 26.9834 17.5777 26.2834 19.2C25.5834 20.8222 24.6334 22.2333 23.4334 23.4333C22.2334 24.6333 20.8223 25.5833 19.2001 26.2833C17.5779 26.9833 15.8445 27.3333 14.0001 27.3333ZM14.0001 24.6666C16.9779 24.6666 19.5001 23.6333 21.5667 21.5666C23.6334 19.5 24.6667 16.9777 24.6667 14C24.6667 11.0222 23.6334 8.49996 21.5667 6.43329C19.5001 4.36663 16.9779 3.33329 14.0001 3.33329C11.0223 3.33329 8.50008 4.36663 6.43341 6.43329C4.36675 8.49996 3.33341 11.0222 3.33341 14C3.33341 16.9777 4.36675 19.5 6.43341 21.5666C8.50008 23.6333 11.0223 24.6666 14.0001 24.6666Z" })
|
|
978
1047
|
}
|
|
979
1048
|
);
|
|
980
1049
|
};
|
|
981
1050
|
|
|
982
1051
|
// src/components/icons/SettingsIcon.tsx
|
|
983
|
-
import { jsx as
|
|
1052
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
984
1053
|
var SettingsIcon = () => {
|
|
985
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ jsx21(
|
|
986
1055
|
"svg",
|
|
987
1056
|
{
|
|
988
1057
|
width: "18",
|
|
@@ -990,7 +1059,7 @@ var SettingsIcon = () => {
|
|
|
990
1059
|
viewBox: "0 0 18 18",
|
|
991
1060
|
fill: "none",
|
|
992
1061
|
xmlns: "http://www.w3.org/2000/svg",
|
|
993
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ jsx21(
|
|
994
1063
|
"path",
|
|
995
1064
|
{
|
|
996
1065
|
d: "M6.62325 17.5L6.26504 14.78C6.07101 14.7092 5.88818 14.6242 5.71653 14.525C5.54489 14.4258 5.37698 14.3196 5.2128 14.2063L2.54862 15.2688L0.0859375 11.2312L2.39191 9.57375C2.37698 9.47458 2.36952 9.37896 2.36952 9.28687V8.71313C2.36952 8.62104 2.37698 8.52542 2.39191 8.42625L0.0859375 6.76875L2.54862 2.73125L5.2128 3.79375C5.37698 3.68042 5.54862 3.57417 5.72773 3.475C5.90683 3.37583 6.08594 3.29083 6.26504 3.22L6.62325 0.5H11.5486L11.9068 3.22C12.1009 3.29083 12.2837 3.37583 12.4553 3.475C12.627 3.57417 12.7949 3.68042 12.9591 3.79375L15.6233 2.73125L18.0859 6.76875L15.78 8.42625C15.7949 8.52542 15.8024 8.62104 15.8024 8.71313V9.28687C15.8024 9.37896 15.7874 9.47458 15.7576 9.57375L18.0635 11.2312L15.6009 15.2688L12.9591 14.2063C12.7949 14.3196 12.6233 14.4258 12.4441 14.525C12.265 14.6242 12.0859 14.7092 11.9068 14.78L11.5486 17.5H6.62325ZM9.13071 11.975C9.99639 11.975 10.7352 11.6846 11.3471 11.1038C11.9591 10.5229 12.265 9.82167 12.265 9C12.265 8.17833 11.9591 7.47708 11.3471 6.89625C10.7352 6.31542 9.99639 6.025 9.13071 6.025C8.25012 6.025 7.50758 6.31542 6.9031 6.89625C6.29862 7.47708 5.99639 8.17833 5.99639 9C5.99639 9.82167 6.29862 10.5229 6.9031 11.1038C7.50758 11.6846 8.25012 11.975 9.13071 11.975ZM9.13071 10.275C8.75758 10.275 8.44042 10.151 8.17922 9.90312C7.91803 9.65521 7.78743 9.35417 7.78743 9C7.78743 8.64583 7.91803 8.34479 8.17922 8.09688C8.44042 7.84896 8.75758 7.725 9.13071 7.725C9.50385 7.725 9.82101 7.84896 10.0822 8.09688C10.3434 8.34479 10.474 8.64583 10.474 9C10.474 9.35417 10.3434 9.65521 10.0822 9.90312C9.82101 10.151 9.50385 10.275 9.13071 10.275ZM8.19042 15.8H9.95907L10.2725 13.5475C10.7352 13.4342 11.1643 13.2677 11.5598 13.0481C11.9553 12.8285 12.3173 12.5629 12.6456 12.2513L14.8621 13.1225L15.7352 11.6775L13.8098 10.2963C13.8844 10.0979 13.9367 9.88896 13.9665 9.66938C13.9964 9.44979 14.0113 9.22667 14.0113 9C14.0113 8.77333 13.9964 8.55021 13.9665 8.33063C13.9367 8.11104 13.8844 7.90208 13.8098 7.70375L15.7352 6.3225L14.8621 4.8775L12.6456 5.77C12.3173 5.44417 11.9553 5.17146 11.5598 4.95188C11.1643 4.73229 10.7352 4.56583 10.2725 4.4525L9.98146 2.2H8.2128L7.89937 4.4525C7.43668 4.56583 7.00758 4.73229 6.61206 4.95188C6.21653 5.17146 5.85459 5.43708 5.52624 5.74875L3.30982 4.8775L2.43668 6.3225L4.36206 7.6825C4.28743 7.895 4.23519 8.1075 4.20534 8.32C4.17549 8.5325 4.16056 8.75917 4.16056 9C4.16056 9.22667 4.17549 9.44625 4.20534 9.65875C4.23519 9.87125 4.28743 10.0837 4.36206 10.2963L2.43668 11.6775L3.30982 13.1225L5.52624 12.23C5.85459 12.5558 6.21653 12.8285 6.61206 13.0481C7.00758 13.2677 7.43668 13.4342 7.89937 13.5475L8.19042 15.8Z",
|
|
@@ -1002,7 +1071,7 @@ var SettingsIcon = () => {
|
|
|
1002
1071
|
};
|
|
1003
1072
|
|
|
1004
1073
|
// src/components/icons/XSwapBadgeIcon.tsx
|
|
1005
|
-
import { jsx as
|
|
1074
|
+
import { jsx as jsx22, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1006
1075
|
var XSwapBadgeIcon = () => {
|
|
1007
1076
|
return /* @__PURE__ */ jsxs4(
|
|
1008
1077
|
"svg",
|
|
@@ -1013,8 +1082,8 @@ var XSwapBadgeIcon = () => {
|
|
|
1013
1082
|
width: "80",
|
|
1014
1083
|
height: "27",
|
|
1015
1084
|
children: [
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ jsx22("title", { children: "xswap-badge" }),
|
|
1086
|
+
/* @__PURE__ */ jsx22("defs", { children: /* @__PURE__ */ jsx22(
|
|
1018
1087
|
"image",
|
|
1019
1088
|
{
|
|
1020
1089
|
width: "80",
|
|
@@ -1023,15 +1092,15 @@ var XSwapBadgeIcon = () => {
|
|
|
1023
1092
|
href: "data:image/png;base64,iVBORw0KGgoAAAANSUhEU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
|
|
1025
1094
|
) }),
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ jsx22("style", {}),
|
|
1096
|
+
/* @__PURE__ */ jsx22("use", { id: "Background", href: "#img1iVBORw0KGgoAAAANSUhEUgAAAF", x: "0", y: "1" })
|
|
1028
1097
|
]
|
|
1029
1098
|
}
|
|
1030
1099
|
);
|
|
1031
1100
|
};
|
|
1032
1101
|
|
|
1033
1102
|
// src/components/icons/ChainlinkCCIPIcon.tsx
|
|
1034
|
-
import { jsx as
|
|
1103
|
+
import { jsx as jsx23, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1035
1104
|
var ChainlinkCCIPIcon = () => {
|
|
1036
1105
|
return /* @__PURE__ */ jsxs5(
|
|
1037
1106
|
"svg",
|
|
@@ -1042,8 +1111,8 @@ var ChainlinkCCIPIcon = () => {
|
|
|
1042
1111
|
width: "67",
|
|
1043
1112
|
height: "27",
|
|
1044
1113
|
children: [
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ jsx23("title", { children: "chainlink-CCIP" }),
|
|
1115
|
+
/* @__PURE__ */ jsx23("defs", { children: /* @__PURE__ */ jsx23(
|
|
1047
1116
|
"image",
|
|
1048
1117
|
{
|
|
1049
1118
|
width: "67",
|
|
@@ -1052,17 +1121,17 @@ var ChainlinkCCIPIcon = () => {
|
|
|
1052
1121
|
href: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAAAbCAYAAAAnFzLpAAAAAXNSR0IB2cksfwAADPtJREFUeJzdWQtUlcUWngNItexilpq6gsrKFLVCEAgFRBBMeYsooGJKlqZi6kUzV2YpGg/l+qCXUqGGXutippW3ViGvcw7ncHg/BIU0QuWpvOEg//32nP8/Ihwh17pr3XWbtfaaMzN7Zvb+Zu89e/7D2AAlaG0Os/eTMwd/BbP1kbOX/RXD7HzlDugbytsYo/GF63IGWub/v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PURE__ */
|
|
1056
|
-
/* @__PURE__ */
|
|
1124
|
+
/* @__PURE__ */ jsx23("style", {}),
|
|
1125
|
+
/* @__PURE__ */ jsx23("use", { id: "Background", href: "#imgiVBORw0KGgoAAA", x: "0", y: "0" })
|
|
1057
1126
|
]
|
|
1058
1127
|
}
|
|
1059
1128
|
);
|
|
1060
1129
|
};
|
|
1061
1130
|
|
|
1062
1131
|
// src/components/icons/XSwapLogo.tsx
|
|
1063
|
-
import { jsx as
|
|
1132
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1064
1133
|
var XSwapLogo = () => {
|
|
1065
|
-
return /* @__PURE__ */
|
|
1134
|
+
return /* @__PURE__ */ jsx24(
|
|
1066
1135
|
"svg",
|
|
1067
1136
|
{
|
|
1068
1137
|
version: "1.1",
|
|
@@ -1072,7 +1141,7 @@ var XSwapLogo = () => {
|
|
|
1072
1141
|
y: "0px",
|
|
1073
1142
|
viewBox: "0 0 50 50",
|
|
1074
1143
|
enableBackground: "new 0 0 50 50",
|
|
1075
|
-
children: /* @__PURE__ */
|
|
1144
|
+
children: /* @__PURE__ */ jsx24(
|
|
1076
1145
|
"image",
|
|
1077
1146
|
{
|
|
1078
1147
|
id: "image0",
|
|
@@ -1086,13 +1155,13 @@ var XSwapLogo = () => {
|
|
|
1086
1155
|
};
|
|
1087
1156
|
|
|
1088
1157
|
// src/components/TxConfigForm/PoweredBy.tsx
|
|
1089
|
-
import { jsx as
|
|
1158
|
+
import { jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1090
1159
|
var PoweredBy = () => {
|
|
1091
1160
|
return /* @__PURE__ */ jsxs6("div", { className: "flex justify-center items-center gap-2 my-3", children: [
|
|
1092
|
-
/* @__PURE__ */
|
|
1093
|
-
/* @__PURE__ */
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ jsx25("span", { className: "text-x_grey", children: "Powered by" }),
|
|
1162
|
+
/* @__PURE__ */ jsx25(XSwapBadgeIcon, {}),
|
|
1163
|
+
/* @__PURE__ */ jsx25("span", { children: "\u2715" }),
|
|
1164
|
+
/* @__PURE__ */ jsx25(ChainlinkCCIPIcon, {})
|
|
1096
1165
|
] });
|
|
1097
1166
|
};
|
|
1098
1167
|
|
|
@@ -1124,7 +1193,7 @@ import BigNumberJS2 from "bignumber.js";
|
|
|
1124
1193
|
|
|
1125
1194
|
// src/components/TxConfigForm/HistoryCard.tsx
|
|
1126
1195
|
import { useCallback, useMemo } from "react";
|
|
1127
|
-
import { Fragment, jsx as
|
|
1196
|
+
import { Fragment, jsx as jsx26, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1128
1197
|
var HistoryCard = ({ transaction, supportedChains }) => {
|
|
1129
1198
|
const date = getDate(transaction.timestamp);
|
|
1130
1199
|
const supportedTokens = useMemo(() => {
|
|
@@ -1172,12 +1241,12 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
1172
1241
|
);
|
|
1173
1242
|
return /* @__PURE__ */ jsxs7("div", { className: "flex flex-col globalBorder rounded-xl bg-[rgb(15,15,15)] text-white text-xs sm:text-sm p-4 gap-3 mb-2", children: [
|
|
1174
1243
|
/* @__PURE__ */ jsxs7("div", { className: "flex w-full items-center justify-between", children: [
|
|
1175
|
-
/* @__PURE__ */
|
|
1244
|
+
/* @__PURE__ */ jsx26("div", { className: "text-sm sm:text-base", children: date }),
|
|
1176
1245
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1177
|
-
transaction.status === "IN_PROGRESS" && /* @__PURE__ */
|
|
1178
|
-
transaction.status === "DONE" && /* @__PURE__ */
|
|
1179
|
-
transaction.status === "REVERTED" && /* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1246
|
+
transaction.status === "IN_PROGRESS" && /* @__PURE__ */ jsx26("div", { className: "flex items-center", children: /* @__PURE__ */ jsx26("div", { className: "text-[rgb(250,200,100)]", children: "In progress" }) }),
|
|
1247
|
+
transaction.status === "DONE" && /* @__PURE__ */ jsx26("div", { className: "flex items-center", children: /* @__PURE__ */ jsx26("div", { className: "text-[rgb(100,200,100)]", children: "Done" }) }),
|
|
1248
|
+
transaction.status === "REVERTED" && /* @__PURE__ */ jsx26("div", { className: "flex items-center", children: /* @__PURE__ */ jsx26("div", { className: "text-[rgb(255,100,100)]", children: "Reverted" }) }),
|
|
1249
|
+
/* @__PURE__ */ jsx26(
|
|
1181
1250
|
"a",
|
|
1182
1251
|
{
|
|
1183
1252
|
href: `${supportedChains.find(
|
|
@@ -1187,7 +1256,7 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
1187
1256
|
rel: "noreferrer",
|
|
1188
1257
|
className: "ml-2 no-underline",
|
|
1189
1258
|
"aria-label": "Show the transaction in the chain explorer",
|
|
1190
|
-
children: /* @__PURE__ */
|
|
1259
|
+
children: /* @__PURE__ */ jsx26("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ jsx26(ArrowUpRightIcon, {}) })
|
|
1191
1260
|
}
|
|
1192
1261
|
)
|
|
1193
1262
|
] })
|
|
@@ -1195,7 +1264,7 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
1195
1264
|
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between flex-wrap gap-2", children: [
|
|
1196
1265
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1197
1266
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1198
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ jsx26(
|
|
1199
1268
|
"img",
|
|
1200
1269
|
{
|
|
1201
1270
|
src: sourceChainData?.image,
|
|
@@ -1203,11 +1272,11 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
1203
1272
|
className: "w-5 h-5 mr-1"
|
|
1204
1273
|
}
|
|
1205
1274
|
),
|
|
1206
|
-
/* @__PURE__ */
|
|
1275
|
+
/* @__PURE__ */ jsx26("div", { children: sourceChainData?.displayName })
|
|
1207
1276
|
] }),
|
|
1208
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ jsx26("div", { className: "w-3.5 h-3.5 my-0 mx-1.5", children: /* @__PURE__ */ jsx26(ArrowRightIcon, {}) }),
|
|
1209
1278
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ jsx26(
|
|
1211
1280
|
"img",
|
|
1212
1281
|
{
|
|
1213
1282
|
src: targetChainData?.image,
|
|
@@ -1215,35 +1284,35 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
1215
1284
|
className: "w-5 h-5 mr-1"
|
|
1216
1285
|
}
|
|
1217
1286
|
),
|
|
1218
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ jsx26("div", { children: targetChainData?.displayName })
|
|
1219
1288
|
] })
|
|
1220
1289
|
] }),
|
|
1221
|
-
/* @__PURE__ */
|
|
1290
|
+
/* @__PURE__ */ jsx26("div", { className: "flex items-center mb-2 last:mb-0", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center flex-wrap", children: [
|
|
1222
1291
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1223
1292
|
Number(transferredAmount) < MINIMUM_DISPLAYED_TOKEN_AMOUNT ? `<${MINIMUM_DISPLAYED_TOKEN_AMOUNT}` : transferredAmount,
|
|
1224
|
-
/* @__PURE__ */
|
|
1225
|
-
tokenData?.image ? /* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ jsx26("div", { className: "ml-1", children: tokenData?.symbol }),
|
|
1294
|
+
tokenData?.image ? /* @__PURE__ */ jsx26(
|
|
1226
1295
|
"img",
|
|
1227
1296
|
{
|
|
1228
1297
|
src: tokenData?.image,
|
|
1229
1298
|
alt: tokenData?.name || "",
|
|
1230
1299
|
className: "w-5 h-5 ml-1"
|
|
1231
1300
|
}
|
|
1232
|
-
) : /* @__PURE__ */
|
|
1301
|
+
) : /* @__PURE__ */ jsx26("div", { className: "flex items-center justify-center w-5 h-5 text-[10px] ml-1 rounded-full bg-[#272e40] text-[#e0e7fa]", children: tokenData?.symbol.substring(0, 1) })
|
|
1233
1302
|
] }),
|
|
1234
1303
|
transaction.tokenOutAddress && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1235
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ jsx26("div", { className: "w-3.5 h-3.5 my-0 mx-1.5", children: /* @__PURE__ */ jsx26(ArrowRightIcon, {}) }),
|
|
1236
1305
|
/* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1237
1306
|
Number(receivedAmount) < 1e-4 ? "<0.0001" : receivedAmount,
|
|
1238
|
-
/* @__PURE__ */
|
|
1239
|
-
tokenOutData?.image ? /* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ jsx26("div", { className: "ml-1", children: tokenOutData?.symbol }),
|
|
1308
|
+
tokenOutData?.image ? /* @__PURE__ */ jsx26(
|
|
1240
1309
|
"img",
|
|
1241
1310
|
{
|
|
1242
1311
|
src: tokenOutData?.image,
|
|
1243
1312
|
alt: tokenOutData?.name || "",
|
|
1244
1313
|
className: "w-5 h-5 ml-1"
|
|
1245
1314
|
}
|
|
1246
|
-
) : /* @__PURE__ */
|
|
1315
|
+
) : /* @__PURE__ */ jsx26("div", { className: "flex items-center justify-center w-5 h-5 text-[10px] ml-1 rounded-full bg-[#272e40] text-[#e0e7fa]", children: tokenData?.symbol.substring(0, 1) })
|
|
1247
1316
|
] })
|
|
1248
1317
|
] })
|
|
1249
1318
|
] }) })
|
|
@@ -1252,7 +1321,7 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
1252
1321
|
};
|
|
1253
1322
|
|
|
1254
1323
|
// src/components/TxConfigForm/History.tsx
|
|
1255
|
-
import { jsx as
|
|
1324
|
+
import { jsx as jsx27, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1256
1325
|
var History = ({ signer, supportedChains }) => {
|
|
1257
1326
|
const [fetchedHistory, setFetchedHistory] = useState2();
|
|
1258
1327
|
const [historyLoadedOnce, setHistoryLoadedOnce] = useState2(false);
|
|
@@ -1262,15 +1331,35 @@ var History = ({ signer, supportedChains }) => {
|
|
|
1262
1331
|
const fetchedTransactions = [];
|
|
1263
1332
|
if (downloadedHistory) {
|
|
1264
1333
|
for (const entry of downloadedHistory.history) {
|
|
1334
|
+
let status = "IN_PROGRESS";
|
|
1265
1335
|
if (!entry.source) {
|
|
1266
1336
|
continue;
|
|
1267
1337
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1338
|
+
if (entry.failed) {
|
|
1339
|
+
status = "REVERTED";
|
|
1340
|
+
}
|
|
1270
1341
|
if (!!entry.target) {
|
|
1271
1342
|
status = "DONE";
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1343
|
+
}
|
|
1344
|
+
if (entry.transferType === "SINGLE_CHAIN") {
|
|
1345
|
+
if (!entry.target) {
|
|
1346
|
+
continue;
|
|
1347
|
+
}
|
|
1348
|
+
const blockTimestampMs2 = new Date(entry.target.blockTime).getTime();
|
|
1349
|
+
const estimatedDeliveryTimestamp2 = blockTimestampMs2 / 1e3;
|
|
1350
|
+
fetchedTransactions.push({
|
|
1351
|
+
hash: entry.target.transactionHash,
|
|
1352
|
+
timestamp: blockTimestampMs2 / 1e3,
|
|
1353
|
+
sourceChainId: entry.target.blockchainId,
|
|
1354
|
+
targetChainId: entry.target.blockchainId,
|
|
1355
|
+
amountWei: entry.source.tokenAmount,
|
|
1356
|
+
tokenAddress: entry.source.tokenAddress,
|
|
1357
|
+
tokenOutAddress: entry.target?.tokenAmount,
|
|
1358
|
+
tokenOutAmount: entry.target?.tokenAmount,
|
|
1359
|
+
estimatedDeliveryTimestamp: estimatedDeliveryTimestamp2,
|
|
1360
|
+
status
|
|
1361
|
+
});
|
|
1362
|
+
continue;
|
|
1274
1363
|
}
|
|
1275
1364
|
const blockTimestampMs = new Date(entry.source.blockTime).getTime();
|
|
1276
1365
|
const estimatedDeliveryTimestamp = new BigNumberJS2(
|
|
@@ -1304,11 +1393,11 @@ var History = ({ signer, supportedChains }) => {
|
|
|
1304
1393
|
return () => clearInterval(timer);
|
|
1305
1394
|
}, [signer, fetchHistory, getHistory, historyLoadedOnce]);
|
|
1306
1395
|
if (!signer)
|
|
1307
|
-
return /* @__PURE__ */
|
|
1308
|
-
return /* @__PURE__ */
|
|
1309
|
-
fetchedHistory?.length === 0 && historyLoadedOnce && /* @__PURE__ */
|
|
1310
|
-
!fetchedHistory && !historyLoadedOnce && /* @__PURE__ */
|
|
1311
|
-
fetchedHistory?.map((transaction, index) => /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ jsx27("div", { className: "flex items-center justify-center w-full h-[30vh]", children: "Connect a wallet to browse history" });
|
|
1397
|
+
return /* @__PURE__ */ jsx27("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsxs8("div", { className: "w-full h-96 overflow-scroll overflow-x-hidden", children: [
|
|
1398
|
+
fetchedHistory?.length === 0 && historyLoadedOnce && /* @__PURE__ */ jsx27("div", { className: "w-full text-center py-4 px-0 text-[rgb(158,158,158)]", children: "Your history is empty..." }),
|
|
1399
|
+
!fetchedHistory && !historyLoadedOnce && /* @__PURE__ */ jsx27("div", { className: "flex w-full h-full items-center justify-center", children: /* @__PURE__ */ jsx27(CircularProgressIcon, {}) }),
|
|
1400
|
+
fetchedHistory?.map((transaction, index) => /* @__PURE__ */ jsx27(
|
|
1312
1401
|
HistoryCard,
|
|
1313
1402
|
{
|
|
1314
1403
|
transaction,
|
|
@@ -1320,39 +1409,41 @@ var History = ({ signer, supportedChains }) => {
|
|
|
1320
1409
|
};
|
|
1321
1410
|
|
|
1322
1411
|
// src/components/TxConfigForm/TopBar.tsx
|
|
1323
|
-
import { Fragment as Fragment2, jsx as
|
|
1412
|
+
import { Fragment as Fragment2, jsx as jsx28, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1324
1413
|
var TopBar = ({
|
|
1325
1414
|
signer,
|
|
1326
1415
|
setSettingsShown,
|
|
1327
1416
|
setHistoryTabShown,
|
|
1328
|
-
historyTabShown
|
|
1417
|
+
historyTabShown,
|
|
1418
|
+
onClose
|
|
1329
1419
|
}) => {
|
|
1330
|
-
return /* @__PURE__ */ jsxs9("div", { className: "flex w-full justify-between items-center mx-auto
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2", children: [
|
|
1333
|
-
!historyTabShown && /* @__PURE__ */
|
|
1420
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex w-full justify-between items-center mx-auto p-2", children: [
|
|
1421
|
+
/* @__PURE__ */ jsx28("div", { className: "rounded-lg text-[rgba(255,255,255,0.6)] text-xs sm:text-base whitespace-nowrap", children: signer ? `Connected wallet: ${shortAddress(signer)}` : `Wallet disconnected` }),
|
|
1422
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2 justify-center items-center", children: [
|
|
1423
|
+
!historyTabShown && /* @__PURE__ */ jsx28(
|
|
1334
1424
|
"div",
|
|
1335
1425
|
{
|
|
1336
1426
|
onClick: () => setSettingsShown(true),
|
|
1337
1427
|
className: "flex items-center text-xs gap-1 cursor-pointer",
|
|
1338
|
-
children: /* @__PURE__ */
|
|
1428
|
+
children: /* @__PURE__ */ jsx28("div", { className: "w-7 h-7 rounded-full bg-gradient-to-r from-x_blue_light to-x_blue_dark flex items-center justify-center", children: /* @__PURE__ */ jsx28(SettingsIcon, {}) })
|
|
1339
1429
|
}
|
|
1340
1430
|
),
|
|
1341
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsx28(
|
|
1342
1432
|
"div",
|
|
1343
1433
|
{
|
|
1344
1434
|
onClick: () => setHistoryTabShown((x) => !x),
|
|
1345
1435
|
className: "flex items-center text-sm gap-1 cursor-pointer",
|
|
1346
|
-
children: !historyTabShown ? /* @__PURE__ */
|
|
1436
|
+
children: !historyTabShown ? /* @__PURE__ */ jsx28(Fragment2, { children: /* @__PURE__ */ jsx28("div", { className: "w-7 h-7 rounded-full bg-gradient-to-r from-x_blue_light to-x_blue_dark flex items-center justify-center", children: /* @__PURE__ */ jsx28(HistoryIcon, {}) }) }) : /* @__PURE__ */ jsx28("div", { children: "Back" })
|
|
1347
1437
|
}
|
|
1348
|
-
)
|
|
1438
|
+
),
|
|
1439
|
+
/* @__PURE__ */ jsx28("div", { className: "cursor-pointer text-white", onClick: onClose, children: /* @__PURE__ */ jsx28(CloseIcon, {}) })
|
|
1349
1440
|
] })
|
|
1350
1441
|
] });
|
|
1351
1442
|
};
|
|
1352
1443
|
|
|
1353
1444
|
// src/components/TxConfigForm/Settings.tsx
|
|
1354
1445
|
import { useState as useState3, useEffect as useEffect3 } from "react";
|
|
1355
|
-
import { jsx as
|
|
1446
|
+
import { jsx as jsx29, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1356
1447
|
var Settings = ({
|
|
1357
1448
|
setSlippage,
|
|
1358
1449
|
setSettingsShown,
|
|
@@ -1369,22 +1460,22 @@ var Settings = ({
|
|
|
1369
1460
|
);
|
|
1370
1461
|
}
|
|
1371
1462
|
}, [slippageActivePresetIndex, usingSlippageInput]);
|
|
1372
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsx29("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", children: /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-4 justify-between", children: [
|
|
1373
1464
|
/* @__PURE__ */ jsxs10("div", { className: "flex justify-between", children: [
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ jsx29("div", { className: "text-base", children: "Settings" }),
|
|
1466
|
+
/* @__PURE__ */ jsx29(
|
|
1376
1467
|
"div",
|
|
1377
1468
|
{
|
|
1378
1469
|
className: "cursor-pointer",
|
|
1379
1470
|
onClick: () => setSettingsShown(false),
|
|
1380
|
-
children: /* @__PURE__ */
|
|
1471
|
+
children: /* @__PURE__ */ jsx29(CloseIcon, {})
|
|
1381
1472
|
}
|
|
1382
1473
|
)
|
|
1383
1474
|
] }),
|
|
1384
1475
|
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1385
1476
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-2 items-center", children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
/* @__PURE__ */
|
|
1477
|
+
/* @__PURE__ */ jsx29("div", { className: "text-sm text-[rgba(255,255,255,0.6)]", children: "Express delivery" }),
|
|
1478
|
+
/* @__PURE__ */ jsx29("div", { children: /* @__PURE__ */ jsxs10(
|
|
1388
1479
|
"span",
|
|
1389
1480
|
{
|
|
1390
1481
|
className: "inline-flex w-14 h-9 p-3 relative align-middle box-border overflow-hidden cursor-pointer",
|
|
@@ -1392,8 +1483,8 @@ var Settings = ({
|
|
|
1392
1483
|
setExpressChecked((x) => !x);
|
|
1393
1484
|
},
|
|
1394
1485
|
children: [
|
|
1395
|
-
/* @__PURE__ */
|
|
1396
|
-
/* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ jsx29("span", { className: "h-full, w-full rounded-lg bg-[rgba(255,255,255,0.3)]" }),
|
|
1487
|
+
/* @__PURE__ */ jsx29(
|
|
1397
1488
|
"span",
|
|
1398
1489
|
{
|
|
1399
1490
|
className: `transition-all w-5 h-5 rounded-full absolute translate-y-[-4px]
|
|
@@ -1405,14 +1496,14 @@ var Settings = ({
|
|
|
1405
1496
|
) })
|
|
1406
1497
|
] }),
|
|
1407
1498
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-4", children: [
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ jsx29("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ jsx29(InfoIcon, {}) }),
|
|
1500
|
+
/* @__PURE__ */ jsx29("div", { className: "text-xs text-left", children: "Express delivery is a special feature of XSwap that reduces transaction time across chains to around 30 seconds. It is currently available for swaps below a value of $ 1000 USD." })
|
|
1410
1501
|
] })
|
|
1411
1502
|
] }),
|
|
1412
1503
|
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-2 ", children: [
|
|
1413
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ jsx29("div", { className: " text-[rgba(255,255,255,0.6)] text-sm", children: "Slippage" }),
|
|
1414
1505
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-2", children: [
|
|
1415
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ jsx29("div", { className: "flex items-center bg-[rgba(15,15,15,1)] p-1 globalBorder rounded-xl", children: SLIPPAGE_PRESETS.map((preset, index) => /* @__PURE__ */ jsx29(
|
|
1416
1507
|
"div",
|
|
1417
1508
|
{
|
|
1418
1509
|
className: `transition-all cursor-pointer block rounded-lg p-2 border-none text-sm leading-[10px] ${index === slippageActivePresetIndex && !usingSlippageInput ? "text-white" : "text-[rgba(255,255,255,0.2)]"} ${index === slippageActivePresetIndex && !usingSlippageInput ? "bg-gradient-to-r from-[#3681c6] to-[#2b4a9d]" : ""}`,
|
|
@@ -1425,7 +1516,7 @@ var Settings = ({
|
|
|
1425
1516
|
index
|
|
1426
1517
|
)) }),
|
|
1427
1518
|
/* @__PURE__ */ jsxs10("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", children: [
|
|
1428
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ jsx29(
|
|
1429
1520
|
"input",
|
|
1430
1521
|
{
|
|
1431
1522
|
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",
|
|
@@ -1444,16 +1535,16 @@ var Settings = ({
|
|
|
1444
1535
|
}
|
|
1445
1536
|
}
|
|
1446
1537
|
),
|
|
1447
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ jsx29(PercentageIcon, {})
|
|
1448
1539
|
] })
|
|
1449
1540
|
] }),
|
|
1450
1541
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-4", children: [
|
|
1451
|
-
/* @__PURE__ */
|
|
1542
|
+
/* @__PURE__ */ jsx29("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ jsx29(InfoIcon, {}) }),
|
|
1452
1543
|
/* @__PURE__ */ jsxs10("div", { className: "text-xs text-left", children: [
|
|
1453
1544
|
"Slippage is the price variation you are willing to accept in the event that the price of the trade changes while it is processing.",
|
|
1454
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ jsx29("br", {}),
|
|
1455
1546
|
" ",
|
|
1456
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx29("br", {}),
|
|
1457
1548
|
"If the trade fails due to too-low slippage, you will receive USDC on the destination chain."
|
|
1458
1549
|
] })
|
|
1459
1550
|
] })
|
|
@@ -1462,23 +1553,28 @@ var Settings = ({
|
|
|
1462
1553
|
};
|
|
1463
1554
|
|
|
1464
1555
|
// src/components/TxConfigForm/FeesDetails.tsx
|
|
1465
|
-
import {
|
|
1556
|
+
import { useMemo as useMemo2 } from "react";
|
|
1557
|
+
import { jsx as jsx30, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1466
1558
|
var FeesDetails = ({
|
|
1467
1559
|
isGettingRoute,
|
|
1468
1560
|
route,
|
|
1469
1561
|
paymentToken,
|
|
1470
1562
|
dstToken,
|
|
1471
1563
|
expressChecked,
|
|
1564
|
+
exceedsExpressDeliveryLimit,
|
|
1472
1565
|
slippage,
|
|
1473
1566
|
feesDetailsShown,
|
|
1474
1567
|
setFeesDetailsShown
|
|
1475
1568
|
}) => {
|
|
1476
|
-
|
|
1477
|
-
|
|
1569
|
+
const isExpressDeliveryPossible = useMemo2(() => {
|
|
1570
|
+
return expressChecked && !exceedsExpressDeliveryLimit;
|
|
1571
|
+
}, [expressChecked, exceedsExpressDeliveryLimit]);
|
|
1572
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-3 globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-2 sm:p-4 mb-1", children: [
|
|
1573
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center justify-between text-xs sm:text-sm", children: [
|
|
1478
1574
|
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1 font-medium text-white opacity-60", children: [
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
isGettingRoute ? /* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ jsx30(CoinsIcon, {}),
|
|
1576
|
+
/* @__PURE__ */ jsx30("div", { className: "mr-1", children: "Fees:" }),
|
|
1577
|
+
isGettingRoute ? /* @__PURE__ */ jsx30(Skeleton, { width: "w-20", height: "h-4" }) : ` ${weiToHumanReadable({
|
|
1482
1578
|
amount: safeBigNumberFrom(
|
|
1483
1579
|
route?.xSwapFees.xSwapFee.nativeFee || "0"
|
|
1484
1580
|
).add(safeBigNumberFrom(route?.xSwapFees.ccipFee || "0")).add(
|
|
@@ -1489,60 +1585,61 @@ var FeesDetails = ({
|
|
|
1489
1585
|
})} ${paymentToken?.symbol}`
|
|
1490
1586
|
] }),
|
|
1491
1587
|
/* @__PURE__ */ jsxs11("div", { className: "flex gap-1 items-center", children: [
|
|
1492
|
-
/* @__PURE__ */ jsxs11(
|
|
1588
|
+
route?.xSwapFees.expressDeliveryFee && !isGettingRoute && /* @__PURE__ */ jsxs11(
|
|
1493
1589
|
"div",
|
|
1494
1590
|
{
|
|
1495
|
-
className: `flex gap-1 items-center font-medium ${
|
|
1591
|
+
className: `flex gap-1 items-center font-medium ${isExpressDeliveryPossible ? "text-x_green" : "text-white opacity-60"}`,
|
|
1496
1592
|
children: [
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
|
|
1593
|
+
/* @__PURE__ */ jsx30(TimerIcon, {}),
|
|
1594
|
+
isExpressDeliveryPossible ? "Fast ~ 30sec " : "Normal ~ 30min"
|
|
1499
1595
|
]
|
|
1500
1596
|
}
|
|
1501
1597
|
),
|
|
1502
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ jsx30(
|
|
1503
1599
|
"div",
|
|
1504
1600
|
{
|
|
1505
1601
|
onClick: () => setFeesDetailsShown((x) => !x),
|
|
1506
1602
|
className: "font-medium text-white opacity-60 cursor-pointer flex items-center w-[15px] h-[9px]",
|
|
1507
|
-
children: feesDetailsShown ? /* @__PURE__ */
|
|
1603
|
+
children: feesDetailsShown ? /* @__PURE__ */ jsx30(ChevronUpIcon, {}) : /* @__PURE__ */ jsx30(ChevronDownIcon, {})
|
|
1508
1604
|
}
|
|
1509
1605
|
)
|
|
1510
1606
|
] })
|
|
1511
1607
|
] }),
|
|
1512
|
-
feesDetailsShown && /* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center justify-between ", children: [
|
|
1608
|
+
feesDetailsShown && /* @__PURE__ */ jsxs11("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
1513
1609
|
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col text-[10px] gap-1", children: [
|
|
1514
|
-
/* @__PURE__ */ jsxs11("div", { className: "font-medium text-white opacity-60", children: [
|
|
1515
|
-
"CCIP Fee:",
|
|
1516
|
-
` ${weiToHumanReadable({
|
|
1610
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex justify-between font-medium text-white opacity-60 gap-1", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx30("div", { children: "CCIP Fee:" }),
|
|
1612
|
+
/* @__PURE__ */ jsx30("div", { className: "whitespace-nowrap", children: ` ${weiToHumanReadable({
|
|
1517
1613
|
amount: route?.xSwapFees.ccipFee || "0",
|
|
1518
1614
|
decimals: 18,
|
|
1519
1615
|
precisionFractionalPlaces: 5
|
|
1520
|
-
})} ${paymentToken?.symbol}`
|
|
1616
|
+
})} ${paymentToken?.symbol}` })
|
|
1521
1617
|
] }),
|
|
1522
|
-
/* @__PURE__ */ jsxs11("div", { className: "font-medium text-white opacity-60", children: [
|
|
1523
|
-
"Native Fee:",
|
|
1524
|
-
` ${weiToHumanReadable({
|
|
1618
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex justify-between font-medium text-white opacity-60 gap-1", children: [
|
|
1619
|
+
/* @__PURE__ */ jsx30("div", { children: "Native Fee:" }),
|
|
1620
|
+
/* @__PURE__ */ jsx30("div", { className: "whitespace-nowrap", children: ` ${weiToHumanReadable({
|
|
1525
1621
|
amount: route?.xSwapFees.xSwapFee.nativeFee || "0",
|
|
1526
1622
|
decimals: 18,
|
|
1527
1623
|
precisionFractionalPlaces: 5
|
|
1528
|
-
})} ${paymentToken?.symbol}`
|
|
1624
|
+
})} ${paymentToken?.symbol}` })
|
|
1529
1625
|
] })
|
|
1530
1626
|
] }),
|
|
1531
1627
|
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col text-[10px] gap-1", children: [
|
|
1532
|
-
/* @__PURE__ */ jsxs11("div", { className: "font-medium text-white opacity-60", children: [
|
|
1533
|
-
"Slippage:
|
|
1534
|
-
`${slippage}%`
|
|
1628
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex justify-between font-medium text-white opacity-60 gap-1", children: [
|
|
1629
|
+
/* @__PURE__ */ jsx30("div", { children: "Slippage:" }),
|
|
1630
|
+
/* @__PURE__ */ jsx30("div", { className: "whitespace-nowrap", children: `${slippage}%` })
|
|
1535
1631
|
] }),
|
|
1536
|
-
/* @__PURE__ */ jsxs11("div", { className: "font-medium text-white opacity-60", children: [
|
|
1537
|
-
"Min amount out:",
|
|
1538
|
-
" ",
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1632
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex justify-between font-medium text-white opacity-60 gap-1", children: [
|
|
1633
|
+
/* @__PURE__ */ jsx30("div", { children: "Min amount out:" }),
|
|
1634
|
+
/* @__PURE__ */ jsxs11("div", { className: "whitespace-nowrap", children: [
|
|
1635
|
+
weiToHumanReadable({
|
|
1636
|
+
amount: route?.minAmountOut || "0",
|
|
1637
|
+
decimals: dstToken?.decimals || 18,
|
|
1638
|
+
precisionFractionalPlaces: 5
|
|
1639
|
+
}),
|
|
1640
|
+
" ",
|
|
1641
|
+
dstToken?.symbol
|
|
1642
|
+
] })
|
|
1546
1643
|
] })
|
|
1547
1644
|
] })
|
|
1548
1645
|
] })
|
|
@@ -1550,28 +1647,48 @@ var FeesDetails = ({
|
|
|
1550
1647
|
};
|
|
1551
1648
|
|
|
1552
1649
|
// src/components/TxConfigForm/Summary.tsx
|
|
1553
|
-
import { useEffect as useEffect5, useMemo as
|
|
1650
|
+
import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
1554
1651
|
|
|
1555
1652
|
// src/components/TxConfigForm/UsdPrice.tsx
|
|
1556
1653
|
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1557
|
-
import { Fragment as Fragment3, jsx as
|
|
1654
|
+
import { Fragment as Fragment3, jsx as jsx31 } from "react/jsx-runtime";
|
|
1558
1655
|
var UsdPrice = ({
|
|
1559
1656
|
prices,
|
|
1560
1657
|
token,
|
|
1561
1658
|
amount = "0",
|
|
1562
|
-
loading = false
|
|
1659
|
+
loading = false,
|
|
1660
|
+
type,
|
|
1661
|
+
setExceedsExpressDeliveryLimit
|
|
1563
1662
|
}) => {
|
|
1564
1663
|
const [usdPrice, setUsdPrice] = useState4("0.00");
|
|
1565
1664
|
useEffect4(() => {
|
|
1566
1665
|
if (token && prices && prices[token.address]) {
|
|
1567
|
-
|
|
1666
|
+
const newUsdPrice = (Number(amount) * Number(prices[token.address])).toFixed(2);
|
|
1667
|
+
if (type === "src" && setExceedsExpressDeliveryLimit) {
|
|
1668
|
+
setExceedsExpressDeliveryLimit(
|
|
1669
|
+
Number(newUsdPrice) > EXPRESS_DELIVERY_LIMIT
|
|
1670
|
+
);
|
|
1671
|
+
}
|
|
1672
|
+
setUsdPrice(newUsdPrice);
|
|
1568
1673
|
}
|
|
1569
1674
|
}, [token, prices, amount]);
|
|
1570
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ jsx31("div", { className: "opacity-60 py-4", children: loading ? /* @__PURE__ */ jsx31(Skeleton, { width: "w-12", height: "h-4" }) : token ? prices && prices[token.address] ? /* @__PURE__ */ jsx31("div", { children: `$${usdPrice}` }) : /* @__PURE__ */ jsx31(Alert, { desc: "Unknown price" }) : /* @__PURE__ */ jsx31(Fragment3, { children: "$0.00" }) });
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
// src/components/UnknownTokenLogo/UnknownTokenLogo.tsx
|
|
1679
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1680
|
+
var UnknownTokenLogo = ({ tokenName, className }) => {
|
|
1681
|
+
return /* @__PURE__ */ jsx32(
|
|
1682
|
+
"div",
|
|
1683
|
+
{
|
|
1684
|
+
className: `w-5 h-5 rounded-full bg-white shadow-sm flex items-center justify-center text-black ${className}`,
|
|
1685
|
+
children: tokenName.substring(0, 1)
|
|
1686
|
+
}
|
|
1687
|
+
);
|
|
1571
1688
|
};
|
|
1572
1689
|
|
|
1573
1690
|
// src/components/TxConfigForm/Summary.tsx
|
|
1574
|
-
import { jsx as
|
|
1691
|
+
import { jsx as jsx33, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1575
1692
|
var Summary = ({
|
|
1576
1693
|
isGettingRoute,
|
|
1577
1694
|
route,
|
|
@@ -1579,7 +1696,7 @@ var Summary = ({
|
|
|
1579
1696
|
dstChain
|
|
1580
1697
|
}) => {
|
|
1581
1698
|
const [prices, setPrices] = useState5();
|
|
1582
|
-
const amountReadable =
|
|
1699
|
+
const amountReadable = useMemo4(
|
|
1583
1700
|
() => weiToHumanReadable({
|
|
1584
1701
|
amount: route?.estAmountOut || "0",
|
|
1585
1702
|
decimals: dstToken?.decimals || 18,
|
|
@@ -1597,48 +1714,64 @@ var Summary = ({
|
|
|
1597
1714
|
return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 relative", children: [
|
|
1598
1715
|
/* @__PURE__ */ jsxs12("div", { className: "flex justify-between", children: [
|
|
1599
1716
|
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", children: [
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
isGettingRoute ? /* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ jsx33("p", { className: "text-[rgba(255,255,255,0.6)] text-sm", children: "You receive" }),
|
|
1718
|
+
isGettingRoute ? /* @__PURE__ */ jsx33(
|
|
1602
1719
|
Skeleton,
|
|
1603
1720
|
{
|
|
1604
1721
|
width: "w-[100px]",
|
|
1605
1722
|
height: "h-[36px]",
|
|
1606
1723
|
other: "sm:w-[190px]"
|
|
1607
1724
|
}
|
|
1608
|
-
) : /* @__PURE__ */
|
|
1609
|
-
amountReadable,
|
|
1610
|
-
/* @__PURE__ */ jsx30("div", { className: "w-4 sm:w-6 h-4 sm:h-6", children: /* @__PURE__ */ jsx30("img", { src: dstToken?.image, alt: dstToken?.name }) }),
|
|
1611
|
-
/* @__PURE__ */ jsx30("p", { className: "text-base sm:text-xl", children: dstToken?.symbol })
|
|
1612
|
-
] })
|
|
1725
|
+
) : /* @__PURE__ */ jsx33("div", { className: "flex gap-2 items-center text-white text-xl sm:text-3xl", children: amountReadable })
|
|
1613
1726
|
] }),
|
|
1614
|
-
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1 text-sm", children: [
|
|
1615
|
-
/* @__PURE__ */
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1727
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-end gap-1 text-sm", children: [
|
|
1728
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex justify-center items-center gap-1", children: [
|
|
1729
|
+
/* @__PURE__ */ jsx33("div", { className: "w-5 h-5", children: dstToken?.image ? /* @__PURE__ */ jsx33(
|
|
1730
|
+
"img",
|
|
1731
|
+
{
|
|
1732
|
+
className: "w-5 h-5",
|
|
1733
|
+
src: dstToken?.image,
|
|
1734
|
+
alt: dstToken?.name
|
|
1735
|
+
}
|
|
1736
|
+
) : /* @__PURE__ */ jsx33(
|
|
1737
|
+
UnknownTokenLogo,
|
|
1738
|
+
{
|
|
1739
|
+
tokenName: "?",
|
|
1740
|
+
className: "token-select__generated-logo"
|
|
1741
|
+
}
|
|
1742
|
+
) }),
|
|
1743
|
+
/* @__PURE__ */ jsx33("p", { className: "text-base sm:text-xl", children: dstToken?.name })
|
|
1744
|
+
] }),
|
|
1745
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex justify-center items-center gap-1", children: [
|
|
1746
|
+
/* @__PURE__ */ jsx33("p", { className: "text-[rgba(255,255,255,0.6)] text-right", children: "on " }),
|
|
1747
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1 text-white", children: [
|
|
1748
|
+
/* @__PURE__ */ jsx33("div", { className: "w-4 h-4", children: /* @__PURE__ */ jsx33("img", { src: dstChain?.image, alt: dstChain?.name }) }),
|
|
1749
|
+
/* @__PURE__ */ jsx33("div", { children: dstChain?.displayName })
|
|
1750
|
+
] })
|
|
1619
1751
|
] })
|
|
1620
1752
|
] })
|
|
1621
1753
|
] }),
|
|
1622
|
-
/* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ jsx33(
|
|
1623
1755
|
UsdPrice,
|
|
1624
1756
|
{
|
|
1625
1757
|
prices,
|
|
1626
1758
|
token: dstToken,
|
|
1627
1759
|
amount: amountReadable,
|
|
1628
|
-
loading: isGettingRoute
|
|
1760
|
+
loading: isGettingRoute,
|
|
1761
|
+
type: "dst"
|
|
1629
1762
|
}
|
|
1630
1763
|
),
|
|
1631
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute right-[50%] top-0 translate-x-1/2 translate-y-[-60%] globalBorder rounded-xl p-[5px] bg-[rgba(15,15,15,1)]", children: /* @__PURE__ */ jsx33("div", { className: " flex items-center justify-center rounded-lg w-8 h-8 bg-gradient-to-l from-[rgba(54,129,198,1)] to-[rgba(43,74,157,1)] ", children: /* @__PURE__ */ jsx33(ArrowDownIcon, {}) }) })
|
|
1632
1765
|
] });
|
|
1633
1766
|
};
|
|
1634
1767
|
|
|
1635
1768
|
// src/components/TxConfigForm/SwapPanel.tsx
|
|
1636
|
-
import { useState as useState7, useEffect as useEffect6, useRef as useRef2, useMemo as
|
|
1769
|
+
import { useState as useState7, useEffect as useEffect6, useRef as useRef2, useMemo as useMemo7 } from "react";
|
|
1637
1770
|
|
|
1638
1771
|
// src/components/TxConfigForm/TokenPicker.tsx
|
|
1639
|
-
import { useState as useState6, useMemo as
|
|
1772
|
+
import { useState as useState6, useMemo as useMemo5 } from "react";
|
|
1640
1773
|
import { createPortal } from "react-dom";
|
|
1641
|
-
import { Fragment as Fragment4, jsx as
|
|
1774
|
+
import { Fragment as Fragment4, jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1642
1775
|
var TokenPicker = ({
|
|
1643
1776
|
onCloseClick,
|
|
1644
1777
|
tokens,
|
|
@@ -1656,7 +1789,7 @@ var TokenPicker = ({
|
|
|
1656
1789
|
onCloseClick();
|
|
1657
1790
|
}
|
|
1658
1791
|
};
|
|
1659
|
-
const filteredTokens =
|
|
1792
|
+
const filteredTokens = useMemo5(() => {
|
|
1660
1793
|
const isMatch = (value, searchValue2) => value.toLowerCase().indexOf(searchValue2.toLowerCase()) > -1;
|
|
1661
1794
|
return tokens?.filter(
|
|
1662
1795
|
(token) => isMatch(token.symbol, searchValue) || isMatch(token.name, searchValue) || token.address === searchValue.toLowerCase()
|
|
@@ -1665,24 +1798,24 @@ var TokenPicker = ({
|
|
|
1665
1798
|
);
|
|
1666
1799
|
}, [searchValue, tokens]);
|
|
1667
1800
|
return modalRoot ? createPortal(
|
|
1668
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ jsx34(
|
|
1669
1802
|
"div",
|
|
1670
1803
|
{
|
|
1671
1804
|
onClick: onBackdropClick,
|
|
1672
1805
|
className: "box-border fixed h-full w-full z-[999] top-0 left-0 bg-[rgba(0,0,0,0.8)] flex items-center justify-center p-5",
|
|
1673
1806
|
children: /* @__PURE__ */ jsxs13("div", { className: "relative bg-black rounded-3xl p-6 max-h-[70%] flex flex-col text-base text-white w-[452px] h-[70%] border border-solid border-[rgba(255,255,255,0.2)]", children: [
|
|
1674
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ jsx34(
|
|
1675
1808
|
"div",
|
|
1676
1809
|
{
|
|
1677
1810
|
onClick: onCloseClick,
|
|
1678
1811
|
className: "absolute top-4 right-4 cursor-pointer",
|
|
1679
|
-
children: /* @__PURE__ */
|
|
1812
|
+
children: /* @__PURE__ */ jsx34(CloseIcon, {})
|
|
1680
1813
|
}
|
|
1681
1814
|
),
|
|
1682
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ jsx34("p", { className: "text-base mb-4", children: "Pick a token" }),
|
|
1683
1816
|
/* @__PURE__ */ jsxs13("div", { className: "flex items-center border border-solid border-[rgba(255,255,255,0.1)] rounded-lg py-0 px-3 gap-2 bg-[rgba(15,15,15,1)]", children: [
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ jsx34("div", { className: "w-6 h-6", children: /* @__PURE__ */ jsx34(SearchIcon, {}) }),
|
|
1818
|
+
/* @__PURE__ */ jsx34(
|
|
1686
1819
|
"input",
|
|
1687
1820
|
{
|
|
1688
1821
|
placeholder: "Search name or paste address",
|
|
@@ -1692,7 +1825,7 @@ var TokenPicker = ({
|
|
|
1692
1825
|
}
|
|
1693
1826
|
)
|
|
1694
1827
|
] }),
|
|
1695
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ jsx34("div", { className: "my-4 mx-0 flex flex-wrap gap-3", children: tokens?.filter((token) => token?.quickPick).map((token) => /* @__PURE__ */ jsxs13(
|
|
1696
1829
|
"div",
|
|
1697
1830
|
{
|
|
1698
1831
|
className: `flex gap-2 py-1 px-2 items-center bg-[rgb(15,15,15)] rounded-2xl border border-solid border-[rgba(255,255,255,0.1)] hover:bg-[rgb(25,25,25)] hover:cursor-pointer ${token.address === selectedToken?.address ? "bg-[rgb(35, 35, 35)]" : ""}`,
|
|
@@ -1701,14 +1834,14 @@ var TokenPicker = ({
|
|
|
1701
1834
|
onCloseClick();
|
|
1702
1835
|
},
|
|
1703
1836
|
children: [
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1837
|
+
/* @__PURE__ */ jsx34("img", { src: token.image, alt: token.name, className: "w-5" }),
|
|
1838
|
+
/* @__PURE__ */ jsx34("div", { className: "text-sm", children: token.symbol })
|
|
1706
1839
|
]
|
|
1707
1840
|
},
|
|
1708
1841
|
token.address
|
|
1709
1842
|
)) }),
|
|
1710
|
-
/* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ jsx34("div", { className: "h-[2px] my-0 mx-[-24px] w-[100%+48px] px-12 bg-[rgba(255,255,255,0.1)]" }),
|
|
1844
|
+
/* @__PURE__ */ jsx34("div", { className: "overflow-y-scroll h-full mx-[-24px] w-[100%+48px] flex flex-col", children: filteredTokens && filteredTokens.length > 0 ? filteredTokens.map((token, index) => /* @__PURE__ */ jsxs13(
|
|
1712
1845
|
"div",
|
|
1713
1846
|
{
|
|
1714
1847
|
className: `flex gap-3 py-2 px-[24px] w-full items-center hover:bg-[rgb(25,25,25)] hover:cursor-pointer ${token.address === selectedToken?.address ? "bg-[rgb(35,35,35)]" : ""}`,
|
|
@@ -1717,29 +1850,29 @@ var TokenPicker = ({
|
|
|
1717
1850
|
onCloseClick();
|
|
1718
1851
|
},
|
|
1719
1852
|
children: [
|
|
1720
|
-
token.image ? /* @__PURE__ */
|
|
1853
|
+
token.image ? /* @__PURE__ */ jsx34(
|
|
1721
1854
|
"img",
|
|
1722
1855
|
{
|
|
1723
1856
|
src: token.image,
|
|
1724
1857
|
alt: token.name,
|
|
1725
1858
|
className: "token-picker__all__logo"
|
|
1726
1859
|
}
|
|
1727
|
-
) : /* @__PURE__ */
|
|
1860
|
+
) : /* @__PURE__ */ jsx34("div", { className: "flex items-center justify-center w-9 h-9 text-[15px] ml-1 rounded-full bg-[#272e40] text-[#e0e7fa]", children: token?.symbol.substring(0, 1) }),
|
|
1728
1861
|
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between items-center gap-1 overflow-hidden grow", children: [
|
|
1729
1862
|
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col leading-[16px]", children: [
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
1863
|
+
/* @__PURE__ */ jsx34("div", { className: "overflow-hidden whitespace-nowrap text-ellipsis text-[15px]", children: token.name }),
|
|
1864
|
+
/* @__PURE__ */ jsx34("div", { className: "text-[#888] text-[11px]", children: token.symbol })
|
|
1732
1865
|
] }),
|
|
1733
|
-
signer && /* @__PURE__ */
|
|
1866
|
+
signer && /* @__PURE__ */ jsx34(Fragment4, { children: balances && balances[token.address] && token.decimals ? /* @__PURE__ */ jsx34("div", { className: "text-xs", children: weiToHumanReadable({
|
|
1734
1867
|
amount: balances[token.address]?.toString() || "0",
|
|
1735
1868
|
decimals: token.decimals,
|
|
1736
1869
|
precisionFractionalPlaces: 4
|
|
1737
|
-
}) }) : /* @__PURE__ */
|
|
1870
|
+
}) }) : /* @__PURE__ */ jsx34(Skeleton, { width: "w-12", height: "h-3" }) })
|
|
1738
1871
|
] })
|
|
1739
1872
|
]
|
|
1740
1873
|
},
|
|
1741
1874
|
`${index}_${token.address}`
|
|
1742
|
-
)) : /* @__PURE__ */
|
|
1875
|
+
)) : /* @__PURE__ */ jsx34("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx34("p", { className: "text-sm text-white", children: "No tokens found." }) }) })
|
|
1743
1876
|
] })
|
|
1744
1877
|
}
|
|
1745
1878
|
),
|
|
@@ -1748,7 +1881,7 @@ var TokenPicker = ({
|
|
|
1748
1881
|
};
|
|
1749
1882
|
|
|
1750
1883
|
// src/components/TxConfigForm/ChainListElement.tsx
|
|
1751
|
-
import { jsx as
|
|
1884
|
+
import { jsx as jsx35, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1752
1885
|
var ChainListElement = ({
|
|
1753
1886
|
chain,
|
|
1754
1887
|
setSrcChain,
|
|
@@ -1766,21 +1899,21 @@ var ChainListElement = ({
|
|
|
1766
1899
|
setChainListShown(false);
|
|
1767
1900
|
},
|
|
1768
1901
|
children: [
|
|
1769
|
-
/* @__PURE__ */
|
|
1902
|
+
/* @__PURE__ */ jsx35("img", { width: 12, height: 12, src: chain.image, alt: chain.displayName }),
|
|
1770
1903
|
chain.displayName
|
|
1771
1904
|
]
|
|
1772
1905
|
}
|
|
1773
1906
|
),
|
|
1774
|
-
index !== length - 1 && /* @__PURE__ */
|
|
1907
|
+
index !== length - 1 && /* @__PURE__ */ jsx35("div", { className: "h-px mx-2 bg-[rgba(255,255,255,0.15)]" })
|
|
1775
1908
|
] }, `${chain.ecosystem}-${chain.chainId}`);
|
|
1776
1909
|
};
|
|
1777
1910
|
|
|
1778
1911
|
// src/components/TxConfigForm/BalanceComponent.tsx
|
|
1779
|
-
import { useMemo as
|
|
1912
|
+
import { useMemo as useMemo6 } from "react";
|
|
1780
1913
|
import BigNumber3 from "bignumber.js";
|
|
1781
|
-
import { Fragment as Fragment5, jsx as
|
|
1914
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1782
1915
|
var BalanceComponent = ({ srcToken, balances }) => {
|
|
1783
|
-
const balanceText =
|
|
1916
|
+
const balanceText = useMemo6(() => {
|
|
1784
1917
|
if (!balances || !srcToken) return "0";
|
|
1785
1918
|
if (balances[srcToken.address]?.toString() === "0") return "0";
|
|
1786
1919
|
const fullHumanReadable = weiToHumanReadable({
|
|
@@ -1806,12 +1939,12 @@ var BalanceComponent = ({ srcToken, balances }) => {
|
|
|
1806
1939
|
decimals: srcToken.decimals,
|
|
1807
1940
|
precisionFractionalPlaces: 4
|
|
1808
1941
|
}) : 0,
|
|
1809
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ jsx36("span", { className: "bg-gradient-to-r from-x_blue_light to-x_blue_dark bg-clip-text text-transparent", children: "Max" })
|
|
1810
1943
|
] });
|
|
1811
1944
|
};
|
|
1812
1945
|
|
|
1813
1946
|
// src/components/TxConfigForm/SwapPanel.tsx
|
|
1814
|
-
import { jsx as
|
|
1947
|
+
import { jsx as jsx37, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1815
1948
|
var SwapPanel = ({
|
|
1816
1949
|
amount,
|
|
1817
1950
|
setAmount,
|
|
@@ -1822,7 +1955,8 @@ var SwapPanel = ({
|
|
|
1822
1955
|
signer,
|
|
1823
1956
|
balances,
|
|
1824
1957
|
prices,
|
|
1825
|
-
supportedChains
|
|
1958
|
+
supportedChains,
|
|
1959
|
+
setExceedsExpressDeliveryLimit
|
|
1826
1960
|
}) => {
|
|
1827
1961
|
const [chainListShown, setChainListShown] = useState7(false);
|
|
1828
1962
|
const [tokenListShown, setTokenListShown] = useState7(false);
|
|
@@ -1842,7 +1976,7 @@ var SwapPanel = ({
|
|
|
1842
1976
|
weiToHumanReadable({
|
|
1843
1977
|
amount: balances[srcToken.address]?.toString() || "0",
|
|
1844
1978
|
decimals: srcToken.decimals,
|
|
1845
|
-
precisionFractionalPlaces:
|
|
1979
|
+
precisionFractionalPlaces: srcToken.decimals
|
|
1846
1980
|
})
|
|
1847
1981
|
);
|
|
1848
1982
|
};
|
|
@@ -1852,15 +1986,15 @@ var SwapPanel = ({
|
|
|
1852
1986
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1853
1987
|
}
|
|
1854
1988
|
}, [chainListShown]);
|
|
1855
|
-
const chainListOptions =
|
|
1989
|
+
const chainListOptions = useMemo7(
|
|
1856
1990
|
() => supportedChains.filter((chain) => chain.chainId !== srcChain?.chainId),
|
|
1857
1991
|
[supportedChains, srcChain]
|
|
1858
1992
|
);
|
|
1859
1993
|
return /* @__PURE__ */ jsxs16("div", { className: "flex justify-between globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4", children: [
|
|
1860
1994
|
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col justify-between gap-2 overflow-hidden w-1/2", children: [
|
|
1861
1995
|
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1", children: [
|
|
1862
|
-
/* @__PURE__ */
|
|
1863
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ jsx37("p", { className: "text-white opacity-60 text-xs sm:text-sm font-medium", children: "You pay" }),
|
|
1997
|
+
/* @__PURE__ */ jsx37(
|
|
1864
1998
|
"input",
|
|
1865
1999
|
{
|
|
1866
2000
|
className: "p-0 border-none outline-none bg-transparent text-2xl overflow-ellipsis",
|
|
@@ -1879,13 +2013,15 @@ var SwapPanel = ({
|
|
|
1879
2013
|
}
|
|
1880
2014
|
)
|
|
1881
2015
|
] }),
|
|
1882
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx37("div", { className: "flex items-center text-sm text-[rgba(255,255,255,0.6)]", children: /* @__PURE__ */ jsx37(
|
|
1883
2017
|
UsdPrice,
|
|
1884
2018
|
{
|
|
1885
2019
|
prices,
|
|
1886
2020
|
token: srcToken,
|
|
1887
2021
|
amount,
|
|
1888
|
-
loading: false
|
|
2022
|
+
loading: false,
|
|
2023
|
+
type: "src",
|
|
2024
|
+
setExceedsExpressDeliveryLimit
|
|
1889
2025
|
}
|
|
1890
2026
|
) })
|
|
1891
2027
|
] }),
|
|
@@ -1898,7 +2034,7 @@ var SwapPanel = ({
|
|
|
1898
2034
|
setTokenListShown((state) => !state);
|
|
1899
2035
|
},
|
|
1900
2036
|
children: [
|
|
1901
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ jsx37(
|
|
1902
2038
|
"img",
|
|
1903
2039
|
{
|
|
1904
2040
|
height: 16,
|
|
@@ -1907,12 +2043,12 @@ var SwapPanel = ({
|
|
|
1907
2043
|
alt: srcToken?.name
|
|
1908
2044
|
}
|
|
1909
2045
|
),
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx37("div", { children: srcToken?.symbol }),
|
|
2047
|
+
/* @__PURE__ */ jsx37(DownArrowIcon, {})
|
|
1912
2048
|
]
|
|
1913
2049
|
}
|
|
1914
2050
|
),
|
|
1915
|
-
tokenListShown && /* @__PURE__ */
|
|
2051
|
+
tokenListShown && /* @__PURE__ */ jsx37(
|
|
1916
2052
|
TokenPicker,
|
|
1917
2053
|
{
|
|
1918
2054
|
onCloseClick: () => setTokenListShown(false),
|
|
@@ -1923,12 +2059,12 @@ var SwapPanel = ({
|
|
|
1923
2059
|
balances
|
|
1924
2060
|
}
|
|
1925
2061
|
),
|
|
1926
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ jsx37(
|
|
1927
2063
|
"div",
|
|
1928
2064
|
{
|
|
1929
2065
|
onClick: handleMaxClick,
|
|
1930
2066
|
className: "flex gap-1 items-center font-medium text-white opacity-60 py-0.5 cursor-pointer",
|
|
1931
|
-
children: signer && /* @__PURE__ */
|
|
2067
|
+
children: signer && /* @__PURE__ */ jsx37(BalanceComponent, { balances, srcToken })
|
|
1932
2068
|
}
|
|
1933
2069
|
),
|
|
1934
2070
|
/* @__PURE__ */ jsxs16(
|
|
@@ -1938,7 +2074,7 @@ var SwapPanel = ({
|
|
|
1938
2074
|
className: "bg-black globalBorder rounded-2xl whitespace-nowrap flex items-center p-2 cursor-pointer gap-2",
|
|
1939
2075
|
onClick: () => setChainListShown((prev) => !prev),
|
|
1940
2076
|
children: [
|
|
1941
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsx37(
|
|
1942
2078
|
"img",
|
|
1943
2079
|
{
|
|
1944
2080
|
width: "16",
|
|
@@ -1947,17 +2083,17 @@ var SwapPanel = ({
|
|
|
1947
2083
|
alt: srcChain?.name
|
|
1948
2084
|
}
|
|
1949
2085
|
),
|
|
1950
|
-
/* @__PURE__ */
|
|
1951
|
-
/* @__PURE__ */
|
|
2086
|
+
/* @__PURE__ */ jsx37("div", { children: srcChain?.displayName }),
|
|
2087
|
+
/* @__PURE__ */ jsx37(DownArrowIcon, {})
|
|
1952
2088
|
]
|
|
1953
2089
|
}
|
|
1954
2090
|
),
|
|
1955
|
-
chainListShown && /* @__PURE__ */
|
|
2091
|
+
chainListShown && /* @__PURE__ */ jsx37(
|
|
1956
2092
|
"ul",
|
|
1957
2093
|
{
|
|
1958
2094
|
ref: listRef,
|
|
1959
2095
|
className: "bg-black globalBorder rounded-lg whitespace-nowrap z-1 right-0 top-10 px-2 max-w-full max-h-[40vh] overflow-auto absolute text-sm z-20",
|
|
1960
|
-
children: chainListOptions.map((chain, index) => /* @__PURE__ */
|
|
2096
|
+
children: chainListOptions.map((chain, index) => /* @__PURE__ */ jsx37(
|
|
1961
2097
|
ChainListElement,
|
|
1962
2098
|
{
|
|
1963
2099
|
index,
|
|
@@ -1974,9 +2110,9 @@ var SwapPanel = ({
|
|
|
1974
2110
|
};
|
|
1975
2111
|
|
|
1976
2112
|
// src/components/TxConfigForm/ErrorField.tsx
|
|
1977
|
-
import { jsx as
|
|
2113
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1978
2114
|
var ErrorField = ({ error }) => {
|
|
1979
|
-
return /* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsx38(
|
|
1980
2116
|
"div",
|
|
1981
2117
|
{
|
|
1982
2118
|
className: `flex justify-center mb-1 items-center w-full rounded-2xl bg-x_error_background border border-solid ${error.length > 0 ? "border-x_error_border" : "border-transparent"}`,
|
|
@@ -1986,15 +2122,15 @@ var ErrorField = ({ error }) => {
|
|
|
1986
2122
|
};
|
|
1987
2123
|
|
|
1988
2124
|
// src/components/TxConfigForm/Description.tsx
|
|
1989
|
-
import { jsx as
|
|
2125
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1990
2126
|
var Description = ({ description }) => {
|
|
1991
|
-
return /* @__PURE__ */
|
|
2127
|
+
return /* @__PURE__ */ jsx39("div", { className: "flex flex-col items-start rounded-lg px-4 py-2", children: /* @__PURE__ */ jsx39("div", { className: "w-full flex gap-4 items-start justify-between text-xl", children: description }) });
|
|
1992
2128
|
};
|
|
1993
2129
|
|
|
1994
2130
|
// src/components/TxConfigForm/Button.tsx
|
|
1995
|
-
import { jsx as
|
|
2131
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1996
2132
|
var Button = ({ children, onClick, type, disabled }) => {
|
|
1997
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ jsx40(
|
|
1998
2134
|
"button",
|
|
1999
2135
|
{
|
|
2000
2136
|
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",
|
|
@@ -2007,14 +2143,16 @@ var Button = ({ children, onClick, type, disabled }) => {
|
|
|
2007
2143
|
};
|
|
2008
2144
|
|
|
2009
2145
|
// src/components/TxConfigForm/Form.tsx
|
|
2010
|
-
import { jsx as
|
|
2146
|
+
import { jsx as jsx41, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2011
2147
|
var Form = ({
|
|
2148
|
+
integratorId,
|
|
2012
2149
|
dstChainId,
|
|
2013
2150
|
dstTokenAddr,
|
|
2014
2151
|
customContractCalls,
|
|
2015
2152
|
desc,
|
|
2016
2153
|
supportedChains,
|
|
2017
|
-
onSubmit
|
|
2154
|
+
onSubmit,
|
|
2155
|
+
onClose
|
|
2018
2156
|
}) => {
|
|
2019
2157
|
const [signer, setSigner] = useState8();
|
|
2020
2158
|
const [dstChain, setDstChain] = useState8();
|
|
@@ -2033,6 +2171,7 @@ var Form = ({
|
|
|
2033
2171
|
const [formError, setFormError] = useState8("");
|
|
2034
2172
|
const [slippage, setSlippage] = useState8("1.5");
|
|
2035
2173
|
const [feesDetailsShown, setFeesDetailsShown] = useState8(false);
|
|
2174
|
+
const [exceedsExpressDeliveryLimit, setExceedsExpressDeliveryLimit] = useState8(false);
|
|
2036
2175
|
const debouncedAmount = useDebounce(amount, 1e3);
|
|
2037
2176
|
const account = useAccount();
|
|
2038
2177
|
const { switchChainAsync } = useSwitchChain();
|
|
@@ -2053,14 +2192,24 @@ var Form = ({
|
|
|
2053
2192
|
setDstChain(supportedChains.find((chain) => chain.chainId === dstChainId));
|
|
2054
2193
|
}, [supportedChains, dstChainId]);
|
|
2055
2194
|
useEffect7(() => {
|
|
2056
|
-
|
|
2057
|
-
dstChain
|
|
2195
|
+
(async () => {
|
|
2196
|
+
if (!dstChain) {
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
let dstTokenResult = dstChain?.tokens.find(
|
|
2058
2200
|
(token) => token.address.toLowerCase() === dstTokenAddr.toLowerCase()
|
|
2059
|
-
)
|
|
2060
|
-
|
|
2201
|
+
);
|
|
2202
|
+
if (!dstTokenResult) {
|
|
2203
|
+
dstTokenResult = await getCustomTokenData(
|
|
2204
|
+
dstChain,
|
|
2205
|
+
dstTokenAddr.toLowerCase()
|
|
2206
|
+
);
|
|
2207
|
+
}
|
|
2208
|
+
setDstToken(dstTokenResult);
|
|
2209
|
+
})();
|
|
2061
2210
|
}, [dstChain]);
|
|
2062
2211
|
useEffect7(() => {
|
|
2063
|
-
if (srcChain && srcToken && dstChain && debouncedAmount && paymentToken && slippage) {
|
|
2212
|
+
if (integratorId && srcChain && srcToken && dstChain && debouncedAmount && paymentToken && slippage) {
|
|
2064
2213
|
setFormError("");
|
|
2065
2214
|
const timeout = setTimeout(() => {
|
|
2066
2215
|
setFormError("Getting Route is taking longer than usually");
|
|
@@ -2072,6 +2221,7 @@ var Form = ({
|
|
|
2072
2221
|
`Configuration error: selected token ($${srcToken.symbol} ${srcToken.name}) has unknown decimals param.`
|
|
2073
2222
|
);
|
|
2074
2223
|
getRoute({
|
|
2224
|
+
integratorId,
|
|
2075
2225
|
fromAmount: ethers3.utils.parseUnits(debouncedAmount, srcToken.decimals).toString(),
|
|
2076
2226
|
fromAddress: signer || ADDRESSES[srcChain.chainId].FeeCollector,
|
|
2077
2227
|
fromChain: srcChain.chainId,
|
|
@@ -2081,7 +2231,7 @@ var Form = ({
|
|
|
2081
2231
|
toToken: dstTokenAddr,
|
|
2082
2232
|
paymentToken: paymentToken.address,
|
|
2083
2233
|
slippage: Number(slippage),
|
|
2084
|
-
expressDelivery: expressChecked,
|
|
2234
|
+
expressDelivery: expressChecked && !exceedsExpressDeliveryLimit,
|
|
2085
2235
|
customContractCalls
|
|
2086
2236
|
}).then((response) => {
|
|
2087
2237
|
setRoute(response);
|
|
@@ -2140,19 +2290,20 @@ var Form = ({
|
|
|
2140
2290
|
return /* @__PURE__ */ jsxs17(
|
|
2141
2291
|
"form",
|
|
2142
2292
|
{
|
|
2143
|
-
className: "flex flex-col gap-2 z-10 my-0
|
|
2293
|
+
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",
|
|
2144
2294
|
onSubmit: handleSubmit,
|
|
2145
2295
|
children: [
|
|
2146
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ jsx41(
|
|
2147
2297
|
TopBar,
|
|
2148
2298
|
{
|
|
2149
2299
|
signer,
|
|
2150
2300
|
historyTabShown,
|
|
2151
2301
|
setHistoryTabShown,
|
|
2152
|
-
setSettingsShown
|
|
2302
|
+
setSettingsShown,
|
|
2303
|
+
onClose
|
|
2153
2304
|
}
|
|
2154
2305
|
),
|
|
2155
|
-
settingsShown && /* @__PURE__ */
|
|
2306
|
+
settingsShown && /* @__PURE__ */ jsx41(
|
|
2156
2307
|
Settings,
|
|
2157
2308
|
{
|
|
2158
2309
|
expressChecked,
|
|
@@ -2162,9 +2313,9 @@ var Form = ({
|
|
|
2162
2313
|
setSlippage
|
|
2163
2314
|
}
|
|
2164
2315
|
),
|
|
2165
|
-
historyTabShown ? /* @__PURE__ */
|
|
2166
|
-
desc && /* @__PURE__ */
|
|
2167
|
-
/* @__PURE__ */
|
|
2316
|
+
historyTabShown ? /* @__PURE__ */ jsx41(History, { signer, supportedChains }) : /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-2", children: [
|
|
2317
|
+
desc && /* @__PURE__ */ jsx41(Description, { description: desc }),
|
|
2318
|
+
/* @__PURE__ */ jsx41(
|
|
2168
2319
|
SwapPanel,
|
|
2169
2320
|
{
|
|
2170
2321
|
amount,
|
|
@@ -2176,10 +2327,11 @@ var Form = ({
|
|
|
2176
2327
|
balances,
|
|
2177
2328
|
prices,
|
|
2178
2329
|
supportedChains,
|
|
2179
|
-
setSrcChain
|
|
2330
|
+
setSrcChain,
|
|
2331
|
+
setExceedsExpressDeliveryLimit
|
|
2180
2332
|
}
|
|
2181
2333
|
),
|
|
2182
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsx41(
|
|
2183
2335
|
Summary,
|
|
2184
2336
|
{
|
|
2185
2337
|
isGettingRoute,
|
|
@@ -2188,7 +2340,7 @@ var Form = ({
|
|
|
2188
2340
|
dstChain
|
|
2189
2341
|
}
|
|
2190
2342
|
),
|
|
2191
|
-
/* @__PURE__ */
|
|
2343
|
+
/* @__PURE__ */ jsx41(
|
|
2192
2344
|
FeesDetails,
|
|
2193
2345
|
{
|
|
2194
2346
|
route,
|
|
@@ -2196,13 +2348,14 @@ var Form = ({
|
|
|
2196
2348
|
paymentToken,
|
|
2197
2349
|
dstToken,
|
|
2198
2350
|
expressChecked,
|
|
2351
|
+
exceedsExpressDeliveryLimit,
|
|
2199
2352
|
slippage,
|
|
2200
2353
|
feesDetailsShown,
|
|
2201
2354
|
setFeesDetailsShown
|
|
2202
2355
|
}
|
|
2203
2356
|
),
|
|
2204
|
-
formError.length > 0 && /* @__PURE__ */
|
|
2205
|
-
signer && srcChain && srcChain.chainId !== account.chainId?.toString() ? /* @__PURE__ */
|
|
2357
|
+
formError.length > 0 && /* @__PURE__ */ jsx41(ErrorField, { error: formError }),
|
|
2358
|
+
signer && srcChain && srcChain.chainId !== account.chainId?.toString() ? /* @__PURE__ */ jsx41(Button, { type: "button", onClick: handleSwitchChain, children: "Switch chain" }) : /* @__PURE__ */ jsx41(
|
|
2206
2359
|
Button,
|
|
2207
2360
|
{
|
|
2208
2361
|
type: "submit",
|
|
@@ -2217,8 +2370,9 @@ var Form = ({
|
|
|
2217
2370
|
};
|
|
2218
2371
|
|
|
2219
2372
|
// src/components/TxConfigForm/index.tsx
|
|
2220
|
-
import { jsx as
|
|
2373
|
+
import { jsx as jsx42, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2221
2374
|
var TxConfigForm = ({
|
|
2375
|
+
integratorId,
|
|
2222
2376
|
dstChainId,
|
|
2223
2377
|
dstTokenAddr,
|
|
2224
2378
|
customContractCalls,
|
|
@@ -2235,41 +2389,36 @@ var TxConfigForm = ({
|
|
|
2235
2389
|
}
|
|
2236
2390
|
};
|
|
2237
2391
|
const queryClient = new QueryClient();
|
|
2238
|
-
const wagmiConfig =
|
|
2392
|
+
const wagmiConfig = useMemo8(
|
|
2239
2393
|
() => getWagmiConfig(supportedChains),
|
|
2240
2394
|
supportedChains
|
|
2241
2395
|
);
|
|
2242
|
-
return /* @__PURE__ */
|
|
2396
|
+
return /* @__PURE__ */ jsx42(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx42(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx42(
|
|
2243
2397
|
"div",
|
|
2244
2398
|
{
|
|
2245
2399
|
className: "top-0 left-0 right-0 bottom-0 bg-[rgba(0,0,0,0.8)] fixed flex items-center justify-center z-10",
|
|
2246
2400
|
onClick: onBackdropClick,
|
|
2247
|
-
children: /* @__PURE__ */ jsxs18("div", { className: "relative bg-black rounded-3xl
|
|
2248
|
-
/* @__PURE__ */
|
|
2401
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "relative bg-black rounded-3xl overflow-auto text-white border-2 border-solid border-[rgba(255,255,255,0.1)]", children: [
|
|
2402
|
+
/* @__PURE__ */ jsx42(
|
|
2249
2403
|
Form,
|
|
2250
2404
|
{
|
|
2405
|
+
integratorId,
|
|
2251
2406
|
dstChainId,
|
|
2252
2407
|
dstTokenAddr,
|
|
2253
2408
|
customContractCalls,
|
|
2254
2409
|
desc,
|
|
2255
2410
|
supportedChains,
|
|
2256
|
-
onSubmit
|
|
2257
|
-
|
|
2258
|
-
),
|
|
2259
|
-
/* @__PURE__ */ jsx39(
|
|
2260
|
-
"div",
|
|
2261
|
-
{
|
|
2262
|
-
className: "absolute top-7 right-4 cursor-pointer text-white",
|
|
2263
|
-
onClick: onClose,
|
|
2264
|
-
children: /* @__PURE__ */ jsx39(CloseIcon, {})
|
|
2411
|
+
onSubmit,
|
|
2412
|
+
onClose
|
|
2265
2413
|
}
|
|
2266
2414
|
),
|
|
2267
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ jsx42(PoweredBy, {})
|
|
2268
2416
|
] })
|
|
2269
2417
|
}
|
|
2270
2418
|
) }) });
|
|
2271
2419
|
};
|
|
2272
2420
|
var openTxConfigForm = async ({
|
|
2421
|
+
integratorId,
|
|
2273
2422
|
dstChainId,
|
|
2274
2423
|
dstTokenAddr,
|
|
2275
2424
|
customContractCalls,
|
|
@@ -2277,11 +2426,13 @@ var openTxConfigForm = async ({
|
|
|
2277
2426
|
supportedChains
|
|
2278
2427
|
}) => {
|
|
2279
2428
|
try {
|
|
2280
|
-
return await new Promise((resolve) => {
|
|
2429
|
+
return await new Promise(async (resolve) => {
|
|
2430
|
+
await waitForInitialization();
|
|
2281
2431
|
xswapRoot.render(
|
|
2282
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ jsx42(
|
|
2283
2433
|
TxConfigForm,
|
|
2284
2434
|
{
|
|
2435
|
+
integratorId,
|
|
2285
2436
|
dstChainId,
|
|
2286
2437
|
dstTokenAddr,
|
|
2287
2438
|
customContractCalls,
|
|
@@ -2304,27 +2455,26 @@ var openTxConfigForm = async ({
|
|
|
2304
2455
|
};
|
|
2305
2456
|
|
|
2306
2457
|
// src/components/TxStatusButton/index.tsx
|
|
2307
|
-
import { useMemo as
|
|
2308
|
-
import { Fragment as Fragment6, jsx as
|
|
2458
|
+
import { useMemo as useMemo9, useState as useState9 } from "react";
|
|
2459
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2309
2460
|
var TxStatusButton = ({ transaction }) => {
|
|
2310
2461
|
const {
|
|
2311
|
-
fromChain,
|
|
2312
|
-
fromChainImage,
|
|
2313
|
-
fromToken,
|
|
2314
|
-
fromTokenImage,
|
|
2315
|
-
fromAmount,
|
|
2316
|
-
toChain,
|
|
2317
|
-
toChainImage,
|
|
2462
|
+
srcChain: fromChain,
|
|
2463
|
+
srcChainImage: fromChainImage,
|
|
2464
|
+
srcToken: fromToken,
|
|
2465
|
+
srcTokenImage: fromTokenImage,
|
|
2466
|
+
srcAmount: fromAmount,
|
|
2467
|
+
dstChain: toChain,
|
|
2468
|
+
dstChainImage: toChainImage,
|
|
2318
2469
|
isDone,
|
|
2319
|
-
txHash,
|
|
2320
2470
|
explorer
|
|
2321
2471
|
} = transaction;
|
|
2322
2472
|
const [isWide, setIsWide] = useState9(false);
|
|
2323
|
-
const background =
|
|
2473
|
+
const background = useMemo9(
|
|
2324
2474
|
() => isDone ? "bg-[rgba(2,2,2,1)] bg-gradient-to-r from-[rgba(76,175,80,0.2)] to-[rgba(46,125,50,0.2)]" : "bg-[rgba(2,2,2,1)] bg-gradient-to-r from-[rgba(54,129,198,0.2)] to-[rgba(43,74,157,0.2)]",
|
|
2325
2475
|
[isDone]
|
|
2326
2476
|
);
|
|
2327
|
-
const border =
|
|
2477
|
+
const border = useMemo9(
|
|
2328
2478
|
() => isDone ? "border border-solid border-x_green_dark" : "border border-solid border-x_blue_dark",
|
|
2329
2479
|
[isDone]
|
|
2330
2480
|
);
|
|
@@ -2336,7 +2486,7 @@ var TxStatusButton = ({ transaction }) => {
|
|
|
2336
2486
|
children: [
|
|
2337
2487
|
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between flex-col gap-2 sm:gap-5 sm:flex-row w-full", children: [
|
|
2338
2488
|
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
2339
|
-
/* @__PURE__ */
|
|
2489
|
+
/* @__PURE__ */ jsx43(
|
|
2340
2490
|
"img",
|
|
2341
2491
|
{
|
|
2342
2492
|
className: "w-5 h-5",
|
|
@@ -2344,26 +2494,32 @@ var TxStatusButton = ({ transaction }) => {
|
|
|
2344
2494
|
alt: "source chain"
|
|
2345
2495
|
}
|
|
2346
2496
|
),
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
/* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ jsx43("div", { children: fromChain }),
|
|
2498
|
+
/* @__PURE__ */ jsx43("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ jsx43(ArrowRightIcon, {}) }),
|
|
2499
|
+
/* @__PURE__ */ jsx43("img", { className: "w-5 h-5", src: toChainImage, alt: "to chain" }),
|
|
2500
|
+
/* @__PURE__ */ jsx43("div", { children: toChain })
|
|
2351
2501
|
] }),
|
|
2352
2502
|
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsx43("div", { children: "Sent" }),
|
|
2504
|
+
/* @__PURE__ */ jsx43("div", { children: fromAmount }),
|
|
2505
|
+
/* @__PURE__ */ jsx43("div", { children: fromToken }),
|
|
2506
|
+
fromTokenImage ? /* @__PURE__ */ jsx43(
|
|
2357
2507
|
"img",
|
|
2358
2508
|
{
|
|
2359
2509
|
className: "w-5 h-5",
|
|
2360
2510
|
src: fromTokenImage,
|
|
2361
2511
|
alt: "source token"
|
|
2362
2512
|
}
|
|
2513
|
+
) : /* @__PURE__ */ jsx43(
|
|
2514
|
+
UnknownTokenLogo,
|
|
2515
|
+
{
|
|
2516
|
+
tokenName: "?",
|
|
2517
|
+
className: "token-select__generated-logo"
|
|
2518
|
+
}
|
|
2363
2519
|
)
|
|
2364
2520
|
] })
|
|
2365
2521
|
] }),
|
|
2366
|
-
/* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ jsx43(
|
|
2367
2523
|
"a",
|
|
2368
2524
|
{
|
|
2369
2525
|
href: explorer,
|
|
@@ -2371,21 +2527,21 @@ var TxStatusButton = ({ transaction }) => {
|
|
|
2371
2527
|
rel: "noreferrer",
|
|
2372
2528
|
className: "no-underline cursor-pointer",
|
|
2373
2529
|
"aria-label": "Show the transaction in the chain explorer",
|
|
2374
|
-
children: /* @__PURE__ */
|
|
2530
|
+
children: /* @__PURE__ */ jsx43("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ jsx43(ArrowUpRightIcon, {}) })
|
|
2375
2531
|
}
|
|
2376
2532
|
)
|
|
2377
2533
|
]
|
|
2378
2534
|
}
|
|
2379
2535
|
),
|
|
2380
|
-
/* @__PURE__ */
|
|
2536
|
+
/* @__PURE__ */ jsx43(
|
|
2381
2537
|
"div",
|
|
2382
2538
|
{
|
|
2383
2539
|
className: `text-white rounded-xl cursor-pointer ${background} ${border}`,
|
|
2384
2540
|
children: /* @__PURE__ */ jsxs19("div", { className: "flex gap-2 items-center h-14 w-20 justify-center", children: [
|
|
2385
|
-
/* @__PURE__ */
|
|
2386
|
-
/* @__PURE__ */
|
|
2387
|
-
/* @__PURE__ */
|
|
2388
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ jsx43(ArrowLeftIcon, {}),
|
|
2542
|
+
/* @__PURE__ */ jsx43("div", { className: "relative flex items-center justify-center w-9 h-9", children: isDone ? /* @__PURE__ */ jsx43("div", { className: "text-x_green w-5 h-5", children: /* @__PURE__ */ jsx43(CheckIcon, {}) }) : /* @__PURE__ */ jsxs19(Fragment6, { children: [
|
|
2543
|
+
/* @__PURE__ */ jsx43("div", { className: "w-5 h-5", children: /* @__PURE__ */ jsx43(XSwapLogo, {}) }),
|
|
2544
|
+
/* @__PURE__ */ jsx43("div", { className: "absolute flex items-center justify-center top-0 left-0 right-0 bottom-0 text-white", children: /* @__PURE__ */ jsx43(CircularProgressIcon, {}) })
|
|
2389
2545
|
] }) })
|
|
2390
2546
|
] })
|
|
2391
2547
|
}
|
|
@@ -2412,25 +2568,66 @@ var updateTransactionDoneInRenderedTransactions = (txHash) => {
|
|
|
2412
2568
|
}
|
|
2413
2569
|
};
|
|
2414
2570
|
var renderTxStatusButtons = () => {
|
|
2415
|
-
const buttons = renderedTransactions.map((item) => /* @__PURE__ */
|
|
2571
|
+
const buttons = renderedTransactions.map((item) => /* @__PURE__ */ jsx43(TxStatusButton, { transaction: item }, item.txHash));
|
|
2416
2572
|
txStatusRoot.render(buttons);
|
|
2417
2573
|
};
|
|
2418
2574
|
|
|
2419
2575
|
// src/components/Skeleton/index.tsx
|
|
2420
|
-
import { jsx as
|
|
2576
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2421
2577
|
var Skeleton = ({ width, height }) => {
|
|
2422
|
-
return /* @__PURE__ */
|
|
2578
|
+
return /* @__PURE__ */ jsx44("div", { className: `bg-current rounded animate-pulse ${width} ${height}` });
|
|
2423
2579
|
};
|
|
2424
2580
|
|
|
2425
2581
|
// src/services/integrations/monitoring.ts
|
|
2426
2582
|
import retry from "async-retry";
|
|
2427
|
-
|
|
2583
|
+
|
|
2584
|
+
// src/services/blockchain.ts
|
|
2585
|
+
import { ethers as ethers4 } from "ethers";
|
|
2586
|
+
var getCustomTokenData = async (chain, tokenAddress) => {
|
|
2587
|
+
const rpcUrl = chain.publicRpcUrls[0];
|
|
2588
|
+
const customTokenContract = new ethers4.Contract(
|
|
2589
|
+
tokenAddress.toLowerCase(),
|
|
2590
|
+
ERC20Abi,
|
|
2591
|
+
ethers4.getDefaultProvider(rpcUrl)
|
|
2592
|
+
);
|
|
2593
|
+
try {
|
|
2594
|
+
const query = async (contract, method, args = []) => {
|
|
2595
|
+
if (contract?.provider) {
|
|
2596
|
+
const response = await contract[method](...args);
|
|
2597
|
+
return response;
|
|
2598
|
+
}
|
|
2599
|
+
return null;
|
|
2600
|
+
};
|
|
2601
|
+
const responses = await Promise.all([
|
|
2602
|
+
query(customTokenContract, "decimals"),
|
|
2603
|
+
query(customTokenContract, "name"),
|
|
2604
|
+
query(customTokenContract, "symbol")
|
|
2605
|
+
]);
|
|
2606
|
+
const [decimals, name, symbol] = responses;
|
|
2607
|
+
return {
|
|
2608
|
+
address: tokenAddress,
|
|
2609
|
+
symbol,
|
|
2610
|
+
name,
|
|
2611
|
+
decimals,
|
|
2612
|
+
quickPick: false,
|
|
2613
|
+
supported: true,
|
|
2614
|
+
priority: 0
|
|
2615
|
+
};
|
|
2616
|
+
} catch (_) {
|
|
2617
|
+
throw new Error(
|
|
2618
|
+
`Provided token ${tokenAddress} does not exists on chain ${chain.displayName}`
|
|
2619
|
+
);
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
|
|
2623
|
+
// src/services/integrations/monitoring.ts
|
|
2624
|
+
var renderTxStatus = async (txChainId, txHash) => {
|
|
2428
2625
|
const txReceipt = await getTxReceipt(txChainId, txHash);
|
|
2429
2626
|
const supportedChains = (await getChains()).filter(
|
|
2430
2627
|
({ web3Environment, swapSupported }) => web3Environment === "mainnet" /* MAINNET */ && swapSupported
|
|
2431
2628
|
);
|
|
2432
2629
|
const messageSentEvent = txReceipt.logs?.find((log) => {
|
|
2433
|
-
return log.topics[0] ===
|
|
2630
|
+
return log.topics[0] === ethers5.utils.id(MSG_SENT_EVENT_SIG);
|
|
2434
2631
|
});
|
|
2435
2632
|
if (!messageSentEvent) {
|
|
2436
2633
|
throw new Error(
|
|
@@ -2438,7 +2635,7 @@ var monitorTransactionStatus = async (txChainId, txHash) => {
|
|
|
2438
2635
|
);
|
|
2439
2636
|
}
|
|
2440
2637
|
const messageId = messageSentEvent?.topics[1];
|
|
2441
|
-
const iface = new
|
|
2638
|
+
const iface = new ethers5.utils.Interface(MSG_SENT_EVENT_ABI);
|
|
2442
2639
|
const decodedMessageSentEvent = iface.parseLog(messageSentEvent);
|
|
2443
2640
|
if (!decodedMessageSentEvent) {
|
|
2444
2641
|
throw new Error(
|
|
@@ -2448,9 +2645,16 @@ var monitorTransactionStatus = async (txChainId, txHash) => {
|
|
|
2448
2645
|
const srcChain = supportedChains.find(
|
|
2449
2646
|
(chain) => chain.chainId === txChainId.toString()
|
|
2450
2647
|
);
|
|
2451
|
-
|
|
2648
|
+
if (!srcChain) {
|
|
2649
|
+
throw new Error(`Unknown src chain ${txChainId}`);
|
|
2650
|
+
}
|
|
2651
|
+
const tokenAddress = decodedMessageSentEvent.args?.token.toString();
|
|
2652
|
+
let srcToken = srcChain.tokens.find(
|
|
2452
2653
|
(token) => token.address === decodedMessageSentEvent.args?.token.toString()
|
|
2453
2654
|
);
|
|
2655
|
+
if (!srcToken) {
|
|
2656
|
+
srcToken = await getCustomTokenData(srcChain, tokenAddress);
|
|
2657
|
+
}
|
|
2454
2658
|
const dstChain = supportedChains.find(
|
|
2455
2659
|
(chain) => chain.ccipChainId === decodedMessageSentEvent.args?.destinationChainSelector?.toString()
|
|
2456
2660
|
);
|
|
@@ -2458,19 +2662,20 @@ var monitorTransactionStatus = async (txChainId, txHash) => {
|
|
|
2458
2662
|
if (!dstChainId) {
|
|
2459
2663
|
throw new Error(`Unknown destination chain!`);
|
|
2460
2664
|
}
|
|
2665
|
+
const tokenAmount = weiToHumanReadable({
|
|
2666
|
+
amount: decodedMessageSentEvent.args?.tokenAmount.toString(),
|
|
2667
|
+
decimals: srcToken?.decimals || 18,
|
|
2668
|
+
precisionFractionalPlaces: 4
|
|
2669
|
+
});
|
|
2461
2670
|
const transaction = {
|
|
2462
2671
|
txHash,
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
amount: decodedMessageSentEvent.args?.tokenAmount.toString(),
|
|
2471
|
-
decimals: srcToken?.decimals || 18,
|
|
2472
|
-
precisionFractionalPlaces: 4
|
|
2473
|
-
}),
|
|
2672
|
+
srcChain: srcChain.displayName,
|
|
2673
|
+
srcChainImage: srcChain.image,
|
|
2674
|
+
dstChain: dstChain.displayName,
|
|
2675
|
+
dstChainImage: dstChain.image,
|
|
2676
|
+
srcToken: srcToken?.symbol,
|
|
2677
|
+
srcTokenImage: srcToken?.image,
|
|
2678
|
+
srcAmount: tokenAmount === "0" ? "<0.0001" : tokenAmount,
|
|
2474
2679
|
isDone: false,
|
|
2475
2680
|
explorer: `${CCIP_EXPLORER}/tx/${txHash}`
|
|
2476
2681
|
};
|
|
@@ -2480,16 +2685,16 @@ var monitorTransactionStatus = async (txChainId, txHash) => {
|
|
|
2480
2685
|
if (!xSwapRouterOnDestinationAddress) {
|
|
2481
2686
|
throw new Error(`Unknown destination XSwapRouter!`);
|
|
2482
2687
|
}
|
|
2483
|
-
const xSwapRouterOnDestination = new
|
|
2688
|
+
const xSwapRouterOnDestination = new ethers5.Contract(
|
|
2484
2689
|
xSwapRouterOnDestinationAddress,
|
|
2485
2690
|
MSG_RECEIVED_EVENT_ABI,
|
|
2486
|
-
|
|
2691
|
+
ethers5.getDefaultProvider(
|
|
2487
2692
|
supportedChains.find((chain) => chain.chainId === dstChainId)?.publicRpcUrls[0]
|
|
2488
2693
|
)
|
|
2489
2694
|
);
|
|
2490
2695
|
const msgReceivedEventFilter = {
|
|
2491
2696
|
address: xSwapRouterOnDestinationAddress,
|
|
2492
|
-
topics: [
|
|
2697
|
+
topics: [ethers5.utils.id(MSG_RECEIVED_EVENT_SIG), messageId]
|
|
2493
2698
|
};
|
|
2494
2699
|
const onSuccess = async () => {
|
|
2495
2700
|
updateTransactionDoneInRenderedTransactions(txHash);
|
|
@@ -2500,6 +2705,11 @@ var monitorTransactionStatus = async (txChainId, txHash) => {
|
|
|
2500
2705
|
removeTransactionFromRenderedTransactions(txHash);
|
|
2501
2706
|
renderTxStatusButtons();
|
|
2502
2707
|
};
|
|
2708
|
+
getTxStatus({ transferId: messageId }).then((response) => {
|
|
2709
|
+
if (response.status === "DONE") {
|
|
2710
|
+
onSuccess();
|
|
2711
|
+
}
|
|
2712
|
+
});
|
|
2503
2713
|
xSwapRouterOnDestination.once(msgReceivedEventFilter, () => onSuccess());
|
|
2504
2714
|
};
|
|
2505
2715
|
var getTxReceipt = async (txChainId, txHash) => {
|
|
@@ -2507,7 +2717,7 @@ var getTxReceipt = async (txChainId, txHash) => {
|
|
|
2507
2717
|
const chain = (await getChains()).find(
|
|
2508
2718
|
(chain2) => chain2.chainId === txChainId
|
|
2509
2719
|
);
|
|
2510
|
-
const provider = new
|
|
2720
|
+
const provider = new ethers5.providers.JsonRpcProvider(
|
|
2511
2721
|
chain?.publicRpcUrls[0]
|
|
2512
2722
|
);
|
|
2513
2723
|
return await retry(async () => {
|
|
@@ -2525,7 +2735,8 @@ var getTxReceipt = async (txChainId, txHash) => {
|
|
|
2525
2735
|
};
|
|
2526
2736
|
|
|
2527
2737
|
// src/services/integrations/transactions.ts
|
|
2528
|
-
var
|
|
2738
|
+
var openTransactionModal = async ({
|
|
2739
|
+
integratorId,
|
|
2529
2740
|
dstChain,
|
|
2530
2741
|
dstToken,
|
|
2531
2742
|
customContractCalls = [],
|
|
@@ -2536,6 +2747,7 @@ var getSwapTx = async ({
|
|
|
2536
2747
|
);
|
|
2537
2748
|
validateSwapTxData(supportedChains, dstChain, dstToken);
|
|
2538
2749
|
const route = await openTxConfigForm({
|
|
2750
|
+
integratorId,
|
|
2539
2751
|
dstChainId: dstChain,
|
|
2540
2752
|
dstTokenAddr: dstToken,
|
|
2541
2753
|
customContractCalls,
|
|
@@ -2551,19 +2763,27 @@ var validateSwapTxData = (supportedChains, dstChain, dstToken) => {
|
|
|
2551
2763
|
if (!supportedDstChain) {
|
|
2552
2764
|
throw new Error(`Provided chain '${dstChain}' is not supported`);
|
|
2553
2765
|
}
|
|
2554
|
-
if (!
|
|
2555
|
-
throw new Error(
|
|
2766
|
+
if (!isETHAddressValid(dstToken)) {
|
|
2767
|
+
throw new Error(
|
|
2768
|
+
`Provided token address ${dstToken} on chain ${dstChain} is not correct`
|
|
2769
|
+
);
|
|
2556
2770
|
}
|
|
2557
2771
|
};
|
|
2558
2772
|
|
|
2559
2773
|
// src/index.ts
|
|
2560
2774
|
initDocument();
|
|
2775
|
+
var XPay = {
|
|
2776
|
+
openTransactionModal,
|
|
2777
|
+
renderTxStatus
|
|
2778
|
+
};
|
|
2779
|
+
var src_default = XPay;
|
|
2561
2780
|
export {
|
|
2562
2781
|
ContractName,
|
|
2563
2782
|
Ecosystem,
|
|
2564
2783
|
Environment,
|
|
2565
2784
|
Web3Environment,
|
|
2566
2785
|
XSwapCallType,
|
|
2567
|
-
|
|
2568
|
-
|
|
2786
|
+
src_default as default,
|
|
2787
|
+
openTransactionModal,
|
|
2788
|
+
renderTxStatus
|
|
2569
2789
|
};
|