@blockend/widget 1.0.46 → 1.0.47
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/{AllRoutes-ebEKf9Ro.js → AllRoutes-DzeVxLDj.js} +9 -9
- package/dist/{Box-CiCWnabh.js → Box-Ci2zRQrs.js} +1 -1
- package/dist/{EstGas-BVEriilK.js → EstGas-CObudv5z.js} +163 -195
- package/dist/{Grow-C6PHu0yK.js → Grow-BE3H0oa5.js} +2 -2
- package/dist/{InputComp-BXSYOI6T.js → InputComp-CJp-XwEr.js} +3 -3
- package/dist/{LoadRoute-BNZMhjBq.js → LoadRoute-eUX6vrIQ.js} +5 -5
- package/dist/QuotesProgress-DCNTk9oc.js +28 -0
- package/dist/{SwapAsset-5fGa7RI7.js → SwapAsset-Dk21ATof.js} +1 -1
- package/dist/{Tooltip-DZnPQjew.js → Tooltip-BZfJNVn-.js} +3 -3
- package/dist/{TxnButton-BmnXiTl8.js → TxnButton-DEs1au8L.js} +4 -4
- package/dist/{add-DliAEKbR.js → add-ZLHbLJJu.js} +1 -1
- package/dist/{all-wallets-9YBmSsEh.js → all-wallets-d2aKzL33.js} +1 -1
- package/dist/{app-store-cLc_fbJp.js → app-store-D64ScJNv.js} +1 -1
- package/dist/{apple-DmGlSCW4.js → apple-Du4IHASB.js} +1 -1
- package/dist/{arrow-bottom-BNKn4j5U.js → arrow-bottom-Dv2epYGz.js} +1 -1
- package/dist/{arrow-bottom-circle-CZL2vTc2.js → arrow-bottom-circle-UWVTMTVh.js} +1 -1
- package/dist/{arrow-left-D9JcV0Q-.js → arrow-left-BKfIGA7r.js} +1 -1
- package/dist/{arrow-right-DOHZnmbU.js → arrow-right-2mONf0tM.js} +1 -1
- package/dist/{arrow-top-Dyu4OO_u.js → arrow-top-X4pWUiKn.js} +1 -1
- package/dist/{bank-CtB7x5WX.js → bank-CsABCgFp.js} +1 -1
- package/dist/{basic-sgi7m0S-.js → basic-BPWB_wOx.js} +3 -3
- package/dist/{browser-CPMV76Fc.js → browser-DwbBRE2D.js} +1 -1
- package/dist/{card-DZrjJpNd.js → card-BewgfynW.js} +1 -1
- package/dist/{ccip-rz-h0ONe.js → ccip-CLnQdUd7.js} +1 -1
- package/dist/{checkmark-CO1kXDe-.js → checkmark-CQhUJTfi.js} +1 -1
- package/dist/{checkmark-bold-g1JkiOD4.js → checkmark-bold-CedqjnnO.js} +1 -1
- package/dist/{chevron-bottom-CeJz8Reo.js → chevron-bottom-DJ4X9Prx.js} +1 -1
- package/dist/{chevron-left-BcYg2UPw.js → chevron-left-DWynSM9B.js} +1 -1
- package/dist/{chevron-right-BsBn3zrb.js → chevron-right-DvWAAqhV.js} +1 -1
- package/dist/{chevron-top-CMxkT0uL.js → chevron-top-BR530r9H.js} +1 -1
- package/dist/{chrome-store-CkCy-7ku.js → chrome-store-_0c6caxN.js} +1 -1
- package/dist/{clock-DMc_CWtO.js → clock-VdAYDjqL.js} +1 -1
- package/dist/{close-CryuK1CT.js → close-CO-0N2CX.js} +1 -1
- package/dist/{coinPlaceholder-DvVl4DoH.js → coinPlaceholder-ujAsyqU0.js} +1 -1
- package/dist/{compass-D03r7VwG.js → compass-VKJy5_W5.js} +1 -1
- package/dist/{copy-DMvE_6eP.js → copy-osfd8JXZ.js} +1 -1
- package/dist/{core-DCInaJVR.js → core-B_HqNWOu.js} +3 -3
- package/dist/{cursor-95Nxz9_g.js → cursor-DpjQo7re.js} +1 -1
- package/dist/{cursor-transparent-D8DY5_j7.js → cursor-transparent-xK4CF8Hs.js} +1 -1
- package/dist/{desktop-CRGnR_c9.js → desktop-BMPBQv2t.js} +1 -1
- package/dist/{disconnect-JWp74w81.js → disconnect-Cl9LGKMz.js} +1 -1
- package/dist/{discord-BRXfeglo.js → discord-CZVHD-wp.js} +1 -1
- package/dist/{down-RANbXRSh.js → down-Ct-xismN.js} +2 -2
- package/dist/{etherscan-pfbXsPpq.js → etherscan-DdrzJHLk.js} +1 -1
- package/dist/{exclamation-triangle-BWZ21L0p.js → exclamation-triangle-CIQaYDSx.js} +1 -1
- package/dist/{extension-CmXIVuOr.js → extension-Bb_ygQH_.js} +1 -1
- package/dist/{external-link-CAybzTlO.js → external-link-Ddh7vP38.js} +1 -1
- package/dist/{facebook-DcDQpXBA.js → facebook-D6zpX69B.js} +1 -1
- package/dist/{farcaster-CGXV2sTr.js → farcaster-ifhEe-N4.js} +1 -1
- package/dist/{filters-4PzOF6Y_.js → filters-DkeDbJhM.js} +1 -1
- package/dist/{getChainIds-DHE0M6xN.js → getChainIds-B9EIXuqY.js} +2 -2
- package/dist/{getCosmosAddress-BkiMb5Ws.js → getCosmosAddress-CyskK48O.js} +4 -4
- package/dist/{github-z1VaBQpb.js → github-DBFD3-Hx.js} +1 -1
- package/dist/{google-DDDXhxRD.js → google-CoR2VD6q.js} +1 -1
- package/dist/{hamburger-x__CpQ8N.js → hamburger-Bw36etpI.js} +5 -5
- package/dist/{help-circle-Hk0xQlw5.js → help-circle-DUrhwW6n.js} +1 -1
- package/dist/{id-BPRiRQQi.js → id-Bq9kGLxW.js} +1 -1
- package/dist/{image-CZ26oTkB.js → image-m0IwqZ1Z.js} +1 -1
- package/dist/{index-Bd6WahOg.js → index-BcWL0DrD.js} +27 -46
- package/dist/{index-DSkfxRgh.js → index-BeQiCUcq.js} +4 -4
- package/dist/{index-D6p8qIoR.js → index-BsWWdDAF.js} +1 -1
- package/dist/{index-BaJGH0Wo.js → index-C-aKTD_P.js} +10 -10
- package/dist/{index-DrCKZb_R.js → index-CUx6_xcj.js} +1 -1
- package/dist/{index-D6rJMZnJ.js → index-Cdagj5-o.js} +78 -78
- package/dist/{index-DxSSO5f_.js → index-D2EfKDiV.js} +4 -4
- package/dist/{index-DA6hSPnv.js → index-DOop9kfD.js} +114 -114
- package/dist/{index-2nKvQV6S.js → index-DbRR6GNq.js} +5 -5
- package/dist/{index-ChjHLLtj.js → index-U2mQgSOl.js} +2 -2
- package/dist/{index-CAsUs2fN.js → index-ZWAnsHEz.js} +11 -11
- package/dist/{index.es-D7A4rCjT.js → index.es-BYDUqEHk.js} +2 -2
- package/dist/{index.es-9vMrGsMN.js → index.es-D8AzsbDB.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-nXKAaGnK.js → info-anm9CSBd.js} +1 -1
- package/dist/{info-circle-DBRsyv1V.js → info-circle-Cpd8vFSP.js} +1 -1
- package/dist/{lightbulb-B1ByE_z3.js → lightbulb-DPXldPzr.js} +1 -1
- package/dist/{mail-BEh53yuD.js → mail-r4sP3-4z.js} +1 -1
- package/dist/{mobile-BTInaRxp.js → mobile-D0nLhS3C.js} +1 -1
- package/dist/{more-BdkhRCT0.js → more-BKn6NMxN.js} +1 -1
- package/dist/{network-placeholder-_q940_Fj.js → network-placeholder-YBGnG39d.js} +1 -1
- package/dist/{nftPlaceholder-C_vMI1Zq.js → nftPlaceholder-B2s--N4I.js} +1 -1
- package/dist/{off-CjN7QcgJ.js → off-BMZ4jVAS.js} +1 -1
- package/dist/{play-store-D0oSbUK-.js → play-store-BjMQicZs.js} +1 -1
- package/dist/{plus-lZsdp6Eh.js → plus-CYx41gPe.js} +1 -1
- package/dist/{qr-code-CQEDt6E5.js → qr-code-Drc3pJQ_.js} +1 -1
- package/dist/{recycle-horizontal-BPR3n_8r.js → recycle-horizontal-rWs7v9lF.js} +1 -1
- package/dist/{refresh-BJkQe_FG.js → refresh-D2BcFG4j.js} +1 -1
- package/dist/{reown-logo-Bevkr0xz.js → reown-logo-wUSSdW9D.js} +1 -1
- package/dist/{search-BfGI_53c.js → search-B-YtHXtd.js} +1 -1
- package/dist/{send-CqRHFlOm.js → send-DLvL_BbY.js} +1 -1
- package/dist/{swapHorizontal-uS8nbcBj.js → swapHorizontal-D44_OZ9u.js} +1 -1
- package/dist/{swapHorizontalBold-rzZa_A7L.js → swapHorizontalBold-Cep1eyxj.js} +1 -1
- package/dist/{swapHorizontalMedium-DmxWOlid.js → swapHorizontalMedium-CwPNAHyv.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-Bh4Bsx-4.js → swapHorizontalRoundedBold-s5nQTCKq.js} +1 -1
- package/dist/{swapVertical-B30qm7WO.js → swapVertical-Bc1o38Xk.js} +1 -1
- package/dist/{telegram-CITR-rqw.js → telegram-BW1hx271.js} +1 -1
- package/dist/{three-dots-DvMlVtkk.js → three-dots-BY9EVUEH.js} +1 -1
- package/dist/{twitch-Cg70CCVs.js → twitch-Cte3S7e8.js} +1 -1
- package/dist/{twitterIcon-lUQKP1xi.js → twitterIcon-CSNk9-ke.js} +1 -1
- package/dist/{unsupportedProp-BEw61JH6.js → unsupportedProp-7kgM9Qp3.js} +1 -1
- package/dist/{useRegisterError-FSrH_Jvm.js → useRegisterError-JoAAYTsQ.js} +1 -1
- package/dist/{verify-Dr2B20vD.js → verify-D1ht4LA_.js} +1 -1
- package/dist/{verify-filled-Bc-tpntt.js → verify-filled-dnv72m5L.js} +1 -1
- package/dist/{w3m-modal-BW_yp0bM.js → w3m-modal-C6GoV_9z.js} +2 -2
- package/dist/{wallet-LyIKSgXv.js → wallet-Bprt1UAo.js} +1 -1
- package/dist/{wallet-placeholder-Dofecbxd.js → wallet-placeholder-Gxhin3eq.js} +1 -1
- package/dist/{walletconnect-CIiBCeU4.js → walletconnect-BtGZzptI.js} +1 -1
- package/dist/{warning-circle-DSqqePjX.js → warning-circle-Dg0PEAqK.js} +1 -1
- package/dist/{x-Bw4KtWr5.js → x-DvzFvpB5.js} +1 -1
- package/package.json +1 -1
- package/dist/QuotesProgress-BuNSdVaQ.js +0 -28
@@ -1,17 +1,17 @@
|
|
1
1
|
import { jsxs as u, jsx as e, Fragment as K } from "react/jsx-runtime";
|
2
2
|
import de, { useState as N, useEffect as B, useRef as B1, Suspense as A1 } from "react";
|
3
|
-
import { B as j1, i as Ee, u as ke, F as De, f as $e, C as _e, W as i1 } from "./useRegisterError-
|
4
|
-
import { u as l, l as pe, a as a1, c as Ve, S as P1, M as L1 } from "./index-
|
5
|
-
import { C as e1, M as F1, g as t1 } from "./getChainIds-
|
3
|
+
import { B as j1, i as Ee, u as ke, F as De, f as $e, C as _e, W as i1 } from "./useRegisterError-JoAAYTsQ.js";
|
4
|
+
import { u as l, l as pe, a as a1, c as Ve, S as P1, M as L1 } from "./index-BcWL0DrD.js";
|
5
|
+
import { C as e1, M as F1, g as t1 } from "./getChainIds-B9EIXuqY.js";
|
6
6
|
import { useQuery as l1 } from "@tanstack/react-query";
|
7
7
|
import { useAccount as ge, useConnect as M1, useConnections as E1, useBalance as O1 } from "wagmi";
|
8
8
|
import { useDynamicContext as Ne, useIsLoggedIn as R1, useUserWallets as $1 } from "@dynamic-labs/sdk-react-core";
|
9
9
|
import { S as _1 } from "./shareicon-CG3v7iKI.js";
|
10
|
-
import { u as V1, B as z1 } from "./index-
|
10
|
+
import { u as V1, B as z1 } from "./index-U2mQgSOl.js";
|
11
11
|
import { useAccount as Oe, useStargateClient as c1, useSuggestChainAndConnect as S1, WalletType as Z1 } from "graz";
|
12
|
-
import { S as H1, D as G1 } from "./down-
|
12
|
+
import { S as H1, D as G1 } from "./down-Ct-xismN.js";
|
13
13
|
import { R as K1 } from "./index-CDq3vNnP.js";
|
14
|
-
import { C as ze, P as be, u as J1, g as n1 } from "./getCosmosAddress-
|
14
|
+
import { C as ze, P as be, u as J1, g as n1 } from "./getCosmosAddress-CyskK48O.js";
|
15
15
|
function b1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ u(
|
17
17
|
"svg",
|
@@ -47,7 +47,7 @@ function b1({ fill: t }) {
|
|
47
47
|
);
|
48
48
|
}
|
49
49
|
function q1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
50
|
-
const [r, c] = N(t), [b,
|
50
|
+
const [r, c] = N(t), [b, w] = N(""), { tick: a, defaultCoin: p } = Ee;
|
51
51
|
return /* @__PURE__ */ u("div", { children: [
|
52
52
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
53
53
|
/* @__PURE__ */ e(
|
@@ -78,7 +78,7 @@ function q1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
|
78
78
|
type: "text",
|
79
79
|
value: b,
|
80
80
|
onChange: (f) => {
|
81
|
-
|
81
|
+
w(f.target.value);
|
82
82
|
},
|
83
83
|
className: `bw-text-sm bw-px-2 bw-w-full bw-h-[34px] ${b.length ? "bw-border-0 bw-border-transparent" : "bw-border bw-border-border-primary"} bw-rounded-[5px] bw-font-normal bw-bg-background-container placeholder:bw-text-text-placeholder bw-text-text-primary`,
|
84
84
|
placeholder: "Search Network"
|
@@ -135,7 +135,7 @@ function U1(t) {
|
|
135
135
|
chainId: [(t == null ? void 0 : t.chainId) || c.chainId],
|
136
136
|
multiChain: !0
|
137
137
|
});
|
138
|
-
async function
|
138
|
+
async function w(a) {
|
139
139
|
var p, f;
|
140
140
|
if ((p = r == null ? void 0 : r[a]) != null && p.bech32Address && b) {
|
141
141
|
let T = await (b[a] || b).getAllBalances(
|
@@ -145,7 +145,7 @@ function U1(t) {
|
|
145
145
|
}
|
146
146
|
}
|
147
147
|
return B(() => {
|
148
|
-
((t == null ? void 0 : t.networkType) == "cosmos" || (c == null ? void 0 : c.networkType) == "cosmos") &&
|
148
|
+
((t == null ? void 0 : t.networkType) == "cosmos" || (c == null ? void 0 : c.networkType) == "cosmos") && w((t == null ? void 0 : t.chainId) || (c == null ? void 0 : c.chainId));
|
149
149
|
}, [b, c, t]), { cosmosBalance: n };
|
150
150
|
}
|
151
151
|
function d1(t) {
|
@@ -218,30 +218,30 @@ function D1({ selectedChain: t }) {
|
|
218
218
|
}
|
219
219
|
const et = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s, showExchangeList: r, setCoinData: c, setChainData: b }) {
|
220
220
|
var Be, Ae;
|
221
|
-
l((
|
222
|
-
const
|
221
|
+
l((d) => d.searchCustomCoin);
|
222
|
+
const w = l((d) => d.setSearchCustomCoin), { ref: a, inView: p } = V1(), { getWallet: f } = ke({}), { connected: I, address: T } = a1(), { isConnected: P, address: h } = ge(), { primaryWallet: y } = Ne();
|
223
223
|
R1();
|
224
|
-
const C = f(n), A = l((
|
224
|
+
const C = f(n), A = l((d) => d.fromChain), v = l((d) => d.fromCoin), Z = l((d) => d.toChain), H = l((d) => d.toCoin), [ne, L] = N(!1), { cosmosBalance: R } = U1(n), { defaultCoin: _ } = Ee, [J, g] = N(0), m = B1(null), { data: k } = Oe({
|
225
225
|
chainId: [n.chainId],
|
226
226
|
multiChain: !0
|
227
|
-
}), M = (n == null ? void 0 : n.networkType) === "evm" && h || (n == null ? void 0 : n.networkType) === "sol" && (y == null ? void 0 : y.address) || (n == null ? void 0 : n.networkType) === "tron" && T || (n == null ? void 0 : n.networkType) === "cosmos" && ((Be = k == null ? void 0 : k[n == null ? void 0 : n.chainId]) == null ? void 0 : Be.bech32Address), F = l((
|
228
|
-
l((
|
229
|
-
const x = l((
|
227
|
+
}), M = (n == null ? void 0 : n.networkType) === "evm" && h || (n == null ? void 0 : n.networkType) === "sol" && (y == null ? void 0 : y.address) || (n == null ? void 0 : n.networkType) === "tron" && T || (n == null ? void 0 : n.networkType) === "cosmos" && ((Be = k == null ? void 0 : k[n == null ? void 0 : n.chainId]) == null ? void 0 : Be.bech32Address), F = l((d) => d.toDisconnect);
|
228
|
+
l((d) => d.setToDisconnect);
|
229
|
+
const x = l((d) => d.customWallet), O = l((d) => d.setCustomWallet), $ = l((d) => d.tokens), [E, j] = N([]), [V, ie] = N([]), [Te, Y] = N([]), G = $, Q = l1({
|
230
230
|
queryKey: ["balance", C == null ? void 0 : C.address, n],
|
231
231
|
queryFn: async () => await (await Ve.fetchBalance(C.address, n.chainId)).json(),
|
232
232
|
enabled: !!((Ae = C == null ? void 0 : C.address) != null && Ae.length && n.chainId),
|
233
233
|
refetchOnWindowFocus: !1
|
234
234
|
});
|
235
|
-
function z(
|
236
|
-
var
|
237
|
-
let D = d1(
|
238
|
-
return
|
235
|
+
function z(d) {
|
236
|
+
var re, le, oe, se, q, W, U, ee, S, X, ce, te;
|
237
|
+
let D = d1(d.address);
|
238
|
+
return d.networkType == "cosmos" ? $e(((re = R == null ? void 0 : R[D]) == null ? void 0 : re.amount) / Math.pow(10, d.decimals) || 0) || "" : $e((((W = (q = (se = (oe = (le = Q.data) == null ? void 0 : le.data) == null ? void 0 : oe[n == null ? void 0 : n.networkType]) == null ? void 0 : se[n.chainId]) == null ? void 0 : q[d.address]) == null ? void 0 : W.balance) || 0) / Math.pow(10, ((te = (ce = (X = (S = (ee = (U = Q.data) == null ? void 0 : U.data) == null ? void 0 : ee[n == null ? void 0 : n.networkType]) == null ? void 0 : S[n.chainId]) == null ? void 0 : X[d.address]) == null ? void 0 : ce.asset) == null ? void 0 : te.decimals) || 0) || 0) || "";
|
239
239
|
}
|
240
240
|
B(() => {
|
241
|
-
o.length > 40 && W1(o) && !V.length ? (L(!0),
|
241
|
+
o.length > 40 && W1(o) && !V.length ? (L(!0), w({
|
242
242
|
chainId: n.chainId,
|
243
243
|
address: o
|
244
|
-
})) : o.length || (L(!1),
|
244
|
+
})) : o.length || (L(!1), w({ chainId: "", address: "" }));
|
245
245
|
}, [o, V]), B(() => {
|
246
246
|
g(0);
|
247
247
|
}, [o]);
|
@@ -249,71 +249,71 @@ const et = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s
|
|
249
249
|
g(0), ie([]), m.current.scrollTo(0, 0);
|
250
250
|
}
|
251
251
|
B(() => {
|
252
|
-
var
|
253
|
-
G != null && G.isSuccess && (n != null && n.chainId) && j(((D = (
|
252
|
+
var d, D;
|
253
|
+
G != null && G.isSuccess && (n != null && n.chainId) && j(((D = (d = G == null ? void 0 : G.data) == null ? void 0 : d.data) == null ? void 0 : D[n == null ? void 0 : n.chainId]) || []);
|
254
254
|
}, [G, n.chainId]), B(() => {
|
255
255
|
Ie();
|
256
256
|
}, [n.chainId]);
|
257
257
|
function ye() {
|
258
258
|
var se;
|
259
|
-
let
|
260
|
-
var W, U,
|
261
|
-
return ((W = q.name) == null ? void 0 : W.toLowerCase().includes(o == null ? void 0 : o.toLowerCase())) || ((U = q.symbol) == null ? void 0 : U.toLowerCase().includes(o == null ? void 0 : o.toLowerCase())) || ((S = (
|
259
|
+
let d = (se = E == null ? void 0 : E.filter((q) => {
|
260
|
+
var W, U, ee, S;
|
261
|
+
return ((W = q.name) == null ? void 0 : W.toLowerCase().includes(o == null ? void 0 : o.toLowerCase())) || ((U = q.symbol) == null ? void 0 : U.toLowerCase().includes(o == null ? void 0 : o.toLowerCase())) || ((S = (ee = q.address) == null ? void 0 : ee.toLowerCase()) == null ? void 0 : S.includes(o == null ? void 0 : o.toLowerCase()));
|
262
262
|
})) == null ? void 0 : se.sort((q, W) => {
|
263
263
|
if (M) return z(W) * W.lastPrice - z(q) * q.lastPrice;
|
264
|
-
}), D = 20,
|
264
|
+
}), D = 20, re = J * D, le = re + D, oe = d.slice(re, le);
|
265
265
|
J == 0 ? ie([...oe]) : ie([...V, ...oe]);
|
266
266
|
}
|
267
267
|
return B(() => {
|
268
268
|
E != null && E.length && ye();
|
269
269
|
}, [E, o, J, M, R, Q.data]), B(() => {
|
270
|
-
p && g((
|
271
|
-
}, [p]), /* @__PURE__ */ e("div", { ref: m, className: " bw-h-[200px] bw-pr-2 md:bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children: V && (V == null ? void 0 : V.length) > 0 ? V == null ? void 0 : V.map((
|
270
|
+
p && g((d) => d + 1);
|
271
|
+
}, [p]), /* @__PURE__ */ e("div", { ref: m, className: " bw-h-[200px] bw-pr-2 md:bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children: V && (V == null ? void 0 : V.length) > 0 ? V == null ? void 0 : V.map((d, D, re) => {
|
272
272
|
var le, oe, se, q, W, U;
|
273
273
|
return /* @__PURE__ */ u(
|
274
274
|
"div",
|
275
275
|
{
|
276
|
-
ref:
|
276
|
+
ref: re.length >= 20 && re.length - 1 === D ? a : null,
|
277
277
|
className: `bw-py-2
|
278
|
-
${r == "from" && H._id !==
|
278
|
+
${r == "from" && H._id !== d._id || r == "to" && v._id !== d._id, ""}
|
279
279
|
bw-flex bw-items-center bw-justify-between bw-cursor-pointer bw-border-b bw-border-border-primary
|
280
280
|
|
281
281
|
}`,
|
282
282
|
onClick: async () => {
|
283
|
-
var S, X, ce,
|
284
|
-
let
|
283
|
+
var S, X, ce, te, Ce, ae, we, je, ve, Pe, Le;
|
284
|
+
let ee = {
|
285
285
|
// ...coinData,
|
286
|
-
coin:
|
287
|
-
...
|
288
|
-
availBal: ((Ce = (
|
286
|
+
coin: d.symbol,
|
287
|
+
...d,
|
288
|
+
availBal: ((Ce = (te = (ce = (X = (S = Q.data) == null ? void 0 : S.data) == null ? void 0 : X[n == null ? void 0 : n.networkType]) == null ? void 0 : ce[n.chainId]) == null ? void 0 : te[d.address.toLowerCase()]) == null ? void 0 : Ce.balance) / Math.pow(10, ((Le = (Pe = (ve = (je = (we = (ae = Q.data) == null ? void 0 : ae.data) == null ? void 0 : we[n == null ? void 0 : n.networkType]) == null ? void 0 : je[n == null ? void 0 : n.chainId]) == null ? void 0 : ve[d.address.toLowerCase()]) == null ? void 0 : Pe.asset) == null ? void 0 : Le.decimals) || 0)
|
289
289
|
};
|
290
|
-
c(
|
290
|
+
c(ee), b(n), s(n, ee), (n == null ? void 0 : n.networkType) === (Z == null ? void 0 : Z.networkType) || (n == null || n.networkType, A == null || A.networkType, O(""));
|
291
291
|
},
|
292
292
|
children: [
|
293
293
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-items-center bw-justify-center bw-w-max bw-gap-x-2", children: [
|
294
|
-
/* @__PURE__ */ u("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(le =
|
295
|
-
(oe =
|
294
|
+
/* @__PURE__ */ u("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(le = d.image) != null && le.length ? "bw-bg-background-secondary" : ""}`, children: [
|
295
|
+
(oe = d.image) != null && oe.length ? /* @__PURE__ */ e("img", { src: d.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: _, className: "bw-rounded-[50%]", width: 30, height: 30, alt: "img" }),
|
296
296
|
(se = n == null ? void 0 : n.image) != null && se.length ? /* @__PURE__ */ e("img", { src: n.image, className: `bw-absolute ${(q = n == null ? void 0 : n.image) != null && q.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: _, 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
297
|
] }),
|
298
298
|
/* @__PURE__ */ u("div", { children: [
|
299
299
|
/* @__PURE__ */ u("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
300
300
|
/* @__PURE__ */ u("span", { className: "bw-font-bold bw-text-text-primary", children: [
|
301
|
-
|
301
|
+
d.symbol || "",
|
302
302
|
" "
|
303
303
|
] }),
|
304
|
-
|
304
|
+
d.name
|
305
305
|
] }),
|
306
306
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-items-center bw-gap-x-2", children: [
|
307
307
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-secondary", children: n.name }),
|
308
308
|
/* @__PURE__ */ u("div", { className: "bw-bg-background-networkcard bw-flex bw-items-center bw-gap-x-2 bw-px-2", children: [
|
309
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-secondary", children:
|
309
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-secondary", children: d != null && d.address ? d.address.substring(0, 6) + "..." + d.address.substring(d.address.length - 6, d.address.length) : "" }),
|
310
310
|
/* @__PURE__ */ e(
|
311
311
|
"a",
|
312
312
|
{
|
313
|
-
href: (U = (W = n.explorer) == null ? void 0 : W.token) == null ? void 0 : U.replace("{tokenAddress}",
|
313
|
+
href: (U = (W = n.explorer) == null ? void 0 : W.token) == null ? void 0 : U.replace("{tokenAddress}", d.address),
|
314
314
|
target: "_blank",
|
315
|
-
onClick: (
|
316
|
-
|
315
|
+
onClick: (ee) => {
|
316
|
+
ee.stopPropagation();
|
317
317
|
},
|
318
318
|
className: "hover:bw-opacity-70",
|
319
319
|
children: /* @__PURE__ */ e(_1, { fill: "var(--tw-text-secondary)" })
|
@@ -323,22 +323,22 @@ const et = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s
|
|
323
323
|
] })
|
324
324
|
] })
|
325
325
|
] }),
|
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" && x && ((x == null ? void 0 : x.length) > 30 || F) ? /* @__PURE__ */ e(K, {}) : Q.isFetching ? /* @__PURE__ */ e(_e, { size: 12, thickness: 4, color: "inherit" }) : M ? z(
|
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" && x && ((x == null ? void 0 : x.length) > 30 || F) ? /* @__PURE__ */ e(K, {}) : Q.isFetching ? /* @__PURE__ */ e(_e, { size: 12, thickness: 4, color: "inherit" }) : M ? z(d) > 0 ? /* @__PURE__ */ u(K, { children: [
|
327
327
|
/* @__PURE__ */ e(
|
328
328
|
De,
|
329
329
|
{
|
330
|
-
value: z(
|
330
|
+
value: z(d) || "",
|
331
331
|
options: {
|
332
332
|
maxDecimals: 10
|
333
333
|
}
|
334
334
|
}
|
335
335
|
),
|
336
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: z(
|
336
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: z(d) * d.lastPrice > 0 ? /* @__PURE__ */ u(K, { children: [
|
337
337
|
"$",
|
338
338
|
/* @__PURE__ */ e(
|
339
339
|
De,
|
340
340
|
{
|
341
|
-
value: $e(z(
|
341
|
+
value: $e(z(d) * d.lastPrice),
|
342
342
|
options: {
|
343
343
|
maxDecimals: 10
|
344
344
|
}
|
@@ -350,11 +350,11 @@ const et = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s
|
|
350
350
|
},
|
351
351
|
D
|
352
352
|
);
|
353
|
-
}) :
|
353
|
+
}) : ne && !($.isLoading && $.isFetching) ? /* @__PURE__ */ e(D1, { selectedChain: n }) : !o.length && /* @__PURE__ */ e("div", { className: "bw-w-full bw-flex bw-justify-center bw-mt-4 bw-text-text-primary", children: /* @__PURE__ */ e(_e, { color: "inherit", size: 30 }) }) });
|
354
354
|
});
|
355
355
|
function tt({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coinData: r, showExchangeList: c, fetchChains: b }) {
|
356
356
|
var g, m, k, M, F;
|
357
|
-
const [
|
357
|
+
const [w, a] = N(!1), [p, f] = N(""), I = l((x) => x.tokens), [T, P] = N([]), [h, y] = N(0), [C, A] = N({ chain: "" }), v = l((x) => x.gradient), Z = l((x) => x.configuration), H = l((x) => x.chainObj);
|
358
358
|
B(() => {
|
359
359
|
var x, O, $, E;
|
360
360
|
if ((O = (x = b.data) == null ? void 0 : x.data) != null && O.length) {
|
@@ -370,7 +370,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
370
370
|
y(E.length);
|
371
371
|
}
|
372
372
|
}, [(m = b.data) == null ? void 0 : m.data]);
|
373
|
-
function
|
373
|
+
function ne(x, O) {
|
374
374
|
var $, E;
|
375
375
|
($ = x.chain) != null && $.length && ((E = O == null ? void 0 : O.coin) != null && E.length) && o();
|
376
376
|
}
|
@@ -381,7 +381,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
381
381
|
A(x), f("");
|
382
382
|
}
|
383
383
|
const { tick: _, defaultCoin: J } = Ee;
|
384
|
-
return
|
384
|
+
return w ? /* @__PURE__ */ e(q1, { handleSetChainData: R, data: (k = b.data) == null ? void 0 : k.data, handleBack: L, network: C }) : /* @__PURE__ */ u(K, { children: [
|
385
385
|
/* @__PURE__ */ u("div", { children: [
|
386
386
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
387
387
|
/* @__PURE__ */ e(
|
@@ -487,7 +487,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
487
487
|
]
|
488
488
|
}
|
489
489
|
),
|
490
|
-
/* @__PURE__ */ e(et, { value: p, handleClosePopup:
|
490
|
+
/* @__PURE__ */ e(et, { value: p, handleClosePopup: ne, showExchangeList: c, setChainData: t, setCoinData: n, selectChainState: C })
|
491
491
|
] })
|
492
492
|
] });
|
493
493
|
}
|
@@ -499,7 +499,7 @@ function nt({
|
|
499
499
|
handleShowWallet: r,
|
500
500
|
setConnectWalletField: c
|
501
501
|
}) {
|
502
|
-
const [b,
|
502
|
+
const [b, w] = N(null), { address: a, chain: p, data: f, disconnect: I, ...T } = t, [P, h] = N(), { connector: y } = ge(), { connectors: C } = M1(), A = () => {
|
503
503
|
c(o), o == "to" ? (v(), n(!0)) : v();
|
504
504
|
};
|
505
505
|
E1(), B(() => {
|
@@ -531,8 +531,8 @@ function nt({
|
|
531
531
|
) });
|
532
532
|
}
|
533
533
|
function o1({ chainData: t, setShowExchangeList: n, handleShowWallet: o, setConnectWalletField: s, coinData: r, show: c }) {
|
534
|
-
var A, v, Z, H,
|
535
|
-
const b = l((g) => g.configuration),
|
534
|
+
var A, v, Z, H, ne, L, R, _, J;
|
535
|
+
const b = l((g) => g.configuration), w = l((g) => g.customWallet), { isConnected: a, isConnecting: p, isReconnecting: f } = ge();
|
536
536
|
Ne();
|
537
537
|
const { defaultCoin: I } = Ee, { isAnyWalletConnected: T, getWallet: P } = ke({
|
538
538
|
chainData: t,
|
@@ -568,28 +568,28 @@ function o1({ chainData: t, setShowExchangeList: n, handleShowWallet: o, setConn
|
|
568
568
|
(Z = r == null ? void 0 : r.coin) != null && Z.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
569
|
/* @__PURE__ */ e(G1, { fill: (H = r == null ? void 0 : r.coin) != null && H.length ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" })
|
570
570
|
] }),
|
571
|
-
(
|
571
|
+
(ne = t == null ? void 0 : t.chain) != null && ne.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
572
|
]
|
573
573
|
}
|
574
574
|
)
|
575
575
|
]
|
576
576
|
}
|
577
577
|
),
|
578
|
-
/* @__PURE__ */ e(rt, { isConnected: c == "to" ? (h == null ? void 0 : h.networkType) === (y == null ? void 0 : y.networkType) ? !!((R = (L = P(h)) == null ? void 0 : L.address) != null && R.length || (
|
578
|
+
/* @__PURE__ */ e(rt, { isConnected: c == "to" ? (h == null ? void 0 : h.networkType) === (y == null ? void 0 : y.networkType) ? !!((R = (L = P(h)) == null ? void 0 : L.address) != null && R.length || (w == null ? void 0 : w.length) > 30) : !!((J = (_ = P(y)) == null ? void 0 : _.address) != null && J.length || (w == null ? void 0 : w.length) > 30) : T, setConnectWalletField: s, handleShowWallet: o, show: c, chainData: t, handleToDisconnect: C })
|
579
579
|
] });
|
580
580
|
}
|
581
581
|
function rt({ isConnected: t, setConnectWalletField: n, handleShowWallet: o, show: s, chainData: r, handleToDisconnect: c }) {
|
582
582
|
var f;
|
583
|
-
const b = l((I) => I.customWallet),
|
583
|
+
const b = l((I) => I.customWallet), w = l((I) => I.fromChain), a = l((I) => I.toChain), { getWallet: p } = ke({
|
584
584
|
chainData: r,
|
585
585
|
show: s
|
586
586
|
});
|
587
587
|
return /* @__PURE__ */ e("div", { className: "bw-mt-2 bw-flex bw-justify-end", children: t ? /* @__PURE__ */ e(
|
588
588
|
nt,
|
589
589
|
{
|
590
|
-
walletDetails: (b == null ? void 0 : b.length) > 30 && s == "to" ? p({}) : (
|
590
|
+
walletDetails: (b == null ? void 0 : b.length) > 30 && s == "to" ? p({}) : (w == null ? void 0 : w.networkType) == (a == null ? void 0 : a.networkType) && s == "to" ? {
|
591
591
|
disconnect: c,
|
592
|
-
address: (f = p(
|
592
|
+
address: (f = p(w)) == null ? void 0 : f.address
|
593
593
|
} : p(r),
|
594
594
|
handleToDisconnect: c,
|
595
595
|
show: s,
|
@@ -720,7 +720,7 @@ function w1({ options: t, handleOptions: n }) {
|
|
720
720
|
boxShadow: s && s.customTheme && ((c = (r = s.customTheme) == null ? void 0 : r.shadow) == null ? void 0 : c.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
721
721
|
},
|
722
722
|
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",
|
723
|
-
children: o.map((b,
|
723
|
+
children: o.map((b, w, a) => /* @__PURE__ */ u(
|
724
724
|
"button",
|
725
725
|
{
|
726
726
|
onClick: () => {
|
@@ -743,7 +743,7 @@ function w1({ options: t, handleOptions: n }) {
|
|
743
743
|
children: b.name
|
744
744
|
}
|
745
745
|
),
|
746
|
-
a.length - 1 !==
|
746
|
+
a.length - 1 !== w && /* @__PURE__ */ e("div", { className: "bw-h-[70%] bw-absolute bw-right-0 bw-w-[1px] bw-border bw-border-border-primary" }),
|
747
747
|
/* @__PURE__ */ e(
|
748
748
|
"div",
|
749
749
|
{
|
@@ -779,7 +779,7 @@ function u1(t) {
|
|
779
779
|
}
|
780
780
|
function m1({ inputVal: t, handleCustomVal: n, title: o, inputSideText: s }) {
|
781
781
|
var c, b;
|
782
|
-
const r = l((
|
782
|
+
const r = l((w) => w.configuration);
|
783
783
|
return /* @__PURE__ */ u("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: [
|
784
784
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal", children: o }),
|
785
785
|
/* @__PURE__ */ u(
|
@@ -797,8 +797,8 @@ function m1({ inputVal: t, handleCustomVal: n, title: o, inputSideText: s }) {
|
|
797
797
|
className: "bw-bg-transparent bw-border-none bw-text-text-primary bw-text-xl bw-font-medium bw-pl-3 bw-pr-2 bw-w-[80%] bw-h-full bw-text-right",
|
798
798
|
value: t,
|
799
799
|
onChange: n,
|
800
|
-
onKeyDown: (
|
801
|
-
u1(
|
800
|
+
onKeyDown: (w) => {
|
801
|
+
u1(w);
|
802
802
|
}
|
803
803
|
}
|
804
804
|
),
|
@@ -891,11 +891,11 @@ function f1() {
|
|
891
891
|
] });
|
892
892
|
}
|
893
893
|
function at({ handleClose: t }) {
|
894
|
-
const [n, o] = N(""), [s, r] = N({ name: "Low", value: "low" }), [c, b] = N(""), [
|
894
|
+
const [n, o] = N(""), [s, r] = N({ name: "Low", value: "low" }), [c, b] = N(""), [w, a] = N(""), [p, f] = N(""), I = l((g) => g.broadCastMode), T = l((g) => g.customFee), P = l((g) => g.setCustomFee), h = l((g) => g.slippage), y = l((g) => g.setSlippage), C = l((g) => g.setBroadCastMode), A = l((g) => g.option), v = l((g) => g.setOption), Z = n == T && A.name == s.name && h == p && (w === I && w !== "" || !n.length && !A.name.length);
|
895
895
|
function H(g) {
|
896
896
|
b(""), o(g.target.value);
|
897
897
|
}
|
898
|
-
function
|
898
|
+
function ne(g, m) {
|
899
899
|
b(""), r(g);
|
900
900
|
}
|
901
901
|
B(() => {
|
@@ -916,11 +916,11 @@ function at({ handleClose: t }) {
|
|
916
916
|
a(I);
|
917
917
|
}, [I]);
|
918
918
|
function _() {
|
919
|
-
if (
|
919
|
+
if (w == "" && (n.length || s.name.length)) {
|
920
920
|
C(""), b("Please select a mode");
|
921
921
|
return;
|
922
922
|
}
|
923
|
-
n.length ? (P(n), v(s)) : (P(""), L()), C(
|
923
|
+
n.length ? (P(n), v(s)) : (P(""), L()), C(w), y(p), t();
|
924
924
|
}
|
925
925
|
function J(g) {
|
926
926
|
b(""), a(g);
|
@@ -931,8 +931,8 @@ function at({ handleClose: t }) {
|
|
931
931
|
/* @__PURE__ */ e(g1, { handleClose: t }),
|
932
932
|
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage: p, handleSlippage: R }) }),
|
933
933
|
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(f1, {}) }),
|
934
|
-
/* @__PURE__ */ e(st, { mode:
|
935
|
-
/* @__PURE__ */ e(w1, { options: s, handleOptions:
|
934
|
+
/* @__PURE__ */ e(st, { mode: w, handleMode: J }),
|
935
|
+
/* @__PURE__ */ e(w1, { options: s, handleOptions: ne }),
|
936
936
|
/* @__PURE__ */ e(
|
937
937
|
m1,
|
938
938
|
{
|
@@ -955,7 +955,7 @@ function at({ handleClose: t }) {
|
|
955
955
|
] });
|
956
956
|
}
|
957
957
|
function lt({ handleClose: t }) {
|
958
|
-
const [n, o] = N({ name: "Low", value: "low" }), [s, r] = N(""), [c, b] = N(""),
|
958
|
+
const [n, o] = N({ name: "Low", value: "low" }), [s, r] = N(""), [c, b] = N(""), w = l((v) => v.setEvmGas), a = l((v) => v.setEvmSpeed), p = l((v) => v.evmSpeed), f = l((v) => v.evmGas), I = l((v) => v.slippage), T = l((v) => v.setSlippage), P = s == f && p.name == n.name && I == c;
|
959
959
|
function h(v, Z) {
|
960
960
|
o(v);
|
961
961
|
}
|
@@ -968,7 +968,7 @@ function lt({ handleClose: t }) {
|
|
968
968
|
f != null && f.length ? r(f) : r("");
|
969
969
|
}, [f]);
|
970
970
|
function C() {
|
971
|
-
s.length ? (
|
971
|
+
s.length ? (w(s), a(n)) : (w(""), a(n)), T(c), t();
|
972
972
|
}
|
973
973
|
B(() => {
|
974
974
|
b(I);
|
@@ -1133,7 +1133,7 @@ function ut() {
|
|
1133
1133
|
}
|
1134
1134
|
let s1, Fe, he, Me = 0;
|
1135
1135
|
function mt({ confirmRoute: t, setConfirmRoute: n, routes: o, routesData: s, isRoutesEnabled: r, fetchBalance: c }) {
|
1136
|
-
const [b,
|
1136
|
+
const [b, w] = N(0), { getWallet: a } = ke({}), p = l((y) => y.fromChain), f = a(p), { isConnected: I } = ge();
|
1137
1137
|
B(() => {
|
1138
1138
|
t && clearInterval(he);
|
1139
1139
|
}, [t]), B(() => {
|
@@ -1144,37 +1144,37 @@ function mt({ confirmRoute: t, setConfirmRoute: n, routes: o, routesData: s, isR
|
|
1144
1144
|
}, [o.isFetching]), B(() => {
|
1145
1145
|
if (!pe.isEmpty(s)) {
|
1146
1146
|
const y = Math.max(0, s.deadline - Me);
|
1147
|
-
|
1147
|
+
w(y);
|
1148
1148
|
}
|
1149
1149
|
return () => {
|
1150
|
-
|
1150
|
+
w(0);
|
1151
1151
|
};
|
1152
1152
|
}, [s]), B(() => (pe.isEmpty(s) || document.addEventListener("visibilitychange", h), () => {
|
1153
1153
|
document.removeEventListener("visibilitychange", h);
|
1154
1154
|
}), [s]);
|
1155
1155
|
function T() {
|
1156
|
-
s1 = Date.now(),
|
1156
|
+
s1 = Date.now(), w((y) => (Fe = y, y));
|
1157
1157
|
}
|
1158
1158
|
function P() {
|
1159
1159
|
let y = Date.now(), C = Math.round((y - s1) / 1e3);
|
1160
1160
|
s.deadline - Fe + C > s.deadline ? n((A) => {
|
1161
1161
|
var v;
|
1162
|
-
return A || ((v = f.address) != null && v.length && c.refetch(), o.refetch(),
|
1163
|
-
}) : Fe && C &&
|
1162
|
+
return A || ((v = f.address) != null && v.length && c.refetch(), o.refetch(), w(s.deadline)), A;
|
1163
|
+
}) : Fe && C && w(Fe - C);
|
1164
1164
|
}
|
1165
1165
|
function h() {
|
1166
1166
|
document.visibilityState === "visible" ? P() : T();
|
1167
1167
|
}
|
1168
1168
|
return B(() => (pe.isEmpty(s) ? he && clearInterval(he) : he = setInterval(() => {
|
1169
|
-
|
1169
|
+
w((y) => y <= 0 ? (Me = 0, s.deadline) : (Me++, y - 1));
|
1170
1170
|
}, 1e3), () => {
|
1171
1171
|
he && clearInterval(he);
|
1172
|
-
}), [s]), l((y) => y.timerValue), { quoteTimer: b, setQuoteTimer:
|
1172
|
+
}), [s]), l((y) => y.timerValue), { quoteTimer: b, setQuoteTimer: w };
|
1173
1173
|
}
|
1174
1174
|
function pt(t, n, o) {
|
1175
|
-
const { primaryWallet: s } = Ne(), [r, c] = N(0), b = async (
|
1175
|
+
const { primaryWallet: s } = Ne(), [r, c] = N(0), b = async (w) => {
|
1176
1176
|
if (!s) return;
|
1177
|
-
const a = new ze(
|
1177
|
+
const a = new ze(w || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed");
|
1178
1178
|
if (a)
|
1179
1179
|
try {
|
1180
1180
|
const p = new be(s.address);
|
@@ -1205,13 +1205,13 @@ async function ht(t, n) {
|
|
1205
1205
|
});
|
1206
1206
|
let c = {};
|
1207
1207
|
for (const { account: b } of r.value) {
|
1208
|
-
const
|
1209
|
-
c[
|
1208
|
+
const w = b.data.parsed.info.mint, a = b.data.parsed.info.tokenAmount.uiAmount;
|
1209
|
+
c[w] = a;
|
1210
1210
|
}
|
1211
1211
|
return c;
|
1212
1212
|
}
|
1213
1213
|
function yt(t, n) {
|
1214
|
-
const [o, s] = N(0), { primaryWallet: r, setPrimaryWallet: c } = Ne(), [b,
|
1214
|
+
const [o, s] = N(0), { primaryWallet: r, setPrimaryWallet: c } = Ne(), [b, w] = N(!1), a = l((m) => m.fromChain), { address: p, isConnected: f } = ge(), I = l((m) => m.cosmosChainIds), { data: T, isConnected: P } = Oe({
|
1215
1215
|
chainId: I,
|
1216
1216
|
multiChain: !0
|
1217
1217
|
}), h = l((m) => m.fromCoin), { data: y, isLoading: C } = O1({
|
@@ -1224,7 +1224,7 @@ function yt(t, n) {
|
|
1224
1224
|
isLoading: v,
|
1225
1225
|
isFetching: Z,
|
1226
1226
|
isInitialLoading: H,
|
1227
|
-
isRefetching:
|
1227
|
+
isRefetching: ne
|
1228
1228
|
} = c1({
|
1229
1229
|
chainId: [a.chainId],
|
1230
1230
|
multiChain: !0
|
@@ -1235,20 +1235,20 @@ function yt(t, n) {
|
|
1235
1235
|
if (k)
|
1236
1236
|
try {
|
1237
1237
|
const M = new be(r.address);
|
1238
|
-
|
1238
|
+
w(!0);
|
1239
1239
|
const x = await k.getBalance(M) / 1e9;
|
1240
|
-
s(x),
|
1240
|
+
s(x), w(!1);
|
1241
1241
|
} catch {
|
1242
|
-
|
1242
|
+
w(!1);
|
1243
1243
|
}
|
1244
1244
|
}
|
1245
1245
|
async function R(m) {
|
1246
1246
|
try {
|
1247
|
-
|
1247
|
+
w(!0);
|
1248
1248
|
let k = await ht(r.address, m);
|
1249
|
-
|
1249
|
+
w(!1), s(k == null ? void 0 : k[h == null ? void 0 : h.address]);
|
1250
1250
|
} catch {
|
1251
|
-
|
1251
|
+
w(!1);
|
1252
1252
|
}
|
1253
1253
|
}
|
1254
1254
|
let _;
|
@@ -1270,11 +1270,11 @@ function yt(t, n) {
|
|
1270
1270
|
var M, F;
|
1271
1271
|
let k = A[m] || A;
|
1272
1272
|
try {
|
1273
|
-
|
1273
|
+
w(!0);
|
1274
1274
|
let x = await k.getAllBalances((M = T == null ? void 0 : T[m]) == null ? void 0 : M.bech32Address), O = pe.keyBy(x, "denom");
|
1275
|
-
s(((F = O[d1(h.address)]) == null ? void 0 : F.amount) / Math.pow(10, h.decimals) || 0),
|
1275
|
+
s(((F = O[d1(h.address)]) == null ? void 0 : F.amount) / Math.pow(10, h.decimals) || 0), w(!1);
|
1276
1276
|
} catch {
|
1277
|
-
|
1277
|
+
w(!1);
|
1278
1278
|
}
|
1279
1279
|
}
|
1280
1280
|
return B(() => {
|
@@ -1285,19 +1285,19 @@ function yt(t, n) {
|
|
1285
1285
|
isBalanceLoading: (a == null ? void 0 : a.networkType) == "sol" || (a == null ? void 0 : a.networkType) == "cosmos" ? b : (a == null ? void 0 : a.networkType) == "evm" ? C : !1
|
1286
1286
|
};
|
1287
1287
|
}
|
1288
|
-
const Ct = de.lazy(() => import("./SwapAsset-
|
1288
|
+
const Ct = de.lazy(() => import("./SwapAsset-Dk21ATof.js")), vt = de.lazy(() => import("./InputComp-CJp-XwEr.js")), kt = de.lazy(() => import("./QuotesProgress-DCNTk9oc.js")), Nt = de.lazy(() => import("./TxnButton-DEs1au8L.js")), Tt = de.lazy(() => import("./index-BeQiCUcq.js").then((t) => t.i)), It = de.lazy(() => import("./index-D2EfKDiV.js")), Bt = de.lazy(() => import("./LoadRoute-eUX6vrIQ.js")), At = de.lazy(() => import("./AllRoutes-DzeVxLDj.js"));
|
1289
1289
|
function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
1290
1290
|
var Ge, Ke, Je, qe, Xe, Qe, We;
|
1291
|
-
const [s, r] = N(), [c, b] = N(!1), [
|
1291
|
+
const [s, r] = N(), [c, b] = N(!1), [w, a] = N(!1), [p, f] = N(!1), [I, T] = N(!1), [P, h] = N("all"), [y, C] = N(!1), { primaryWallet: A } = Ne();
|
1292
1292
|
$1();
|
1293
|
-
const { address: v } = ge(), { address: Z } = a1(), { getbal: H, isBalanceLoading:
|
1293
|
+
const { address: v } = ge(), { address: Z } = a1(), { getbal: H, isBalanceLoading: ne } = yt(y), { data: L, isConnected: R } = Oe({ chainId: "cosmoshub-4" });
|
1294
1294
|
l((i) => i.configuration);
|
1295
1295
|
const _ = l((i) => i.persist), J = l((i) => i.setPersist), g = l((i) => i.route), m = l((i) => i.fromChain), k = l((i) => i.toChain), M = l((i) => i.fromCoin), F = l((i) => i.toCoin), x = l((i) => i.setFromChain), O = l((i) => i.setToChain), $ = l((i) => i.setFromCoin), E = l((i) => i.setToCoin), j = l((i) => i.amount), V = l((i) => i.setAmount), ie = l((i) => i.customWallet);
|
1296
1296
|
l((i) => i.setToDisconnect);
|
1297
|
-
const Te = l((i) => i.setCosmosChainIds), Y = l((i) => i.customFee), G = l((i) => i.broadCastMode), Q = l((i) => i.evmGas), z = l((i) => i.evmSpeed), Ie = l((i) => i.slippage), ye = l((i) => i.option), Be = l((i) => i.setCustomWallet), Ae = l((i) => i.setSelectedProvider), { balanceSol:
|
1297
|
+
const Te = l((i) => i.setCosmosChainIds), Y = l((i) => i.customFee), G = l((i) => i.broadCastMode), Q = l((i) => i.evmGas), z = l((i) => i.evmSpeed), Ie = l((i) => i.slippage), ye = l((i) => i.option), Be = l((i) => i.setCustomWallet), Ae = l((i) => i.setSelectedProvider), { balanceSol: d } = pt(m, y, Re), { suggestAndConnectAsync: D } = S1(), re = !!(j.length && m.chain.length && M.coin.length && k.chain.length && F.coin.length && !p && I), le = ["routes", v, m, k, M, F, j, A == null ? void 0 : A.address, Z, ie, L == null ? void 0 : L.bech32Address, Y, Q, z, Ie, G, ye.value];
|
1298
1298
|
let oe = (G === "Priority Fee" || G === "Both") && (Y != null && Y.length) ? Y : ye.value, se = (G === "Jito Tip" || G === "Both") && (Y != null && Y.length) ? Y : ye.value, q = Q != null && Q.length ? Q : z.value;
|
1299
|
-
const W = (m == null ? void 0 : m.networkType) === "sol" ? G === "Priority Fee" ? `&solanaPriorityFee=${oe}` : G === "Jito Tip" ? `&solanaJitoTip=${se}` : `&solanaPriorityFee=${oe}&solanaJitoTip=${se}` : (m == null ? void 0 : m.networkType) === "evm" ? `&evmPriorityFee=${q}` : "", { getWallet: U, refetch:
|
1300
|
-
enabled:
|
1299
|
+
const W = (m == null ? void 0 : m.networkType) === "sol" ? G === "Priority Fee" ? `&solanaPriorityFee=${oe}` : G === "Jito Tip" ? `&solanaJitoTip=${se}` : `&solanaPriorityFee=${oe}&solanaJitoTip=${se}` : (m == null ? void 0 : m.networkType) === "evm" ? `&evmPriorityFee=${q}` : "", { getWallet: U, refetch: ee } = ke({}), { routes: S, routesData: X, setRoutesData: ce, errorMessage: te, setErrorMessage: Ce } = J1({
|
1300
|
+
enabled: re,
|
1301
1301
|
dependency: le,
|
1302
1302
|
payload: [(m == null ? void 0 : m.networkType) === "cosmos" ? n1(L == null ? void 0 : L.bech32Address, (Ge = m == null ? void 0 : m.chainInfo) == null ? void 0 : Ge.bech32Config.bech32PrefixAccAddr) : ((Ke = U(m)) == null ? void 0 : Ke.address) || "", m, k, M, F, j, Number(Ie) * 100, (ie == null ? void 0 : ie.length) > 30 ? ((Je = U({})) == null ? void 0 : Je.address) || "" : (k == null ? void 0 : k.networkType) === "cosmos" ? n1(L == null ? void 0 : L.bech32Address, (qe = k == null ? void 0 : k.chainInfo) == null ? void 0 : qe.bech32Config.bech32PrefixAccAddr) : ((Xe = U(k)) == null ? void 0 : Xe.address) || "", W]
|
1303
1303
|
}), ae = U(m), we = l1({
|
@@ -1308,9 +1308,9 @@ function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1308
1308
|
}), { quoteTimer: je } = mt({
|
1309
1309
|
routes: S,
|
1310
1310
|
routesData: X,
|
1311
|
-
confirmRoute:
|
1311
|
+
confirmRoute: w,
|
1312
1312
|
setConfirmRoute: a,
|
1313
|
-
isRoutesEnabled:
|
1313
|
+
isRoutesEnabled: re,
|
1314
1314
|
fetchBalance: we
|
1315
1315
|
});
|
1316
1316
|
B(() => {
|
@@ -1338,7 +1338,7 @@ function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1338
1338
|
let xe = await D({
|
1339
1339
|
chainInfo: i,
|
1340
1340
|
walletType: Z1.KEPLR
|
1341
|
-
}), me = await
|
1341
|
+
}), me = await ee(), fe = await t1();
|
1342
1342
|
Te(fe);
|
1343
1343
|
}
|
1344
1344
|
} catch {
|
@@ -1356,7 +1356,7 @@ function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1356
1356
|
b(!c);
|
1357
1357
|
}
|
1358
1358
|
function He(i) {
|
1359
|
-
a(typeof i < "u" ? i : !
|
1359
|
+
a(typeof i < "u" ? i : !w);
|
1360
1360
|
}
|
1361
1361
|
function Re(i) {
|
1362
1362
|
C(i);
|
@@ -1402,18 +1402,18 @@ function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1402
1402
|
} else
|
1403
1403
|
return;
|
1404
1404
|
}
|
1405
|
-
return /* @__PURE__ */ e(A1, { fallback: /* @__PURE__ */ e(L1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(Tt, { connectWalletField: P, handleShowWallet: t, handleRecentSelectedWallet: I1 }) : !
|
1405
|
+
return /* @__PURE__ */ e(A1, { fallback: /* @__PURE__ */ e(L1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(Tt, { connectWalletField: P, handleShowWallet: t, handleRecentSelectedWallet: I1 }) : !w && !((We = _ == null ? void 0 : _.routeId) != null && We.length) ? c ? /* @__PURE__ */ e(At, { routes: S, handleShowAllRoutes: Ze, handleRoutesData: C1, convertVal: (F == null ? void 0 : F.lastPrice) || 0, amount: j }) : s ? /* @__PURE__ */ e(tt, { chainData: s == "from" ? m : k, coinData: s == "from" ? M : F, setChainData: h1, setCoinData: y1, handleReset: Pe, showExchangeList: s, fetchBalance: we, fetchChains: o }) : /* @__PURE__ */ u(K, { children: [
|
1406
1406
|
/* @__PURE__ */ e(ut, {}),
|
1407
1407
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
1408
1408
|
/* @__PURE__ */ e(Ct, { handleSwap: T1 }),
|
1409
1409
|
/* @__PURE__ */ e(o1, { chainData: m, show: "from", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: h, coinData: M }),
|
1410
1410
|
/* @__PURE__ */ e(o1, { chainData: k, show: "to", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: h, coinData: F })
|
1411
1411
|
] }),
|
1412
|
-
/* @__PURE__ */ e(vt, { amount: j, setAmount: V, fetchBalance: we, getCoinBalance: H, isBalanceLoading:
|
1412
|
+
/* @__PURE__ */ e(vt, { amount: j, setAmount: V, fetchBalance: we, getCoinBalance: H, isBalanceLoading: ne }),
|
1413
1413
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Bt, { routes: S, handleShowAllRoutes: Ze, routesData: X, amount: j, isRoutesEnabled: I, price: ((X == null ? void 0 : X.outputAmountDisplay) || "") * ((F == null ? void 0 : F.lastPrice) || 0) }) }),
|
1414
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (
|
1415
|
-
/* @__PURE__ */ e(kt, { routes: S, routesData: X,
|
1416
|
-
/* @__PURE__ */ e(Nt, { routesData: X, handleSuccess: Re, routes: S, fetchBalancePrev: we, amount: j, isAmountTyped: I, handleShowWallet: t, setConnectWalletField: h, handleConfirmClose: He, balanceSol:
|
1414
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (te == null ? void 0 : te.error) == "string" ? te == null ? void 0 : te.error : "" }),
|
1415
|
+
/* @__PURE__ */ e(kt, { amount: I, routes: S, routesData: X, quoteTimer: je }),
|
1416
|
+
/* @__PURE__ */ e(Nt, { routesData: X, handleSuccess: Re, routes: S, fetchBalancePrev: we, amount: j, isAmountTyped: I, handleShowWallet: t, setConnectWalletField: h, handleConfirmClose: He, balanceSol: d, getCoinBalance: H })
|
1417
1417
|
] }) : /* @__PURE__ */ e(It, { handleConfirmClose: He, amount: j, routesData: X, resetAmount: k1, routes: S, handleStopRoute: ve, resetBalance: v1 }) }) });
|
1418
1418
|
}
|
1419
1419
|
function Pt({ fetchChains: t }) {
|