@spicenet-io/spiceflow-ui 1.7.5 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +212 -8
- package/dist/index.js +212 -8
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -103,7 +103,7 @@ const CHAIN_CONFIGS = {
|
|
|
103
103
|
symbol: "ETH",
|
|
104
104
|
decimals: 18
|
|
105
105
|
},
|
|
106
|
-
rpc: "https://
|
|
106
|
+
rpc: "https://site1.moralis-nodes.com/base-sepolia/0563a61e273c428f906716cd4befa362",
|
|
107
107
|
blockExplorers: {
|
|
108
108
|
default: {
|
|
109
109
|
name: "Basescan",
|
|
@@ -916,12 +916,13 @@ const useAssets = ({
|
|
|
916
916
|
address,
|
|
917
917
|
supportedChains,
|
|
918
918
|
fetchBalances: fetchBalances2,
|
|
919
|
-
refreshInterval =
|
|
920
|
-
//
|
|
919
|
+
refreshInterval = 8e3
|
|
920
|
+
// 8 seconds default
|
|
921
921
|
}) => {
|
|
922
922
|
const [assets, setAssets] = React.useState([]);
|
|
923
923
|
const [loading, setLoading] = React.useState(false);
|
|
924
924
|
const [error, setError] = React.useState(null);
|
|
925
|
+
const isInitialLoadRef = React.useRef(true);
|
|
925
926
|
const addressRef = React.useRef(address);
|
|
926
927
|
const supportedChainsRef = React.useRef(supportedChains);
|
|
927
928
|
const fetchBalancesRef = React.useRef(fetchBalances2);
|
|
@@ -938,7 +939,9 @@ const useAssets = ({
|
|
|
938
939
|
setAssets([]);
|
|
939
940
|
return;
|
|
940
941
|
}
|
|
941
|
-
|
|
942
|
+
if (isInitialLoadRef.current) {
|
|
943
|
+
setLoading(true);
|
|
944
|
+
}
|
|
942
945
|
setError(null);
|
|
943
946
|
try {
|
|
944
947
|
const balances = await currentFetchBalances(currentAddress);
|
|
@@ -957,7 +960,10 @@ const useAssets = ({
|
|
|
957
960
|
setError(errorMessage);
|
|
958
961
|
console.error("Error fetching assets:", err);
|
|
959
962
|
} finally {
|
|
960
|
-
|
|
963
|
+
if (isInitialLoadRef.current) {
|
|
964
|
+
setLoading(false);
|
|
965
|
+
isInitialLoadRef.current = false;
|
|
966
|
+
}
|
|
961
967
|
}
|
|
962
968
|
}, []);
|
|
963
969
|
const getAssetsByChain = React.useCallback(
|
|
@@ -971,6 +977,7 @@ const useAssets = ({
|
|
|
971
977
|
}, [assets]);
|
|
972
978
|
React.useEffect(() => {
|
|
973
979
|
if (address) {
|
|
980
|
+
isInitialLoadRef.current = true;
|
|
974
981
|
refreshAssets();
|
|
975
982
|
}
|
|
976
983
|
}, [address, refreshAssets]);
|
|
@@ -5534,6 +5541,84 @@ const ConnectWalletModal = ({
|
|
|
5534
5541
|
},
|
|
5535
5542
|
children: [
|
|
5536
5543
|
/* @__PURE__ */ jsxRuntime.jsx(ModalHeader, { title: "Connect Wallet", onClose }),
|
|
5544
|
+
requiredChainId === 421614 && !isConnected && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5545
|
+
"div",
|
|
5546
|
+
{
|
|
5547
|
+
style: {
|
|
5548
|
+
padding: "0 32px",
|
|
5549
|
+
marginTop: "20px"
|
|
5550
|
+
},
|
|
5551
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5552
|
+
"div",
|
|
5553
|
+
{
|
|
5554
|
+
style: {
|
|
5555
|
+
padding: "12px 16px",
|
|
5556
|
+
backgroundColor: "#EFF6FF",
|
|
5557
|
+
borderRadius: "8px",
|
|
5558
|
+
border: "1px solid #BFDBFE",
|
|
5559
|
+
display: "flex",
|
|
5560
|
+
alignItems: "center",
|
|
5561
|
+
gap: "10px"
|
|
5562
|
+
},
|
|
5563
|
+
children: [
|
|
5564
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5565
|
+
"div",
|
|
5566
|
+
{
|
|
5567
|
+
style: {
|
|
5568
|
+
width: "32px",
|
|
5569
|
+
height: "32px",
|
|
5570
|
+
borderRadius: "50%",
|
|
5571
|
+
backgroundColor: "#DBEAFE",
|
|
5572
|
+
display: "flex",
|
|
5573
|
+
alignItems: "center",
|
|
5574
|
+
justifyContent: "center",
|
|
5575
|
+
flexShrink: 0
|
|
5576
|
+
},
|
|
5577
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5578
|
+
"img",
|
|
5579
|
+
{
|
|
5580
|
+
src: img$3,
|
|
5581
|
+
alt: "Rabby",
|
|
5582
|
+
style: {
|
|
5583
|
+
width: "20px",
|
|
5584
|
+
height: "20px",
|
|
5585
|
+
objectFit: "contain"
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
)
|
|
5589
|
+
}
|
|
5590
|
+
),
|
|
5591
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
|
|
5592
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5593
|
+
"p",
|
|
5594
|
+
{
|
|
5595
|
+
style: {
|
|
5596
|
+
margin: "0 0 4px 0",
|
|
5597
|
+
color: "#1E40AF",
|
|
5598
|
+
fontSize: "13px",
|
|
5599
|
+
fontWeight: 600
|
|
5600
|
+
},
|
|
5601
|
+
children: "Recommended Wallet"
|
|
5602
|
+
}
|
|
5603
|
+
),
|
|
5604
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5605
|
+
"p",
|
|
5606
|
+
{
|
|
5607
|
+
style: {
|
|
5608
|
+
margin: 0,
|
|
5609
|
+
color: "#1E3A8A",
|
|
5610
|
+
fontSize: "12px",
|
|
5611
|
+
lineHeight: "1.4"
|
|
5612
|
+
},
|
|
5613
|
+
children: "For Arbitrum Sepolia, we recommend using Rabby wallet instead of MetaMask for the best experience."
|
|
5614
|
+
}
|
|
5615
|
+
)
|
|
5616
|
+
] })
|
|
5617
|
+
]
|
|
5618
|
+
}
|
|
5619
|
+
)
|
|
5620
|
+
}
|
|
5621
|
+
),
|
|
5537
5622
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5538
5623
|
"div",
|
|
5539
5624
|
{
|
|
@@ -5665,6 +5750,75 @@ const ConnectWalletModal = ({
|
|
|
5665
5750
|
]
|
|
5666
5751
|
}
|
|
5667
5752
|
),
|
|
5753
|
+
isConnected && requiredChainId === 421614 && activeConnector && (activeConnector.name.toLowerCase().includes("metamask") || activeConnector.type === "injected") && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5754
|
+
"div",
|
|
5755
|
+
{
|
|
5756
|
+
style: {
|
|
5757
|
+
padding: "12px 16px",
|
|
5758
|
+
backgroundColor: "#EFF6FF",
|
|
5759
|
+
borderRadius: "8px",
|
|
5760
|
+
border: "1px solid #BFDBFE",
|
|
5761
|
+
display: "flex",
|
|
5762
|
+
alignItems: "center",
|
|
5763
|
+
gap: "10px"
|
|
5764
|
+
},
|
|
5765
|
+
children: [
|
|
5766
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5767
|
+
"div",
|
|
5768
|
+
{
|
|
5769
|
+
style: {
|
|
5770
|
+
width: "32px",
|
|
5771
|
+
height: "32px",
|
|
5772
|
+
borderRadius: "50%",
|
|
5773
|
+
backgroundColor: "#DBEAFE",
|
|
5774
|
+
display: "flex",
|
|
5775
|
+
alignItems: "center",
|
|
5776
|
+
justifyContent: "center",
|
|
5777
|
+
flexShrink: 0
|
|
5778
|
+
},
|
|
5779
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5780
|
+
"img",
|
|
5781
|
+
{
|
|
5782
|
+
src: img$3,
|
|
5783
|
+
alt: "Rabby",
|
|
5784
|
+
style: {
|
|
5785
|
+
width: "20px",
|
|
5786
|
+
height: "20px",
|
|
5787
|
+
objectFit: "contain"
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5790
|
+
)
|
|
5791
|
+
}
|
|
5792
|
+
),
|
|
5793
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
|
|
5794
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5795
|
+
"p",
|
|
5796
|
+
{
|
|
5797
|
+
style: {
|
|
5798
|
+
margin: "0 0 4px 0",
|
|
5799
|
+
color: "#1E40AF",
|
|
5800
|
+
fontSize: "13px",
|
|
5801
|
+
fontWeight: 600
|
|
5802
|
+
},
|
|
5803
|
+
children: "Recommended Wallet"
|
|
5804
|
+
}
|
|
5805
|
+
),
|
|
5806
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5807
|
+
"p",
|
|
5808
|
+
{
|
|
5809
|
+
style: {
|
|
5810
|
+
margin: 0,
|
|
5811
|
+
color: "#1E3A8A",
|
|
5812
|
+
fontSize: "12px",
|
|
5813
|
+
lineHeight: "1.4"
|
|
5814
|
+
},
|
|
5815
|
+
children: "For Arbitrum Sepolia, we recommend using Rabby wallet instead of MetaMask for the best experience."
|
|
5816
|
+
}
|
|
5817
|
+
)
|
|
5818
|
+
] })
|
|
5819
|
+
]
|
|
5820
|
+
}
|
|
5821
|
+
),
|
|
5668
5822
|
isConnected && address ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5669
5823
|
"div",
|
|
5670
5824
|
{
|
|
@@ -7055,7 +7209,7 @@ const DepositModal = React.memo(
|
|
|
7055
7209
|
address: sourceAddress || address,
|
|
7056
7210
|
supportedChains,
|
|
7057
7211
|
fetchBalances,
|
|
7058
|
-
refreshInterval:
|
|
7212
|
+
refreshInterval: 8e3
|
|
7059
7213
|
});
|
|
7060
7214
|
const [isExecuting, setIsExecuting] = React.useState(false);
|
|
7061
7215
|
const [error, setError] = React.useState(null);
|
|
@@ -7093,6 +7247,26 @@ const DepositModal = React.memo(
|
|
|
7093
7247
|
});
|
|
7094
7248
|
}
|
|
7095
7249
|
}, [depositAmount]);
|
|
7250
|
+
React.useEffect(() => {
|
|
7251
|
+
if (selectedDepositAssets.length === 0) return;
|
|
7252
|
+
setSelectedDepositAssets((prev) => {
|
|
7253
|
+
return prev.map((selectedItem) => {
|
|
7254
|
+
if (!selectedItem.asset) return selectedItem;
|
|
7255
|
+
const freshAsset = depositAssets.find(
|
|
7256
|
+
(a) => a.chainId === selectedItem.asset.chainId && a.address.toLowerCase() === selectedItem.asset.address.toLowerCase()
|
|
7257
|
+
);
|
|
7258
|
+
if (freshAsset) {
|
|
7259
|
+
return {
|
|
7260
|
+
...selectedItem,
|
|
7261
|
+
asset: freshAsset,
|
|
7262
|
+
// Preserve the user's entered amount
|
|
7263
|
+
amount: selectedItem.amount
|
|
7264
|
+
};
|
|
7265
|
+
}
|
|
7266
|
+
return selectedItem;
|
|
7267
|
+
});
|
|
7268
|
+
});
|
|
7269
|
+
}, [assets]);
|
|
7096
7270
|
React.useEffect(() => {
|
|
7097
7271
|
if (nonEip7702Mode && intentStatus?.overallStatus === "success" && postDepositInstruction && postDepositStatus === "idle") {
|
|
7098
7272
|
const bridgedAmount = bridgedAmountRef.current;
|
|
@@ -7143,8 +7317,16 @@ const DepositModal = React.memo(
|
|
|
7143
7317
|
const errorMessage = error2?.message || String(error2 || "");
|
|
7144
7318
|
const errorDetails = error2?.details || "";
|
|
7145
7319
|
const errorString = `${errorMessage} ${errorDetails}`.toLowerCase();
|
|
7320
|
+
console.error("RPC Error Details:", {
|
|
7321
|
+
code: error2?.code,
|
|
7322
|
+
message: errorMessage,
|
|
7323
|
+
details: errorDetails,
|
|
7324
|
+
data: error2?.data,
|
|
7325
|
+
stack: error2?.stack,
|
|
7326
|
+
fullError: error2
|
|
7327
|
+
});
|
|
7146
7328
|
if (errorString.includes("internal json-rpc error") || errorString.includes("internal error") || errorString.includes("an internal error was received")) {
|
|
7147
|
-
return "Network error
|
|
7329
|
+
return "RPC Network error. Try switching your MetaMask RPC endpoint or try again.";
|
|
7148
7330
|
}
|
|
7149
7331
|
return errorMessage || "Transaction failed";
|
|
7150
7332
|
}, []);
|
|
@@ -7234,6 +7416,7 @@ const DepositModal = React.memo(
|
|
|
7234
7416
|
}
|
|
7235
7417
|
setAirdropMessage("Airdrop requested successfully.");
|
|
7236
7418
|
} catch (e) {
|
|
7419
|
+
console.log(e);
|
|
7237
7420
|
const msg = handleRpcError(e);
|
|
7238
7421
|
setAirdropError(msg);
|
|
7239
7422
|
} finally {
|
|
@@ -7357,6 +7540,11 @@ const DepositModal = React.memo(
|
|
|
7357
7540
|
}
|
|
7358
7541
|
if (currentChain?.id !== chainId) {
|
|
7359
7542
|
setError("Wrong chain selected. Switching network...");
|
|
7543
|
+
console.log("Attempting to switch to chain:", {
|
|
7544
|
+
chainId,
|
|
7545
|
+
currentChainId: currentChain?.id,
|
|
7546
|
+
chainName: getChainName$1(chainId)
|
|
7547
|
+
});
|
|
7360
7548
|
try {
|
|
7361
7549
|
await switchChainAsync({ chainId });
|
|
7362
7550
|
let attempts = 0;
|
|
@@ -7443,6 +7631,14 @@ const DepositModal = React.memo(
|
|
|
7443
7631
|
tokenAddress = "0x0";
|
|
7444
7632
|
}
|
|
7445
7633
|
const isNative = selectedAsset.asset.isNative || tokenAddress.toLowerCase() === "0x0";
|
|
7634
|
+
console.log("Sending transaction via MetaMask:", {
|
|
7635
|
+
chainId,
|
|
7636
|
+
isNative,
|
|
7637
|
+
tokenAddress,
|
|
7638
|
+
delegateContract,
|
|
7639
|
+
amount: amount.toString(),
|
|
7640
|
+
walletChainId: externalWalletClient.chain?.id
|
|
7641
|
+
});
|
|
7446
7642
|
const txHash = isNative ? await externalWalletClient.sendTransaction({
|
|
7447
7643
|
to: delegateContract,
|
|
7448
7644
|
value: amount
|
|
@@ -7583,6 +7779,14 @@ const DepositModal = React.memo(
|
|
|
7583
7779
|
tokenAddress = "0x0";
|
|
7584
7780
|
}
|
|
7585
7781
|
const isNative = selectedAsset.asset.isNative || tokenAddress.toLowerCase() === "0x0";
|
|
7782
|
+
console.log("Sending EIP-7702 transaction via MetaMask:", {
|
|
7783
|
+
chainId,
|
|
7784
|
+
isNative,
|
|
7785
|
+
tokenAddress,
|
|
7786
|
+
amount: amount.toString(),
|
|
7787
|
+
recipient: address,
|
|
7788
|
+
walletChainId: externalWalletClient.chain?.id
|
|
7789
|
+
});
|
|
7586
7790
|
const transferToEmbeddedTx = isNative ? await externalWalletClient.sendTransaction({
|
|
7587
7791
|
to: address,
|
|
7588
7792
|
value: amount
|
|
@@ -10210,7 +10414,7 @@ const SpiceWithdraw = (props) => {
|
|
|
10210
10414
|
}
|
|
10211
10415
|
const transports = {};
|
|
10212
10416
|
chains.forEach((chain) => {
|
|
10213
|
-
transports[chain.id] = wagmi.http();
|
|
10417
|
+
transports[chain.id] = wagmi.http(chain.rpc);
|
|
10214
10418
|
});
|
|
10215
10419
|
const connectorsList = [connectors.metaMask()];
|
|
10216
10420
|
if (walletConnectProjectId) {
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ const CHAIN_CONFIGS = {
|
|
|
101
101
|
symbol: "ETH",
|
|
102
102
|
decimals: 18
|
|
103
103
|
},
|
|
104
|
-
rpc: "https://
|
|
104
|
+
rpc: "https://site1.moralis-nodes.com/base-sepolia/0563a61e273c428f906716cd4befa362",
|
|
105
105
|
blockExplorers: {
|
|
106
106
|
default: {
|
|
107
107
|
name: "Basescan",
|
|
@@ -914,12 +914,13 @@ const useAssets = ({
|
|
|
914
914
|
address,
|
|
915
915
|
supportedChains,
|
|
916
916
|
fetchBalances: fetchBalances2,
|
|
917
|
-
refreshInterval =
|
|
918
|
-
//
|
|
917
|
+
refreshInterval = 8e3
|
|
918
|
+
// 8 seconds default
|
|
919
919
|
}) => {
|
|
920
920
|
const [assets, setAssets] = useState([]);
|
|
921
921
|
const [loading, setLoading] = useState(false);
|
|
922
922
|
const [error, setError] = useState(null);
|
|
923
|
+
const isInitialLoadRef = useRef(true);
|
|
923
924
|
const addressRef = useRef(address);
|
|
924
925
|
const supportedChainsRef = useRef(supportedChains);
|
|
925
926
|
const fetchBalancesRef = useRef(fetchBalances2);
|
|
@@ -936,7 +937,9 @@ const useAssets = ({
|
|
|
936
937
|
setAssets([]);
|
|
937
938
|
return;
|
|
938
939
|
}
|
|
939
|
-
|
|
940
|
+
if (isInitialLoadRef.current) {
|
|
941
|
+
setLoading(true);
|
|
942
|
+
}
|
|
940
943
|
setError(null);
|
|
941
944
|
try {
|
|
942
945
|
const balances = await currentFetchBalances(currentAddress);
|
|
@@ -955,7 +958,10 @@ const useAssets = ({
|
|
|
955
958
|
setError(errorMessage);
|
|
956
959
|
console.error("Error fetching assets:", err);
|
|
957
960
|
} finally {
|
|
958
|
-
|
|
961
|
+
if (isInitialLoadRef.current) {
|
|
962
|
+
setLoading(false);
|
|
963
|
+
isInitialLoadRef.current = false;
|
|
964
|
+
}
|
|
959
965
|
}
|
|
960
966
|
}, []);
|
|
961
967
|
const getAssetsByChain = useCallback(
|
|
@@ -969,6 +975,7 @@ const useAssets = ({
|
|
|
969
975
|
}, [assets]);
|
|
970
976
|
useEffect(() => {
|
|
971
977
|
if (address) {
|
|
978
|
+
isInitialLoadRef.current = true;
|
|
972
979
|
refreshAssets();
|
|
973
980
|
}
|
|
974
981
|
}, [address, refreshAssets]);
|
|
@@ -5532,6 +5539,84 @@ const ConnectWalletModal = ({
|
|
|
5532
5539
|
},
|
|
5533
5540
|
children: [
|
|
5534
5541
|
/* @__PURE__ */ jsx(ModalHeader, { title: "Connect Wallet", onClose }),
|
|
5542
|
+
requiredChainId === 421614 && !isConnected && /* @__PURE__ */ jsx(
|
|
5543
|
+
"div",
|
|
5544
|
+
{
|
|
5545
|
+
style: {
|
|
5546
|
+
padding: "0 32px",
|
|
5547
|
+
marginTop: "20px"
|
|
5548
|
+
},
|
|
5549
|
+
children: /* @__PURE__ */ jsxs(
|
|
5550
|
+
"div",
|
|
5551
|
+
{
|
|
5552
|
+
style: {
|
|
5553
|
+
padding: "12px 16px",
|
|
5554
|
+
backgroundColor: "#EFF6FF",
|
|
5555
|
+
borderRadius: "8px",
|
|
5556
|
+
border: "1px solid #BFDBFE",
|
|
5557
|
+
display: "flex",
|
|
5558
|
+
alignItems: "center",
|
|
5559
|
+
gap: "10px"
|
|
5560
|
+
},
|
|
5561
|
+
children: [
|
|
5562
|
+
/* @__PURE__ */ jsx(
|
|
5563
|
+
"div",
|
|
5564
|
+
{
|
|
5565
|
+
style: {
|
|
5566
|
+
width: "32px",
|
|
5567
|
+
height: "32px",
|
|
5568
|
+
borderRadius: "50%",
|
|
5569
|
+
backgroundColor: "#DBEAFE",
|
|
5570
|
+
display: "flex",
|
|
5571
|
+
alignItems: "center",
|
|
5572
|
+
justifyContent: "center",
|
|
5573
|
+
flexShrink: 0
|
|
5574
|
+
},
|
|
5575
|
+
children: /* @__PURE__ */ jsx(
|
|
5576
|
+
"img",
|
|
5577
|
+
{
|
|
5578
|
+
src: img$3,
|
|
5579
|
+
alt: "Rabby",
|
|
5580
|
+
style: {
|
|
5581
|
+
width: "20px",
|
|
5582
|
+
height: "20px",
|
|
5583
|
+
objectFit: "contain"
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
)
|
|
5587
|
+
}
|
|
5588
|
+
),
|
|
5589
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
5590
|
+
/* @__PURE__ */ jsx(
|
|
5591
|
+
"p",
|
|
5592
|
+
{
|
|
5593
|
+
style: {
|
|
5594
|
+
margin: "0 0 4px 0",
|
|
5595
|
+
color: "#1E40AF",
|
|
5596
|
+
fontSize: "13px",
|
|
5597
|
+
fontWeight: 600
|
|
5598
|
+
},
|
|
5599
|
+
children: "Recommended Wallet"
|
|
5600
|
+
}
|
|
5601
|
+
),
|
|
5602
|
+
/* @__PURE__ */ jsx(
|
|
5603
|
+
"p",
|
|
5604
|
+
{
|
|
5605
|
+
style: {
|
|
5606
|
+
margin: 0,
|
|
5607
|
+
color: "#1E3A8A",
|
|
5608
|
+
fontSize: "12px",
|
|
5609
|
+
lineHeight: "1.4"
|
|
5610
|
+
},
|
|
5611
|
+
children: "For Arbitrum Sepolia, we recommend using Rabby wallet instead of MetaMask for the best experience."
|
|
5612
|
+
}
|
|
5613
|
+
)
|
|
5614
|
+
] })
|
|
5615
|
+
]
|
|
5616
|
+
}
|
|
5617
|
+
)
|
|
5618
|
+
}
|
|
5619
|
+
),
|
|
5535
5620
|
/* @__PURE__ */ jsxs(
|
|
5536
5621
|
"div",
|
|
5537
5622
|
{
|
|
@@ -5663,6 +5748,75 @@ const ConnectWalletModal = ({
|
|
|
5663
5748
|
]
|
|
5664
5749
|
}
|
|
5665
5750
|
),
|
|
5751
|
+
isConnected && requiredChainId === 421614 && activeConnector && (activeConnector.name.toLowerCase().includes("metamask") || activeConnector.type === "injected") && /* @__PURE__ */ jsxs(
|
|
5752
|
+
"div",
|
|
5753
|
+
{
|
|
5754
|
+
style: {
|
|
5755
|
+
padding: "12px 16px",
|
|
5756
|
+
backgroundColor: "#EFF6FF",
|
|
5757
|
+
borderRadius: "8px",
|
|
5758
|
+
border: "1px solid #BFDBFE",
|
|
5759
|
+
display: "flex",
|
|
5760
|
+
alignItems: "center",
|
|
5761
|
+
gap: "10px"
|
|
5762
|
+
},
|
|
5763
|
+
children: [
|
|
5764
|
+
/* @__PURE__ */ jsx(
|
|
5765
|
+
"div",
|
|
5766
|
+
{
|
|
5767
|
+
style: {
|
|
5768
|
+
width: "32px",
|
|
5769
|
+
height: "32px",
|
|
5770
|
+
borderRadius: "50%",
|
|
5771
|
+
backgroundColor: "#DBEAFE",
|
|
5772
|
+
display: "flex",
|
|
5773
|
+
alignItems: "center",
|
|
5774
|
+
justifyContent: "center",
|
|
5775
|
+
flexShrink: 0
|
|
5776
|
+
},
|
|
5777
|
+
children: /* @__PURE__ */ jsx(
|
|
5778
|
+
"img",
|
|
5779
|
+
{
|
|
5780
|
+
src: img$3,
|
|
5781
|
+
alt: "Rabby",
|
|
5782
|
+
style: {
|
|
5783
|
+
width: "20px",
|
|
5784
|
+
height: "20px",
|
|
5785
|
+
objectFit: "contain"
|
|
5786
|
+
}
|
|
5787
|
+
}
|
|
5788
|
+
)
|
|
5789
|
+
}
|
|
5790
|
+
),
|
|
5791
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
5792
|
+
/* @__PURE__ */ jsx(
|
|
5793
|
+
"p",
|
|
5794
|
+
{
|
|
5795
|
+
style: {
|
|
5796
|
+
margin: "0 0 4px 0",
|
|
5797
|
+
color: "#1E40AF",
|
|
5798
|
+
fontSize: "13px",
|
|
5799
|
+
fontWeight: 600
|
|
5800
|
+
},
|
|
5801
|
+
children: "Recommended Wallet"
|
|
5802
|
+
}
|
|
5803
|
+
),
|
|
5804
|
+
/* @__PURE__ */ jsx(
|
|
5805
|
+
"p",
|
|
5806
|
+
{
|
|
5807
|
+
style: {
|
|
5808
|
+
margin: 0,
|
|
5809
|
+
color: "#1E3A8A",
|
|
5810
|
+
fontSize: "12px",
|
|
5811
|
+
lineHeight: "1.4"
|
|
5812
|
+
},
|
|
5813
|
+
children: "For Arbitrum Sepolia, we recommend using Rabby wallet instead of MetaMask for the best experience."
|
|
5814
|
+
}
|
|
5815
|
+
)
|
|
5816
|
+
] })
|
|
5817
|
+
]
|
|
5818
|
+
}
|
|
5819
|
+
),
|
|
5666
5820
|
isConnected && address ? /* @__PURE__ */ jsxs(
|
|
5667
5821
|
"div",
|
|
5668
5822
|
{
|
|
@@ -7053,7 +7207,7 @@ const DepositModal = React.memo(
|
|
|
7053
7207
|
address: sourceAddress || address,
|
|
7054
7208
|
supportedChains,
|
|
7055
7209
|
fetchBalances,
|
|
7056
|
-
refreshInterval:
|
|
7210
|
+
refreshInterval: 8e3
|
|
7057
7211
|
});
|
|
7058
7212
|
const [isExecuting, setIsExecuting] = useState(false);
|
|
7059
7213
|
const [error, setError] = useState(null);
|
|
@@ -7091,6 +7245,26 @@ const DepositModal = React.memo(
|
|
|
7091
7245
|
});
|
|
7092
7246
|
}
|
|
7093
7247
|
}, [depositAmount]);
|
|
7248
|
+
useEffect(() => {
|
|
7249
|
+
if (selectedDepositAssets.length === 0) return;
|
|
7250
|
+
setSelectedDepositAssets((prev) => {
|
|
7251
|
+
return prev.map((selectedItem) => {
|
|
7252
|
+
if (!selectedItem.asset) return selectedItem;
|
|
7253
|
+
const freshAsset = depositAssets.find(
|
|
7254
|
+
(a) => a.chainId === selectedItem.asset.chainId && a.address.toLowerCase() === selectedItem.asset.address.toLowerCase()
|
|
7255
|
+
);
|
|
7256
|
+
if (freshAsset) {
|
|
7257
|
+
return {
|
|
7258
|
+
...selectedItem,
|
|
7259
|
+
asset: freshAsset,
|
|
7260
|
+
// Preserve the user's entered amount
|
|
7261
|
+
amount: selectedItem.amount
|
|
7262
|
+
};
|
|
7263
|
+
}
|
|
7264
|
+
return selectedItem;
|
|
7265
|
+
});
|
|
7266
|
+
});
|
|
7267
|
+
}, [assets]);
|
|
7094
7268
|
useEffect(() => {
|
|
7095
7269
|
if (nonEip7702Mode && intentStatus?.overallStatus === "success" && postDepositInstruction && postDepositStatus === "idle") {
|
|
7096
7270
|
const bridgedAmount = bridgedAmountRef.current;
|
|
@@ -7141,8 +7315,16 @@ const DepositModal = React.memo(
|
|
|
7141
7315
|
const errorMessage = error2?.message || String(error2 || "");
|
|
7142
7316
|
const errorDetails = error2?.details || "";
|
|
7143
7317
|
const errorString = `${errorMessage} ${errorDetails}`.toLowerCase();
|
|
7318
|
+
console.error("RPC Error Details:", {
|
|
7319
|
+
code: error2?.code,
|
|
7320
|
+
message: errorMessage,
|
|
7321
|
+
details: errorDetails,
|
|
7322
|
+
data: error2?.data,
|
|
7323
|
+
stack: error2?.stack,
|
|
7324
|
+
fullError: error2
|
|
7325
|
+
});
|
|
7144
7326
|
if (errorString.includes("internal json-rpc error") || errorString.includes("internal error") || errorString.includes("an internal error was received")) {
|
|
7145
|
-
return "Network error
|
|
7327
|
+
return "RPC Network error. Try switching your MetaMask RPC endpoint or try again.";
|
|
7146
7328
|
}
|
|
7147
7329
|
return errorMessage || "Transaction failed";
|
|
7148
7330
|
}, []);
|
|
@@ -7232,6 +7414,7 @@ const DepositModal = React.memo(
|
|
|
7232
7414
|
}
|
|
7233
7415
|
setAirdropMessage("Airdrop requested successfully.");
|
|
7234
7416
|
} catch (e) {
|
|
7417
|
+
console.log(e);
|
|
7235
7418
|
const msg = handleRpcError(e);
|
|
7236
7419
|
setAirdropError(msg);
|
|
7237
7420
|
} finally {
|
|
@@ -7355,6 +7538,11 @@ const DepositModal = React.memo(
|
|
|
7355
7538
|
}
|
|
7356
7539
|
if (currentChain?.id !== chainId) {
|
|
7357
7540
|
setError("Wrong chain selected. Switching network...");
|
|
7541
|
+
console.log("Attempting to switch to chain:", {
|
|
7542
|
+
chainId,
|
|
7543
|
+
currentChainId: currentChain?.id,
|
|
7544
|
+
chainName: getChainName$1(chainId)
|
|
7545
|
+
});
|
|
7358
7546
|
try {
|
|
7359
7547
|
await switchChainAsync({ chainId });
|
|
7360
7548
|
let attempts = 0;
|
|
@@ -7441,6 +7629,14 @@ const DepositModal = React.memo(
|
|
|
7441
7629
|
tokenAddress = "0x0";
|
|
7442
7630
|
}
|
|
7443
7631
|
const isNative = selectedAsset.asset.isNative || tokenAddress.toLowerCase() === "0x0";
|
|
7632
|
+
console.log("Sending transaction via MetaMask:", {
|
|
7633
|
+
chainId,
|
|
7634
|
+
isNative,
|
|
7635
|
+
tokenAddress,
|
|
7636
|
+
delegateContract,
|
|
7637
|
+
amount: amount.toString(),
|
|
7638
|
+
walletChainId: externalWalletClient.chain?.id
|
|
7639
|
+
});
|
|
7444
7640
|
const txHash = isNative ? await externalWalletClient.sendTransaction({
|
|
7445
7641
|
to: delegateContract,
|
|
7446
7642
|
value: amount
|
|
@@ -7581,6 +7777,14 @@ const DepositModal = React.memo(
|
|
|
7581
7777
|
tokenAddress = "0x0";
|
|
7582
7778
|
}
|
|
7583
7779
|
const isNative = selectedAsset.asset.isNative || tokenAddress.toLowerCase() === "0x0";
|
|
7780
|
+
console.log("Sending EIP-7702 transaction via MetaMask:", {
|
|
7781
|
+
chainId,
|
|
7782
|
+
isNative,
|
|
7783
|
+
tokenAddress,
|
|
7784
|
+
amount: amount.toString(),
|
|
7785
|
+
recipient: address,
|
|
7786
|
+
walletChainId: externalWalletClient.chain?.id
|
|
7787
|
+
});
|
|
7584
7788
|
const transferToEmbeddedTx = isNative ? await externalWalletClient.sendTransaction({
|
|
7585
7789
|
to: address,
|
|
7586
7790
|
value: amount
|
|
@@ -10208,7 +10412,7 @@ const SpiceWithdraw = (props) => {
|
|
|
10208
10412
|
}
|
|
10209
10413
|
const transports = {};
|
|
10210
10414
|
chains.forEach((chain) => {
|
|
10211
|
-
transports[chain.id] = http$1();
|
|
10415
|
+
transports[chain.id] = http$1(chain.rpc);
|
|
10212
10416
|
});
|
|
10213
10417
|
const connectorsList = [metaMask()];
|
|
10214
10418
|
if (walletConnectProjectId) {
|