@blockend/widget 1.0.61-beta.2 → 1.0.61-beta.4
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-DiYSWU8X.js +47 -0
- package/dist/{AllRoutes-DIWsY_7s.js → AllRoutes-Tg2ZT76o.js} +9 -9
- package/dist/{Box-CSkOh5pT.js → Box-B9juHpcj.js} +1 -1
- package/dist/{EstGas-D0lMj040.js → EstGas-KMkZn-29.js} +9 -8
- package/dist/{Grow-DArf5BOf.js → Grow-ChRZXdpG.js} +2 -2
- package/dist/{InputComp-BpwhlO5B.js → InputComp-DK_7Rx6i.js} +3 -3
- package/dist/{LoadRoute-Dqk83p2o.js → LoadRoute-DZti2QMq.js} +4 -4
- package/dist/{QuotesProgress-D-bhAdY6.js → QuotesProgress-CSOyBEYv.js} +1 -1
- package/dist/{SwapAsset-CeJghqM4.js → SwapAsset-COjdLi4Y.js} +1 -1
- package/dist/{Tooltip-Bo6E3Ppn.js → Tooltip-DwZ5UqZH.js} +3 -3
- package/dist/{TxnButton-06UcI8vZ.js → TxnButton-DTr4yN0f.js} +3 -3
- package/dist/{add-CnnoTaOE.js → add-Cd5IQacX.js} +1 -1
- package/dist/{all-wallets-77I8A1dR.js → all-wallets-DtKwKlvg.js} +1 -1
- package/dist/{app-store-BHbNWU5O.js → app-store-D20Hc9r5.js} +1 -1
- package/dist/{apple-BUqoJ3h4.js → apple-Dr_FNuvW.js} +1 -1
- package/dist/{arrow-bottom-BKIkvLUW.js → arrow-bottom-BK4Q9_cl.js} +1 -1
- package/dist/{arrow-bottom-circle-CmtY1Go0.js → arrow-bottom-circle-BJNTJ2Id.js} +1 -1
- package/dist/{arrow-left-B1RmdyFf.js → arrow-left-BdTVmWvr.js} +1 -1
- package/dist/{arrow-right-DAGdMwrS.js → arrow-right-BpTu_CvC.js} +1 -1
- package/dist/{arrow-top-DL8aloED.js → arrow-top-DqcH1Bm6.js} +1 -1
- package/dist/{bank-Cho2fj04.js → bank-DiAMG5kv.js} +1 -1
- package/dist/{basic-Hq9EE7JN.js → basic-Dt8XZdAE.js} +3 -3
- package/dist/{browser-B1tFXGo3.js → browser-CR2VhkL1.js} +1 -1
- package/dist/{card-CAIekfsW.js → card-B6zr6eXl.js} +1 -1
- package/dist/{ccip-CQW-OT50.js → ccip-CooAdn5B.js} +1 -1
- package/dist/{checkmark-CMNFl8gr.js → checkmark-5ZEqUgwd.js} +1 -1
- package/dist/{checkmark-bold-jZ_-Wln9.js → checkmark-bold-GLZ5J2EM.js} +1 -1
- package/dist/{chevron-bottom-BXlfv0v_.js → chevron-bottom-B9lKM1_B.js} +1 -1
- package/dist/{chevron-left-CR6Vk7-R.js → chevron-left-B74WPhMU.js} +1 -1
- package/dist/{chevron-right-CK7kmFE0.js → chevron-right-dERN-cRp.js} +1 -1
- package/dist/{chevron-top-5bB353uT.js → chevron-top-CJmBr01i.js} +1 -1
- package/dist/{chrome-store-3zRMRPZ3.js → chrome-store-BN7beBXm.js} +1 -1
- package/dist/{clock-C9VfcQU_.js → clock-BZJEanFr.js} +1 -1
- package/dist/{close-Dp60_0UW.js → close-DYzaADrh.js} +1 -1
- package/dist/{coinPlaceholder-B9q-Q9nc.js → coinPlaceholder-XoI98vL6.js} +1 -1
- package/dist/{compass-D1YdDLDZ.js → compass-Bmw05_74.js} +1 -1
- package/dist/{copy-wpPbMuG7.js → copy-CRsvr_-Y.js} +1 -1
- package/dist/{core-f2H2Z9Sf.js → core-CNtVUQSn.js} +3 -3
- package/dist/{cursor-BGD-Vp6U.js → cursor-_4FCtfoF.js} +1 -1
- package/dist/{cursor-transparent-Df_S-DGP.js → cursor-transparent-t3C3bGio.js} +1 -1
- package/dist/{desktop-xGzb89jl.js → desktop-DEjtj9b9.js} +1 -1
- package/dist/{disconnect-C-l5x3f5.js → disconnect-CvfcFsZW.js} +1 -1
- package/dist/{discord-BMihtS7L.js → discord-Da2kNDFh.js} +1 -1
- package/dist/{down-IP3JFhRv.js → down-Co_636uZ.js} +2 -2
- package/dist/{etherscan-BIDZ39Go.js → etherscan-Bm-JiVEa.js} +1 -1
- package/dist/{exclamation-triangle-DtY9538O.js → exclamation-triangle-DfSv-b_f.js} +1 -1
- package/dist/{extension-nyPuSGEb.js → extension-BKycUNuZ.js} +1 -1
- package/dist/{external-link-CWQ6mRkJ.js → external-link-BYcqpWTv.js} +1 -1
- package/dist/{facebook-C9YV_9Ud.js → facebook-BnfOctOT.js} +1 -1
- package/dist/{farcaster-Bk5tC5cR.js → farcaster-Wnye6IH2.js} +1 -1
- package/dist/{filters-Boj-Safw.js → filters-AjWcrbkL.js} +1 -1
- package/dist/{getChainIds-DVwNZAc5.js → getChainIds-CWu3-jMu.js} +2 -2
- package/dist/{getCosmosAddress-DGjk1iF-.js → getCosmosAddress-CV3jkiKz.js} +1842 -1842
- package/dist/{github-CqlLNrtO.js → github-BCuvL-wO.js} +1 -1
- package/dist/{google-DWRbHt_B.js → google-Bkru7TaB.js} +1 -1
- package/dist/{hamburger-CCqMn9nd.js → hamburger-BAiLuR6L.js} +5 -5
- package/dist/{help-circle-Cv5722_F.js → help-circle-BpNFkswD.js} +1 -1
- package/dist/{id-BpuE8i1h.js → id-DVghrxc8.js} +1 -1
- package/dist/{image-BLabe1u_.js → image-B9otxaOn.js} +1 -1
- package/dist/{index-B7xlfFYR.js → index-A30teLx9.js} +4 -4
- package/dist/{index-BMaOhhWB.js → index-BFyxV5IM.js} +2 -2
- package/dist/{index-X1wa5bpP.js → index-BpIbxRWS.js} +5 -5
- package/dist/{index-3TDndzHy.js → index-C4ti16FQ.js} +1 -1
- package/dist/{index-a8BP6V0o.js → index-CJbvu2rb.js} +4 -4
- package/dist/{index-lJKy2Bhi.js → index-CTGZJNEw.js} +136 -136
- package/dist/{index-BmPN76Lg.js → index-CxEZ0Yvm.js} +8 -8
- package/dist/{index-DtPZUylH.js → index-DbBzmGSg.js} +11 -11
- package/dist/{index-Bf3Fkna6.js → index-DuQELdTr.js} +10 -10
- package/dist/{index-DIsRIvWS.js → index-fiVT57xi.js} +78 -78
- package/dist/{index-C0l8Ijyj.js → index-oJZeBYfH.js} +1 -1
- package/dist/{index.es-DLS0SSoV.js → index.es-ACvqNRUv.js} +1 -1
- package/dist/{index.es-BvE3zZVY.js → index.es-CgeEFjeC.js} +2 -2
- package/dist/index.es.js +1 -1
- package/dist/{info-BROBzEn3.js → info-DKooTZg2.js} +1 -1
- package/dist/{info-circle-BhnTaYwQ.js → info-circle-Ti790Qys.js} +1 -1
- package/dist/{lightbulb-BMm8pAvQ.js → lightbulb-D1hpKqvI.js} +1 -1
- package/dist/{mail-BBH0_xPX.js → mail-CX1ISYMg.js} +1 -1
- package/dist/{mobile-BKmYB0js.js → mobile-DvLnSnxU.js} +1 -1
- package/dist/{more-BgKFZ5_N.js → more-BDqYsMER.js} +1 -1
- package/dist/{network-placeholder-Bx4Pd_VA.js → network-placeholder-BqrGYxWk.js} +1 -1
- package/dist/{nftPlaceholder-CjhjYlRs.js → nftPlaceholder-BPLi6F_i.js} +1 -1
- package/dist/{off-CNWZ7rAK.js → off-DmMES7z0.js} +1 -1
- package/dist/{play-store-CLp2fzCO.js → play-store-CtRsxrd8.js} +1 -1
- package/dist/{plus-BUG6XdxV.js → plus-Dd2dpw3r.js} +1 -1
- package/dist/{qr-code-C-JVP33d.js → qr-code-BpKmAinw.js} +1 -1
- package/dist/{recycle-horizontal-C0QxOqzM.js → recycle-horizontal-DmtC4FOF.js} +1 -1
- package/dist/{refresh-CyabrC0p.js → refresh-DTco7Ml3.js} +1 -1
- package/dist/{reown-logo-ULFpSpZD.js → reown-logo-DcZ11LCN.js} +1 -1
- package/dist/{search-CzhkDgzL.js → search-B675ucu5.js} +1 -1
- package/dist/{send-3zcoBLqV.js → send-B8uHx5xd.js} +1 -1
- package/dist/{swapHorizontal-DkBtpUHQ.js → swapHorizontal-CCzHRYwe.js} +1 -1
- package/dist/{swapHorizontalBold-CwigaZ5c.js → swapHorizontalBold-DWTNNXhE.js} +1 -1
- package/dist/{swapHorizontalMedium-CzzR3-0y.js → swapHorizontalMedium-DNSKYh0N.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-C055Y8zs.js → swapHorizontalRoundedBold-CT15U_Bs.js} +1 -1
- package/dist/{swapVertical-d-A3bfm6.js → swapVertical-DLin8Hkc.js} +1 -1
- package/dist/{telegram--pfczlkG.js → telegram-DF-iSxN1.js} +1 -1
- package/dist/{three-dots-CIEdgWJT.js → three-dots-CJPDVJmM.js} +1 -1
- package/dist/{twitch-CbcHu1ns.js → twitch-czegAr5r.js} +1 -1
- package/dist/{twitterIcon-DB90mhmN.js → twitterIcon-BULt70k5.js} +1 -1
- package/dist/{unsupportedProp-BQSrS0LI.js → unsupportedProp-B7PT0i4E.js} +1 -1
- package/dist/{useRegisterError-NuUdpWyD.js → useRegisterError-DtCN2F9V.js} +1 -1
- package/dist/{verify-C8Ud6dXo.js → verify-C_rmfozd.js} +1 -1
- package/dist/{verify-filled-CAbxeIrk.js → verify-filled-D0LZm_J5.js} +1 -1
- package/dist/{w3m-modal-7qD9ca_a.js → w3m-modal-2mTvT9A2.js} +2 -2
- package/dist/{wallet-CALjCWYW.js → wallet-NTyIGqPL.js} +1 -1
- package/dist/{wallet-placeholder-2GP-1vJb.js → wallet-placeholder-Bsw2gBaK.js} +1 -1
- package/dist/{walletconnect-BuMmu4SH.js → walletconnect-ds3vBVCr.js} +1 -1
- package/dist/{warning-circle-CNQ1oGvz.js → warning-circle-NWVxVoZ6.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-Bg_5LCup.js → x-MjpW51zN.js} +1 -1
- package/package.json +1 -1
- package/dist/AdvancedSettings-DMVTMB1Z.js +0 -60
@@ -1,17 +1,17 @@
|
|
1
1
|
import { jsxs as p, jsx as e, Fragment as J } from "react/jsx-runtime";
|
2
2
|
import ce, { useState as k, useEffect as j, useRef as L1, Suspense as e1 } from "react";
|
3
|
-
import { B as P1, i as Ee, u as
|
4
|
-
import { u as
|
5
|
-
import { C as n1, M as E1, g as r1 } from "./getChainIds-
|
6
|
-
import { useQuery as
|
3
|
+
import { B as P1, i as Ee, u as Ie, F as t1, f as $e, C as Se, W as l1 } from "./useRegisterError-DtCN2F9V.js";
|
4
|
+
import { u as l, l as pe, a as ze, c as _e, S as F1, M as M1 } from "./index-CxEZ0Yvm.js";
|
5
|
+
import { C as n1, M as E1, g as r1 } from "./getChainIds-CWu3-jMu.js";
|
6
|
+
import { useQuery as c1 } from "@tanstack/react-query";
|
7
7
|
import { useAccount as fe, useConnect as O1, useConnections as R1, useBalance as $1 } from "wagmi";
|
8
|
-
import { useDynamicContext as
|
8
|
+
import { useDynamicContext as Be, useIsLoggedIn as S1 } from "@dynamic-labs/sdk-react-core";
|
9
9
|
import { S as _1 } from "./shareicon-CG3v7iKI.js";
|
10
|
-
import { u as z1, B as V1 } from "./index-
|
10
|
+
import { u as z1, B as V1 } from "./index-BFyxV5IM.js";
|
11
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-
|
12
|
+
import { S as G1, D as K1 } from "./down-Co_636uZ.js";
|
13
13
|
import { R as J1 } from "./index-CDq3vNnP.js";
|
14
|
-
import { C as Ve, P as we, u as q1, g as o1 } from "./getCosmosAddress-
|
14
|
+
import { C as Ve, P as we, u as q1, g as o1 } from "./getCosmosAddress-CV3jkiKz.js";
|
15
15
|
function d1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ p(
|
17
17
|
"svg",
|
@@ -47,7 +47,7 @@ function d1({ fill: t }) {
|
|
47
47
|
);
|
48
48
|
}
|
49
49
|
function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
50
|
-
const [r,
|
50
|
+
const [r, c] = k(t), [b, d] = k(""), { 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(
|
@@ -128,11 +128,11 @@ 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] = k({}), o =
|
131
|
+
const [n, s] = k({}), o = l((i) => i.cosmosChainIds), { data: r } = Oe({
|
132
132
|
chainId: o,
|
133
133
|
multiChain: !0
|
134
|
-
}),
|
135
|
-
chainId: [(t == null ? void 0 : t.chainId) ||
|
134
|
+
}), c = l((i) => i.fromChain), { data: b } = b1({
|
135
|
+
chainId: [(t == null ? void 0 : t.chainId) || c.chainId],
|
136
136
|
multiChain: !0
|
137
137
|
});
|
138
138
|
async function d(i) {
|
@@ -143,8 +143,8 @@ function W1(t) {
|
|
143
143
|
}
|
144
144
|
}
|
145
145
|
return j(() => {
|
146
|
-
((t == null ? void 0 : t.networkType) == "cosmos" || (
|
147
|
-
}, [b,
|
146
|
+
((t == null ? void 0 : t.networkType) == "cosmos" || (c == null ? void 0 : c.networkType) == "cosmos") && d((t == null ? void 0 : t.chainId) || (c == null ? void 0 : c.chainId));
|
147
|
+
}, [b, c, t]), { cosmosBalance: n };
|
148
148
|
}
|
149
149
|
function w1(t) {
|
150
150
|
let n = t.split("/");
|
@@ -214,26 +214,26 @@ function et({ selectedChain: t }) {
|
|
214
214
|
] })
|
215
215
|
] });
|
216
216
|
}
|
217
|
-
const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o, showExchangeList: r, setCoinData:
|
218
|
-
var
|
219
|
-
|
220
|
-
const d =
|
217
|
+
const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o, showExchangeList: r, setCoinData: c, setChainData: b }) {
|
218
|
+
var ke, Le;
|
219
|
+
l((u) => u.searchCustomCoin);
|
220
|
+
const d = l((u) => u.setSearchCustomCoin), { ref: i, inView: g } = z1(), { getWallet: x } = Ie({}), { connected: N, address: A } = ze(), { isConnected: M, address: F } = fe(), { primaryWallet: h } = Be();
|
221
221
|
S1();
|
222
|
-
const m = x(n), T =
|
222
|
+
const m = x(n), T = l((u) => u.fromChain), y = l((u) => u.fromCoin), S = l((u) => u.toChain), _ = l((u) => u.toCoin), [te, E] = k(!1), { cosmosBalance: G } = W1(n), { defaultCoin: O } = Ee, [z, f] = k(0), C = L1(null), { data: P } = Oe({
|
223
223
|
chainId: [n.chainId],
|
224
224
|
multiChain: !0
|
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" && A || (n == null ? void 0 : n.networkType) === "cosmos" && ((
|
226
|
-
|
227
|
-
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" && A || (n == null ? void 0 : n.networkType) === "cosmos" && ((ke = P == null ? void 0 : P[n == null ? void 0 : n.chainId]) == null ? void 0 : ke.bech32Address), $ = l((u) => u.toDisconnect);
|
226
|
+
l((u) => u.setToDisconnect);
|
227
|
+
const w = l((u) => u.customWallet), I = l((u) => u.setCustomWallet), B = l((u) => u.tokens), [L, v] = k([]), [R, ne] = k([]), [Ae, W] = k([]), H = B, U = c1({
|
228
228
|
queryKey: ["balance", m == null ? void 0 : m.address, n],
|
229
229
|
queryFn: async () => await (await _e.fetchBalance(m.address, n.chainId)).json(),
|
230
230
|
enabled: !!((Le = m == null ? void 0 : m.address) != null && Le.length && n.chainId),
|
231
231
|
refetchOnWindowFocus: !1
|
232
232
|
});
|
233
233
|
function V(u) {
|
234
|
-
var
|
234
|
+
var re, oe, se, ae, K, q, ie, ee, Y, ge, X, Q;
|
235
235
|
let D = w1(u.address);
|
236
|
-
return u.networkType == "cosmos" ? $e(((
|
236
|
+
return u.networkType == "cosmos" ? $e(((re = G == null ? void 0 : G[D]) == null ? void 0 : re.amount) / Math.pow(10, u.decimals) || 0) || "" : $e((((q = (K = (ae = (se = (oe = U.data) == null ? void 0 : oe.data) == null ? void 0 : se[n == null ? void 0 : n.networkType]) == null ? void 0 : ae[n.chainId]) == null ? void 0 : K[u.address]) == null ? void 0 : q.balance) || 0) / Math.pow(10, ((Q = (X = (ge = (Y = (ee = (ie = U.data) == null ? void 0 : ie.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) || "";
|
237
237
|
}
|
238
238
|
j(() => {
|
239
239
|
s.length > 40 && Y1(s) && !R.length ? (E(!0), d({
|
@@ -243,55 +243,55 @@ const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
243
243
|
}, [s, R]), j(() => {
|
244
244
|
f(0);
|
245
245
|
}, [s]);
|
246
|
-
function
|
247
|
-
f(0),
|
246
|
+
function je() {
|
247
|
+
f(0), ne([]), C.current.scrollTo(0, 0);
|
248
248
|
}
|
249
249
|
j(() => {
|
250
250
|
var u, D;
|
251
251
|
H != null && H.isSuccess && (n != null && n.chainId) && v(((D = (u = H == null ? void 0 : H.data) == null ? void 0 : u.data) == null ? void 0 : D[n == null ? void 0 : n.chainId]) || []);
|
252
252
|
}, [H, n.chainId]), j(() => {
|
253
|
-
|
253
|
+
je();
|
254
254
|
}, [n.chainId]);
|
255
255
|
function ve() {
|
256
|
-
var
|
257
|
-
let u = (
|
258
|
-
var q,
|
259
|
-
return ((q = K.name) == null ? void 0 : q.toLowerCase().includes(s == null ? void 0 : s.toLowerCase())) || ((
|
260
|
-
})) == null ? void 0 :
|
256
|
+
var ae;
|
257
|
+
let u = (ae = L == null ? void 0 : L.filter((K) => {
|
258
|
+
var q, ie, ee, Y;
|
259
|
+
return ((q = K.name) == null ? void 0 : q.toLowerCase().includes(s == null ? void 0 : s.toLowerCase())) || ((ie = K.symbol) == null ? void 0 : ie.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 : ae.sort((K, q) => {
|
261
261
|
if (Z) return V(q) * q.lastPrice - V(K) * K.lastPrice;
|
262
|
-
}), D = 20,
|
263
|
-
z == 0 ?
|
262
|
+
}), D = 20, re = z * D, oe = re + D, se = u.slice(re, oe);
|
263
|
+
z == 0 ? ne([...se]) : ne([...R, ...se]);
|
264
264
|
}
|
265
265
|
return j(() => {
|
266
266
|
L != null && L.length && ve();
|
267
267
|
}, [L, s, z, Z, G, U.data]), j(() => {
|
268
268
|
g && f((u) => u + 1);
|
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,
|
270
|
-
var
|
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, re) => {
|
270
|
+
var oe, se, ae, K, q, ie;
|
271
271
|
return /* @__PURE__ */ p(
|
272
272
|
"div",
|
273
273
|
{
|
274
|
-
ref:
|
274
|
+
ref: re.length >= 20 && re.length - 1 === D ? i : null,
|
275
275
|
className: `bw-py-2
|
276
276
|
${r == "from" && _._id !== u._id || r == "to" && y._id !== u._id, ""}
|
277
277
|
bw-flex bw-items-center bw-justify-between bw-cursor-pointer bw-border-b bw-border-border-primary
|
278
278
|
|
279
279
|
}`,
|
280
280
|
onClick: async () => {
|
281
|
-
var Y, ge, X, Q, xe, be,
|
281
|
+
var Y, ge, X, Q, xe, be, Ne, le, ue, Pe, Te;
|
282
282
|
let ee = {
|
283
283
|
// ...coinData,
|
284
284
|
coin: u.symbol,
|
285
285
|
...u,
|
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, ((
|
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, ((Te = (Pe = (ue = (le = (Ne = (be = U.data) == null ? void 0 : be.data) == null ? void 0 : Ne[n == null ? void 0 : n.networkType]) == null ? void 0 : le[n == null ? void 0 : n.chainId]) == null ? void 0 : ue[u.address.toLowerCase()]) == null ? void 0 : Pe.asset) == null ? void 0 : Te.decimals) || 0)
|
287
287
|
};
|
288
|
-
|
288
|
+
c(ee), b(n), o(n, ee), (n == null ? void 0 : n.networkType) === (S == null ? void 0 : S.networkType) || (n == null || n.networkType, T == null || T.networkType, I(""));
|
289
289
|
},
|
290
290
|
children: [
|
291
291
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-justify-center bw-w-max bw-gap-x-2", children: [
|
292
|
-
/* @__PURE__ */ p("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(
|
293
|
-
(
|
294
|
-
(
|
292
|
+
/* @__PURE__ */ p("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(oe = u.image) != null && oe.length ? "bw-bg-background-secondary" : ""}`, children: [
|
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
|
+
(ae = n == null ? void 0 : n.image) != null && ae.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" })
|
295
295
|
] }),
|
296
296
|
/* @__PURE__ */ p("div", { children: [
|
297
297
|
/* @__PURE__ */ p("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
@@ -308,7 +308,7 @@ const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
308
308
|
/* @__PURE__ */ e(
|
309
309
|
"a",
|
310
310
|
{
|
311
|
-
href: (
|
311
|
+
href: (ie = (q = n.explorer) == null ? void 0 : q.token) == null ? void 0 : ie.replace("{tokenAddress}", u.address),
|
312
312
|
target: "_blank",
|
313
313
|
onClick: (ee) => {
|
314
314
|
ee.stopPropagation();
|
@@ -350,14 +350,14 @@ const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
350
350
|
);
|
351
351
|
}) : te && !(B.isLoading && B.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 }) }) });
|
352
352
|
});
|
353
|
-
function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coinData: r, showExchangeList:
|
353
|
+
function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coinData: r, showExchangeList: c, fetchChains: b }) {
|
354
354
|
var f, C, P, Z, $;
|
355
|
-
const [d, i] = k(!1), [g, x] = k(""), N =
|
355
|
+
const [d, i] = k(!1), [g, x] = k(""), N = l((w) => w.tokens), [A, M] = k([]), [F, h] = k(0), [m, T] = k({ chain: "" }), y = l((w) => w.gradient), S = l((w) => w.configuration), _ = l((w) => w.chainObj);
|
356
356
|
j(() => {
|
357
357
|
var w, I, B, L;
|
358
358
|
if ((I = (w = b.data) == null ? void 0 : w.data) != null && I.length) {
|
359
|
-
let v = [...(L = (B = b.data) == null ? void 0 : B.data) == null ? void 0 : L.slice(0, 9)], R = v.findIndex((V) => V.chainId === "137"),
|
360
|
-
v.splice(R, 1, _[80094] || {}), v.splice(
|
359
|
+
let v = [...(L = (B = b.data) == null ? void 0 : B.data) == null ? void 0 : L.slice(0, 9)], R = v.findIndex((V) => V.chainId === "137"), ne = v.findIndex((V) => V.chainId === "324"), Ae = v.findIndex((V) => V.chainId === "10"), W = v.findIndex((V) => V.chainId === "43114");
|
360
|
+
v.splice(R, 1, _[80094] || {}), v.splice(ne, 1, _[2741] || {}), v.splice(Ae, 1, _["eclipse-svm"] || {}), v.splice(W, 1, _[999] || {}), !!pe.keyBy(v, "chainId")[m.chainId] || (v.pop(), v.push(m)), M(v);
|
361
361
|
}
|
362
362
|
}, [_, (f = b.data) == null ? void 0 : f.data, o, m]), j(() => {
|
363
363
|
T(o);
|
@@ -393,7 +393,7 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
393
393
|
}
|
394
394
|
),
|
395
395
|
/* @__PURE__ */ p("div", { className: "bw-text-base bw-font-normal bw-text-text-secondary", children: [
|
396
|
-
|
396
|
+
c.charAt(0).toUpperCase() + c.slice(1),
|
397
397
|
" Network"
|
398
398
|
] })
|
399
399
|
] }),
|
@@ -485,7 +485,7 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
485
485
|
]
|
486
486
|
}
|
487
487
|
),
|
488
|
-
/* @__PURE__ */ e(tt, { value: g, handleClosePopup: te, showExchangeList:
|
488
|
+
/* @__PURE__ */ e(tt, { value: g, handleClosePopup: te, showExchangeList: c, setChainData: t, setCoinData: n, selectChainState: m })
|
489
489
|
] })
|
490
490
|
] });
|
491
491
|
}
|
@@ -495,10 +495,10 @@ function rt({
|
|
495
495
|
show: s,
|
496
496
|
networkType: o,
|
497
497
|
handleShowWallet: r,
|
498
|
-
setConnectWalletField:
|
498
|
+
setConnectWalletField: c
|
499
499
|
}) {
|
500
500
|
const [b, d] = k(null), { address: i, chain: g, data: x, disconnect: N, ...A } = t, [M, F] = k(), { connector: h } = fe(), { connectors: m } = O1(), T = () => {
|
501
|
-
|
501
|
+
c(s), s == "to" ? (y(), n(!0)) : y();
|
502
502
|
};
|
503
503
|
R1(), j(() => {
|
504
504
|
m.length && F(
|
@@ -521,27 +521,27 @@ function rt({
|
|
521
521
|
/* @__PURE__ */ e(
|
522
522
|
"div",
|
523
523
|
{
|
524
|
-
children: /* @__PURE__ */ e(
|
524
|
+
children: /* @__PURE__ */ e(l1, { fill: "var(--tw-text-secondary)" })
|
525
525
|
}
|
526
526
|
)
|
527
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" }) })
|
528
528
|
}
|
529
529
|
) });
|
530
530
|
}
|
531
|
-
function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConnectWalletField: o, coinData: r, show:
|
531
|
+
function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConnectWalletField: o, coinData: r, show: c }) {
|
532
532
|
var T, y, S, _, te, E, G, O, z;
|
533
|
-
const b =
|
534
|
-
|
535
|
-
const { defaultCoin: N } = Ee, { isAnyWalletConnected: A, getWallet: M } =
|
533
|
+
const b = l((f) => f.configuration), d = l((f) => f.customWallet), { isConnected: i, isConnecting: g, isReconnecting: x } = fe();
|
534
|
+
Be();
|
535
|
+
const { defaultCoin: N } = Ee, { isAnyWalletConnected: A, getWallet: M } = Ie({
|
536
536
|
chainData: t,
|
537
|
-
show:
|
537
|
+
show: c
|
538
538
|
});
|
539
|
-
|
540
|
-
const F =
|
539
|
+
l((f) => f.toDisconnect), l((f) => f.setToDisconnect);
|
540
|
+
const F = l((f) => f.fromChain), h = l((f) => f.toChain);
|
541
541
|
function m(f) {
|
542
542
|
}
|
543
543
|
return /* @__PURE__ */ p("div", { className: "bw-w-[50%] ", children: [
|
544
|
-
/* @__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: c == "from" ? "Give" : "Get" }),
|
545
545
|
/* @__PURE__ */ p(
|
546
546
|
"div",
|
547
547
|
{
|
@@ -558,7 +558,7 @@ function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConn
|
|
558
558
|
"div",
|
559
559
|
{
|
560
560
|
onClick: () => {
|
561
|
-
n(
|
561
|
+
n(c);
|
562
562
|
},
|
563
563
|
className: "bw-cursor-pointer",
|
564
564
|
children: [
|
@@ -573,12 +573,12 @@ function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConn
|
|
573
573
|
]
|
574
574
|
}
|
575
575
|
),
|
576
|
-
/* @__PURE__ */ e(ot, { isConnected:
|
576
|
+
/* @__PURE__ */ e(ot, { isConnected: c == "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) : A, setConnectWalletField: o, handleShowWallet: s, show: c, chainData: t, handleToDisconnect: m })
|
577
577
|
] });
|
578
578
|
}
|
579
|
-
function ot({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, show: o, chainData: r, handleToDisconnect:
|
579
|
+
function ot({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, show: o, chainData: r, handleToDisconnect: c }) {
|
580
580
|
var x;
|
581
|
-
const b =
|
581
|
+
const b = l((N) => N.customWallet), d = l((N) => N.fromChain), i = l((N) => N.toChain), { getWallet: g } = Ie({
|
582
582
|
chainData: r,
|
583
583
|
show: o
|
584
584
|
});
|
@@ -586,10 +586,10 @@ function ot({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, sho
|
|
586
586
|
rt,
|
587
587
|
{
|
588
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:
|
589
|
+
disconnect: c,
|
590
590
|
address: (x = g(d)) == null ? void 0 : x.address
|
591
591
|
} : g(r),
|
592
|
-
handleToDisconnect:
|
592
|
+
handleToDisconnect: c,
|
593
593
|
show: o,
|
594
594
|
networkType: r == null ? void 0 : r.networkType,
|
595
595
|
setConnectWalletField: n,
|
@@ -604,7 +604,7 @@ function ot({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, sho
|
|
604
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",
|
605
605
|
children: [
|
606
606
|
/* @__PURE__ */ e("p", { className: "bw-mr-3", children: "Connect" }),
|
607
|
-
/* @__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(l1, { fill: "var(--tw-text-secondary)" }) })
|
608
608
|
]
|
609
609
|
}
|
610
610
|
) });
|
@@ -614,7 +614,7 @@ const st = "_gradient_15zwe_1", Ze = {
|
|
614
614
|
};
|
615
615
|
function at({ mode: t, handleMode: n }) {
|
616
616
|
var o, r;
|
617
|
-
const s =
|
617
|
+
const s = l((c) => c.configuration);
|
618
618
|
return /* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center", children: /* @__PURE__ */ p(
|
619
619
|
"div",
|
620
620
|
{
|
@@ -703,19 +703,19 @@ function it({ fill: t }) {
|
|
703
703
|
);
|
704
704
|
}
|
705
705
|
function u1({ options: t, handleOptions: n }) {
|
706
|
-
var r,
|
706
|
+
var r, c;
|
707
707
|
const s = [
|
708
708
|
{ name: "Medium", value: "medium" },
|
709
709
|
{ name: "High", value: "high" },
|
710
710
|
{ name: "Degen", value: "ultra" }
|
711
|
-
], o =
|
711
|
+
], o = l((b) => b.configuration);
|
712
712
|
return /* @__PURE__ */ p("div", { className: "bw-mt-5 bw-flex bw-items-center bw-justify-between", children: [
|
713
713
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: "Speed" }),
|
714
714
|
/* @__PURE__ */ e(
|
715
715
|
"div",
|
716
716
|
{
|
717
717
|
style: {
|
718
|
-
boxShadow: o && o.customTheme && ((
|
718
|
+
boxShadow: o && o.customTheme && ((c = (r = o.customTheme) == null ? void 0 : r.shadow) == null ? void 0 : c.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
719
719
|
},
|
720
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",
|
721
721
|
children: s.map((b, d, i) => /* @__PURE__ */ p(
|
@@ -776,15 +776,15 @@ function m1(t) {
|
|
776
776
|
/^\d$/.test(t.key) || n.includes(t.key) || t.preventDefault();
|
777
777
|
}
|
778
778
|
function p1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
779
|
-
var
|
780
|
-
const r =
|
779
|
+
var c, b;
|
780
|
+
const r = l((d) => d.configuration);
|
781
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: [
|
782
782
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal", children: s }),
|
783
783
|
/* @__PURE__ */ p(
|
784
784
|
"div",
|
785
785
|
{
|
786
786
|
style: {
|
787
|
-
boxShadow: r && r.customTheme && ((b = (
|
787
|
+
boxShadow: r && r.customTheme && ((b = (c = r.customTheme) == null ? void 0 : c.shadow) == null ? void 0 : b.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
788
788
|
},
|
789
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",
|
790
790
|
children: [
|
@@ -810,8 +810,8 @@ function p1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
810
810
|
] });
|
811
811
|
}
|
812
812
|
function g1({ handleSave: t, isSaveButtonDisabled: n }) {
|
813
|
-
const s =
|
814
|
-
return
|
813
|
+
const s = l((o) => o.configuration);
|
814
|
+
return l((o) => o.slippage), /* @__PURE__ */ e(
|
815
815
|
"div",
|
816
816
|
{
|
817
817
|
style: { ...s == null ? void 0 : s.gradientStyle },
|
@@ -843,7 +843,7 @@ function f1({ handleClose: t }) {
|
|
843
843
|
}
|
844
844
|
function x1({ slippage: t, handleSlippage: n }) {
|
845
845
|
var o, r;
|
846
|
-
const s =
|
846
|
+
const s = l((c) => c.configuration);
|
847
847
|
return /* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-justify-between", children: [
|
848
848
|
/* @__PURE__ */ e("p", { className: "bw-text-lg bw-font-normal bw-text-text-primary", children: "Max Slippage" }),
|
849
849
|
/* @__PURE__ */ p(
|
@@ -858,20 +858,20 @@ function x1({ slippage: t, handleSlippage: n }) {
|
|
858
858
|
/* @__PURE__ */ e(
|
859
859
|
"input",
|
860
860
|
{
|
861
|
-
onKeyUp: (
|
862
|
-
|
861
|
+
onKeyUp: (c) => {
|
862
|
+
c.key === "Enter" && c.target.blur();
|
863
863
|
},
|
864
|
-
onFocus: (
|
865
|
-
|
864
|
+
onFocus: (c) => {
|
865
|
+
c.target.parentElement.style.border = "1px solid var(--tw-text-primary)", c.target.parentElement.style.fontWeight = 600;
|
866
866
|
},
|
867
|
-
onBlur: (
|
868
|
-
|
867
|
+
onBlur: (c) => {
|
868
|
+
c.target.parentElement.style.border = "1px solid var(--tw-border-primary)", c.target.parentElement.style.fontWeight = 400;
|
869
869
|
},
|
870
870
|
value: t,
|
871
871
|
onChange: n,
|
872
872
|
type: "number",
|
873
|
-
onKeyDown: (
|
874
|
-
m1(
|
873
|
+
onKeyDown: (c) => {
|
874
|
+
m1(c);
|
875
875
|
},
|
876
876
|
className: "bw-bg-transparent bw-border-none bw-text-text-primary bw-pl-2 bw-text-right bw-w-[80%]"
|
877
877
|
}
|
@@ -888,8 +888,8 @@ function h1() {
|
|
888
888
|
/* @__PURE__ */ e("div", { className: "bw-h-[1px] bw-flex-1 bw-bg-border-primary " })
|
889
889
|
] });
|
890
890
|
}
|
891
|
-
function
|
892
|
-
const [n, s] = k(""), [o, r] = k({ name: "Low", value: "low" }), [
|
891
|
+
function lt({ handleClose: t }) {
|
892
|
+
const [n, s] = k(""), [o, r] = k({ name: "Low", value: "low" }), [c, b] = k(""), [d, i] = k(""), [g, x] = k(""), N = l((f) => f.broadCastMode), A = l((f) => f.customFee), M = l((f) => f.setCustomFee), F = l((f) => f.slippage), h = l((f) => f.setSlippage), m = l((f) => f.setBroadCastMode), T = l((f) => f.option), y = l((f) => f.setOption), S = n == A && T.name == o.name && F == g && (d === N && d !== "" || !n.length && !T.name.length);
|
893
893
|
function _(f) {
|
894
894
|
b(""), s(f.target.value);
|
895
895
|
}
|
@@ -941,7 +941,7 @@ function ct({ handleClose: t }) {
|
|
941
941
|
}
|
942
942
|
),
|
943
943
|
/* @__PURE__ */ p("div", { className: "bw-relative", 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:
|
944
|
+
/* @__PURE__ */ e("p", { className: "bw-w-full bw-absolute bw-text-center -bw-top-5 bw-text-xs bw-text-text-redtext", children: c }),
|
945
945
|
/* @__PURE__ */ e(
|
946
946
|
g1,
|
947
947
|
{
|
@@ -952,8 +952,8 @@ function ct({ handleClose: t }) {
|
|
952
952
|
] })
|
953
953
|
] });
|
954
954
|
}
|
955
|
-
function
|
956
|
-
const [n, s] = k({ name: "Low", value: "low" }), [o, r] = k(""), [
|
955
|
+
function ct({ handleClose: t }) {
|
956
|
+
const [n, s] = k({ name: "Low", value: "low" }), [o, r] = k(""), [c, b] = k(""), d = l((y) => y.setEvmGas), i = l((y) => y.setEvmSpeed), g = l((y) => y.evmSpeed), x = l((y) => y.evmGas), N = l((y) => y.slippage), A = l((y) => y.setSlippage), M = o == x && g.name == n.name && N == c;
|
957
957
|
function F(y, S) {
|
958
958
|
s(y);
|
959
959
|
}
|
@@ -966,7 +966,7 @@ function lt({ handleClose: t }) {
|
|
966
966
|
x != null && x.length ? r(x) : r("");
|
967
967
|
}, [x]);
|
968
968
|
function m() {
|
969
|
-
o.length ? (d(o), i(n)) : (d(""), i(n)), A(
|
969
|
+
o.length ? (d(o), i(n)) : (d(""), i(n)), A(c), t();
|
970
970
|
}
|
971
971
|
j(() => {
|
972
972
|
b(N);
|
@@ -976,7 +976,7 @@ function lt({ handleClose: t }) {
|
|
976
976
|
}
|
977
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: [
|
978
978
|
/* @__PURE__ */ e(f1, { handleClose: t }),
|
979
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage:
|
979
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage: c, handleSlippage: T }) }),
|
980
980
|
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(h1, {}) }),
|
981
981
|
/* @__PURE__ */ e(u1, { options: n, handleOptions: F }),
|
982
982
|
/* @__PURE__ */ e(
|
@@ -998,7 +998,7 @@ function lt({ handleClose: t }) {
|
|
998
998
|
] });
|
999
999
|
}
|
1000
1000
|
function bt({ open: t, handleClose: n }) {
|
1001
|
-
const s =
|
1001
|
+
const s = l((r) => r.fromChain);
|
1002
1002
|
return /* @__PURE__ */ e(
|
1003
1003
|
E1,
|
1004
1004
|
{
|
@@ -1015,7 +1015,7 @@ function bt({ open: t, handleClose: n }) {
|
|
1015
1015
|
// left: "47%",
|
1016
1016
|
// transform: "translate(-50%, -50%)",
|
1017
1017
|
bgcolor: "var(--tw-bg-container)"
|
1018
|
-
}, children: s.networkType == "sol" ? /* @__PURE__ */ e(
|
1018
|
+
}, children: s.networkType == "sol" ? /* @__PURE__ */ e(lt, { handleClose: n }) : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(ct, { handleClose: n }) }) })
|
1019
1019
|
}
|
1020
1020
|
);
|
1021
1021
|
}
|
@@ -1059,7 +1059,7 @@ function dt({ fill: t }) {
|
|
1059
1059
|
);
|
1060
1060
|
}
|
1061
1061
|
function wt() {
|
1062
|
-
const t =
|
1062
|
+
const t = l((o) => o.configuration), n = t == null ? void 0 : t.headingStyles, s = (t == null ? void 0 : t.headingText) || "";
|
1063
1063
|
return s.length ? /* @__PURE__ */ e(
|
1064
1064
|
"span",
|
1065
1065
|
{
|
@@ -1077,7 +1077,7 @@ function wt() {
|
|
1077
1077
|
] });
|
1078
1078
|
}
|
1079
1079
|
function ut() {
|
1080
|
-
const t =
|
1080
|
+
const t = l((s) => s.configuration), n = t == null ? void 0 : t.headingContainerStyles;
|
1081
1081
|
return /* @__PURE__ */ e(
|
1082
1082
|
"div",
|
1083
1083
|
{
|
@@ -1110,7 +1110,7 @@ function ut() {
|
|
1110
1110
|
);
|
1111
1111
|
}
|
1112
1112
|
function mt() {
|
1113
|
-
const [t, n] = k(!1), s =
|
1113
|
+
const [t, n] = k(!1), s = l((r) => r.fromChain);
|
1114
1114
|
function o() {
|
1115
1115
|
n(!1);
|
1116
1116
|
}
|
@@ -1130,13 +1130,13 @@ function mt() {
|
|
1130
1130
|
] });
|
1131
1131
|
}
|
1132
1132
|
let i1, Fe, Ce, Me = 0;
|
1133
|
-
function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isRoutesEnabled: r, fetchBalance:
|
1134
|
-
const [b, d] = k(0), { getWallet: i } =
|
1133
|
+
function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isRoutesEnabled: r, fetchBalance: c }) {
|
1134
|
+
const [b, d] = k(0), { getWallet: i } = Ie({}), g = l((h) => h.fromChain), x = i(g), { isConnected: N } = fe();
|
1135
1135
|
j(() => {
|
1136
1136
|
t && clearInterval(Ce);
|
1137
1137
|
}, [t]), j(() => {
|
1138
1138
|
var h;
|
1139
|
-
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 && c.refetch(), s.refetch());
|
1140
1140
|
}, [b, t, r]), j(() => {
|
1141
1141
|
s.isFetching && (Me = 0);
|
1142
1142
|
}, [s.isFetching]), j(() => {
|
@@ -1157,7 +1157,7 @@ function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isR
|
|
1157
1157
|
let h = Date.now(), m = Math.round((h - i1) / 1e3);
|
1158
1158
|
o.deadline - Fe + m > o.deadline ? n((T) => {
|
1159
1159
|
var y;
|
1160
|
-
return console.log(t, "called confirm"), T || ((y = x.address) != null && y.length &&
|
1160
|
+
return console.log(t, "called confirm"), T || ((y = x.address) != null && y.length && c.refetch(), s.refetch(), d(o.deadline)), T;
|
1161
1161
|
}) : Fe && m && d(Fe - m);
|
1162
1162
|
}
|
1163
1163
|
function F() {
|
@@ -1167,20 +1167,20 @@ function pt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isR
|
|
1167
1167
|
d((h) => h <= 0 ? (Me = 0, o.deadline) : (Me++, h - 1));
|
1168
1168
|
}, 1e3), () => {
|
1169
1169
|
Ce && clearInterval(Ce);
|
1170
|
-
}), [o]),
|
1170
|
+
}), [o]), l((h) => h.timerValue), { quoteTimer: b, setQuoteTimer: d };
|
1171
1171
|
}
|
1172
1172
|
function gt(t, n, s) {
|
1173
|
-
const { primaryWallet: o } =
|
1173
|
+
const { primaryWallet: o } = Be(), [r, c] = k(0), b = async (d) => {
|
1174
1174
|
if (!o) return;
|
1175
1175
|
const i = new Ve(d || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed");
|
1176
1176
|
if (i)
|
1177
1177
|
try {
|
1178
1178
|
const g = new we(o.address);
|
1179
1179
|
i.onAccountChange(g, (A) => {
|
1180
|
-
|
1180
|
+
c(A.lamports / 1e9);
|
1181
1181
|
});
|
1182
1182
|
const N = await i.getBalance(g) / 1e9;
|
1183
|
-
|
1183
|
+
c(N), s(!1);
|
1184
1184
|
} catch (g) {
|
1185
1185
|
console.log(g), s(!1);
|
1186
1186
|
}
|
@@ -1201,12 +1201,12 @@ async function yt(t, n) {
|
|
1201
1201
|
const s = new Ve(n || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed"), o = new we(t), r = await s.getParsedTokenAccountsByOwner(o, {
|
1202
1202
|
programId: n ? ht : xt
|
1203
1203
|
});
|
1204
|
-
let
|
1204
|
+
let c = {};
|
1205
1205
|
for (const { account: b } of r.value) {
|
1206
1206
|
const d = b.data.parsed.info.mint, i = b.data.parsed.info.tokenAmount.uiAmount;
|
1207
|
-
|
1207
|
+
c[d] = i;
|
1208
1208
|
}
|
1209
|
-
return
|
1209
|
+
return c;
|
1210
1210
|
}
|
1211
1211
|
const Ct = "0000000000000000000000000000000000", vt = async (t) => {
|
1212
1212
|
try {
|
@@ -1231,10 +1231,10 @@ async function kt(t, n) {
|
|
1231
1231
|
}
|
1232
1232
|
}
|
1233
1233
|
function Nt(t, n) {
|
1234
|
-
const [s, o] = k(0), { primaryWallet: r, setPrimaryWallet:
|
1234
|
+
const [s, o] = k(0), { primaryWallet: r, setPrimaryWallet: c } = Be(), [b, d] = k(!1), i = l((w) => w.fromChain), { address: g, isConnected: x } = fe(), { address: N, isConnected: A } = ze(), M = l((w) => w.cosmosChainIds), { data: F, isConnected: h } = Oe({
|
1235
1235
|
chainId: M,
|
1236
1236
|
multiChain: !0
|
1237
|
-
}), m =
|
1237
|
+
}), m = l((w) => w.fromCoin), { data: T, isLoading: y } = $1({
|
1238
1238
|
address: g,
|
1239
1239
|
token: ft((m == null ? void 0 : m.address) || ""),
|
1240
1240
|
chainId: Number((i == null ? void 0 : i.chainId) || 0),
|
@@ -1330,26 +1330,26 @@ function Nt(t, n) {
|
|
1330
1330
|
isBalanceLoading: (i == null ? void 0 : i.networkType) == "evm" ? y : b
|
1331
1331
|
};
|
1332
1332
|
}
|
1333
|
-
const Tt = ce.lazy(() => import("./SwapAsset-
|
1333
|
+
const Tt = ce.lazy(() => import("./SwapAsset-COjdLi4Y.js")), It = ce.lazy(() => import("./InputComp-DK_7Rx6i.js")), Bt = ce.lazy(() => import("./QuotesProgress-CSOyBEYv.js")), At = ce.lazy(() => import("./TxnButton-DTr4yN0f.js")), jt = ce.lazy(() => import("./index-CJbvu2rb.js").then((t) => t.i)), Lt = ce.lazy(() => import("./index-A30teLx9.js")), Pt = ce.lazy(() => import("./LoadRoute-DZti2QMq.js")), Ft = ce.lazy(() => import("./AllRoutes-Tg2ZT76o.js")), Mt = ce.lazy(() => import("./AdvancedSettings-DiYSWU8X.js"));
|
1334
1334
|
function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
1335
1335
|
var Ke, Je, qe, Xe, Qe, Ue, Ye;
|
1336
|
-
const [o, r] = k(), [
|
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,
|
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:
|
1339
|
-
enabled:
|
1340
|
-
dependency:
|
1341
|
-
payload: [(C == null ? void 0 : C.networkType) === "cosmos" ? o1(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, $, v, Number(
|
1342
|
-
}),
|
1343
|
-
queryKey: ["balance",
|
1344
|
-
queryFn: async () => await (await _e.fetchBalance(
|
1345
|
-
enabled: !!((Ue =
|
1336
|
+
const [o, r] = k(), [c, b] = k(!1), [d, i] = k(!1), [g, x] = k(!1), [N, A] = k(!1), [M, F] = k("all"), [h, m] = k(!1), { primaryWallet: T } = Be(), { address: y } = fe(), { address: S } = ze(), { getbal: _, isBalanceLoading: te } = Nt(h), { data: E, isConnected: G } = Oe({ chainId: "cosmoshub-4" }), O = l((a) => a.persist), z = l((a) => a.setPersist), f = l((a) => a.route), C = l((a) => a.fromChain), P = l((a) => a.toChain), Z = l((a) => a.fromCoin), $ = l((a) => a.toCoin), w = l((a) => a.setFromChain), I = l((a) => a.setToChain), B = l((a) => a.setFromCoin), L = l((a) => a.setToCoin), v = l((a) => a.amount), R = l((a) => a.setAmount), ne = l((a) => a.customWallet), Ae = l((a) => a.setCosmosChainIds), W = l((a) => a.customFee), H = l((a) => a.broadCastMode), U = l((a) => a.evmGas), V = l((a) => a.evmSpeed), je = l((a) => a.slippage), ve = l((a) => a.option), ke = l((a) => a.maxAccounts), Le = l((a) => a.setCustomWallet), u = l((a) => a.setSelectedProvider), { balanceSol: D } = gt(C, h, Re), { suggestAndConnectAsync: re } = Z1(), oe = !!(v.length && C.chain.length && Z.coin.length && P.chain.length && $.coin.length && !g && N), se = l((a) => a.lite), ae = ["routes", y, C, P, Z, $, v, T == null ? void 0 : T.address, S, ne, E == null ? void 0 : E.bech32Address, W, U, V, je, H, ve.value, se, ke];
|
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, ie = 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: ie } : "", { getWallet: Y, refetch: ge } = Ie({}), { routes: X, routesData: Q, setRoutesData: xe, errorMessage: be, setErrorMessage: Ne } = q1({
|
1339
|
+
enabled: oe,
|
1340
|
+
dependency: ae,
|
1341
|
+
payload: [(C == null ? void 0 : C.networkType) === "cosmos" ? o1(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, $, v, Number(je) * 100, (ne == null ? void 0 : ne.length) > 30 ? ((qe = Y({})) == null ? void 0 : qe.address) || "" : (P == null ? void 0 : P.networkType) === "cosmos" ? o1(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, ke]
|
1342
|
+
}), le = Y(C), ue = c1({
|
1343
|
+
queryKey: ["balance", le == null ? void 0 : le.address, C],
|
1344
|
+
queryFn: async () => await (await _e.fetchBalance(le.address, C.chainId)).json(),
|
1345
|
+
enabled: !!((Ue = le == null ? void 0 : le.address) != null && Ue.length && C.chainId),
|
1346
1346
|
refetchOnWindowFocus: !1
|
1347
1347
|
}), { quoteTimer: Pe } = pt({
|
1348
1348
|
routes: X,
|
1349
1349
|
routesData: Q,
|
1350
1350
|
confirmRoute: d,
|
1351
1351
|
setConfirmRoute: i,
|
1352
|
-
isRoutesEnabled:
|
1352
|
+
isRoutesEnabled: oe,
|
1353
1353
|
fetchBalance: ue
|
1354
1354
|
});
|
1355
1355
|
j(() => {
|
@@ -1363,7 +1363,7 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1363
1363
|
}, [v]), j(() => {
|
1364
1364
|
X.isFetching && xe({});
|
1365
1365
|
}, [X.isFetching]);
|
1366
|
-
function
|
1366
|
+
function Te(a) {
|
1367
1367
|
x(a);
|
1368
1368
|
}
|
1369
1369
|
function y1() {
|
@@ -1374,11 +1374,11 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1374
1374
|
try {
|
1375
1375
|
let de = await r1();
|
1376
1376
|
if (de.length && !de.includes(a.chainId)) {
|
1377
|
-
let he = await
|
1377
|
+
let he = await re({
|
1378
1378
|
chainInfo: a,
|
1379
1379
|
walletType: H1.KEPLR
|
1380
1380
|
}), me = await ge(), ye = await r1();
|
1381
|
-
|
1381
|
+
Ae(ye);
|
1382
1382
|
}
|
1383
1383
|
} catch (de) {
|
1384
1384
|
console.log(de);
|
@@ -1387,13 +1387,13 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1387
1387
|
return;
|
1388
1388
|
}
|
1389
1389
|
function v1(a) {
|
1390
|
-
(a == null ? void 0 : a.networkType) == "cosmos" && C1(a.chainInfo), R(""),
|
1390
|
+
(a == null ? void 0 : a.networkType) == "cosmos" && C1(a.chainInfo), R(""), Ne({ error: "" }), o == "from" ? w({ ...a }) : o == "to" && I({ ...a });
|
1391
1391
|
}
|
1392
1392
|
function k1(a) {
|
1393
|
-
|
1393
|
+
Ne({ error: "" }), R(""), o == "from" ? B({ ...a }) : o == "to" && L({ ...a });
|
1394
1394
|
}
|
1395
1395
|
function He() {
|
1396
|
-
b(!
|
1396
|
+
b(!c);
|
1397
1397
|
}
|
1398
1398
|
function Ge(a) {
|
1399
1399
|
i(typeof a < "u" ? a : !d);
|
@@ -1402,7 +1402,7 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1402
1402
|
m(a);
|
1403
1403
|
}
|
1404
1404
|
function N1(a) {
|
1405
|
-
|
1405
|
+
u(a == null ? void 0 : a.provider), xe(a);
|
1406
1406
|
}
|
1407
1407
|
function T1() {
|
1408
1408
|
setTimeout(() => {
|
@@ -1426,10 +1426,10 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1426
1426
|
});
|
1427
1427
|
}
|
1428
1428
|
function A1() {
|
1429
|
-
R(""), w(P), B($), I(C), L(Z), C.networkType !== P.networkType &&
|
1429
|
+
R(""), w(P), B($), I(C), L(Z), C.networkType !== P.networkType && Le("");
|
1430
1430
|
}
|
1431
1431
|
j(() => {
|
1432
|
-
O.isHistory && f === "" && (z({ allSteps: { steps: null, currentStep: 0 }, stepData: {} }),
|
1432
|
+
O.isHistory && f === "" && (z({ allSteps: { steps: null, currentStep: 0 }, stepData: {} }), Te(!1));
|
1433
1433
|
}, [O]);
|
1434
1434
|
function j1(a) {
|
1435
1435
|
var de;
|
@@ -1442,7 +1442,7 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1442
1442
|
} else
|
1443
1443
|
return;
|
1444
1444
|
}
|
1445
|
-
return console.log(T, "confirm route"), /* @__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) ?
|
1445
|
+
return console.log(T, "confirm route"), /* @__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) ? c ? /* @__PURE__ */ e(Ft, { routes: X, handleShowAllRoutes: He, handleRoutesData: N1, convertVal: ($ == null ? void 0 : $.lastPrice) || 0, amount: v }) : o ? /* @__PURE__ */ e(nt, { chainData: o == "from" ? C : P, coinData: o == "from" ? Z : $, setChainData: v1, setCoinData: k1, handleReset: y1, showExchangeList: o, fetchBalance: ue, fetchChains: s }) : /* @__PURE__ */ p(J, { children: [
|
1446
1446
|
/* @__PURE__ */ e(mt, {}),
|
1447
1447
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
1448
1448
|
/* @__PURE__ */ e(Tt, { handleSwap: A1 }),
|
@@ -1454,12 +1454,12 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1454
1454
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Pt, { routes: X, handleShowAllRoutes: He, routesData: Q, amount: v, isRoutesEnabled: N, price: ((Q == null ? void 0 : Q.outputAmountDisplay) || "") * (($ == null ? void 0 : $.lastPrice) || 0) }) }),
|
1455
1455
|
/* @__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 : "" }),
|
1456
1456
|
/* @__PURE__ */ e(Bt, { amount: N, routes: X, routesData: Q, quoteTimer: Pe }),
|
1457
|
-
/* @__PURE__ */ e(At, { routesData: Q, handleSuccess: Re, routes: X, fetchBalancePrev: ue, amount: v, isAmountTyped: N, handleShowWallet: t, setConnectWalletField: F, handleConfirmClose: Ge, balanceSol:
|
1458
|
-
] }) : /* @__PURE__ */ e(Lt, { handleConfirmClose: Ge, amount: v, routesData: Q, resetAmount: I1, routes: X, handleStopRoute:
|
1457
|
+
/* @__PURE__ */ e(At, { routesData: Q, handleSuccess: Re, routes: X, fetchBalancePrev: ue, amount: v, isAmountTyped: N, handleShowWallet: t, setConnectWalletField: F, handleConfirmClose: Ge, balanceSol: D, getCoinBalance: _ })
|
1458
|
+
] }) : /* @__PURE__ */ e(Lt, { handleConfirmClose: Ge, amount: v, routesData: Q, resetAmount: I1, routes: X, handleStopRoute: Te, resetBalance: T1 }) }) });
|
1459
1459
|
}
|
1460
1460
|
function Ot({ fetchChains: t }) {
|
1461
1461
|
const [n, s] = k(!1), { isConnected: o } = fe();
|
1462
|
-
function r(
|
1462
|
+
function r(c) {
|
1463
1463
|
s(!n);
|
1464
1464
|
}
|
1465
1465
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|