@xswap-link/sdk 0.1.2 → 0.1.3
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 +11 -0
- package/dist/index.css +92 -33
- package/dist/index.d.mts +60 -155
- package/dist/index.d.ts +60 -155
- package/dist/index.js +915 -1841
- package/dist/index.mjs +867 -1800
- package/package.json +1 -1
- package/src/components/Skeleton/index.tsx +8 -5
- package/src/components/TxConfigForm/FeesDetails.tsx +5 -5
- package/src/components/TxConfigForm/Form.tsx +10 -3
- package/src/components/TxConfigForm/History.tsx +1 -1
- package/src/components/TxConfigForm/HistoryCard.tsx +19 -40
- package/src/components/TxConfigForm/Summary.tsx +57 -28
- package/src/components/TxConfigForm/SwapPanel.tsx +70 -77
- package/src/components/TxConfigForm/TokenPicker.tsx +2 -2
- package/src/components/TxConfigForm/TopBar.tsx +2 -2
- package/src/components/TxConfigForm/UsdPrice.tsx +41 -0
- package/src/components/TxConfigForm/index.tsx +1 -2
- package/src/components/TxHistoryButton/index.tsx +150 -0
- package/src/components/icons/ArrowLeftIcon.tsx +16 -0
- package/src/components/icons/ChevronUpIcon.tsx +1 -6
- package/src/components/icons/CircularProgressIcon.tsx +13 -15
- package/src/components/icons/XSwapLogo.tsx +98 -0
- package/src/components/icons/index.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/constants/index.ts +1 -0
- package/src/contracts/abi/index.ts +0 -2
- package/src/contracts/addresses.ts +6 -0
- package/src/models/Addresses.ts +1 -0
- package/src/models/TransactionHistory.ts +44 -29
- package/src/services/integrations/transactions.ts +166 -1
- package/src/utils/index.ts +7 -0
- package/tailwind.config.js +6 -1
- package/tsconfig.json +3 -7
- package/src/contracts/abi/XSwapRouter.json +0 -1242
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ var Alert = ({ desc }) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// src/components/TxConfigForm/index.tsx
|
|
19
|
-
import { useMemo as
|
|
19
|
+
import { useMemo as useMemo7 } from "react";
|
|
20
20
|
import { createRoot } from "react-dom/client";
|
|
21
21
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
22
22
|
import { WagmiProvider } from "wagmi";
|
|
@@ -79,8 +79,8 @@ var CloseIcon = () => {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
// src/components/TxConfigForm/Form.tsx
|
|
82
|
-
import { useEffect as
|
|
83
|
-
import { ethers as
|
|
82
|
+
import { useEffect as useEffect7, useState as useState8 } from "react";
|
|
83
|
+
import { ethers as ethers4 } from "ethers";
|
|
84
84
|
import { useAccount, useSwitchChain } from "wagmi";
|
|
85
85
|
|
|
86
86
|
// xswap.config.ts
|
|
@@ -167,6 +167,7 @@ import { ethers as ethers2 } from "ethers";
|
|
|
167
167
|
var ContractName = /* @__PURE__ */ ((ContractName2) => {
|
|
168
168
|
ContractName2["BatchQuery"] = "BatchQuery";
|
|
169
169
|
ContractName2["FeeCollector"] = "FeeCollector";
|
|
170
|
+
ContractName2["XSwapRouter"] = "XSwapRouter";
|
|
170
171
|
return ContractName2;
|
|
171
172
|
})(ContractName || {});
|
|
172
173
|
|
|
@@ -516,1422 +517,185 @@ var ERC20_default = [
|
|
|
516
517
|
}
|
|
517
518
|
];
|
|
518
519
|
|
|
519
|
-
// src/contracts/abi/
|
|
520
|
-
var
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
{
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
name: "destinationChainSelector",
|
|
531
|
-
type: "uint64"
|
|
532
|
-
}
|
|
533
|
-
],
|
|
534
|
-
name: "DestinationChainNotWhitelisted",
|
|
535
|
-
type: "error"
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
inputs: [],
|
|
539
|
-
name: "FailedToSendNative",
|
|
540
|
-
type: "error"
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
inputs: [],
|
|
544
|
-
name: "IncorrectArrayLength",
|
|
545
|
-
type: "error"
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
inputs: [],
|
|
549
|
-
name: "InvalidAddress",
|
|
550
|
-
type: "error"
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
inputs: [
|
|
554
|
-
{
|
|
555
|
-
internalType: "address",
|
|
556
|
-
name: "router",
|
|
557
|
-
type: "address"
|
|
558
|
-
}
|
|
559
|
-
],
|
|
560
|
-
name: "InvalidRouter",
|
|
561
|
-
type: "error"
|
|
520
|
+
// src/contracts/abi/index.ts
|
|
521
|
+
var BatchQueryAbi = BatchQuery_default;
|
|
522
|
+
var ERC20Abi = ERC20_default;
|
|
523
|
+
|
|
524
|
+
// src/contracts/addresses.ts
|
|
525
|
+
var ADDRESSES = {
|
|
526
|
+
// arbitrum
|
|
527
|
+
"42161": {
|
|
528
|
+
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
529
|
+
["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
|
|
530
|
+
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
562
531
|
},
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
type: "address"
|
|
569
|
-
}
|
|
570
|
-
],
|
|
571
|
-
name: "MessageAlreadyExecuted",
|
|
572
|
-
type: "error"
|
|
532
|
+
// avalanche
|
|
533
|
+
"43114": {
|
|
534
|
+
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
535
|
+
["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
|
|
536
|
+
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
573
537
|
},
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
538
|
+
// base
|
|
539
|
+
"8453": {
|
|
540
|
+
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
541
|
+
["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
|
|
542
|
+
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
578
543
|
},
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
type: "uint64"
|
|
585
|
-
}
|
|
586
|
-
],
|
|
587
|
-
name: "NoXSwapRouterOnSelectedChain",
|
|
588
|
-
type: "error"
|
|
544
|
+
// ethereum
|
|
545
|
+
"1": {
|
|
546
|
+
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
547
|
+
["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
|
|
548
|
+
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
589
549
|
},
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
type: "uint256"
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
internalType: "uint256",
|
|
599
|
-
name: "calculatedFees",
|
|
600
|
-
type: "uint256"
|
|
601
|
-
}
|
|
602
|
-
],
|
|
603
|
-
name: "NotEnoughBalance",
|
|
604
|
-
type: "error"
|
|
550
|
+
// optimism
|
|
551
|
+
"10": {
|
|
552
|
+
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
553
|
+
["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
|
|
554
|
+
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
605
555
|
},
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
556
|
+
// polygon
|
|
557
|
+
"137": {
|
|
558
|
+
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
559
|
+
["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
|
|
560
|
+
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
// src/constants/index.ts
|
|
565
|
+
var DEFAULT_ECOSYSTEM = "evm" /* EVM */;
|
|
566
|
+
var NUMBER_INPUT_REGEX = /^[0-9]*[.,]?[0-9]*$/;
|
|
567
|
+
var SLIPPAGE_PRESETS = [0.5, 1.5, 3];
|
|
568
|
+
var DELIVERY_TIME = 30 * 1e3 * 60;
|
|
569
|
+
var EXPRESS_DELIVERY_TIME = 30 * 1e3;
|
|
570
|
+
var BALANCES_CHUNK_SIZE = 500;
|
|
571
|
+
var ROUTE_TIMEOUT_MS = 5e3;
|
|
572
|
+
var MINIMUM_DISPLAYED_TOKEN_AMOUNT = 1e-4;
|
|
573
|
+
var DEFAULT_SOURCE_CHAIN_ID = "1";
|
|
574
|
+
var CCIP_EXPLORER = "https://ccip.chain.link/";
|
|
575
|
+
|
|
576
|
+
// src/utils/contracts.ts
|
|
577
|
+
var IERC20 = new ethers.utils.Interface(ERC20Abi);
|
|
578
|
+
var getBalanceOf = async (wallet, token, rpcUrl) => {
|
|
579
|
+
const provider = ethers.getDefaultProvider(rpcUrl);
|
|
580
|
+
if (token === ethers.constants.AddressZero) {
|
|
581
|
+
return ethers.utils.formatEther(await provider.getBalance(wallet));
|
|
582
|
+
}
|
|
583
|
+
const contract = new ethers.Contract(token, ERC20Abi, provider);
|
|
584
|
+
return ethers.utils.formatUnits(
|
|
585
|
+
await contract.balanceOf(wallet),
|
|
586
|
+
await contract.decimals()
|
|
587
|
+
);
|
|
588
|
+
};
|
|
589
|
+
var getBalances = async (chain, wallet) => {
|
|
590
|
+
return {
|
|
591
|
+
...await getNativeBalance(chain, wallet),
|
|
592
|
+
...await getErc20Balances(chain, wallet)
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
var getNativeBalance = async (chain, wallet) => {
|
|
596
|
+
const native = chain.tokens.find(
|
|
597
|
+
({ address }) => address === ethers.constants.AddressZero
|
|
598
|
+
);
|
|
599
|
+
if (native) {
|
|
600
|
+
const provider = ethers.getDefaultProvider(chain.publicRpcUrls[0]);
|
|
601
|
+
const balance = await provider.getBalance(wallet);
|
|
602
|
+
return {
|
|
603
|
+
[native.address]: balance
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
return {};
|
|
607
|
+
};
|
|
608
|
+
var getErc20Balances = async (chain, wallet) => {
|
|
609
|
+
const erc20Tokens = chain.tokens.filter(
|
|
610
|
+
({ address }) => address !== ethers.constants.AddressZero
|
|
611
|
+
);
|
|
612
|
+
const tokenChunks = chunkArray(erc20Tokens, BALANCES_CHUNK_SIZE);
|
|
613
|
+
const promises = tokenChunks.map(async (tokenChunk) => {
|
|
614
|
+
const tokenAddresses = tokenChunk.map((token) => token.address);
|
|
615
|
+
const calldatas = tokenChunk.map(
|
|
616
|
+
() => IERC20.encodeFunctionData("balanceOf", [wallet])
|
|
617
|
+
);
|
|
618
|
+
const contractAddress = ADDRESSES[chain.chainId]?.BatchQuery;
|
|
619
|
+
const rpcUrl = chain.publicRpcUrls[0];
|
|
620
|
+
if (contractAddress && rpcUrl) {
|
|
621
|
+
const contract = new ethers.Contract(
|
|
622
|
+
contractAddress,
|
|
623
|
+
BatchQueryAbi,
|
|
624
|
+
ethers.getDefaultProvider(rpcUrl)
|
|
625
|
+
);
|
|
626
|
+
return await contract["batchQuery"](tokenAddresses, calldatas);
|
|
627
|
+
}
|
|
628
|
+
return Promise.resolve();
|
|
629
|
+
});
|
|
630
|
+
const tokenBalances = (await Promise.all(promises)).flat().map(
|
|
631
|
+
(encodedBalance) => ethers.utils.defaultAbiCoder.decode(["uint256"], encodedBalance)[0]
|
|
632
|
+
);
|
|
633
|
+
const balances = {};
|
|
634
|
+
erc20Tokens.forEach((token, index) => {
|
|
635
|
+
balances[token.address] = tokenBalances[index];
|
|
636
|
+
});
|
|
637
|
+
return balances;
|
|
638
|
+
};
|
|
639
|
+
var generateApproveTxData = (tokenAddress, spender, amount) => {
|
|
640
|
+
return tokenAddress !== ethers.constants.AddressZero ? {
|
|
641
|
+
to: tokenAddress,
|
|
642
|
+
value: safeBigNumberFrom("0"),
|
|
643
|
+
data: IERC20.encodeFunctionData("approve", [spender, amount])
|
|
644
|
+
} : void 0;
|
|
645
|
+
};
|
|
646
|
+
var findPlaceholderIndex = (abi, funName, funParams, placeholderValue) => {
|
|
647
|
+
if (funParams.flat(Infinity).filter((param) => param === placeholderValue).length !== 1) {
|
|
648
|
+
throw new Error("Random placeholder value must be provided and unique.");
|
|
649
|
+
}
|
|
650
|
+
const iface = new ethers.utils.Interface(abi);
|
|
651
|
+
const functionFragment = iface.getFunction(funName);
|
|
652
|
+
if (!functionFragment) {
|
|
653
|
+
throw new Error(`Can't find function "${funName}" in provided ABI.`);
|
|
654
|
+
}
|
|
655
|
+
const encodedFunData = iface.encodeFunctionData(functionFragment, funParams);
|
|
656
|
+
const paramData = encodedFunData.slice(10);
|
|
657
|
+
const chunks = [];
|
|
658
|
+
for (let i = 0; i < paramData.length; i += 64) {
|
|
659
|
+
chunks.push(paramData.slice(i, i + 64));
|
|
660
|
+
}
|
|
661
|
+
const searchValue = placeholderValue.toHexString().slice(2).padStart(64, "0");
|
|
662
|
+
const result = chunks.findIndex((chunk) => chunk === searchValue);
|
|
663
|
+
if (result === -1) {
|
|
664
|
+
throw new Error("Randomized parameter not found in the encoded data.");
|
|
665
|
+
}
|
|
666
|
+
return result;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
// src/utils/strings.ts
|
|
670
|
+
var shortAddress = (address) => {
|
|
671
|
+
return `${address?.substring(0, 5)}...${address?.substring(
|
|
672
|
+
address.length - 5,
|
|
673
|
+
address.length
|
|
674
|
+
)}`;
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
// src/utils/index.ts
|
|
678
|
+
import { format } from "date-fns";
|
|
679
|
+
var replaceNull = (values, newValue) => {
|
|
680
|
+
const modifiedValues = [...values];
|
|
681
|
+
for (let i = 0; i < modifiedValues.length; i++) {
|
|
682
|
+
if (Array.isArray(modifiedValues[i])) {
|
|
683
|
+
modifiedValues[i] = replaceNull(modifiedValues[i], newValue);
|
|
684
|
+
} else {
|
|
685
|
+
if (modifiedValues[i] === null) {
|
|
686
|
+
modifiedValues[i] = newValue;
|
|
617
687
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
],
|
|
630
|
-
name: "TokenNotWhitelisted",
|
|
631
|
-
type: "error"
|
|
632
|
-
},
|
|
633
|
-
{
|
|
634
|
-
anonymous: false,
|
|
635
|
-
inputs: [
|
|
636
|
-
{
|
|
637
|
-
indexed: false,
|
|
638
|
-
internalType: "address",
|
|
639
|
-
name: "previousAdmin",
|
|
640
|
-
type: "address"
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
indexed: false,
|
|
644
|
-
internalType: "address",
|
|
645
|
-
name: "newAdmin",
|
|
646
|
-
type: "address"
|
|
647
|
-
}
|
|
648
|
-
],
|
|
649
|
-
name: "AdminChanged",
|
|
650
|
-
type: "event"
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
anonymous: false,
|
|
654
|
-
inputs: [
|
|
655
|
-
{
|
|
656
|
-
indexed: true,
|
|
657
|
-
internalType: "address",
|
|
658
|
-
name: "beacon",
|
|
659
|
-
type: "address"
|
|
660
|
-
}
|
|
661
|
-
],
|
|
662
|
-
name: "BeaconUpgraded",
|
|
663
|
-
type: "event"
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
anonymous: false,
|
|
667
|
-
inputs: [
|
|
668
|
-
{
|
|
669
|
-
indexed: false,
|
|
670
|
-
internalType: "address",
|
|
671
|
-
name: "token",
|
|
672
|
-
type: "address"
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
indexed: false,
|
|
676
|
-
internalType: "uint256",
|
|
677
|
-
name: "tokenAmount",
|
|
678
|
-
type: "uint256"
|
|
679
|
-
}
|
|
680
|
-
],
|
|
681
|
-
name: "EmergencyWithdraw",
|
|
682
|
-
type: "event"
|
|
683
|
-
},
|
|
684
|
-
{
|
|
685
|
-
anonymous: false,
|
|
686
|
-
inputs: [
|
|
687
|
-
{
|
|
688
|
-
indexed: true,
|
|
689
|
-
internalType: "bytes32",
|
|
690
|
-
name: "messageId",
|
|
691
|
-
type: "bytes32"
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
indexed: true,
|
|
695
|
-
internalType: "uint64",
|
|
696
|
-
name: "sourceChainSelector",
|
|
697
|
-
type: "uint64"
|
|
698
|
-
},
|
|
699
|
-
{
|
|
700
|
-
indexed: true,
|
|
701
|
-
internalType: "address",
|
|
702
|
-
name: "sender",
|
|
703
|
-
type: "address"
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
indexed: false,
|
|
707
|
-
internalType: "bytes",
|
|
708
|
-
name: "data",
|
|
709
|
-
type: "bytes"
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
indexed: false,
|
|
713
|
-
internalType: "address",
|
|
714
|
-
name: "token",
|
|
715
|
-
type: "address"
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
indexed: false,
|
|
719
|
-
internalType: "uint256",
|
|
720
|
-
name: "tokenAmount",
|
|
721
|
-
type: "uint256"
|
|
722
|
-
}
|
|
723
|
-
],
|
|
724
|
-
name: "ExecutorRunFailed",
|
|
725
|
-
type: "event"
|
|
726
|
-
},
|
|
727
|
-
{
|
|
728
|
-
anonymous: false,
|
|
729
|
-
inputs: [
|
|
730
|
-
{
|
|
731
|
-
indexed: false,
|
|
732
|
-
internalType: "address",
|
|
733
|
-
name: "newExecutor",
|
|
734
|
-
type: "address"
|
|
735
|
-
}
|
|
736
|
-
],
|
|
737
|
-
name: "ExecutorUpdated",
|
|
738
|
-
type: "event"
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
anonymous: false,
|
|
742
|
-
inputs: [
|
|
743
|
-
{
|
|
744
|
-
indexed: true,
|
|
745
|
-
internalType: "bytes32",
|
|
746
|
-
name: "messageId",
|
|
747
|
-
type: "bytes32"
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
indexed: true,
|
|
751
|
-
internalType: "address",
|
|
752
|
-
name: "messageExecutor",
|
|
753
|
-
type: "address"
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
indexed: true,
|
|
757
|
-
internalType: "bytes32",
|
|
758
|
-
name: "executionHash",
|
|
759
|
-
type: "bytes32"
|
|
760
|
-
},
|
|
761
|
-
{
|
|
762
|
-
indexed: false,
|
|
763
|
-
internalType: "address",
|
|
764
|
-
name: "token",
|
|
765
|
-
type: "address"
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
indexed: false,
|
|
769
|
-
internalType: "uint256",
|
|
770
|
-
name: "tokenAmount",
|
|
771
|
-
type: "uint256"
|
|
772
|
-
}
|
|
773
|
-
],
|
|
774
|
-
name: "FundsReturnedForMessageExecution",
|
|
775
|
-
type: "event"
|
|
776
|
-
},
|
|
777
|
-
{
|
|
778
|
-
anonymous: false,
|
|
779
|
-
inputs: [
|
|
780
|
-
{
|
|
781
|
-
indexed: false,
|
|
782
|
-
internalType: "uint8",
|
|
783
|
-
name: "version",
|
|
784
|
-
type: "uint8"
|
|
785
|
-
}
|
|
786
|
-
],
|
|
787
|
-
name: "Initialized",
|
|
788
|
-
type: "event"
|
|
789
|
-
},
|
|
790
|
-
{
|
|
791
|
-
anonymous: false,
|
|
792
|
-
inputs: [
|
|
793
|
-
{
|
|
794
|
-
indexed: true,
|
|
795
|
-
internalType: "bytes32",
|
|
796
|
-
name: "messageId",
|
|
797
|
-
type: "bytes32"
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
indexed: true,
|
|
801
|
-
internalType: "uint64",
|
|
802
|
-
name: "sourceChainSelector",
|
|
803
|
-
type: "uint64"
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
indexed: true,
|
|
807
|
-
internalType: "address",
|
|
808
|
-
name: "sender",
|
|
809
|
-
type: "address"
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
indexed: false,
|
|
813
|
-
internalType: "bytes",
|
|
814
|
-
name: "data",
|
|
815
|
-
type: "bytes"
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
indexed: false,
|
|
819
|
-
internalType: "address",
|
|
820
|
-
name: "token",
|
|
821
|
-
type: "address"
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
indexed: false,
|
|
825
|
-
internalType: "uint256",
|
|
826
|
-
name: "tokenAmount",
|
|
827
|
-
type: "uint256"
|
|
828
|
-
}
|
|
829
|
-
],
|
|
830
|
-
name: "MessageReceived",
|
|
831
|
-
type: "event"
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
anonymous: false,
|
|
835
|
-
inputs: [
|
|
836
|
-
{
|
|
837
|
-
indexed: true,
|
|
838
|
-
internalType: "bytes32",
|
|
839
|
-
name: "messageId",
|
|
840
|
-
type: "bytes32"
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
indexed: true,
|
|
844
|
-
internalType: "uint64",
|
|
845
|
-
name: "destinationChainSelector",
|
|
846
|
-
type: "uint64"
|
|
847
|
-
},
|
|
848
|
-
{
|
|
849
|
-
indexed: true,
|
|
850
|
-
internalType: "address",
|
|
851
|
-
name: "sender",
|
|
852
|
-
type: "address"
|
|
853
|
-
},
|
|
854
|
-
{
|
|
855
|
-
indexed: false,
|
|
856
|
-
internalType: "bytes",
|
|
857
|
-
name: "data",
|
|
858
|
-
type: "bytes"
|
|
859
|
-
},
|
|
860
|
-
{
|
|
861
|
-
indexed: false,
|
|
862
|
-
internalType: "address",
|
|
863
|
-
name: "token",
|
|
864
|
-
type: "address"
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
indexed: false,
|
|
868
|
-
internalType: "uint256",
|
|
869
|
-
name: "tokenAmount",
|
|
870
|
-
type: "uint256"
|
|
871
|
-
},
|
|
872
|
-
{
|
|
873
|
-
indexed: false,
|
|
874
|
-
internalType: "uint256",
|
|
875
|
-
name: "valueForInstantCcipRecieve",
|
|
876
|
-
type: "uint256"
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
indexed: false,
|
|
880
|
-
internalType: "address",
|
|
881
|
-
name: "transferedToken",
|
|
882
|
-
type: "address"
|
|
883
|
-
},
|
|
884
|
-
{
|
|
885
|
-
indexed: false,
|
|
886
|
-
internalType: "uint256",
|
|
887
|
-
name: "transferedTokenAmount",
|
|
888
|
-
type: "uint256"
|
|
889
|
-
}
|
|
890
|
-
],
|
|
891
|
-
name: "MessageSent",
|
|
892
|
-
type: "event"
|
|
893
|
-
},
|
|
894
|
-
{
|
|
895
|
-
anonymous: false,
|
|
896
|
-
inputs: [
|
|
897
|
-
{
|
|
898
|
-
indexed: true,
|
|
899
|
-
internalType: "address",
|
|
900
|
-
name: "previousOwner",
|
|
901
|
-
type: "address"
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
indexed: true,
|
|
905
|
-
internalType: "address",
|
|
906
|
-
name: "newOwner",
|
|
907
|
-
type: "address"
|
|
908
|
-
}
|
|
909
|
-
],
|
|
910
|
-
name: "OwnershipTransferred",
|
|
911
|
-
type: "event"
|
|
912
|
-
},
|
|
913
|
-
{
|
|
914
|
-
anonymous: false,
|
|
915
|
-
inputs: [
|
|
916
|
-
{
|
|
917
|
-
indexed: false,
|
|
918
|
-
internalType: "address",
|
|
919
|
-
name: "newFeeCollectorAddress",
|
|
920
|
-
type: "address"
|
|
921
|
-
}
|
|
922
|
-
],
|
|
923
|
-
name: "SetFeeCollectorAddress",
|
|
924
|
-
type: "event"
|
|
925
|
-
},
|
|
926
|
-
{
|
|
927
|
-
anonymous: false,
|
|
928
|
-
inputs: [
|
|
929
|
-
{
|
|
930
|
-
indexed: false,
|
|
931
|
-
internalType: "address",
|
|
932
|
-
name: "newFeeOracleAddress",
|
|
933
|
-
type: "address"
|
|
934
|
-
}
|
|
935
|
-
],
|
|
936
|
-
name: "SetFeeOracleAddress",
|
|
937
|
-
type: "event"
|
|
938
|
-
},
|
|
939
|
-
{
|
|
940
|
-
anonymous: false,
|
|
941
|
-
inputs: [
|
|
942
|
-
{
|
|
943
|
-
indexed: true,
|
|
944
|
-
internalType: "address",
|
|
945
|
-
name: "implementation",
|
|
946
|
-
type: "address"
|
|
947
|
-
}
|
|
948
|
-
],
|
|
949
|
-
name: "Upgraded",
|
|
950
|
-
type: "event"
|
|
951
|
-
},
|
|
952
|
-
{
|
|
953
|
-
inputs: [
|
|
954
|
-
{
|
|
955
|
-
components: [
|
|
956
|
-
{
|
|
957
|
-
internalType: "bytes32",
|
|
958
|
-
name: "messageId",
|
|
959
|
-
type: "bytes32"
|
|
960
|
-
},
|
|
961
|
-
{
|
|
962
|
-
internalType: "uint64",
|
|
963
|
-
name: "sourceChainSelector",
|
|
964
|
-
type: "uint64"
|
|
965
|
-
},
|
|
966
|
-
{
|
|
967
|
-
internalType: "bytes",
|
|
968
|
-
name: "sender",
|
|
969
|
-
type: "bytes"
|
|
970
|
-
},
|
|
971
|
-
{
|
|
972
|
-
internalType: "bytes",
|
|
973
|
-
name: "data",
|
|
974
|
-
type: "bytes"
|
|
975
|
-
},
|
|
976
|
-
{
|
|
977
|
-
components: [
|
|
978
|
-
{
|
|
979
|
-
internalType: "address",
|
|
980
|
-
name: "token",
|
|
981
|
-
type: "address"
|
|
982
|
-
},
|
|
983
|
-
{
|
|
984
|
-
internalType: "uint256",
|
|
985
|
-
name: "amount",
|
|
986
|
-
type: "uint256"
|
|
987
|
-
}
|
|
988
|
-
],
|
|
989
|
-
internalType: "struct Client.EVMTokenAmount[]",
|
|
990
|
-
name: "destTokenAmounts",
|
|
991
|
-
type: "tuple[]"
|
|
992
|
-
}
|
|
993
|
-
],
|
|
994
|
-
internalType: "struct Client.Any2EVMMessage",
|
|
995
|
-
name: "message",
|
|
996
|
-
type: "tuple"
|
|
997
|
-
}
|
|
998
|
-
],
|
|
999
|
-
name: "ccipReceive",
|
|
1000
|
-
outputs: [],
|
|
1001
|
-
stateMutability: "nonpayable",
|
|
1002
|
-
type: "function"
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
inputs: [
|
|
1006
|
-
{
|
|
1007
|
-
internalType: "uint64",
|
|
1008
|
-
name: "",
|
|
1009
|
-
type: "uint64"
|
|
1010
|
-
}
|
|
1011
|
-
],
|
|
1012
|
-
name: "chainSelectorToXSwapRouterMap",
|
|
1013
|
-
outputs: [
|
|
1014
|
-
{
|
|
1015
|
-
internalType: "address",
|
|
1016
|
-
name: "",
|
|
1017
|
-
type: "address"
|
|
1018
|
-
}
|
|
1019
|
-
],
|
|
1020
|
-
stateMutability: "view",
|
|
1021
|
-
type: "function"
|
|
1022
|
-
},
|
|
1023
|
-
{
|
|
1024
|
-
inputs: [
|
|
1025
|
-
{
|
|
1026
|
-
internalType: "address",
|
|
1027
|
-
name: "_tokenToWithdraw",
|
|
1028
|
-
type: "address"
|
|
1029
|
-
},
|
|
1030
|
-
{
|
|
1031
|
-
internalType: "uint256",
|
|
1032
|
-
name: "_amountToWithdraw",
|
|
1033
|
-
type: "uint256"
|
|
1034
|
-
}
|
|
1035
|
-
],
|
|
1036
|
-
name: "emergencyWithdraw",
|
|
1037
|
-
outputs: [],
|
|
1038
|
-
stateMutability: "nonpayable",
|
|
1039
|
-
type: "function"
|
|
1040
|
-
},
|
|
1041
|
-
{
|
|
1042
|
-
inputs: [],
|
|
1043
|
-
name: "feeCollectorAddress",
|
|
1044
|
-
outputs: [
|
|
1045
|
-
{
|
|
1046
|
-
internalType: "address",
|
|
1047
|
-
name: "",
|
|
1048
|
-
type: "address"
|
|
1049
|
-
}
|
|
1050
|
-
],
|
|
1051
|
-
stateMutability: "view",
|
|
1052
|
-
type: "function"
|
|
1053
|
-
},
|
|
1054
|
-
{
|
|
1055
|
-
inputs: [],
|
|
1056
|
-
name: "feeOracleAddress",
|
|
1057
|
-
outputs: [
|
|
1058
|
-
{
|
|
1059
|
-
internalType: "address",
|
|
1060
|
-
name: "",
|
|
1061
|
-
type: "address"
|
|
1062
|
-
}
|
|
1063
|
-
],
|
|
1064
|
-
stateMutability: "view",
|
|
1065
|
-
type: "function"
|
|
1066
|
-
},
|
|
1067
|
-
{
|
|
1068
|
-
inputs: [
|
|
1069
|
-
{
|
|
1070
|
-
internalType: "address",
|
|
1071
|
-
name: "_paymentToken",
|
|
1072
|
-
type: "address"
|
|
1073
|
-
},
|
|
1074
|
-
{
|
|
1075
|
-
internalType: "uint64",
|
|
1076
|
-
name: "_destinationChainSelector",
|
|
1077
|
-
type: "uint64"
|
|
1078
|
-
},
|
|
1079
|
-
{
|
|
1080
|
-
components: [
|
|
1081
|
-
{
|
|
1082
|
-
internalType: "address",
|
|
1083
|
-
name: "receiver",
|
|
1084
|
-
type: "address"
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
internalType: "address",
|
|
1088
|
-
name: "tokenOut",
|
|
1089
|
-
type: "address"
|
|
1090
|
-
},
|
|
1091
|
-
{
|
|
1092
|
-
internalType: "uint256",
|
|
1093
|
-
name: "estimatedAmountOut",
|
|
1094
|
-
type: "uint256"
|
|
1095
|
-
},
|
|
1096
|
-
{
|
|
1097
|
-
components: [
|
|
1098
|
-
{
|
|
1099
|
-
internalType: "enum CallType",
|
|
1100
|
-
name: "callType",
|
|
1101
|
-
type: "uint8"
|
|
1102
|
-
},
|
|
1103
|
-
{
|
|
1104
|
-
internalType: "address",
|
|
1105
|
-
name: "target",
|
|
1106
|
-
type: "address"
|
|
1107
|
-
},
|
|
1108
|
-
{
|
|
1109
|
-
internalType: "uint256",
|
|
1110
|
-
name: "value",
|
|
1111
|
-
type: "uint256"
|
|
1112
|
-
},
|
|
1113
|
-
{
|
|
1114
|
-
internalType: "bytes",
|
|
1115
|
-
name: "callData",
|
|
1116
|
-
type: "bytes"
|
|
1117
|
-
},
|
|
1118
|
-
{
|
|
1119
|
-
internalType: "bytes",
|
|
1120
|
-
name: "payload",
|
|
1121
|
-
type: "bytes"
|
|
1122
|
-
}
|
|
1123
|
-
],
|
|
1124
|
-
internalType: "struct Call[]",
|
|
1125
|
-
name: "calls",
|
|
1126
|
-
type: "tuple[]"
|
|
1127
|
-
}
|
|
1128
|
-
],
|
|
1129
|
-
internalType: "struct SwapDataDestination",
|
|
1130
|
-
name: "_swapDestinationData",
|
|
1131
|
-
type: "tuple"
|
|
1132
|
-
},
|
|
1133
|
-
{
|
|
1134
|
-
internalType: "address",
|
|
1135
|
-
name: "_token",
|
|
1136
|
-
type: "address"
|
|
1137
|
-
},
|
|
1138
|
-
{
|
|
1139
|
-
internalType: "uint256",
|
|
1140
|
-
name: "_amount",
|
|
1141
|
-
type: "uint256"
|
|
1142
|
-
},
|
|
1143
|
-
{
|
|
1144
|
-
internalType: "uint256",
|
|
1145
|
-
name: "_gasLimit",
|
|
1146
|
-
type: "uint256"
|
|
1147
|
-
}
|
|
1148
|
-
],
|
|
1149
|
-
name: "getFees",
|
|
1150
|
-
outputs: [
|
|
1151
|
-
{
|
|
1152
|
-
components: [
|
|
1153
|
-
{
|
|
1154
|
-
internalType: "uint256",
|
|
1155
|
-
name: "ccipFee",
|
|
1156
|
-
type: "uint256"
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
components: [
|
|
1160
|
-
{
|
|
1161
|
-
internalType: "uint256",
|
|
1162
|
-
name: "tokenFee",
|
|
1163
|
-
type: "uint256"
|
|
1164
|
-
},
|
|
1165
|
-
{
|
|
1166
|
-
internalType: "uint256",
|
|
1167
|
-
name: "nativeFee",
|
|
1168
|
-
type: "uint256"
|
|
1169
|
-
}
|
|
1170
|
-
],
|
|
1171
|
-
internalType: "struct XSwapFee",
|
|
1172
|
-
name: "xSwapFee",
|
|
1173
|
-
type: "tuple"
|
|
1174
|
-
}
|
|
1175
|
-
],
|
|
1176
|
-
internalType: "struct MessageFees",
|
|
1177
|
-
name: "fees",
|
|
1178
|
-
type: "tuple"
|
|
1179
|
-
}
|
|
1180
|
-
],
|
|
1181
|
-
stateMutability: "view",
|
|
1182
|
-
type: "function"
|
|
1183
|
-
},
|
|
1184
|
-
{
|
|
1185
|
-
inputs: [],
|
|
1186
|
-
name: "getRouter",
|
|
1187
|
-
outputs: [
|
|
1188
|
-
{
|
|
1189
|
-
internalType: "address",
|
|
1190
|
-
name: "",
|
|
1191
|
-
type: "address"
|
|
1192
|
-
}
|
|
1193
|
-
],
|
|
1194
|
-
stateMutability: "view",
|
|
1195
|
-
type: "function"
|
|
1196
|
-
},
|
|
1197
|
-
{
|
|
1198
|
-
inputs: [
|
|
1199
|
-
{
|
|
1200
|
-
internalType: "address",
|
|
1201
|
-
name: "_ccipRouter",
|
|
1202
|
-
type: "address"
|
|
1203
|
-
},
|
|
1204
|
-
{
|
|
1205
|
-
internalType: "address",
|
|
1206
|
-
name: "_feeOracle",
|
|
1207
|
-
type: "address"
|
|
1208
|
-
},
|
|
1209
|
-
{
|
|
1210
|
-
internalType: "address",
|
|
1211
|
-
name: "_feeCollector",
|
|
1212
|
-
type: "address"
|
|
1213
|
-
},
|
|
1214
|
-
{
|
|
1215
|
-
internalType: "address",
|
|
1216
|
-
name: "_xSwapExecutor",
|
|
1217
|
-
type: "address"
|
|
1218
|
-
},
|
|
1219
|
-
{
|
|
1220
|
-
internalType: "address",
|
|
1221
|
-
name: "_owner",
|
|
1222
|
-
type: "address"
|
|
1223
|
-
}
|
|
1224
|
-
],
|
|
1225
|
-
name: "initialize",
|
|
1226
|
-
outputs: [],
|
|
1227
|
-
stateMutability: "nonpayable",
|
|
1228
|
-
type: "function"
|
|
1229
|
-
},
|
|
1230
|
-
{
|
|
1231
|
-
inputs: [
|
|
1232
|
-
{
|
|
1233
|
-
components: [
|
|
1234
|
-
{
|
|
1235
|
-
internalType: "bytes32",
|
|
1236
|
-
name: "messageId",
|
|
1237
|
-
type: "bytes32"
|
|
1238
|
-
},
|
|
1239
|
-
{
|
|
1240
|
-
internalType: "uint64",
|
|
1241
|
-
name: "sourceChainSelector",
|
|
1242
|
-
type: "uint64"
|
|
1243
|
-
},
|
|
1244
|
-
{
|
|
1245
|
-
internalType: "bytes",
|
|
1246
|
-
name: "sender",
|
|
1247
|
-
type: "bytes"
|
|
1248
|
-
},
|
|
1249
|
-
{
|
|
1250
|
-
internalType: "bytes",
|
|
1251
|
-
name: "data",
|
|
1252
|
-
type: "bytes"
|
|
1253
|
-
},
|
|
1254
|
-
{
|
|
1255
|
-
components: [
|
|
1256
|
-
{
|
|
1257
|
-
internalType: "address",
|
|
1258
|
-
name: "token",
|
|
1259
|
-
type: "address"
|
|
1260
|
-
},
|
|
1261
|
-
{
|
|
1262
|
-
internalType: "uint256",
|
|
1263
|
-
name: "amount",
|
|
1264
|
-
type: "uint256"
|
|
1265
|
-
}
|
|
1266
|
-
],
|
|
1267
|
-
internalType: "struct Client.EVMTokenAmount[]",
|
|
1268
|
-
name: "destTokenAmounts",
|
|
1269
|
-
type: "tuple[]"
|
|
1270
|
-
}
|
|
1271
|
-
],
|
|
1272
|
-
internalType: "struct Client.Any2EVMMessage",
|
|
1273
|
-
name: "_any2EvmMessage",
|
|
1274
|
-
type: "tuple"
|
|
1275
|
-
}
|
|
1276
|
-
],
|
|
1277
|
-
name: "instantCcipReceive",
|
|
1278
|
-
outputs: [],
|
|
1279
|
-
stateMutability: "nonpayable",
|
|
1280
|
-
type: "function"
|
|
1281
|
-
},
|
|
1282
|
-
{
|
|
1283
|
-
inputs: [
|
|
1284
|
-
{
|
|
1285
|
-
internalType: "bytes32",
|
|
1286
|
-
name: "",
|
|
1287
|
-
type: "bytes32"
|
|
1288
|
-
}
|
|
1289
|
-
],
|
|
1290
|
-
name: "messageExecutionHashToExecutorMap",
|
|
1291
|
-
outputs: [
|
|
1292
|
-
{
|
|
1293
|
-
internalType: "address",
|
|
1294
|
-
name: "",
|
|
1295
|
-
type: "address"
|
|
1296
|
-
}
|
|
1297
|
-
],
|
|
1298
|
-
stateMutability: "view",
|
|
1299
|
-
type: "function"
|
|
1300
|
-
},
|
|
1301
|
-
{
|
|
1302
|
-
inputs: [],
|
|
1303
|
-
name: "owner",
|
|
1304
|
-
outputs: [
|
|
1305
|
-
{
|
|
1306
|
-
internalType: "address",
|
|
1307
|
-
name: "",
|
|
1308
|
-
type: "address"
|
|
1309
|
-
}
|
|
1310
|
-
],
|
|
1311
|
-
stateMutability: "view",
|
|
1312
|
-
type: "function"
|
|
1313
|
-
},
|
|
1314
|
-
{
|
|
1315
|
-
inputs: [],
|
|
1316
|
-
name: "proxiableUUID",
|
|
1317
|
-
outputs: [
|
|
1318
|
-
{
|
|
1319
|
-
internalType: "bytes32",
|
|
1320
|
-
name: "",
|
|
1321
|
-
type: "bytes32"
|
|
1322
|
-
}
|
|
1323
|
-
],
|
|
1324
|
-
stateMutability: "view",
|
|
1325
|
-
type: "function"
|
|
1326
|
-
},
|
|
1327
|
-
{
|
|
1328
|
-
inputs: [],
|
|
1329
|
-
name: "renounceOwnership",
|
|
1330
|
-
outputs: [],
|
|
1331
|
-
stateMutability: "nonpayable",
|
|
1332
|
-
type: "function"
|
|
1333
|
-
},
|
|
1334
|
-
{
|
|
1335
|
-
inputs: [
|
|
1336
|
-
{
|
|
1337
|
-
internalType: "address",
|
|
1338
|
-
name: "_feeCollectorAddress",
|
|
1339
|
-
type: "address"
|
|
1340
|
-
}
|
|
1341
|
-
],
|
|
1342
|
-
name: "setFeeCollectorAddress",
|
|
1343
|
-
outputs: [],
|
|
1344
|
-
stateMutability: "nonpayable",
|
|
1345
|
-
type: "function"
|
|
1346
|
-
},
|
|
1347
|
-
{
|
|
1348
|
-
inputs: [
|
|
1349
|
-
{
|
|
1350
|
-
internalType: "address",
|
|
1351
|
-
name: "_feeOracleAddress",
|
|
1352
|
-
type: "address"
|
|
1353
|
-
}
|
|
1354
|
-
],
|
|
1355
|
-
name: "setFeeOracleAddress",
|
|
1356
|
-
outputs: [],
|
|
1357
|
-
stateMutability: "nonpayable",
|
|
1358
|
-
type: "function"
|
|
1359
|
-
},
|
|
1360
|
-
{
|
|
1361
|
-
inputs: [
|
|
1362
|
-
{
|
|
1363
|
-
internalType: "address",
|
|
1364
|
-
name: "_router",
|
|
1365
|
-
type: "address"
|
|
1366
|
-
}
|
|
1367
|
-
],
|
|
1368
|
-
name: "setRouter",
|
|
1369
|
-
outputs: [],
|
|
1370
|
-
stateMutability: "nonpayable",
|
|
1371
|
-
type: "function"
|
|
1372
|
-
},
|
|
1373
|
-
{
|
|
1374
|
-
inputs: [
|
|
1375
|
-
{
|
|
1376
|
-
internalType: "address",
|
|
1377
|
-
name: "_xSwapExecutor",
|
|
1378
|
-
type: "address"
|
|
1379
|
-
}
|
|
1380
|
-
],
|
|
1381
|
-
name: "setXSwapExecutor",
|
|
1382
|
-
outputs: [],
|
|
1383
|
-
stateMutability: "nonpayable",
|
|
1384
|
-
type: "function"
|
|
1385
|
-
},
|
|
1386
|
-
{
|
|
1387
|
-
inputs: [
|
|
1388
|
-
{
|
|
1389
|
-
internalType: "bytes4",
|
|
1390
|
-
name: "interfaceId",
|
|
1391
|
-
type: "bytes4"
|
|
1392
|
-
}
|
|
1393
|
-
],
|
|
1394
|
-
name: "supportsInterface",
|
|
1395
|
-
outputs: [
|
|
1396
|
-
{
|
|
1397
|
-
internalType: "bool",
|
|
1398
|
-
name: "",
|
|
1399
|
-
type: "bool"
|
|
1400
|
-
}
|
|
1401
|
-
],
|
|
1402
|
-
stateMutability: "pure",
|
|
1403
|
-
type: "function"
|
|
1404
|
-
},
|
|
1405
|
-
{
|
|
1406
|
-
inputs: [
|
|
1407
|
-
{
|
|
1408
|
-
internalType: "address",
|
|
1409
|
-
name: "_paymentToken",
|
|
1410
|
-
type: "address"
|
|
1411
|
-
},
|
|
1412
|
-
{
|
|
1413
|
-
internalType: "uint64",
|
|
1414
|
-
name: "_destinationChainSelector",
|
|
1415
|
-
type: "uint64"
|
|
1416
|
-
},
|
|
1417
|
-
{
|
|
1418
|
-
components: [
|
|
1419
|
-
{
|
|
1420
|
-
internalType: "address",
|
|
1421
|
-
name: "receiver",
|
|
1422
|
-
type: "address"
|
|
1423
|
-
},
|
|
1424
|
-
{
|
|
1425
|
-
internalType: "address",
|
|
1426
|
-
name: "tokenOut",
|
|
1427
|
-
type: "address"
|
|
1428
|
-
},
|
|
1429
|
-
{
|
|
1430
|
-
internalType: "uint256",
|
|
1431
|
-
name: "estimatedAmountOut",
|
|
1432
|
-
type: "uint256"
|
|
1433
|
-
},
|
|
1434
|
-
{
|
|
1435
|
-
components: [
|
|
1436
|
-
{
|
|
1437
|
-
internalType: "enum CallType",
|
|
1438
|
-
name: "callType",
|
|
1439
|
-
type: "uint8"
|
|
1440
|
-
},
|
|
1441
|
-
{
|
|
1442
|
-
internalType: "address",
|
|
1443
|
-
name: "target",
|
|
1444
|
-
type: "address"
|
|
1445
|
-
},
|
|
1446
|
-
{
|
|
1447
|
-
internalType: "uint256",
|
|
1448
|
-
name: "value",
|
|
1449
|
-
type: "uint256"
|
|
1450
|
-
},
|
|
1451
|
-
{
|
|
1452
|
-
internalType: "bytes",
|
|
1453
|
-
name: "callData",
|
|
1454
|
-
type: "bytes"
|
|
1455
|
-
},
|
|
1456
|
-
{
|
|
1457
|
-
internalType: "bytes",
|
|
1458
|
-
name: "payload",
|
|
1459
|
-
type: "bytes"
|
|
1460
|
-
}
|
|
1461
|
-
],
|
|
1462
|
-
internalType: "struct Call[]",
|
|
1463
|
-
name: "calls",
|
|
1464
|
-
type: "tuple[]"
|
|
1465
|
-
}
|
|
1466
|
-
],
|
|
1467
|
-
internalType: "struct SwapDataDestination",
|
|
1468
|
-
name: "_swapDestinationData",
|
|
1469
|
-
type: "tuple"
|
|
1470
|
-
},
|
|
1471
|
-
{
|
|
1472
|
-
components: [
|
|
1473
|
-
{
|
|
1474
|
-
internalType: "address",
|
|
1475
|
-
name: "tokenIn",
|
|
1476
|
-
type: "address"
|
|
1477
|
-
},
|
|
1478
|
-
{
|
|
1479
|
-
internalType: "uint256",
|
|
1480
|
-
name: "amountIn",
|
|
1481
|
-
type: "uint256"
|
|
1482
|
-
},
|
|
1483
|
-
{
|
|
1484
|
-
internalType: "address",
|
|
1485
|
-
name: "tokenOut",
|
|
1486
|
-
type: "address"
|
|
1487
|
-
},
|
|
1488
|
-
{
|
|
1489
|
-
internalType: "uint256",
|
|
1490
|
-
name: "estimatedAmountOut",
|
|
1491
|
-
type: "uint256"
|
|
1492
|
-
},
|
|
1493
|
-
{
|
|
1494
|
-
internalType: "uint256",
|
|
1495
|
-
name: "valueForDestinationGas",
|
|
1496
|
-
type: "uint256"
|
|
1497
|
-
},
|
|
1498
|
-
{
|
|
1499
|
-
internalType: "uint256",
|
|
1500
|
-
name: "valueForInstantCcipRecieve",
|
|
1501
|
-
type: "uint256"
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
components: [
|
|
1505
|
-
{
|
|
1506
|
-
internalType: "enum CallType",
|
|
1507
|
-
name: "callType",
|
|
1508
|
-
type: "uint8"
|
|
1509
|
-
},
|
|
1510
|
-
{
|
|
1511
|
-
internalType: "address",
|
|
1512
|
-
name: "target",
|
|
1513
|
-
type: "address"
|
|
1514
|
-
},
|
|
1515
|
-
{
|
|
1516
|
-
internalType: "uint256",
|
|
1517
|
-
name: "value",
|
|
1518
|
-
type: "uint256"
|
|
1519
|
-
},
|
|
1520
|
-
{
|
|
1521
|
-
internalType: "bytes",
|
|
1522
|
-
name: "callData",
|
|
1523
|
-
type: "bytes"
|
|
1524
|
-
},
|
|
1525
|
-
{
|
|
1526
|
-
internalType: "bytes",
|
|
1527
|
-
name: "payload",
|
|
1528
|
-
type: "bytes"
|
|
1529
|
-
}
|
|
1530
|
-
],
|
|
1531
|
-
internalType: "struct Call[]",
|
|
1532
|
-
name: "calls",
|
|
1533
|
-
type: "tuple[]"
|
|
1534
|
-
}
|
|
1535
|
-
],
|
|
1536
|
-
internalType: "struct SwapDataOrigin",
|
|
1537
|
-
name: "_swapOriginData",
|
|
1538
|
-
type: "tuple"
|
|
1539
|
-
},
|
|
1540
|
-
{
|
|
1541
|
-
internalType: "uint256",
|
|
1542
|
-
name: "_gasLimit",
|
|
1543
|
-
type: "uint256"
|
|
1544
|
-
}
|
|
1545
|
-
],
|
|
1546
|
-
name: "swapAndSendMessage",
|
|
1547
|
-
outputs: [
|
|
1548
|
-
{
|
|
1549
|
-
internalType: "bytes32",
|
|
1550
|
-
name: "messageId",
|
|
1551
|
-
type: "bytes32"
|
|
1552
|
-
}
|
|
1553
|
-
],
|
|
1554
|
-
stateMutability: "payable",
|
|
1555
|
-
type: "function"
|
|
1556
|
-
},
|
|
1557
|
-
{
|
|
1558
|
-
inputs: [
|
|
1559
|
-
{
|
|
1560
|
-
internalType: "address",
|
|
1561
|
-
name: "newOwner",
|
|
1562
|
-
type: "address"
|
|
1563
|
-
}
|
|
1564
|
-
],
|
|
1565
|
-
name: "transferOwnership",
|
|
1566
|
-
outputs: [],
|
|
1567
|
-
stateMutability: "nonpayable",
|
|
1568
|
-
type: "function"
|
|
1569
|
-
},
|
|
1570
|
-
{
|
|
1571
|
-
inputs: [
|
|
1572
|
-
{
|
|
1573
|
-
internalType: "uint64",
|
|
1574
|
-
name: "_chainSelector",
|
|
1575
|
-
type: "uint64"
|
|
1576
|
-
},
|
|
1577
|
-
{
|
|
1578
|
-
internalType: "address",
|
|
1579
|
-
name: "_xSwapRouter",
|
|
1580
|
-
type: "address"
|
|
1581
|
-
}
|
|
1582
|
-
],
|
|
1583
|
-
name: "updateChainSelectorToXSwapRouterMap",
|
|
1584
|
-
outputs: [],
|
|
1585
|
-
stateMutability: "nonpayable",
|
|
1586
|
-
type: "function"
|
|
1587
|
-
},
|
|
1588
|
-
{
|
|
1589
|
-
inputs: [
|
|
1590
|
-
{
|
|
1591
|
-
internalType: "uint64[]",
|
|
1592
|
-
name: "_chainSelectors",
|
|
1593
|
-
type: "uint64[]"
|
|
1594
|
-
},
|
|
1595
|
-
{
|
|
1596
|
-
internalType: "address[]",
|
|
1597
|
-
name: "_xSwapRouters",
|
|
1598
|
-
type: "address[]"
|
|
1599
|
-
}
|
|
1600
|
-
],
|
|
1601
|
-
name: "updateChainSelectorToXSwapRouterMapMany",
|
|
1602
|
-
outputs: [],
|
|
1603
|
-
stateMutability: "nonpayable",
|
|
1604
|
-
type: "function"
|
|
1605
|
-
},
|
|
1606
|
-
{
|
|
1607
|
-
inputs: [
|
|
1608
|
-
{
|
|
1609
|
-
internalType: "uint64",
|
|
1610
|
-
name: "_sourceChainSelector",
|
|
1611
|
-
type: "uint64"
|
|
1612
|
-
},
|
|
1613
|
-
{
|
|
1614
|
-
internalType: "address",
|
|
1615
|
-
name: "_sender",
|
|
1616
|
-
type: "address"
|
|
1617
|
-
},
|
|
1618
|
-
{
|
|
1619
|
-
internalType: "bool",
|
|
1620
|
-
name: "_isWhitelisted",
|
|
1621
|
-
type: "bool"
|
|
1622
|
-
}
|
|
1623
|
-
],
|
|
1624
|
-
name: "updateWhitelistSender",
|
|
1625
|
-
outputs: [],
|
|
1626
|
-
stateMutability: "nonpayable",
|
|
1627
|
-
type: "function"
|
|
1628
|
-
},
|
|
1629
|
-
{
|
|
1630
|
-
inputs: [
|
|
1631
|
-
{
|
|
1632
|
-
internalType: "uint64[]",
|
|
1633
|
-
name: "_sourceChainSelectors",
|
|
1634
|
-
type: "uint64[]"
|
|
1635
|
-
},
|
|
1636
|
-
{
|
|
1637
|
-
internalType: "address[]",
|
|
1638
|
-
name: "_senders",
|
|
1639
|
-
type: "address[]"
|
|
1640
|
-
},
|
|
1641
|
-
{
|
|
1642
|
-
internalType: "bool[]",
|
|
1643
|
-
name: "_areWhitelisted",
|
|
1644
|
-
type: "bool[]"
|
|
1645
|
-
}
|
|
1646
|
-
],
|
|
1647
|
-
name: "updateWhitelistSenderMany",
|
|
1648
|
-
outputs: [],
|
|
1649
|
-
stateMutability: "nonpayable",
|
|
1650
|
-
type: "function"
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
inputs: [
|
|
1654
|
-
{
|
|
1655
|
-
internalType: "address",
|
|
1656
|
-
name: "_token",
|
|
1657
|
-
type: "address"
|
|
1658
|
-
},
|
|
1659
|
-
{
|
|
1660
|
-
internalType: "bool",
|
|
1661
|
-
name: "_isWhitelisted",
|
|
1662
|
-
type: "bool"
|
|
1663
|
-
}
|
|
1664
|
-
],
|
|
1665
|
-
name: "updateWhitelistToken",
|
|
1666
|
-
outputs: [],
|
|
1667
|
-
stateMutability: "nonpayable",
|
|
1668
|
-
type: "function"
|
|
1669
|
-
},
|
|
1670
|
-
{
|
|
1671
|
-
inputs: [
|
|
1672
|
-
{
|
|
1673
|
-
internalType: "address",
|
|
1674
|
-
name: "newImplementation",
|
|
1675
|
-
type: "address"
|
|
1676
|
-
}
|
|
1677
|
-
],
|
|
1678
|
-
name: "upgradeTo",
|
|
1679
|
-
outputs: [],
|
|
1680
|
-
stateMutability: "nonpayable",
|
|
1681
|
-
type: "function"
|
|
1682
|
-
},
|
|
1683
|
-
{
|
|
1684
|
-
inputs: [
|
|
1685
|
-
{
|
|
1686
|
-
internalType: "address",
|
|
1687
|
-
name: "newImplementation",
|
|
1688
|
-
type: "address"
|
|
1689
|
-
},
|
|
1690
|
-
{
|
|
1691
|
-
internalType: "bytes",
|
|
1692
|
-
name: "data",
|
|
1693
|
-
type: "bytes"
|
|
1694
|
-
}
|
|
1695
|
-
],
|
|
1696
|
-
name: "upgradeToAndCall",
|
|
1697
|
-
outputs: [],
|
|
1698
|
-
stateMutability: "payable",
|
|
1699
|
-
type: "function"
|
|
1700
|
-
},
|
|
1701
|
-
{
|
|
1702
|
-
inputs: [
|
|
1703
|
-
{
|
|
1704
|
-
internalType: "uint64",
|
|
1705
|
-
name: "",
|
|
1706
|
-
type: "uint64"
|
|
1707
|
-
},
|
|
1708
|
-
{
|
|
1709
|
-
internalType: "address",
|
|
1710
|
-
name: "",
|
|
1711
|
-
type: "address"
|
|
1712
|
-
}
|
|
1713
|
-
],
|
|
1714
|
-
name: "whitelistedSenders",
|
|
1715
|
-
outputs: [
|
|
1716
|
-
{
|
|
1717
|
-
internalType: "bool",
|
|
1718
|
-
name: "",
|
|
1719
|
-
type: "bool"
|
|
1720
|
-
}
|
|
1721
|
-
],
|
|
1722
|
-
stateMutability: "view",
|
|
1723
|
-
type: "function"
|
|
1724
|
-
},
|
|
1725
|
-
{
|
|
1726
|
-
inputs: [
|
|
1727
|
-
{
|
|
1728
|
-
internalType: "address",
|
|
1729
|
-
name: "",
|
|
1730
|
-
type: "address"
|
|
1731
|
-
}
|
|
1732
|
-
],
|
|
1733
|
-
name: "whitelistedTokens",
|
|
1734
|
-
outputs: [
|
|
1735
|
-
{
|
|
1736
|
-
internalType: "bool",
|
|
1737
|
-
name: "",
|
|
1738
|
-
type: "bool"
|
|
1739
|
-
}
|
|
1740
|
-
],
|
|
1741
|
-
stateMutability: "view",
|
|
1742
|
-
type: "function"
|
|
1743
|
-
},
|
|
1744
|
-
{
|
|
1745
|
-
inputs: [],
|
|
1746
|
-
name: "xSwapExecutor",
|
|
1747
|
-
outputs: [
|
|
1748
|
-
{
|
|
1749
|
-
internalType: "address",
|
|
1750
|
-
name: "",
|
|
1751
|
-
type: "address"
|
|
1752
|
-
}
|
|
1753
|
-
],
|
|
1754
|
-
stateMutability: "view",
|
|
1755
|
-
type: "function"
|
|
1756
|
-
},
|
|
1757
|
-
{
|
|
1758
|
-
stateMutability: "payable",
|
|
1759
|
-
type: "receive"
|
|
1760
|
-
}
|
|
1761
|
-
];
|
|
1762
|
-
|
|
1763
|
-
// src/contracts/abi/index.ts
|
|
1764
|
-
var BatchQueryAbi = BatchQuery_default;
|
|
1765
|
-
var ERC20Abi = ERC20_default;
|
|
1766
|
-
var XSwapRouterAbi = XSwapRouter_default;
|
|
1767
|
-
|
|
1768
|
-
// src/contracts/addresses.ts
|
|
1769
|
-
var ADDRESSES = {
|
|
1770
|
-
// arbitrum
|
|
1771
|
-
"42161": {
|
|
1772
|
-
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
1773
|
-
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
1774
|
-
},
|
|
1775
|
-
// avalanche
|
|
1776
|
-
"43114": {
|
|
1777
|
-
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
1778
|
-
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
1779
|
-
},
|
|
1780
|
-
// base
|
|
1781
|
-
"8453": {
|
|
1782
|
-
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
1783
|
-
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
1784
|
-
},
|
|
1785
|
-
// ethereum
|
|
1786
|
-
"1": {
|
|
1787
|
-
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
1788
|
-
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
1789
|
-
},
|
|
1790
|
-
// optimism
|
|
1791
|
-
"10": {
|
|
1792
|
-
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
1793
|
-
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
1794
|
-
},
|
|
1795
|
-
// polygon
|
|
1796
|
-
"137": {
|
|
1797
|
-
["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
|
|
1798
|
-
["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
|
|
1799
|
-
}
|
|
1800
|
-
};
|
|
1801
|
-
|
|
1802
|
-
// src/constants/index.ts
|
|
1803
|
-
var DEFAULT_ECOSYSTEM = "evm" /* EVM */;
|
|
1804
|
-
var NUMBER_INPUT_REGEX = /^[0-9]*[.,]?[0-9]*$/;
|
|
1805
|
-
var SLIPPAGE_PRESETS = [0.5, 1.5, 3];
|
|
1806
|
-
var DELIVERY_TIME = 30 * 1e3 * 60;
|
|
1807
|
-
var EXPRESS_DELIVERY_TIME = 30 * 1e3;
|
|
1808
|
-
var BALANCES_CHUNK_SIZE = 500;
|
|
1809
|
-
var ROUTE_TIMEOUT_MS = 5e3;
|
|
1810
|
-
var MINIMUM_DISPLAYED_TOKEN_AMOUNT = 1e-4;
|
|
1811
|
-
var DEFAULT_SOURCE_CHAIN_ID = "1";
|
|
1812
|
-
|
|
1813
|
-
// src/utils/contracts.ts
|
|
1814
|
-
var IERC20 = new ethers.utils.Interface(ERC20Abi);
|
|
1815
|
-
var getBalanceOf = async (wallet, token, rpcUrl) => {
|
|
1816
|
-
const provider = ethers.getDefaultProvider(rpcUrl);
|
|
1817
|
-
if (token === ethers.constants.AddressZero) {
|
|
1818
|
-
return ethers.utils.formatEther(await provider.getBalance(wallet));
|
|
1819
|
-
}
|
|
1820
|
-
const contract = new ethers.Contract(token, ERC20Abi, provider);
|
|
1821
|
-
return ethers.utils.formatUnits(
|
|
1822
|
-
await contract.balanceOf(wallet),
|
|
1823
|
-
await contract.decimals()
|
|
1824
|
-
);
|
|
1825
|
-
};
|
|
1826
|
-
var getBalances = async (chain, wallet) => {
|
|
1827
|
-
return {
|
|
1828
|
-
...await getNativeBalance(chain, wallet),
|
|
1829
|
-
...await getErc20Balances(chain, wallet)
|
|
1830
|
-
};
|
|
1831
|
-
};
|
|
1832
|
-
var getNativeBalance = async (chain, wallet) => {
|
|
1833
|
-
const native = chain.tokens.find(
|
|
1834
|
-
({ address }) => address === ethers.constants.AddressZero
|
|
1835
|
-
);
|
|
1836
|
-
if (native) {
|
|
1837
|
-
const provider = ethers.getDefaultProvider(chain.publicRpcUrls[0]);
|
|
1838
|
-
const balance = await provider.getBalance(wallet);
|
|
1839
|
-
return {
|
|
1840
|
-
[native.address]: balance
|
|
1841
|
-
};
|
|
1842
|
-
}
|
|
1843
|
-
return {};
|
|
1844
|
-
};
|
|
1845
|
-
var getErc20Balances = async (chain, wallet) => {
|
|
1846
|
-
const erc20Tokens = chain.tokens.filter(
|
|
1847
|
-
({ address }) => address !== ethers.constants.AddressZero
|
|
1848
|
-
);
|
|
1849
|
-
const tokenChunks = chunkArray(erc20Tokens, BALANCES_CHUNK_SIZE);
|
|
1850
|
-
const promises = tokenChunks.map(async (tokenChunk) => {
|
|
1851
|
-
const tokenAddresses = tokenChunk.map((token) => token.address);
|
|
1852
|
-
const calldatas = tokenChunk.map(
|
|
1853
|
-
() => IERC20.encodeFunctionData("balanceOf", [wallet])
|
|
1854
|
-
);
|
|
1855
|
-
const contractAddress = ADDRESSES[chain.chainId]?.BatchQuery;
|
|
1856
|
-
const rpcUrl = chain.publicRpcUrls[0];
|
|
1857
|
-
if (contractAddress && rpcUrl) {
|
|
1858
|
-
const contract = new ethers.Contract(
|
|
1859
|
-
contractAddress,
|
|
1860
|
-
BatchQueryAbi,
|
|
1861
|
-
ethers.getDefaultProvider(rpcUrl)
|
|
1862
|
-
);
|
|
1863
|
-
return await contract["batchQuery"](tokenAddresses, calldatas);
|
|
1864
|
-
}
|
|
1865
|
-
return Promise.resolve();
|
|
1866
|
-
});
|
|
1867
|
-
const tokenBalances = (await Promise.all(promises)).flat().map(
|
|
1868
|
-
(encodedBalance) => ethers.utils.defaultAbiCoder.decode(["uint256"], encodedBalance)[0]
|
|
1869
|
-
);
|
|
1870
|
-
const balances = {};
|
|
1871
|
-
erc20Tokens.forEach((token, index) => {
|
|
1872
|
-
balances[token.address] = tokenBalances[index];
|
|
1873
|
-
});
|
|
1874
|
-
return balances;
|
|
1875
|
-
};
|
|
1876
|
-
var generateApproveTxData = (tokenAddress, spender, amount) => {
|
|
1877
|
-
return tokenAddress !== ethers.constants.AddressZero ? {
|
|
1878
|
-
to: tokenAddress,
|
|
1879
|
-
value: safeBigNumberFrom("0"),
|
|
1880
|
-
data: IERC20.encodeFunctionData("approve", [spender, amount])
|
|
1881
|
-
} : void 0;
|
|
1882
|
-
};
|
|
1883
|
-
var findPlaceholderIndex = (abi, funName, funParams, placeholderValue) => {
|
|
1884
|
-
if (funParams.flat(Infinity).filter((param) => param === placeholderValue).length !== 1) {
|
|
1885
|
-
throw new Error("Random placeholder value must be provided and unique.");
|
|
1886
|
-
}
|
|
1887
|
-
const iface = new ethers.utils.Interface(abi);
|
|
1888
|
-
const functionFragment = iface.getFunction(funName);
|
|
1889
|
-
if (!functionFragment) {
|
|
1890
|
-
throw new Error(`Can't find function "${funName}" in provided ABI.`);
|
|
1891
|
-
}
|
|
1892
|
-
const encodedFunData = iface.encodeFunctionData(functionFragment, funParams);
|
|
1893
|
-
const paramData = encodedFunData.slice(10);
|
|
1894
|
-
const chunks = [];
|
|
1895
|
-
for (let i = 0; i < paramData.length; i += 64) {
|
|
1896
|
-
chunks.push(paramData.slice(i, i + 64));
|
|
1897
|
-
}
|
|
1898
|
-
const searchValue = placeholderValue.toHexString().slice(2).padStart(64, "0");
|
|
1899
|
-
const result = chunks.findIndex((chunk) => chunk === searchValue);
|
|
1900
|
-
if (result === -1) {
|
|
1901
|
-
throw new Error("Randomized parameter not found in the encoded data.");
|
|
1902
|
-
}
|
|
1903
|
-
return result;
|
|
1904
|
-
};
|
|
1905
|
-
|
|
1906
|
-
// src/utils/strings.ts
|
|
1907
|
-
var shortAddress = (address) => {
|
|
1908
|
-
return `${address?.substring(0, 5)}...${address?.substring(
|
|
1909
|
-
address.length - 5,
|
|
1910
|
-
address.length
|
|
1911
|
-
)}`;
|
|
1912
|
-
};
|
|
1913
|
-
|
|
1914
|
-
// src/utils/index.ts
|
|
1915
|
-
var replaceNull = (values, newValue) => {
|
|
1916
|
-
const modifiedValues = [...values];
|
|
1917
|
-
for (let i = 0; i < modifiedValues.length; i++) {
|
|
1918
|
-
if (Array.isArray(modifiedValues[i])) {
|
|
1919
|
-
modifiedValues[i] = replaceNull(modifiedValues[i], newValue);
|
|
1920
|
-
} else {
|
|
1921
|
-
if (modifiedValues[i] === null) {
|
|
1922
|
-
modifiedValues[i] = newValue;
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
return modifiedValues;
|
|
1927
|
-
};
|
|
1928
|
-
var deepMergeObjects = (obj1, obj2) => {
|
|
1929
|
-
for (const key in obj2) {
|
|
1930
|
-
if (obj2.hasOwnProperty(key)) {
|
|
1931
|
-
if (obj1.hasOwnProperty(key) && typeof obj1[key] === "object" && typeof obj2[key] === "object") {
|
|
1932
|
-
deepMergeObjects(obj1[key], obj2[key]);
|
|
1933
|
-
} else {
|
|
1934
|
-
obj1[key] = obj2[key];
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
return modifiedValues;
|
|
691
|
+
};
|
|
692
|
+
var deepMergeObjects = (obj1, obj2) => {
|
|
693
|
+
for (const key in obj2) {
|
|
694
|
+
if (obj2.hasOwnProperty(key)) {
|
|
695
|
+
if (obj1.hasOwnProperty(key) && typeof obj1[key] === "object" && typeof obj2[key] === "object") {
|
|
696
|
+
deepMergeObjects(obj1[key], obj2[key]);
|
|
697
|
+
} else {
|
|
698
|
+
obj1[key] = obj2[key];
|
|
1935
699
|
}
|
|
1936
700
|
}
|
|
1937
701
|
}
|
|
@@ -1944,6 +708,10 @@ var chunkArray = (array, chunkSize) => {
|
|
|
1944
708
|
}
|
|
1945
709
|
return result;
|
|
1946
710
|
};
|
|
711
|
+
var getDate = (blockTimestamp) => {
|
|
712
|
+
const date = new Date(blockTimestamp * 1e3);
|
|
713
|
+
return format(date, "d MMM yyyy HH:mm:ss");
|
|
714
|
+
};
|
|
1947
715
|
|
|
1948
716
|
// src/services/integrations/customCalls/staking.ts
|
|
1949
717
|
var generateStakingCalls = ({
|
|
@@ -2011,6 +779,7 @@ var generateStakingCalls = ({
|
|
|
2011
779
|
};
|
|
2012
780
|
|
|
2013
781
|
// src/services/integrations/transactions.ts
|
|
782
|
+
import { ethers as ethers3 } from "ethers";
|
|
2014
783
|
var getSwapTx = async ({
|
|
2015
784
|
dstChain,
|
|
2016
785
|
dstToken,
|
|
@@ -2020,6 +789,7 @@ var getSwapTx = async ({
|
|
|
2020
789
|
const supportedChains = (await getChains()).filter(
|
|
2021
790
|
({ web3Environment, swapSupported }) => web3Environment === "mainnet" /* MAINNET */ && swapSupported
|
|
2022
791
|
);
|
|
792
|
+
validateSwapTxData(supportedChains, dstChain, dstToken);
|
|
2023
793
|
const route = await openTxConfigForm({
|
|
2024
794
|
dstChainId: dstChain,
|
|
2025
795
|
dstTokenAddr: dstToken,
|
|
@@ -2029,6 +799,119 @@ var getSwapTx = async ({
|
|
|
2029
799
|
});
|
|
2030
800
|
return route.transactions;
|
|
2031
801
|
};
|
|
802
|
+
var validateSwapTxData = (supportedChains, dstChain, dstToken) => {
|
|
803
|
+
const supportedDstChain = supportedChains.find(
|
|
804
|
+
({ chainId }) => chainId === dstChain
|
|
805
|
+
);
|
|
806
|
+
if (!supportedDstChain) {
|
|
807
|
+
throw new Error(`Provided chain '${dstChain}' is not supported`);
|
|
808
|
+
}
|
|
809
|
+
if (!supportedDstChain.tokens.some(({ address }) => address === dstToken)) {
|
|
810
|
+
throw new Error(`Provided token '${dstToken}' is not supported`);
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
var monitorTransactionStatus = async (srcChainId, txHash) => {
|
|
814
|
+
const txReceipt = await getTxReceipt(srcChainId, txHash);
|
|
815
|
+
if (!txReceipt) {
|
|
816
|
+
throw new Error(
|
|
817
|
+
`No transaction found for chain ${srcChainId} tx ${txHash}`
|
|
818
|
+
);
|
|
819
|
+
}
|
|
820
|
+
const supportedChains = (await getChains()).filter(
|
|
821
|
+
({ web3Environment, swapSupported }) => web3Environment === "mainnet" /* MAINNET */ && swapSupported
|
|
822
|
+
);
|
|
823
|
+
const messageSentEventSignature = "MessageSent(bytes32,uint64,address,bytes,address,uint256,uint256,address,uint256)";
|
|
824
|
+
const messageSentEventAbi = [
|
|
825
|
+
"event MessageSent(bytes32 indexed messageId, uint64 indexed destinationChainSelector, address indexed sender, bytes data, address token, uint256 tokenAmount, uint256 valueForInstantCcipRecieve, address transferedToken, uint256 transferedTokenAmount)"
|
|
826
|
+
];
|
|
827
|
+
const messageReceivedEventSignature = "MessageReceived(bytes32,uint64,address,bytes,address,uint256)";
|
|
828
|
+
const messageReceivedEventAbi = [
|
|
829
|
+
"event MessageReceived(bytes32 indexed messageId, uint64 indexed sourceChainSelector, address indexed sender, bytes data, address token, uint256 tokenAmount)"
|
|
830
|
+
];
|
|
831
|
+
const messageSentEvent = txReceipt.logs?.find((log) => {
|
|
832
|
+
return log.topics[0] === ethers3.utils.id(messageSentEventSignature);
|
|
833
|
+
});
|
|
834
|
+
if (!messageSentEvent) {
|
|
835
|
+
throw new Error(
|
|
836
|
+
`No transaction event found for chain ${srcChainId} tx ${txHash}`
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
const messageId = messageSentEvent?.topics[1];
|
|
840
|
+
const iface = new ethers3.utils.Interface(messageSentEventAbi);
|
|
841
|
+
const decodedMessageSentEvent = iface.parseLog(messageSentEvent);
|
|
842
|
+
if (!decodedMessageSentEvent) {
|
|
843
|
+
throw new Error(
|
|
844
|
+
`No transaction event arguments found for chain ${srcChainId} tx ${txHash}`
|
|
845
|
+
);
|
|
846
|
+
}
|
|
847
|
+
const srcChain = supportedChains.find(
|
|
848
|
+
(chain) => chain.chainId === srcChainId.toString()
|
|
849
|
+
);
|
|
850
|
+
const srcToken = srcChain?.tokens.find(
|
|
851
|
+
(token) => token.address === decodedMessageSentEvent.args?.token.toString()
|
|
852
|
+
);
|
|
853
|
+
const targetChain = supportedChains.find(
|
|
854
|
+
(chain) => chain.ccipChainId === decodedMessageSentEvent.args?.destinationChainSelector?.toString()
|
|
855
|
+
);
|
|
856
|
+
const toChainId = targetChain?.chainId;
|
|
857
|
+
if (!toChainId) {
|
|
858
|
+
throw new Error(`Unknown destination chain!`);
|
|
859
|
+
}
|
|
860
|
+
const transaction = {
|
|
861
|
+
txHash,
|
|
862
|
+
fromChain: srcChain?.displayName,
|
|
863
|
+
fromChainImage: srcChain?.image,
|
|
864
|
+
toChain: targetChain.displayName,
|
|
865
|
+
toChainImage: targetChain.image,
|
|
866
|
+
fromToken: srcToken?.symbol,
|
|
867
|
+
fromTokenImage: srcToken?.image,
|
|
868
|
+
fromAmount: weiToHumanReadable({
|
|
869
|
+
amount: decodedMessageSentEvent.args?.tokenAmount.toString(),
|
|
870
|
+
decimals: srcToken?.decimals || 18,
|
|
871
|
+
precisionFractionalPlaces: 4
|
|
872
|
+
}),
|
|
873
|
+
isDone: false,
|
|
874
|
+
explorer: `${CCIP_EXPLORER}/tx/${txHash}`
|
|
875
|
+
};
|
|
876
|
+
addTransactionToRenderedTransactions(transaction);
|
|
877
|
+
renderTxHistoryButtons();
|
|
878
|
+
const xSwapRouterOnDestinationAddress = ADDRESSES[toChainId]?.XSwapRouter;
|
|
879
|
+
if (!xSwapRouterOnDestinationAddress) {
|
|
880
|
+
throw new Error(`Unknown destination XSwapRouter!`);
|
|
881
|
+
}
|
|
882
|
+
const xSwapRouterOnDestination = new ethers3.Contract(
|
|
883
|
+
xSwapRouterOnDestinationAddress,
|
|
884
|
+
messageReceivedEventAbi,
|
|
885
|
+
ethers3.getDefaultProvider(
|
|
886
|
+
supportedChains.find((chain) => chain.chainId === toChainId)?.publicRpcUrls[0]
|
|
887
|
+
)
|
|
888
|
+
);
|
|
889
|
+
const eventFilter = {
|
|
890
|
+
address: xSwapRouterOnDestinationAddress,
|
|
891
|
+
topics: [ethers3.utils.id(messageReceivedEventSignature), messageId]
|
|
892
|
+
};
|
|
893
|
+
const onSuccess = async () => {
|
|
894
|
+
updateTransactionDoneInRenderedTransactions(txHash);
|
|
895
|
+
renderTxHistoryButtons();
|
|
896
|
+
await new Promise((resolve) => setTimeout(() => resolve(true), 5e3));
|
|
897
|
+
removeTransactionFromRenderedTransactions(txHash);
|
|
898
|
+
renderTxHistoryButtons();
|
|
899
|
+
};
|
|
900
|
+
xSwapRouterOnDestination.once(eventFilter, () => onSuccess());
|
|
901
|
+
};
|
|
902
|
+
var getTxReceipt = async (txChainId, txHash) => {
|
|
903
|
+
const chains = await getChains();
|
|
904
|
+
const chain = chains.find((chain2) => chain2.chainId === txChainId.toString());
|
|
905
|
+
const provider = new ethers3.providers.JsonRpcProvider(
|
|
906
|
+
chain?.publicRpcUrls[0]
|
|
907
|
+
);
|
|
908
|
+
try {
|
|
909
|
+
return await provider.getTransactionReceipt(txHash);
|
|
910
|
+
} catch (error) {
|
|
911
|
+
console.error("Error fetching transaction receipt:", error);
|
|
912
|
+
return null;
|
|
913
|
+
}
|
|
914
|
+
};
|
|
2032
915
|
|
|
2033
916
|
// src/hooks/useDebounce.tsx
|
|
2034
917
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -2055,7 +938,6 @@ import BigNumberJS2 from "bignumber.js";
|
|
|
2055
938
|
|
|
2056
939
|
// src/components/TxConfigForm/HistoryCard.tsx
|
|
2057
940
|
import { useCallback, useMemo } from "react";
|
|
2058
|
-
import { format } from "date-fns";
|
|
2059
941
|
|
|
2060
942
|
// src/components/icons/ArrowRightIcon.tsx
|
|
2061
943
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -2093,45 +975,67 @@ var ArrowDownIcon = () => {
|
|
|
2093
975
|
);
|
|
2094
976
|
};
|
|
2095
977
|
|
|
2096
|
-
// src/components/icons/
|
|
978
|
+
// src/components/icons/ArrowLeftIcon.tsx
|
|
2097
979
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
2098
|
-
var
|
|
980
|
+
var ArrowLeftIcon = () => {
|
|
2099
981
|
return /* @__PURE__ */ jsx4(
|
|
982
|
+
"svg",
|
|
983
|
+
{
|
|
984
|
+
width: "10",
|
|
985
|
+
height: "16",
|
|
986
|
+
viewBox: "0 0 10 16",
|
|
987
|
+
fill: "none",
|
|
988
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
989
|
+
children: /* @__PURE__ */ jsx4(
|
|
990
|
+
"path",
|
|
991
|
+
{
|
|
992
|
+
d: "M0.5 8L8.13251 15.5L9.5 14.1562L3.20318 8L9.4682 1.84375L8.10071 0.5L0.5 8Z",
|
|
993
|
+
fill: "white"
|
|
994
|
+
}
|
|
995
|
+
)
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
};
|
|
999
|
+
|
|
1000
|
+
// src/components/icons/ArrowUpRightIcon.tsx
|
|
1001
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1002
|
+
var ArrowUpRightIcon = () => {
|
|
1003
|
+
return /* @__PURE__ */ jsx5(
|
|
2100
1004
|
"svg",
|
|
2101
1005
|
{
|
|
2102
1006
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2103
1007
|
viewBox: "0 0 512 512",
|
|
2104
1008
|
fill: "currentColor",
|
|
2105
|
-
children: /* @__PURE__ */
|
|
1009
|
+
children: /* @__PURE__ */ jsx5("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" })
|
|
2106
1010
|
}
|
|
2107
1011
|
);
|
|
2108
1012
|
};
|
|
2109
1013
|
|
|
2110
1014
|
// src/components/icons/CheckIcon.tsx
|
|
2111
|
-
import { jsx as
|
|
1015
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
2112
1016
|
var CheckIcon = () => {
|
|
2113
|
-
return /* @__PURE__ */
|
|
1017
|
+
return /* @__PURE__ */ jsx6(
|
|
2114
1018
|
"svg",
|
|
2115
1019
|
{
|
|
2116
1020
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2117
1021
|
viewBox: "0 0 448 512",
|
|
2118
1022
|
fill: "currentColor",
|
|
2119
|
-
children: /* @__PURE__ */
|
|
1023
|
+
children: /* @__PURE__ */ jsx6("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" })
|
|
2120
1024
|
}
|
|
2121
1025
|
);
|
|
2122
1026
|
};
|
|
2123
1027
|
|
|
2124
1028
|
// src/components/icons/ChevronDownIcon.tsx
|
|
2125
|
-
import { jsx as
|
|
1029
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
2126
1030
|
var ChevronDownIcon = () => {
|
|
2127
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ jsx7(
|
|
2128
1032
|
"svg",
|
|
2129
1033
|
{
|
|
2130
1034
|
width: "12",
|
|
2131
1035
|
height: "12",
|
|
2132
1036
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2133
1037
|
viewBox: "0 0 512 512",
|
|
2134
|
-
children: /* @__PURE__ */
|
|
1038
|
+
children: /* @__PURE__ */ jsx7(
|
|
2135
1039
|
"path",
|
|
2136
1040
|
{
|
|
2137
1041
|
fill: "currentColor",
|
|
@@ -2143,65 +1047,51 @@ var ChevronDownIcon = () => {
|
|
|
2143
1047
|
};
|
|
2144
1048
|
|
|
2145
1049
|
// src/components/icons/ChevronUpIcon.tsx
|
|
2146
|
-
import { jsx as
|
|
1050
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2147
1051
|
var ChevronUpIcon = () => {
|
|
2148
|
-
return /* @__PURE__ */
|
|
2149
|
-
"
|
|
1052
|
+
return /* @__PURE__ */ jsx8("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: /* @__PURE__ */ jsx8(
|
|
1053
|
+
"path",
|
|
2150
1054
|
{
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2154
|
-
viewBox: "0 0 512 512",
|
|
2155
|
-
children: /* @__PURE__ */ jsx7(
|
|
2156
|
-
"path",
|
|
2157
|
-
{
|
|
2158
|
-
fill: "currentColor",
|
|
2159
|
-
d: "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"
|
|
2160
|
-
}
|
|
2161
|
-
)
|
|
1055
|
+
fill: "currentColor",
|
|
1056
|
+
d: "M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"
|
|
2162
1057
|
}
|
|
2163
|
-
);
|
|
1058
|
+
) });
|
|
2164
1059
|
};
|
|
2165
1060
|
|
|
2166
1061
|
// src/components/icons/CircularProgressIcon.tsx
|
|
2167
|
-
import { jsx as
|
|
1062
|
+
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2168
1063
|
var CircularProgressIcon = () => {
|
|
2169
1064
|
return /* @__PURE__ */ jsxs2(
|
|
2170
1065
|
"svg",
|
|
2171
1066
|
{
|
|
2172
|
-
className: "animate-spin
|
|
2173
|
-
|
|
1067
|
+
className: "animate-spin-slow text-white",
|
|
1068
|
+
width: "33",
|
|
1069
|
+
height: "33",
|
|
1070
|
+
viewBox: "0 0 33 33",
|
|
2174
1071
|
fill: "none",
|
|
2175
|
-
|
|
1072
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2176
1073
|
children: [
|
|
2177
|
-
/* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ jsx9(
|
|
2178
1075
|
"circle",
|
|
2179
1076
|
{
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
strokeWidth: "
|
|
1077
|
+
cx: "16.5",
|
|
1078
|
+
cy: "16.5",
|
|
1079
|
+
r: "15.5",
|
|
1080
|
+
stroke: "white",
|
|
1081
|
+
strokeOpacity: "0.2",
|
|
1082
|
+
strokeWidth: "2"
|
|
2186
1083
|
}
|
|
2187
1084
|
),
|
|
2188
|
-
/* @__PURE__ */
|
|
2189
|
-
"path",
|
|
2190
|
-
{
|
|
2191
|
-
className: "opacity-75",
|
|
2192
|
-
fill: "currentColor",
|
|
2193
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
2194
|
-
}
|
|
2195
|
-
)
|
|
1085
|
+
/* @__PURE__ */ jsx9("path", { d: "M1 16C1 7.71573 7.71573 1 16 1", stroke: "white", strokeWidth: "2" })
|
|
2196
1086
|
]
|
|
2197
1087
|
}
|
|
2198
1088
|
);
|
|
2199
1089
|
};
|
|
2200
1090
|
|
|
2201
1091
|
// src/components/icons/CoinsIcon.tsx
|
|
2202
|
-
import { jsx as
|
|
1092
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2203
1093
|
var CoinsIcon = () => {
|
|
2204
|
-
return /* @__PURE__ */
|
|
1094
|
+
return /* @__PURE__ */ jsx10(
|
|
2205
1095
|
"svg",
|
|
2206
1096
|
{
|
|
2207
1097
|
width: "24",
|
|
@@ -2209,7 +1099,7 @@ var CoinsIcon = () => {
|
|
|
2209
1099
|
viewBox: "0 0 24 24",
|
|
2210
1100
|
fill: "none",
|
|
2211
1101
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2212
|
-
children: /* @__PURE__ */
|
|
1102
|
+
children: /* @__PURE__ */ jsx10(
|
|
2213
1103
|
"path",
|
|
2214
1104
|
{
|
|
2215
1105
|
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",
|
|
@@ -2222,9 +1112,9 @@ var CoinsIcon = () => {
|
|
|
2222
1112
|
};
|
|
2223
1113
|
|
|
2224
1114
|
// src/components/icons/DownArrorIcon.tsx
|
|
2225
|
-
import { jsx as
|
|
1115
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2226
1116
|
var DownArrowIcon = () => {
|
|
2227
|
-
return /* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ jsx11(
|
|
2228
1118
|
"svg",
|
|
2229
1119
|
{
|
|
2230
1120
|
width: 16,
|
|
@@ -2232,7 +1122,7 @@ var DownArrowIcon = () => {
|
|
|
2232
1122
|
viewBox: "0 0 16 16",
|
|
2233
1123
|
fill: "none",
|
|
2234
1124
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2235
|
-
children: /* @__PURE__ */
|
|
1125
|
+
children: /* @__PURE__ */ jsx11(
|
|
2236
1126
|
"path",
|
|
2237
1127
|
{
|
|
2238
1128
|
d: "M8.00008 9.76921L5.06421 6.83334H10.9359L8.00008 9.76921Z",
|
|
@@ -2245,9 +1135,9 @@ var DownArrowIcon = () => {
|
|
|
2245
1135
|
};
|
|
2246
1136
|
|
|
2247
1137
|
// src/components/icons/HistoryIcon.tsx
|
|
2248
|
-
import { jsx as
|
|
1138
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2249
1139
|
var HistoryIcon = () => {
|
|
2250
|
-
return /* @__PURE__ */
|
|
1140
|
+
return /* @__PURE__ */ jsx12(
|
|
2251
1141
|
"svg",
|
|
2252
1142
|
{
|
|
2253
1143
|
width: "20",
|
|
@@ -2255,7 +1145,7 @@ var HistoryIcon = () => {
|
|
|
2255
1145
|
viewBox: "0 0 20 20",
|
|
2256
1146
|
fill: "none",
|
|
2257
1147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2258
|
-
children: /* @__PURE__ */
|
|
1148
|
+
children: /* @__PURE__ */ jsx12(
|
|
2259
1149
|
"path",
|
|
2260
1150
|
{
|
|
2261
1151
|
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",
|
|
@@ -2267,23 +1157,12 @@ var HistoryIcon = () => {
|
|
|
2267
1157
|
};
|
|
2268
1158
|
|
|
2269
1159
|
// src/components/icons/HourGlassIcon.tsx
|
|
2270
|
-
import { jsx as
|
|
2271
|
-
var HourGlassIcon = () => {
|
|
2272
|
-
return /* @__PURE__ */ jsx12(
|
|
2273
|
-
"svg",
|
|
2274
|
-
{
|
|
2275
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2276
|
-
viewBox: "0 0 384 512",
|
|
2277
|
-
fill: "currentColor",
|
|
2278
|
-
children: /* @__PURE__ */ jsx12("path", { d: "M0 32C0 14.3 14.3 0 32 0H64 320h32c17.7 0 32 14.3 32 32s-14.3 32-32 32V75c0 42.4-16.9 83.1-46.9 113.1L237.3 256l67.9 67.9c30 30 46.9 70.7 46.9 113.1v11c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 64 32c-17.7 0-32-14.3-32-32s14.3-32 32-32V437c0-42.4 16.9-83.1 46.9-113.1L146.7 256 78.9 188.1C48.9 158.1 32 117.4 32 75V64C14.3 64 0 49.7 0 32zM96 64V75c0 25.5 10.1 49.9 28.1 67.9L192 210.7l67.9-67.9c18-18 28.1-42.4 28.1-67.9V64H96zm0 384H288V437c0-25.5-10.1-49.9-28.1-67.9L192 301.3l-67.9 67.9c-18 18-28.1 42.4-28.1 67.9v11z" })
|
|
2279
|
-
}
|
|
2280
|
-
);
|
|
2281
|
-
};
|
|
1160
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2282
1161
|
|
|
2283
1162
|
// src/components/icons/SearchIcon.tsx
|
|
2284
|
-
import { jsx as
|
|
1163
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2285
1164
|
var SearchIcon = () => {
|
|
2286
|
-
return /* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ jsx14(
|
|
2287
1166
|
"svg",
|
|
2288
1167
|
{
|
|
2289
1168
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2291,27 +1170,16 @@ var SearchIcon = () => {
|
|
|
2291
1170
|
width: "24",
|
|
2292
1171
|
viewBox: "0 -960 960 960",
|
|
2293
1172
|
fill: "#ffffffc0",
|
|
2294
|
-
children: /* @__PURE__ */
|
|
1173
|
+
children: /* @__PURE__ */ jsx14("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" })
|
|
2295
1174
|
}
|
|
2296
1175
|
);
|
|
2297
1176
|
};
|
|
2298
1177
|
|
|
2299
1178
|
// src/components/icons/XMarkIcon.tsx
|
|
2300
|
-
import { jsx as
|
|
2301
|
-
var XMarkIcon = () => {
|
|
2302
|
-
return /* @__PURE__ */ jsx14(
|
|
2303
|
-
"svg",
|
|
2304
|
-
{
|
|
2305
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2306
|
-
viewBox: "0 0 384 512",
|
|
2307
|
-
fill: "current",
|
|
2308
|
-
children: /* @__PURE__ */ jsx14("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z" })
|
|
2309
|
-
}
|
|
2310
|
-
);
|
|
2311
|
-
};
|
|
1179
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2312
1180
|
|
|
2313
1181
|
// src/components/icons/PercentageIcon.tsx
|
|
2314
|
-
import { jsx as
|
|
1182
|
+
import { jsx as jsx16, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2315
1183
|
var PercentageIcon = () => {
|
|
2316
1184
|
return /* @__PURE__ */ jsxs3(
|
|
2317
1185
|
"svg",
|
|
@@ -2322,14 +1190,14 @@ var PercentageIcon = () => {
|
|
|
2322
1190
|
fill: "none",
|
|
2323
1191
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2324
1192
|
children: [
|
|
2325
|
-
/* @__PURE__ */
|
|
1193
|
+
/* @__PURE__ */ jsx16(
|
|
2326
1194
|
"path",
|
|
2327
1195
|
{
|
|
2328
1196
|
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",
|
|
2329
1197
|
fill: "url(#paint0_linear_32_1164)"
|
|
2330
1198
|
}
|
|
2331
1199
|
),
|
|
2332
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ jsx16("defs", { children: /* @__PURE__ */ jsxs3(
|
|
2333
1201
|
"linearGradient",
|
|
2334
1202
|
{
|
|
2335
1203
|
id: "paint0_linear_32_1164",
|
|
@@ -2339,8 +1207,8 @@ var PercentageIcon = () => {
|
|
|
2339
1207
|
y2: "1.31767",
|
|
2340
1208
|
gradientUnits: "userSpaceOnUse",
|
|
2341
1209
|
children: [
|
|
2342
|
-
/* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsx16("stop", { stopColor: "#3681C6" }),
|
|
1211
|
+
/* @__PURE__ */ jsx16("stop", { offset: "1", stopColor: "#2B4A9D" })
|
|
2344
1212
|
]
|
|
2345
1213
|
}
|
|
2346
1214
|
) })
|
|
@@ -2350,9 +1218,9 @@ var PercentageIcon = () => {
|
|
|
2350
1218
|
};
|
|
2351
1219
|
|
|
2352
1220
|
// src/components/icons/TimerIcon.tsx
|
|
2353
|
-
import { jsx as
|
|
1221
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2354
1222
|
var TimerIcon = () => {
|
|
2355
|
-
return /* @__PURE__ */
|
|
1223
|
+
return /* @__PURE__ */ jsx17(
|
|
2356
1224
|
"svg",
|
|
2357
1225
|
{
|
|
2358
1226
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2360,15 +1228,15 @@ var TimerIcon = () => {
|
|
|
2360
1228
|
viewBox: "0 -960 960 960",
|
|
2361
1229
|
width: "16",
|
|
2362
1230
|
fill: "currentColor",
|
|
2363
|
-
children: /* @__PURE__ */
|
|
1231
|
+
children: /* @__PURE__ */ jsx17("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" })
|
|
2364
1232
|
}
|
|
2365
1233
|
);
|
|
2366
1234
|
};
|
|
2367
1235
|
|
|
2368
1236
|
// src/components/icons/InfoIcon.tsx
|
|
2369
|
-
import { jsx as
|
|
1237
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2370
1238
|
var InfoIcon = () => {
|
|
2371
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ jsx18(
|
|
2372
1240
|
"svg",
|
|
2373
1241
|
{
|
|
2374
1242
|
width: "28",
|
|
@@ -2376,15 +1244,15 @@ var InfoIcon = () => {
|
|
|
2376
1244
|
viewBox: "0 0 28 28",
|
|
2377
1245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2378
1246
|
fill: "currentColor",
|
|
2379
|
-
children: /* @__PURE__ */
|
|
1247
|
+
children: /* @__PURE__ */ jsx18("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" })
|
|
2380
1248
|
}
|
|
2381
1249
|
);
|
|
2382
1250
|
};
|
|
2383
1251
|
|
|
2384
1252
|
// src/components/icons/SettingsIcon.tsx
|
|
2385
|
-
import { jsx as
|
|
1253
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2386
1254
|
var SettingsIcon = () => {
|
|
2387
|
-
return /* @__PURE__ */
|
|
1255
|
+
return /* @__PURE__ */ jsx19(
|
|
2388
1256
|
"svg",
|
|
2389
1257
|
{
|
|
2390
1258
|
width: "18",
|
|
@@ -2392,7 +1260,7 @@ var SettingsIcon = () => {
|
|
|
2392
1260
|
viewBox: "0 0 18 18",
|
|
2393
1261
|
fill: "none",
|
|
2394
1262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2395
|
-
children: /* @__PURE__ */
|
|
1263
|
+
children: /* @__PURE__ */ jsx19(
|
|
2396
1264
|
"path",
|
|
2397
1265
|
{
|
|
2398
1266
|
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",
|
|
@@ -2404,7 +1272,7 @@ var SettingsIcon = () => {
|
|
|
2404
1272
|
};
|
|
2405
1273
|
|
|
2406
1274
|
// src/components/icons/XSwapBadgeIcon.tsx
|
|
2407
|
-
import { jsx as
|
|
1275
|
+
import { jsx as jsx20, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2408
1276
|
var XSwapBadgeIcon = () => {
|
|
2409
1277
|
return /* @__PURE__ */ jsxs4(
|
|
2410
1278
|
"svg",
|
|
@@ -2415,8 +1283,8 @@ var XSwapBadgeIcon = () => {
|
|
|
2415
1283
|
width: "80",
|
|
2416
1284
|
height: "27",
|
|
2417
1285
|
children: [
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ jsx20("title", { children: "xswap-badge" }),
|
|
1287
|
+
/* @__PURE__ */ jsx20("defs", { children: /* @__PURE__ */ jsx20(
|
|
2420
1288
|
"image",
|
|
2421
1289
|
{
|
|
2422
1290
|
width: "80",
|
|
@@ -2425,15 +1293,15 @@ var XSwapBadgeIcon = () => {
|
|
|
2425
1293
|
href: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAaCAYAAAAg0tunAAAAAXNSR0IB2cksfwAADFhJREFUeJzlWAl4VNUVPgnJZDKZ7MlMkskyJJNMkkkyk2QmC5N9mRASYhIISQiaBKKkhB0CskQMQYiAsmmDgIJiAXEB7Ve0Iq1rldqqrbWt1KVatbUqVtSqFTg9J+8OeRkGwX6tn3w93/fPm3fvO/fd+9+z3Qetax4CxMlQjQjW5U+Addnjw7hk8fAA+8aXIbZ1LeT0PQk5/c8ATHwUUiq6IH/SAiidtvzSx7ocpX3HK56xjkVE3uNgYwL6noLkzl0QkNYAKoMDshY94lYvrWPX8FWb3wWGqZshb81xyF3zHNiufwaiS3vA3DLgWdjQ41Ezve+7XM53L5a6RbXGaUOrclY+tdrW91S/beWTC1Nm7M5RGSoD1Mk1wyRm9x4dpWNqvgXAPxH8jTWgye0Mi2+6Mc/a97OluWuOryHckHr17sG06tnVd6xb4dHaMzCsg2Thl4rLSizFU3SRuW2H45s2Yva1x9C24kk0zz70cUTRnL3qlNrQ4IxGgLBxsPOuh4afX7b6VvrVgtZ6JUQWdBsiCmc9lj774Mnc1c9izvVPo2HaVowed9WRrLKpusRxzcM6LgR5EnwJwYRQQiBBQfC4LEmMSasAQ1phjL9+3DFN4Sw09xxG64KjmNi0DUMyr9yjzZ4crLFMAoW+DGYt6B9enNowEaJzOnTh1vaHjS23Ytbin6Jl4U9QN34ZBhlKjtF4cbEZDojMqJETxwSFExyE6wi7CQcI2wmzCRkE5eVHorcewhLskJRVZfSLtj0fmNqIifWbMeOqe1FftfZsVHbb/UWNP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G6SnLpHLKuVPfkCfHUWEARPQ4UunxQhlrBG8LP9cWXL4bo8Yu90nsPgWne/guO8X0QGSl8Jnaepe9wEnhR8TM2AwQkklWlDRMmx8VEETMOlKUd4BOZB6qECgi2tYG2tAc0xd0Q37ph2PpM8w/8F5b5vxMZgXxqOY5SmbXxkgn8fxcZgVw/8vEsC6Xvk5dE4L8BBYs8HFbmQE4AAAAASUVORK5CYII="
|
|
2426
1294
|
}
|
|
2427
1295
|
) }),
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ jsx20("style", {}),
|
|
1297
|
+
/* @__PURE__ */ jsx20("use", { id: "Background", href: "#img1iVBORw0KGgoAAAANSUhEUgAAAF", x: "0", y: "1" })
|
|
2430
1298
|
]
|
|
2431
1299
|
}
|
|
2432
1300
|
);
|
|
2433
1301
|
};
|
|
2434
1302
|
|
|
2435
1303
|
// src/components/icons/ChainlinkCCIPIcon.tsx
|
|
2436
|
-
import { jsx as
|
|
1304
|
+
import { jsx as jsx21, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2437
1305
|
var ChainlinkCCIPIcon = () => {
|
|
2438
1306
|
return /* @__PURE__ */ jsxs5(
|
|
2439
1307
|
"svg",
|
|
@@ -2444,8 +1312,8 @@ var ChainlinkCCIPIcon = () => {
|
|
|
2444
1312
|
width: "67",
|
|
2445
1313
|
height: "27",
|
|
2446
1314
|
children: [
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
1315
|
+
/* @__PURE__ */ jsx21("title", { children: "chainlink-CCIP" }),
|
|
1316
|
+
/* @__PURE__ */ jsx21("defs", { children: /* @__PURE__ */ jsx21(
|
|
2449
1317
|
"image",
|
|
2450
1318
|
{
|
|
2451
1319
|
width: "67",
|
|
@@ -2454,20 +1322,42 @@ var ChainlinkCCIPIcon = () => {
|
|
|
2454
1322
|
href: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA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xzRYZKf08s3azz7V3xv3E/xw3DxylPobgzJ1SNPhVzX6rCu0fF3BbryHtFFh+bDRA8lqqZ08Istmv/fbjJQKBI1ySElaGeDjolgpBM8QWnJ6PY4Byo1J3oX7n4ifGkl+s8TFkfMjkzWzFzJP9/dXP+/1rU/0r5Dy2/8Z6sDkzgAAAAAElFTkSuQmCC"
|
|
2455
1323
|
}
|
|
2456
1324
|
) }),
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ jsx21("style", {}),
|
|
1326
|
+
/* @__PURE__ */ jsx21("use", { id: "Background", href: "#imgiVBORw0KGgoAAA", x: "0", y: "0" })
|
|
2459
1327
|
]
|
|
2460
1328
|
}
|
|
2461
1329
|
);
|
|
2462
1330
|
};
|
|
2463
1331
|
|
|
1332
|
+
// src/components/icons/XSwapLogo.tsx
|
|
1333
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1334
|
+
var XSwapLogo = () => {
|
|
1335
|
+
return /* @__PURE__ */ jsx22(
|
|
1336
|
+
"svg",
|
|
1337
|
+
{
|
|
1338
|
+
version: "1.1",
|
|
1339
|
+
id: "Layer_1",
|
|
1340
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1341
|
+
x: "0px",
|
|
1342
|
+
y: "0px",
|
|
1343
|
+
viewBox: "0 0 50 50",
|
|
1344
|
+
enableBackground: "new 0 0 50 50",
|
|
1345
|
+
children: /* @__PURE__ */ jsx22(
|
|
1346
|
+
"image",
|
|
1347
|
+
{
|
|
1348
|
+
id: "image0",
|
|
1349
|
+
x: "0",
|
|
1350
|
+
y: "0",
|
|
1351
|
+
href: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAQ\nrElEQV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SDOc2IYTLQRBy4eWTKK5oPi8\nIbphaqu0O/EEkrkGBicvC4SDcwqms76CYFO16JU17ccJo2esrd39bn03iBGXtcA05FPCdGD72wAZ\nnuik2Z3UwnCBNAiE2pBa3qQbD26+YBAnrbNmr4xK8wpDThAKwhdiuoIjum4saQg0VdFRVSxiR01e\n1Dvjyhfr9n3QKeidNdbriv5UW0HTDvjCg6cQ3XkhpIkQZhdEKyj1O9V06NELDnGauQdc8YYI6RsI\n+tHaDt+BgfDlGm2DttBa4/DGMuCH953whNoGi6isW570Vx/IE8K2bFvZCKFspI1QCiFtbGWDUgih\nEEYyDQde+0pTfR+Wmen0BJLu0r6ONsMwNA4n0jC0MEyNMBVG+JhcW37DNCMzk6fe0P6/6ZaOfwAl\nLqsAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMDUtMjdUMTE6NTQ6MjkrMDA6MDCo6mafAAAAJXRF\nWHRkYXRlOm1vZGlmeQAyMDI0LTA1LTI3VDExOjU0OjI5KzAwOjAw2bfeIwAAAABJRU5ErkJggg=="
|
|
1352
|
+
}
|
|
1353
|
+
)
|
|
1354
|
+
}
|
|
1355
|
+
);
|
|
1356
|
+
};
|
|
1357
|
+
|
|
2464
1358
|
// src/components/TxConfigForm/HistoryCard.tsx
|
|
2465
|
-
import { Fragment, jsx as
|
|
1359
|
+
import { Fragment, jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2466
1360
|
var HistoryCard = ({ transaction, supportedChains }) => {
|
|
2467
|
-
const getDate = useCallback((blockTimestamp) => {
|
|
2468
|
-
const date2 = new Date(blockTimestamp * 1e3);
|
|
2469
|
-
return format(date2, "d MMM yyyy HH:mm:ss");
|
|
2470
|
-
}, []);
|
|
2471
1361
|
const date = getDate(transaction.timestamp);
|
|
2472
1362
|
const supportedTokens = useMemo(() => {
|
|
2473
1363
|
const customTokens = JSON.parse(
|
|
@@ -2512,23 +1402,14 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
2512
1402
|
const targetChainData = supportedChains.find(
|
|
2513
1403
|
(chain) => chain.chainId === transaction.targetChainId
|
|
2514
1404
|
);
|
|
2515
|
-
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col
|
|
2516
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex
|
|
2519
|
-
transaction.status === "IN_PROGRESS" && /* @__PURE__ */
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
transaction.status === "DONE" && /* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2524
|
-
/* @__PURE__ */ jsx21("div", { className: "w-3.5 h-3.5 mr-1 text-[rgb(100,200,100)]", children: /* @__PURE__ */ jsx21(CheckIcon, {}) }),
|
|
2525
|
-
/* @__PURE__ */ jsx21("div", { className: "text-xs text-[rgb(100,200,100)]", children: "Done" })
|
|
2526
|
-
] }),
|
|
2527
|
-
transaction.status === "REVERTED" && /* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2528
|
-
/* @__PURE__ */ jsx21("div", { className: "w-4 h-4 mr-1 text-[rgb(255,100,100)]", children: /* @__PURE__ */ jsx21(XMarkIcon, {}) }),
|
|
2529
|
-
/* @__PURE__ */ jsx21("div", { className: "text-xs text-[rgb(255,100,100)]", children: "Reverted" })
|
|
2530
|
-
] }),
|
|
2531
|
-
/* @__PURE__ */ jsx21(
|
|
1405
|
+
return /* @__PURE__ */ jsxs6("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: [
|
|
1406
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex w-full items-center justify-between", children: [
|
|
1407
|
+
/* @__PURE__ */ jsx23("div", { className: "text-sm sm:text-base", children: date }),
|
|
1408
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
1409
|
+
transaction.status === "IN_PROGRESS" && /* @__PURE__ */ jsx23("div", { className: "flex items-center", children: /* @__PURE__ */ jsx23("div", { className: "text-[rgb(250,200,100)]", children: "In progress" }) }),
|
|
1410
|
+
transaction.status === "DONE" && /* @__PURE__ */ jsx23("div", { className: "flex items-center", children: /* @__PURE__ */ jsx23("div", { className: "text-[rgb(100,200,100)]", children: "Done" }) }),
|
|
1411
|
+
transaction.status === "REVERTED" && /* @__PURE__ */ jsx23("div", { className: "flex items-center", children: /* @__PURE__ */ jsx23("div", { className: "text-[rgb(255,100,100)]", children: "Reverted" }) }),
|
|
1412
|
+
/* @__PURE__ */ jsx23(
|
|
2532
1413
|
"a",
|
|
2533
1414
|
{
|
|
2534
1415
|
href: `${supportedChains.find(
|
|
@@ -2538,15 +1419,15 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
2538
1419
|
rel: "noreferrer",
|
|
2539
1420
|
className: "ml-2 no-underline",
|
|
2540
1421
|
"aria-label": "Show the transaction in the chain explorer",
|
|
2541
|
-
children: /* @__PURE__ */
|
|
1422
|
+
children: /* @__PURE__ */ jsx23("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ jsx23(ArrowUpRightIcon, {}) })
|
|
2542
1423
|
}
|
|
2543
1424
|
)
|
|
2544
1425
|
] })
|
|
2545
1426
|
] }),
|
|
2546
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap gap-
|
|
2547
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex
|
|
1427
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex justify-between flex-wrap gap-2", children: [
|
|
1428
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2548
1429
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2549
|
-
/* @__PURE__ */
|
|
1430
|
+
/* @__PURE__ */ jsx23(
|
|
2550
1431
|
"img",
|
|
2551
1432
|
{
|
|
2552
1433
|
src: sourceChainData?.image,
|
|
@@ -2554,11 +1435,11 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
2554
1435
|
className: "w-5 h-5 mr-1"
|
|
2555
1436
|
}
|
|
2556
1437
|
),
|
|
2557
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ jsx23("div", { children: sourceChainData?.displayName })
|
|
2558
1439
|
] }),
|
|
2559
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ jsx23("div", { className: "w-3.5 h-3.5 my-0 mx-1.5", children: /* @__PURE__ */ jsx23(ArrowRightIcon, {}) }),
|
|
2560
1441
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2561
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ jsx23(
|
|
2562
1443
|
"img",
|
|
2563
1444
|
{
|
|
2564
1445
|
src: targetChainData?.image,
|
|
@@ -2566,35 +1447,35 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
2566
1447
|
className: "w-5 h-5 mr-1"
|
|
2567
1448
|
}
|
|
2568
1449
|
),
|
|
2569
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ jsx23("div", { children: targetChainData?.displayName })
|
|
2570
1451
|
] })
|
|
2571
1452
|
] }),
|
|
2572
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ jsx23("div", { className: "flex items-center mb-2 last:mb-0", children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center flex-wrap", children: [
|
|
2573
1454
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2574
1455
|
Number(transferredAmount) < MINIMUM_DISPLAYED_TOKEN_AMOUNT ? `<${MINIMUM_DISPLAYED_TOKEN_AMOUNT}` : transferredAmount,
|
|
2575
|
-
/* @__PURE__ */
|
|
2576
|
-
tokenData?.image ? /* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ jsx23("div", { className: "ml-1", children: tokenData?.symbol }),
|
|
1457
|
+
tokenData?.image ? /* @__PURE__ */ jsx23(
|
|
2577
1458
|
"img",
|
|
2578
1459
|
{
|
|
2579
1460
|
src: tokenData?.image,
|
|
2580
1461
|
alt: tokenData?.name || "",
|
|
2581
1462
|
className: "w-5 h-5 ml-1"
|
|
2582
1463
|
}
|
|
2583
|
-
) : /* @__PURE__ */
|
|
1464
|
+
) : /* @__PURE__ */ jsx23("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) })
|
|
2584
1465
|
] }),
|
|
2585
1466
|
transaction.tokenOutAddress && /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
2586
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ jsx23("div", { className: "w-3.5 h-3.5 my-0 mx-1.5", children: /* @__PURE__ */ jsx23(ArrowRightIcon, {}) }),
|
|
2587
1468
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center", children: [
|
|
2588
1469
|
Number(receivedAmount) < 1e-4 ? "<0.0001" : receivedAmount,
|
|
2589
|
-
/* @__PURE__ */
|
|
2590
|
-
tokenOutData?.image ? /* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ jsx23("div", { className: "ml-1", children: tokenOutData?.symbol }),
|
|
1471
|
+
tokenOutData?.image ? /* @__PURE__ */ jsx23(
|
|
2591
1472
|
"img",
|
|
2592
1473
|
{
|
|
2593
1474
|
src: tokenOutData?.image,
|
|
2594
1475
|
alt: tokenOutData?.name || "",
|
|
2595
1476
|
className: "w-5 h-5 ml-1"
|
|
2596
1477
|
}
|
|
2597
|
-
) : /* @__PURE__ */
|
|
1478
|
+
) : /* @__PURE__ */ jsx23("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) })
|
|
2598
1479
|
] })
|
|
2599
1480
|
] })
|
|
2600
1481
|
] }) })
|
|
@@ -2603,7 +1484,7 @@ var HistoryCard = ({ transaction, supportedChains }) => {
|
|
|
2603
1484
|
};
|
|
2604
1485
|
|
|
2605
1486
|
// src/components/TxConfigForm/History.tsx
|
|
2606
|
-
import { jsx as
|
|
1487
|
+
import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2607
1488
|
var History = ({ signer, supportedChains }) => {
|
|
2608
1489
|
const [fetchedHistory, setFetchedHistory] = useState2();
|
|
2609
1490
|
const [historyLoadedOnce, setHistoryLoadedOnce] = useState2(false);
|
|
@@ -2657,11 +1538,11 @@ var History = ({ signer, supportedChains }) => {
|
|
|
2657
1538
|
return () => clearInterval(timer);
|
|
2658
1539
|
}, [signer, fetchHistory, getHistory, historyLoadedOnce]);
|
|
2659
1540
|
if (!signer)
|
|
2660
|
-
return /* @__PURE__ */
|
|
2661
|
-
return /* @__PURE__ */
|
|
2662
|
-
fetchedHistory?.length === 0 && historyLoadedOnce && /* @__PURE__ */
|
|
2663
|
-
!fetchedHistory && !historyLoadedOnce && /* @__PURE__ */
|
|
2664
|
-
fetchedHistory?.map((transaction, index) => /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ jsx24("div", { className: "flex items-center justify-center w-full h-[30vh]", children: "Connect a wallet to browse history" });
|
|
1542
|
+
return /* @__PURE__ */ jsx24("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsxs7("div", { className: "w-full h-96 overflow-scroll overflow-x-hidden", children: [
|
|
1543
|
+
fetchedHistory?.length === 0 && historyLoadedOnce && /* @__PURE__ */ jsx24("div", { className: "w-full text-center py-4 px-0 text-[rgb(158,158,158)]", children: "Your history is empty..." }),
|
|
1544
|
+
!fetchedHistory && !historyLoadedOnce && /* @__PURE__ */ jsx24("div", { className: "flex w-full h-full items-center justify-center", children: /* @__PURE__ */ jsx24(CircularProgressIcon, {}) }),
|
|
1545
|
+
fetchedHistory?.map((transaction, index) => /* @__PURE__ */ jsx24(
|
|
2665
1546
|
HistoryCard,
|
|
2666
1547
|
{
|
|
2667
1548
|
transaction,
|
|
@@ -2673,30 +1554,30 @@ var History = ({ signer, supportedChains }) => {
|
|
|
2673
1554
|
};
|
|
2674
1555
|
|
|
2675
1556
|
// src/components/TxConfigForm/TopBar.tsx
|
|
2676
|
-
import { Fragment as Fragment2, jsx as
|
|
1557
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2677
1558
|
var TopBar = ({
|
|
2678
1559
|
signer,
|
|
2679
1560
|
setSettingsShown,
|
|
2680
1561
|
setHistoryTabShown,
|
|
2681
1562
|
historyTabShown
|
|
2682
1563
|
}) => {
|
|
2683
|
-
return /* @__PURE__ */ jsxs8("div", { className: "flex w-full justify-between mx-auto pl-4 pr-8 pt-2", children: [
|
|
2684
|
-
/* @__PURE__ */
|
|
1564
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex w-full justify-between items-center mx-auto sm:pl-4 pr-8 pt-2", children: [
|
|
1565
|
+
/* @__PURE__ */ jsx25("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` }),
|
|
2685
1566
|
/* @__PURE__ */ jsxs8("div", { className: "flex gap-2", children: [
|
|
2686
|
-
!historyTabShown && /* @__PURE__ */
|
|
1567
|
+
!historyTabShown && /* @__PURE__ */ jsx25(
|
|
2687
1568
|
"div",
|
|
2688
1569
|
{
|
|
2689
1570
|
onClick: () => setSettingsShown(true),
|
|
2690
1571
|
className: "flex items-center text-xs gap-1 cursor-pointer",
|
|
2691
|
-
children: /* @__PURE__ */
|
|
1572
|
+
children: /* @__PURE__ */ jsx25("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__ */ jsx25(SettingsIcon, {}) })
|
|
2692
1573
|
}
|
|
2693
1574
|
),
|
|
2694
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ jsx25(
|
|
2695
1576
|
"div",
|
|
2696
1577
|
{
|
|
2697
1578
|
onClick: () => setHistoryTabShown((x) => !x),
|
|
2698
1579
|
className: "flex items-center text-sm gap-1 cursor-pointer",
|
|
2699
|
-
children: !historyTabShown ? /* @__PURE__ */
|
|
1580
|
+
children: !historyTabShown ? /* @__PURE__ */ jsx25(Fragment2, { children: /* @__PURE__ */ jsx25("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__ */ jsx25(HistoryIcon, {}) }) }) : /* @__PURE__ */ jsx25("div", { children: "Back" })
|
|
2700
1581
|
}
|
|
2701
1582
|
)
|
|
2702
1583
|
] })
|
|
@@ -2705,7 +1586,7 @@ var TopBar = ({
|
|
|
2705
1586
|
|
|
2706
1587
|
// src/components/TxConfigForm/Settings.tsx
|
|
2707
1588
|
import { useState as useState3, useEffect as useEffect3 } from "react";
|
|
2708
|
-
import { jsx as
|
|
1589
|
+
import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2709
1590
|
var Settings = ({
|
|
2710
1591
|
setSlippage,
|
|
2711
1592
|
setSettingsShown,
|
|
@@ -2722,22 +1603,22 @@ var Settings = ({
|
|
|
2722
1603
|
);
|
|
2723
1604
|
}
|
|
2724
1605
|
}, [slippageActivePresetIndex, usingSlippageInput]);
|
|
2725
|
-
return /* @__PURE__ */
|
|
1606
|
+
return /* @__PURE__ */ jsx26("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__ */ jsxs9("div", { className: "flex flex-col gap-4 justify-between", children: [
|
|
2726
1607
|
/* @__PURE__ */ jsxs9("div", { className: "flex justify-between", children: [
|
|
2727
|
-
/* @__PURE__ */
|
|
2728
|
-
/* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ jsx26("div", { className: "text-base", children: "Settings" }),
|
|
1609
|
+
/* @__PURE__ */ jsx26(
|
|
2729
1610
|
"div",
|
|
2730
1611
|
{
|
|
2731
1612
|
className: "cursor-pointer",
|
|
2732
1613
|
onClick: () => setSettingsShown(false),
|
|
2733
|
-
children: /* @__PURE__ */
|
|
1614
|
+
children: /* @__PURE__ */ jsx26(CloseIcon, {})
|
|
2734
1615
|
}
|
|
2735
1616
|
)
|
|
2736
1617
|
] }),
|
|
2737
1618
|
/* @__PURE__ */ jsxs9("div", { children: [
|
|
2738
1619
|
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2 items-center", children: [
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
1620
|
+
/* @__PURE__ */ jsx26("div", { className: "text-sm text-[rgba(255,255,255,0.6)]", children: "Express delivery" }),
|
|
1621
|
+
/* @__PURE__ */ jsx26("div", { children: /* @__PURE__ */ jsxs9(
|
|
2741
1622
|
"span",
|
|
2742
1623
|
{
|
|
2743
1624
|
className: "inline-flex w-14 h-9 p-3 relative align-middle box-border overflow-hidden cursor-pointer",
|
|
@@ -2745,8 +1626,8 @@ var Settings = ({
|
|
|
2745
1626
|
setExpressChecked((x) => !x);
|
|
2746
1627
|
},
|
|
2747
1628
|
children: [
|
|
2748
|
-
/* @__PURE__ */
|
|
2749
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ jsx26("span", { className: "h-full, w-full rounded-lg bg-[rgba(255,255,255,0.3)]" }),
|
|
1630
|
+
/* @__PURE__ */ jsx26(
|
|
2750
1631
|
"span",
|
|
2751
1632
|
{
|
|
2752
1633
|
className: `transition-all w-5 h-5 rounded-full absolute translate-y-[-4px]
|
|
@@ -2758,14 +1639,14 @@ var Settings = ({
|
|
|
2758
1639
|
) })
|
|
2759
1640
|
] }),
|
|
2760
1641
|
/* @__PURE__ */ jsxs9("div", { className: "flex gap-4", children: [
|
|
2761
|
-
/* @__PURE__ */
|
|
2762
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ jsx26("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ jsx26(InfoIcon, {}) }),
|
|
1643
|
+
/* @__PURE__ */ jsx26("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." })
|
|
2763
1644
|
] })
|
|
2764
1645
|
] }),
|
|
2765
1646
|
/* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-2 ", children: [
|
|
2766
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ jsx26("div", { className: " text-[rgba(255,255,255,0.6)] text-sm", children: "Slippage" }),
|
|
2767
1648
|
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2", children: [
|
|
2768
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ jsx26("div", { className: "flex items-center bg-[rgba(15,15,15,1)] p-1 globalBorder rounded-xl", children: SLIPPAGE_PRESETS.map((preset, index) => /* @__PURE__ */ jsx26(
|
|
2769
1650
|
"div",
|
|
2770
1651
|
{
|
|
2771
1652
|
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]" : ""}`,
|
|
@@ -2778,7 +1659,7 @@ var Settings = ({
|
|
|
2778
1659
|
index
|
|
2779
1660
|
)) }),
|
|
2780
1661
|
/* @__PURE__ */ jsxs9("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: [
|
|
2781
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ jsx26(
|
|
2782
1663
|
"input",
|
|
2783
1664
|
{
|
|
2784
1665
|
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",
|
|
@@ -2797,16 +1678,16 @@ var Settings = ({
|
|
|
2797
1678
|
}
|
|
2798
1679
|
}
|
|
2799
1680
|
),
|
|
2800
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsx26(PercentageIcon, {})
|
|
2801
1682
|
] })
|
|
2802
1683
|
] }),
|
|
2803
1684
|
/* @__PURE__ */ jsxs9("div", { className: "flex gap-4", children: [
|
|
2804
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx26("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ jsx26(InfoIcon, {}) }),
|
|
2805
1686
|
/* @__PURE__ */ jsxs9("div", { className: "text-xs text-left", children: [
|
|
2806
1687
|
"Slippage is the price variation you are willing to accept in the event that the price of the trade changes while it is processing.",
|
|
2807
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx26("br", {}),
|
|
2808
1689
|
" ",
|
|
2809
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ jsx26("br", {}),
|
|
2810
1691
|
"If the trade fails due to too-low slippage, you will receive USDC on the destination chain."
|
|
2811
1692
|
] })
|
|
2812
1693
|
] })
|
|
@@ -2815,7 +1696,7 @@ var Settings = ({
|
|
|
2815
1696
|
};
|
|
2816
1697
|
|
|
2817
1698
|
// src/components/TxConfigForm/FeesDetails.tsx
|
|
2818
|
-
import { jsx as
|
|
1699
|
+
import { jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2819
1700
|
var FeesDetails = ({
|
|
2820
1701
|
isGettingRoute,
|
|
2821
1702
|
route,
|
|
@@ -2827,11 +1708,11 @@ var FeesDetails = ({
|
|
|
2827
1708
|
setFeesDetailsShown
|
|
2828
1709
|
}) => {
|
|
2829
1710
|
return /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-3 globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 mb-1", children: [
|
|
2830
|
-
/* @__PURE__ */ jsxs10("div", { className: "flex w-full items-center justify-between", children: [
|
|
2831
|
-
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
isGettingRoute ? /* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex w-full items-center justify-between text-xs sm:text-sm ", children: [
|
|
1712
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1 font-medium text-white opacity-60", children: [
|
|
1713
|
+
/* @__PURE__ */ jsx27(CoinsIcon, {}),
|
|
1714
|
+
/* @__PURE__ */ jsx27("div", { className: "mr-1", children: "Fees:" }),
|
|
1715
|
+
isGettingRoute ? /* @__PURE__ */ jsx27("div", { className: "bg-current rounded animate-pulse w-20 h-4" }) : ` ${weiToHumanReadable({
|
|
2835
1716
|
amount: safeBigNumberFrom(
|
|
2836
1717
|
route?.xSwapFees.xSwapFee.nativeFee || "0"
|
|
2837
1718
|
).add(safeBigNumberFrom(route?.xSwapFees.ccipFee || "0")).add(
|
|
@@ -2841,23 +1722,23 @@ var FeesDetails = ({
|
|
|
2841
1722
|
precisionFractionalPlaces: 5
|
|
2842
1723
|
})} ${paymentToken?.symbol}`
|
|
2843
1724
|
] }),
|
|
2844
|
-
/* @__PURE__ */ jsxs10("div", { className: "flex gap-1", children: [
|
|
1725
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex gap-1 items-center", children: [
|
|
2845
1726
|
/* @__PURE__ */ jsxs10(
|
|
2846
1727
|
"div",
|
|
2847
1728
|
{
|
|
2848
|
-
className: `flex gap-1
|
|
1729
|
+
className: `flex gap-1 items-center font-medium ${expressChecked ? "text-x_green" : "text-white opacity-60"}`,
|
|
2849
1730
|
children: [
|
|
2850
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ jsx27(TimerIcon, {}),
|
|
2851
1732
|
expressChecked ? "Fast ~ 30sec " : "Normal ~ 30min"
|
|
2852
1733
|
]
|
|
2853
1734
|
}
|
|
2854
1735
|
),
|
|
2855
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ jsx27(
|
|
2856
1737
|
"div",
|
|
2857
1738
|
{
|
|
2858
1739
|
onClick: () => setFeesDetailsShown((x) => !x),
|
|
2859
|
-
className: "
|
|
2860
|
-
children: feesDetailsShown ? /* @__PURE__ */
|
|
1740
|
+
className: "font-medium text-white opacity-60 cursor-pointer flex items-center w-[15px] h-[9px]",
|
|
1741
|
+
children: feesDetailsShown ? /* @__PURE__ */ jsx27(ChevronUpIcon, {}) : /* @__PURE__ */ jsx27(ChevronDownIcon, {})
|
|
2861
1742
|
}
|
|
2862
1743
|
)
|
|
2863
1744
|
] })
|
|
@@ -2903,45 +1784,95 @@ var FeesDetails = ({
|
|
|
2903
1784
|
};
|
|
2904
1785
|
|
|
2905
1786
|
// src/components/TxConfigForm/Summary.tsx
|
|
2906
|
-
import {
|
|
1787
|
+
import { useEffect as useEffect5, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1788
|
+
|
|
1789
|
+
// src/components/TxConfigForm/UsdPrice.tsx
|
|
1790
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
1791
|
+
import { Fragment as Fragment3, jsx as jsx28 } from "react/jsx-runtime";
|
|
1792
|
+
var UsdPrice = ({
|
|
1793
|
+
prices,
|
|
1794
|
+
token,
|
|
1795
|
+
amount = "0",
|
|
1796
|
+
loading = false
|
|
1797
|
+
}) => {
|
|
1798
|
+
const [usdPrice, setUsdPrice] = useState4("0.00");
|
|
1799
|
+
useEffect4(() => {
|
|
1800
|
+
if (token && prices && prices[token.address]) {
|
|
1801
|
+
setUsdPrice((Number(amount) * Number(prices[token.address])).toFixed(2));
|
|
1802
|
+
}
|
|
1803
|
+
}, [token, prices, amount]);
|
|
1804
|
+
return /* @__PURE__ */ jsx28("div", { className: "opacity-60 py-4", children: loading ? /* @__PURE__ */ jsx28(Skeleton, { width: "w-12", height: "h-4" }) : token ? prices && prices[token.address] ? /* @__PURE__ */ jsx28("div", { children: `$${usdPrice}` }) : /* @__PURE__ */ jsx28(Alert, { desc: "Unknown price" }) : /* @__PURE__ */ jsx28(Fragment3, { children: "$0.00" }) });
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
// src/components/TxConfigForm/Summary.tsx
|
|
1808
|
+
import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2907
1809
|
var Summary = ({
|
|
2908
1810
|
isGettingRoute,
|
|
2909
|
-
amount,
|
|
2910
1811
|
route,
|
|
2911
1812
|
dstToken,
|
|
2912
1813
|
dstChain
|
|
2913
1814
|
}) => {
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
1815
|
+
const [prices, setPrices] = useState5();
|
|
1816
|
+
const amountReadable = useMemo3(
|
|
1817
|
+
() => weiToHumanReadable({
|
|
1818
|
+
amount: route?.estAmountOut || "0",
|
|
1819
|
+
decimals: dstToken?.decimals || 18,
|
|
1820
|
+
precisionFractionalPlaces: 5
|
|
1821
|
+
}),
|
|
1822
|
+
[route, dstToken]
|
|
1823
|
+
);
|
|
1824
|
+
useEffect5(() => {
|
|
1825
|
+
if (dstChain) {
|
|
1826
|
+
getPrices({ chainId: dstChain.chainId, currency: "USD" }).then(
|
|
1827
|
+
(prices2) => setPrices(prices2)
|
|
1828
|
+
);
|
|
1829
|
+
}
|
|
1830
|
+
}, [dstChain]);
|
|
1831
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex flex-col globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 relative", children: [
|
|
1832
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex justify-between", children: [
|
|
1833
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1", children: [
|
|
1834
|
+
/* @__PURE__ */ jsx29("p", { className: "text-[rgba(255,255,255,0.6)] text-sm", children: "You receive" }),
|
|
1835
|
+
isGettingRoute ? /* @__PURE__ */ jsx29(
|
|
1836
|
+
Skeleton,
|
|
1837
|
+
{
|
|
1838
|
+
width: "w-[100px]",
|
|
1839
|
+
height: "h-[36px]",
|
|
1840
|
+
other: "sm:w-[190px]"
|
|
1841
|
+
}
|
|
1842
|
+
) : /* @__PURE__ */ jsxs11("div", { className: "flex gap-2 items-center text-white text-xl sm:text-3xl", children: [
|
|
1843
|
+
amountReadable,
|
|
1844
|
+
/* @__PURE__ */ jsx29("div", { className: "w-4 sm:w-6 h-4 sm:h-6", children: /* @__PURE__ */ jsx29("img", { src: dstToken?.image, alt: dstToken?.name }) }),
|
|
1845
|
+
/* @__PURE__ */ jsx29("p", { className: "text-base sm:text-xl", children: dstToken?.symbol })
|
|
1846
|
+
] })
|
|
1847
|
+
] }),
|
|
1848
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1 text-sm", children: [
|
|
1849
|
+
/* @__PURE__ */ jsx29("p", { className: "text-[rgba(255,255,255,0.6)] text-right", children: "on chain:" }),
|
|
1850
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1 text-white", children: [
|
|
1851
|
+
/* @__PURE__ */ jsx29("div", { className: "w-4 h-4", children: /* @__PURE__ */ jsx29("img", { src: dstChain?.image, alt: dstChain?.name }) }),
|
|
1852
|
+
/* @__PURE__ */ jsx29("div", { children: dstChain?.displayName })
|
|
1853
|
+
] })
|
|
2932
1854
|
] })
|
|
2933
1855
|
] }),
|
|
2934
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ jsx29(
|
|
1857
|
+
UsdPrice,
|
|
1858
|
+
{
|
|
1859
|
+
prices,
|
|
1860
|
+
token: dstToken,
|
|
1861
|
+
amount: amountReadable,
|
|
1862
|
+
loading: isGettingRoute
|
|
1863
|
+
}
|
|
1864
|
+
),
|
|
1865
|
+
/* @__PURE__ */ jsx29("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__ */ jsx29("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__ */ jsx29(ArrowDownIcon, {}) }) })
|
|
2935
1866
|
] });
|
|
2936
1867
|
};
|
|
2937
1868
|
|
|
2938
1869
|
// src/components/TxConfigForm/SwapPanel.tsx
|
|
2939
|
-
import { useState as
|
|
1870
|
+
import { useState as useState7, useEffect as useEffect6, useRef as useRef2, useMemo as useMemo6 } from "react";
|
|
2940
1871
|
|
|
2941
1872
|
// src/components/TxConfigForm/TokenPicker.tsx
|
|
2942
|
-
import { useState as
|
|
1873
|
+
import { useState as useState6, useMemo as useMemo4 } from "react";
|
|
2943
1874
|
import { createPortal } from "react-dom";
|
|
2944
|
-
import { Fragment as
|
|
1875
|
+
import { Fragment as Fragment4, jsx as jsx30, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2945
1876
|
var TokenPicker = ({
|
|
2946
1877
|
onCloseClick,
|
|
2947
1878
|
tokens,
|
|
@@ -2950,8 +1881,8 @@ var TokenPicker = ({
|
|
|
2950
1881
|
signer,
|
|
2951
1882
|
balances
|
|
2952
1883
|
}) => {
|
|
2953
|
-
const [searchValue, setSearchValue] =
|
|
2954
|
-
const modalRoot = document.querySelector("
|
|
1884
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
1885
|
+
const modalRoot = document.querySelector("#xswap-modal");
|
|
2955
1886
|
const onBackdropClick = (e) => {
|
|
2956
1887
|
e.stopPropagation();
|
|
2957
1888
|
e.nativeEvent.stopImmediatePropagation();
|
|
@@ -2959,7 +1890,7 @@ var TokenPicker = ({
|
|
|
2959
1890
|
onCloseClick();
|
|
2960
1891
|
}
|
|
2961
1892
|
};
|
|
2962
|
-
const filteredTokens =
|
|
1893
|
+
const filteredTokens = useMemo4(() => {
|
|
2963
1894
|
const isMatch = (value, searchValue2) => value.toLowerCase().indexOf(searchValue2.toLowerCase()) > -1;
|
|
2964
1895
|
return tokens?.filter(
|
|
2965
1896
|
(token) => isMatch(token.symbol, searchValue) || isMatch(token.name, searchValue) || token.address === searchValue.toLowerCase()
|
|
@@ -2968,24 +1899,24 @@ var TokenPicker = ({
|
|
|
2968
1899
|
);
|
|
2969
1900
|
}, [searchValue, tokens]);
|
|
2970
1901
|
return modalRoot ? createPortal(
|
|
2971
|
-
/* @__PURE__ */
|
|
1902
|
+
/* @__PURE__ */ jsx30(
|
|
2972
1903
|
"div",
|
|
2973
1904
|
{
|
|
2974
1905
|
onClick: onBackdropClick,
|
|
2975
1906
|
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",
|
|
2976
1907
|
children: /* @__PURE__ */ jsxs12("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: [
|
|
2977
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsx30(
|
|
2978
1909
|
"div",
|
|
2979
1910
|
{
|
|
2980
1911
|
onClick: onCloseClick,
|
|
2981
1912
|
className: "absolute top-4 right-4 cursor-pointer",
|
|
2982
|
-
children: /* @__PURE__ */
|
|
1913
|
+
children: /* @__PURE__ */ jsx30(CloseIcon, {})
|
|
2983
1914
|
}
|
|
2984
1915
|
),
|
|
2985
|
-
/* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ jsx30("p", { className: "text-base mb-4", children: "Pick a token" }),
|
|
2986
1917
|
/* @__PURE__ */ jsxs12("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: [
|
|
2987
|
-
/* @__PURE__ */
|
|
2988
|
-
/* @__PURE__ */
|
|
1918
|
+
/* @__PURE__ */ jsx30("div", { className: "w-6 h-6", children: /* @__PURE__ */ jsx30(SearchIcon, {}) }),
|
|
1919
|
+
/* @__PURE__ */ jsx30(
|
|
2989
1920
|
"input",
|
|
2990
1921
|
{
|
|
2991
1922
|
placeholder: "Search name or paste address",
|
|
@@ -2995,7 +1926,7 @@ var TokenPicker = ({
|
|
|
2995
1926
|
}
|
|
2996
1927
|
)
|
|
2997
1928
|
] }),
|
|
2998
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx30("div", { className: "my-4 mx-0 flex flex-wrap gap-3", children: tokens?.filter((token) => token?.quickPick).map((token) => /* @__PURE__ */ jsxs12(
|
|
2999
1930
|
"div",
|
|
3000
1931
|
{
|
|
3001
1932
|
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)]" : ""}`,
|
|
@@ -3004,14 +1935,14 @@ var TokenPicker = ({
|
|
|
3004
1935
|
onCloseClick();
|
|
3005
1936
|
},
|
|
3006
1937
|
children: [
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ jsx30("img", { src: token.image, alt: token.name, className: "w-5" }),
|
|
1939
|
+
/* @__PURE__ */ jsx30("div", { className: "text-sm", children: token.symbol })
|
|
3009
1940
|
]
|
|
3010
1941
|
},
|
|
3011
1942
|
token.address
|
|
3012
1943
|
)) }),
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsx30("div", { className: "h-[2px] my-0 mx-[-24px] w-[100%+48px] px-12 bg-[rgba(255,255,255,0.1)]" }),
|
|
1945
|
+
/* @__PURE__ */ jsx30("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__ */ jsxs12(
|
|
3015
1946
|
"div",
|
|
3016
1947
|
{
|
|
3017
1948
|
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)]" : ""}`,
|
|
@@ -3020,29 +1951,29 @@ var TokenPicker = ({
|
|
|
3020
1951
|
onCloseClick();
|
|
3021
1952
|
},
|
|
3022
1953
|
children: [
|
|
3023
|
-
token.image ? /* @__PURE__ */
|
|
1954
|
+
token.image ? /* @__PURE__ */ jsx30(
|
|
3024
1955
|
"img",
|
|
3025
1956
|
{
|
|
3026
1957
|
src: token.image,
|
|
3027
1958
|
alt: token.name,
|
|
3028
1959
|
className: "token-picker__all__logo"
|
|
3029
1960
|
}
|
|
3030
|
-
) : /* @__PURE__ */
|
|
1961
|
+
) : /* @__PURE__ */ jsx30("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) }),
|
|
3031
1962
|
/* @__PURE__ */ jsxs12("div", { className: "flex justify-between items-center gap-1 overflow-hidden grow", children: [
|
|
3032
1963
|
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col leading-[16px]", children: [
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ jsx30("div", { className: "overflow-hidden whitespace-nowrap text-ellipsis text-[15px]", children: token.name }),
|
|
1965
|
+
/* @__PURE__ */ jsx30("div", { className: "text-[#888] text-[11px]", children: token.symbol })
|
|
3035
1966
|
] }),
|
|
3036
|
-
signer && /* @__PURE__ */
|
|
1967
|
+
signer && /* @__PURE__ */ jsx30(Fragment4, { children: balances && balances[token.address] && token.decimals ? /* @__PURE__ */ jsx30("div", { className: "text-xs", children: weiToHumanReadable({
|
|
3037
1968
|
amount: balances[token.address]?.toString() || "0",
|
|
3038
1969
|
decimals: token.decimals,
|
|
3039
1970
|
precisionFractionalPlaces: 4
|
|
3040
|
-
}) }) : /* @__PURE__ */
|
|
1971
|
+
}) }) : /* @__PURE__ */ jsx30(Skeleton, { width: "w-12", height: "h-3" }) })
|
|
3041
1972
|
] })
|
|
3042
1973
|
]
|
|
3043
1974
|
},
|
|
3044
1975
|
`${index}_${token.address}`
|
|
3045
|
-
)) : /* @__PURE__ */
|
|
1976
|
+
)) : /* @__PURE__ */ jsx30("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ jsx30("p", { className: "text-sm text-white", children: "No tokens found." }) }) })
|
|
3046
1977
|
] })
|
|
3047
1978
|
}
|
|
3048
1979
|
),
|
|
@@ -3051,7 +1982,7 @@ var TokenPicker = ({
|
|
|
3051
1982
|
};
|
|
3052
1983
|
|
|
3053
1984
|
// src/components/TxConfigForm/ChainListElement.tsx
|
|
3054
|
-
import { jsx as
|
|
1985
|
+
import { jsx as jsx31, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3055
1986
|
var ChainListElement = ({
|
|
3056
1987
|
chain,
|
|
3057
1988
|
setSrcChain,
|
|
@@ -3069,21 +2000,21 @@ var ChainListElement = ({
|
|
|
3069
2000
|
setChainListShown(false);
|
|
3070
2001
|
},
|
|
3071
2002
|
children: [
|
|
3072
|
-
/* @__PURE__ */
|
|
2003
|
+
/* @__PURE__ */ jsx31("img", { width: 12, height: 12, src: chain.image, alt: chain.displayName }),
|
|
3073
2004
|
chain.displayName
|
|
3074
2005
|
]
|
|
3075
2006
|
}
|
|
3076
2007
|
),
|
|
3077
|
-
index !== length - 1 && /* @__PURE__ */
|
|
2008
|
+
index !== length - 1 && /* @__PURE__ */ jsx31("div", { className: "h-px mx-2 bg-[rgba(255,255,255,0.15)]" })
|
|
3078
2009
|
] }, `${chain.ecosystem}-${chain.chainId}`);
|
|
3079
2010
|
};
|
|
3080
2011
|
|
|
3081
2012
|
// src/components/TxConfigForm/BalanceComponent.tsx
|
|
3082
|
-
import { useMemo as
|
|
2013
|
+
import { useMemo as useMemo5 } from "react";
|
|
3083
2014
|
import BigNumber3 from "bignumber.js";
|
|
3084
|
-
import { Fragment as
|
|
2015
|
+
import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3085
2016
|
var BalanceComponent = ({ srcToken, balances }) => {
|
|
3086
|
-
const balanceText =
|
|
2017
|
+
const balanceText = useMemo5(() => {
|
|
3087
2018
|
if (!balances || !srcToken)
|
|
3088
2019
|
return "0";
|
|
3089
2020
|
if (balances[srcToken.address]?.toString() === "0")
|
|
@@ -3103,7 +2034,7 @@ var BalanceComponent = ({ srcToken, balances }) => {
|
|
|
3103
2034
|
precisionFractionalPlaces: 5
|
|
3104
2035
|
});
|
|
3105
2036
|
}, [srcToken, balances]);
|
|
3106
|
-
return /* @__PURE__ */ jsxs14(
|
|
2037
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3107
2038
|
"Balance:",
|
|
3108
2039
|
" ",
|
|
3109
2040
|
srcToken && balances ? weiToHumanReadable({
|
|
@@ -3111,12 +2042,12 @@ var BalanceComponent = ({ srcToken, balances }) => {
|
|
|
3111
2042
|
decimals: srcToken.decimals,
|
|
3112
2043
|
precisionFractionalPlaces: 4
|
|
3113
2044
|
}) : 0,
|
|
3114
|
-
/* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ jsx32("span", { className: "bg-gradient-to-r from-x_blue_light to-x_blue_dark bg-clip-text text-transparent", children: "Max" })
|
|
3115
2046
|
] });
|
|
3116
2047
|
};
|
|
3117
2048
|
|
|
3118
2049
|
// src/components/TxConfigForm/SwapPanel.tsx
|
|
3119
|
-
import {
|
|
2050
|
+
import { jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3120
2051
|
var SwapPanel = ({
|
|
3121
2052
|
amount,
|
|
3122
2053
|
setAmount,
|
|
@@ -3129,8 +2060,8 @@ var SwapPanel = ({
|
|
|
3129
2060
|
prices,
|
|
3130
2061
|
supportedChains
|
|
3131
2062
|
}) => {
|
|
3132
|
-
const [chainListShown, setChainListShown] =
|
|
3133
|
-
const [tokenListShown, setTokenListShown] =
|
|
2063
|
+
const [chainListShown, setChainListShown] = useState7(false);
|
|
2064
|
+
const [tokenListShown, setTokenListShown] = useState7(false);
|
|
3134
2065
|
const listRef = useRef2(null);
|
|
3135
2066
|
const buttonRef = useRef2(null);
|
|
3136
2067
|
const handleClickOutside = (event) => {
|
|
@@ -3151,21 +2082,21 @@ var SwapPanel = ({
|
|
|
3151
2082
|
})
|
|
3152
2083
|
);
|
|
3153
2084
|
};
|
|
3154
|
-
|
|
2085
|
+
useEffect6(() => {
|
|
3155
2086
|
if (chainListShown) {
|
|
3156
2087
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3157
2088
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3158
2089
|
}
|
|
3159
2090
|
}, [chainListShown]);
|
|
3160
|
-
const chainListOptions =
|
|
2091
|
+
const chainListOptions = useMemo6(
|
|
3161
2092
|
() => supportedChains.filter((chain) => chain.chainId !== srcChain?.chainId),
|
|
3162
2093
|
[supportedChains, srcChain]
|
|
3163
2094
|
);
|
|
3164
|
-
return /* @__PURE__ */ jsxs15("div", { className: "flex
|
|
3165
|
-
/* @__PURE__ */ jsxs15("div", { className: "
|
|
3166
|
-
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
/* @__PURE__ */
|
|
2095
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex justify-between globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4", children: [
|
|
2096
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col justify-between gap-2 overflow-hidden w-1/2", children: [
|
|
2097
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-1", children: [
|
|
2098
|
+
/* @__PURE__ */ jsx33("p", { className: "text-white opacity-60 text-xs sm:text-sm font-medium", children: "You pay" }),
|
|
2099
|
+
/* @__PURE__ */ jsx33(
|
|
3169
2100
|
"input",
|
|
3170
2101
|
{
|
|
3171
2102
|
className: "p-0 border-none outline-none bg-transparent text-2xl overflow-ellipsis",
|
|
@@ -3185,90 +2116,94 @@ var SwapPanel = ({
|
|
|
3185
2116
|
}
|
|
3186
2117
|
)
|
|
3187
2118
|
] }),
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
),
|
|
3210
|
-
chainListShown && /* @__PURE__ */ jsx30(
|
|
3211
|
-
"ul",
|
|
3212
|
-
{
|
|
3213
|
-
ref: listRef,
|
|
3214
|
-
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",
|
|
3215
|
-
children: chainListOptions.map((chain, index) => /* @__PURE__ */ jsx30(
|
|
3216
|
-
ChainListElement,
|
|
2119
|
+
/* @__PURE__ */ jsx33("div", { className: "flex items-center text-sm text-[rgba(255,255,255,0.6)]", children: /* @__PURE__ */ jsx33(
|
|
2120
|
+
UsdPrice,
|
|
2121
|
+
{
|
|
2122
|
+
prices,
|
|
2123
|
+
token: srcToken,
|
|
2124
|
+
amount,
|
|
2125
|
+
loading: false
|
|
2126
|
+
}
|
|
2127
|
+
) })
|
|
2128
|
+
] }),
|
|
2129
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col relative items-end gap-2.5 w-1/2 text-xs", children: [
|
|
2130
|
+
/* @__PURE__ */ jsxs15(
|
|
2131
|
+
"div",
|
|
2132
|
+
{
|
|
2133
|
+
className: "flex gap-2 items-center p-2 max-w-full cursor-pointer bg-black text-white globalBorder rounded-3xl whitespace-nowrap",
|
|
2134
|
+
onClick: () => {
|
|
2135
|
+
setTokenListShown((state) => !state);
|
|
2136
|
+
},
|
|
2137
|
+
children: [
|
|
2138
|
+
/* @__PURE__ */ jsx33(
|
|
2139
|
+
"img",
|
|
3217
2140
|
{
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
chain
|
|
2141
|
+
height: 16,
|
|
2142
|
+
width: 16,
|
|
2143
|
+
src: srcToken?.image,
|
|
2144
|
+
alt: srcToken?.name
|
|
3223
2145
|
}
|
|
3224
|
-
)
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
}
|
|
3243
|
-
),
|
|
3244
|
-
/* @__PURE__ */ jsx30("div", { children: srcToken?.symbol }),
|
|
3245
|
-
/* @__PURE__ */ jsx30(DownArrowIcon, {})
|
|
3246
|
-
]
|
|
3247
|
-
}
|
|
3248
|
-
),
|
|
3249
|
-
tokenListShown && /* @__PURE__ */ jsx30(
|
|
3250
|
-
TokenPicker,
|
|
3251
|
-
{
|
|
3252
|
-
onCloseClick: () => setTokenListShown(false),
|
|
3253
|
-
tokens: srcChain?.tokens,
|
|
3254
|
-
signer,
|
|
3255
|
-
selectedToken: srcToken,
|
|
3256
|
-
setSelectedToken: (token) => setSrcToken(token),
|
|
3257
|
-
balances
|
|
3258
|
-
}
|
|
3259
|
-
)
|
|
3260
|
-
] })
|
|
3261
|
-
] }),
|
|
3262
|
-
/* @__PURE__ */ jsxs15("div", { className: "flex justify-between items-center w-full text-sm text-[rgba(255,255,255,0.6)] relative", children: [
|
|
3263
|
-
srcToken ? prices && prices[srcToken.address] ? /* @__PURE__ */ jsx30("div", { children: `$${(Number(amount) * Number(prices[srcToken.address])).toFixed(
|
|
3264
|
-
2
|
|
3265
|
-
)}` }) : /* @__PURE__ */ jsx30(Alert, { desc: "Unknown price" }) : /* @__PURE__ */ jsx30(Fragment5, { children: "$0.00" }),
|
|
3266
|
-
/* @__PURE__ */ jsx30(
|
|
2146
|
+
),
|
|
2147
|
+
/* @__PURE__ */ jsx33("div", { children: srcToken?.symbol }),
|
|
2148
|
+
/* @__PURE__ */ jsx33(DownArrowIcon, {})
|
|
2149
|
+
]
|
|
2150
|
+
}
|
|
2151
|
+
),
|
|
2152
|
+
tokenListShown && /* @__PURE__ */ jsx33(
|
|
2153
|
+
TokenPicker,
|
|
2154
|
+
{
|
|
2155
|
+
onCloseClick: () => setTokenListShown(false),
|
|
2156
|
+
tokens: srcChain?.tokens,
|
|
2157
|
+
signer,
|
|
2158
|
+
selectedToken: srcToken,
|
|
2159
|
+
setSelectedToken: (token) => setSrcToken(token),
|
|
2160
|
+
balances
|
|
2161
|
+
}
|
|
2162
|
+
),
|
|
2163
|
+
/* @__PURE__ */ jsx33(
|
|
3267
2164
|
"div",
|
|
3268
2165
|
{
|
|
3269
2166
|
onClick: handleMaxClick,
|
|
3270
2167
|
className: "flex gap-1 items-center font-medium text-white opacity-60 py-0.5 cursor-pointer",
|
|
3271
|
-
children: signer && /* @__PURE__ */
|
|
2168
|
+
children: signer && /* @__PURE__ */ jsx33(BalanceComponent, { balances, srcToken })
|
|
2169
|
+
}
|
|
2170
|
+
),
|
|
2171
|
+
/* @__PURE__ */ jsxs15(
|
|
2172
|
+
"div",
|
|
2173
|
+
{
|
|
2174
|
+
ref: buttonRef,
|
|
2175
|
+
className: "bg-black globalBorder rounded-2xl whitespace-nowrap flex items-center p-2 cursor-pointer gap-2",
|
|
2176
|
+
onClick: () => setChainListShown((prev) => !prev),
|
|
2177
|
+
children: [
|
|
2178
|
+
/* @__PURE__ */ jsx33(
|
|
2179
|
+
"img",
|
|
2180
|
+
{
|
|
2181
|
+
width: "16",
|
|
2182
|
+
height: "16",
|
|
2183
|
+
src: srcChain?.image,
|
|
2184
|
+
alt: srcChain?.name
|
|
2185
|
+
}
|
|
2186
|
+
),
|
|
2187
|
+
/* @__PURE__ */ jsx33("div", { children: srcChain?.displayName }),
|
|
2188
|
+
/* @__PURE__ */ jsx33(DownArrowIcon, {})
|
|
2189
|
+
]
|
|
2190
|
+
}
|
|
2191
|
+
),
|
|
2192
|
+
chainListShown && /* @__PURE__ */ jsx33(
|
|
2193
|
+
"ul",
|
|
2194
|
+
{
|
|
2195
|
+
ref: listRef,
|
|
2196
|
+
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",
|
|
2197
|
+
children: chainListOptions.map((chain, index) => /* @__PURE__ */ jsx33(
|
|
2198
|
+
ChainListElement,
|
|
2199
|
+
{
|
|
2200
|
+
index,
|
|
2201
|
+
length: supportedChains.length,
|
|
2202
|
+
setSrcChain,
|
|
2203
|
+
setChainListShown,
|
|
2204
|
+
chain
|
|
2205
|
+
}
|
|
2206
|
+
))
|
|
3272
2207
|
}
|
|
3273
2208
|
)
|
|
3274
2209
|
] })
|
|
@@ -3276,9 +2211,9 @@ var SwapPanel = ({
|
|
|
3276
2211
|
};
|
|
3277
2212
|
|
|
3278
2213
|
// src/components/TxConfigForm/ErrorField.tsx
|
|
3279
|
-
import { jsx as
|
|
2214
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3280
2215
|
var ErrorField = ({ error }) => {
|
|
3281
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ jsx34(
|
|
3282
2217
|
"div",
|
|
3283
2218
|
{
|
|
3284
2219
|
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"}`,
|
|
@@ -3288,13 +2223,13 @@ var ErrorField = ({ error }) => {
|
|
|
3288
2223
|
};
|
|
3289
2224
|
|
|
3290
2225
|
// src/components/TxConfigForm/Description.tsx
|
|
3291
|
-
import { jsx as
|
|
2226
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3292
2227
|
var Description = ({ description }) => {
|
|
3293
|
-
return /* @__PURE__ */
|
|
2228
|
+
return /* @__PURE__ */ jsx35("div", { className: "flex flex-col items-start rounded-lg px-4 py-2", children: /* @__PURE__ */ jsx35("div", { className: "w-full flex gap-4 items-start justify-between text-xl", children: description }) });
|
|
3294
2229
|
};
|
|
3295
2230
|
|
|
3296
2231
|
// src/components/TxConfigForm/Form.tsx
|
|
3297
|
-
import { jsx as
|
|
2232
|
+
import { jsx as jsx36, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3298
2233
|
var Form = ({
|
|
3299
2234
|
dstChainId,
|
|
3300
2235
|
dstTokenAddr,
|
|
@@ -3303,30 +2238,30 @@ var Form = ({
|
|
|
3303
2238
|
supportedChains,
|
|
3304
2239
|
onSubmit
|
|
3305
2240
|
}) => {
|
|
3306
|
-
const [signer, setSigner] =
|
|
3307
|
-
const [dstChain, setDstChain] =
|
|
3308
|
-
const [dstToken, setDstToken] =
|
|
3309
|
-
const [srcChain, setSrcChain] =
|
|
3310
|
-
const [srcToken, setSrcToken] =
|
|
3311
|
-
const [amount, setAmount] =
|
|
3312
|
-
const [paymentToken, setPaymentToken] =
|
|
3313
|
-
const [route, setRoute] =
|
|
3314
|
-
const [expressChecked, setExpressChecked] =
|
|
3315
|
-
const [historyTabShown, setHistoryTabShown] =
|
|
3316
|
-
const [isGettingRoute, setIsGettingRoute] =
|
|
3317
|
-
const [prices, setPrices] =
|
|
3318
|
-
const [balances, setBalances] =
|
|
3319
|
-
const [settingsShown, setSettingsShown] =
|
|
3320
|
-
const [formError, setFormError] =
|
|
3321
|
-
const [slippage, setSlippage] =
|
|
3322
|
-
const [feesDetailsShown, setFeesDetailsShown] =
|
|
2241
|
+
const [signer, setSigner] = useState8();
|
|
2242
|
+
const [dstChain, setDstChain] = useState8();
|
|
2243
|
+
const [dstToken, setDstToken] = useState8();
|
|
2244
|
+
const [srcChain, setSrcChain] = useState8();
|
|
2245
|
+
const [srcToken, setSrcToken] = useState8();
|
|
2246
|
+
const [amount, setAmount] = useState8("");
|
|
2247
|
+
const [paymentToken, setPaymentToken] = useState8();
|
|
2248
|
+
const [route, setRoute] = useState8();
|
|
2249
|
+
const [expressChecked, setExpressChecked] = useState8(true);
|
|
2250
|
+
const [historyTabShown, setHistoryTabShown] = useState8(false);
|
|
2251
|
+
const [isGettingRoute, setIsGettingRoute] = useState8(false);
|
|
2252
|
+
const [prices, setPrices] = useState8();
|
|
2253
|
+
const [balances, setBalances] = useState8();
|
|
2254
|
+
const [settingsShown, setSettingsShown] = useState8(false);
|
|
2255
|
+
const [formError, setFormError] = useState8("");
|
|
2256
|
+
const [slippage, setSlippage] = useState8("1.5");
|
|
2257
|
+
const [feesDetailsShown, setFeesDetailsShown] = useState8(false);
|
|
3323
2258
|
const debouncedAmount = useDebounce(amount, 1e3);
|
|
3324
2259
|
const account = useAccount();
|
|
3325
2260
|
const { switchChainAsync } = useSwitchChain();
|
|
3326
|
-
|
|
2261
|
+
useEffect7(() => {
|
|
3327
2262
|
setSigner(account.address);
|
|
3328
2263
|
}, [account.address]);
|
|
3329
|
-
|
|
2264
|
+
useEffect7(() => {
|
|
3330
2265
|
const defaultChain = supportedChains.find(
|
|
3331
2266
|
({ chainId }) => chainId === account.chainId?.toString()
|
|
3332
2267
|
);
|
|
@@ -3336,17 +2271,17 @@ var Form = ({
|
|
|
3336
2271
|
)
|
|
3337
2272
|
);
|
|
3338
2273
|
}, [account.chainId]);
|
|
3339
|
-
|
|
2274
|
+
useEffect7(() => {
|
|
3340
2275
|
setDstChain(supportedChains.find((chain) => chain.chainId === dstChainId));
|
|
3341
2276
|
}, [supportedChains, dstChainId]);
|
|
3342
|
-
|
|
2277
|
+
useEffect7(() => {
|
|
3343
2278
|
setDstToken(
|
|
3344
2279
|
dstChain?.tokens.find(
|
|
3345
2280
|
(token) => token.address.toLowerCase() === dstTokenAddr.toLowerCase()
|
|
3346
2281
|
)
|
|
3347
2282
|
);
|
|
3348
2283
|
}, [dstChain]);
|
|
3349
|
-
|
|
2284
|
+
useEffect7(() => {
|
|
3350
2285
|
if (srcChain && srcToken && dstChain && debouncedAmount && paymentToken && slippage) {
|
|
3351
2286
|
setFormError("");
|
|
3352
2287
|
const timeout = setTimeout(() => {
|
|
@@ -3354,8 +2289,12 @@ var Form = ({
|
|
|
3354
2289
|
}, ROUTE_TIMEOUT_MS);
|
|
3355
2290
|
setIsGettingRoute(true);
|
|
3356
2291
|
setFeesDetailsShown(false);
|
|
2292
|
+
if (!srcToken.decimals)
|
|
2293
|
+
throw new Error(
|
|
2294
|
+
`Configuration error: selected token ($${srcToken.symbol} ${srcToken.name}) has unknown decimals param.`
|
|
2295
|
+
);
|
|
3357
2296
|
getRoute({
|
|
3358
|
-
fromAmount:
|
|
2297
|
+
fromAmount: ethers4.utils.parseUnits(debouncedAmount, srcToken.decimals).toString(),
|
|
3359
2298
|
fromAddress: signer || ADDRESSES[srcChain.chainId].FeeCollector,
|
|
3360
2299
|
fromChain: srcChain.chainId,
|
|
3361
2300
|
fromToken: srcToken.address,
|
|
@@ -3385,30 +2324,30 @@ var Form = ({
|
|
|
3385
2324
|
slippage,
|
|
3386
2325
|
expressChecked
|
|
3387
2326
|
]);
|
|
3388
|
-
|
|
2327
|
+
useEffect7(() => {
|
|
3389
2328
|
if (srcChain) {
|
|
3390
2329
|
setPaymentToken(
|
|
3391
2330
|
srcChain.tokens.find(
|
|
3392
|
-
(token) => token.address.toLowerCase() ===
|
|
2331
|
+
(token) => token.address.toLowerCase() === ethers4.constants.AddressZero.toLowerCase()
|
|
3393
2332
|
)
|
|
3394
2333
|
);
|
|
3395
2334
|
}
|
|
3396
2335
|
}, [srcChain]);
|
|
3397
|
-
|
|
2336
|
+
useEffect7(() => {
|
|
3398
2337
|
setAmount("");
|
|
3399
2338
|
setFormError("");
|
|
3400
2339
|
}, [srcToken]);
|
|
3401
|
-
|
|
2340
|
+
useEffect7(() => {
|
|
3402
2341
|
setSrcToken(srcChain?.tokens[0]);
|
|
3403
2342
|
}, [srcChain]);
|
|
3404
|
-
|
|
2343
|
+
useEffect7(() => {
|
|
3405
2344
|
if (srcChain) {
|
|
3406
2345
|
getPrices({ chainId: srcChain.chainId, currency: "USD" }).then(
|
|
3407
2346
|
(prices2) => setPrices(prices2)
|
|
3408
2347
|
);
|
|
3409
2348
|
}
|
|
3410
2349
|
}, [srcChain]);
|
|
3411
|
-
|
|
2350
|
+
useEffect7(() => {
|
|
3412
2351
|
if (srcChain && signer) {
|
|
3413
2352
|
getBalances(srcChain, signer).then((balances2) => setBalances(balances2));
|
|
3414
2353
|
}
|
|
@@ -3427,7 +2366,7 @@ var Form = ({
|
|
|
3427
2366
|
className: "flex flex-col gap-2 z-10 my-0 mx-auto p-4 rounded-3xl overflow-hidden font-light w-x_mobile sm:w-x_desktop",
|
|
3428
2367
|
onSubmit: handleSubmit,
|
|
3429
2368
|
children: [
|
|
3430
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ jsx36(
|
|
3431
2370
|
TopBar,
|
|
3432
2371
|
{
|
|
3433
2372
|
signer,
|
|
@@ -3436,7 +2375,7 @@ var Form = ({
|
|
|
3436
2375
|
setSettingsShown
|
|
3437
2376
|
}
|
|
3438
2377
|
),
|
|
3439
|
-
settingsShown && /* @__PURE__ */
|
|
2378
|
+
settingsShown && /* @__PURE__ */ jsx36(
|
|
3440
2379
|
Settings,
|
|
3441
2380
|
{
|
|
3442
2381
|
expressChecked,
|
|
@@ -3446,9 +2385,9 @@ var Form = ({
|
|
|
3446
2385
|
setSlippage
|
|
3447
2386
|
}
|
|
3448
2387
|
),
|
|
3449
|
-
historyTabShown ? /* @__PURE__ */
|
|
3450
|
-
desc && /* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
2388
|
+
historyTabShown ? /* @__PURE__ */ jsx36(History, { signer, supportedChains }) : /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2", children: [
|
|
2389
|
+
desc && /* @__PURE__ */ jsx36(Description, { description: desc }),
|
|
2390
|
+
/* @__PURE__ */ jsx36(
|
|
3452
2391
|
SwapPanel,
|
|
3453
2392
|
{
|
|
3454
2393
|
amount,
|
|
@@ -3463,17 +2402,16 @@ var Form = ({
|
|
|
3463
2402
|
setSrcChain
|
|
3464
2403
|
}
|
|
3465
2404
|
),
|
|
3466
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsx36(
|
|
3467
2406
|
Summary,
|
|
3468
2407
|
{
|
|
3469
2408
|
isGettingRoute,
|
|
3470
|
-
amount,
|
|
3471
2409
|
route,
|
|
3472
2410
|
dstToken,
|
|
3473
2411
|
dstChain
|
|
3474
2412
|
}
|
|
3475
2413
|
),
|
|
3476
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ jsx36(
|
|
3477
2415
|
FeesDetails,
|
|
3478
2416
|
{
|
|
3479
2417
|
route,
|
|
@@ -3486,8 +2424,16 @@ var Form = ({
|
|
|
3486
2424
|
setFeesDetailsShown
|
|
3487
2425
|
}
|
|
3488
2426
|
),
|
|
3489
|
-
formError.length > 0 && /* @__PURE__ */
|
|
3490
|
-
srcChain && srcChain.chainId !== account.chainId?.toString() ? /* @__PURE__ */
|
|
2427
|
+
formError.length > 0 && /* @__PURE__ */ jsx36(ErrorField, { error: formError }),
|
|
2428
|
+
srcChain && srcChain.chainId !== account.chainId?.toString() ? /* @__PURE__ */ jsx36(
|
|
2429
|
+
"button",
|
|
2430
|
+
{
|
|
2431
|
+
disabled: !signer,
|
|
2432
|
+
type: "button",
|
|
2433
|
+
onClick: handleSwitchChain,
|
|
2434
|
+
children: "Switch chain"
|
|
2435
|
+
}
|
|
2436
|
+
) : /* @__PURE__ */ jsx36(
|
|
3491
2437
|
"button",
|
|
3492
2438
|
{
|
|
3493
2439
|
type: "submit",
|
|
@@ -3502,7 +2448,7 @@ var Form = ({
|
|
|
3502
2448
|
};
|
|
3503
2449
|
|
|
3504
2450
|
// src/components/TxConfigForm/index.tsx
|
|
3505
|
-
import { jsx as
|
|
2451
|
+
import { jsx as jsx37, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3506
2452
|
var TxConfigForm = ({
|
|
3507
2453
|
dstChainId,
|
|
3508
2454
|
dstTokenAddr,
|
|
@@ -3520,17 +2466,17 @@ var TxConfigForm = ({
|
|
|
3520
2466
|
}
|
|
3521
2467
|
};
|
|
3522
2468
|
const queryClient = new QueryClient();
|
|
3523
|
-
const wagmiConfig =
|
|
2469
|
+
const wagmiConfig = useMemo7(
|
|
3524
2470
|
() => getWagmiConfig(supportedChains),
|
|
3525
2471
|
supportedChains
|
|
3526
2472
|
);
|
|
3527
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ jsx37(WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ jsx37(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx37(
|
|
3528
2474
|
"div",
|
|
3529
2475
|
{
|
|
3530
2476
|
className: "top-0 left-0 right-0 bottom-0 bg-[rgba(0,0,0,0.8)] fixed flex items-center justify-center z-10",
|
|
3531
2477
|
onClick: onBackdropClick,
|
|
3532
2478
|
children: /* @__PURE__ */ jsxs17("div", { className: "relative bg-black rounded-3xl w-lg overflow-auto text-white border-2 border-solid border-[rgba(255,255,255,0.1)]", children: [
|
|
3533
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsx37(
|
|
3534
2480
|
Form,
|
|
3535
2481
|
{
|
|
3536
2482
|
dstChainId,
|
|
@@ -3541,19 +2487,19 @@ var TxConfigForm = ({
|
|
|
3541
2487
|
onSubmit
|
|
3542
2488
|
}
|
|
3543
2489
|
),
|
|
3544
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ jsx37(
|
|
3545
2491
|
"div",
|
|
3546
2492
|
{
|
|
3547
2493
|
className: "absolute top-7 right-4 cursor-pointer text-white",
|
|
3548
2494
|
onClick: onClose,
|
|
3549
|
-
children: /* @__PURE__ */
|
|
2495
|
+
children: /* @__PURE__ */ jsx37(CloseIcon, {})
|
|
3550
2496
|
}
|
|
3551
2497
|
),
|
|
3552
2498
|
/* @__PURE__ */ jsxs17("div", { className: "swappage__poweredby", children: [
|
|
3553
|
-
/* @__PURE__ */
|
|
3554
|
-
/* @__PURE__ */
|
|
3555
|
-
/* @__PURE__ */
|
|
3556
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ jsx37("span", { children: "Powered by" }),
|
|
2500
|
+
/* @__PURE__ */ jsx37(XSwapBadgeIcon, {}),
|
|
2501
|
+
/* @__PURE__ */ jsx37("span", { children: "\u2715" }),
|
|
2502
|
+
/* @__PURE__ */ jsx37(ChainlinkCCIPIcon, {})
|
|
3557
2503
|
] })
|
|
3558
2504
|
] })
|
|
3559
2505
|
}
|
|
@@ -3569,7 +2515,7 @@ var openTxConfigForm = async ({
|
|
|
3569
2515
|
try {
|
|
3570
2516
|
return await new Promise((resolve) => {
|
|
3571
2517
|
txConfigFormRoot.render(
|
|
3572
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ jsx37(
|
|
3573
2519
|
TxConfigForm,
|
|
3574
2520
|
{
|
|
3575
2521
|
dstChainId,
|
|
@@ -3595,22 +2541,137 @@ var openTxConfigForm = async ({
|
|
|
3595
2541
|
var txConfigFormRoot;
|
|
3596
2542
|
if (typeof document !== "undefined") {
|
|
3597
2543
|
const xswapElement = document.createElement("div");
|
|
3598
|
-
xswapElement.setAttribute("id", "
|
|
3599
|
-
xswapElement.classList.add("xswap");
|
|
2544
|
+
xswapElement.setAttribute("id", "xswap-modal");
|
|
3600
2545
|
document.body.appendChild(xswapElement);
|
|
3601
2546
|
txConfigFormRoot = createRoot(xswapElement);
|
|
3602
2547
|
}
|
|
3603
2548
|
|
|
2549
|
+
// src/components/TxHistoryButton/index.tsx
|
|
2550
|
+
import { useState as useState9 } from "react";
|
|
2551
|
+
import { createRoot as createRoot2 } from "react-dom/client";
|
|
2552
|
+
import { Fragment as Fragment6, jsx as jsx38, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2553
|
+
var TxHistoryButton = ({ transaction }) => {
|
|
2554
|
+
const {
|
|
2555
|
+
fromChain,
|
|
2556
|
+
fromChainImage,
|
|
2557
|
+
fromToken,
|
|
2558
|
+
fromTokenImage,
|
|
2559
|
+
fromAmount,
|
|
2560
|
+
toChain,
|
|
2561
|
+
toChainImage,
|
|
2562
|
+
isDone,
|
|
2563
|
+
txHash,
|
|
2564
|
+
explorer
|
|
2565
|
+
} = transaction;
|
|
2566
|
+
const [isWide, setIsWide] = useState9(false);
|
|
2567
|
+
return /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", onClick: () => setIsWide((x) => !x), children: [
|
|
2568
|
+
isWide && /* @__PURE__ */ jsxs18(
|
|
2569
|
+
"div",
|
|
2570
|
+
{
|
|
2571
|
+
className: `flex items-center min-w-60 sm:w-[520px] text-white h-14 px-4 text-sm gap-3 rounded-xl bg-gradient-to-r ${isDone ? "from-[rgba(76,175,80,0.1)] to-[rgba(46,125,50,0.1)] border border-solid border-x_green_dark" : "from-[rgba(54,129,198,0.1)] to-[rgba(43,74,157,0.1)] border border-solid border-x_blue_dark"}`,
|
|
2572
|
+
children: [
|
|
2573
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex justify-between flex-col gap-2 sm:gap-5 sm:flex-row w-full", children: [
|
|
2574
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
2575
|
+
/* @__PURE__ */ jsx38(
|
|
2576
|
+
"img",
|
|
2577
|
+
{
|
|
2578
|
+
className: "w-5 h-5",
|
|
2579
|
+
src: fromChainImage,
|
|
2580
|
+
alt: "source chain"
|
|
2581
|
+
}
|
|
2582
|
+
),
|
|
2583
|
+
/* @__PURE__ */ jsx38("div", { children: fromChain }),
|
|
2584
|
+
/* @__PURE__ */ jsx38("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ jsx38(ArrowRightIcon, {}) }),
|
|
2585
|
+
/* @__PURE__ */ jsx38("img", { className: "w-5 h-5", src: toChainImage, alt: "to chain" }),
|
|
2586
|
+
/* @__PURE__ */ jsx38("div", { children: toChain })
|
|
2587
|
+
] }),
|
|
2588
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
2589
|
+
/* @__PURE__ */ jsx38("div", { children: "Sent" }),
|
|
2590
|
+
/* @__PURE__ */ jsx38("div", { children: fromAmount }),
|
|
2591
|
+
/* @__PURE__ */ jsx38("div", { children: fromToken }),
|
|
2592
|
+
/* @__PURE__ */ jsx38(
|
|
2593
|
+
"img",
|
|
2594
|
+
{
|
|
2595
|
+
className: "w-5 h-5",
|
|
2596
|
+
src: fromTokenImage,
|
|
2597
|
+
alt: "source token"
|
|
2598
|
+
}
|
|
2599
|
+
)
|
|
2600
|
+
] })
|
|
2601
|
+
] }),
|
|
2602
|
+
/* @__PURE__ */ jsx38(
|
|
2603
|
+
"a",
|
|
2604
|
+
{
|
|
2605
|
+
href: explorer,
|
|
2606
|
+
target: "_blank",
|
|
2607
|
+
rel: "noreferrer",
|
|
2608
|
+
className: "no-underline cursor-pointer",
|
|
2609
|
+
"aria-label": "Show the transaction in the chain explorer",
|
|
2610
|
+
children: /* @__PURE__ */ jsx38("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ jsx38(ArrowUpRightIcon, {}) })
|
|
2611
|
+
}
|
|
2612
|
+
)
|
|
2613
|
+
]
|
|
2614
|
+
}
|
|
2615
|
+
),
|
|
2616
|
+
/* @__PURE__ */ jsx38(
|
|
2617
|
+
"div",
|
|
2618
|
+
{
|
|
2619
|
+
className: `text-white rounded-xl cursor-pointer bg-gradient-to-r
|
|
2620
|
+
${isDone ? "from-[rgba(76,175,80,0.1)] to-[rgba(46,125,50,0.1)] border border-solid border-x_green_dark" : "from-[rgba(54,129,198,0.1)] to-[rgba(43,74,157,0.1)] border border-solid border-x_blue_dark"}`,
|
|
2621
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "flex gap-2 items-center h-14 w-20 justify-center", children: [
|
|
2622
|
+
/* @__PURE__ */ jsx38(ArrowLeftIcon, {}),
|
|
2623
|
+
/* @__PURE__ */ jsx38("div", { className: "relative flex items-center justify-center w-9 h-9", children: isDone ? /* @__PURE__ */ jsx38("div", { className: "text-x_green w-5 h-5", children: /* @__PURE__ */ jsx38(CheckIcon, {}) }) : /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
2624
|
+
/* @__PURE__ */ jsx38("div", { className: "w-5 h-5", children: /* @__PURE__ */ jsx38(XSwapLogo, {}) }),
|
|
2625
|
+
/* @__PURE__ */ jsx38("div", { className: "absolute flex items-center justify-center top-0 left-0 right-0 bottom-0 text-white", children: /* @__PURE__ */ jsx38(CircularProgressIcon, {}) })
|
|
2626
|
+
] }) })
|
|
2627
|
+
] })
|
|
2628
|
+
}
|
|
2629
|
+
)
|
|
2630
|
+
] });
|
|
2631
|
+
};
|
|
2632
|
+
var renderedTransactions = [];
|
|
2633
|
+
var addTransactionToRenderedTransactions = (transaction) => {
|
|
2634
|
+
if (!renderedTransactions.some(({ txHash }) => txHash === transaction.txHash))
|
|
2635
|
+
renderedTransactions.push(transaction);
|
|
2636
|
+
};
|
|
2637
|
+
var removeTransactionFromRenderedTransactions = (txHash) => {
|
|
2638
|
+
const filteredRenderedTransactions = renderedTransactions.filter(
|
|
2639
|
+
(item) => item.txHash !== txHash
|
|
2640
|
+
);
|
|
2641
|
+
renderedTransactions = [...filteredRenderedTransactions];
|
|
2642
|
+
};
|
|
2643
|
+
var updateTransactionDoneInRenderedTransactions = (txHash) => {
|
|
2644
|
+
const transaction = renderedTransactions.find(
|
|
2645
|
+
(item) => item.txHash === txHash
|
|
2646
|
+
);
|
|
2647
|
+
if (transaction) {
|
|
2648
|
+
transaction.isDone = true;
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
var historyElement = document.createElement("div");
|
|
2652
|
+
historyElement.setAttribute("id", "xswap-history");
|
|
2653
|
+
historyElement.setAttribute(
|
|
2654
|
+
"class",
|
|
2655
|
+
"absolute bottom-5 right-2 flex flex-col gap-3 pl-9 items-end w-full z-50"
|
|
2656
|
+
);
|
|
2657
|
+
document.body.appendChild(historyElement);
|
|
2658
|
+
var txHistoryButtonRoot = createRoot2(historyElement);
|
|
2659
|
+
var renderTxHistoryButtons = () => {
|
|
2660
|
+
const buttons = renderedTransactions.map((item) => /* @__PURE__ */ jsx38(TxHistoryButton, { transaction: item }, item.txHash));
|
|
2661
|
+
txHistoryButtonRoot.render(buttons);
|
|
2662
|
+
};
|
|
2663
|
+
|
|
3604
2664
|
// src/components/Skeleton/index.tsx
|
|
3605
|
-
import { jsx as
|
|
3606
|
-
var Skeleton = ({
|
|
3607
|
-
return /* @__PURE__ */
|
|
2665
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2666
|
+
var Skeleton = ({ width, height }) => {
|
|
2667
|
+
return /* @__PURE__ */ jsx39("div", { className: `bg-current rounded animate-pulse ${width} ${height}` });
|
|
3608
2668
|
};
|
|
3609
2669
|
export {
|
|
3610
2670
|
ADDRESSES,
|
|
3611
2671
|
Alert,
|
|
3612
2672
|
BALANCES_CHUNK_SIZE,
|
|
3613
2673
|
BatchQueryAbi,
|
|
2674
|
+
CCIP_EXPLORER,
|
|
3614
2675
|
ContractName,
|
|
3615
2676
|
DEFAULT_ECOSYSTEM,
|
|
3616
2677
|
DEFAULT_SOURCE_CHAIN_ID,
|
|
@@ -3625,9 +2686,10 @@ export {
|
|
|
3625
2686
|
ROUTE_TIMEOUT_MS,
|
|
3626
2687
|
SLIPPAGE_PRESETS,
|
|
3627
2688
|
Skeleton,
|
|
2689
|
+
TxHistoryButton,
|
|
3628
2690
|
Web3Environment,
|
|
3629
2691
|
XSwapCallType,
|
|
3630
|
-
|
|
2692
|
+
addTransactionToRenderedTransactions,
|
|
3631
2693
|
chunkArray,
|
|
3632
2694
|
deepMergeObjects,
|
|
3633
2695
|
findPlaceholderIndex,
|
|
@@ -3640,14 +2702,19 @@ export {
|
|
|
3640
2702
|
getBridgeTokens,
|
|
3641
2703
|
getChainData,
|
|
3642
2704
|
getChains,
|
|
2705
|
+
getDate,
|
|
3643
2706
|
getHistory,
|
|
3644
2707
|
getPrices,
|
|
3645
2708
|
getRoute,
|
|
3646
2709
|
getSwapTx,
|
|
3647
2710
|
getTokens,
|
|
2711
|
+
monitorTransactionStatus,
|
|
3648
2712
|
openTxConfigForm,
|
|
2713
|
+
removeTransactionFromRenderedTransactions,
|
|
2714
|
+
renderTxHistoryButtons,
|
|
3649
2715
|
replaceNull,
|
|
3650
2716
|
safeBigNumberFrom,
|
|
3651
2717
|
shortAddress,
|
|
2718
|
+
updateTransactionDoneInRenderedTransactions,
|
|
3652
2719
|
weiToHumanReadable
|
|
3653
2720
|
};
|