@blockend/widget 1.0.60-beta.1 → 1.0.61-beta.1
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/AdvancedSettings-BSHVKOx8.js +60 -0
- package/dist/{AllRoutes-B-tqwmhZ.js → AllRoutes-3rJ_6MZA.js} +9 -9
- package/dist/{Box-B9dKcT71.js → Box-k1E75YNB.js} +14 -14
- package/dist/EstGas-NmdlnuTV.js +1688 -0
- package/dist/{Grow-DGNIagcL.js → Grow-DHSmig3g.js} +28 -28
- package/dist/{InputComp-C0BYsYO2.js → InputComp-Q8pjLoPE.js} +3 -3
- package/dist/{LoadRoute-BejmZs2l.js → LoadRoute-C2z-mW9G.js} +4 -4
- package/dist/{QuotesProgress-DUtmb0H1.js → QuotesProgress-BD5CQpZ-.js} +1 -1
- package/dist/{SwapAsset-C6q38SfB.js → SwapAsset-Kx0ombNP.js} +1 -1
- package/dist/{Tooltip-B9eQU87E.js → Tooltip-Dx9YIENU.js} +3 -3
- package/dist/{TxnButton-B7erQoe9.js → TxnButton-CWOz7URH.js} +32 -33
- package/dist/{add-BDXnG29B.js → add-D_aca-vE.js} +1 -1
- package/dist/{all-wallets-A5aRDDSX.js → all-wallets-D4BSWfpK.js} +1 -1
- package/dist/{app-store-CRNlWthG.js → app-store-ST0Ravfg.js} +1 -1
- package/dist/{apple-Bk9AlpJi.js → apple-DaFtNkdI.js} +1 -1
- package/dist/{arrow-bottom-Wyw-Sjsd.js → arrow-bottom-CuRXWFcr.js} +1 -1
- package/dist/{arrow-bottom-circle-F5a-Pm5A.js → arrow-bottom-circle-xfTEwf8w.js} +1 -1
- package/dist/{arrow-left-xa8Yhbw7.js → arrow-left-Z346mTvE.js} +1 -1
- package/dist/{arrow-right-DHehfJb9.js → arrow-right-CUIO0t26.js} +1 -1
- package/dist/{arrow-top-Zr4NTjGQ.js → arrow-top-DmqPBsC5.js} +1 -1
- package/dist/{bank-hQuILOEh.js → bank-BO1ZejV3.js} +1 -1
- package/dist/{basic-DtnxLRWd.js → basic-P5IuMVWt.js} +3 -3
- package/dist/{browser-DdzWWRtF.js → browser-R_yTVBVl.js} +1 -1
- package/dist/{card-CgYBeEF3.js → card-CmQJzq49.js} +1 -1
- package/dist/{ccip-fwzPvAXp.js → ccip-Vdbs2YPx.js} +1 -1
- package/dist/{checkmark-CRSJVI7P.js → checkmark-BUj82mTz.js} +1 -1
- package/dist/{checkmark-bold-Chu-2qTS.js → checkmark-bold-4sXAvyEi.js} +1 -1
- package/dist/{chevron-bottom-CWuEnub2.js → chevron-bottom-BHRgOLsC.js} +1 -1
- package/dist/{chevron-left-h2_syVI8.js → chevron-left-eVq5zb9x.js} +1 -1
- package/dist/{chevron-right-Ct4j2Leu.js → chevron-right-BqbdhgX8.js} +1 -1
- package/dist/{chevron-top-DcBzaR2h.js → chevron-top-lFcz1Dk9.js} +1 -1
- package/dist/{chrome-store-CXn4JMj-.js → chrome-store-CJjs0q6Z.js} +1 -1
- package/dist/{clock-JZPADmeK.js → clock-LxWBSJ_V.js} +1 -1
- package/dist/{close-DtXi8BhO.js → close-CJEyeA8d.js} +1 -1
- package/dist/{coinPlaceholder-BK6alFNE.js → coinPlaceholder-A0px2L1V.js} +1 -1
- package/dist/{compass-DWhtsJev.js → compass-CKpEE3QF.js} +1 -1
- package/dist/{copy-D-MDSgUX.js → copy-BGAVbyLK.js} +1 -1
- package/dist/{core-BwKgmZsH.js → core-UMj0YuPY.js} +6124 -4570
- package/dist/{cursor-Dh3mFu9G.js → cursor-CdRK37lV.js} +1 -1
- package/dist/{cursor-transparent-NB0LxFUO.js → cursor-transparent-DCtZPn6M.js} +1 -1
- package/dist/{desktop-BgF9XEMs.js → desktop-BpmiexI7.js} +1 -1
- package/dist/{disconnect-Dq0GPLgW.js → disconnect-CmRL6rxR.js} +1 -1
- package/dist/{discord-Dx0EuHuU.js → discord-CgA8etyT.js} +1 -1
- package/dist/{down-D_76LJ5o.js → down-veMPztmj.js} +2 -2
- package/dist/{etherscan-CNIjXg_f.js → etherscan-B0Iz4J9k.js} +1 -1
- package/dist/{exclamation-triangle-Bhp8mAG7.js → exclamation-triangle-Box_8laE.js} +1 -1
- package/dist/{extension-BKqqIj7b.js → extension-CT5kynXr.js} +1 -1
- package/dist/{external-link-DbGPs34E.js → external-link-BmAqCUs9.js} +1 -1
- package/dist/{facebook-DRG1zLmw.js → facebook-CzlMPtlk.js} +1 -1
- package/dist/{farcaster-DDWwjMH9.js → farcaster-Z3KYAnFk.js} +1 -1
- package/dist/{filters-Bj10QvW6.js → filters-CVtviD0v.js} +1 -1
- package/dist/{getChainIds-eeGoWwbI.js → getChainIds-DDKgS0TA.js} +2 -2
- package/dist/{getCosmosAddress-DlgoXFw9.js → getCosmosAddress-D-BxI1sZ.js} +1589 -1574
- package/dist/{github-ZPlB-Utk.js → github-KjnPjzGN.js} +1 -1
- package/dist/{google-CCKsdggZ.js → google-CnyCazMS.js} +1 -1
- package/dist/{hamburger-DPe9Xfjf.js → hamburger-DkyOLKDt.js} +5 -5
- package/dist/{help-circle-IpogiYkd.js → help-circle-BoN3xTWx.js} +1 -1
- package/dist/{id--1TM5fr0.js → id-tq8aEw5U.js} +1 -1
- package/dist/{image-DUfvu2wM.js → image-DBC1q2_n.js} +1 -1
- package/dist/{index-Bb3Owdat.js → index-37soHOzC.js} +2 -2
- package/dist/{index-BAuHi89Z.js → index-B6Hd7MNh.js} +3111 -3034
- package/dist/{index-HXseE2Nv.js → index-BMJemt0T.js} +1 -1
- package/dist/{index-BEzLzd5e.js → index-BnfXeC9U.js} +11 -11
- package/dist/{index-C5XuDvkl.js → index-BrUFU9w4.js} +587 -578
- package/dist/{index-BqAYNgz8.js → index-C57ebjbd.js} +78 -78
- package/dist/index-CrdvyxIs.js +6713 -0
- package/dist/{index-BThpYFL-.js → index-Dq-7CifU.js} +332 -352
- package/dist/{index-DThyqr43.js → index-DwgdKTri.js} +1 -1
- package/dist/index-nbo2VFYc.js +206 -0
- package/dist/{index-CIxU6QQf.js → index-u8Ded5qw.js} +2604 -2625
- package/dist/index.es-CXA8FwxC.js +14904 -0
- package/dist/{index.es-D28h__ZD.js → index.es-CwOZPtUM.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-CRK9yM3q.js → info-B-ADkq2O.js} +1 -1
- package/dist/{info-circle-DroAdDav.js → info-circle-CzjFim13.js} +1 -1
- package/dist/{lightbulb-DGwzaoxs.js → lightbulb-BzGUazBJ.js} +1 -1
- package/dist/{mail-BQSCf__h.js → mail-CEB7w3xW.js} +1 -1
- package/dist/{mobile-4chCtN_4.js → mobile-D2As9Lxy.js} +1 -1
- package/dist/{more-uiMKzNjJ.js → more-B3qgSPHK.js} +1 -1
- package/dist/{network-placeholder-CVOcWHRh.js → network-placeholder-D3v1VNVd.js} +1 -1
- package/dist/{nftPlaceholder-CakfkypA.js → nftPlaceholder-7uzR-QgE.js} +1 -1
- package/dist/{off-CoYWNQqe.js → off-B5fhwDTB.js} +1 -1
- package/dist/{play-store-q5l7DaBe.js → play-store-fmnI2qeP.js} +1 -1
- package/dist/{plus-CR0bo3Ss.js → plus-BPrwB2BV.js} +1 -1
- package/dist/{qr-code-FNoqG2yJ.js → qr-code-DRh63vJj.js} +1 -1
- package/dist/{recycle-horizontal-BsU3dW8b.js → recycle-horizontal-DGw86E5g.js} +1 -1
- package/dist/{refresh-DyJzaQLK.js → refresh-Dg7iaYhB.js} +1 -1
- package/dist/{reown-logo-BFbpXVCB.js → reown-logo-tiOXXURu.js} +1 -1
- package/dist/{search-CoIHCx8n.js → search-eG23Hr6c.js} +1 -1
- package/dist/{send-CT0RLtYP.js → send-BOwE6eLM.js} +1 -1
- package/dist/{swapHorizontal-2UEy_VbL.js → swapHorizontal-ywv205Wi.js} +1 -1
- package/dist/{swapHorizontalBold-BwLgMdQd.js → swapHorizontalBold-CzmBehA5.js} +1 -1
- package/dist/{swapHorizontalMedium-Wwd3Subk.js → swapHorizontalMedium-BLbLZusS.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-CbSALTi8.js → swapHorizontalRoundedBold-N_SHWa3r.js} +1 -1
- package/dist/{swapVertical-B5GizA1j.js → swapVertical-EAZRQhGp.js} +1 -1
- package/dist/{telegram-BtJEmiFh.js → telegram-n36fCk1z.js} +1 -1
- package/dist/{three-dots-Bel3OYRL.js → three-dots-0tBgmH4A.js} +1 -1
- package/dist/{twitch-iJUsxLGs.js → twitch-BhZ8ahtd.js} +1 -1
- package/dist/{twitterIcon-5Bw6TNyI.js → twitterIcon-DfNmxt1B.js} +1 -1
- package/dist/{unsupportedProp-CtBHkzVs.js → unsupportedProp-D3sAzZYG.js} +1 -1
- package/dist/useRegisterError-Bo2lp0sa.js +8919 -0
- package/dist/{verify-9NPblyAz.js → verify-CWXFpftr.js} +1 -1
- package/dist/{verify-filled-BNVhfPkW.js → verify-filled-DP3y-Kx3.js} +1 -1
- package/dist/{w3m-modal-BoPsPieM.js → w3m-modal-CwwnoSKf.js} +2 -2
- package/dist/{wallet-DTIql0UA.js → wallet-pQYrlhSS.js} +1 -1
- package/dist/{wallet-placeholder-DXx_YU8N.js → wallet-placeholder-CFNKM5lP.js} +1 -1
- package/dist/{walletconnect-9eJmse3N.js → walletconnect-CAtjZJiV.js} +1 -1
- package/dist/{warning-circle-B3zxM-8-.js → warning-circle-BOE2EoE9.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-EqjvjF0s.js → x-BqcRzM19.js} +1 -1
- package/package.json +2 -1
- package/dist/EstGas-ZNdT7ZNT.js +0 -20281
- package/dist/index-Ds5cL5Tm.js +0 -160
- package/dist/index-Wj3B2hZ5.js +0 -206
- package/dist/index.es-DhjmbcLt.js +0 -13234
- package/dist/useRegisterError-UVP98oC5.js +0 -8912
@@ -1,18 +1,18 @@
|
|
1
|
-
import { jsxs as p, jsx as e, Fragment as
|
2
|
-
import
|
3
|
-
import { B as P1, i as Ee, u as
|
4
|
-
import { u as
|
5
|
-
import { C as
|
1
|
+
import { jsxs as p, jsx as e, Fragment as J } from "react/jsx-runtime";
|
2
|
+
import ce, { useState as v, useEffect as j, useRef as L1, Suspense as e1 } from "react";
|
3
|
+
import { B as P1, i as Ee, u as Te, F as t1, f as $e, C as Se, W as c1 } from "./useRegisterError-Bo2lp0sa.js";
|
4
|
+
import { u as c, l as pe, a as ze, c as _e, S as F1, M as M1 } from "./index-B6Hd7MNh.js";
|
5
|
+
import { C as n1, M as E1, g as r1 } from "./getChainIds-DDKgS0TA.js";
|
6
6
|
import { useQuery as l1 } from "@tanstack/react-query";
|
7
|
-
import { useAccount as fe, useConnect as
|
8
|
-
import { useDynamicContext as
|
9
|
-
import { S as
|
10
|
-
import { u as
|
11
|
-
import { useAccount as Oe, useStargateClient as
|
12
|
-
import { S as G1, D as K1 } from "./down-
|
7
|
+
import { useAccount as fe, useConnect as O1, useConnections as R1, useBalance as $1 } from "wagmi";
|
8
|
+
import { useDynamicContext as Ie, useIsLoggedIn as S1 } from "@dynamic-labs/sdk-react-core";
|
9
|
+
import { S as _1 } from "./shareicon-CG3v7iKI.js";
|
10
|
+
import { u as z1, B as V1 } from "./index-37soHOzC.js";
|
11
|
+
import { useAccount as Oe, useStargateClient as b1, useSuggestChainAndConnect as Z1, WalletType as H1 } from "graz";
|
12
|
+
import { S as G1, D as K1 } from "./down-veMPztmj.js";
|
13
13
|
import { R as J1 } from "./index-CDq3vNnP.js";
|
14
|
-
import { C as Ve, P as de, u as q1, g as
|
15
|
-
function
|
14
|
+
import { C as Ve, P as de, u as q1, g as s1 } from "./getCosmosAddress-D-BxI1sZ.js";
|
15
|
+
function d1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ p(
|
17
17
|
"svg",
|
18
18
|
{
|
@@ -47,7 +47,7 @@ function b1({ fill: t }) {
|
|
47
47
|
);
|
48
48
|
}
|
49
49
|
function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
50
|
-
const [r,
|
50
|
+
const [r, l] = v(t), [b, d] = v(""), { tick: i, defaultCoin: g } = Ee;
|
51
51
|
return /* @__PURE__ */ p("div", { children: [
|
52
52
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
53
53
|
/* @__PURE__ */ e(
|
@@ -84,7 +84,7 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
84
84
|
placeholder: "Search Network"
|
85
85
|
}
|
86
86
|
),
|
87
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: /* @__PURE__ */ e(
|
87
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: /* @__PURE__ */ e(d1, { fill: "var(--tw-background-secondary)" }) })
|
88
88
|
]
|
89
89
|
}
|
90
90
|
),
|
@@ -106,7 +106,7 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
106
106
|
/* @__PURE__ */ e("img", { src: (B = x.image) != null && B.length ? x.image : g, className: "bw-rounded-[50%] bw-border bw-border-border-primary", width: 25, height: 25, alt: "img" }),
|
107
107
|
" ",
|
108
108
|
/* @__PURE__ */ e("p", { children: x.name }),
|
109
|
-
o.chain === x.name ? /* @__PURE__ */ e("img", { src:
|
109
|
+
o.chain === x.name ? /* @__PURE__ */ e("img", { src: i, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(J, {})
|
110
110
|
] }),
|
111
111
|
/* @__PURE__ */ p("div", { className: "bw-pr-2", children: [
|
112
112
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal", children: "Tokens" }),
|
@@ -119,7 +119,7 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
119
119
|
}) })
|
120
120
|
] });
|
121
121
|
}
|
122
|
-
const Q1 = "_gradientbackground_7x8s8_1", U1 = "_overlay_7x8s8_5",
|
122
|
+
const Q1 = "_gradientbackground_7x8s8_1", U1 = "_overlay_7x8s8_5", o1 = {
|
123
123
|
gradientbackground: Q1,
|
124
124
|
overlay: U1
|
125
125
|
};
|
@@ -128,27 +128,25 @@ function Y1(t) {
|
|
128
128
|
return t.slice(0, 2) === "0x" ? !0 : n ? t == n : !1;
|
129
129
|
}
|
130
130
|
function W1(t) {
|
131
|
-
const [n, s] = v({}), o =
|
131
|
+
const [n, s] = v({}), o = c((i) => i.cosmosChainIds), { data: r } = Oe({
|
132
132
|
chainId: o,
|
133
133
|
multiChain: !0
|
134
|
-
}),
|
135
|
-
chainId: [(t == null ? void 0 : t.chainId) ||
|
134
|
+
}), l = c((i) => i.fromChain), { data: b } = b1({
|
135
|
+
chainId: [(t == null ? void 0 : t.chainId) || l.chainId],
|
136
136
|
multiChain: !0
|
137
137
|
});
|
138
|
-
async function d(
|
138
|
+
async function d(i) {
|
139
139
|
var g, x;
|
140
|
-
if ((g = r == null ? void 0 : r[
|
141
|
-
let B = await (b[
|
142
|
-
(x = r == null ? void 0 : r[a]) == null ? void 0 : x.bech32Address
|
143
|
-
), M = ge.keyBy(B, "denom");
|
140
|
+
if ((g = r == null ? void 0 : r[i]) != null && g.bech32Address && b) {
|
141
|
+
let B = await (b[i] || b).getAllBalances((x = r == null ? void 0 : r[i]) == null ? void 0 : x.bech32Address), M = pe.keyBy(B, "denom");
|
144
142
|
s(M);
|
145
143
|
}
|
146
144
|
}
|
147
145
|
return j(() => {
|
148
|
-
((t == null ? void 0 : t.networkType) == "cosmos" || (
|
149
|
-
}, [b,
|
146
|
+
((t == null ? void 0 : t.networkType) == "cosmos" || (l == null ? void 0 : l.networkType) == "cosmos") && d((t == null ? void 0 : t.chainId) || (l == null ? void 0 : l.chainId));
|
147
|
+
}, [b, l, t]), { cosmosBalance: n };
|
150
148
|
}
|
151
|
-
function
|
149
|
+
function w1(t) {
|
152
150
|
let n = t.split("/");
|
153
151
|
if (n.length > 1) {
|
154
152
|
let s = n[1].toUpperCase();
|
@@ -201,7 +199,7 @@ function et({ selectedChain: t }) {
|
|
201
199
|
className: "bw-w-[80px] bw-h-[80px] bw-border-border-primary bw-border-2 bw-opacity-50 bw-rounded-[50%]",
|
202
200
|
alt: "chain"
|
203
201
|
}
|
204
|
-
) : /* @__PURE__ */ e(
|
202
|
+
) : /* @__PURE__ */ e(J, {}),
|
205
203
|
/* @__PURE__ */ e("div", { className: "bw-absolute bw-bg-background-container -bw-bottom-2 -bw-right-2 bw-flex bw-items-center bw-justify-center bw-rounded-full bw-border bw-border-border-primary bw-w-[44px] bw-h-[44px]", children: /* @__PURE__ */ e(D1, { fill: "var(--tw-text-secondary)" }) })
|
206
204
|
] }) }),
|
207
205
|
/* @__PURE__ */ p("h2", { className: "bw-text-base bw-text-center bw-mt-3 bw-font-bold bw-text-text-primary", children: [
|
@@ -216,84 +214,84 @@ function et({ selectedChain: t }) {
|
|
216
214
|
] })
|
217
215
|
] });
|
218
216
|
}
|
219
|
-
const tt =
|
220
|
-
var
|
221
|
-
|
222
|
-
const d =
|
223
|
-
|
224
|
-
const m = x(n), I =
|
217
|
+
const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o, showExchangeList: r, setCoinData: l, setChainData: b }) {
|
218
|
+
var je, Le;
|
219
|
+
c((u) => u.searchCustomCoin);
|
220
|
+
const d = c((u) => u.setSearchCustomCoin), { ref: i, inView: g } = z1(), { getWallet: x } = Te({}), { connected: k, address: B } = ze(), { isConnected: M, address: F } = fe(), { primaryWallet: h } = Ie();
|
221
|
+
S1();
|
222
|
+
const m = x(n), I = c((u) => u.fromChain), y = c((u) => u.fromCoin), S = c((u) => u.toChain), _ = c((u) => u.toCoin), [te, E] = v(!1), { cosmosBalance: G } = W1(n), { defaultCoin: O } = Ee, [z, f] = v(0), C = L1(null), { data: P } = Oe({
|
225
223
|
chainId: [n.chainId],
|
226
224
|
multiChain: !0
|
227
|
-
}), Z = (n == null ? void 0 : n.networkType) === "evm" && F || (n == null ? void 0 : n.networkType) === "sol" && (h == null ? void 0 : h.address) || (n == null ? void 0 : n.networkType) === "tron" && B || (n == null ? void 0 : n.networkType) === "cosmos" && ((
|
228
|
-
|
229
|
-
const w =
|
225
|
+
}), Z = (n == null ? void 0 : n.networkType) === "evm" && F || (n == null ? void 0 : n.networkType) === "sol" && (h == null ? void 0 : h.address) || (n == null ? void 0 : n.networkType) === "tron" && B || (n == null ? void 0 : n.networkType) === "cosmos" && ((je = P == null ? void 0 : P[n == null ? void 0 : n.chainId]) == null ? void 0 : je.bech32Address), $ = c((u) => u.toDisconnect);
|
226
|
+
c((u) => u.setToDisconnect);
|
227
|
+
const w = c((u) => u.customWallet), T = c((u) => u.setCustomWallet), A = c((u) => u.tokens), [L, N] = v([]), [R, re] = v([]), [Be, W] = v([]), H = A, U = l1({
|
230
228
|
queryKey: ["balance", m == null ? void 0 : m.address, n],
|
231
|
-
queryFn: async () => await (await
|
232
|
-
enabled: !!((
|
229
|
+
queryFn: async () => await (await _e.fetchBalance(m.address, n.chainId)).json(),
|
230
|
+
enabled: !!((Le = m == null ? void 0 : m.address) != null && Le.length && n.chainId),
|
233
231
|
refetchOnWindowFocus: !1
|
234
232
|
});
|
235
|
-
function
|
236
|
-
var
|
237
|
-
let D =
|
238
|
-
return u.networkType == "cosmos" ?
|
233
|
+
function V(u) {
|
234
|
+
var ne, le, se, oe, K, q, ae, ee, Y, ge, X, Q;
|
235
|
+
let D = w1(u.address);
|
236
|
+
return u.networkType == "cosmos" ? $e(((ne = G == null ? void 0 : G[D]) == null ? void 0 : ne.amount) / Math.pow(10, u.decimals) || 0) || "" : $e((((q = (K = (oe = (se = (le = U.data) == null ? void 0 : le.data) == null ? void 0 : se[n == null ? void 0 : n.networkType]) == null ? void 0 : oe[n.chainId]) == null ? void 0 : K[u.address]) == null ? void 0 : q.balance) || 0) / Math.pow(10, ((Q = (X = (ge = (Y = (ee = (ae = U.data) == null ? void 0 : ae.data) == null ? void 0 : ee[n == null ? void 0 : n.networkType]) == null ? void 0 : Y[n.chainId]) == null ? void 0 : ge[u.address]) == null ? void 0 : X.asset) == null ? void 0 : Q.decimals) || 0) || 0) || "";
|
239
237
|
}
|
240
238
|
j(() => {
|
241
|
-
s.length > 40 && Y1(s) &&
|
239
|
+
s.length > 40 && Y1(s) && !R.length ? (E(!0), d({
|
242
240
|
chainId: n.chainId,
|
243
241
|
address: s
|
244
242
|
})) : s.length || (E(!1), d({ chainId: "", address: "" }));
|
245
|
-
}, [s,
|
243
|
+
}, [s, R]), j(() => {
|
246
244
|
f(0);
|
247
245
|
}, [s]);
|
248
|
-
function
|
249
|
-
f(0),
|
246
|
+
function Ae() {
|
247
|
+
f(0), re([]), C.current.scrollTo(0, 0);
|
250
248
|
}
|
251
249
|
j(() => {
|
252
250
|
var u, D;
|
253
251
|
H != null && H.isSuccess && (n != null && n.chainId) && N(((D = (u = H == null ? void 0 : H.data) == null ? void 0 : u.data) == null ? void 0 : D[n == null ? void 0 : n.chainId]) || []);
|
254
252
|
}, [H, n.chainId]), j(() => {
|
255
|
-
|
253
|
+
Ae();
|
256
254
|
}, [n.chainId]);
|
257
|
-
function
|
258
|
-
var
|
259
|
-
let u = (
|
260
|
-
var
|
261
|
-
return ((
|
262
|
-
})) == null ? void 0 :
|
263
|
-
if (Z) return
|
264
|
-
}), D = 20,
|
265
|
-
|
255
|
+
function ve() {
|
256
|
+
var oe;
|
257
|
+
let u = (oe = L == null ? void 0 : L.filter((K) => {
|
258
|
+
var q, ae, ee, Y;
|
259
|
+
return ((q = K.name) == null ? void 0 : q.toLowerCase().includes(s == null ? void 0 : s.toLowerCase())) || ((ae = K.symbol) == null ? void 0 : ae.toLowerCase().includes(s == null ? void 0 : s.toLowerCase())) || ((Y = (ee = K.address) == null ? void 0 : ee.toLowerCase()) == null ? void 0 : Y.includes(s == null ? void 0 : s.toLowerCase()));
|
260
|
+
})) == null ? void 0 : oe.sort((K, q) => {
|
261
|
+
if (Z) return V(q) * q.lastPrice - V(K) * K.lastPrice;
|
262
|
+
}), D = 20, ne = z * D, le = ne + D, se = u.slice(ne, le);
|
263
|
+
z == 0 ? re([...se]) : re([...R, ...se]);
|
266
264
|
}
|
267
265
|
return j(() => {
|
268
|
-
|
269
|
-
}, [
|
266
|
+
L != null && L.length && ve();
|
267
|
+
}, [L, s, z, Z, G, U.data]), j(() => {
|
270
268
|
g && f((u) => u + 1);
|
271
|
-
}, [g]), /* @__PURE__ */ e("div", { ref: C, className: " bw-pr-2 bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children:
|
272
|
-
var le,
|
269
|
+
}, [g]), /* @__PURE__ */ e("div", { ref: C, className: " bw-pr-2 bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children: R && (R == null ? void 0 : R.length) > 0 ? R == null ? void 0 : R.map((u, D, ne) => {
|
270
|
+
var le, se, oe, K, q, ae;
|
273
271
|
return /* @__PURE__ */ p(
|
274
272
|
"div",
|
275
273
|
{
|
276
|
-
ref:
|
274
|
+
ref: ne.length >= 20 && ne.length - 1 === D ? i : null,
|
277
275
|
className: `bw-py-2
|
278
276
|
${r == "from" && _._id !== u._id || r == "to" && y._id !== u._id, ""}
|
279
277
|
bw-flex bw-items-center bw-justify-between bw-cursor-pointer bw-border-b bw-border-border-primary
|
280
278
|
|
281
279
|
}`,
|
282
280
|
onClick: async () => {
|
283
|
-
var
|
284
|
-
let
|
281
|
+
var Y, ge, X, Q, xe, be, ke, ie, we, Pe, Ne;
|
282
|
+
let ee = {
|
285
283
|
// ...coinData,
|
286
284
|
coin: u.symbol,
|
287
285
|
...u,
|
288
|
-
availBal: ((
|
286
|
+
availBal: ((xe = (Q = (X = (ge = (Y = U.data) == null ? void 0 : Y.data) == null ? void 0 : ge[n == null ? void 0 : n.networkType]) == null ? void 0 : X[n.chainId]) == null ? void 0 : Q[u.address.toLowerCase()]) == null ? void 0 : xe.balance) / Math.pow(10, ((Ne = (Pe = (we = (ie = (ke = (be = U.data) == null ? void 0 : be.data) == null ? void 0 : ke[n == null ? void 0 : n.networkType]) == null ? void 0 : ie[n == null ? void 0 : n.chainId]) == null ? void 0 : we[u.address.toLowerCase()]) == null ? void 0 : Pe.asset) == null ? void 0 : Ne.decimals) || 0)
|
289
287
|
};
|
290
|
-
|
288
|
+
l(ee), b(n), o(n, ee), (n == null ? void 0 : n.networkType) === (S == null ? void 0 : S.networkType) || (n == null || n.networkType, I == null || I.networkType, T(""));
|
291
289
|
},
|
292
290
|
children: [
|
293
291
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-justify-center bw-w-max bw-gap-x-2", children: [
|
294
292
|
/* @__PURE__ */ p("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(le = u.image) != null && le.length ? "bw-bg-background-secondary" : ""}`, children: [
|
295
|
-
(
|
296
|
-
(
|
293
|
+
(se = u.image) != null && se.length ? /* @__PURE__ */ e("img", { src: u.image, className: "bw-rounded-[50%] bw-max-w-[30px] bw-max-h-[30px] bw-object-contain", width: 30, height: 30, alt: "img" }) : /* @__PURE__ */ e("img", { src: O, className: "bw-rounded-[50%]", width: 30, height: 30, alt: "img" }),
|
294
|
+
(oe = n == null ? void 0 : n.image) != null && oe.length ? /* @__PURE__ */ e("img", { src: n.image, className: `bw-absolute ${(K = n == null ? void 0 : n.image) != null && K.length ? "bw-bg-background-secondary" : ""} bw-right-0 bw-max-w-[16px] bw-max-h-[16px] bw-object-contain bw-bottom-[-4px] bw-border bw-border-border-primary bw-rounded-[50%]`, width: 16, height: 16, alt: "img" }) : /* @__PURE__ */ e("img", { src: O, className: "bw-absolute bw-bg-background-secondary bw-right-0 bw-bottom-[-4px] bw-border bw-border-border-primary bw-rounded-[50%]", width: 16, height: 16, alt: "img" })
|
297
295
|
] }),
|
298
296
|
/* @__PURE__ */ p("div", { children: [
|
299
297
|
/* @__PURE__ */ p("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
@@ -310,78 +308,78 @@ const tt = we.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
310
308
|
/* @__PURE__ */ e(
|
311
309
|
"a",
|
312
310
|
{
|
313
|
-
href: (
|
311
|
+
href: (ae = (q = n.explorer) == null ? void 0 : q.token) == null ? void 0 : ae.replace("{tokenAddress}", u.address),
|
314
312
|
target: "_blank",
|
315
|
-
onClick: (
|
316
|
-
|
313
|
+
onClick: (ee) => {
|
314
|
+
ee.stopPropagation();
|
317
315
|
},
|
318
316
|
className: "hover:bw-opacity-70",
|
319
|
-
children: /* @__PURE__ */ e(
|
317
|
+
children: /* @__PURE__ */ e(_1, { fill: "var(--tw-text-secondary)" })
|
320
318
|
}
|
321
319
|
)
|
322
320
|
] })
|
323
321
|
] })
|
324
322
|
] })
|
325
323
|
] }),
|
326
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && w && ((w == null ? void 0 : w.length) > 30 ||
|
324
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && w && ((w == null ? void 0 : w.length) > 30 || $) ? /* @__PURE__ */ e(J, {}) : U.isFetching ? /* @__PURE__ */ e(Se, { size: 12, thickness: 4, color: "inherit" }) : Z ? V(u) > 0 ? /* @__PURE__ */ p(J, { children: [
|
327
325
|
/* @__PURE__ */ e(
|
328
|
-
|
326
|
+
t1,
|
329
327
|
{
|
330
|
-
value:
|
328
|
+
value: V(u) || "",
|
331
329
|
options: {
|
332
330
|
maxDecimals: 10
|
333
331
|
}
|
334
332
|
}
|
335
333
|
),
|
336
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children:
|
334
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: V(u) * u.lastPrice > 0 ? /* @__PURE__ */ p(J, { children: [
|
337
335
|
"$",
|
338
336
|
/* @__PURE__ */ e(
|
339
|
-
|
337
|
+
t1,
|
340
338
|
{
|
341
|
-
value:
|
339
|
+
value: $e(V(u) * u.lastPrice),
|
342
340
|
options: {
|
343
341
|
maxDecimals: 10
|
344
342
|
}
|
345
343
|
}
|
346
344
|
)
|
347
345
|
] }) : "" })
|
348
|
-
] }) : /* @__PURE__ */ e(
|
346
|
+
] }) : /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(J, {}) }) })
|
349
347
|
]
|
350
348
|
},
|
351
349
|
D
|
352
350
|
);
|
353
|
-
}) :
|
351
|
+
}) : te && !(A.isLoading && A.isFetching) ? /* @__PURE__ */ e(et, { selectedChain: n }) : !s.length && /* @__PURE__ */ e("div", { className: "bw-w-full bw-flex bw-justify-center bw-mt-4 bw-text-text-primary", children: /* @__PURE__ */ e(Se, { color: "inherit", size: 30 }) }) });
|
354
352
|
});
|
355
|
-
function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coinData: r, showExchangeList:
|
356
|
-
var f, C,
|
357
|
-
const [d,
|
353
|
+
function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coinData: r, showExchangeList: l, fetchChains: b }) {
|
354
|
+
var f, C, P, Z, $;
|
355
|
+
const [d, i] = v(!1), [g, x] = v(""), k = c((w) => w.tokens), [B, M] = v([]), [F, h] = v(0), [m, I] = v({ chain: "" }), y = c((w) => w.gradient), S = c((w) => w.configuration), _ = c((w) => w.chainObj);
|
358
356
|
j(() => {
|
359
|
-
var w, T, A,
|
357
|
+
var w, T, A, L;
|
360
358
|
if ((T = (w = b.data) == null ? void 0 : w.data) != null && T.length) {
|
361
|
-
let N = [...(
|
362
|
-
N.splice(
|
359
|
+
let N = [...(L = (A = b.data) == null ? void 0 : A.data) == null ? void 0 : L.slice(0, 9)], R = N.findIndex((V) => V.chainId === "137"), re = N.findIndex((V) => V.chainId === "324"), Be = N.findIndex((V) => V.chainId === "10"), W = N.findIndex((V) => V.chainId === "43114");
|
360
|
+
N.splice(R, 1, _[80094] || {}), N.splice(re, 1, _[2741] || {}), N.splice(Be, 1, _["eclipse-svm"] || {}), N.splice(W, 1, _[999] || {}), !!pe.keyBy(N, "chainId")[m.chainId] || (N.pop(), N.push(m)), M(N);
|
363
361
|
}
|
364
362
|
}, [_, (f = b.data) == null ? void 0 : f.data, o, m]), j(() => {
|
365
363
|
I(o);
|
366
364
|
}, [o]), j(() => {
|
367
365
|
var w, T, A;
|
368
366
|
if ((T = (w = b.data) == null ? void 0 : w.data) != null && T.length) {
|
369
|
-
let
|
370
|
-
h(
|
367
|
+
let L = (A = b.data) == null ? void 0 : A.data.filter((N) => !0);
|
368
|
+
h(L.length);
|
371
369
|
}
|
372
370
|
}, [(C = b.data) == null ? void 0 : C.data]);
|
373
|
-
function
|
374
|
-
var A,
|
375
|
-
(A = w.chain) != null && A.length && ((
|
371
|
+
function te(w, T) {
|
372
|
+
var A, L;
|
373
|
+
(A = w.chain) != null && A.length && ((L = T == null ? void 0 : T.coin) != null && L.length) && s();
|
376
374
|
}
|
377
375
|
function E() {
|
378
|
-
|
376
|
+
i(!1);
|
379
377
|
}
|
380
|
-
function
|
378
|
+
function G(w) {
|
381
379
|
I(w), x("");
|
382
380
|
}
|
383
|
-
const { tick: O, defaultCoin:
|
384
|
-
return d ? /* @__PURE__ */ e(X1, { handleSetChainData:
|
381
|
+
const { tick: O, defaultCoin: z } = Ee;
|
382
|
+
return d ? /* @__PURE__ */ e(X1, { handleSetChainData: G, data: (P = b.data) == null ? void 0 : P.data, handleBack: E, network: m }) : /* @__PURE__ */ p(J, { children: [
|
385
383
|
/* @__PURE__ */ p("div", { children: [
|
386
384
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
387
385
|
/* @__PURE__ */ e(
|
@@ -391,24 +389,24 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
391
389
|
s(), (!r.coin.length || !o.chain.length) && (n({ coin: "" }), t({ chain: "" }));
|
392
390
|
},
|
393
391
|
className: "bw-absolute bw-left-0 bw-top-[25%]",
|
394
|
-
children: /* @__PURE__ */ e(
|
392
|
+
children: /* @__PURE__ */ e(n1, { fill: "var(--tw-text-secondary)" })
|
395
393
|
}
|
396
394
|
),
|
397
395
|
/* @__PURE__ */ p("div", { className: "bw-text-base bw-font-normal bw-text-text-secondary", children: [
|
398
|
-
|
396
|
+
l.charAt(0).toUpperCase() + l.slice(1),
|
399
397
|
" Network"
|
400
398
|
] })
|
401
399
|
] }),
|
402
|
-
b.isLoading ? /* @__PURE__ */ e(
|
400
|
+
b.isLoading ? /* @__PURE__ */ e(F1, { animation: "wave", variant: "rectangular", width: "100%", height: 134, className: "bw-rounded-md bw-flex bw-justify-center bw-bg-transparent bw-opacity-0 bw-items-center bw-text-text-primary" }) : /* @__PURE__ */ p("div", { className: "bw-grid bw-grid-cols-5 bw-gap-1 bw-overflow-y-auto bw-w-full", children: [
|
403
401
|
b.isSuccess && B.map((w, T) => {
|
404
|
-
var A,
|
402
|
+
var A, L;
|
405
403
|
return /* @__PURE__ */ e(
|
406
404
|
"div",
|
407
405
|
{
|
408
406
|
style: m.name == w.name ? {
|
409
407
|
...S.gradientStyle
|
410
408
|
} : {},
|
411
|
-
className: ` bw-relative ${m.name == w.name ? (y ||
|
409
|
+
className: ` bw-relative ${m.name == w.name ? (y || o1.gradientbackground) + " " + o1.overlay : "bw-bg-transparent"} bw-p-[2px] bw-h-max bw-rounded-[7px]`,
|
412
410
|
children: /* @__PURE__ */ p(
|
413
411
|
"div",
|
414
412
|
{
|
@@ -418,15 +416,15 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
418
416
|
...w
|
419
417
|
// networkType: "cosmos",
|
420
418
|
};
|
421
|
-
|
419
|
+
G(N);
|
422
420
|
},
|
423
421
|
className: "bw-p-2 bw-w-full bw-aspect-video bw-relative bw-z-10 bw-bg-background-networkcard bw-rounded-md bw-flex bw-flex-col bw-justify-center bw-items-center",
|
424
422
|
style: { cursor: "pointer" },
|
425
423
|
children: [
|
426
|
-
/* @__PURE__ */ e("img", { src: (A = w.image) != null && A.length ? w.image :
|
424
|
+
/* @__PURE__ */ e("img", { src: (A = w.image) != null && A.length ? w.image : z, width: 25, className: "bw-rounded-[50%] bw-border bw-border-border-primary", height: 25, alt: "img" }),
|
427
425
|
" ",
|
428
|
-
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${m.name == w.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((
|
429
|
-
(m == null ? void 0 : m.chain) == w ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: O }) : /* @__PURE__ */ e(
|
426
|
+
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${m.name == w.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((L = w.name) == null ? void 0 : L.length) > 7 ? w.name.substring(0, 7) + ".." : w.name }),
|
427
|
+
(m == null ? void 0 : m.chain) == w ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: O }) : /* @__PURE__ */ e(J, {})
|
430
428
|
]
|
431
429
|
},
|
432
430
|
T
|
@@ -439,16 +437,16 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
439
437
|
"div",
|
440
438
|
{
|
441
439
|
onClick: () => {
|
442
|
-
|
440
|
+
i(!0);
|
443
441
|
},
|
444
442
|
className: "bw-p-2 bw-w-full bw-aspect-video bw-bg-background-networkcard bw-rounded-md bw-flex bw-flex-col bw-justify-center bw-items-center",
|
445
443
|
style: { cursor: "pointer" },
|
446
444
|
children: [
|
447
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-medium bw-text-text-primary", children: (
|
445
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-medium bw-text-text-primary", children: ($ = (Z = b.data) == null ? void 0 : Z.data) != null && $.length ? `+${F - 9}` : "0" }),
|
448
446
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-primary", children: "Networks" })
|
449
447
|
]
|
450
448
|
}
|
451
|
-
) }) : /* @__PURE__ */ e(
|
449
|
+
) }) : /* @__PURE__ */ e(J, {})
|
452
450
|
] })
|
453
451
|
] }),
|
454
452
|
/* @__PURE__ */ p("div", { children: [
|
@@ -481,13 +479,13 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
481
479
|
x("");
|
482
480
|
},
|
483
481
|
className: "bw-mt-1 bw-mr-1",
|
484
|
-
children: /* @__PURE__ */ e(
|
482
|
+
children: /* @__PURE__ */ e(n1, { fill: "var(--tw-text-primary)" })
|
485
483
|
}
|
486
|
-
) : /* @__PURE__ */ e(
|
484
|
+
) : /* @__PURE__ */ e(d1, { fill: "var(--tw-background-secondary)" }) })
|
487
485
|
]
|
488
486
|
}
|
489
487
|
),
|
490
|
-
/* @__PURE__ */ e(tt, { value: g, handleClosePopup:
|
488
|
+
/* @__PURE__ */ e(tt, { value: g, handleClosePopup: te, showExchangeList: l, setChainData: t, setCoinData: n, selectChainState: m })
|
491
489
|
] })
|
492
490
|
] });
|
493
491
|
}
|
@@ -497,20 +495,20 @@ function rt({
|
|
497
495
|
show: s,
|
498
496
|
networkType: o,
|
499
497
|
handleShowWallet: r,
|
500
|
-
setConnectWalletField:
|
498
|
+
setConnectWalletField: l
|
501
499
|
}) {
|
502
|
-
const [b, d] = v(null), { address:
|
503
|
-
|
500
|
+
const [b, d] = v(null), { address: i, chain: g, data: x, disconnect: k, ...B } = t, [M, F] = v(), { connector: h } = fe(), { connectors: m } = O1(), I = () => {
|
501
|
+
l(s), s == "to" ? (y(), n(!0)) : y();
|
504
502
|
};
|
505
|
-
|
503
|
+
R1(), j(() => {
|
506
504
|
m.length && F(
|
507
|
-
|
505
|
+
pe.keyBy(m, (S) => S.uid)
|
508
506
|
);
|
509
507
|
}, [m]);
|
510
508
|
async function y() {
|
511
509
|
o === "evm" && (g == null ? void 0 : g.network) !== "custom" && (M != null && M[h == null ? void 0 : h.uid]), r();
|
512
510
|
}
|
513
|
-
return /* @__PURE__ */ e(
|
511
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
|
514
512
|
"button",
|
515
513
|
{
|
516
514
|
"aria-haspopup": "true",
|
@@ -518,32 +516,32 @@ function rt({
|
|
518
516
|
id: "basic-button",
|
519
517
|
style: { fontSize: "12px" },
|
520
518
|
className: "bw-bg-background-container bw-flex bw-items-center bw-justify-center bw-gap-x-2 bw-mb-[4px] bw-w-[100px] bw-h-[25px] bw-rounded-xl bw-border bw-border-border-primary",
|
521
|
-
children:
|
522
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-primary bw-text-xs bw-font-normal", children: ((
|
519
|
+
children: i ? /* @__PURE__ */ p(J, { children: [
|
520
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-primary bw-text-xs bw-font-normal", children: ((i == null ? void 0 : i.substring(0, 4)) || "") + "..." + ((i == null ? void 0 : i.substring(i.length - 4, i.length)) || "") }),
|
523
521
|
/* @__PURE__ */ e(
|
524
522
|
"div",
|
525
523
|
{
|
526
|
-
children: /* @__PURE__ */ e(
|
524
|
+
children: /* @__PURE__ */ e(c1, { fill: "var(--tw-text-secondary)" })
|
527
525
|
}
|
528
526
|
)
|
529
|
-
] }) : /* @__PURE__ */ e("div", { className: "bw-w-[10px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[10px]", children: /* @__PURE__ */ e(
|
527
|
+
] }) : /* @__PURE__ */ e("div", { className: "bw-w-[10px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[10px]", children: /* @__PURE__ */ e(Se, { size: 10, thickness: 5, color: "inherit" }) })
|
530
528
|
}
|
531
529
|
) });
|
532
530
|
}
|
533
|
-
function
|
534
|
-
var I, y, S, _,
|
535
|
-
const b =
|
536
|
-
|
537
|
-
const { defaultCoin: k } = Ee, { isAnyWalletConnected: B, getWallet: M } =
|
531
|
+
function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConnectWalletField: o, coinData: r, show: l }) {
|
532
|
+
var I, y, S, _, te, E, G, O, z;
|
533
|
+
const b = c((f) => f.configuration), d = c((f) => f.customWallet), { isConnected: i, isConnecting: g, isReconnecting: x } = fe();
|
534
|
+
Ie();
|
535
|
+
const { defaultCoin: k } = Ee, { isAnyWalletConnected: B, getWallet: M } = Te({
|
538
536
|
chainData: t,
|
539
|
-
show:
|
537
|
+
show: l
|
540
538
|
});
|
541
|
-
|
542
|
-
const F =
|
539
|
+
c((f) => f.toDisconnect), c((f) => f.setToDisconnect);
|
540
|
+
const F = c((f) => f.fromChain), h = c((f) => f.toChain);
|
543
541
|
function m(f) {
|
544
542
|
}
|
545
543
|
return /* @__PURE__ */ p("div", { className: "bw-w-[50%] ", children: [
|
546
|
-
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-left bw-font-medium bw-mb-1 bw-text-text-secondary", children:
|
544
|
+
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-left bw-font-medium bw-mb-1 bw-text-text-secondary", children: l == "from" ? "Give" : "Get" }),
|
547
545
|
/* @__PURE__ */ p(
|
548
546
|
"div",
|
549
547
|
{
|
@@ -560,7 +558,7 @@ function o1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConn
|
|
560
558
|
"div",
|
561
559
|
{
|
562
560
|
onClick: () => {
|
563
|
-
n(
|
561
|
+
n(l);
|
564
562
|
},
|
565
563
|
className: "bw-cursor-pointer",
|
566
564
|
children: [
|
@@ -568,30 +566,30 @@ function o1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConn
|
|
568
566
|
(S = r == null ? void 0 : r.coin) != null && S.length ? /* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-bold bw-text-text-primary", children: r.coin }) : /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-text-primary bw-font-bold", children: "Select Token" }),
|
569
567
|
/* @__PURE__ */ e(K1, { fill: (_ = r == null ? void 0 : r.coin) != null && _.length ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" })
|
570
568
|
] }),
|
571
|
-
(
|
569
|
+
(te = t == null ? void 0 : t.chain) != null && te.length ? /* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: `on ${t.chain}`.length > 12 ? `on ${t.chain.substring(0, 12)}..` : `on ${t.chain}` }) : /* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-bold bw-text-text-primary", children: "& Chain" })
|
572
570
|
]
|
573
571
|
}
|
574
572
|
)
|
575
573
|
]
|
576
574
|
}
|
577
575
|
),
|
578
|
-
/* @__PURE__ */ e(st, { isConnected:
|
576
|
+
/* @__PURE__ */ e(st, { isConnected: l == "to" ? (F == null ? void 0 : F.networkType) === (h == null ? void 0 : h.networkType) ? !!((G = (E = M(F)) == null ? void 0 : E.address) != null && G.length || (d == null ? void 0 : d.length) > 30) : !!((z = (O = M(h)) == null ? void 0 : O.address) != null && z.length || (d == null ? void 0 : d.length) > 30) : B, setConnectWalletField: o, handleShowWallet: s, show: l, chainData: t, handleToDisconnect: m })
|
579
577
|
] });
|
580
578
|
}
|
581
|
-
function st({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, show: o, chainData: r, handleToDisconnect:
|
579
|
+
function st({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, show: o, chainData: r, handleToDisconnect: l }) {
|
582
580
|
var x;
|
583
|
-
const b =
|
581
|
+
const b = c((k) => k.customWallet), d = c((k) => k.fromChain), i = c((k) => k.toChain), { getWallet: g } = Te({
|
584
582
|
chainData: r,
|
585
583
|
show: o
|
586
584
|
});
|
587
585
|
return /* @__PURE__ */ e("div", { className: "bw-mt-2 bw-flex bw-justify-end", children: t ? /* @__PURE__ */ e(
|
588
586
|
rt,
|
589
587
|
{
|
590
|
-
walletDetails: (b == null ? void 0 : b.length) > 30 && o == "to" ? g({}) : (d == null ? void 0 : d.networkType) == (
|
591
|
-
disconnect:
|
588
|
+
walletDetails: (b == null ? void 0 : b.length) > 30 && o == "to" ? g({}) : (d == null ? void 0 : d.networkType) == (i == null ? void 0 : i.networkType) && o == "to" ? {
|
589
|
+
disconnect: l,
|
592
590
|
address: (x = g(d)) == null ? void 0 : x.address
|
593
591
|
} : g(r),
|
594
|
-
handleToDisconnect:
|
592
|
+
handleToDisconnect: l,
|
595
593
|
show: o,
|
596
594
|
networkType: r == null ? void 0 : r.networkType,
|
597
595
|
setConnectWalletField: n,
|
@@ -606,17 +604,17 @@ function st({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, sho
|
|
606
604
|
className: "bw-mb-1 bw-relative bw-min-w-[100px] bw-flex bw-justify-center bw-items-center bw-gap-x-1 bw-w-[84px] bw-h-[25px] bw-text-xs bw-font-medium bw-px-2 bw-rounded-xl bw-border bw-border-border-primary bw-bg-background-container bw-text-text-primary",
|
607
605
|
children: [
|
608
606
|
/* @__PURE__ */ e("p", { className: "bw-mr-3", children: "Connect" }),
|
609
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2", children: /* @__PURE__ */ e(
|
607
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2", children: /* @__PURE__ */ e(c1, { fill: "var(--tw-text-secondary)" }) })
|
610
608
|
]
|
611
609
|
}
|
612
610
|
) });
|
613
611
|
}
|
614
|
-
const ot = "_gradient_15zwe_1",
|
612
|
+
const ot = "_gradient_15zwe_1", Ze = {
|
615
613
|
gradient: ot
|
616
614
|
};
|
617
|
-
function
|
615
|
+
function at({ mode: t, handleMode: n }) {
|
618
616
|
var o, r;
|
619
|
-
const s =
|
617
|
+
const s = c((l) => l.configuration);
|
620
618
|
return /* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center", children: /* @__PURE__ */ p(
|
621
619
|
"div",
|
622
620
|
{
|
@@ -646,10 +644,10 @@ function it({ mode: t, handleMode: n }) {
|
|
646
644
|
{
|
647
645
|
style: {
|
648
646
|
transition: "left 0.5s",
|
649
|
-
width: "calc(100% /
|
647
|
+
width: "calc(100% / 3)",
|
650
648
|
...s == null ? void 0 : s.gradientStyle
|
651
649
|
},
|
652
|
-
className: `${!(s != null && s.gradientStyle) &&
|
650
|
+
className: `${!(s != null && s.gradientStyle) && Ze.gradient} ${t === "Both" ? "bw-left-[66.5%]" : t === "Priority Fee" ? "bw-left-0" : t === "Jito Tip" ? "bw-left-[33%]" : "bw-hidden"} bw-z-10 bw-cursor-pointer bw-absolute bw-h-[40px] bw-p-[2px] bw-rounded-md `,
|
653
651
|
children: /* @__PURE__ */ e("div", { className: "bw-w-full bw-h-full bw-text-text-primary bw-text-sm bw-font-extrabold bw-flex bw-justify-center bw-items-center bw-rounded-md bw-bg-background-container", children: t })
|
654
652
|
}
|
655
653
|
),
|
@@ -666,19 +664,6 @@ function it({ mode: t, handleMode: n }) {
|
|
666
664
|
]
|
667
665
|
}
|
668
666
|
),
|
669
|
-
/* @__PURE__ */ p(
|
670
|
-
"button",
|
671
|
-
{
|
672
|
-
onClick: () => {
|
673
|
-
n("Helius Tip");
|
674
|
-
},
|
675
|
-
className: "bw-font-normal bw-text-text-secondary bw-border bw-bg-background-container bw-border-x-0 bw-flex bw-justify-center bw-items-center bw-relative bw-text-sm bw-flex-1 bw-border-border-primary bw-h-[40px] ",
|
676
|
-
children: [
|
677
|
-
/* @__PURE__ */ e("p", { className: `${t === "Helius Tip" ? "bw-opacity-0" : "bw-opacity-100"}`, style: { transition: "opacity 0.1s ease" }, children: "Helius Tip" }),
|
678
|
-
/* @__PURE__ */ e("div", { className: "bw-h-[70%] bw-right-0 bw-absolute bw-w-[1px] bw-bg-border-primary" })
|
679
|
-
]
|
680
|
-
}
|
681
|
-
),
|
682
667
|
/* @__PURE__ */ e(
|
683
668
|
"button",
|
684
669
|
{
|
@@ -696,7 +681,7 @@ function it({ mode: t, handleMode: n }) {
|
|
696
681
|
}
|
697
682
|
) });
|
698
683
|
}
|
699
|
-
function
|
684
|
+
function it({ fill: t }) {
|
700
685
|
return /* @__PURE__ */ e(
|
701
686
|
"svg",
|
702
687
|
{
|
@@ -717,23 +702,23 @@ function at({ fill: t }) {
|
|
717
702
|
}
|
718
703
|
);
|
719
704
|
}
|
720
|
-
function
|
721
|
-
var r,
|
705
|
+
function u1({ options: t, handleOptions: n }) {
|
706
|
+
var r, l;
|
722
707
|
const s = [
|
723
708
|
{ name: "Medium", value: "medium" },
|
724
709
|
{ name: "High", value: "high" },
|
725
710
|
{ name: "Degen", value: "ultra" }
|
726
|
-
], o =
|
711
|
+
], o = c((b) => b.configuration);
|
727
712
|
return /* @__PURE__ */ p("div", { className: "bw-mt-5 bw-flex bw-items-center bw-justify-between", children: [
|
728
713
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: "Speed" }),
|
729
714
|
/* @__PURE__ */ e(
|
730
715
|
"div",
|
731
716
|
{
|
732
717
|
style: {
|
733
|
-
boxShadow: o && o.customTheme && ((
|
718
|
+
boxShadow: o && o.customTheme && ((l = (r = o.customTheme) == null ? void 0 : r.shadow) == null ? void 0 : l.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
734
719
|
},
|
735
720
|
className: "bw-flex bw-border bw-bg-background-container bw-w-[70%] md:bw-w-[60%] bw-h-[40px] bw-rounded-md bw-border-border-primary bw-items-center bw-justify-between",
|
736
|
-
children: s.map((b, d,
|
721
|
+
children: s.map((b, d, i) => /* @__PURE__ */ p(
|
737
722
|
"button",
|
738
723
|
{
|
739
724
|
onClick: () => {
|
@@ -748,7 +733,7 @@ function w1({ options: t, handleOptions: n }) {
|
|
748
733
|
className: `
|
749
734
|
bw-flex bw-flex-1 bw-relative bw-h-full bw-rounded-md bw-gap-x-1 bw-justify-center bw-items-center `,
|
750
735
|
children: [
|
751
|
-
b.value === "ultra" ? /* @__PURE__ */ e(
|
736
|
+
b.value === "ultra" ? /* @__PURE__ */ e(it, { fill: b.value === t.value ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" }) : /* @__PURE__ */ e(J, {}),
|
752
737
|
/* @__PURE__ */ e(
|
753
738
|
"p",
|
754
739
|
{
|
@@ -756,7 +741,7 @@ function w1({ options: t, handleOptions: n }) {
|
|
756
741
|
children: b.name
|
757
742
|
}
|
758
743
|
),
|
759
|
-
|
744
|
+
i.length - 1 !== d && /* @__PURE__ */ e("div", { className: "bw-h-[70%] bw-absolute bw-right-0 bw-w-[1px] bw-border bw-border-border-primary" }),
|
760
745
|
/* @__PURE__ */ e(
|
761
746
|
"div",
|
762
747
|
{
|
@@ -766,7 +751,7 @@ function w1({ options: t, handleOptions: n }) {
|
|
766
751
|
},
|
767
752
|
className: `bw-w-full
|
768
753
|
|
769
|
-
${b.value === t.value ? "bw-opacity-100" : "bw-opacity-0"} bw-absolute bw-bottom-0 bw-h-[2px] bw-rounded-md ${!(o != null && o.gradientStyle) &&
|
754
|
+
${b.value === t.value ? "bw-opacity-100" : "bw-opacity-0"} bw-absolute bw-bottom-0 bw-h-[2px] bw-rounded-md ${!(o != null && o.gradientStyle) && Ze.gradient}`
|
770
755
|
}
|
771
756
|
)
|
772
757
|
]
|
@@ -776,7 +761,7 @@ function w1({ options: t, handleOptions: n }) {
|
|
776
761
|
)
|
777
762
|
] });
|
778
763
|
}
|
779
|
-
function
|
764
|
+
function m1(t) {
|
780
765
|
const n = [
|
781
766
|
"Tab",
|
782
767
|
"Enter",
|
@@ -790,16 +775,16 @@ function u1(t) {
|
|
790
775
|
];
|
791
776
|
/^\d$/.test(t.key) || n.includes(t.key) || t.preventDefault();
|
792
777
|
}
|
793
|
-
function
|
794
|
-
var
|
795
|
-
const r =
|
778
|
+
function p1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
779
|
+
var l, b;
|
780
|
+
const r = c((d) => d.configuration);
|
796
781
|
return /* @__PURE__ */ p("div", { className: "bw-mt-5 bw-flex bw-items-center bw-justify-between bw-gap-x-3 bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
797
782
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal", children: s }),
|
798
783
|
/* @__PURE__ */ p(
|
799
784
|
"div",
|
800
785
|
{
|
801
786
|
style: {
|
802
|
-
boxShadow: r && r.customTheme && ((b = (
|
787
|
+
boxShadow: r && r.customTheme && ((b = (l = r.customTheme) == null ? void 0 : l.shadow) == null ? void 0 : b.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
803
788
|
},
|
804
789
|
className: "bw-h-[40px] bw-w-[70%] md:bw-w-[60%] bw-flex bw-rounded-md bw-border bw-border-border-primary bw-bg-background-container bw-p-1 bw-text-text-primary",
|
805
790
|
children: [
|
@@ -811,7 +796,7 @@ function m1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
811
796
|
value: t,
|
812
797
|
onChange: n,
|
813
798
|
onKeyDown: (d) => {
|
814
|
-
|
799
|
+
m1(d);
|
815
800
|
}
|
816
801
|
}
|
817
802
|
),
|
@@ -824,13 +809,13 @@ function m1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
824
809
|
)
|
825
810
|
] });
|
826
811
|
}
|
827
|
-
function
|
828
|
-
const s =
|
829
|
-
return
|
812
|
+
function g1({ handleSave: t, isSaveButtonDisabled: n }) {
|
813
|
+
const s = c((o) => o.configuration);
|
814
|
+
return c((o) => o.slippage), /* @__PURE__ */ e(
|
830
815
|
"div",
|
831
816
|
{
|
832
817
|
style: { ...s == null ? void 0 : s.gradientStyle },
|
833
|
-
className: `${n ? "bw-bg-border-primary" : !(s != null && s.gradientStyle) &&
|
818
|
+
className: `${n ? "bw-bg-border-primary" : !(s != null && s.gradientStyle) && Ze.gradient} bw-rounded-sm bw-p-[2px] bw-mt-10`,
|
834
819
|
children: /* @__PURE__ */ e(
|
835
820
|
"button",
|
836
821
|
{
|
@@ -842,7 +827,7 @@ function p1({ handleSave: t, isSaveButtonDisabled: n }) {
|
|
842
827
|
}
|
843
828
|
);
|
844
829
|
}
|
845
|
-
function
|
830
|
+
function f1({ handleClose: t }) {
|
846
831
|
return /* @__PURE__ */ p("div", { className: "bw-w-full bw-relative bw-flex bw-items-center bw-justify-center", children: [
|
847
832
|
/* @__PURE__ */ e("h2", { className: "bw-text-2xl bw-font-bold bw-text-text-primary", children: "Config" }),
|
848
833
|
/* @__PURE__ */ e(
|
@@ -856,9 +841,9 @@ function g1({ handleClose: t }) {
|
|
856
841
|
)
|
857
842
|
] });
|
858
843
|
}
|
859
|
-
function
|
844
|
+
function x1({ slippage: t, handleSlippage: n }) {
|
860
845
|
var o, r;
|
861
|
-
const s =
|
846
|
+
const s = c((l) => l.configuration);
|
862
847
|
return /* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-justify-between", children: [
|
863
848
|
/* @__PURE__ */ e("p", { className: "bw-text-lg bw-font-normal bw-text-text-primary", children: "Max Slippage" }),
|
864
849
|
/* @__PURE__ */ p(
|
@@ -873,20 +858,20 @@ function f1({ slippage: t, handleSlippage: n }) {
|
|
873
858
|
/* @__PURE__ */ e(
|
874
859
|
"input",
|
875
860
|
{
|
876
|
-
onKeyUp: (
|
877
|
-
|
861
|
+
onKeyUp: (l) => {
|
862
|
+
l.key === "Enter" && l.target.blur();
|
878
863
|
},
|
879
|
-
onFocus: (
|
880
|
-
|
864
|
+
onFocus: (l) => {
|
865
|
+
l.target.parentElement.style.border = "1px solid var(--tw-text-primary)", l.target.parentElement.style.fontWeight = 600;
|
881
866
|
},
|
882
|
-
onBlur: (
|
883
|
-
|
867
|
+
onBlur: (l) => {
|
868
|
+
l.target.parentElement.style.border = "1px solid var(--tw-border-primary)", l.target.parentElement.style.fontWeight = 400;
|
884
869
|
},
|
885
870
|
value: t,
|
886
871
|
onChange: n,
|
887
872
|
type: "number",
|
888
|
-
onKeyDown: (
|
889
|
-
|
873
|
+
onKeyDown: (l) => {
|
874
|
+
m1(l);
|
890
875
|
},
|
891
876
|
className: "bw-bg-transparent bw-border-none bw-text-text-primary bw-pl-2 bw-text-right bw-w-[80%]"
|
892
877
|
}
|
@@ -897,18 +882,18 @@ function f1({ slippage: t, handleSlippage: n }) {
|
|
897
882
|
)
|
898
883
|
] });
|
899
884
|
}
|
900
|
-
function
|
885
|
+
function h1() {
|
901
886
|
return /* @__PURE__ */ p("div", { className: "bw-flex bw-gap-x-5 bw-items-center ", children: [
|
902
887
|
/* @__PURE__ */ e("h2", { className: "bw-text-lg bw-font-normal bw-text-text-primary", children: "Transaction Fee" }),
|
903
888
|
/* @__PURE__ */ e("div", { className: "bw-h-[1px] bw-flex-1 bw-bg-border-primary " })
|
904
889
|
] });
|
905
890
|
}
|
906
|
-
function
|
907
|
-
const [n, s] = v(""), [o, r] = v({ name: "Low", value: "low" }), [
|
891
|
+
function ct({ handleClose: t }) {
|
892
|
+
const [n, s] = v(""), [o, r] = v({ name: "Low", value: "low" }), [l, b] = v(""), [d, i] = v(""), [g, x] = v(""), k = c((f) => f.broadCastMode), B = c((f) => f.customFee), M = c((f) => f.setCustomFee), F = c((f) => f.slippage), h = c((f) => f.setSlippage), m = c((f) => f.setBroadCastMode), I = c((f) => f.option), y = c((f) => f.setOption), S = n == B && I.name == o.name && F == g && (d === k && d !== "" || !n.length && !I.name.length);
|
908
893
|
function _(f) {
|
909
894
|
b(""), s(f.target.value);
|
910
895
|
}
|
911
|
-
function
|
896
|
+
function te(f, C) {
|
912
897
|
b(""), r(f);
|
913
898
|
}
|
914
899
|
j(() => {
|
@@ -922,11 +907,11 @@ function lt({ handleClose: t }) {
|
|
922
907
|
j(() => {
|
923
908
|
x(F);
|
924
909
|
}, [h]);
|
925
|
-
function
|
910
|
+
function G(f) {
|
926
911
|
x(f.target.value);
|
927
912
|
}
|
928
913
|
j(() => {
|
929
|
-
|
914
|
+
i(k);
|
930
915
|
}, [k]);
|
931
916
|
function O() {
|
932
917
|
if (d == "" && (n.length || o.name.length)) {
|
@@ -935,19 +920,19 @@ function lt({ handleClose: t }) {
|
|
935
920
|
}
|
936
921
|
n.length ? (M(n), y(o)) : (M(""), E()), m(d), h(g), t();
|
937
922
|
}
|
938
|
-
function
|
939
|
-
b(""),
|
923
|
+
function z(f) {
|
924
|
+
b(""), i(f);
|
940
925
|
}
|
941
926
|
return j(() => {
|
942
|
-
!B && !I.name.length && (m(""),
|
927
|
+
!B && !I.name.length && (m(""), i(""));
|
943
928
|
}, [B, I.name]), /* @__PURE__ */ p("div", { className: "bw-w-full md:bw-w-[443px] bw-h-[447px] bw-rounded-lg bw-border bw-p-3 px-4 md:bw-px-6 bw-border-border-primary bw-text-white bw-bg-background-container", children: [
|
944
|
-
/* @__PURE__ */ e(
|
945
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(
|
946
|
-
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(
|
947
|
-
/* @__PURE__ */ e(
|
948
|
-
/* @__PURE__ */ e(
|
929
|
+
/* @__PURE__ */ e(f1, { handleClose: t }),
|
930
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage: g, handleSlippage: G }) }),
|
931
|
+
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(h1, {}) }),
|
932
|
+
/* @__PURE__ */ e(at, { mode: d, handleMode: z }),
|
933
|
+
/* @__PURE__ */ e(u1, { options: o, handleOptions: te }),
|
949
934
|
/* @__PURE__ */ e(
|
950
|
-
|
935
|
+
p1,
|
951
936
|
{
|
952
937
|
title: "Max Cap",
|
953
938
|
inputSideText: "SOL",
|
@@ -956,9 +941,9 @@ function lt({ handleClose: t }) {
|
|
956
941
|
}
|
957
942
|
),
|
958
943
|
/* @__PURE__ */ p("div", { className: "bw-relative", children: [
|
959
|
-
/* @__PURE__ */ e("p", { className: "bw-w-full bw-absolute bw-text-center -bw-top-5 bw-text-xs bw-text-text-redtext", children:
|
944
|
+
/* @__PURE__ */ e("p", { className: "bw-w-full bw-absolute bw-text-center -bw-top-5 bw-text-xs bw-text-text-redtext", children: l }),
|
960
945
|
/* @__PURE__ */ e(
|
961
|
-
|
946
|
+
g1,
|
962
947
|
{
|
963
948
|
handleSave: O,
|
964
949
|
isSaveButtonDisabled: S
|
@@ -967,8 +952,8 @@ function lt({ handleClose: t }) {
|
|
967
952
|
] })
|
968
953
|
] });
|
969
954
|
}
|
970
|
-
function
|
971
|
-
const [n, s] = v({ name: "Low", value: "low" }), [o, r] = v(""), [
|
955
|
+
function lt({ handleClose: t }) {
|
956
|
+
const [n, s] = v({ name: "Low", value: "low" }), [o, r] = v(""), [l, b] = v(""), d = c((y) => y.setEvmGas), i = c((y) => y.setEvmSpeed), g = c((y) => y.evmSpeed), x = c((y) => y.evmGas), k = c((y) => y.slippage), B = c((y) => y.setSlippage), M = o == x && g.name == n.name && k == l;
|
972
957
|
function F(y, S) {
|
973
958
|
s(y);
|
974
959
|
}
|
@@ -981,7 +966,7 @@ function ct({ handleClose: t }) {
|
|
981
966
|
x != null && x.length ? r(x) : r("");
|
982
967
|
}, [x]);
|
983
968
|
function m() {
|
984
|
-
o.length ? (d(o),
|
969
|
+
o.length ? (d(o), i(n)) : (d(""), i(n)), B(l), t();
|
985
970
|
}
|
986
971
|
j(() => {
|
987
972
|
b(k);
|
@@ -990,12 +975,12 @@ function ct({ handleClose: t }) {
|
|
990
975
|
b(y.target.value);
|
991
976
|
}
|
992
977
|
return /* @__PURE__ */ p("div", { className: "bw-w-full md:bw-w-[443px] bw-h-[396px] bw-rounded-md bw-border bw-p-3 bw-border-border-primary bw-text-white bw-bg-background-container", children: [
|
993
|
-
/* @__PURE__ */ e(
|
994
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(
|
995
|
-
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(
|
996
|
-
/* @__PURE__ */ e(
|
978
|
+
/* @__PURE__ */ e(f1, { handleClose: t }),
|
979
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage: l, handleSlippage: I }) }),
|
980
|
+
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(h1, {}) }),
|
981
|
+
/* @__PURE__ */ e(u1, { options: n, handleOptions: F }),
|
997
982
|
/* @__PURE__ */ e(
|
998
|
-
|
983
|
+
p1,
|
999
984
|
{
|
1000
985
|
title: "Gas Price",
|
1001
986
|
inputSideText: "GWEI",
|
@@ -1004,7 +989,7 @@ function ct({ handleClose: t }) {
|
|
1004
989
|
}
|
1005
990
|
),
|
1006
991
|
/* @__PURE__ */ e(
|
1007
|
-
|
992
|
+
g1,
|
1008
993
|
{
|
1009
994
|
handleSave: m,
|
1010
995
|
isSaveButtonDisabled: M
|
@@ -1013,9 +998,9 @@ function ct({ handleClose: t }) {
|
|
1013
998
|
] });
|
1014
999
|
}
|
1015
1000
|
function bt({ open: t, handleClose: n }) {
|
1016
|
-
const s =
|
1001
|
+
const s = c((r) => r.fromChain);
|
1017
1002
|
return /* @__PURE__ */ e(
|
1018
|
-
|
1003
|
+
E1,
|
1019
1004
|
{
|
1020
1005
|
open: t,
|
1021
1006
|
disablePortal: !0,
|
@@ -1030,7 +1015,7 @@ function bt({ open: t, handleClose: n }) {
|
|
1030
1015
|
// left: "47%",
|
1031
1016
|
// transform: "translate(-50%, -50%)",
|
1032
1017
|
bgcolor: "var(--tw-bg-container)"
|
1033
|
-
}, children: s.networkType == "sol" ? /* @__PURE__ */ e(
|
1018
|
+
}, children: s.networkType == "sol" ? /* @__PURE__ */ e(ct, { handleClose: n }) : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(lt, { handleClose: n }) }) })
|
1034
1019
|
}
|
1035
1020
|
);
|
1036
1021
|
}
|
@@ -1074,7 +1059,7 @@ function dt({ fill: t }) {
|
|
1074
1059
|
);
|
1075
1060
|
}
|
1076
1061
|
function wt() {
|
1077
|
-
const t =
|
1062
|
+
const t = c((o) => o.configuration), n = t == null ? void 0 : t.headingStyles, s = (t == null ? void 0 : t.headingText) || "";
|
1078
1063
|
return s.length ? /* @__PURE__ */ e(
|
1079
1064
|
"span",
|
1080
1065
|
{
|
@@ -1092,7 +1077,7 @@ function wt() {
|
|
1092
1077
|
] });
|
1093
1078
|
}
|
1094
1079
|
function ut() {
|
1095
|
-
const t =
|
1080
|
+
const t = c((s) => s.configuration), n = t == null ? void 0 : t.headingContainerStyles;
|
1096
1081
|
return /* @__PURE__ */ e(
|
1097
1082
|
"div",
|
1098
1083
|
{
|
@@ -1125,11 +1110,11 @@ function ut() {
|
|
1125
1110
|
);
|
1126
1111
|
}
|
1127
1112
|
function mt() {
|
1128
|
-
const [t, n] = v(!1), s =
|
1113
|
+
const [t, n] = v(!1), s = c((r) => r.fromChain);
|
1129
1114
|
function o() {
|
1130
1115
|
n(!1);
|
1131
1116
|
}
|
1132
|
-
return /* @__PURE__ */ p(
|
1117
|
+
return /* @__PURE__ */ p(J, { children: [
|
1133
1118
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-w-full -bw-mt-2 bw-mb-3 bw-items-center bw-justify-end", children: [
|
1134
1119
|
/* @__PURE__ */ e(ut, {}),
|
1135
1120
|
/* @__PURE__ */ e(
|
@@ -1145,24 +1130,24 @@ function mt() {
|
|
1145
1130
|
] });
|
1146
1131
|
}
|
1147
1132
|
let i1, Fe, Ce, Me = 0;
|
1148
|
-
function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isRoutesEnabled: r, fetchBalance:
|
1149
|
-
const [b, d] = v(0), { getWallet:
|
1133
|
+
function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isRoutesEnabled: r, fetchBalance: l }) {
|
1134
|
+
const [b, d] = v(0), { getWallet: i } = Te({}), g = c((h) => h.fromChain), x = i(g), { isConnected: k } = fe();
|
1150
1135
|
j(() => {
|
1151
1136
|
t && clearInterval(Ce);
|
1152
1137
|
}, [t]), j(() => {
|
1153
1138
|
var h;
|
1154
|
-
b === 0 && document.visibilityState === "visible" && !t && r && ((h = x.address) != null && h.length &&
|
1139
|
+
b === 0 && document.visibilityState === "visible" && !t && r && ((h = x.address) != null && h.length && l.refetch(), s.refetch());
|
1155
1140
|
}, [b, t, r]), j(() => {
|
1156
1141
|
s.isFetching && (Me = 0);
|
1157
1142
|
}, [s.isFetching]), j(() => {
|
1158
|
-
if (!
|
1143
|
+
if (!pe.isEmpty(o)) {
|
1159
1144
|
const h = Math.max(0, o.deadline - Me);
|
1160
1145
|
d(h);
|
1161
1146
|
}
|
1162
1147
|
return () => {
|
1163
1148
|
d(0);
|
1164
1149
|
};
|
1165
|
-
}, [o]), j(() => (
|
1150
|
+
}, [o]), j(() => (pe.isEmpty(o) || document.addEventListener("visibilitychange", F), () => {
|
1166
1151
|
document.removeEventListener("visibilitychange", F);
|
1167
1152
|
}), [o]);
|
1168
1153
|
function B() {
|
@@ -1172,30 +1157,30 @@ function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isR
|
|
1172
1157
|
let h = Date.now(), m = Math.round((h - i1) / 1e3);
|
1173
1158
|
o.deadline - Fe + m > o.deadline ? n((I) => {
|
1174
1159
|
var y;
|
1175
|
-
return I || ((y = x.address) != null && y.length &&
|
1160
|
+
return I || ((y = x.address) != null && y.length && l.refetch(), s.refetch(), d(o.deadline)), I;
|
1176
1161
|
}) : Fe && m && d(Fe - m);
|
1177
1162
|
}
|
1178
1163
|
function F() {
|
1179
1164
|
document.visibilityState === "visible" ? M() : B();
|
1180
1165
|
}
|
1181
|
-
return j(() => (
|
1166
|
+
return j(() => (pe.isEmpty(o) ? Ce && clearInterval(Ce) : Ce = setInterval(() => {
|
1182
1167
|
d((h) => h <= 0 ? (Me = 0, o.deadline) : (Me++, h - 1));
|
1183
1168
|
}, 1e3), () => {
|
1184
1169
|
Ce && clearInterval(Ce);
|
1185
|
-
}), [o]),
|
1170
|
+
}), [o]), c((h) => h.timerValue), { quoteTimer: b, setQuoteTimer: d };
|
1186
1171
|
}
|
1187
1172
|
function gt(t, n, s) {
|
1188
|
-
const { primaryWallet: o } =
|
1173
|
+
const { primaryWallet: o } = Ie(), [r, l] = v(0), b = async (d) => {
|
1189
1174
|
if (!o) return;
|
1190
|
-
const
|
1191
|
-
if (
|
1175
|
+
const i = new Ve(d || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed");
|
1176
|
+
if (i)
|
1192
1177
|
try {
|
1193
1178
|
const g = new de(o.address);
|
1194
|
-
|
1195
|
-
|
1179
|
+
i.onAccountChange(g, (B) => {
|
1180
|
+
l(B.lamports / 1e9);
|
1196
1181
|
});
|
1197
|
-
const k = await
|
1198
|
-
|
1182
|
+
const k = await i.getBalance(g) / 1e9;
|
1183
|
+
l(k), s(!1);
|
1199
1184
|
} catch {
|
1200
1185
|
s(!1);
|
1201
1186
|
}
|
@@ -1216,12 +1201,12 @@ async function yt(t, n) {
|
|
1216
1201
|
const s = new Ve(n || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed"), o = new de(t), r = await s.getParsedTokenAccountsByOwner(o, {
|
1217
1202
|
programId: n ? ht : xt
|
1218
1203
|
});
|
1219
|
-
let
|
1204
|
+
let l = {};
|
1220
1205
|
for (const { account: b } of r.value) {
|
1221
|
-
const d = b.data.parsed.info.mint,
|
1222
|
-
|
1206
|
+
const d = b.data.parsed.info.mint, i = b.data.parsed.info.tokenAmount.uiAmount;
|
1207
|
+
l[d] = i;
|
1223
1208
|
}
|
1224
|
-
return
|
1209
|
+
return l;
|
1225
1210
|
}
|
1226
1211
|
const Ct = "0000000000000000000000000000000000", vt = async (t) => {
|
1227
1212
|
try {
|
@@ -1246,22 +1231,22 @@ async function kt(t, n) {
|
|
1246
1231
|
}
|
1247
1232
|
}
|
1248
1233
|
function Nt(t, n) {
|
1249
|
-
const [s, o] = v(0), { primaryWallet: r, setPrimaryWallet:
|
1234
|
+
const [s, o] = v(0), { primaryWallet: r, setPrimaryWallet: l } = Ie(), [b, d] = v(!1), i = c((w) => w.fromChain), { address: g, isConnected: x } = fe(), { address: k, isConnected: B } = ze(), M = c((w) => w.cosmosChainIds), { data: F, isConnected: h } = Oe({
|
1250
1235
|
chainId: M,
|
1251
1236
|
multiChain: !0
|
1252
|
-
}), m =
|
1237
|
+
}), m = c((w) => w.fromCoin), { data: I, isLoading: y } = $1({
|
1253
1238
|
address: g,
|
1254
1239
|
token: ft((m == null ? void 0 : m.address) || ""),
|
1255
|
-
chainId: Number((
|
1256
|
-
enabled: !!((
|
1240
|
+
chainId: Number((i == null ? void 0 : i.chainId) || 0),
|
1241
|
+
enabled: !!((i.networkType == "evm" || n) && g && (g != null && g.length))
|
1257
1242
|
}), {
|
1258
1243
|
data: S,
|
1259
1244
|
isLoading: _,
|
1260
|
-
isFetching:
|
1245
|
+
isFetching: te,
|
1261
1246
|
isInitialLoading: E,
|
1262
|
-
isRefetching:
|
1263
|
-
} =
|
1264
|
-
chainId: [
|
1247
|
+
isRefetching: G
|
1248
|
+
} = b1({
|
1249
|
+
chainId: [i.chainId],
|
1265
1250
|
multiChain: !0
|
1266
1251
|
});
|
1267
1252
|
async function O(w) {
|
@@ -1277,7 +1262,7 @@ function Nt(t, n) {
|
|
1277
1262
|
d(!1);
|
1278
1263
|
}
|
1279
1264
|
}
|
1280
|
-
async function
|
1265
|
+
async function z(w) {
|
1281
1266
|
try {
|
1282
1267
|
d(!0);
|
1283
1268
|
let T = await yt(r.address, w);
|
@@ -1293,41 +1278,41 @@ function Nt(t, n) {
|
|
1293
1278
|
if (!w) return;
|
1294
1279
|
const T = new de(r.address);
|
1295
1280
|
T && (f = w.onAccountChange(T, (A) => {
|
1296
|
-
var
|
1297
|
-
if (
|
1298
|
-
if (((
|
1281
|
+
var L;
|
1282
|
+
if (i.networkType == "sol" && (r != null && r.address))
|
1283
|
+
if (((L = m == null ? void 0 : m.symbol) == null ? void 0 : L.toLowerCase()) === "sol")
|
1299
1284
|
O();
|
1300
|
-
else if (
|
1301
|
-
m.symbol == "ETH" ? O("https://eclipse.lgns.net/") :
|
1285
|
+
else if (i.chainId === "eclipse-svm")
|
1286
|
+
m.symbol == "ETH" ? O("https://eclipse.lgns.net/") : z("https://eclipse.lgns.net/");
|
1302
1287
|
else {
|
1303
|
-
if (
|
1288
|
+
if (i.networkType === "btc" || i.networkType === "sui")
|
1304
1289
|
return;
|
1305
|
-
|
1290
|
+
z();
|
1306
1291
|
}
|
1307
1292
|
}));
|
1308
1293
|
}
|
1309
|
-
async function
|
1294
|
+
async function P() {
|
1310
1295
|
d(!0);
|
1311
1296
|
const w = await r.getBalance();
|
1312
1297
|
o(w), d(!1);
|
1313
1298
|
}
|
1314
|
-
j(() => ((
|
1299
|
+
j(() => ((i == null ? void 0 : i.networkType) === "sol" && C(), async () => {
|
1315
1300
|
if (!r) return;
|
1316
1301
|
const w = await r.connector.getPublicClient();
|
1317
1302
|
w && w.removeAccountChangeListener(f);
|
1318
|
-
}), [r == null ? void 0 : r.address,
|
1303
|
+
}), [r == null ? void 0 : r.address, i == null ? void 0 : i.networkType, m]);
|
1319
1304
|
async function Z(w) {
|
1320
|
-
var A,
|
1305
|
+
var A, L;
|
1321
1306
|
let T = S[w] || S;
|
1322
1307
|
try {
|
1323
1308
|
d(!0);
|
1324
|
-
let N = await T.getAllBalances((A = F == null ? void 0 : F[w]) == null ? void 0 : A.bech32Address),
|
1325
|
-
o(((
|
1309
|
+
let N = await T.getAllBalances((A = F == null ? void 0 : F[w]) == null ? void 0 : A.bech32Address), R = pe.keyBy(N, "denom");
|
1310
|
+
o(((L = R[w1(m.address)]) == null ? void 0 : L.amount) / Math.pow(10, m.decimals) || 0), d(!1);
|
1326
1311
|
} catch {
|
1327
1312
|
d(!1);
|
1328
1313
|
}
|
1329
1314
|
}
|
1330
|
-
async function
|
1315
|
+
async function $(w, T) {
|
1331
1316
|
o(0);
|
1332
1317
|
try {
|
1333
1318
|
d(!0);
|
@@ -1339,104 +1324,98 @@ function Nt(t, n) {
|
|
1339
1324
|
}
|
1340
1325
|
return j(() => {
|
1341
1326
|
var w;
|
1342
|
-
|
1343
|
-
}, [
|
1327
|
+
o(0), i.networkType == "sol" && (r != null && r.address) ? ((w = m == null ? void 0 : m.symbol) == null ? void 0 : w.toLowerCase()) === "sol" ? O() : i.chainId == "eclipse-svm" ? m.symbol == "ETH" ? O("https://eclipse.lgns.net/") : z("https://eclipse.lgns.net/") : z() : i.networkType == "sui" && (r == null ? void 0 : r.chain) == "SUI" || i.networkType == "btc" && (r == null ? void 0 : r.chain) == "BTC" ? P() : i.networkType == "evm" && g && (g != null && g.length) ? o(Number((I == null ? void 0 : I.formatted) || 0)) : i.networkType == "cosmos" && h && !_ ? Z(i == null ? void 0 : i.chainId) : i.networkType == "tron" && k && $(k, m == null ? void 0 : m.address);
|
1328
|
+
}, [i.networkType, i == null ? void 0 : i.chainId, m.symbol, m == null ? void 0 : m.address, I, g, r == null ? void 0 : r.address, g, h, _, r == null ? void 0 : r.chain, t, k]), {
|
1344
1329
|
getbal: s,
|
1345
|
-
isBalanceLoading: (
|
1330
|
+
isBalanceLoading: (i == null ? void 0 : i.networkType) == "evm" ? y : b
|
1346
1331
|
};
|
1347
1332
|
}
|
1348
|
-
const Tt =
|
1349
|
-
function
|
1333
|
+
const Tt = ce.lazy(() => import("./SwapAsset-Kx0ombNP.js")), It = ce.lazy(() => import("./InputComp-Q8pjLoPE.js")), Bt = ce.lazy(() => import("./QuotesProgress-BD5CQpZ-.js")), At = ce.lazy(() => import("./TxnButton-CWOz7URH.js")), jt = ce.lazy(() => import("./index-BrUFU9w4.js").then((t) => t.i)), Lt = ce.lazy(() => import("./index-nbo2VFYc.js")), Pt = ce.lazy(() => import("./LoadRoute-C2z-mW9G.js")), Ft = ce.lazy(() => import("./AllRoutes-3rJ_6MZA.js")), Mt = ce.lazy(() => import("./AdvancedSettings-BSHVKOx8.js"));
|
1334
|
+
function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
1350
1335
|
var Ke, Je, qe, Xe, Qe, Ue, Ye;
|
1351
|
-
const [o, r] = v(), [
|
1352
|
-
|
1353
|
-
const {
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
enabled:
|
1361
|
-
dependency: le,
|
1362
|
-
payload: [(C == null ? void 0 : C.networkType) === "cosmos" ? r1(E == null ? void 0 : E.bech32Address, (Ke = C == null ? void 0 : C.chainInfo) == null ? void 0 : Ke.bech32Config.bech32PrefixAccAddr) : ((Je = q(C)) == null ? void 0 : Je.address) || "", C, L, Z, R, N, Number(Be) * 100, (se == null ? void 0 : se.length) > 30 ? ((qe = q({})) == null ? void 0 : qe.address) || "" : (L == null ? void 0 : L.networkType) === "cosmos" ? r1(E == null ? void 0 : E.bech32Address, (Xe = L == null ? void 0 : L.chainInfo) == null ? void 0 : Xe.bech32Config.bech32PrefixAccAddr) : ((Qe = q(L)) == null ? void 0 : Qe.address) || "", oe]
|
1363
|
-
}), ae = q(C), ue = l1({
|
1364
|
-
queryKey: ["balance", ae == null ? void 0 : ae.address, C],
|
1365
|
-
queryFn: async () => await (await Se.fetchBalance(ae.address, C.chainId)).json(),
|
1366
|
-
enabled: !!((Ue = ae == null ? void 0 : ae.address) != null && Ue.length && C.chainId),
|
1336
|
+
const [o, r] = v(), [l, b] = v(!1), [d, i] = v(!1), [g, x] = v(!1), [k, B] = v(!1), [M, F] = v("all"), [h, m] = v(!1), { primaryWallet: I } = Ie(), { address: y } = fe(), { address: S } = ze(), { getbal: _, isBalanceLoading: te } = Nt(h), { data: E, isConnected: G } = Oe({ chainId: "cosmoshub-4" }), O = c((a) => a.persist), z = c((a) => a.setPersist), f = c((a) => a.route), C = c((a) => a.fromChain), P = c((a) => a.toChain), Z = c((a) => a.fromCoin), $ = c((a) => a.toCoin), w = c((a) => a.setFromChain), T = c((a) => a.setToChain), A = c((a) => a.setFromCoin), L = c((a) => a.setToCoin), N = c((a) => a.amount), R = c((a) => a.setAmount), re = c((a) => a.customWallet), Be = c((a) => a.setCosmosChainIds), W = c((a) => a.customFee), H = c((a) => a.broadCastMode), U = c((a) => a.evmGas), V = c((a) => a.evmSpeed), Ae = c((a) => a.slippage), ve = c((a) => a.option), je = c((a) => a.setCustomWallet), Le = c((a) => a.setSelectedProvider), { balanceSol: u } = gt(C, h, Re), { suggestAndConnectAsync: D } = Z1(), ne = !!(N.length && C.chain.length && Z.coin.length && P.chain.length && $.coin.length && !g && k), le = c((a) => a.direct), se = c((a) => a.maxAccounts), oe = ["routes", y, C, P, Z, $, N, I == null ? void 0 : I.address, S, re, E == null ? void 0 : E.bech32Address, W, U, V, Ae, H, ve.value, le, se];
|
1337
|
+
let K = (H === "Priority Fee" || H === "Both") && (W != null && W.length) ? W : ve.value, q = (H === "Jito Tip" || H === "Both") && (W != null && W.length) ? W : ve.value, ae = U != null && U.length ? U : V.value;
|
1338
|
+
const ee = (C == null ? void 0 : C.networkType) === "sol" ? H === "Priority Fee" ? `&solanaPriorityFee=${K}` : H === "Jito Tip" ? { solanaJitoTip: q } : { solanaPriorityFee: K, solanaJitoTip: q } : (C == null ? void 0 : C.networkType) === "evm" ? { evmPriorityFee: ae } : "", { getWallet: Y, refetch: ge } = Te({}), { routes: X, routesData: Q, setRoutesData: xe, errorMessage: be, setErrorMessage: ke } = q1({
|
1339
|
+
enabled: ne,
|
1340
|
+
dependency: oe,
|
1341
|
+
payload: [(C == null ? void 0 : C.networkType) === "cosmos" ? s1(E == null ? void 0 : E.bech32Address, (Ke = C == null ? void 0 : C.chainInfo) == null ? void 0 : Ke.bech32Config.bech32PrefixAccAddr) : ((Je = Y(C)) == null ? void 0 : Je.address) || "", C, P, Z, $, N, Number(Ae) * 100, (re == null ? void 0 : re.length) > 30 ? ((qe = Y({})) == null ? void 0 : qe.address) || "" : (P == null ? void 0 : P.networkType) === "cosmos" ? s1(E == null ? void 0 : E.bech32Address, (Xe = P == null ? void 0 : P.chainInfo) == null ? void 0 : Xe.bech32Config.bech32PrefixAccAddr) : ((Qe = Y(P)) == null ? void 0 : Qe.address) || "", ee]
|
1342
|
+
}), ie = Y(C), we = l1({
|
1343
|
+
queryKey: ["balance", ie == null ? void 0 : ie.address, C],
|
1344
|
+
queryFn: async () => await (await _e.fetchBalance(ie.address, C.chainId)).json(),
|
1345
|
+
enabled: !!((Ue = ie == null ? void 0 : ie.address) != null && Ue.length && C.chainId),
|
1367
1346
|
refetchOnWindowFocus: !1
|
1368
1347
|
}), { quoteTimer: Pe } = pt({
|
1369
|
-
routes:
|
1370
|
-
routesData:
|
1348
|
+
routes: X,
|
1349
|
+
routesData: Q,
|
1371
1350
|
confirmRoute: d,
|
1372
|
-
setConfirmRoute:
|
1373
|
-
isRoutesEnabled:
|
1374
|
-
fetchBalance:
|
1351
|
+
setConfirmRoute: i,
|
1352
|
+
isRoutesEnabled: ne,
|
1353
|
+
fetchBalance: we
|
1375
1354
|
});
|
1376
1355
|
j(() => {
|
1377
|
-
N ||
|
1378
|
-
let
|
1379
|
-
return Number(N) > 0 && (
|
1356
|
+
N || xe({});
|
1357
|
+
let a;
|
1358
|
+
return Number(N) > 0 && (a = setTimeout(() => {
|
1380
1359
|
B(!0);
|
1381
1360
|
}, 500)), () => {
|
1382
|
-
clearTimeout(
|
1361
|
+
clearTimeout(a), B(!1);
|
1383
1362
|
};
|
1384
1363
|
}, [N]), j(() => {
|
1385
|
-
|
1386
|
-
}, [
|
1387
|
-
function
|
1388
|
-
x(
|
1364
|
+
X.isFetching && xe({});
|
1365
|
+
}, [X.isFetching]);
|
1366
|
+
function Ne(a) {
|
1367
|
+
x(a);
|
1389
1368
|
}
|
1390
|
-
function
|
1369
|
+
function y1() {
|
1391
1370
|
r();
|
1392
1371
|
}
|
1393
|
-
async function
|
1394
|
-
if (
|
1372
|
+
async function C1(a) {
|
1373
|
+
if (G)
|
1395
1374
|
try {
|
1396
|
-
let
|
1397
|
-
if (
|
1375
|
+
let ue = await r1();
|
1376
|
+
if (ue.length && !ue.includes(a.chainId)) {
|
1398
1377
|
let he = await D({
|
1399
|
-
chainInfo:
|
1400
|
-
walletType:
|
1401
|
-
}),
|
1402
|
-
|
1378
|
+
chainInfo: a,
|
1379
|
+
walletType: H1.KEPLR
|
1380
|
+
}), me = await ge(), ye = await r1();
|
1381
|
+
Be(ye);
|
1403
1382
|
}
|
1404
1383
|
} catch {
|
1405
1384
|
}
|
1406
1385
|
else
|
1407
1386
|
return;
|
1408
1387
|
}
|
1409
|
-
function
|
1410
|
-
(
|
1388
|
+
function v1(a) {
|
1389
|
+
(a == null ? void 0 : a.networkType) == "cosmos" && C1(a.chainInfo), R(""), ke({ error: "" }), o == "from" ? w({ ...a }) : o == "to" && T({ ...a });
|
1411
1390
|
}
|
1412
|
-
function
|
1413
|
-
|
1391
|
+
function k1(a) {
|
1392
|
+
ke({ error: "" }), R(""), o == "from" ? A({ ...a }) : o == "to" && L({ ...a });
|
1414
1393
|
}
|
1415
|
-
function
|
1416
|
-
b(!
|
1394
|
+
function He() {
|
1395
|
+
b(!l);
|
1417
1396
|
}
|
1418
|
-
function Ge(
|
1419
|
-
|
1397
|
+
function Ge(a) {
|
1398
|
+
i(typeof a < "u" ? a : !d);
|
1420
1399
|
}
|
1421
|
-
function
|
1422
|
-
m(
|
1400
|
+
function Re(a) {
|
1401
|
+
m(a);
|
1423
1402
|
}
|
1424
|
-
function
|
1425
|
-
|
1403
|
+
function N1(a) {
|
1404
|
+
Le(a == null ? void 0 : a.provider), xe(a);
|
1426
1405
|
}
|
1427
|
-
function
|
1406
|
+
function T1() {
|
1428
1407
|
setTimeout(() => {
|
1429
|
-
|
1408
|
+
Re(!0), we.refetch();
|
1430
1409
|
}, 1e3);
|
1431
1410
|
}
|
1432
|
-
function
|
1433
|
-
|
1411
|
+
function I1() {
|
1412
|
+
R("");
|
1434
1413
|
}
|
1435
|
-
function
|
1436
|
-
|
1414
|
+
function B1(a, ue, he) {
|
1415
|
+
_e.fetchTokens(a.chainId, he).then((me) => me.json()).then((me) => {
|
1437
1416
|
var ye, We;
|
1438
|
-
(We = (ye =
|
1439
|
-
|
1417
|
+
(We = (ye = me.data) == null ? void 0 : ye[a.chainId]) == null || We.forEach((De) => {
|
1418
|
+
ue({
|
1440
1419
|
...Z,
|
1441
1420
|
coin: De.symbol,
|
1442
1421
|
...De,
|
@@ -1445,44 +1424,45 @@ function Mt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1445
1424
|
});
|
1446
1425
|
});
|
1447
1426
|
}
|
1448
|
-
function
|
1449
|
-
|
1427
|
+
function A1() {
|
1428
|
+
R(""), w(P), A($), T(C), L(Z), C.networkType !== P.networkType && je("");
|
1450
1429
|
}
|
1451
1430
|
j(() => {
|
1452
|
-
O.isHistory && f === "" && (
|
1431
|
+
O.isHistory && f === "" && (z({ allSteps: { steps: null, currentStep: 0 }, stepData: {} }), Ne(!1));
|
1453
1432
|
}, [O]);
|
1454
|
-
function
|
1455
|
-
var
|
1456
|
-
if (
|
1457
|
-
let he =
|
1433
|
+
function j1(a) {
|
1434
|
+
var ue;
|
1435
|
+
if (a && s.isSuccess && a !== (P == null ? void 0 : P.networkType) && a !== (C == null ? void 0 : C.networkType)) {
|
1436
|
+
let he = pe.keyBy(s.data.data, "chainId"), me = a == "evm" ? "8453" : a == "sol" ? "sol" : a == "sui" ? "1" : a == "btc" ? "btc" : a == "tron" ? "tron" : "cosmoshub-4", ye = a == "evm" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : a == "sol" ? "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" : a == "sui" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : a == "btc" ? "bitcoin" : a == "tron" ? "0000000000000000000000000000000000" : "uatom";
|
1458
1437
|
w({
|
1459
|
-
...he[
|
1460
|
-
chain: ((
|
1461
|
-
}),
|
1438
|
+
...he[me],
|
1439
|
+
chain: ((ue = he[me]) == null ? void 0 : ue.name) || ""
|
1440
|
+
}), B1(he[me], A, ye);
|
1462
1441
|
} else
|
1463
1442
|
return;
|
1464
1443
|
}
|
1465
|
-
return /* @__PURE__ */ e(
|
1444
|
+
return /* @__PURE__ */ e(e1, { fallback: /* @__PURE__ */ e(M1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(jt, { connectWalletField: M, handleShowWallet: t, handleRecentSelectedWallet: j1 }) : !d && !((Ye = O == null ? void 0 : O.routeId) != null && Ye.length) ? l ? /* @__PURE__ */ e(Ft, { routes: X, handleShowAllRoutes: He, handleRoutesData: N1, convertVal: ($ == null ? void 0 : $.lastPrice) || 0, amount: N }) : o ? /* @__PURE__ */ e(nt, { chainData: o == "from" ? C : P, coinData: o == "from" ? Z : $, setChainData: v1, setCoinData: k1, handleReset: y1, showExchangeList: o, fetchBalance: we, fetchChains: s }) : /* @__PURE__ */ p(J, { children: [
|
1466
1445
|
/* @__PURE__ */ e(mt, {}),
|
1467
1446
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
1468
|
-
/* @__PURE__ */ e(Tt, { handleSwap:
|
1469
|
-
/* @__PURE__ */ e(
|
1470
|
-
/* @__PURE__ */ e(
|
1447
|
+
/* @__PURE__ */ e(Tt, { handleSwap: A1 }),
|
1448
|
+
/* @__PURE__ */ e(a1, { chainData: C, show: "from", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: F, coinData: Z }),
|
1449
|
+
/* @__PURE__ */ e(a1, { chainData: P, show: "to", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: F, coinData: $ })
|
1471
1450
|
] }),
|
1472
|
-
/* @__PURE__ */ e(It, { amount: N, setAmount:
|
1473
|
-
/* @__PURE__ */ e(
|
1451
|
+
/* @__PURE__ */ e(It, { amount: N, setAmount: R, fetchBalance: we, getCoinBalance: _, isBalanceLoading: te }),
|
1452
|
+
/* @__PURE__ */ e(e1, { fallback: /* @__PURE__ */ e("div", { children: "Loading..." }), children: /* @__PURE__ */ e(Mt, {}) }),
|
1453
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Pt, { routes: X, handleShowAllRoutes: He, routesData: Q, amount: N, isRoutesEnabled: k, price: ((Q == null ? void 0 : Q.outputAmountDisplay) || "") * (($ == null ? void 0 : $.lastPrice) || 0) }) }),
|
1474
1454
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (be == null ? void 0 : be.error) == "string" ? be == null ? void 0 : be.error : "" }),
|
1475
|
-
/* @__PURE__ */ e(Bt, { amount: k, routes:
|
1476
|
-
/* @__PURE__ */ e(At, { routesData:
|
1477
|
-
] }) : /* @__PURE__ */ e(
|
1455
|
+
/* @__PURE__ */ e(Bt, { amount: k, routes: X, routesData: Q, quoteTimer: Pe }),
|
1456
|
+
/* @__PURE__ */ e(At, { routesData: Q, handleSuccess: Re, routes: X, fetchBalancePrev: we, amount: N, isAmountTyped: k, handleShowWallet: t, setConnectWalletField: F, handleConfirmClose: Ge, balanceSol: u, getCoinBalance: _ })
|
1457
|
+
] }) : /* @__PURE__ */ e(Lt, { handleConfirmClose: Ge, amount: N, routesData: Q, resetAmount: I1, routes: X, handleStopRoute: Ne, resetBalance: T1 }) }) });
|
1478
1458
|
}
|
1479
|
-
function
|
1459
|
+
function Ot({ fetchChains: t }) {
|
1480
1460
|
const [n, s] = v(!1), { isConnected: o } = fe();
|
1481
|
-
function r(
|
1461
|
+
function r(l) {
|
1482
1462
|
s(!n);
|
1483
1463
|
}
|
1484
1464
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1485
|
-
|
1465
|
+
Et,
|
1486
1466
|
{
|
1487
1467
|
handleShowWallet: r,
|
1488
1468
|
fetchChains: t,
|
@@ -1490,15 +1470,15 @@ function Et({ fetchChains: t }) {
|
|
1490
1470
|
}
|
1491
1471
|
) });
|
1492
1472
|
}
|
1493
|
-
const
|
1473
|
+
const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1494
1474
|
__proto__: null,
|
1495
|
-
default:
|
1475
|
+
default: Ot
|
1496
1476
|
}, Symbol.toStringTag, { value: "Module" }));
|
1497
1477
|
export {
|
1498
1478
|
ft as c,
|
1499
1479
|
vt as g,
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1480
|
+
Ut as i,
|
1481
|
+
w1 as p,
|
1482
|
+
m1 as r,
|
1503
1483
|
W1 as u
|
1504
1484
|
};
|