@xswap-link/sdk 0.1.1 → 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.
Files changed (35) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/index.css +98 -39
  3. package/dist/index.d.mts +62 -157
  4. package/dist/index.d.ts +62 -157
  5. package/dist/index.js +962 -1923
  6. package/dist/index.mjs +919 -1887
  7. package/package.json +1 -1
  8. package/src/components/Skeleton/index.tsx +8 -5
  9. package/src/components/TxConfigForm/FeesDetails.tsx +5 -5
  10. package/src/components/TxConfigForm/Form.tsx +20 -14
  11. package/src/components/TxConfigForm/History.tsx +50 -101
  12. package/src/components/TxConfigForm/HistoryCard.tsx +22 -42
  13. package/src/components/TxConfigForm/Summary.tsx +57 -28
  14. package/src/components/TxConfigForm/SwapPanel.tsx +70 -77
  15. package/src/components/TxConfigForm/TokenPicker.tsx +69 -66
  16. package/src/components/TxConfigForm/TopBar.tsx +19 -19
  17. package/src/components/TxConfigForm/UsdPrice.tsx +41 -0
  18. package/src/components/TxConfigForm/index.tsx +1 -2
  19. package/src/components/TxHistoryButton/index.tsx +150 -0
  20. package/src/components/icons/ArrowLeftIcon.tsx +16 -0
  21. package/src/components/icons/ChevronUpIcon.tsx +1 -6
  22. package/src/components/icons/CircularProgressIcon.tsx +13 -15
  23. package/src/components/icons/XSwapLogo.tsx +98 -0
  24. package/src/components/icons/index.ts +2 -0
  25. package/src/components/index.ts +1 -0
  26. package/src/constants/index.ts +3 -2
  27. package/src/contracts/abi/index.ts +0 -2
  28. package/src/contracts/addresses.ts +6 -0
  29. package/src/models/Addresses.ts +1 -0
  30. package/src/models/TransactionHistory.ts +44 -29
  31. package/src/services/integrations/transactions.ts +166 -1
  32. package/src/utils/index.ts +7 -0
  33. package/tailwind.config.js +9 -0
  34. package/tsconfig.json +3 -7
  35. package/src/contracts/abi/XSwapRouter.json +0 -1242
package/dist/index.js CHANGED
@@ -33,10 +33,11 @@ __export(src_exports, {
33
33
  ADDRESSES: () => ADDRESSES,
34
34
  Alert: () => Alert,
35
35
  BALANCES_CHUNK_SIZE: () => BALANCES_CHUNK_SIZE,
36
- BALANCE_DISPLAY_MIN_LIMIT: () => BALANCE_DISPLAY_MIN_LIMIT,
37
36
  BatchQueryAbi: () => BatchQueryAbi,
37
+ CCIP_EXPLORER: () => CCIP_EXPLORER,
38
38
  ContractName: () => ContractName,
39
39
  DEFAULT_ECOSYSTEM: () => DEFAULT_ECOSYSTEM,
40
+ DEFAULT_SOURCE_CHAIN_ID: () => DEFAULT_SOURCE_CHAIN_ID,
40
41
  DELIVERY_TIME: () => DELIVERY_TIME,
41
42
  ERC20Abi: () => ERC20Abi,
42
43
  EXPRESS_DELIVERY_TIME: () => EXPRESS_DELIVERY_TIME,
@@ -48,9 +49,10 @@ __export(src_exports, {
48
49
  ROUTE_TIMEOUT_MS: () => ROUTE_TIMEOUT_MS,
49
50
  SLIPPAGE_PRESETS: () => SLIPPAGE_PRESETS,
50
51
  Skeleton: () => Skeleton,
52
+ TxHistoryButton: () => TxHistoryButton,
51
53
  Web3Environment: () => Web3Environment,
52
54
  XSwapCallType: () => XSwapCallType,
53
- XSwapRouterAbi: () => XSwapRouterAbi,
55
+ addTransactionToRenderedTransactions: () => addTransactionToRenderedTransactions,
54
56
  chunkArray: () => chunkArray,
55
57
  deepMergeObjects: () => deepMergeObjects,
56
58
  findPlaceholderIndex: () => findPlaceholderIndex,
@@ -63,15 +65,20 @@ __export(src_exports, {
63
65
  getBridgeTokens: () => getBridgeTokens,
64
66
  getChainData: () => getChainData,
65
67
  getChains: () => getChains,
68
+ getDate: () => getDate,
66
69
  getHistory: () => getHistory,
67
70
  getPrices: () => getPrices,
68
71
  getRoute: () => getRoute,
69
72
  getSwapTx: () => getSwapTx,
70
73
  getTokens: () => getTokens,
74
+ monitorTransactionStatus: () => monitorTransactionStatus,
71
75
  openTxConfigForm: () => openTxConfigForm,
76
+ removeTransactionFromRenderedTransactions: () => removeTransactionFromRenderedTransactions,
77
+ renderTxHistoryButtons: () => renderTxHistoryButtons,
72
78
  replaceNull: () => replaceNull,
73
79
  safeBigNumberFrom: () => safeBigNumberFrom,
74
80
  shortAddress: () => shortAddress,
81
+ updateTransactionDoneInRenderedTransactions: () => updateTransactionDoneInRenderedTransactions,
75
82
  weiToHumanReadable: () => weiToHumanReadable
76
83
  });
77
84
  module.exports = __toCommonJS(src_exports);
@@ -86,7 +93,7 @@ var Alert = ({ desc }) => {
86
93
  };
87
94
 
88
95
  // src/components/TxConfigForm/index.tsx
89
- var import_react9 = require("react");
96
+ var import_react11 = require("react");
90
97
  var import_client = require("react-dom/client");
91
98
  var import_react_query = require("@tanstack/react-query");
92
99
  var import_wagmi3 = require("wagmi");
@@ -149,8 +156,8 @@ var CloseIcon = () => {
149
156
  };
150
157
 
151
158
  // src/components/TxConfigForm/Form.tsx
152
- var import_react8 = require("react");
153
- var import_ethers4 = require("ethers");
159
+ var import_react10 = require("react");
160
+ var import_ethers5 = require("ethers");
154
161
  var import_wagmi2 = require("wagmi");
155
162
 
156
163
  // xswap.config.ts
@@ -237,6 +244,7 @@ var import_ethers3 = require("ethers");
237
244
  var ContractName = /* @__PURE__ */ ((ContractName2) => {
238
245
  ContractName2["BatchQuery"] = "BatchQuery";
239
246
  ContractName2["FeeCollector"] = "FeeCollector";
247
+ ContractName2["XSwapRouter"] = "XSwapRouter";
240
248
  return ContractName2;
241
249
  })(ContractName || {});
242
250
 
@@ -586,1422 +594,185 @@ var ERC20_default = [
586
594
  }
587
595
  ];
588
596
 
589
- // src/contracts/abi/XSwapRouter.json
590
- var XSwapRouter_default = [
591
- {
592
- inputs: [],
593
- stateMutability: "nonpayable",
594
- type: "constructor"
595
- },
596
- {
597
- inputs: [
598
- {
599
- internalType: "uint64",
600
- name: "destinationChainSelector",
601
- type: "uint64"
602
- }
603
- ],
604
- name: "DestinationChainNotWhitelisted",
605
- type: "error"
606
- },
607
- {
608
- inputs: [],
609
- name: "FailedToSendNative",
610
- type: "error"
611
- },
612
- {
613
- inputs: [],
614
- name: "IncorrectArrayLength",
615
- type: "error"
616
- },
617
- {
618
- inputs: [],
619
- name: "InvalidAddress",
620
- type: "error"
621
- },
622
- {
623
- inputs: [
624
- {
625
- internalType: "address",
626
- name: "router",
627
- type: "address"
628
- }
629
- ],
630
- name: "InvalidRouter",
631
- type: "error"
597
+ // src/contracts/abi/index.ts
598
+ var BatchQueryAbi = BatchQuery_default;
599
+ var ERC20Abi = ERC20_default;
600
+
601
+ // src/contracts/addresses.ts
602
+ var ADDRESSES = {
603
+ // arbitrum
604
+ "42161": {
605
+ ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
606
+ ["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
607
+ ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
632
608
  },
633
- {
634
- inputs: [
635
- {
636
- internalType: "address",
637
- name: "messageExecutor",
638
- type: "address"
639
- }
640
- ],
641
- name: "MessageAlreadyExecuted",
642
- type: "error"
609
+ // avalanche
610
+ "43114": {
611
+ ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
612
+ ["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
613
+ ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
643
614
  },
644
- {
645
- inputs: [],
646
- name: "MessageMustTransferOnlyOneToken",
647
- type: "error"
615
+ // base
616
+ "8453": {
617
+ ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
618
+ ["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
619
+ ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
648
620
  },
649
- {
650
- inputs: [
651
- {
652
- internalType: "uint64",
653
- name: "chainId",
654
- type: "uint64"
655
- }
656
- ],
657
- name: "NoXSwapRouterOnSelectedChain",
658
- type: "error"
621
+ // ethereum
622
+ "1": {
623
+ ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
624
+ ["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
625
+ ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
659
626
  },
660
- {
661
- inputs: [
662
- {
663
- internalType: "uint256",
664
- name: "currentBalance",
665
- type: "uint256"
666
- },
667
- {
668
- internalType: "uint256",
669
- name: "calculatedFees",
670
- type: "uint256"
671
- }
672
- ],
673
- name: "NotEnoughBalance",
674
- type: "error"
627
+ // optimism
628
+ "10": {
629
+ ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
630
+ ["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
631
+ ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
675
632
  },
676
- {
677
- inputs: [
678
- {
679
- internalType: "uint64",
680
- name: "sourceChainSelector",
681
- type: "uint64"
682
- },
683
- {
684
- internalType: "address",
685
- name: "sender",
686
- type: "address"
633
+ // polygon
634
+ "137": {
635
+ ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
636
+ ["XSwapRouter" /* XSwapRouter */]: "0xe1c14b9f065dead2e89ee35382f8bd42bdb87a04",
637
+ ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
638
+ }
639
+ };
640
+
641
+ // src/constants/index.ts
642
+ var DEFAULT_ECOSYSTEM = "evm" /* EVM */;
643
+ var NUMBER_INPUT_REGEX = /^[0-9]*[.,]?[0-9]*$/;
644
+ var SLIPPAGE_PRESETS = [0.5, 1.5, 3];
645
+ var DELIVERY_TIME = 30 * 1e3 * 60;
646
+ var EXPRESS_DELIVERY_TIME = 30 * 1e3;
647
+ var BALANCES_CHUNK_SIZE = 500;
648
+ var ROUTE_TIMEOUT_MS = 5e3;
649
+ var MINIMUM_DISPLAYED_TOKEN_AMOUNT = 1e-4;
650
+ var DEFAULT_SOURCE_CHAIN_ID = "1";
651
+ var CCIP_EXPLORER = "https://ccip.chain.link/";
652
+
653
+ // src/utils/contracts.ts
654
+ var IERC20 = new import_ethers2.ethers.utils.Interface(ERC20Abi);
655
+ var getBalanceOf = async (wallet, token, rpcUrl) => {
656
+ const provider = import_ethers2.ethers.getDefaultProvider(rpcUrl);
657
+ if (token === import_ethers2.ethers.constants.AddressZero) {
658
+ return import_ethers2.ethers.utils.formatEther(await provider.getBalance(wallet));
659
+ }
660
+ const contract = new import_ethers2.ethers.Contract(token, ERC20Abi, provider);
661
+ return import_ethers2.ethers.utils.formatUnits(
662
+ await contract.balanceOf(wallet),
663
+ await contract.decimals()
664
+ );
665
+ };
666
+ var getBalances = async (chain, wallet) => {
667
+ return {
668
+ ...await getNativeBalance(chain, wallet),
669
+ ...await getErc20Balances(chain, wallet)
670
+ };
671
+ };
672
+ var getNativeBalance = async (chain, wallet) => {
673
+ const native = chain.tokens.find(
674
+ ({ address }) => address === import_ethers2.ethers.constants.AddressZero
675
+ );
676
+ if (native) {
677
+ const provider = import_ethers2.ethers.getDefaultProvider(chain.publicRpcUrls[0]);
678
+ const balance = await provider.getBalance(wallet);
679
+ return {
680
+ [native.address]: balance
681
+ };
682
+ }
683
+ return {};
684
+ };
685
+ var getErc20Balances = async (chain, wallet) => {
686
+ const erc20Tokens = chain.tokens.filter(
687
+ ({ address }) => address !== import_ethers2.ethers.constants.AddressZero
688
+ );
689
+ const tokenChunks = chunkArray(erc20Tokens, BALANCES_CHUNK_SIZE);
690
+ const promises = tokenChunks.map(async (tokenChunk) => {
691
+ const tokenAddresses = tokenChunk.map((token) => token.address);
692
+ const calldatas = tokenChunk.map(
693
+ () => IERC20.encodeFunctionData("balanceOf", [wallet])
694
+ );
695
+ const contractAddress = ADDRESSES[chain.chainId]?.BatchQuery;
696
+ const rpcUrl = chain.publicRpcUrls[0];
697
+ if (contractAddress && rpcUrl) {
698
+ const contract = new import_ethers2.ethers.Contract(
699
+ contractAddress,
700
+ BatchQueryAbi,
701
+ import_ethers2.ethers.getDefaultProvider(rpcUrl)
702
+ );
703
+ return await contract["batchQuery"](tokenAddresses, calldatas);
704
+ }
705
+ return Promise.resolve();
706
+ });
707
+ const tokenBalances = (await Promise.all(promises)).flat().map(
708
+ (encodedBalance) => import_ethers2.ethers.utils.defaultAbiCoder.decode(["uint256"], encodedBalance)[0]
709
+ );
710
+ const balances = {};
711
+ erc20Tokens.forEach((token, index) => {
712
+ balances[token.address] = tokenBalances[index];
713
+ });
714
+ return balances;
715
+ };
716
+ var generateApproveTxData = (tokenAddress, spender, amount) => {
717
+ return tokenAddress !== import_ethers2.ethers.constants.AddressZero ? {
718
+ to: tokenAddress,
719
+ value: safeBigNumberFrom("0"),
720
+ data: IERC20.encodeFunctionData("approve", [spender, amount])
721
+ } : void 0;
722
+ };
723
+ var findPlaceholderIndex = (abi, funName, funParams, placeholderValue) => {
724
+ if (funParams.flat(Infinity).filter((param) => param === placeholderValue).length !== 1) {
725
+ throw new Error("Random placeholder value must be provided and unique.");
726
+ }
727
+ const iface = new import_ethers2.ethers.utils.Interface(abi);
728
+ const functionFragment = iface.getFunction(funName);
729
+ if (!functionFragment) {
730
+ throw new Error(`Can't find function "${funName}" in provided ABI.`);
731
+ }
732
+ const encodedFunData = iface.encodeFunctionData(functionFragment, funParams);
733
+ const paramData = encodedFunData.slice(10);
734
+ const chunks = [];
735
+ for (let i = 0; i < paramData.length; i += 64) {
736
+ chunks.push(paramData.slice(i, i + 64));
737
+ }
738
+ const searchValue = placeholderValue.toHexString().slice(2).padStart(64, "0");
739
+ const result = chunks.findIndex((chunk) => chunk === searchValue);
740
+ if (result === -1) {
741
+ throw new Error("Randomized parameter not found in the encoded data.");
742
+ }
743
+ return result;
744
+ };
745
+
746
+ // src/utils/strings.ts
747
+ var shortAddress = (address) => {
748
+ return `${address?.substring(0, 5)}...${address?.substring(
749
+ address.length - 5,
750
+ address.length
751
+ )}`;
752
+ };
753
+
754
+ // src/utils/index.ts
755
+ var import_date_fns = require("date-fns");
756
+ var replaceNull = (values, newValue) => {
757
+ const modifiedValues = [...values];
758
+ for (let i = 0; i < modifiedValues.length; i++) {
759
+ if (Array.isArray(modifiedValues[i])) {
760
+ modifiedValues[i] = replaceNull(modifiedValues[i], newValue);
761
+ } else {
762
+ if (modifiedValues[i] === null) {
763
+ modifiedValues[i] = newValue;
687
764
  }
688
- ],
689
- name: "SenderNotWhitelisted",
690
- type: "error"
691
- },
692
- {
693
- inputs: [
694
- {
695
- internalType: "address",
696
- name: "token",
697
- type: "address"
698
- }
699
- ],
700
- name: "TokenNotWhitelisted",
701
- type: "error"
702
- },
703
- {
704
- anonymous: false,
705
- inputs: [
706
- {
707
- indexed: false,
708
- internalType: "address",
709
- name: "previousAdmin",
710
- type: "address"
711
- },
712
- {
713
- indexed: false,
714
- internalType: "address",
715
- name: "newAdmin",
716
- type: "address"
717
- }
718
- ],
719
- name: "AdminChanged",
720
- type: "event"
721
- },
722
- {
723
- anonymous: false,
724
- inputs: [
725
- {
726
- indexed: true,
727
- internalType: "address",
728
- name: "beacon",
729
- type: "address"
730
- }
731
- ],
732
- name: "BeaconUpgraded",
733
- type: "event"
734
- },
735
- {
736
- anonymous: false,
737
- inputs: [
738
- {
739
- indexed: false,
740
- internalType: "address",
741
- name: "token",
742
- type: "address"
743
- },
744
- {
745
- indexed: false,
746
- internalType: "uint256",
747
- name: "tokenAmount",
748
- type: "uint256"
749
- }
750
- ],
751
- name: "EmergencyWithdraw",
752
- type: "event"
753
- },
754
- {
755
- anonymous: false,
756
- inputs: [
757
- {
758
- indexed: true,
759
- internalType: "bytes32",
760
- name: "messageId",
761
- type: "bytes32"
762
- },
763
- {
764
- indexed: true,
765
- internalType: "uint64",
766
- name: "sourceChainSelector",
767
- type: "uint64"
768
- },
769
- {
770
- indexed: true,
771
- internalType: "address",
772
- name: "sender",
773
- type: "address"
774
- },
775
- {
776
- indexed: false,
777
- internalType: "bytes",
778
- name: "data",
779
- type: "bytes"
780
- },
781
- {
782
- indexed: false,
783
- internalType: "address",
784
- name: "token",
785
- type: "address"
786
- },
787
- {
788
- indexed: false,
789
- internalType: "uint256",
790
- name: "tokenAmount",
791
- type: "uint256"
792
- }
793
- ],
794
- name: "ExecutorRunFailed",
795
- type: "event"
796
- },
797
- {
798
- anonymous: false,
799
- inputs: [
800
- {
801
- indexed: false,
802
- internalType: "address",
803
- name: "newExecutor",
804
- type: "address"
805
- }
806
- ],
807
- name: "ExecutorUpdated",
808
- type: "event"
809
- },
810
- {
811
- anonymous: false,
812
- inputs: [
813
- {
814
- indexed: true,
815
- internalType: "bytes32",
816
- name: "messageId",
817
- type: "bytes32"
818
- },
819
- {
820
- indexed: true,
821
- internalType: "address",
822
- name: "messageExecutor",
823
- type: "address"
824
- },
825
- {
826
- indexed: true,
827
- internalType: "bytes32",
828
- name: "executionHash",
829
- type: "bytes32"
830
- },
831
- {
832
- indexed: false,
833
- internalType: "address",
834
- name: "token",
835
- type: "address"
836
- },
837
- {
838
- indexed: false,
839
- internalType: "uint256",
840
- name: "tokenAmount",
841
- type: "uint256"
842
- }
843
- ],
844
- name: "FundsReturnedForMessageExecution",
845
- type: "event"
846
- },
847
- {
848
- anonymous: false,
849
- inputs: [
850
- {
851
- indexed: false,
852
- internalType: "uint8",
853
- name: "version",
854
- type: "uint8"
855
- }
856
- ],
857
- name: "Initialized",
858
- type: "event"
859
- },
860
- {
861
- anonymous: false,
862
- inputs: [
863
- {
864
- indexed: true,
865
- internalType: "bytes32",
866
- name: "messageId",
867
- type: "bytes32"
868
- },
869
- {
870
- indexed: true,
871
- internalType: "uint64",
872
- name: "sourceChainSelector",
873
- type: "uint64"
874
- },
875
- {
876
- indexed: true,
877
- internalType: "address",
878
- name: "sender",
879
- type: "address"
880
- },
881
- {
882
- indexed: false,
883
- internalType: "bytes",
884
- name: "data",
885
- type: "bytes"
886
- },
887
- {
888
- indexed: false,
889
- internalType: "address",
890
- name: "token",
891
- type: "address"
892
- },
893
- {
894
- indexed: false,
895
- internalType: "uint256",
896
- name: "tokenAmount",
897
- type: "uint256"
898
- }
899
- ],
900
- name: "MessageReceived",
901
- type: "event"
902
- },
903
- {
904
- anonymous: false,
905
- inputs: [
906
- {
907
- indexed: true,
908
- internalType: "bytes32",
909
- name: "messageId",
910
- type: "bytes32"
911
- },
912
- {
913
- indexed: true,
914
- internalType: "uint64",
915
- name: "destinationChainSelector",
916
- type: "uint64"
917
- },
918
- {
919
- indexed: true,
920
- internalType: "address",
921
- name: "sender",
922
- type: "address"
923
- },
924
- {
925
- indexed: false,
926
- internalType: "bytes",
927
- name: "data",
928
- type: "bytes"
929
- },
930
- {
931
- indexed: false,
932
- internalType: "address",
933
- name: "token",
934
- type: "address"
935
- },
936
- {
937
- indexed: false,
938
- internalType: "uint256",
939
- name: "tokenAmount",
940
- type: "uint256"
941
- },
942
- {
943
- indexed: false,
944
- internalType: "uint256",
945
- name: "valueForInstantCcipRecieve",
946
- type: "uint256"
947
- },
948
- {
949
- indexed: false,
950
- internalType: "address",
951
- name: "transferedToken",
952
- type: "address"
953
- },
954
- {
955
- indexed: false,
956
- internalType: "uint256",
957
- name: "transferedTokenAmount",
958
- type: "uint256"
959
- }
960
- ],
961
- name: "MessageSent",
962
- type: "event"
963
- },
964
- {
965
- anonymous: false,
966
- inputs: [
967
- {
968
- indexed: true,
969
- internalType: "address",
970
- name: "previousOwner",
971
- type: "address"
972
- },
973
- {
974
- indexed: true,
975
- internalType: "address",
976
- name: "newOwner",
977
- type: "address"
978
- }
979
- ],
980
- name: "OwnershipTransferred",
981
- type: "event"
982
- },
983
- {
984
- anonymous: false,
985
- inputs: [
986
- {
987
- indexed: false,
988
- internalType: "address",
989
- name: "newFeeCollectorAddress",
990
- type: "address"
991
- }
992
- ],
993
- name: "SetFeeCollectorAddress",
994
- type: "event"
995
- },
996
- {
997
- anonymous: false,
998
- inputs: [
999
- {
1000
- indexed: false,
1001
- internalType: "address",
1002
- name: "newFeeOracleAddress",
1003
- type: "address"
1004
- }
1005
- ],
1006
- name: "SetFeeOracleAddress",
1007
- type: "event"
1008
- },
1009
- {
1010
- anonymous: false,
1011
- inputs: [
1012
- {
1013
- indexed: true,
1014
- internalType: "address",
1015
- name: "implementation",
1016
- type: "address"
1017
- }
1018
- ],
1019
- name: "Upgraded",
1020
- type: "event"
1021
- },
1022
- {
1023
- inputs: [
1024
- {
1025
- components: [
1026
- {
1027
- internalType: "bytes32",
1028
- name: "messageId",
1029
- type: "bytes32"
1030
- },
1031
- {
1032
- internalType: "uint64",
1033
- name: "sourceChainSelector",
1034
- type: "uint64"
1035
- },
1036
- {
1037
- internalType: "bytes",
1038
- name: "sender",
1039
- type: "bytes"
1040
- },
1041
- {
1042
- internalType: "bytes",
1043
- name: "data",
1044
- type: "bytes"
1045
- },
1046
- {
1047
- components: [
1048
- {
1049
- internalType: "address",
1050
- name: "token",
1051
- type: "address"
1052
- },
1053
- {
1054
- internalType: "uint256",
1055
- name: "amount",
1056
- type: "uint256"
1057
- }
1058
- ],
1059
- internalType: "struct Client.EVMTokenAmount[]",
1060
- name: "destTokenAmounts",
1061
- type: "tuple[]"
1062
- }
1063
- ],
1064
- internalType: "struct Client.Any2EVMMessage",
1065
- name: "message",
1066
- type: "tuple"
1067
- }
1068
- ],
1069
- name: "ccipReceive",
1070
- outputs: [],
1071
- stateMutability: "nonpayable",
1072
- type: "function"
1073
- },
1074
- {
1075
- inputs: [
1076
- {
1077
- internalType: "uint64",
1078
- name: "",
1079
- type: "uint64"
1080
- }
1081
- ],
1082
- name: "chainSelectorToXSwapRouterMap",
1083
- outputs: [
1084
- {
1085
- internalType: "address",
1086
- name: "",
1087
- type: "address"
1088
- }
1089
- ],
1090
- stateMutability: "view",
1091
- type: "function"
1092
- },
1093
- {
1094
- inputs: [
1095
- {
1096
- internalType: "address",
1097
- name: "_tokenToWithdraw",
1098
- type: "address"
1099
- },
1100
- {
1101
- internalType: "uint256",
1102
- name: "_amountToWithdraw",
1103
- type: "uint256"
1104
- }
1105
- ],
1106
- name: "emergencyWithdraw",
1107
- outputs: [],
1108
- stateMutability: "nonpayable",
1109
- type: "function"
1110
- },
1111
- {
1112
- inputs: [],
1113
- name: "feeCollectorAddress",
1114
- outputs: [
1115
- {
1116
- internalType: "address",
1117
- name: "",
1118
- type: "address"
1119
- }
1120
- ],
1121
- stateMutability: "view",
1122
- type: "function"
1123
- },
1124
- {
1125
- inputs: [],
1126
- name: "feeOracleAddress",
1127
- outputs: [
1128
- {
1129
- internalType: "address",
1130
- name: "",
1131
- type: "address"
1132
- }
1133
- ],
1134
- stateMutability: "view",
1135
- type: "function"
1136
- },
1137
- {
1138
- inputs: [
1139
- {
1140
- internalType: "address",
1141
- name: "_paymentToken",
1142
- type: "address"
1143
- },
1144
- {
1145
- internalType: "uint64",
1146
- name: "_destinationChainSelector",
1147
- type: "uint64"
1148
- },
1149
- {
1150
- components: [
1151
- {
1152
- internalType: "address",
1153
- name: "receiver",
1154
- type: "address"
1155
- },
1156
- {
1157
- internalType: "address",
1158
- name: "tokenOut",
1159
- type: "address"
1160
- },
1161
- {
1162
- internalType: "uint256",
1163
- name: "estimatedAmountOut",
1164
- type: "uint256"
1165
- },
1166
- {
1167
- components: [
1168
- {
1169
- internalType: "enum CallType",
1170
- name: "callType",
1171
- type: "uint8"
1172
- },
1173
- {
1174
- internalType: "address",
1175
- name: "target",
1176
- type: "address"
1177
- },
1178
- {
1179
- internalType: "uint256",
1180
- name: "value",
1181
- type: "uint256"
1182
- },
1183
- {
1184
- internalType: "bytes",
1185
- name: "callData",
1186
- type: "bytes"
1187
- },
1188
- {
1189
- internalType: "bytes",
1190
- name: "payload",
1191
- type: "bytes"
1192
- }
1193
- ],
1194
- internalType: "struct Call[]",
1195
- name: "calls",
1196
- type: "tuple[]"
1197
- }
1198
- ],
1199
- internalType: "struct SwapDataDestination",
1200
- name: "_swapDestinationData",
1201
- type: "tuple"
1202
- },
1203
- {
1204
- internalType: "address",
1205
- name: "_token",
1206
- type: "address"
1207
- },
1208
- {
1209
- internalType: "uint256",
1210
- name: "_amount",
1211
- type: "uint256"
1212
- },
1213
- {
1214
- internalType: "uint256",
1215
- name: "_gasLimit",
1216
- type: "uint256"
1217
- }
1218
- ],
1219
- name: "getFees",
1220
- outputs: [
1221
- {
1222
- components: [
1223
- {
1224
- internalType: "uint256",
1225
- name: "ccipFee",
1226
- type: "uint256"
1227
- },
1228
- {
1229
- components: [
1230
- {
1231
- internalType: "uint256",
1232
- name: "tokenFee",
1233
- type: "uint256"
1234
- },
1235
- {
1236
- internalType: "uint256",
1237
- name: "nativeFee",
1238
- type: "uint256"
1239
- }
1240
- ],
1241
- internalType: "struct XSwapFee",
1242
- name: "xSwapFee",
1243
- type: "tuple"
1244
- }
1245
- ],
1246
- internalType: "struct MessageFees",
1247
- name: "fees",
1248
- type: "tuple"
1249
- }
1250
- ],
1251
- stateMutability: "view",
1252
- type: "function"
1253
- },
1254
- {
1255
- inputs: [],
1256
- name: "getRouter",
1257
- outputs: [
1258
- {
1259
- internalType: "address",
1260
- name: "",
1261
- type: "address"
1262
- }
1263
- ],
1264
- stateMutability: "view",
1265
- type: "function"
1266
- },
1267
- {
1268
- inputs: [
1269
- {
1270
- internalType: "address",
1271
- name: "_ccipRouter",
1272
- type: "address"
1273
- },
1274
- {
1275
- internalType: "address",
1276
- name: "_feeOracle",
1277
- type: "address"
1278
- },
1279
- {
1280
- internalType: "address",
1281
- name: "_feeCollector",
1282
- type: "address"
1283
- },
1284
- {
1285
- internalType: "address",
1286
- name: "_xSwapExecutor",
1287
- type: "address"
1288
- },
1289
- {
1290
- internalType: "address",
1291
- name: "_owner",
1292
- type: "address"
1293
- }
1294
- ],
1295
- name: "initialize",
1296
- outputs: [],
1297
- stateMutability: "nonpayable",
1298
- type: "function"
1299
- },
1300
- {
1301
- inputs: [
1302
- {
1303
- components: [
1304
- {
1305
- internalType: "bytes32",
1306
- name: "messageId",
1307
- type: "bytes32"
1308
- },
1309
- {
1310
- internalType: "uint64",
1311
- name: "sourceChainSelector",
1312
- type: "uint64"
1313
- },
1314
- {
1315
- internalType: "bytes",
1316
- name: "sender",
1317
- type: "bytes"
1318
- },
1319
- {
1320
- internalType: "bytes",
1321
- name: "data",
1322
- type: "bytes"
1323
- },
1324
- {
1325
- components: [
1326
- {
1327
- internalType: "address",
1328
- name: "token",
1329
- type: "address"
1330
- },
1331
- {
1332
- internalType: "uint256",
1333
- name: "amount",
1334
- type: "uint256"
1335
- }
1336
- ],
1337
- internalType: "struct Client.EVMTokenAmount[]",
1338
- name: "destTokenAmounts",
1339
- type: "tuple[]"
1340
- }
1341
- ],
1342
- internalType: "struct Client.Any2EVMMessage",
1343
- name: "_any2EvmMessage",
1344
- type: "tuple"
1345
- }
1346
- ],
1347
- name: "instantCcipReceive",
1348
- outputs: [],
1349
- stateMutability: "nonpayable",
1350
- type: "function"
1351
- },
1352
- {
1353
- inputs: [
1354
- {
1355
- internalType: "bytes32",
1356
- name: "",
1357
- type: "bytes32"
1358
- }
1359
- ],
1360
- name: "messageExecutionHashToExecutorMap",
1361
- outputs: [
1362
- {
1363
- internalType: "address",
1364
- name: "",
1365
- type: "address"
1366
- }
1367
- ],
1368
- stateMutability: "view",
1369
- type: "function"
1370
- },
1371
- {
1372
- inputs: [],
1373
- name: "owner",
1374
- outputs: [
1375
- {
1376
- internalType: "address",
1377
- name: "",
1378
- type: "address"
1379
- }
1380
- ],
1381
- stateMutability: "view",
1382
- type: "function"
1383
- },
1384
- {
1385
- inputs: [],
1386
- name: "proxiableUUID",
1387
- outputs: [
1388
- {
1389
- internalType: "bytes32",
1390
- name: "",
1391
- type: "bytes32"
1392
- }
1393
- ],
1394
- stateMutability: "view",
1395
- type: "function"
1396
- },
1397
- {
1398
- inputs: [],
1399
- name: "renounceOwnership",
1400
- outputs: [],
1401
- stateMutability: "nonpayable",
1402
- type: "function"
1403
- },
1404
- {
1405
- inputs: [
1406
- {
1407
- internalType: "address",
1408
- name: "_feeCollectorAddress",
1409
- type: "address"
1410
- }
1411
- ],
1412
- name: "setFeeCollectorAddress",
1413
- outputs: [],
1414
- stateMutability: "nonpayable",
1415
- type: "function"
1416
- },
1417
- {
1418
- inputs: [
1419
- {
1420
- internalType: "address",
1421
- name: "_feeOracleAddress",
1422
- type: "address"
1423
- }
1424
- ],
1425
- name: "setFeeOracleAddress",
1426
- outputs: [],
1427
- stateMutability: "nonpayable",
1428
- type: "function"
1429
- },
1430
- {
1431
- inputs: [
1432
- {
1433
- internalType: "address",
1434
- name: "_router",
1435
- type: "address"
1436
- }
1437
- ],
1438
- name: "setRouter",
1439
- outputs: [],
1440
- stateMutability: "nonpayable",
1441
- type: "function"
1442
- },
1443
- {
1444
- inputs: [
1445
- {
1446
- internalType: "address",
1447
- name: "_xSwapExecutor",
1448
- type: "address"
1449
- }
1450
- ],
1451
- name: "setXSwapExecutor",
1452
- outputs: [],
1453
- stateMutability: "nonpayable",
1454
- type: "function"
1455
- },
1456
- {
1457
- inputs: [
1458
- {
1459
- internalType: "bytes4",
1460
- name: "interfaceId",
1461
- type: "bytes4"
1462
- }
1463
- ],
1464
- name: "supportsInterface",
1465
- outputs: [
1466
- {
1467
- internalType: "bool",
1468
- name: "",
1469
- type: "bool"
1470
- }
1471
- ],
1472
- stateMutability: "pure",
1473
- type: "function"
1474
- },
1475
- {
1476
- inputs: [
1477
- {
1478
- internalType: "address",
1479
- name: "_paymentToken",
1480
- type: "address"
1481
- },
1482
- {
1483
- internalType: "uint64",
1484
- name: "_destinationChainSelector",
1485
- type: "uint64"
1486
- },
1487
- {
1488
- components: [
1489
- {
1490
- internalType: "address",
1491
- name: "receiver",
1492
- type: "address"
1493
- },
1494
- {
1495
- internalType: "address",
1496
- name: "tokenOut",
1497
- type: "address"
1498
- },
1499
- {
1500
- internalType: "uint256",
1501
- name: "estimatedAmountOut",
1502
- type: "uint256"
1503
- },
1504
- {
1505
- components: [
1506
- {
1507
- internalType: "enum CallType",
1508
- name: "callType",
1509
- type: "uint8"
1510
- },
1511
- {
1512
- internalType: "address",
1513
- name: "target",
1514
- type: "address"
1515
- },
1516
- {
1517
- internalType: "uint256",
1518
- name: "value",
1519
- type: "uint256"
1520
- },
1521
- {
1522
- internalType: "bytes",
1523
- name: "callData",
1524
- type: "bytes"
1525
- },
1526
- {
1527
- internalType: "bytes",
1528
- name: "payload",
1529
- type: "bytes"
1530
- }
1531
- ],
1532
- internalType: "struct Call[]",
1533
- name: "calls",
1534
- type: "tuple[]"
1535
- }
1536
- ],
1537
- internalType: "struct SwapDataDestination",
1538
- name: "_swapDestinationData",
1539
- type: "tuple"
1540
- },
1541
- {
1542
- components: [
1543
- {
1544
- internalType: "address",
1545
- name: "tokenIn",
1546
- type: "address"
1547
- },
1548
- {
1549
- internalType: "uint256",
1550
- name: "amountIn",
1551
- type: "uint256"
1552
- },
1553
- {
1554
- internalType: "address",
1555
- name: "tokenOut",
1556
- type: "address"
1557
- },
1558
- {
1559
- internalType: "uint256",
1560
- name: "estimatedAmountOut",
1561
- type: "uint256"
1562
- },
1563
- {
1564
- internalType: "uint256",
1565
- name: "valueForDestinationGas",
1566
- type: "uint256"
1567
- },
1568
- {
1569
- internalType: "uint256",
1570
- name: "valueForInstantCcipRecieve",
1571
- type: "uint256"
1572
- },
1573
- {
1574
- components: [
1575
- {
1576
- internalType: "enum CallType",
1577
- name: "callType",
1578
- type: "uint8"
1579
- },
1580
- {
1581
- internalType: "address",
1582
- name: "target",
1583
- type: "address"
1584
- },
1585
- {
1586
- internalType: "uint256",
1587
- name: "value",
1588
- type: "uint256"
1589
- },
1590
- {
1591
- internalType: "bytes",
1592
- name: "callData",
1593
- type: "bytes"
1594
- },
1595
- {
1596
- internalType: "bytes",
1597
- name: "payload",
1598
- type: "bytes"
1599
- }
1600
- ],
1601
- internalType: "struct Call[]",
1602
- name: "calls",
1603
- type: "tuple[]"
1604
- }
1605
- ],
1606
- internalType: "struct SwapDataOrigin",
1607
- name: "_swapOriginData",
1608
- type: "tuple"
1609
- },
1610
- {
1611
- internalType: "uint256",
1612
- name: "_gasLimit",
1613
- type: "uint256"
1614
- }
1615
- ],
1616
- name: "swapAndSendMessage",
1617
- outputs: [
1618
- {
1619
- internalType: "bytes32",
1620
- name: "messageId",
1621
- type: "bytes32"
1622
- }
1623
- ],
1624
- stateMutability: "payable",
1625
- type: "function"
1626
- },
1627
- {
1628
- inputs: [
1629
- {
1630
- internalType: "address",
1631
- name: "newOwner",
1632
- type: "address"
1633
- }
1634
- ],
1635
- name: "transferOwnership",
1636
- outputs: [],
1637
- stateMutability: "nonpayable",
1638
- type: "function"
1639
- },
1640
- {
1641
- inputs: [
1642
- {
1643
- internalType: "uint64",
1644
- name: "_chainSelector",
1645
- type: "uint64"
1646
- },
1647
- {
1648
- internalType: "address",
1649
- name: "_xSwapRouter",
1650
- type: "address"
1651
- }
1652
- ],
1653
- name: "updateChainSelectorToXSwapRouterMap",
1654
- outputs: [],
1655
- stateMutability: "nonpayable",
1656
- type: "function"
1657
- },
1658
- {
1659
- inputs: [
1660
- {
1661
- internalType: "uint64[]",
1662
- name: "_chainSelectors",
1663
- type: "uint64[]"
1664
- },
1665
- {
1666
- internalType: "address[]",
1667
- name: "_xSwapRouters",
1668
- type: "address[]"
1669
- }
1670
- ],
1671
- name: "updateChainSelectorToXSwapRouterMapMany",
1672
- outputs: [],
1673
- stateMutability: "nonpayable",
1674
- type: "function"
1675
- },
1676
- {
1677
- inputs: [
1678
- {
1679
- internalType: "uint64",
1680
- name: "_sourceChainSelector",
1681
- type: "uint64"
1682
- },
1683
- {
1684
- internalType: "address",
1685
- name: "_sender",
1686
- type: "address"
1687
- },
1688
- {
1689
- internalType: "bool",
1690
- name: "_isWhitelisted",
1691
- type: "bool"
1692
- }
1693
- ],
1694
- name: "updateWhitelistSender",
1695
- outputs: [],
1696
- stateMutability: "nonpayable",
1697
- type: "function"
1698
- },
1699
- {
1700
- inputs: [
1701
- {
1702
- internalType: "uint64[]",
1703
- name: "_sourceChainSelectors",
1704
- type: "uint64[]"
1705
- },
1706
- {
1707
- internalType: "address[]",
1708
- name: "_senders",
1709
- type: "address[]"
1710
- },
1711
- {
1712
- internalType: "bool[]",
1713
- name: "_areWhitelisted",
1714
- type: "bool[]"
1715
- }
1716
- ],
1717
- name: "updateWhitelistSenderMany",
1718
- outputs: [],
1719
- stateMutability: "nonpayable",
1720
- type: "function"
1721
- },
1722
- {
1723
- inputs: [
1724
- {
1725
- internalType: "address",
1726
- name: "_token",
1727
- type: "address"
1728
- },
1729
- {
1730
- internalType: "bool",
1731
- name: "_isWhitelisted",
1732
- type: "bool"
1733
- }
1734
- ],
1735
- name: "updateWhitelistToken",
1736
- outputs: [],
1737
- stateMutability: "nonpayable",
1738
- type: "function"
1739
- },
1740
- {
1741
- inputs: [
1742
- {
1743
- internalType: "address",
1744
- name: "newImplementation",
1745
- type: "address"
1746
- }
1747
- ],
1748
- name: "upgradeTo",
1749
- outputs: [],
1750
- stateMutability: "nonpayable",
1751
- type: "function"
1752
- },
1753
- {
1754
- inputs: [
1755
- {
1756
- internalType: "address",
1757
- name: "newImplementation",
1758
- type: "address"
1759
- },
1760
- {
1761
- internalType: "bytes",
1762
- name: "data",
1763
- type: "bytes"
1764
- }
1765
- ],
1766
- name: "upgradeToAndCall",
1767
- outputs: [],
1768
- stateMutability: "payable",
1769
- type: "function"
1770
- },
1771
- {
1772
- inputs: [
1773
- {
1774
- internalType: "uint64",
1775
- name: "",
1776
- type: "uint64"
1777
- },
1778
- {
1779
- internalType: "address",
1780
- name: "",
1781
- type: "address"
1782
- }
1783
- ],
1784
- name: "whitelistedSenders",
1785
- outputs: [
1786
- {
1787
- internalType: "bool",
1788
- name: "",
1789
- type: "bool"
1790
- }
1791
- ],
1792
- stateMutability: "view",
1793
- type: "function"
1794
- },
1795
- {
1796
- inputs: [
1797
- {
1798
- internalType: "address",
1799
- name: "",
1800
- type: "address"
1801
- }
1802
- ],
1803
- name: "whitelistedTokens",
1804
- outputs: [
1805
- {
1806
- internalType: "bool",
1807
- name: "",
1808
- type: "bool"
1809
- }
1810
- ],
1811
- stateMutability: "view",
1812
- type: "function"
1813
- },
1814
- {
1815
- inputs: [],
1816
- name: "xSwapExecutor",
1817
- outputs: [
1818
- {
1819
- internalType: "address",
1820
- name: "",
1821
- type: "address"
1822
- }
1823
- ],
1824
- stateMutability: "view",
1825
- type: "function"
1826
- },
1827
- {
1828
- stateMutability: "payable",
1829
- type: "receive"
1830
- }
1831
- ];
1832
-
1833
- // src/contracts/abi/index.ts
1834
- var BatchQueryAbi = BatchQuery_default;
1835
- var ERC20Abi = ERC20_default;
1836
- var XSwapRouterAbi = XSwapRouter_default;
1837
-
1838
- // src/contracts/addresses.ts
1839
- var ADDRESSES = {
1840
- // arbitrum
1841
- "42161": {
1842
- ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
1843
- ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
1844
- },
1845
- // avalanche
1846
- "43114": {
1847
- ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
1848
- ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
1849
- },
1850
- // base
1851
- "8453": {
1852
- ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
1853
- ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
1854
- },
1855
- // ethereum
1856
- "1": {
1857
- ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
1858
- ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
1859
- },
1860
- // optimism
1861
- "10": {
1862
- ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
1863
- ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
1864
- },
1865
- // polygon
1866
- "137": {
1867
- ["BatchQuery" /* BatchQuery */]: "0xb5f9934ea0810ef5faa677e8c68c6983b88664b1",
1868
- ["FeeCollector" /* FeeCollector */]: "0xb37275558f02f05104c2ba35199d16adeb43432f"
1869
- }
1870
- };
1871
-
1872
- // src/constants/index.ts
1873
- var DEFAULT_ECOSYSTEM = "evm" /* EVM */;
1874
- var NUMBER_INPUT_REGEX = /^[0-9]*[.,]?[0-9]*$/;
1875
- var SLIPPAGE_PRESETS = [0.5, 1.5, 3];
1876
- var DELIVERY_TIME = 30 * 1e3 * 60;
1877
- var EXPRESS_DELIVERY_TIME = 30 * 1e3;
1878
- var BALANCES_CHUNK_SIZE = 500;
1879
- var BALANCE_DISPLAY_MIN_LIMIT = 1e-4;
1880
- var ROUTE_TIMEOUT_MS = 5e3;
1881
- var MINIMUM_DISPLAYED_TOKEN_AMOUNT = 1e-5;
1882
-
1883
- // src/utils/contracts.ts
1884
- var IERC20 = new import_ethers2.ethers.utils.Interface(ERC20Abi);
1885
- var getBalanceOf = async (wallet, token, rpcUrl) => {
1886
- const provider = import_ethers2.ethers.getDefaultProvider(rpcUrl);
1887
- if (token === import_ethers2.ethers.constants.AddressZero) {
1888
- return import_ethers2.ethers.utils.formatEther(await provider.getBalance(wallet));
1889
- }
1890
- const contract = new import_ethers2.ethers.Contract(token, ERC20Abi, provider);
1891
- return import_ethers2.ethers.utils.formatUnits(
1892
- await contract.balanceOf(wallet),
1893
- await contract.decimals()
1894
- );
1895
- };
1896
- var getBalances = async (chain, wallet) => {
1897
- return {
1898
- ...await getNativeBalance(chain, wallet),
1899
- ...await getErc20Balances(chain, wallet)
1900
- };
1901
- };
1902
- var getNativeBalance = async (chain, wallet) => {
1903
- const native = chain.tokens.find(
1904
- ({ address }) => address === import_ethers2.ethers.constants.AddressZero
1905
- );
1906
- if (native) {
1907
- const provider = import_ethers2.ethers.getDefaultProvider(chain.publicRpcUrls[0]);
1908
- const balance = await provider.getBalance(wallet);
1909
- return {
1910
- [native.address]: balance
1911
- };
1912
- }
1913
- return {};
1914
- };
1915
- var getErc20Balances = async (chain, wallet) => {
1916
- const erc20Tokens = chain.tokens.filter(
1917
- ({ address }) => address !== import_ethers2.ethers.constants.AddressZero
1918
- );
1919
- const tokenChunks = chunkArray(erc20Tokens, BALANCES_CHUNK_SIZE);
1920
- const promises = tokenChunks.map(async (tokenChunk) => {
1921
- const tokenAddresses = tokenChunk.map((token) => token.address);
1922
- const calldatas = tokenChunk.map(
1923
- () => IERC20.encodeFunctionData("balanceOf", [wallet])
1924
- );
1925
- const contractAddress = ADDRESSES[chain.chainId]?.BatchQuery;
1926
- const rpcUrl = chain.publicRpcUrls[0];
1927
- if (contractAddress && rpcUrl) {
1928
- const contract = new import_ethers2.ethers.Contract(
1929
- contractAddress,
1930
- BatchQueryAbi,
1931
- import_ethers2.ethers.getDefaultProvider(rpcUrl)
1932
- );
1933
- return await contract["batchQuery"](tokenAddresses, calldatas);
1934
- }
1935
- return Promise.resolve();
1936
- });
1937
- const tokenBalances = (await Promise.all(promises)).flat().map(
1938
- (encodedBalance) => import_ethers2.ethers.utils.defaultAbiCoder.decode(["uint256"], encodedBalance)[0]
1939
- );
1940
- const balances = {};
1941
- erc20Tokens.forEach((token, index) => {
1942
- balances[token.address] = tokenBalances[index];
1943
- });
1944
- return balances;
1945
- };
1946
- var generateApproveTxData = (tokenAddress, spender, amount) => {
1947
- return tokenAddress !== import_ethers2.ethers.constants.AddressZero ? {
1948
- to: tokenAddress,
1949
- value: safeBigNumberFrom("0"),
1950
- data: IERC20.encodeFunctionData("approve", [spender, amount])
1951
- } : void 0;
1952
- };
1953
- var findPlaceholderIndex = (abi, funName, funParams, placeholderValue) => {
1954
- if (funParams.flat(Infinity).filter((param) => param === placeholderValue).length !== 1) {
1955
- throw new Error("Random placeholder value must be provided and unique.");
1956
- }
1957
- const iface = new import_ethers2.ethers.utils.Interface(abi);
1958
- const functionFragment = iface.getFunction(funName);
1959
- if (!functionFragment) {
1960
- throw new Error(`Can't find function "${funName}" in provided ABI.`);
1961
- }
1962
- const encodedFunData = iface.encodeFunctionData(functionFragment, funParams);
1963
- const paramData = encodedFunData.slice(10);
1964
- const chunks = [];
1965
- for (let i = 0; i < paramData.length; i += 64) {
1966
- chunks.push(paramData.slice(i, i + 64));
1967
- }
1968
- const searchValue = placeholderValue.toHexString().slice(2).padStart(64, "0");
1969
- const result = chunks.findIndex((chunk) => chunk === searchValue);
1970
- if (result === -1) {
1971
- throw new Error("Randomized parameter not found in the encoded data.");
1972
- }
1973
- return result;
1974
- };
1975
-
1976
- // src/utils/strings.ts
1977
- var shortAddress = (address) => {
1978
- return `${address?.substring(0, 5)}...${address?.substring(
1979
- address.length - 5,
1980
- address.length
1981
- )}`;
1982
- };
1983
-
1984
- // src/utils/index.ts
1985
- var replaceNull = (values, newValue) => {
1986
- const modifiedValues = [...values];
1987
- for (let i = 0; i < modifiedValues.length; i++) {
1988
- if (Array.isArray(modifiedValues[i])) {
1989
- modifiedValues[i] = replaceNull(modifiedValues[i], newValue);
1990
- } else {
1991
- if (modifiedValues[i] === null) {
1992
- modifiedValues[i] = newValue;
1993
- }
1994
- }
1995
- }
1996
- return modifiedValues;
1997
- };
1998
- var deepMergeObjects = (obj1, obj2) => {
1999
- for (const key in obj2) {
2000
- if (obj2.hasOwnProperty(key)) {
2001
- if (obj1.hasOwnProperty(key) && typeof obj1[key] === "object" && typeof obj2[key] === "object") {
2002
- deepMergeObjects(obj1[key], obj2[key]);
2003
- } else {
2004
- obj1[key] = obj2[key];
765
+ }
766
+ }
767
+ return modifiedValues;
768
+ };
769
+ var deepMergeObjects = (obj1, obj2) => {
770
+ for (const key in obj2) {
771
+ if (obj2.hasOwnProperty(key)) {
772
+ if (obj1.hasOwnProperty(key) && typeof obj1[key] === "object" && typeof obj2[key] === "object") {
773
+ deepMergeObjects(obj1[key], obj2[key]);
774
+ } else {
775
+ obj1[key] = obj2[key];
2005
776
  }
2006
777
  }
2007
778
  }
@@ -2014,6 +785,10 @@ var chunkArray = (array, chunkSize) => {
2014
785
  }
2015
786
  return result;
2016
787
  };
788
+ var getDate = (blockTimestamp) => {
789
+ const date = new Date(blockTimestamp * 1e3);
790
+ return (0, import_date_fns.format)(date, "d MMM yyyy HH:mm:ss");
791
+ };
2017
792
 
2018
793
  // src/services/integrations/customCalls/staking.ts
2019
794
  var generateStakingCalls = ({
@@ -2081,6 +856,7 @@ var generateStakingCalls = ({
2081
856
  };
2082
857
 
2083
858
  // src/services/integrations/transactions.ts
859
+ var import_ethers4 = require("ethers");
2084
860
  var getSwapTx = async ({
2085
861
  dstChain,
2086
862
  dstToken,
@@ -2090,6 +866,7 @@ var getSwapTx = async ({
2090
866
  const supportedChains = (await getChains()).filter(
2091
867
  ({ web3Environment, swapSupported }) => web3Environment === "mainnet" /* MAINNET */ && swapSupported
2092
868
  );
869
+ validateSwapTxData(supportedChains, dstChain, dstToken);
2093
870
  const route = await openTxConfigForm({
2094
871
  dstChainId: dstChain,
2095
872
  dstTokenAddr: dstToken,
@@ -2099,6 +876,119 @@ var getSwapTx = async ({
2099
876
  });
2100
877
  return route.transactions;
2101
878
  };
879
+ var validateSwapTxData = (supportedChains, dstChain, dstToken) => {
880
+ const supportedDstChain = supportedChains.find(
881
+ ({ chainId }) => chainId === dstChain
882
+ );
883
+ if (!supportedDstChain) {
884
+ throw new Error(`Provided chain '${dstChain}' is not supported`);
885
+ }
886
+ if (!supportedDstChain.tokens.some(({ address }) => address === dstToken)) {
887
+ throw new Error(`Provided token '${dstToken}' is not supported`);
888
+ }
889
+ };
890
+ var monitorTransactionStatus = async (srcChainId, txHash) => {
891
+ const txReceipt = await getTxReceipt(srcChainId, txHash);
892
+ if (!txReceipt) {
893
+ throw new Error(
894
+ `No transaction found for chain ${srcChainId} tx ${txHash}`
895
+ );
896
+ }
897
+ const supportedChains = (await getChains()).filter(
898
+ ({ web3Environment, swapSupported }) => web3Environment === "mainnet" /* MAINNET */ && swapSupported
899
+ );
900
+ const messageSentEventSignature = "MessageSent(bytes32,uint64,address,bytes,address,uint256,uint256,address,uint256)";
901
+ const messageSentEventAbi = [
902
+ "event MessageSent(bytes32 indexed messageId, uint64 indexed destinationChainSelector, address indexed sender, bytes data, address token, uint256 tokenAmount, uint256 valueForInstantCcipRecieve, address transferedToken, uint256 transferedTokenAmount)"
903
+ ];
904
+ const messageReceivedEventSignature = "MessageReceived(bytes32,uint64,address,bytes,address,uint256)";
905
+ const messageReceivedEventAbi = [
906
+ "event MessageReceived(bytes32 indexed messageId, uint64 indexed sourceChainSelector, address indexed sender, bytes data, address token, uint256 tokenAmount)"
907
+ ];
908
+ const messageSentEvent = txReceipt.logs?.find((log) => {
909
+ return log.topics[0] === import_ethers4.ethers.utils.id(messageSentEventSignature);
910
+ });
911
+ if (!messageSentEvent) {
912
+ throw new Error(
913
+ `No transaction event found for chain ${srcChainId} tx ${txHash}`
914
+ );
915
+ }
916
+ const messageId = messageSentEvent?.topics[1];
917
+ const iface = new import_ethers4.ethers.utils.Interface(messageSentEventAbi);
918
+ const decodedMessageSentEvent = iface.parseLog(messageSentEvent);
919
+ if (!decodedMessageSentEvent) {
920
+ throw new Error(
921
+ `No transaction event arguments found for chain ${srcChainId} tx ${txHash}`
922
+ );
923
+ }
924
+ const srcChain = supportedChains.find(
925
+ (chain) => chain.chainId === srcChainId.toString()
926
+ );
927
+ const srcToken = srcChain?.tokens.find(
928
+ (token) => token.address === decodedMessageSentEvent.args?.token.toString()
929
+ );
930
+ const targetChain = supportedChains.find(
931
+ (chain) => chain.ccipChainId === decodedMessageSentEvent.args?.destinationChainSelector?.toString()
932
+ );
933
+ const toChainId = targetChain?.chainId;
934
+ if (!toChainId) {
935
+ throw new Error(`Unknown destination chain!`);
936
+ }
937
+ const transaction = {
938
+ txHash,
939
+ fromChain: srcChain?.displayName,
940
+ fromChainImage: srcChain?.image,
941
+ toChain: targetChain.displayName,
942
+ toChainImage: targetChain.image,
943
+ fromToken: srcToken?.symbol,
944
+ fromTokenImage: srcToken?.image,
945
+ fromAmount: weiToHumanReadable({
946
+ amount: decodedMessageSentEvent.args?.tokenAmount.toString(),
947
+ decimals: srcToken?.decimals || 18,
948
+ precisionFractionalPlaces: 4
949
+ }),
950
+ isDone: false,
951
+ explorer: `${CCIP_EXPLORER}/tx/${txHash}`
952
+ };
953
+ addTransactionToRenderedTransactions(transaction);
954
+ renderTxHistoryButtons();
955
+ const xSwapRouterOnDestinationAddress = ADDRESSES[toChainId]?.XSwapRouter;
956
+ if (!xSwapRouterOnDestinationAddress) {
957
+ throw new Error(`Unknown destination XSwapRouter!`);
958
+ }
959
+ const xSwapRouterOnDestination = new import_ethers4.ethers.Contract(
960
+ xSwapRouterOnDestinationAddress,
961
+ messageReceivedEventAbi,
962
+ import_ethers4.ethers.getDefaultProvider(
963
+ supportedChains.find((chain) => chain.chainId === toChainId)?.publicRpcUrls[0]
964
+ )
965
+ );
966
+ const eventFilter = {
967
+ address: xSwapRouterOnDestinationAddress,
968
+ topics: [import_ethers4.ethers.utils.id(messageReceivedEventSignature), messageId]
969
+ };
970
+ const onSuccess = async () => {
971
+ updateTransactionDoneInRenderedTransactions(txHash);
972
+ renderTxHistoryButtons();
973
+ await new Promise((resolve) => setTimeout(() => resolve(true), 5e3));
974
+ removeTransactionFromRenderedTransactions(txHash);
975
+ renderTxHistoryButtons();
976
+ };
977
+ xSwapRouterOnDestination.once(eventFilter, () => onSuccess());
978
+ };
979
+ var getTxReceipt = async (txChainId, txHash) => {
980
+ const chains = await getChains();
981
+ const chain = chains.find((chain2) => chain2.chainId === txChainId.toString());
982
+ const provider = new import_ethers4.ethers.providers.JsonRpcProvider(
983
+ chain?.publicRpcUrls[0]
984
+ );
985
+ try {
986
+ return await provider.getTransactionReceipt(txHash);
987
+ } catch (error) {
988
+ console.error("Error fetching transaction receipt:", error);
989
+ return null;
990
+ }
991
+ };
2102
992
 
2103
993
  // src/hooks/useDebounce.tsx
2104
994
  var import_react = require("react");
@@ -2125,7 +1015,6 @@ var import_bignumber2 = __toESM(require("bignumber.js"));
2125
1015
 
2126
1016
  // src/components/TxConfigForm/HistoryCard.tsx
2127
1017
  var import_react2 = require("react");
2128
- var import_date_fns = require("date-fns");
2129
1018
 
2130
1019
  // src/components/icons/ArrowRightIcon.tsx
2131
1020
  var import_jsx_runtime3 = require("react/jsx-runtime");
@@ -2163,45 +1052,67 @@ var ArrowDownIcon = () => {
2163
1052
  );
2164
1053
  };
2165
1054
 
2166
- // src/components/icons/ArrowUpRightIcon.tsx
1055
+ // src/components/icons/ArrowLeftIcon.tsx
2167
1056
  var import_jsx_runtime5 = require("react/jsx-runtime");
2168
- var ArrowUpRightIcon = () => {
1057
+ var ArrowLeftIcon = () => {
2169
1058
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1059
+ "svg",
1060
+ {
1061
+ width: "10",
1062
+ height: "16",
1063
+ viewBox: "0 0 10 16",
1064
+ fill: "none",
1065
+ xmlns: "http://www.w3.org/2000/svg",
1066
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1067
+ "path",
1068
+ {
1069
+ d: "M0.5 8L8.13251 15.5L9.5 14.1562L3.20318 8L9.4682 1.84375L8.10071 0.5L0.5 8Z",
1070
+ fill: "white"
1071
+ }
1072
+ )
1073
+ }
1074
+ );
1075
+ };
1076
+
1077
+ // src/components/icons/ArrowUpRightIcon.tsx
1078
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1079
+ var ArrowUpRightIcon = () => {
1080
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2170
1081
  "svg",
2171
1082
  {
2172
1083
  xmlns: "http://www.w3.org/2000/svg",
2173
1084
  viewBox: "0 0 512 512",
2174
1085
  fill: "currentColor",
2175
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" })
1086
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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" })
2176
1087
  }
2177
1088
  );
2178
1089
  };
2179
1090
 
2180
1091
  // src/components/icons/CheckIcon.tsx
2181
- var import_jsx_runtime6 = require("react/jsx-runtime");
1092
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2182
1093
  var CheckIcon = () => {
2183
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1094
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2184
1095
  "svg",
2185
1096
  {
2186
1097
  xmlns: "http://www.w3.org/2000/svg",
2187
1098
  viewBox: "0 0 448 512",
2188
1099
  fill: "currentColor",
2189
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("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" })
1100
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("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" })
2190
1101
  }
2191
1102
  );
2192
1103
  };
2193
1104
 
2194
1105
  // src/components/icons/ChevronDownIcon.tsx
2195
- var import_jsx_runtime7 = require("react/jsx-runtime");
1106
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2196
1107
  var ChevronDownIcon = () => {
2197
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1108
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2198
1109
  "svg",
2199
1110
  {
2200
1111
  width: "12",
2201
1112
  height: "12",
2202
1113
  xmlns: "http://www.w3.org/2000/svg",
2203
1114
  viewBox: "0 0 512 512",
2204
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1115
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2205
1116
  "path",
2206
1117
  {
2207
1118
  fill: "currentColor",
@@ -2213,65 +1124,51 @@ var ChevronDownIcon = () => {
2213
1124
  };
2214
1125
 
2215
1126
  // src/components/icons/ChevronUpIcon.tsx
2216
- var import_jsx_runtime8 = require("react/jsx-runtime");
1127
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2217
1128
  var ChevronUpIcon = () => {
2218
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2219
- "svg",
1129
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1130
+ "path",
2220
1131
  {
2221
- height: "12",
2222
- width: "12",
2223
- xmlns: "http://www.w3.org/2000/svg",
2224
- viewBox: "0 0 512 512",
2225
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2226
- "path",
2227
- {
2228
- fill: "currentColor",
2229
- 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"
2230
- }
2231
- )
1132
+ fill: "currentColor",
1133
+ 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"
2232
1134
  }
2233
- );
1135
+ ) });
2234
1136
  };
2235
1137
 
2236
1138
  // src/components/icons/CircularProgressIcon.tsx
2237
- var import_jsx_runtime9 = require("react/jsx-runtime");
1139
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2238
1140
  var CircularProgressIcon = () => {
2239
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1141
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2240
1142
  "svg",
2241
1143
  {
2242
- className: "animate-spin -ml-1 mr-3 h-10 w-10 text-white",
2243
- xmlns: "http://www.w3.org/2000/svg",
1144
+ className: "animate-spin-slow text-white",
1145
+ width: "33",
1146
+ height: "33",
1147
+ viewBox: "0 0 33 33",
2244
1148
  fill: "none",
2245
- viewBox: "0 0 24 24",
1149
+ xmlns: "http://www.w3.org/2000/svg",
2246
1150
  children: [
2247
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1151
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2248
1152
  "circle",
2249
1153
  {
2250
- className: "opacity-25",
2251
- cx: "12",
2252
- cy: "12",
2253
- r: "10",
2254
- stroke: "currentColor",
2255
- strokeWidth: "4"
1154
+ cx: "16.5",
1155
+ cy: "16.5",
1156
+ r: "15.5",
1157
+ stroke: "white",
1158
+ strokeOpacity: "0.2",
1159
+ strokeWidth: "2"
2256
1160
  }
2257
1161
  ),
2258
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2259
- "path",
2260
- {
2261
- className: "opacity-75",
2262
- fill: "currentColor",
2263
- 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"
2264
- }
2265
- )
1162
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M1 16C1 7.71573 7.71573 1 16 1", stroke: "white", strokeWidth: "2" })
2266
1163
  ]
2267
1164
  }
2268
1165
  );
2269
1166
  };
2270
1167
 
2271
1168
  // src/components/icons/CoinsIcon.tsx
2272
- var import_jsx_runtime10 = require("react/jsx-runtime");
1169
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2273
1170
  var CoinsIcon = () => {
2274
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1171
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2275
1172
  "svg",
2276
1173
  {
2277
1174
  width: "24",
@@ -2279,7 +1176,7 @@ var CoinsIcon = () => {
2279
1176
  viewBox: "0 0 24 24",
2280
1177
  fill: "none",
2281
1178
  xmlns: "http://www.w3.org/2000/svg",
2282
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1179
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2283
1180
  "path",
2284
1181
  {
2285
1182
  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",
@@ -2292,9 +1189,9 @@ var CoinsIcon = () => {
2292
1189
  };
2293
1190
 
2294
1191
  // src/components/icons/DownArrorIcon.tsx
2295
- var import_jsx_runtime11 = require("react/jsx-runtime");
1192
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2296
1193
  var DownArrowIcon = () => {
2297
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1194
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2298
1195
  "svg",
2299
1196
  {
2300
1197
  width: 16,
@@ -2302,7 +1199,7 @@ var DownArrowIcon = () => {
2302
1199
  viewBox: "0 0 16 16",
2303
1200
  fill: "none",
2304
1201
  xmlns: "http://www.w3.org/2000/svg",
2305
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1202
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2306
1203
  "path",
2307
1204
  {
2308
1205
  d: "M8.00008 9.76921L5.06421 6.83334H10.9359L8.00008 9.76921Z",
@@ -2315,9 +1212,9 @@ var DownArrowIcon = () => {
2315
1212
  };
2316
1213
 
2317
1214
  // src/components/icons/HistoryIcon.tsx
2318
- var import_jsx_runtime12 = require("react/jsx-runtime");
1215
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2319
1216
  var HistoryIcon = () => {
2320
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1217
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2321
1218
  "svg",
2322
1219
  {
2323
1220
  width: "20",
@@ -2325,7 +1222,7 @@ var HistoryIcon = () => {
2325
1222
  viewBox: "0 0 20 20",
2326
1223
  fill: "none",
2327
1224
  xmlns: "http://www.w3.org/2000/svg",
2328
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1225
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2329
1226
  "path",
2330
1227
  {
2331
1228
  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",
@@ -2337,23 +1234,12 @@ var HistoryIcon = () => {
2337
1234
  };
2338
1235
 
2339
1236
  // src/components/icons/HourGlassIcon.tsx
2340
- var import_jsx_runtime13 = require("react/jsx-runtime");
2341
- var HourGlassIcon = () => {
2342
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2343
- "svg",
2344
- {
2345
- xmlns: "http://www.w3.org/2000/svg",
2346
- viewBox: "0 0 384 512",
2347
- fill: "currentColor",
2348
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" })
2349
- }
2350
- );
2351
- };
1237
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2352
1238
 
2353
1239
  // src/components/icons/SearchIcon.tsx
2354
- var import_jsx_runtime14 = require("react/jsx-runtime");
1240
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2355
1241
  var SearchIcon = () => {
2356
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1242
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2357
1243
  "svg",
2358
1244
  {
2359
1245
  xmlns: "http://www.w3.org/2000/svg",
@@ -2361,29 +1247,18 @@ var SearchIcon = () => {
2361
1247
  width: "24",
2362
1248
  viewBox: "0 -960 960 960",
2363
1249
  fill: "#ffffffc0",
2364
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" })
1250
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" })
2365
1251
  }
2366
1252
  );
2367
1253
  };
2368
1254
 
2369
1255
  // src/components/icons/XMarkIcon.tsx
2370
- var import_jsx_runtime15 = require("react/jsx-runtime");
2371
- var XMarkIcon = () => {
2372
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2373
- "svg",
2374
- {
2375
- xmlns: "http://www.w3.org/2000/svg",
2376
- viewBox: "0 0 384 512",
2377
- fill: "current",
2378
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" })
2379
- }
2380
- );
2381
- };
1256
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2382
1257
 
2383
1258
  // src/components/icons/PercentageIcon.tsx
2384
- var import_jsx_runtime16 = require("react/jsx-runtime");
1259
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2385
1260
  var PercentageIcon = () => {
2386
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1261
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2387
1262
  "svg",
2388
1263
  {
2389
1264
  width: "12",
@@ -2392,14 +1267,14 @@ var PercentageIcon = () => {
2392
1267
  fill: "none",
2393
1268
  xmlns: "http://www.w3.org/2000/svg",
2394
1269
  children: [
2395
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1270
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2396
1271
  "path",
2397
1272
  {
2398
1273
  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",
2399
1274
  fill: "url(#paint0_linear_32_1164)"
2400
1275
  }
2401
1276
  ),
2402
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1277
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2403
1278
  "linearGradient",
2404
1279
  {
2405
1280
  id: "paint0_linear_32_1164",
@@ -2409,8 +1284,8 @@ var PercentageIcon = () => {
2409
1284
  y2: "1.31767",
2410
1285
  gradientUnits: "userSpaceOnUse",
2411
1286
  children: [
2412
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { stopColor: "#3681C6" }),
2413
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { offset: "1", stopColor: "#2B4A9D" })
1287
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { stopColor: "#3681C6" }),
1288
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("stop", { offset: "1", stopColor: "#2B4A9D" })
2414
1289
  ]
2415
1290
  }
2416
1291
  ) })
@@ -2420,9 +1295,9 @@ var PercentageIcon = () => {
2420
1295
  };
2421
1296
 
2422
1297
  // src/components/icons/TimerIcon.tsx
2423
- var import_jsx_runtime17 = require("react/jsx-runtime");
1298
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2424
1299
  var TimerIcon = () => {
2425
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1300
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2426
1301
  "svg",
2427
1302
  {
2428
1303
  xmlns: "http://www.w3.org/2000/svg",
@@ -2430,15 +1305,15 @@ var TimerIcon = () => {
2430
1305
  viewBox: "0 -960 960 960",
2431
1306
  width: "16",
2432
1307
  fill: "currentColor",
2433
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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" })
1308
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("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" })
2434
1309
  }
2435
1310
  );
2436
1311
  };
2437
1312
 
2438
1313
  // src/components/icons/InfoIcon.tsx
2439
- var import_jsx_runtime18 = require("react/jsx-runtime");
1314
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2440
1315
  var InfoIcon = () => {
2441
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1316
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2442
1317
  "svg",
2443
1318
  {
2444
1319
  width: "28",
@@ -2446,15 +1321,15 @@ var InfoIcon = () => {
2446
1321
  viewBox: "0 0 28 28",
2447
1322
  xmlns: "http://www.w3.org/2000/svg",
2448
1323
  fill: "currentColor",
2449
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("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" })
1324
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("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" })
2450
1325
  }
2451
1326
  );
2452
1327
  };
2453
1328
 
2454
1329
  // src/components/icons/SettingsIcon.tsx
2455
- var import_jsx_runtime19 = require("react/jsx-runtime");
1330
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2456
1331
  var SettingsIcon = () => {
2457
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1332
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2458
1333
  "svg",
2459
1334
  {
2460
1335
  width: "18",
@@ -2462,7 +1337,7 @@ var SettingsIcon = () => {
2462
1337
  viewBox: "0 0 18 18",
2463
1338
  fill: "none",
2464
1339
  xmlns: "http://www.w3.org/2000/svg",
2465
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1340
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2466
1341
  "path",
2467
1342
  {
2468
1343
  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",
@@ -2474,9 +1349,9 @@ var SettingsIcon = () => {
2474
1349
  };
2475
1350
 
2476
1351
  // src/components/icons/XSwapBadgeIcon.tsx
2477
- var import_jsx_runtime20 = require("react/jsx-runtime");
1352
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2478
1353
  var XSwapBadgeIcon = () => {
2479
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1354
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2480
1355
  "svg",
2481
1356
  {
2482
1357
  version: "1.2",
@@ -2485,8 +1360,8 @@ var XSwapBadgeIcon = () => {
2485
1360
  width: "80",
2486
1361
  height: "27",
2487
1362
  children: [
2488
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("title", { children: "xswap-badge" }),
2489
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1363
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("title", { children: "xswap-badge" }),
1364
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2490
1365
  "image",
2491
1366
  {
2492
1367
  width: "80",
@@ -2495,17 +1370,17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Vw/8vEsC6Xvk5dE4L8BBYs8HFbmQE4AAAAASUVORK5CYII="
2496
1371
  }
2497
1372
  ) }),
2498
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("style", {}),
2499
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("use", { id: "Background", href: "#img1iVBORw0KGgoAAAANSUhEUgAAAF", x: "0", y: "1" })
1373
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("style", {}),
1374
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("use", { id: "Background", href: "#img1iVBORw0KGgoAAAANSUhEUgAAAF", x: "0", y: "1" })
2500
1375
  ]
2501
1376
  }
2502
1377
  );
2503
1378
  };
2504
1379
 
2505
1380
  // src/components/icons/ChainlinkCCIPIcon.tsx
2506
- var import_jsx_runtime21 = require("react/jsx-runtime");
1381
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2507
1382
  var ChainlinkCCIPIcon = () => {
2508
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1383
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
2509
1384
  "svg",
2510
1385
  {
2511
1386
  version: "1.2",
@@ -2514,8 +1389,8 @@ var ChainlinkCCIPIcon = () => {
2514
1389
  width: "67",
2515
1390
  height: "27",
2516
1391
  children: [
2517
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("title", { children: "chainlink-CCIP" }),
2518
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1392
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("title", { children: "chainlink-CCIP" }),
1393
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2519
1394
  "image",
2520
1395
  {
2521
1396
  width: "67",
@@ -2524,20 +1399,42 @@ var ChainlinkCCIPIcon = () => {
2524
1399
  href: "data:image/png;base64,iVBORw0KGgoAAAAN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Ju/PeiEoSxzRYZKf08s3azz7V3xv3E/xw3DxylPobgzJ1SNPhVzX6rCu0fF3BbryHtFFh+bDRA8lqqZ08Istmv/fbjJQKBI1ySElaGeDjolgpBM8QWnJ6PY4Byo1J3oX7n4ifGkl+s8TFkfMjkzWzFzJP9/dXP+/1rU/0r5Dy2/8Z6sDkzgAAAAAElFTkSuQmCC"
2525
1400
  }
2526
1401
  ) }),
2527
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("style", {}),
2528
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("use", { id: "Background", href: "#imgiVBORw0KGgoAAA", x: "0", y: "0" })
1402
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("style", {}),
1403
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("use", { id: "Background", href: "#imgiVBORw0KGgoAAA", x: "0", y: "0" })
2529
1404
  ]
2530
1405
  }
2531
1406
  );
2532
1407
  };
2533
1408
 
1409
+ // src/components/icons/XSwapLogo.tsx
1410
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1411
+ var XSwapLogo = () => {
1412
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1413
+ "svg",
1414
+ {
1415
+ version: "1.1",
1416
+ id: "Layer_1",
1417
+ xmlns: "http://www.w3.org/2000/svg",
1418
+ x: "0px",
1419
+ y: "0px",
1420
+ viewBox: "0 0 50 50",
1421
+ enableBackground: "new 0 0 50 50",
1422
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1423
+ "image",
1424
+ {
1425
+ id: "image0",
1426
+ x: "0",
1427
+ y: "0",
1428
+ href: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAQ\nrElEQVRo3s2aeXSWxb3HPzPP867ZA9lI2C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bphaqu0O/EEkrkGBicvC4SDcwqms76CYFO16JU17ccJo2esrd39bn03iBGXtcA05FPCdGD72wAZ\nnuik2Z3UwnCBNAiE2pBa3qQbD26+YBAnrbNmr4xK8wpDThAKwhdiuoIjum4saQg0VdFRVSxiR01e\n1Dvjyhfr9n3QKeidNdbriv5UW0HTDvjCg6cQ3XkhpIkQZhdEKyj1O9V06NELDnGauQdc8YYI6RsI\n+tHaDt+BgfDlGm2DttBa4/DGMuCH953whNoGi6isW570Vx/IE8K2bFvZCKFspI1QCiFtbGWDUgih\nEEYyDQde+0pTfR+Wmen0BJLu0r6ONsMwNA4n0jC0MEyNMBVG+JhcW37DNCMzk6fe0P6/6ZaOfwAl\nLqsAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMDUtMjdUMTE6NTQ6MjkrMDA6MDCo6mafAAAAJXRF\nWHRkYXRlOm1vZGlmeQAyMDI0LTA1LTI3VDExOjU0OjI5KzAwOjAw2bfeIwAAAABJRU5ErkJggg=="
1429
+ }
1430
+ )
1431
+ }
1432
+ );
1433
+ };
1434
+
2534
1435
  // src/components/TxConfigForm/HistoryCard.tsx
2535
- var import_jsx_runtime22 = require("react/jsx-runtime");
1436
+ var import_jsx_runtime24 = require("react/jsx-runtime");
2536
1437
  var HistoryCard = ({ transaction, supportedChains }) => {
2537
- const getDate = (0, import_react2.useCallback)((blockTimestamp) => {
2538
- const date2 = new Date(blockTimestamp * 1e3);
2539
- return (0, import_date_fns.format)(date2, "d MMM yyyy HH:mm:ss");
2540
- }, []);
2541
1438
  const date = getDate(transaction.timestamp);
2542
1439
  const supportedTokens = (0, import_react2.useMemo)(() => {
2543
1440
  const customTokens = JSON.parse(
@@ -2582,23 +1479,14 @@ var HistoryCard = ({ transaction, supportedChains }) => {
2582
1479
  const targetChainData = supportedChains.find(
2583
1480
  (chain) => chain.chainId === transaction.targetChainId
2584
1481
  );
2585
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col border border-solid border-[rgba(255,255,255,0.1)] rounded-xl bg-[rgb(15,15,15)] p-2 gap-4 mb-2", children: [
2586
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2587
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-[rgba(255,255,255,0.6)] text-xs", children: date }),
2588
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-grow justify-end items-center", children: [
2589
- transaction.status === "IN_PROGRESS" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2590
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-3.5 h-3.5 mr-1 text-[rgb(250,200,100)]", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HourGlassIcon, {}) }),
2591
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs text-[rgb(250,200,100)]", children: "In progress" })
2592
- ] }),
2593
- transaction.status === "DONE" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2594
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-3.5 h-3.5 mr-1 text-[rgb(100,200,100)]", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CheckIcon, {}) }),
2595
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs text-[rgb(100,200,100)]", children: "Done" })
2596
- ] }),
2597
- transaction.status === "REVERTED" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2598
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-4 h-4 mr-1 text-[rgb(255,100,100)]", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(XMarkIcon, {}) }),
2599
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs text-[rgb(255,100,100)]", children: "Reverted" })
2600
- ] }),
2601
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1482
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("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: [
1483
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex w-full items-center justify-between", children: [
1484
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-sm sm:text-base", children: date }),
1485
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center", children: [
1486
+ transaction.status === "IN_PROGRESS" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-[rgb(250,200,100)]", children: "In progress" }) }),
1487
+ transaction.status === "DONE" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-[rgb(100,200,100)]", children: "Done" }) }),
1488
+ transaction.status === "REVERTED" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "text-[rgb(255,100,100)]", children: "Reverted" }) }),
1489
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2602
1490
  "a",
2603
1491
  {
2604
1492
  href: `${supportedChains.find(
@@ -2608,15 +1496,15 @@ var HistoryCard = ({ transaction, supportedChains }) => {
2608
1496
  rel: "noreferrer",
2609
1497
  className: "ml-2 no-underline",
2610
1498
  "aria-label": "Show the transaction in the chain explorer",
2611
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-3.5 h-3.5 text-[rgba(255,255,255,0.6)]", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowUpRightIcon, {}) })
1499
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowUpRightIcon, {}) })
2612
1500
  }
2613
1501
  )
2614
1502
  ] })
2615
1503
  ] }),
2616
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-wrap gap-8", children: [
2617
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-grow items-center", children: [
2618
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2619
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1504
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between flex-wrap gap-2", children: [
1505
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center", children: [
1506
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center", children: [
1507
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2620
1508
  "img",
2621
1509
  {
2622
1510
  src: sourceChainData?.image,
@@ -2624,11 +1512,11 @@ var HistoryCard = ({ transaction, supportedChains }) => {
2624
1512
  className: "w-5 h-5 mr-1"
2625
1513
  }
2626
1514
  ),
2627
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs text-[rgba(255,255,255,0.6)]", children: sourceChainData?.displayName })
1515
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: sourceChainData?.displayName })
2628
1516
  ] }),
2629
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-3.5 h-3.5 text-[rgba(255,255,255,0.6)] my-0 mx-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowRightIcon, {}) }),
2630
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2631
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1517
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-3.5 h-3.5 my-0 mx-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowRightIcon, {}) }),
1518
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center", children: [
1519
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2632
1520
  "img",
2633
1521
  {
2634
1522
  src: targetChainData?.image,
@@ -2636,35 +1524,35 @@ var HistoryCard = ({ transaction, supportedChains }) => {
2636
1524
  className: "w-5 h-5 mr-1"
2637
1525
  }
2638
1526
  ),
2639
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs text-[rgba(255,255,255,0.6)]", children: targetChainData?.displayName })
1527
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: targetChainData?.displayName })
2640
1528
  ] })
2641
1529
  ] }),
2642
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex items-center mb-2 last:mb-0", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-1 items-center flex-wrap text-xs text-[rgba(255,255,255,0.6)]", children: [
2643
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
2644
- Number(transferredAmount) < 1e-4 ? "<0.0001" : transferredAmount,
2645
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs ml-1 text-rgba(255,255,255,0.6)", children: tokenData?.symbol }),
2646
- tokenData?.image ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1530
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex items-center mb-2 last:mb-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center flex-wrap", children: [
1531
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center", children: [
1532
+ Number(transferredAmount) < MINIMUM_DISPLAYED_TOKEN_AMOUNT ? `<${MINIMUM_DISPLAYED_TOKEN_AMOUNT}` : transferredAmount,
1533
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "ml-1", children: tokenData?.symbol }),
1534
+ tokenData?.image ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2647
1535
  "img",
2648
1536
  {
2649
1537
  src: tokenData?.image,
2650
1538
  alt: tokenData?.name || "",
2651
1539
  className: "w-5 h-5 ml-1"
2652
1540
  }
2653
- ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("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) })
1541
+ ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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) })
2654
1542
  ] }),
2655
- transaction.tokenOutAddress && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
2656
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-3.5 h-3.5 text-[rgba(255,255,255,0.6)] my-0 mx-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowRightIcon, {}) }),
2657
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center", children: [
1543
+ transaction.tokenOutAddress && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
1544
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-3.5 h-3.5 my-0 mx-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowRightIcon, {}) }),
1545
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center", children: [
2658
1546
  Number(receivedAmount) < 1e-4 ? "<0.0001" : receivedAmount,
2659
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "text-xs ml-1 text-[rgba(255,255,255,0.6)]", children: tokenOutData?.symbol }),
2660
- tokenOutData?.image ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1547
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "ml-1", children: tokenOutData?.symbol }),
1548
+ tokenOutData?.image ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2661
1549
  "img",
2662
1550
  {
2663
1551
  src: tokenOutData?.image,
2664
1552
  alt: tokenOutData?.name || "",
2665
1553
  className: "w-5 h-5 ml-1"
2666
1554
  }
2667
- ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("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) })
1555
+ ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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) })
2668
1556
  ] })
2669
1557
  ] })
2670
1558
  ] }) })
@@ -2673,85 +1561,49 @@ var HistoryCard = ({ transaction, supportedChains }) => {
2673
1561
  };
2674
1562
 
2675
1563
  // src/components/TxConfigForm/History.tsx
2676
- var import_jsx_runtime23 = require("react/jsx-runtime");
2677
- var PENDING_TXS_LOCAL_STORAGE_KEY = "pending_transactions";
1564
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2678
1565
  var History = ({ signer, supportedChains }) => {
2679
- const [mappedHistory, setMappedHistory] = (0, import_react3.useState)();
1566
+ const [fetchedHistory, setFetchedHistory] = (0, import_react3.useState)();
2680
1567
  const [historyLoadedOnce, setHistoryLoadedOnce] = (0, import_react3.useState)(false);
2681
- const getLocalHistory = () => {
2682
- return JSON.parse(
2683
- localStorage.getItem(PENDING_TXS_LOCAL_STORAGE_KEY) || "{}"
2684
- );
2685
- };
2686
- const setLocalHistory = (data) => {
2687
- localStorage.setItem(PENDING_TXS_LOCAL_STORAGE_KEY, JSON.stringify(data));
2688
- };
2689
1568
  const fetchHistory = (0, import_react3.useCallback)(async () => {
2690
- const downloadedHistory = await getHistory({ walletAddress: signer });
2691
- const fetchedTransactions = [];
2692
- if (downloadedHistory) {
2693
- for (const entry of downloadedHistory.history) {
2694
- if (!entry.source) {
2695
- continue;
2696
- }
2697
- let status;
2698
- if (entry.failed)
2699
- status = "REVERTED";
2700
- if (!!entry.target) {
2701
- status = "DONE";
2702
- } else {
2703
- status = "IN_PROGRESS";
2704
- }
2705
- const blockTimestampMs = new Date(entry.source.blockTime).getTime();
2706
- const estimatedDeliveryTimestamp = new import_bignumber2.default(
2707
- entry.source.valueForInstantCcipRecieve
2708
- ).gt(0) ? blockTimestampMs + EXPRESS_DELIVERY_TIME : blockTimestampMs + DELIVERY_TIME;
2709
- fetchedTransactions.push({
2710
- hash: entry.source.transactionHash,
2711
- timestamp: blockTimestampMs / 1e3,
2712
- sourceChainId: entry.source.blockchainId,
2713
- targetChainId: entry.source.targetBlockchainId,
2714
- amountWei: entry.source.tokenAmount,
2715
- tokenAddress: entry.source.tokenAddress,
2716
- tokenOutAddress: entry.target?.tokenAddress || entry.source.tokenOutAddress,
2717
- tokenOutAmount: entry.target?.tokenAmount || entry.source.estimatedAmountOut,
2718
- estimatedDeliveryTimestamp,
2719
- status
2720
- });
2721
- }
2722
- const txHashToTxFromAPI = {};
2723
- for (const transaction of fetchedTransactions) {
2724
- txHashToTxFromAPI[transaction.hash] = transaction;
2725
- }
2726
- const localHistory = getLocalHistory();
2727
- const newLocalHistory = {};
2728
- for (const [walletAddress, transactions] of Object.entries(
2729
- localHistory
2730
- )) {
2731
- if (walletAddress.toLowerCase() !== signer.toLowerCase()) {
2732
- continue;
2733
- }
2734
- const newLocalHistoryForWallet = [];
2735
- for (const transaction of transactions) {
2736
- if (!txHashToTxFromAPI[transaction.hash]) {
2737
- fetchedTransactions.push(transaction);
2738
- newLocalHistoryForWallet.push(transaction);
1569
+ if (signer) {
1570
+ const downloadedHistory = await getHistory({ walletAddress: signer });
1571
+ const fetchedTransactions = [];
1572
+ if (downloadedHistory) {
1573
+ for (const entry of downloadedHistory.history) {
1574
+ if (!entry.source) {
2739
1575
  continue;
2740
1576
  }
2741
- if (txHashToTxFromAPI[transaction.hash] && transaction.status === "DONE" && txHashToTxFromAPI[transaction.hash]?.status === "IN_PROGRESS") {
2742
- txHashToTxFromAPI[transaction.hash].status = "DONE";
2743
- }
2744
- if (txHashToTxFromAPI[transaction.hash]?.status === "DONE" || txHashToTxFromAPI[transaction.hash]?.status === "REVERTED") {
2745
- continue;
1577
+ let status;
1578
+ if (entry.failed)
1579
+ status = "REVERTED";
1580
+ if (!!entry.target) {
1581
+ status = "DONE";
1582
+ } else {
1583
+ status = "IN_PROGRESS";
2746
1584
  }
1585
+ const blockTimestampMs = new Date(entry.source.blockTime).getTime();
1586
+ const estimatedDeliveryTimestamp = new import_bignumber2.default(
1587
+ entry.source.valueForInstantCcipRecieve
1588
+ ).gt(0) ? blockTimestampMs + EXPRESS_DELIVERY_TIME : blockTimestampMs + DELIVERY_TIME;
1589
+ fetchedTransactions.push({
1590
+ hash: entry.source.transactionHash,
1591
+ timestamp: blockTimestampMs / 1e3,
1592
+ sourceChainId: entry.source.blockchainId,
1593
+ targetChainId: entry.source.targetBlockchainId,
1594
+ amountWei: entry.source.tokenAmount,
1595
+ tokenAddress: entry.source.tokenAddress,
1596
+ tokenOutAddress: entry.target?.tokenAddress || entry.source.tokenOutAddress,
1597
+ tokenOutAmount: entry.target?.tokenAmount || entry.source.estimatedAmountOut,
1598
+ estimatedDeliveryTimestamp,
1599
+ status
1600
+ });
2747
1601
  }
2748
- newLocalHistory[walletAddress.toLowerCase()] = newLocalHistoryForWallet;
1602
+ setFetchedHistory(
1603
+ fetchedTransactions.sort((a, b) => b.timestamp - a.timestamp)
1604
+ );
1605
+ setHistoryLoadedOnce(true);
2749
1606
  }
2750
- setLocalHistory(newLocalHistory);
2751
- setMappedHistory(
2752
- fetchedTransactions.sort((a, b) => b.timestamp - a.timestamp)
2753
- );
2754
- setHistoryLoadedOnce(true);
2755
1607
  }
2756
1608
  }, [signer, getHistory]);
2757
1609
  (0, import_react3.useEffect)(() => {
@@ -2762,10 +1614,12 @@ var History = ({ signer, supportedChains }) => {
2762
1614
  }, 6e4);
2763
1615
  return () => clearInterval(timer);
2764
1616
  }, [signer, fetchHistory, getHistory, historyLoadedOnce]);
2765
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full h-[50vh] overflow-scroll overflow-x-hidden", children: [
2766
- mappedHistory?.length === 0 && historyLoadedOnce && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "w-full text-center py-4 px-0 text-[rgb(158,158,158)]", children: "Your history is empty..." }),
2767
- !mappedHistory && !historyLoadedOnce && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex w-full h-full items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CircularProgressIcon, {}) }),
2768
- mappedHistory?.map((transaction, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1617
+ if (!signer)
1618
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-center w-full h-[30vh]", children: "Connect a wallet to browse history" });
1619
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full h-96 overflow-scroll overflow-x-hidden", children: [
1620
+ fetchedHistory?.length === 0 && historyLoadedOnce && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-full text-center py-4 px-0 text-[rgb(158,158,158)]", children: "Your history is empty..." }),
1621
+ !fetchedHistory && !historyLoadedOnce && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex w-full h-full items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CircularProgressIcon, {}) }),
1622
+ fetchedHistory?.map((transaction, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2769
1623
  HistoryCard,
2770
1624
  {
2771
1625
  transaction,
@@ -2777,30 +1631,30 @@ var History = ({ signer, supportedChains }) => {
2777
1631
  };
2778
1632
 
2779
1633
  // src/components/TxConfigForm/TopBar.tsx
2780
- var import_jsx_runtime24 = require("react/jsx-runtime");
1634
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2781
1635
  var TopBar = ({
2782
1636
  signer,
2783
1637
  setSettingsShown,
2784
1638
  setHistoryTabShown,
2785
1639
  historyTabShown
2786
1640
  }) => {
2787
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex w-full justify-between mx-auto pl-4 pr-8 pt-2", children: [
2788
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "rounded-lg text-[rgba(255,255,255,0.6)] text-base whitespace-nowrap", children: signer ? `Connected wallet: ${shortAddress(signer)}` : `Disconnected` }),
2789
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex gap-2", children: [
2790
- !historyTabShown && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1641
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex w-full justify-between items-center mx-auto sm:pl-4 pr-8 pt-2", children: [
1642
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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` }),
1643
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex gap-2", children: [
1644
+ !historyTabShown && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2791
1645
  "div",
2792
1646
  {
2793
1647
  onClick: () => setSettingsShown(true),
2794
1648
  className: "flex items-center text-xs gap-1 cursor-pointer",
2795
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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__ */ (0, import_jsx_runtime24.jsx)(SettingsIcon, {}) })
1649
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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__ */ (0, import_jsx_runtime26.jsx)(SettingsIcon, {}) })
2796
1650
  }
2797
1651
  ),
2798
- signer && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1652
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2799
1653
  "div",
2800
1654
  {
2801
1655
  onClick: () => setHistoryTabShown((x) => !x),
2802
1656
  className: "flex items-center text-sm gap-1 cursor-pointer",
2803
- children: !historyTabShown ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("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__ */ (0, import_jsx_runtime24.jsx)(HistoryIcon, {}) }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: "Back" })
1657
+ children: !historyTabShown ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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__ */ (0, import_jsx_runtime26.jsx)(HistoryIcon, {}) }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { children: "Back" })
2804
1658
  }
2805
1659
  )
2806
1660
  ] })
@@ -2809,7 +1663,7 @@ var TopBar = ({
2809
1663
 
2810
1664
  // src/components/TxConfigForm/Settings.tsx
2811
1665
  var import_react4 = require("react");
2812
- var import_jsx_runtime25 = require("react/jsx-runtime");
1666
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2813
1667
  var Settings = ({
2814
1668
  setSlippage,
2815
1669
  setSettingsShown,
@@ -2826,22 +1680,22 @@ var Settings = ({
2826
1680
  );
2827
1681
  }
2828
1682
  }, [slippageActivePresetIndex, usingSlippageInput]);
2829
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-4 justify-between", children: [
2830
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-between", children: [
2831
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-base", children: "Settings" }),
2832
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1683
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("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__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-4 justify-between", children: [
1684
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex justify-between", children: [
1685
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-base", children: "Settings" }),
1686
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2833
1687
  "div",
2834
1688
  {
2835
1689
  className: "cursor-pointer",
2836
1690
  onClick: () => setSettingsShown(false),
2837
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CloseIcon, {})
1691
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CloseIcon, {})
2838
1692
  }
2839
1693
  )
2840
1694
  ] }),
2841
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
2842
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-2 items-center", children: [
2843
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-sm text-[rgba(255,255,255,0.6)]", children: "Express delivery" }),
2844
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
1695
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
1696
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-2 items-center", children: [
1697
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-sm text-[rgba(255,255,255,0.6)]", children: "Express delivery" }),
1698
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2845
1699
  "span",
2846
1700
  {
2847
1701
  className: "inline-flex w-14 h-9 p-3 relative align-middle box-border overflow-hidden cursor-pointer",
@@ -2849,8 +1703,8 @@ var Settings = ({
2849
1703
  setExpressChecked((x) => !x);
2850
1704
  },
2851
1705
  children: [
2852
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "h-full, w-full rounded-lg bg-[rgba(255,255,255,0.3)]" }),
2853
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1706
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "h-full, w-full rounded-lg bg-[rgba(255,255,255,0.3)]" }),
1707
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2854
1708
  "span",
2855
1709
  {
2856
1710
  className: `transition-all w-5 h-5 rounded-full absolute translate-y-[-4px]
@@ -2861,15 +1715,15 @@ var Settings = ({
2861
1715
  }
2862
1716
  ) })
2863
1717
  ] }),
2864
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-4", children: [
2865
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InfoIcon, {}) }),
2866
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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." })
1718
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-4", children: [
1719
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoIcon, {}) }),
1720
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("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." })
2867
1721
  ] })
2868
1722
  ] }),
2869
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-2 ", children: [
2870
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: " text-[rgba(255,255,255,0.6)] text-sm", children: "Slippage" }),
2871
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-2", children: [
2872
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center bg-[rgba(15,15,15,1)] p-1 globalBorder rounded-xl", children: SLIPPAGE_PRESETS.map((preset, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1723
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-2 ", children: [
1724
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: " text-[rgba(255,255,255,0.6)] text-sm", children: "Slippage" }),
1725
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-2", children: [
1726
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex items-center bg-[rgba(15,15,15,1)] p-1 globalBorder rounded-xl", children: SLIPPAGE_PRESETS.map((preset, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2873
1727
  "div",
2874
1728
  {
2875
1729
  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]" : ""}`,
@@ -2881,8 +1735,8 @@ var Settings = ({
2881
1735
  },
2882
1736
  index
2883
1737
  )) }),
2884
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("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: [
2885
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1738
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("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: [
1739
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2886
1740
  "input",
2887
1741
  {
2888
1742
  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",
@@ -2901,16 +1755,16 @@ var Settings = ({
2901
1755
  }
2902
1756
  }
2903
1757
  ),
2904
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PercentageIcon, {})
1758
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PercentageIcon, {})
2905
1759
  ] })
2906
1760
  ] }),
2907
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-4", children: [
2908
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InfoIcon, {}) }),
2909
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "text-xs text-left", children: [
1761
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-4", children: [
1762
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "min-w-[26px] min-h-[26px] text-[#ffa726]", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(InfoIcon, {}) }),
1763
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "text-xs text-left", children: [
2910
1764
  "Slippage is the price variation you are willing to accept in the event that the price of the trade changes while it is processing.",
2911
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("br", {}),
1765
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("br", {}),
2912
1766
  " ",
2913
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("br", {}),
1767
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("br", {}),
2914
1768
  "If the trade fails due to too-low slippage, you will receive USDC on the destination chain."
2915
1769
  ] })
2916
1770
  ] })
@@ -2919,7 +1773,7 @@ var Settings = ({
2919
1773
  };
2920
1774
 
2921
1775
  // src/components/TxConfigForm/FeesDetails.tsx
2922
- var import_jsx_runtime26 = require("react/jsx-runtime");
1776
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2923
1777
  var FeesDetails = ({
2924
1778
  isGettingRoute,
2925
1779
  route,
@@ -2930,12 +1784,12 @@ var FeesDetails = ({
2930
1784
  feesDetailsShown,
2931
1785
  setFeesDetailsShown
2932
1786
  }) => {
2933
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-3 globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 mb-1", children: [
2934
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex w-full items-center justify-between", children: [
2935
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-1 text-sm font-medium text-white opacity-60", children: [
2936
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CoinsIcon, {}),
2937
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mr-1", children: "Fees:" }),
2938
- isGettingRoute ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "bg-current rounded animate-pulse w-20 h-4" }) : ` ${weiToHumanReadable({
1787
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-3 globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 mb-1", children: [
1788
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex w-full items-center justify-between text-xs sm:text-sm ", children: [
1789
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-1 font-medium text-white opacity-60", children: [
1790
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CoinsIcon, {}),
1791
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mr-1", children: "Fees:" }),
1792
+ isGettingRoute ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "bg-current rounded animate-pulse w-20 h-4" }) : ` ${weiToHumanReadable({
2939
1793
  amount: safeBigNumberFrom(
2940
1794
  route?.xSwapFees.xSwapFee.nativeFee || "0"
2941
1795
  ).add(safeBigNumberFrom(route?.xSwapFees.ccipFee || "0")).add(
@@ -2945,30 +1799,30 @@ var FeesDetails = ({
2945
1799
  precisionFractionalPlaces: 5
2946
1800
  })} ${paymentToken?.symbol}`
2947
1801
  ] }),
2948
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex gap-1", children: [
2949
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1802
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex gap-1 items-center", children: [
1803
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2950
1804
  "div",
2951
1805
  {
2952
- className: `flex gap-1 text-xs font-medium ${expressChecked ? "text-x_green" : "text-white opacity-60"}`,
1806
+ className: `flex gap-1 items-center font-medium ${expressChecked ? "text-x_green" : "text-white opacity-60"}`,
2953
1807
  children: [
2954
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TimerIcon, {}),
1808
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TimerIcon, {}),
2955
1809
  expressChecked ? "Fast ~ 30sec " : "Normal ~ 30min"
2956
1810
  ]
2957
1811
  }
2958
1812
  ),
2959
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1813
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2960
1814
  "div",
2961
1815
  {
2962
1816
  onClick: () => setFeesDetailsShown((x) => !x),
2963
- className: "text-xs font-medium text-white opacity-60 cursor-pointer flex items-center",
2964
- children: feesDetailsShown ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronUpIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChevronDownIcon, {})
1817
+ className: "font-medium text-white opacity-60 cursor-pointer flex items-center w-[15px] h-[9px]",
1818
+ children: feesDetailsShown ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronUpIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ChevronDownIcon, {})
2965
1819
  }
2966
1820
  )
2967
1821
  ] })
2968
1822
  ] }),
2969
- feesDetailsShown && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex w-full items-center justify-between ", children: [
2970
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col text-[10px] gap-1", children: [
2971
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
1823
+ feesDetailsShown && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex w-full items-center justify-between ", children: [
1824
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col text-[10px] gap-1", children: [
1825
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
2972
1826
  "CCIP Fee:",
2973
1827
  ` ${weiToHumanReadable({
2974
1828
  amount: route?.xSwapFees.ccipFee || "0",
@@ -2976,7 +1830,7 @@ var FeesDetails = ({
2976
1830
  precisionFractionalPlaces: 5
2977
1831
  })} ${paymentToken?.symbol}`
2978
1832
  ] }),
2979
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
1833
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
2980
1834
  "Native Fee:",
2981
1835
  ` ${weiToHumanReadable({
2982
1836
  amount: route?.xSwapFees.xSwapFee.nativeFee || "0",
@@ -2985,12 +1839,12 @@ var FeesDetails = ({
2985
1839
  })} ${paymentToken?.symbol}`
2986
1840
  ] })
2987
1841
  ] }),
2988
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col text-[10px] gap-1", children: [
2989
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
1842
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col text-[10px] gap-1", children: [
1843
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
2990
1844
  "Slippage: ",
2991
1845
  `${slippage}%`
2992
1846
  ] }),
2993
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
1847
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "font-medium text-white opacity-60", children: [
2994
1848
  "Min amount out:",
2995
1849
  " ",
2996
1850
  weiToHumanReadable({
@@ -3007,45 +1861,95 @@ var FeesDetails = ({
3007
1861
  };
3008
1862
 
3009
1863
  // src/components/TxConfigForm/Summary.tsx
3010
- var import_jsx_runtime27 = require("react/jsx-runtime");
1864
+ var import_react6 = require("react");
1865
+
1866
+ // src/components/TxConfigForm/UsdPrice.tsx
1867
+ var import_react5 = require("react");
1868
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1869
+ var UsdPrice = ({
1870
+ prices,
1871
+ token,
1872
+ amount = "0",
1873
+ loading = false
1874
+ }) => {
1875
+ const [usdPrice, setUsdPrice] = (0, import_react5.useState)("0.00");
1876
+ (0, import_react5.useEffect)(() => {
1877
+ if (token && prices && prices[token.address]) {
1878
+ setUsdPrice((Number(amount) * Number(prices[token.address])).toFixed(2));
1879
+ }
1880
+ }, [token, prices, amount]);
1881
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "opacity-60 py-4", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Skeleton, { width: "w-12", height: "h-4" }) : token ? prices && prices[token.address] ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: `$${usdPrice}` }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Alert, { desc: "Unknown price" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: "$0.00" }) });
1882
+ };
1883
+
1884
+ // src/components/TxConfigForm/Summary.tsx
1885
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3011
1886
  var Summary = ({
3012
1887
  isGettingRoute,
3013
- amount,
3014
1888
  route,
3015
1889
  dstToken,
3016
1890
  dstChain
3017
1891
  }) => {
3018
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex justify-between globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 relative", children: [
3019
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-2", children: [
3020
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-[rgba(255,255,255,0.6)] text-sm", children: "You receive" }),
3021
- isGettingRoute && amount.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "bg-current rounded animate-pulse w-[190px] h-7" }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-2 items-center text-white text-2xl", children: [
3022
- weiToHumanReadable({
3023
- amount: route?.estAmountOut || "0",
3024
- decimals: dstToken?.decimals || 18,
3025
- precisionFractionalPlaces: 5
3026
- }),
3027
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { src: dstToken?.image, alt: dstToken?.name }) }),
3028
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { children: dstToken?.symbol })
3029
- ] })
3030
- ] }),
3031
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-1 text-sm", children: [
3032
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-[rgba(255,255,255,0.6)] text-right", children: "on chain:" }),
3033
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-1 text-white", children: [
3034
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-4 h-4", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", { src: dstChain?.image, alt: dstChain?.name }) }),
3035
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: dstChain?.displayName })
1892
+ const [prices, setPrices] = (0, import_react6.useState)();
1893
+ const amountReadable = (0, import_react6.useMemo)(
1894
+ () => weiToHumanReadable({
1895
+ amount: route?.estAmountOut || "0",
1896
+ decimals: dstToken?.decimals || 18,
1897
+ precisionFractionalPlaces: 5
1898
+ }),
1899
+ [route, dstToken]
1900
+ );
1901
+ (0, import_react6.useEffect)(() => {
1902
+ if (dstChain) {
1903
+ getPrices({ chainId: dstChain.chainId, currency: "USD" }).then(
1904
+ (prices2) => setPrices(prices2)
1905
+ );
1906
+ }
1907
+ }, [dstChain]);
1908
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4 relative", children: [
1909
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex justify-between", children: [
1910
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col gap-1", children: [
1911
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-[rgba(255,255,255,0.6)] text-sm", children: "You receive" }),
1912
+ isGettingRoute ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1913
+ Skeleton,
1914
+ {
1915
+ width: "w-[100px]",
1916
+ height: "h-[36px]",
1917
+ other: "sm:w-[190px]"
1918
+ }
1919
+ ) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex gap-2 items-center text-white text-xl sm:text-3xl", children: [
1920
+ amountReadable,
1921
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-4 sm:w-6 h-4 sm:h-6", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: dstToken?.image, alt: dstToken?.name }) }),
1922
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-base sm:text-xl", children: dstToken?.symbol })
1923
+ ] })
1924
+ ] }),
1925
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col gap-1 text-sm", children: [
1926
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-[rgba(255,255,255,0.6)] text-right", children: "on chain:" }),
1927
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-1 text-white", children: [
1928
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-4 h-4", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("img", { src: dstChain?.image, alt: dstChain?.name }) }),
1929
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: dstChain?.displayName })
1930
+ ] })
3036
1931
  ] })
3037
1932
  ] }),
3038
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("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__ */ (0, import_jsx_runtime27.jsx)("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__ */ (0, import_jsx_runtime27.jsx)(ArrowDownIcon, {}) }) })
1933
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1934
+ UsdPrice,
1935
+ {
1936
+ prices,
1937
+ token: dstToken,
1938
+ amount: amountReadable,
1939
+ loading: isGettingRoute
1940
+ }
1941
+ ),
1942
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("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__ */ (0, import_jsx_runtime30.jsx)("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__ */ (0, import_jsx_runtime30.jsx)(ArrowDownIcon, {}) }) })
3039
1943
  ] });
3040
1944
  };
3041
1945
 
3042
1946
  // src/components/TxConfigForm/SwapPanel.tsx
3043
- var import_react7 = require("react");
1947
+ var import_react9 = require("react");
3044
1948
 
3045
1949
  // src/components/TxConfigForm/TokenPicker.tsx
3046
- var import_react5 = require("react");
1950
+ var import_react7 = require("react");
3047
1951
  var import_react_dom = require("react-dom");
3048
- var import_jsx_runtime28 = require("react/jsx-runtime");
1952
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3049
1953
  var TokenPicker = ({
3050
1954
  onCloseClick,
3051
1955
  tokens,
@@ -3054,8 +1958,8 @@ var TokenPicker = ({
3054
1958
  signer,
3055
1959
  balances
3056
1960
  }) => {
3057
- const [searchValue, setSearchValue] = (0, import_react5.useState)("");
3058
- const modalRoot = document.querySelector(".xswap");
1961
+ const [searchValue, setSearchValue] = (0, import_react7.useState)("");
1962
+ const modalRoot = document.querySelector("#xswap-modal");
3059
1963
  const onBackdropClick = (e) => {
3060
1964
  e.stopPropagation();
3061
1965
  e.nativeEvent.stopImmediatePropagation();
@@ -3063,31 +1967,33 @@ var TokenPicker = ({
3063
1967
  onCloseClick();
3064
1968
  }
3065
1969
  };
3066
- const filteredTokens = (0, import_react5.useMemo)(() => {
1970
+ const filteredTokens = (0, import_react7.useMemo)(() => {
3067
1971
  const isMatch = (value, searchValue2) => value.toLowerCase().indexOf(searchValue2.toLowerCase()) > -1;
3068
1972
  return tokens?.filter(
3069
1973
  (token) => isMatch(token.symbol, searchValue) || isMatch(token.name, searchValue) || token.address === searchValue.toLowerCase()
1974
+ ).sort(
1975
+ (a, b) => a.priority < b.priority ? 1 : balances && balances[a.address] && balances[b.address] && balances[a.address]?.lte(balances[b.address] || "0") ? 1 : -1
3070
1976
  );
3071
1977
  }, [searchValue, tokens]);
3072
1978
  return modalRoot ? (0, import_react_dom.createPortal)(
3073
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1979
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3074
1980
  "div",
3075
1981
  {
3076
1982
  onClick: onBackdropClick,
3077
1983
  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",
3078
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("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: [
3079
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1984
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
1985
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3080
1986
  "div",
3081
1987
  {
3082
1988
  onClick: onCloseClick,
3083
1989
  className: "absolute top-4 right-4 cursor-pointer",
3084
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CloseIcon, {})
1990
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CloseIcon, {})
3085
1991
  }
3086
1992
  ),
3087
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-base mb-4", children: "Pick a token" }),
3088
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("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: [
3089
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SearchIcon, {}) }),
3090
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1993
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-base mb-4", children: "Pick a token" }),
1994
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("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: [
1995
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SearchIcon, {}) }),
1996
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3091
1997
  "input",
3092
1998
  {
3093
1999
  placeholder: "Search name or paste address",
@@ -3097,7 +2003,7 @@ var TokenPicker = ({
3097
2003
  }
3098
2004
  )
3099
2005
  ] }),
3100
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "my-4 mx-0 flex flex-wrap gap-3", children: tokens?.filter((token) => token?.quickPick).map((token) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2006
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "my-4 mx-0 flex flex-wrap gap-3", children: tokens?.filter((token) => token?.quickPick).map((token) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3101
2007
  "div",
3102
2008
  {
3103
2009
  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)]" : ""}`,
@@ -3106,16 +2012,14 @@ var TokenPicker = ({
3106
2012
  onCloseClick();
3107
2013
  },
3108
2014
  children: [
3109
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("img", { src: token.image, alt: token.name, className: "w-5" }),
3110
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm", children: token.symbol })
2015
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("img", { src: token.image, alt: token.name, className: "w-5" }),
2016
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "text-sm", children: token.symbol })
3111
2017
  ]
3112
2018
  },
3113
2019
  token.address
3114
2020
  )) }),
3115
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-[2px] my-0 mx-[-24px] w-[100%+48px] px-12 bg-[rgba(255,255,255,0.1)]" }),
3116
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "overflow-y-scroll h-full mx-[-24px] w-[100%+48px] flex flex-col", children: filteredTokens && filteredTokens.length > 0 ? filteredTokens.sort(
3117
- (a, b) => balances && balances[a.address] && balances[b.address] && balances[a.address]?.lte(balances[b.address] || "0") ? 1 : -1
3118
- ).map((token, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2021
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-[2px] my-0 mx-[-24px] w-[100%+48px] px-12 bg-[rgba(255,255,255,0.1)]" }),
2022
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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__ */ (0, import_jsx_runtime31.jsxs)(
3119
2023
  "div",
3120
2024
  {
3121
2025
  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)]" : ""}`,
@@ -3124,29 +2028,29 @@ var TokenPicker = ({
3124
2028
  onCloseClick();
3125
2029
  },
3126
2030
  children: [
3127
- token.image ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2031
+ token.image ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3128
2032
  "img",
3129
2033
  {
3130
2034
  src: token.image,
3131
2035
  alt: token.name,
3132
2036
  className: "token-picker__all__logo"
3133
2037
  }
3134
- ) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("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) }),
3135
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex justify-between items-center gap-1 overflow-hidden grow", children: [
3136
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col leading-[16px]", children: [
3137
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "overflow-hidden whitespace-nowrap text-ellipsis text-[15px]", children: token.name }),
3138
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-[#888] text-[11px]", children: token.symbol })
2038
+ ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("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) }),
2039
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex justify-between items-center gap-1 overflow-hidden grow", children: [
2040
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col leading-[16px]", children: [
2041
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "overflow-hidden whitespace-nowrap text-ellipsis text-[15px]", children: token.name }),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "text-[#888] text-[11px]", children: token.symbol })
3139
2043
  ] }),
3140
- signer && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: balances && balances[token.address] && token.decimals ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-xs", children: weiToHumanReadable({
2044
+ signer && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: balances && balances[token.address] && token.decimals ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "text-xs", children: weiToHumanReadable({
3141
2045
  amount: balances[token.address]?.toString() || "0",
3142
2046
  decimals: token.decimals,
3143
2047
  precisionFractionalPlaces: 4
3144
- }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { w: "w-12", h: "h-3" }) })
2048
+ }) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Skeleton, { width: "w-12", height: "h-3" }) })
3145
2049
  ] })
3146
2050
  ]
3147
2051
  },
3148
2052
  `${index}_${token.address}`
3149
- )) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-white", children: "No tokens found." }) }) })
2053
+ )) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm text-white", children: "No tokens found." }) }) })
3150
2054
  ] })
3151
2055
  }
3152
2056
  ),
@@ -3155,7 +2059,7 @@ var TokenPicker = ({
3155
2059
  };
3156
2060
 
3157
2061
  // src/components/TxConfigForm/ChainListElement.tsx
3158
- var import_jsx_runtime29 = require("react/jsx-runtime");
2062
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3159
2063
  var ChainListElement = ({
3160
2064
  chain,
3161
2065
  setSrcChain,
@@ -3163,8 +2067,8 @@ var ChainListElement = ({
3163
2067
  index,
3164
2068
  length
3165
2069
  }) => {
3166
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
3167
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2070
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
2071
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3168
2072
  "li",
3169
2073
  {
3170
2074
  className: "bg-transparent border-none flex gap-1 items-center cursor-pointer py-2 w-full",
@@ -3173,21 +2077,21 @@ var ChainListElement = ({
3173
2077
  setChainListShown(false);
3174
2078
  },
3175
2079
  children: [
3176
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("img", { width: 12, height: 12, src: chain.image, alt: chain.displayName }),
2080
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("img", { width: 12, height: 12, src: chain.image, alt: chain.displayName }),
3177
2081
  chain.displayName
3178
2082
  ]
3179
2083
  }
3180
2084
  ),
3181
- index !== length - 1 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "h-px mx-2 bg-[rgba(255,255,255,0.15)]" })
2085
+ index !== length - 1 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "h-px mx-2 bg-[rgba(255,255,255,0.15)]" })
3182
2086
  ] }, `${chain.ecosystem}-${chain.chainId}`);
3183
2087
  };
3184
2088
 
3185
2089
  // src/components/TxConfigForm/BalanceComponent.tsx
3186
- var import_react6 = require("react");
2090
+ var import_react8 = require("react");
3187
2091
  var import_bignumber3 = __toESM(require("bignumber.js"));
3188
- var import_jsx_runtime30 = require("react/jsx-runtime");
2092
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3189
2093
  var BalanceComponent = ({ srcToken, balances }) => {
3190
- const balanceText = (0, import_react6.useMemo)(() => {
2094
+ const balanceText = (0, import_react8.useMemo)(() => {
3191
2095
  if (!balances || !srcToken)
3192
2096
  return "0";
3193
2097
  if (balances[srcToken.address]?.toString() === "0")
@@ -3207,7 +2111,7 @@ var BalanceComponent = ({ srcToken, balances }) => {
3207
2111
  precisionFractionalPlaces: 5
3208
2112
  });
3209
2113
  }, [srcToken, balances]);
3210
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
2114
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
3211
2115
  "Balance:",
3212
2116
  " ",
3213
2117
  srcToken && balances ? weiToHumanReadable({
@@ -3215,12 +2119,12 @@ var BalanceComponent = ({ srcToken, balances }) => {
3215
2119
  decimals: srcToken.decimals,
3216
2120
  precisionFractionalPlaces: 4
3217
2121
  }) : 0,
3218
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "bg-gradient-to-r from-x_blue_light to-x_blue_dark bg-clip-text text-transparent", children: "Max" })
2122
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "bg-gradient-to-r from-x_blue_light to-x_blue_dark bg-clip-text text-transparent", children: "Max" })
3219
2123
  ] });
3220
2124
  };
3221
2125
 
3222
2126
  // src/components/TxConfigForm/SwapPanel.tsx
3223
- var import_jsx_runtime31 = require("react/jsx-runtime");
2127
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3224
2128
  var SwapPanel = ({
3225
2129
  amount,
3226
2130
  setAmount,
@@ -3233,10 +2137,10 @@ var SwapPanel = ({
3233
2137
  prices,
3234
2138
  supportedChains
3235
2139
  }) => {
3236
- const [chainListShown, setChainListShown] = (0, import_react7.useState)(false);
3237
- const [tokenListShown, setTokenListShown] = (0, import_react7.useState)(false);
3238
- const listRef = (0, import_react7.useRef)(null);
3239
- const buttonRef = (0, import_react7.useRef)(null);
2140
+ const [chainListShown, setChainListShown] = (0, import_react9.useState)(false);
2141
+ const [tokenListShown, setTokenListShown] = (0, import_react9.useState)(false);
2142
+ const listRef = (0, import_react9.useRef)(null);
2143
+ const buttonRef = (0, import_react9.useRef)(null);
3240
2144
  const handleClickOutside = (event) => {
3241
2145
  if (listRef.current && buttonRef.current) {
3242
2146
  const listElement = listRef.current;
@@ -3255,21 +2159,21 @@ var SwapPanel = ({
3255
2159
  })
3256
2160
  );
3257
2161
  };
3258
- (0, import_react7.useEffect)(() => {
2162
+ (0, import_react9.useEffect)(() => {
3259
2163
  if (chainListShown) {
3260
2164
  document.addEventListener("mousedown", handleClickOutside);
3261
2165
  return () => document.removeEventListener("mousedown", handleClickOutside);
3262
2166
  }
3263
2167
  }, [chainListShown]);
3264
- const chainListOptions = (0, import_react7.useMemo)(
2168
+ const chainListOptions = (0, import_react9.useMemo)(
3265
2169
  () => supportedChains.filter((chain) => chain.chainId !== srcChain?.chainId),
3266
2170
  [supportedChains, srcChain]
3267
2171
  );
3268
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col items-start globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4", children: [
3269
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "w-full flex gap-4 items-start justify-between mb-4", children: [
3270
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col gap-2 overflow-hidden w-1/2", children: [
3271
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-white opacity-60 text-sm font-medium", children: "You pay" }),
3272
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2172
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between globalBorder rounded-lg bg-[rgba(15,15,15,1)] p-4", children: [
2173
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col justify-between gap-2 overflow-hidden w-1/2", children: [
2174
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-1", children: [
2175
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-white opacity-60 text-xs sm:text-sm font-medium", children: "You pay" }),
2176
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3273
2177
  "input",
3274
2178
  {
3275
2179
  className: "p-0 border-none outline-none bg-transparent text-2xl overflow-ellipsis",
@@ -3289,90 +2193,94 @@ var SwapPanel = ({
3289
2193
  }
3290
2194
  )
3291
2195
  ] }),
3292
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-col relative items-end gap-2.5 w-1/2 text-xs", children: [
3293
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3294
- "div",
3295
- {
3296
- ref: buttonRef,
3297
- className: "bg-black globalBorder rounded-2xl whitespace-nowrap flex items-center p-2 cursor-pointer gap-2",
3298
- onClick: () => setChainListShown((prev) => !prev),
3299
- children: [
3300
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3301
- "img",
3302
- {
3303
- width: "16",
3304
- height: "16",
3305
- src: srcChain?.image,
3306
- alt: srcChain?.name
3307
- }
3308
- ),
3309
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: srcChain?.displayName }),
3310
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DownArrowIcon, {})
3311
- ]
3312
- }
3313
- ),
3314
- chainListShown && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3315
- "ul",
3316
- {
3317
- ref: listRef,
3318
- 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",
3319
- children: chainListOptions.map((chain, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3320
- ChainListElement,
2196
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex items-center text-sm text-[rgba(255,255,255,0.6)]", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2197
+ UsdPrice,
2198
+ {
2199
+ prices,
2200
+ token: srcToken,
2201
+ amount,
2202
+ loading: false
2203
+ }
2204
+ ) })
2205
+ ] }),
2206
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col relative items-end gap-2.5 w-1/2 text-xs", children: [
2207
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2208
+ "div",
2209
+ {
2210
+ className: "flex gap-2 items-center p-2 max-w-full cursor-pointer bg-black text-white globalBorder rounded-3xl whitespace-nowrap",
2211
+ onClick: () => {
2212
+ setTokenListShown((state) => !state);
2213
+ },
2214
+ children: [
2215
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2216
+ "img",
3321
2217
  {
3322
- index,
3323
- length: supportedChains.length,
3324
- setSrcChain,
3325
- setChainListShown,
3326
- chain
2218
+ height: 16,
2219
+ width: 16,
2220
+ src: srcToken?.image,
2221
+ alt: srcToken?.name
3327
2222
  }
3328
- ))
3329
- }
3330
- ),
3331
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3332
- "div",
3333
- {
3334
- className: "flex gap-2 items-center p-2 max-w-full cursor-pointer bg-black text-white globalBorder rounded-3xl whitespace-nowrap",
3335
- onClick: () => {
3336
- setTokenListShown((state) => !state);
3337
- },
3338
- children: [
3339
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3340
- "img",
3341
- {
3342
- height: 16,
3343
- width: 16,
3344
- src: srcToken?.image,
3345
- alt: srcToken?.name
3346
- }
3347
- ),
3348
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: srcToken?.symbol }),
3349
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DownArrowIcon, {})
3350
- ]
3351
- }
3352
- ),
3353
- tokenListShown && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3354
- TokenPicker,
3355
- {
3356
- onCloseClick: () => setTokenListShown(false),
3357
- tokens: srcChain?.tokens,
3358
- signer,
3359
- selectedToken: srcToken,
3360
- setSelectedToken: (token) => setSrcToken(token),
3361
- balances
3362
- }
3363
- )
3364
- ] })
3365
- ] }),
3366
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex justify-between items-center w-full text-sm text-[rgba(255,255,255,0.6)] relative", children: [
3367
- srcToken ? prices && prices[srcToken.address] ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: `$${(Number(amount) * Number(prices[srcToken.address])).toFixed(
3368
- 2
3369
- )}` }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Alert, { desc: "Unknown price" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: "$0.00" }),
3370
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2223
+ ),
2224
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: srcToken?.symbol }),
2225
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DownArrowIcon, {})
2226
+ ]
2227
+ }
2228
+ ),
2229
+ tokenListShown && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2230
+ TokenPicker,
2231
+ {
2232
+ onCloseClick: () => setTokenListShown(false),
2233
+ tokens: srcChain?.tokens,
2234
+ signer,
2235
+ selectedToken: srcToken,
2236
+ setSelectedToken: (token) => setSrcToken(token),
2237
+ balances
2238
+ }
2239
+ ),
2240
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3371
2241
  "div",
3372
2242
  {
3373
2243
  onClick: handleMaxClick,
3374
2244
  className: "flex gap-1 items-center font-medium text-white opacity-60 py-0.5 cursor-pointer",
3375
- children: signer && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(BalanceComponent, { balances, srcToken })
2245
+ children: signer && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BalanceComponent, { balances, srcToken })
2246
+ }
2247
+ ),
2248
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2249
+ "div",
2250
+ {
2251
+ ref: buttonRef,
2252
+ className: "bg-black globalBorder rounded-2xl whitespace-nowrap flex items-center p-2 cursor-pointer gap-2",
2253
+ onClick: () => setChainListShown((prev) => !prev),
2254
+ children: [
2255
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2256
+ "img",
2257
+ {
2258
+ width: "16",
2259
+ height: "16",
2260
+ src: srcChain?.image,
2261
+ alt: srcChain?.name
2262
+ }
2263
+ ),
2264
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: srcChain?.displayName }),
2265
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DownArrowIcon, {})
2266
+ ]
2267
+ }
2268
+ ),
2269
+ chainListShown && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2270
+ "ul",
2271
+ {
2272
+ ref: listRef,
2273
+ 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",
2274
+ children: chainListOptions.map((chain, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2275
+ ChainListElement,
2276
+ {
2277
+ index,
2278
+ length: supportedChains.length,
2279
+ setSrcChain,
2280
+ setChainListShown,
2281
+ chain
2282
+ }
2283
+ ))
3376
2284
  }
3377
2285
  )
3378
2286
  ] })
@@ -3380,9 +2288,9 @@ var SwapPanel = ({
3380
2288
  };
3381
2289
 
3382
2290
  // src/components/TxConfigForm/ErrorField.tsx
3383
- var import_jsx_runtime32 = require("react/jsx-runtime");
2291
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3384
2292
  var ErrorField = ({ error }) => {
3385
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2293
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3386
2294
  "div",
3387
2295
  {
3388
2296
  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"}`,
@@ -3392,13 +2300,13 @@ var ErrorField = ({ error }) => {
3392
2300
  };
3393
2301
 
3394
2302
  // src/components/TxConfigForm/Description.tsx
3395
- var import_jsx_runtime33 = require("react/jsx-runtime");
2303
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3396
2304
  var Description = ({ description }) => {
3397
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col items-start rounded-lg px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-full flex gap-4 items-start justify-between text-xl", children: description }) });
2305
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex flex-col items-start rounded-lg px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-full flex gap-4 items-start justify-between text-xl", children: description }) });
3398
2306
  };
3399
2307
 
3400
2308
  // src/components/TxConfigForm/Form.tsx
3401
- var import_jsx_runtime34 = require("react/jsx-runtime");
2309
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3402
2310
  var Form = ({
3403
2311
  dstChainId,
3404
2312
  dstTokenAddr,
@@ -3407,51 +2315,50 @@ var Form = ({
3407
2315
  supportedChains,
3408
2316
  onSubmit
3409
2317
  }) => {
3410
- const [signer, setSigner] = (0, import_react8.useState)();
3411
- const [dstChain, setDstChain] = (0, import_react8.useState)();
3412
- const [dstToken, setDstToken] = (0, import_react8.useState)();
3413
- const [srcChain, setSrcChain] = (0, import_react8.useState)();
3414
- const [srcToken, setSrcToken] = (0, import_react8.useState)();
3415
- const [amount, setAmount] = (0, import_react8.useState)("");
3416
- const [paymentToken, setPaymentToken] = (0, import_react8.useState)();
3417
- const [route, setRoute] = (0, import_react8.useState)();
3418
- const [expressChecked, setExpressChecked] = (0, import_react8.useState)(true);
3419
- const [historyTabShown, setHistoryTabShown] = (0, import_react8.useState)(false);
3420
- const [isGettingRoute, setIsGettingRoute] = (0, import_react8.useState)(false);
3421
- const [prices, setPrices] = (0, import_react8.useState)();
3422
- const [balances, setBalances] = (0, import_react8.useState)();
3423
- const [settingsShown, setSettingsShown] = (0, import_react8.useState)(false);
3424
- const [formError, setFormError] = (0, import_react8.useState)("");
3425
- const [slippage, setSlippage] = (0, import_react8.useState)("1.5");
3426
- const [feesDetailsShown, setFeesDetailsShown] = (0, import_react8.useState)(false);
2318
+ const [signer, setSigner] = (0, import_react10.useState)();
2319
+ const [dstChain, setDstChain] = (0, import_react10.useState)();
2320
+ const [dstToken, setDstToken] = (0, import_react10.useState)();
2321
+ const [srcChain, setSrcChain] = (0, import_react10.useState)();
2322
+ const [srcToken, setSrcToken] = (0, import_react10.useState)();
2323
+ const [amount, setAmount] = (0, import_react10.useState)("");
2324
+ const [paymentToken, setPaymentToken] = (0, import_react10.useState)();
2325
+ const [route, setRoute] = (0, import_react10.useState)();
2326
+ const [expressChecked, setExpressChecked] = (0, import_react10.useState)(true);
2327
+ const [historyTabShown, setHistoryTabShown] = (0, import_react10.useState)(false);
2328
+ const [isGettingRoute, setIsGettingRoute] = (0, import_react10.useState)(false);
2329
+ const [prices, setPrices] = (0, import_react10.useState)();
2330
+ const [balances, setBalances] = (0, import_react10.useState)();
2331
+ const [settingsShown, setSettingsShown] = (0, import_react10.useState)(false);
2332
+ const [formError, setFormError] = (0, import_react10.useState)("");
2333
+ const [slippage, setSlippage] = (0, import_react10.useState)("1.5");
2334
+ const [feesDetailsShown, setFeesDetailsShown] = (0, import_react10.useState)(false);
3427
2335
  const debouncedAmount = useDebounce(amount, 1e3);
3428
2336
  const account = (0, import_wagmi2.useAccount)();
3429
2337
  const { switchChainAsync } = (0, import_wagmi2.useSwitchChain)();
3430
- (0, import_react8.useEffect)(() => {
2338
+ (0, import_react10.useEffect)(() => {
3431
2339
  setSigner(account.address);
3432
2340
  }, [account.address]);
3433
- (0, import_react8.useEffect)(() => {
3434
- if (supportedChains.some(
2341
+ (0, import_react10.useEffect)(() => {
2342
+ const defaultChain = supportedChains.find(
3435
2343
  ({ chainId }) => chainId === account.chainId?.toString()
3436
- )) {
3437
- setSrcChain(
3438
- supportedChains.find(
3439
- ({ chainId }) => chainId === account.chainId?.toString()
3440
- )
3441
- );
3442
- }
2344
+ );
2345
+ setSrcChain(
2346
+ defaultChain ?? supportedChains.find(
2347
+ ({ chainId }) => chainId === DEFAULT_SOURCE_CHAIN_ID
2348
+ )
2349
+ );
3443
2350
  }, [account.chainId]);
3444
- (0, import_react8.useEffect)(() => {
2351
+ (0, import_react10.useEffect)(() => {
3445
2352
  setDstChain(supportedChains.find((chain) => chain.chainId === dstChainId));
3446
2353
  }, [supportedChains, dstChainId]);
3447
- (0, import_react8.useEffect)(() => {
2354
+ (0, import_react10.useEffect)(() => {
3448
2355
  setDstToken(
3449
2356
  dstChain?.tokens.find(
3450
2357
  (token) => token.address.toLowerCase() === dstTokenAddr.toLowerCase()
3451
2358
  )
3452
2359
  );
3453
2360
  }, [dstChain]);
3454
- (0, import_react8.useEffect)(() => {
2361
+ (0, import_react10.useEffect)(() => {
3455
2362
  if (srcChain && srcToken && dstChain && debouncedAmount && paymentToken && slippage) {
3456
2363
  setFormError("");
3457
2364
  const timeout = setTimeout(() => {
@@ -3459,8 +2366,12 @@ var Form = ({
3459
2366
  }, ROUTE_TIMEOUT_MS);
3460
2367
  setIsGettingRoute(true);
3461
2368
  setFeesDetailsShown(false);
2369
+ if (!srcToken.decimals)
2370
+ throw new Error(
2371
+ `Configuration error: selected token ($${srcToken.symbol} ${srcToken.name}) has unknown decimals param.`
2372
+ );
3462
2373
  getRoute({
3463
- fromAmount: import_ethers4.ethers.utils.parseUnits(debouncedAmount, srcToken?.decimals).toString(),
2374
+ fromAmount: import_ethers5.ethers.utils.parseUnits(debouncedAmount, srcToken.decimals).toString(),
3464
2375
  fromAddress: signer || ADDRESSES[srcChain.chainId].FeeCollector,
3465
2376
  fromChain: srcChain.chainId,
3466
2377
  fromToken: srcToken.address,
@@ -3490,30 +2401,30 @@ var Form = ({
3490
2401
  slippage,
3491
2402
  expressChecked
3492
2403
  ]);
3493
- (0, import_react8.useEffect)(() => {
2404
+ (0, import_react10.useEffect)(() => {
3494
2405
  if (srcChain) {
3495
2406
  setPaymentToken(
3496
2407
  srcChain.tokens.find(
3497
- (token) => token.address.toLowerCase() === import_ethers4.ethers.constants.AddressZero.toLowerCase()
2408
+ (token) => token.address.toLowerCase() === import_ethers5.ethers.constants.AddressZero.toLowerCase()
3498
2409
  )
3499
2410
  );
3500
2411
  }
3501
2412
  }, [srcChain]);
3502
- (0, import_react8.useEffect)(() => {
2413
+ (0, import_react10.useEffect)(() => {
3503
2414
  setAmount("");
3504
2415
  setFormError("");
3505
2416
  }, [srcToken]);
3506
- (0, import_react8.useEffect)(() => {
2417
+ (0, import_react10.useEffect)(() => {
3507
2418
  setSrcToken(srcChain?.tokens[0]);
3508
2419
  }, [srcChain]);
3509
- (0, import_react8.useEffect)(() => {
2420
+ (0, import_react10.useEffect)(() => {
3510
2421
  if (srcChain) {
3511
2422
  getPrices({ chainId: srcChain.chainId, currency: "USD" }).then(
3512
2423
  (prices2) => setPrices(prices2)
3513
2424
  );
3514
2425
  }
3515
2426
  }, [srcChain]);
3516
- (0, import_react8.useEffect)(() => {
2427
+ (0, import_react10.useEffect)(() => {
3517
2428
  if (srcChain && signer) {
3518
2429
  getBalances(srcChain, signer).then((balances2) => setBalances(balances2));
3519
2430
  }
@@ -3526,13 +2437,13 @@ var Form = ({
3526
2437
  const handleSwitchChain = async () => {
3527
2438
  await switchChainAsync({ chainId: Number(srcChain?.chainId) });
3528
2439
  };
3529
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2440
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3530
2441
  "form",
3531
2442
  {
3532
- className: "flex flex-col gap-2 z-10 my-0 mx-auto p-4 rounded-3xl overflow-hidden font-light w-[360px] sm:w-[600px]",
2443
+ 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",
3533
2444
  onSubmit: handleSubmit,
3534
2445
  children: [
3535
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2446
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3536
2447
  TopBar,
3537
2448
  {
3538
2449
  signer,
@@ -3541,7 +2452,7 @@ var Form = ({
3541
2452
  setSettingsShown
3542
2453
  }
3543
2454
  ),
3544
- settingsShown && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2455
+ settingsShown && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3545
2456
  Settings,
3546
2457
  {
3547
2458
  expressChecked,
@@ -3551,9 +2462,9 @@ var Form = ({
3551
2462
  setSlippage
3552
2463
  }
3553
2464
  ),
3554
- historyTabShown ? signer && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(History, { signer, supportedChains }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-col gap-2", children: [
3555
- desc && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Description, { description: desc }),
3556
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2465
+ historyTabShown ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(History, { signer, supportedChains }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col gap-2", children: [
2466
+ desc && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Description, { description: desc }),
2467
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3557
2468
  SwapPanel,
3558
2469
  {
3559
2470
  amount,
@@ -3568,17 +2479,16 @@ var Form = ({
3568
2479
  setSrcChain
3569
2480
  }
3570
2481
  ),
3571
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2482
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3572
2483
  Summary,
3573
2484
  {
3574
2485
  isGettingRoute,
3575
- amount,
3576
2486
  route,
3577
2487
  dstToken,
3578
2488
  dstChain
3579
2489
  }
3580
2490
  ),
3581
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2491
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3582
2492
  FeesDetails,
3583
2493
  {
3584
2494
  route,
@@ -3591,8 +2501,16 @@ var Form = ({
3591
2501
  setFeesDetailsShown
3592
2502
  }
3593
2503
  ),
3594
- formError.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ErrorField, { error: formError }),
3595
- srcChain && srcChain.chainId !== account.chainId?.toString() ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: handleSwitchChain, children: "Switch chain" }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2504
+ formError.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ErrorField, { error: formError }),
2505
+ srcChain && srcChain.chainId !== account.chainId?.toString() ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
2506
+ "button",
2507
+ {
2508
+ disabled: !signer,
2509
+ type: "button",
2510
+ onClick: handleSwitchChain,
2511
+ children: "Switch chain"
2512
+ }
2513
+ ) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3596
2514
  "button",
3597
2515
  {
3598
2516
  type: "submit",
@@ -3607,7 +2525,7 @@ var Form = ({
3607
2525
  };
3608
2526
 
3609
2527
  // src/components/TxConfigForm/index.tsx
3610
- var import_jsx_runtime35 = require("react/jsx-runtime");
2528
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3611
2529
  var TxConfigForm = ({
3612
2530
  dstChainId,
3613
2531
  dstTokenAddr,
@@ -3625,17 +2543,17 @@ var TxConfigForm = ({
3625
2543
  }
3626
2544
  };
3627
2545
  const queryClient = new import_react_query.QueryClient();
3628
- const wagmiConfig = (0, import_react9.useMemo)(
2546
+ const wagmiConfig = (0, import_react11.useMemo)(
3629
2547
  () => getWagmiConfig(supportedChains),
3630
2548
  supportedChains
3631
2549
  );
3632
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_wagmi3.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2550
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_wagmi3.WagmiProvider, { config: wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3633
2551
  "div",
3634
2552
  {
3635
2553
  className: "top-0 left-0 right-0 bottom-0 bg-[rgba(0,0,0,0.8)] fixed flex items-center justify-center z-10",
3636
2554
  onClick: onBackdropClick,
3637
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("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: [
3638
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2555
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("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: [
2556
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3639
2557
  Form,
3640
2558
  {
3641
2559
  dstChainId,
@@ -3646,19 +2564,19 @@ var TxConfigForm = ({
3646
2564
  onSubmit
3647
2565
  }
3648
2566
  ),
3649
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2567
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3650
2568
  "div",
3651
2569
  {
3652
2570
  className: "absolute top-7 right-4 cursor-pointer text-white",
3653
2571
  onClick: onClose,
3654
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CloseIcon, {})
2572
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CloseIcon, {})
3655
2573
  }
3656
2574
  ),
3657
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "swappage__poweredby", children: [
3658
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "Powered by" }),
3659
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(XSwapBadgeIcon, {}),
3660
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u2715" }),
3661
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ChainlinkCCIPIcon, {})
2575
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "swappage__poweredby", children: [
2576
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "Powered by" }),
2577
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(XSwapBadgeIcon, {}),
2578
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "\u2715" }),
2579
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChainlinkCCIPIcon, {})
3662
2580
  ] })
3663
2581
  ] })
3664
2582
  }
@@ -3674,7 +2592,7 @@ var openTxConfigForm = async ({
3674
2592
  try {
3675
2593
  return await new Promise((resolve) => {
3676
2594
  txConfigFormRoot.render(
3677
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2595
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3678
2596
  TxConfigForm,
3679
2597
  {
3680
2598
  dstChainId,
@@ -3700,26 +2618,141 @@ var openTxConfigForm = async ({
3700
2618
  var txConfigFormRoot;
3701
2619
  if (typeof document !== "undefined") {
3702
2620
  const xswapElement = document.createElement("div");
3703
- xswapElement.setAttribute("id", "txConfigFormRoot");
3704
- xswapElement.classList.add("xswap");
2621
+ xswapElement.setAttribute("id", "xswap-modal");
3705
2622
  document.body.appendChild(xswapElement);
3706
2623
  txConfigFormRoot = (0, import_client.createRoot)(xswapElement);
3707
2624
  }
3708
2625
 
2626
+ // src/components/TxHistoryButton/index.tsx
2627
+ var import_react12 = require("react");
2628
+ var import_client2 = require("react-dom/client");
2629
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2630
+ var TxHistoryButton = ({ transaction }) => {
2631
+ const {
2632
+ fromChain,
2633
+ fromChainImage,
2634
+ fromToken,
2635
+ fromTokenImage,
2636
+ fromAmount,
2637
+ toChain,
2638
+ toChainImage,
2639
+ isDone,
2640
+ txHash,
2641
+ explorer
2642
+ } = transaction;
2643
+ const [isWide, setIsWide] = (0, import_react12.useState)(false);
2644
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-2", onClick: () => setIsWide((x) => !x), children: [
2645
+ isWide && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
2646
+ "div",
2647
+ {
2648
+ 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"}`,
2649
+ children: [
2650
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex justify-between flex-col gap-2 sm:gap-5 sm:flex-row w-full", children: [
2651
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
2652
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2653
+ "img",
2654
+ {
2655
+ className: "w-5 h-5",
2656
+ src: fromChainImage,
2657
+ alt: "source chain"
2658
+ }
2659
+ ),
2660
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: fromChain }),
2661
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ArrowRightIcon, {}) }),
2662
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("img", { className: "w-5 h-5", src: toChainImage, alt: "to chain" }),
2663
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: toChain })
2664
+ ] }),
2665
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
2666
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: "Sent" }),
2667
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: fromAmount }),
2668
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { children: fromToken }),
2669
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2670
+ "img",
2671
+ {
2672
+ className: "w-5 h-5",
2673
+ src: fromTokenImage,
2674
+ alt: "source token"
2675
+ }
2676
+ )
2677
+ ] })
2678
+ ] }),
2679
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2680
+ "a",
2681
+ {
2682
+ href: explorer,
2683
+ target: "_blank",
2684
+ rel: "noreferrer",
2685
+ className: "no-underline cursor-pointer",
2686
+ "aria-label": "Show the transaction in the chain explorer",
2687
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "w-3.5 h-3.5", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ArrowUpRightIcon, {}) })
2688
+ }
2689
+ )
2690
+ ]
2691
+ }
2692
+ ),
2693
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2694
+ "div",
2695
+ {
2696
+ className: `text-white rounded-xl cursor-pointer bg-gradient-to-r
2697
+ ${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"}`,
2698
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-2 items-center h-14 w-20 justify-center", children: [
2699
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ArrowLeftIcon, {}),
2700
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "relative flex items-center justify-center w-9 h-9", children: isDone ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-x_green w-5 h-5", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CheckIcon, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
2701
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "w-5 h-5", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(XSwapLogo, {}) }),
2702
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "absolute flex items-center justify-center top-0 left-0 right-0 bottom-0 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CircularProgressIcon, {}) })
2703
+ ] }) })
2704
+ ] })
2705
+ }
2706
+ )
2707
+ ] });
2708
+ };
2709
+ var renderedTransactions = [];
2710
+ var addTransactionToRenderedTransactions = (transaction) => {
2711
+ if (!renderedTransactions.some(({ txHash }) => txHash === transaction.txHash))
2712
+ renderedTransactions.push(transaction);
2713
+ };
2714
+ var removeTransactionFromRenderedTransactions = (txHash) => {
2715
+ const filteredRenderedTransactions = renderedTransactions.filter(
2716
+ (item) => item.txHash !== txHash
2717
+ );
2718
+ renderedTransactions = [...filteredRenderedTransactions];
2719
+ };
2720
+ var updateTransactionDoneInRenderedTransactions = (txHash) => {
2721
+ const transaction = renderedTransactions.find(
2722
+ (item) => item.txHash === txHash
2723
+ );
2724
+ if (transaction) {
2725
+ transaction.isDone = true;
2726
+ }
2727
+ };
2728
+ var historyElement = document.createElement("div");
2729
+ historyElement.setAttribute("id", "xswap-history");
2730
+ historyElement.setAttribute(
2731
+ "class",
2732
+ "absolute bottom-5 right-2 flex flex-col gap-3 pl-9 items-end w-full z-50"
2733
+ );
2734
+ document.body.appendChild(historyElement);
2735
+ var txHistoryButtonRoot = (0, import_client2.createRoot)(historyElement);
2736
+ var renderTxHistoryButtons = () => {
2737
+ const buttons = renderedTransactions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TxHistoryButton, { transaction: item }, item.txHash));
2738
+ txHistoryButtonRoot.render(buttons);
2739
+ };
2740
+
3709
2741
  // src/components/Skeleton/index.tsx
3710
- var import_jsx_runtime36 = require("react/jsx-runtime");
3711
- var Skeleton = ({ w, h }) => {
3712
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `bg-current rounded animate-pulse ${w} ${h}` });
2742
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2743
+ var Skeleton = ({ width, height }) => {
2744
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `bg-current rounded animate-pulse ${width} ${height}` });
3713
2745
  };
3714
2746
  // Annotate the CommonJS export names for ESM import in node:
3715
2747
  0 && (module.exports = {
3716
2748
  ADDRESSES,
3717
2749
  Alert,
3718
2750
  BALANCES_CHUNK_SIZE,
3719
- BALANCE_DISPLAY_MIN_LIMIT,
3720
2751
  BatchQueryAbi,
2752
+ CCIP_EXPLORER,
3721
2753
  ContractName,
3722
2754
  DEFAULT_ECOSYSTEM,
2755
+ DEFAULT_SOURCE_CHAIN_ID,
3723
2756
  DELIVERY_TIME,
3724
2757
  ERC20Abi,
3725
2758
  EXPRESS_DELIVERY_TIME,
@@ -3731,9 +2764,10 @@ var Skeleton = ({ w, h }) => {
3731
2764
  ROUTE_TIMEOUT_MS,
3732
2765
  SLIPPAGE_PRESETS,
3733
2766
  Skeleton,
2767
+ TxHistoryButton,
3734
2768
  Web3Environment,
3735
2769
  XSwapCallType,
3736
- XSwapRouterAbi,
2770
+ addTransactionToRenderedTransactions,
3737
2771
  chunkArray,
3738
2772
  deepMergeObjects,
3739
2773
  findPlaceholderIndex,
@@ -3746,14 +2780,19 @@ var Skeleton = ({ w, h }) => {
3746
2780
  getBridgeTokens,
3747
2781
  getChainData,
3748
2782
  getChains,
2783
+ getDate,
3749
2784
  getHistory,
3750
2785
  getPrices,
3751
2786
  getRoute,
3752
2787
  getSwapTx,
3753
2788
  getTokens,
2789
+ monitorTransactionStatus,
3754
2790
  openTxConfigForm,
2791
+ removeTransactionFromRenderedTransactions,
2792
+ renderTxHistoryButtons,
3755
2793
  replaceNull,
3756
2794
  safeBigNumberFrom,
3757
2795
  shortAddress,
2796
+ updateTransactionDoneInRenderedTransactions,
3758
2797
  weiToHumanReadable
3759
2798
  });