@blockend/widget 1.0.61-beta.3 → 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-BrDSLkEx.js → AllRoutes-Tg2ZT76o.js} +9 -9
- package/dist/{Box-BTMntOnW.js → Box-B9juHpcj.js} +1 -1
- package/dist/{EstGas-CELSR_co.js → EstGas-KMkZn-29.js} +9 -8
- package/dist/{Grow--O3Q7qBB.js → Grow-ChRZXdpG.js} +2 -2
- package/dist/{InputComp-CIMBouQg.js → InputComp-DK_7Rx6i.js} +3 -3
- package/dist/{LoadRoute-DP9HswK0.js → LoadRoute-DZti2QMq.js} +4 -4
- package/dist/{QuotesProgress-DXyVWF9h.js → QuotesProgress-CSOyBEYv.js} +1 -1
- package/dist/{SwapAsset-d01boR2k.js → SwapAsset-COjdLi4Y.js} +1 -1
- package/dist/{Tooltip-BGRxmZUc.js → Tooltip-DwZ5UqZH.js} +3 -3
- package/dist/{TxnButton-DUhnDCLZ.js → TxnButton-DTr4yN0f.js} +3 -3
- package/dist/{add-BEjMXwS0.js → add-Cd5IQacX.js} +1 -1
- package/dist/{all-wallets-D5ejBd2J.js → all-wallets-DtKwKlvg.js} +1 -1
- package/dist/{app-store-DyLpIyGe.js → app-store-D20Hc9r5.js} +1 -1
- package/dist/{apple-LF95M9ZO.js → apple-Dr_FNuvW.js} +1 -1
- package/dist/{arrow-bottom-WAJ3nKw-.js → arrow-bottom-BK4Q9_cl.js} +1 -1
- package/dist/{arrow-bottom-circle-BZnCDzRx.js → arrow-bottom-circle-BJNTJ2Id.js} +1 -1
- package/dist/{arrow-left-iCLozbpY.js → arrow-left-BdTVmWvr.js} +1 -1
- package/dist/{arrow-right-BbAPnR2v.js → arrow-right-BpTu_CvC.js} +1 -1
- package/dist/{arrow-top-Cam7P0Cq.js → arrow-top-DqcH1Bm6.js} +1 -1
- package/dist/{bank-CisGvOQw.js → bank-DiAMG5kv.js} +1 -1
- package/dist/{basic-D4ipPfXU.js → basic-Dt8XZdAE.js} +3 -3
- package/dist/{browser-DuEN7q3p.js → browser-CR2VhkL1.js} +1 -1
- package/dist/{card-CsdJWKWP.js → card-B6zr6eXl.js} +1 -1
- package/dist/{ccip-BKlgnW-G.js → ccip-CooAdn5B.js} +1 -1
- package/dist/{checkmark-DGMpHO3y.js → checkmark-5ZEqUgwd.js} +1 -1
- package/dist/{checkmark-bold-CK87kMR1.js → checkmark-bold-GLZ5J2EM.js} +1 -1
- package/dist/{chevron-bottom-C2O1FTiz.js → chevron-bottom-B9lKM1_B.js} +1 -1
- package/dist/{chevron-left-BxFuIrMa.js → chevron-left-B74WPhMU.js} +1 -1
- package/dist/{chevron-right-B5hvp_03.js → chevron-right-dERN-cRp.js} +1 -1
- package/dist/{chevron-top-D_8IACK2.js → chevron-top-CJmBr01i.js} +1 -1
- package/dist/{chrome-store-u5HETQ34.js → chrome-store-BN7beBXm.js} +1 -1
- package/dist/{clock-B_BvmsVw.js → clock-BZJEanFr.js} +1 -1
- package/dist/{close-D4borsFC.js → close-DYzaADrh.js} +1 -1
- package/dist/{coinPlaceholder-BdKcXcQe.js → coinPlaceholder-XoI98vL6.js} +1 -1
- package/dist/{compass-CeU27UPb.js → compass-Bmw05_74.js} +1 -1
- package/dist/{copy-DnmfkWJf.js → copy-CRsvr_-Y.js} +1 -1
- package/dist/{core-R_avBv6F.js → core-CNtVUQSn.js} +3 -3
- package/dist/{cursor-DFsrHX7h.js → cursor-_4FCtfoF.js} +1 -1
- package/dist/{cursor-transparent-C2Jspzlk.js → cursor-transparent-t3C3bGio.js} +1 -1
- package/dist/{desktop-Cvb4Bs-W.js → desktop-DEjtj9b9.js} +1 -1
- package/dist/{disconnect-Cc3TuHcw.js → disconnect-CvfcFsZW.js} +1 -1
- package/dist/{discord-BulP9OPs.js → discord-Da2kNDFh.js} +1 -1
- package/dist/{down-DMOxb9X6.js → down-Co_636uZ.js} +2 -2
- package/dist/{etherscan-CLV4G1N3.js → etherscan-Bm-JiVEa.js} +1 -1
- package/dist/{exclamation-triangle-CTNxc0i0.js → exclamation-triangle-DfSv-b_f.js} +1 -1
- package/dist/{extension-NL920RFJ.js → extension-BKycUNuZ.js} +1 -1
- package/dist/{external-link-C06xueBw.js → external-link-BYcqpWTv.js} +1 -1
- package/dist/{facebook-CUngbGFi.js → facebook-BnfOctOT.js} +1 -1
- package/dist/{farcaster-DyF7oe3m.js → farcaster-Wnye6IH2.js} +1 -1
- package/dist/{filters-NTcvQCDK.js → filters-AjWcrbkL.js} +1 -1
- package/dist/{getChainIds-BPyuIG49.js → getChainIds-CWu3-jMu.js} +2 -2
- package/dist/{getCosmosAddress-BxqNvT5E.js → getCosmosAddress-CV3jkiKz.js} +1465 -1464
- package/dist/{github-C7AEFANq.js → github-BCuvL-wO.js} +1 -1
- package/dist/{google-D2eY5g0j.js → google-Bkru7TaB.js} +1 -1
- package/dist/{hamburger-BBUxDW1l.js → hamburger-BAiLuR6L.js} +5 -5
- package/dist/{help-circle-BsreVT6h.js → help-circle-BpNFkswD.js} +1 -1
- package/dist/{id-9IHoTVmk.js → id-DVghrxc8.js} +1 -1
- package/dist/{image-CpxDCWP0.js → image-B9otxaOn.js} +1 -1
- package/dist/{index-Bsolq3x5.js → index-A30teLx9.js} +4 -4
- package/dist/{index-B5HYIYdX.js → index-BFyxV5IM.js} +2 -2
- package/dist/{index-BAPYRpZ5.js → index-BpIbxRWS.js} +5 -5
- package/dist/{index-CtucwqhS.js → index-C4ti16FQ.js} +1 -1
- package/dist/{index-BK-LO8mS.js → index-CJbvu2rb.js} +4 -4
- package/dist/{index-Bx-p5owo.js → index-CTGZJNEw.js} +218 -218
- package/dist/{index-DGEhy5MB.js → index-CxEZ0Yvm.js} +8 -6
- package/dist/{index-BBHRfWRe.js → index-DbBzmGSg.js} +11 -11
- package/dist/{index-CsFCcGQR.js → index-DuQELdTr.js} +10 -10
- package/dist/{index-AVgT1tC7.js → index-fiVT57xi.js} +78 -78
- package/dist/{index-CufwKYsS.js → index-oJZeBYfH.js} +1 -1
- package/dist/{index.es-DW2t7BAn.js → index.es-ACvqNRUv.js} +1 -1
- package/dist/{index.es-BU0GM1mV.js → index.es-CgeEFjeC.js} +2 -2
- package/dist/index.es.js +1 -1
- package/dist/{info-LwvH4jJX.js → info-DKooTZg2.js} +1 -1
- package/dist/{info-circle-CpntIlZG.js → info-circle-Ti790Qys.js} +1 -1
- package/dist/{lightbulb-D2pTnP9p.js → lightbulb-D1hpKqvI.js} +1 -1
- package/dist/{mail-DJG_2nFe.js → mail-CX1ISYMg.js} +1 -1
- package/dist/{mobile-CfN1g0ky.js → mobile-DvLnSnxU.js} +1 -1
- package/dist/{more-D_MQ1sJN.js → more-BDqYsMER.js} +1 -1
- package/dist/{network-placeholder-DIblWZzB.js → network-placeholder-BqrGYxWk.js} +1 -1
- package/dist/{nftPlaceholder-BbumxxR8.js → nftPlaceholder-BPLi6F_i.js} +1 -1
- package/dist/{off-BYUrtwej.js → off-DmMES7z0.js} +1 -1
- package/dist/{play-store-iblBb5XO.js → play-store-CtRsxrd8.js} +1 -1
- package/dist/{plus-D85wdmHo.js → plus-Dd2dpw3r.js} +1 -1
- package/dist/{qr-code-Dcybxb7U.js → qr-code-BpKmAinw.js} +1 -1
- package/dist/{recycle-horizontal-Bd8ilzW8.js → recycle-horizontal-DmtC4FOF.js} +1 -1
- package/dist/{refresh-Dj6GhAr5.js → refresh-DTco7Ml3.js} +1 -1
- package/dist/{reown-logo-BUsYR2sc.js → reown-logo-DcZ11LCN.js} +1 -1
- package/dist/{search-AZfspUWP.js → search-B675ucu5.js} +1 -1
- package/dist/{send-CpZ6YcVZ.js → send-B8uHx5xd.js} +1 -1
- package/dist/{swapHorizontal-Bp6G13yq.js → swapHorizontal-CCzHRYwe.js} +1 -1
- package/dist/{swapHorizontalBold-h5BpqwRP.js → swapHorizontalBold-DWTNNXhE.js} +1 -1
- package/dist/{swapHorizontalMedium-C5OGmd3s.js → swapHorizontalMedium-DNSKYh0N.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-C_TWWmM4.js → swapHorizontalRoundedBold-CT15U_Bs.js} +1 -1
- package/dist/{swapVertical-DDcdq1Iq.js → swapVertical-DLin8Hkc.js} +1 -1
- package/dist/{telegram-6IwaAWkg.js → telegram-DF-iSxN1.js} +1 -1
- package/dist/{three-dots-CC-EXoV7.js → three-dots-CJPDVJmM.js} +1 -1
- package/dist/{twitch-01WYlxYB.js → twitch-czegAr5r.js} +1 -1
- package/dist/{twitterIcon-CBqQ3gr4.js → twitterIcon-BULt70k5.js} +1 -1
- package/dist/{unsupportedProp-CwqpQh-r.js → unsupportedProp-B7PT0i4E.js} +1 -1
- package/dist/{useRegisterError-ByOKmamU.js → useRegisterError-DtCN2F9V.js} +1 -1
- package/dist/{verify-BswPw1i0.js → verify-C_rmfozd.js} +1 -1
- package/dist/{verify-filled-DukpwPr3.js → verify-filled-D0LZm_J5.js} +1 -1
- package/dist/{w3m-modal-B9D1Uz6O.js → w3m-modal-2mTvT9A2.js} +2 -2
- package/dist/{wallet-Bj7JS51P.js → wallet-NTyIGqPL.js} +1 -1
- package/dist/{wallet-placeholder-ntA_yGUg.js → wallet-placeholder-Bsw2gBaK.js} +1 -1
- package/dist/{walletconnect-C2YXIR96.js → walletconnect-ds3vBVCr.js} +1 -1
- package/dist/{warning-circle-Bug2jkco.js → warning-circle-NWVxVoZ6.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-BEvzIigT.js → x-MjpW51zN.js} +1 -1
- package/package.json +1 -1
- package/dist/AdvancedSettings-BDdJbtcK.js +0 -30
@@ -1,17 +1,17 @@
|
|
1
|
-
import { jsxs as p, jsx as e, Fragment as
|
2
|
-
import
|
3
|
-
import { B as
|
4
|
-
import { u as l, l as
|
5
|
-
import { C as n1, M as
|
1
|
+
import { jsxs as p, jsx as e, Fragment as J } from "react/jsx-runtime";
|
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 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
6
|
import { useQuery as c1 } from "@tanstack/react-query";
|
7
|
-
import { useAccount as fe, useConnect as
|
8
|
-
import { useDynamicContext as
|
9
|
-
import { S as
|
10
|
-
import { u as
|
11
|
-
import { useAccount as Oe, useStargateClient as b1, useSuggestChainAndConnect as
|
12
|
-
import { S as
|
13
|
-
import { R as
|
14
|
-
import { C as Ve, P as
|
7
|
+
import { useAccount as fe, useConnect as O1, useConnections as R1, useBalance as $1 } from "wagmi";
|
8
|
+
import { useDynamicContext as Be, useIsLoggedIn as S1 } from "@dynamic-labs/sdk-react-core";
|
9
|
+
import { S as _1 } from "./shareicon-CG3v7iKI.js";
|
10
|
+
import { u as z1, B as V1 } from "./index-BFyxV5IM.js";
|
11
|
+
import { useAccount as Oe, useStargateClient as b1, useSuggestChainAndConnect as Z1, WalletType as H1 } from "graz";
|
12
|
+
import { S as G1, D as K1 } from "./down-Co_636uZ.js";
|
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-CV3jkiKz.js";
|
15
15
|
function d1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ p(
|
17
17
|
"svg",
|
@@ -46,7 +46,7 @@ function d1({ fill: t }) {
|
|
46
46
|
}
|
47
47
|
);
|
48
48
|
}
|
49
|
-
function
|
49
|
+
function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
50
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: [
|
@@ -57,7 +57,7 @@ function q1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
57
57
|
n();
|
58
58
|
},
|
59
59
|
className: "bw-absolute bw-left-0 bw-top-[25%]",
|
60
|
-
children: /* @__PURE__ */ e(
|
60
|
+
children: /* @__PURE__ */ e(P1, { fill: "var(--tw-text-secondary)" })
|
61
61
|
}
|
62
62
|
),
|
63
63
|
/* @__PURE__ */ e("div", { className: "bw-text-base bw-font-normal bw-text-text-secondary", children: "Network" })
|
@@ -106,7 +106,7 @@ function q1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
106
106
|
/* @__PURE__ */ e("img", { src: (A = x.image) != null && A.length ? x.image : g, className: "bw-rounded-[50%] bw-border bw-border-border-primary", width: 25, height: 25, alt: "img" }),
|
107
107
|
" ",
|
108
108
|
/* @__PURE__ */ e("p", { children: x.name }),
|
109
|
-
o.chain === x.name ? /* @__PURE__ */ e("img", { src: i, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(
|
109
|
+
o.chain === x.name ? /* @__PURE__ */ e("img", { src: i, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(J, {})
|
110
110
|
] }),
|
111
111
|
/* @__PURE__ */ p("div", { className: "bw-pr-2", children: [
|
112
112
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal", children: "Tokens" }),
|
@@ -119,15 +119,15 @@ function q1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
119
119
|
}) })
|
120
120
|
] });
|
121
121
|
}
|
122
|
-
const
|
123
|
-
gradientbackground:
|
124
|
-
overlay:
|
122
|
+
const Q1 = "_gradientbackground_7x8s8_1", U1 = "_overlay_7x8s8_5", s1 = {
|
123
|
+
gradientbackground: Q1,
|
124
|
+
overlay: U1
|
125
125
|
};
|
126
|
-
function
|
126
|
+
function Y1(t) {
|
127
127
|
let n = t.match(/[1-9A-HJ-NP-Za-km-z]{32,44}/);
|
128
128
|
return t.slice(0, 2) === "0x" ? !0 : n ? t == n : !1;
|
129
129
|
}
|
130
|
-
function
|
130
|
+
function W1(t) {
|
131
131
|
const [n, s] = k({}), o = l((i) => i.cosmosChainIds), { data: r } = Oe({
|
132
132
|
chainId: o,
|
133
133
|
multiChain: !0
|
@@ -138,7 +138,7 @@ function Y1(t) {
|
|
138
138
|
async function d(i) {
|
139
139
|
var g, x;
|
140
140
|
if ((g = r == null ? void 0 : r[i]) != null && g.bech32Address && b) {
|
141
|
-
let A = await (b[i] || b).getAllBalances((x = r == null ? void 0 : r[i]) == null ? void 0 : x.bech32Address), M =
|
141
|
+
let A = await (b[i] || b).getAllBalances((x = r == null ? void 0 : r[i]) == null ? void 0 : x.bech32Address), M = pe.keyBy(A, "denom");
|
142
142
|
s(M);
|
143
143
|
}
|
144
144
|
}
|
@@ -154,7 +154,7 @@ function w1(t) {
|
|
154
154
|
} else
|
155
155
|
return t;
|
156
156
|
}
|
157
|
-
function
|
157
|
+
function D1({ fill: t }) {
|
158
158
|
return /* @__PURE__ */ p(
|
159
159
|
"svg",
|
160
160
|
{
|
@@ -189,7 +189,7 @@ function W1({ fill: t }) {
|
|
189
189
|
}
|
190
190
|
);
|
191
191
|
}
|
192
|
-
function
|
192
|
+
function et({ selectedChain: t }) {
|
193
193
|
return /* @__PURE__ */ p("div", { className: "bw-h-[100%] bw-flex bw-flex-col bw-justify-center bw-items-center", children: [
|
194
194
|
/* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center bw-items-center", children: /* @__PURE__ */ p("div", { className: "bw-relative", children: [
|
195
195
|
t != null && t.image ? /* @__PURE__ */ e(
|
@@ -199,8 +199,8 @@ function D1({ selectedChain: t }) {
|
|
199
199
|
className: "bw-w-[80px] bw-h-[80px] bw-border-border-primary bw-border-2 bw-opacity-50 bw-rounded-[50%]",
|
200
200
|
alt: "chain"
|
201
201
|
}
|
202
|
-
) : /* @__PURE__ */ e(
|
203
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-bg-background-container -bw-bottom-2 -bw-right-2 bw-flex bw-items-center bw-justify-center bw-rounded-full bw-border bw-border-border-primary bw-w-[44px] bw-h-[44px]", children: /* @__PURE__ */ e(
|
202
|
+
) : /* @__PURE__ */ e(J, {}),
|
203
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-bg-background-container -bw-bottom-2 -bw-right-2 bw-flex bw-items-center bw-justify-center bw-rounded-full bw-border bw-border-border-primary bw-w-[44px] bw-h-[44px]", children: /* @__PURE__ */ e(D1, { fill: "var(--tw-text-secondary)" }) })
|
204
204
|
] }) }),
|
205
205
|
/* @__PURE__ */ p("h2", { className: "bw-text-base bw-text-center bw-mt-3 bw-font-bold bw-text-text-primary", children: [
|
206
206
|
"No Tokens found on ",
|
@@ -214,84 +214,84 @@ function D1({ selectedChain: t }) {
|
|
214
214
|
] })
|
215
215
|
] });
|
216
216
|
}
|
217
|
-
const
|
218
|
-
var
|
217
|
+
const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o, showExchangeList: r, setCoinData: c, setChainData: b }) {
|
218
|
+
var ke, Le;
|
219
219
|
l((u) => u.searchCustomCoin);
|
220
|
-
const d = l((u) => u.setSearchCustomCoin), { ref: i, inView: g } =
|
221
|
-
|
222
|
-
const m = x(n), T = l((u) => u.fromChain), y = l((u) => u.fromCoin), S = l((u) => u.toChain), _ = l((u) => u.toCoin), [
|
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
|
+
S1();
|
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" && ((
|
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
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,
|
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
|
-
enabled: !!((
|
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
|
-
s.length > 40 &&
|
239
|
+
s.length > 40 && Y1(s) && !R.length ? (E(!0), d({
|
240
240
|
chainId: n.chainId,
|
241
241
|
address: s
|
242
242
|
})) : s.length || (E(!1), d({ chainId: "", address: "" }));
|
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
|
-
function
|
256
|
-
var
|
257
|
-
let u = (
|
258
|
-
var
|
259
|
-
return ((
|
260
|
-
})) == null ? void 0 :
|
261
|
-
if (Z) return V(
|
262
|
-
}), D = 20,
|
263
|
-
z == 0 ?
|
255
|
+
function ve() {
|
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
|
+
if (Z) return V(q) * q.lastPrice - V(K) * K.lastPrice;
|
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
|
-
L != null && L.length &&
|
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
|
282
|
-
let
|
281
|
+
var Y, ge, X, Q, xe, be, Ne, le, ue, Pe, Te;
|
282
|
+
let ee = {
|
283
283
|
// ...coinData,
|
284
284
|
coin: u.symbol,
|
285
285
|
...u,
|
286
|
-
availBal: ((
|
286
|
+
availBal: ((xe = (Q = (X = (ge = (Y = U.data) == null ? void 0 : Y.data) == null ? void 0 : ge[n == null ? void 0 : n.networkType]) == null ? void 0 : X[n.chainId]) == null ? void 0 : Q[u.address.toLowerCase()]) == null ? void 0 : xe.balance) / Math.pow(10, ((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
|
-
c(
|
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,20 +308,20 @@ const et = le.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
|
-
onClick: (
|
314
|
-
|
313
|
+
onClick: (ee) => {
|
314
|
+
ee.stopPropagation();
|
315
315
|
},
|
316
316
|
className: "hover:bw-opacity-70",
|
317
|
-
children: /* @__PURE__ */ e(
|
317
|
+
children: /* @__PURE__ */ e(_1, { fill: "var(--tw-text-secondary)" })
|
318
318
|
}
|
319
319
|
)
|
320
320
|
] })
|
321
321
|
] })
|
322
322
|
] })
|
323
323
|
] }),
|
324
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && w && ((w == null ? void 0 : w.length) > 30 || $) ? /* @__PURE__ */ e(
|
324
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && w && ((w == null ? void 0 : w.length) > 30 || $) ? /* @__PURE__ */ e(J, {}) : U.isFetching ? /* @__PURE__ */ e(Se, { size: 12, thickness: 4, color: "inherit" }) : Z ? V(u) > 0 ? /* @__PURE__ */ p(J, { children: [
|
325
325
|
/* @__PURE__ */ e(
|
326
326
|
t1,
|
327
327
|
{
|
@@ -331,7 +331,7 @@ const et = le.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
331
331
|
}
|
332
332
|
}
|
333
333
|
),
|
334
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: V(u) * u.lastPrice > 0 ? /* @__PURE__ */ p(
|
334
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: V(u) * u.lastPrice > 0 ? /* @__PURE__ */ p(J, { children: [
|
335
335
|
"$",
|
336
336
|
/* @__PURE__ */ e(
|
337
337
|
t1,
|
@@ -343,21 +343,21 @@ const et = le.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
343
343
|
}
|
344
344
|
)
|
345
345
|
] }) : "" })
|
346
|
-
] }) : /* @__PURE__ */ e(
|
346
|
+
] }) : /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(J, {}) }) })
|
347
347
|
]
|
348
348
|
},
|
349
349
|
D
|
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
|
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
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);
|
@@ -368,7 +368,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
368
368
|
h(L.length);
|
369
369
|
}
|
370
370
|
}, [(C = b.data) == null ? void 0 : C.data]);
|
371
|
-
function
|
371
|
+
function te(w, I) {
|
372
372
|
var B, L;
|
373
373
|
(B = w.chain) != null && B.length && ((L = I == null ? void 0 : I.coin) != null && L.length) && s();
|
374
374
|
}
|
@@ -379,7 +379,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
379
379
|
T(w), x("");
|
380
380
|
}
|
381
381
|
const { tick: O, defaultCoin: z } = Ee;
|
382
|
-
return d ? /* @__PURE__ */ e(
|
382
|
+
return d ? /* @__PURE__ */ e(X1, { handleSetChainData: G, data: (P = b.data) == null ? void 0 : P.data, handleBack: E, network: m }) : /* @__PURE__ */ p(J, { children: [
|
383
383
|
/* @__PURE__ */ p("div", { children: [
|
384
384
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
385
385
|
/* @__PURE__ */ e(
|
@@ -397,7 +397,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
397
397
|
" Network"
|
398
398
|
] })
|
399
399
|
] }),
|
400
|
-
b.isLoading ? /* @__PURE__ */ e(
|
400
|
+
b.isLoading ? /* @__PURE__ */ e(F1, { animation: "wave", variant: "rectangular", width: "100%", height: 134, className: "bw-rounded-md bw-flex bw-justify-center bw-bg-transparent bw-opacity-0 bw-items-center bw-text-text-primary" }) : /* @__PURE__ */ p("div", { className: "bw-grid bw-grid-cols-5 bw-gap-1 bw-overflow-y-auto bw-w-full", children: [
|
401
401
|
b.isSuccess && A.map((w, I) => {
|
402
402
|
var B, L;
|
403
403
|
return /* @__PURE__ */ e(
|
@@ -424,7 +424,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
424
424
|
/* @__PURE__ */ e("img", { src: (B = w.image) != null && B.length ? w.image : z, width: 25, className: "bw-rounded-[50%] bw-border bw-border-border-primary", height: 25, alt: "img" }),
|
425
425
|
" ",
|
426
426
|
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${m.name == w.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((L = w.name) == null ? void 0 : L.length) > 7 ? w.name.substring(0, 7) + ".." : w.name }),
|
427
|
-
(m == null ? void 0 : m.chain) == w ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: O }) : /* @__PURE__ */ e(
|
427
|
+
(m == null ? void 0 : m.chain) == w ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: O }) : /* @__PURE__ */ e(J, {})
|
428
428
|
]
|
429
429
|
},
|
430
430
|
I
|
@@ -446,7 +446,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
446
446
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-primary", children: "Networks" })
|
447
447
|
]
|
448
448
|
}
|
449
|
-
) }) : /* @__PURE__ */ e(
|
449
|
+
) }) : /* @__PURE__ */ e(J, {})
|
450
450
|
] })
|
451
451
|
] }),
|
452
452
|
/* @__PURE__ */ p("div", { children: [
|
@@ -472,7 +472,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
472
472
|
placeholder: "Search Token Name or Contract Address"
|
473
473
|
}
|
474
474
|
),
|
475
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (N.isLoading || N.isFetching) && g.length ? /* @__PURE__ */ e("div", { className: " bw-bg-background-container bw-mt-1 bw-mr-1 bw-flex bw-items-center bw-w-[16px] bw-h-[16px]", children: /* @__PURE__ */ e(
|
475
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (N.isLoading || N.isFetching) && g.length ? /* @__PURE__ */ e("div", { className: " bw-bg-background-container bw-mt-1 bw-mr-1 bw-flex bw-items-center bw-w-[16px] bw-h-[16px]", children: /* @__PURE__ */ e(G1, {}) }) : g.length ? /* @__PURE__ */ e(
|
476
476
|
"button",
|
477
477
|
{
|
478
478
|
onClick: () => {
|
@@ -485,11 +485,11 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
485
485
|
]
|
486
486
|
}
|
487
487
|
),
|
488
|
-
/* @__PURE__ */ e(
|
488
|
+
/* @__PURE__ */ e(tt, { value: g, handleClosePopup: te, showExchangeList: c, setChainData: t, setCoinData: n, selectChainState: m })
|
489
489
|
] })
|
490
490
|
] });
|
491
491
|
}
|
492
|
-
function
|
492
|
+
function rt({
|
493
493
|
walletDetails: t,
|
494
494
|
handleToDisconnect: n,
|
495
495
|
show: s,
|
@@ -497,18 +497,18 @@ function nt({
|
|
497
497
|
handleShowWallet: r,
|
498
498
|
setConnectWalletField: c
|
499
499
|
}) {
|
500
|
-
const [b, d] = k(null), { address: i, chain: g, data: x, disconnect: N, ...A } = t, [M, F] = k(), { connector: h } = fe(), { connectors: m } =
|
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(
|
505
|
-
|
505
|
+
pe.keyBy(m, (S) => S.uid)
|
506
506
|
);
|
507
507
|
}, [m]);
|
508
508
|
async function y() {
|
509
509
|
o === "evm" && (g == null ? void 0 : g.network) !== "custom" && (M != null && M[h == null ? void 0 : h.uid]), r();
|
510
510
|
}
|
511
|
-
return /* @__PURE__ */ e(
|
511
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
|
512
512
|
"button",
|
513
513
|
{
|
514
514
|
"aria-haspopup": "true",
|
@@ -516,7 +516,7 @@ function nt({
|
|
516
516
|
id: "basic-button",
|
517
517
|
style: { fontSize: "12px" },
|
518
518
|
className: "bw-bg-background-container bw-flex bw-items-center bw-justify-center bw-gap-x-2 bw-mb-[4px] bw-w-[100px] bw-h-[25px] bw-rounded-xl bw-border bw-border-border-primary",
|
519
|
-
children: i ? /* @__PURE__ */ p(
|
519
|
+
children: i ? /* @__PURE__ */ p(J, { children: [
|
520
520
|
/* @__PURE__ */ e("p", { className: "bw-text-text-primary bw-text-xs bw-font-normal", children: ((i == null ? void 0 : i.substring(0, 4)) || "") + "..." + ((i == null ? void 0 : i.substring(i.length - 4, i.length)) || "") }),
|
521
521
|
/* @__PURE__ */ e(
|
522
522
|
"div",
|
@@ -529,10 +529,10 @@ function nt({
|
|
529
529
|
) });
|
530
530
|
}
|
531
531
|
function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConnectWalletField: o, coinData: r, show: c }) {
|
532
|
-
var T, y, S, _,
|
532
|
+
var T, y, S, _, te, E, G, O, z;
|
533
533
|
const b = l((f) => f.configuration), d = l((f) => f.customWallet), { isConnected: i, isConnecting: g, isReconnecting: x } = fe();
|
534
|
-
|
535
|
-
const { defaultCoin: N } = Ee, { isAnyWalletConnected: A, getWallet: M } =
|
534
|
+
Be();
|
535
|
+
const { defaultCoin: N } = Ee, { isAnyWalletConnected: A, getWallet: M } = Ie({
|
536
536
|
chainData: t,
|
537
537
|
show: c
|
538
538
|
});
|
@@ -564,26 +564,26 @@ function a1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConn
|
|
564
564
|
children: [
|
565
565
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-min-w-[78px] bw-min-h-[28px] bw-items-center bw-gap-x-2", children: [
|
566
566
|
(S = r == null ? void 0 : r.coin) != null && S.length ? /* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-bold bw-text-text-primary", children: r.coin }) : /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-text-primary bw-font-bold", children: "Select Token" }),
|
567
|
-
/* @__PURE__ */ e(
|
567
|
+
/* @__PURE__ */ e(K1, { fill: (_ = r == null ? void 0 : r.coin) != null && _.length ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" })
|
568
568
|
] }),
|
569
|
-
(
|
569
|
+
(te = t == null ? void 0 : t.chain) != null && te.length ? /* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: `on ${t.chain}`.length > 12 ? `on ${t.chain.substring(0, 12)}..` : `on ${t.chain}` }) : /* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-bold bw-text-text-primary", children: "& Chain" })
|
570
570
|
]
|
571
571
|
}
|
572
572
|
)
|
573
573
|
]
|
574
574
|
}
|
575
575
|
),
|
576
|
-
/* @__PURE__ */ e(
|
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
|
579
|
+
function ot({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, show: o, chainData: r, handleToDisconnect: c }) {
|
580
580
|
var x;
|
581
|
-
const b = l((N) => N.customWallet), d = l((N) => N.fromChain), i = l((N) => N.toChain), { getWallet: g } =
|
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
|
});
|
585
585
|
return /* @__PURE__ */ e("div", { className: "bw-mt-2 bw-flex bw-justify-end", children: t ? /* @__PURE__ */ e(
|
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
589
|
disconnect: c,
|
@@ -609,10 +609,10 @@ function rt({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, sho
|
|
609
609
|
}
|
610
610
|
) });
|
611
611
|
}
|
612
|
-
const
|
613
|
-
gradient:
|
612
|
+
const st = "_gradient_15zwe_1", Ze = {
|
613
|
+
gradient: st
|
614
614
|
};
|
615
|
-
function
|
615
|
+
function at({ mode: t, handleMode: n }) {
|
616
616
|
var o, r;
|
617
617
|
const s = l((c) => c.configuration);
|
618
618
|
return /* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center", children: /* @__PURE__ */ p(
|
@@ -681,7 +681,7 @@ function st({ mode: t, handleMode: n }) {
|
|
681
681
|
}
|
682
682
|
) });
|
683
683
|
}
|
684
|
-
function
|
684
|
+
function it({ fill: t }) {
|
685
685
|
return /* @__PURE__ */ e(
|
686
686
|
"svg",
|
687
687
|
{
|
@@ -733,7 +733,7 @@ function u1({ options: t, handleOptions: n }) {
|
|
733
733
|
className: `
|
734
734
|
bw-flex bw-flex-1 bw-relative bw-h-full bw-rounded-md bw-gap-x-1 bw-justify-center bw-items-center `,
|
735
735
|
children: [
|
736
|
-
b.value === "ultra" ? /* @__PURE__ */ e(
|
736
|
+
b.value === "ultra" ? /* @__PURE__ */ e(it, { fill: b.value === t.value ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" }) : /* @__PURE__ */ e(J, {}),
|
737
737
|
/* @__PURE__ */ e(
|
738
738
|
"p",
|
739
739
|
{
|
@@ -831,7 +831,7 @@ function f1({ handleClose: t }) {
|
|
831
831
|
return /* @__PURE__ */ p("div", { className: "bw-w-full bw-relative bw-flex bw-items-center bw-justify-center", children: [
|
832
832
|
/* @__PURE__ */ e("h2", { className: "bw-text-2xl bw-font-bold bw-text-text-primary", children: "Config" }),
|
833
833
|
/* @__PURE__ */ e(
|
834
|
-
|
834
|
+
V1,
|
835
835
|
{
|
836
836
|
disableRipple: !0,
|
837
837
|
onClick: t,
|
@@ -888,12 +888,12 @@ function h1() {
|
|
888
888
|
/* @__PURE__ */ e("div", { className: "bw-h-[1px] bw-flex-1 bw-bg-border-primary " })
|
889
889
|
] });
|
890
890
|
}
|
891
|
-
function
|
891
|
+
function lt({ handleClose: t }) {
|
892
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
|
}
|
896
|
-
function
|
896
|
+
function te(f, C) {
|
897
897
|
b(""), r(f);
|
898
898
|
}
|
899
899
|
j(() => {
|
@@ -929,8 +929,8 @@ function it({ handleClose: t }) {
|
|
929
929
|
/* @__PURE__ */ e(f1, { handleClose: t }),
|
930
930
|
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage: g, handleSlippage: G }) }),
|
931
931
|
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(h1, {}) }),
|
932
|
-
/* @__PURE__ */ e(
|
933
|
-
/* @__PURE__ */ e(u1, { options: o, handleOptions:
|
932
|
+
/* @__PURE__ */ e(at, { mode: d, handleMode: z }),
|
933
|
+
/* @__PURE__ */ e(u1, { options: o, handleOptions: te }),
|
934
934
|
/* @__PURE__ */ e(
|
935
935
|
p1,
|
936
936
|
{
|
@@ -952,7 +952,7 @@ function it({ handleClose: t }) {
|
|
952
952
|
] })
|
953
953
|
] });
|
954
954
|
}
|
955
|
-
function
|
955
|
+
function ct({ handleClose: t }) {
|
956
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);
|
@@ -997,10 +997,10 @@ function lt({ handleClose: t }) {
|
|
997
997
|
)
|
998
998
|
] });
|
999
999
|
}
|
1000
|
-
function
|
1000
|
+
function bt({ open: t, handleClose: n }) {
|
1001
1001
|
const s = l((r) => r.fromChain);
|
1002
1002
|
return /* @__PURE__ */ e(
|
1003
|
-
|
1003
|
+
E1,
|
1004
1004
|
{
|
1005
1005
|
open: t,
|
1006
1006
|
disablePortal: !0,
|
@@ -1015,11 +1015,11 @@ function ct({ 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
|
}
|
1022
|
-
function
|
1022
|
+
function dt({ fill: t }) {
|
1023
1023
|
return /* @__PURE__ */ p(
|
1024
1024
|
"svg",
|
1025
1025
|
{
|
@@ -1058,7 +1058,7 @@ function bt({ fill: t }) {
|
|
1058
1058
|
}
|
1059
1059
|
);
|
1060
1060
|
}
|
1061
|
-
function
|
1061
|
+
function wt() {
|
1062
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",
|
@@ -1076,7 +1076,7 @@ function dt() {
|
|
1076
1076
|
"Y.exchange"
|
1077
1077
|
] });
|
1078
1078
|
}
|
1079
|
-
function
|
1079
|
+
function ut() {
|
1080
1080
|
const t = l((s) => s.configuration), n = t == null ? void 0 : t.headingContainerStyles;
|
1081
1081
|
return /* @__PURE__ */ e(
|
1082
1082
|
"div",
|
@@ -1105,49 +1105,49 @@ function wt() {
|
|
1105
1105
|
paddingLeft: "10px",
|
1106
1106
|
...n
|
1107
1107
|
},
|
1108
|
-
children: /* @__PURE__ */ e(
|
1108
|
+
children: /* @__PURE__ */ e(wt, {})
|
1109
1109
|
}
|
1110
1110
|
);
|
1111
1111
|
}
|
1112
|
-
function
|
1112
|
+
function mt() {
|
1113
1113
|
const [t, n] = k(!1), s = l((r) => r.fromChain);
|
1114
1114
|
function o() {
|
1115
1115
|
n(!1);
|
1116
1116
|
}
|
1117
|
-
return /* @__PURE__ */ p(
|
1117
|
+
return /* @__PURE__ */ p(J, { children: [
|
1118
1118
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-w-full -bw-mt-2 bw-mb-3 bw-items-center bw-justify-end", children: [
|
1119
|
-
/* @__PURE__ */ e(
|
1119
|
+
/* @__PURE__ */ e(ut, {}),
|
1120
1120
|
/* @__PURE__ */ e(
|
1121
1121
|
"div",
|
1122
1122
|
{
|
1123
1123
|
onClick: () => (s == null ? void 0 : s.networkType) !== "cosmos" && n(!0),
|
1124
1124
|
className: "bw-flex bw-relative bw-right-0 bw-items-center bw-gap-x-2",
|
1125
|
-
children: /* @__PURE__ */ e(
|
1125
|
+
children: /* @__PURE__ */ e(J1, { classnames: " ", children: /* @__PURE__ */ e(dt, { fill: "var(--tw-text-secondary)" }) })
|
1126
1126
|
}
|
1127
1127
|
)
|
1128
1128
|
] }),
|
1129
|
-
/* @__PURE__ */ e(
|
1129
|
+
/* @__PURE__ */ e(bt, { open: t, handleClose: o })
|
1130
1130
|
] });
|
1131
1131
|
}
|
1132
|
-
let i1, Fe,
|
1133
|
-
function
|
1134
|
-
const [b, d] = k(0), { getWallet: i } =
|
1132
|
+
let i1, Fe, Ce, Me = 0;
|
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
|
-
t && clearInterval(
|
1136
|
+
t && clearInterval(Ce);
|
1137
1137
|
}, [t]), j(() => {
|
1138
1138
|
var h;
|
1139
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(() => {
|
1143
|
-
if (!
|
1143
|
+
if (!pe.isEmpty(o)) {
|
1144
1144
|
const h = Math.max(0, o.deadline - Me);
|
1145
1145
|
d(h);
|
1146
1146
|
}
|
1147
1147
|
return () => {
|
1148
1148
|
d(0);
|
1149
1149
|
};
|
1150
|
-
}, [o]), j(() => (
|
1150
|
+
}, [o]), j(() => (pe.isEmpty(o) || document.addEventListener("visibilitychange", F), () => {
|
1151
1151
|
document.removeEventListener("visibilitychange", F);
|
1152
1152
|
}), [o]);
|
1153
1153
|
function A() {
|
@@ -1163,19 +1163,19 @@ function mt({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isR
|
|
1163
1163
|
function F() {
|
1164
1164
|
document.visibilityState === "visible" ? M() : A();
|
1165
1165
|
}
|
1166
|
-
return j(() => (
|
1166
|
+
return j(() => (pe.isEmpty(o) ? Ce && clearInterval(Ce) : Ce = setInterval(() => {
|
1167
1167
|
d((h) => h <= 0 ? (Me = 0, o.deadline) : (Me++, h - 1));
|
1168
1168
|
}, 1e3), () => {
|
1169
|
-
|
1169
|
+
Ce && clearInterval(Ce);
|
1170
1170
|
}), [o]), l((h) => h.timerValue), { quoteTimer: b, setQuoteTimer: d };
|
1171
1171
|
}
|
1172
|
-
function
|
1173
|
-
const { primaryWallet: o } =
|
1172
|
+
function gt(t, n, s) {
|
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
|
-
const g = new
|
1178
|
+
const g = new we(o.address);
|
1179
1179
|
i.onAccountChange(g, (A) => {
|
1180
1180
|
c(A.lamports / 1e9);
|
1181
1181
|
});
|
@@ -1189,17 +1189,17 @@ function pt(t, n, s) {
|
|
1189
1189
|
(t == null ? void 0 : t.networkType) === "sol" && b((t == null ? void 0 : t.chainId) === "eclipse-svm" ? "https://eclipse.lgns.net/" : null);
|
1190
1190
|
}, [t == null ? void 0 : t.networkType, o, t == null ? void 0 : t.chainId, o == null ? void 0 : o.address]), { balanceSol: r, getBalanceSol: b };
|
1191
1191
|
}
|
1192
|
-
function
|
1192
|
+
function ft(t) {
|
1193
1193
|
return t == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ? "" : t;
|
1194
1194
|
}
|
1195
|
-
const
|
1196
|
-
new
|
1197
|
-
new
|
1198
|
-
new
|
1199
|
-
async function
|
1195
|
+
const xt = new we("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), ht = new we("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
1196
|
+
new we("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
1197
|
+
new we("So11111111111111111111111111111111111111112");
|
1198
|
+
new we("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
1199
|
+
async function yt(t, n) {
|
1200
1200
|
if (!t) return;
|
1201
|
-
const s = new Ve(n || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed"), o = new
|
1202
|
-
programId: n ?
|
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
|
+
programId: n ? ht : xt
|
1203
1203
|
});
|
1204
1204
|
let c = {};
|
1205
1205
|
for (const { account: b } of r.value) {
|
@@ -1208,7 +1208,7 @@ async function ht(t, n) {
|
|
1208
1208
|
}
|
1209
1209
|
return c;
|
1210
1210
|
}
|
1211
|
-
const
|
1211
|
+
const Ct = "0000000000000000000000000000000000", vt = async (t) => {
|
1212
1212
|
try {
|
1213
1213
|
const n = await tronWeb.trx.getBalance(t);
|
1214
1214
|
return { balance: tronWeb.fromSun(n) };
|
@@ -1216,10 +1216,10 @@ const yt = "0000000000000000000000000000000000", Ct = async (t) => {
|
|
1216
1216
|
throw console.error("Error fetching TRX balance:", n), n;
|
1217
1217
|
}
|
1218
1218
|
};
|
1219
|
-
async function
|
1219
|
+
async function kt(t, n) {
|
1220
1220
|
try {
|
1221
|
-
if (n ===
|
1222
|
-
return
|
1221
|
+
if (n === Ct)
|
1222
|
+
return vt(t);
|
1223
1223
|
const s = await tronWeb.contract().at(n), o = await s.balanceOf(t).call(), r = await s.decimals().call();
|
1224
1224
|
return console.log(o, Number(o), Number(r), "balance"), {
|
1225
1225
|
balance: Number(o) / Math.pow(10, Number(r)),
|
@@ -1230,19 +1230,19 @@ async function vt(t, n) {
|
|
1230
1230
|
throw console.error("Error fetching token balance:", s), s;
|
1231
1231
|
}
|
1232
1232
|
}
|
1233
|
-
function
|
1234
|
-
const [s, o] = k(0), { primaryWallet: r, setPrimaryWallet: c } =
|
1233
|
+
function Nt(t, n) {
|
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 = l((w) => w.fromCoin), { data: T, isLoading: y } =
|
1237
|
+
}), m = l((w) => w.fromCoin), { data: T, isLoading: y } = $1({
|
1238
1238
|
address: g,
|
1239
|
-
token:
|
1239
|
+
token: ft((m == null ? void 0 : m.address) || ""),
|
1240
1240
|
chainId: Number((i == null ? void 0 : i.chainId) || 0),
|
1241
1241
|
enabled: !!((i.networkType == "evm" || n) && g && (g != null && g.length))
|
1242
1242
|
}), {
|
1243
1243
|
data: S,
|
1244
1244
|
isLoading: _,
|
1245
|
-
isFetching:
|
1245
|
+
isFetching: te,
|
1246
1246
|
isInitialLoading: E,
|
1247
1247
|
isRefetching: G
|
1248
1248
|
} = b1({
|
@@ -1254,7 +1254,7 @@ function kt(t, n) {
|
|
1254
1254
|
const I = new Ve(w || "https://solana-rpc.publicnode.com");
|
1255
1255
|
if (I)
|
1256
1256
|
try {
|
1257
|
-
const B = new
|
1257
|
+
const B = new we(r.address);
|
1258
1258
|
d(!0);
|
1259
1259
|
const v = await I.getBalance(B) / 1e9;
|
1260
1260
|
o(v), d(!1);
|
@@ -1265,7 +1265,7 @@ function kt(t, n) {
|
|
1265
1265
|
async function z(w) {
|
1266
1266
|
try {
|
1267
1267
|
d(!0);
|
1268
|
-
let I = await
|
1268
|
+
let I = await yt(r.address, w);
|
1269
1269
|
console.log(I, "ecres"), d(!1), o(I == null ? void 0 : I[m == null ? void 0 : m.address]);
|
1270
1270
|
} catch (I) {
|
1271
1271
|
console.log(I), d(!1);
|
@@ -1276,7 +1276,7 @@ function kt(t, n) {
|
|
1276
1276
|
if (!r) return;
|
1277
1277
|
const w = await r.connector.getPublicClient();
|
1278
1278
|
if (!w) return;
|
1279
|
-
const I = new
|
1279
|
+
const I = new we(r.address);
|
1280
1280
|
I && (f = w.onAccountChange(I, (B) => {
|
1281
1281
|
var L;
|
1282
1282
|
if (i.networkType == "sol" && (r != null && r.address))
|
@@ -1306,7 +1306,7 @@ function kt(t, n) {
|
|
1306
1306
|
let I = S[w] || S;
|
1307
1307
|
try {
|
1308
1308
|
d(!0);
|
1309
|
-
let v = await I.getAllBalances((B = F == null ? void 0 : F[w]) == null ? void 0 : B.bech32Address), R =
|
1309
|
+
let v = await I.getAllBalances((B = F == null ? void 0 : F[w]) == null ? void 0 : B.bech32Address), R = pe.keyBy(v, "denom");
|
1310
1310
|
o(((L = R[w1(m.address)]) == null ? void 0 : L.amount) / Math.pow(10, m.decimals) || 0), d(!1);
|
1311
1311
|
} catch (v) {
|
1312
1312
|
console.log(v, "balerrorcos"), d(!1);
|
@@ -1316,7 +1316,7 @@ function kt(t, n) {
|
|
1316
1316
|
o(0);
|
1317
1317
|
try {
|
1318
1318
|
d(!0);
|
1319
|
-
let B = await
|
1319
|
+
let B = await kt(w, I);
|
1320
1320
|
console.log(B, "balancetron"), o((B == null ? void 0 : B.balance) || 0), d(!1);
|
1321
1321
|
} catch (B) {
|
1322
1322
|
console.log(B, "balerrortron"), d(!1);
|
@@ -1330,30 +1330,30 @@ function kt(t, n) {
|
|
1330
1330
|
isBalanceLoading: (i == null ? void 0 : i.networkType) == "evm" ? y : b
|
1331
1331
|
};
|
1332
1332
|
}
|
1333
|
-
const
|
1334
|
-
function
|
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
|
+
function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
1335
1335
|
var Ke, Je, qe, Xe, Qe, Ue, Ye;
|
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 } =
|
1337
|
-
let
|
1338
|
-
const
|
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 =
|
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
|
-
}), { quoteTimer:
|
1347
|
+
}), { quoteTimer: Pe } = pt({
|
1348
1348
|
routes: X,
|
1349
1349
|
routesData: Q,
|
1350
1350
|
confirmRoute: d,
|
1351
1351
|
setConfirmRoute: i,
|
1352
|
-
isRoutesEnabled:
|
1353
|
-
fetchBalance:
|
1352
|
+
isRoutesEnabled: oe,
|
1353
|
+
fetchBalance: ue
|
1354
1354
|
});
|
1355
1355
|
j(() => {
|
1356
|
-
v ||
|
1356
|
+
v || xe({});
|
1357
1357
|
let a;
|
1358
1358
|
return Number(v) > 0 && (a = setTimeout(() => {
|
1359
1359
|
A(!0);
|
@@ -1361,36 +1361,36 @@ function Mt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1361
1361
|
clearTimeout(a), A(!1);
|
1362
1362
|
};
|
1363
1363
|
}, [v]), j(() => {
|
1364
|
-
X.isFetching &&
|
1364
|
+
X.isFetching && xe({});
|
1365
1365
|
}, [X.isFetching]);
|
1366
|
-
function
|
1366
|
+
function Te(a) {
|
1367
1367
|
x(a);
|
1368
1368
|
}
|
1369
|
-
function
|
1369
|
+
function y1() {
|
1370
1370
|
r();
|
1371
1371
|
}
|
1372
|
-
async function
|
1372
|
+
async function C1(a) {
|
1373
1373
|
if (G)
|
1374
1374
|
try {
|
1375
|
-
let
|
1376
|
-
if (
|
1377
|
-
let
|
1375
|
+
let de = await r1();
|
1376
|
+
if (de.length && !de.includes(a.chainId)) {
|
1377
|
+
let he = await re({
|
1378
1378
|
chainInfo: a,
|
1379
|
-
walletType:
|
1380
|
-
}),
|
1381
|
-
|
1379
|
+
walletType: H1.KEPLR
|
1380
|
+
}), me = await ge(), ye = await r1();
|
1381
|
+
Ae(ye);
|
1382
1382
|
}
|
1383
|
-
} catch (
|
1384
|
-
console.log(
|
1383
|
+
} catch (de) {
|
1384
|
+
console.log(de);
|
1385
1385
|
}
|
1386
1386
|
else
|
1387
1387
|
return;
|
1388
1388
|
}
|
1389
|
-
function C1(a) {
|
1390
|
-
(a == null ? void 0 : a.networkType) == "cosmos" && y1(a.chainInfo), R(""), ve({ error: "" }), o == "from" ? w({ ...a }) : o == "to" && I({ ...a });
|
1391
|
-
}
|
1392
1389
|
function v1(a) {
|
1393
|
-
|
1390
|
+
(a == null ? void 0 : a.networkType) == "cosmos" && C1(a.chainInfo), R(""), Ne({ error: "" }), o == "from" ? w({ ...a }) : o == "to" && I({ ...a });
|
1391
|
+
}
|
1392
|
+
function k1(a) {
|
1393
|
+
Ne({ error: "" }), R(""), o == "from" ? B({ ...a }) : o == "to" && L({ ...a });
|
1394
1394
|
}
|
1395
1395
|
function He() {
|
1396
1396
|
b(!c);
|
@@ -1401,22 +1401,22 @@ function Mt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1401
1401
|
function Re(a) {
|
1402
1402
|
m(a);
|
1403
1403
|
}
|
1404
|
-
function
|
1405
|
-
|
1404
|
+
function N1(a) {
|
1405
|
+
u(a == null ? void 0 : a.provider), xe(a);
|
1406
1406
|
}
|
1407
|
-
function
|
1407
|
+
function T1() {
|
1408
1408
|
setTimeout(() => {
|
1409
|
-
Re(!0),
|
1409
|
+
Re(!0), ue.refetch();
|
1410
1410
|
}, 1e3);
|
1411
1411
|
}
|
1412
|
-
function
|
1412
|
+
function I1() {
|
1413
1413
|
R("");
|
1414
1414
|
}
|
1415
|
-
function
|
1416
|
-
_e.fetchTokens(a.chainId,
|
1417
|
-
var
|
1418
|
-
(We = (
|
1419
|
-
|
1415
|
+
function B1(a, de, he) {
|
1416
|
+
_e.fetchTokens(a.chainId, he).then((me) => me.json()).then((me) => {
|
1417
|
+
var ye, We;
|
1418
|
+
(We = (ye = me.data) == null ? void 0 : ye[a.chainId]) == null || We.forEach((De) => {
|
1419
|
+
de({
|
1420
1420
|
...Z,
|
1421
1421
|
coin: De.symbol,
|
1422
1422
|
...De,
|
@@ -1425,45 +1425,45 @@ function Mt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1425
1425
|
});
|
1426
1426
|
});
|
1427
1427
|
}
|
1428
|
-
function
|
1429
|
-
R(""), w(P), B($), I(C), L(Z), C.networkType !== P.networkType &&
|
1428
|
+
function A1() {
|
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
|
-
function
|
1435
|
-
var
|
1434
|
+
function j1(a) {
|
1435
|
+
var de;
|
1436
1436
|
if (a && s.isSuccess && a !== (P == null ? void 0 : P.networkType) && a !== (C == null ? void 0 : C.networkType)) {
|
1437
|
-
let
|
1437
|
+
let he = pe.keyBy(s.data.data, "chainId"), me = a == "evm" ? "8453" : a == "sol" ? "sol" : a == "sui" ? "1" : a == "btc" ? "btc" : a == "tron" ? "tron" : "cosmoshub-4", ye = a == "evm" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : a == "sol" ? "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" : a == "sui" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : a == "btc" ? "bitcoin" : a == "tron" ? "0000000000000000000000000000000000" : "uatom";
|
1438
1438
|
w({
|
1439
|
-
...
|
1440
|
-
chain: ((
|
1441
|
-
}),
|
1439
|
+
...he[me],
|
1440
|
+
chain: ((de = he[me]) == null ? void 0 : de.name) || ""
|
1441
|
+
}), B1(he[me], B, ye);
|
1442
1442
|
} else
|
1443
1443
|
return;
|
1444
1444
|
}
|
1445
|
-
return console.log(T, "confirm route"), /* @__PURE__ */ e(e1, { fallback: /* @__PURE__ */ e(
|
1446
|
-
/* @__PURE__ */ e(
|
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
|
+
/* @__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
|
-
/* @__PURE__ */ e(
|
1448
|
+
/* @__PURE__ */ e(Tt, { handleSwap: A1 }),
|
1449
1449
|
/* @__PURE__ */ e(a1, { chainData: C, show: "from", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: F, coinData: Z }),
|
1450
1450
|
/* @__PURE__ */ e(a1, { chainData: P, show: "to", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: F, coinData: $ })
|
1451
1451
|
] }),
|
1452
|
-
/* @__PURE__ */ e(
|
1453
|
-
/* @__PURE__ */ e(e1, { fallback: /* @__PURE__ */ e("div", { children: "Loading..." }), children: /* @__PURE__ */ e(
|
1454
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1455
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (
|
1456
|
-
/* @__PURE__ */ e(
|
1457
|
-
/* @__PURE__ */ e(
|
1458
|
-
] }) : /* @__PURE__ */ e(
|
1452
|
+
/* @__PURE__ */ e(It, { amount: v, setAmount: R, fetchBalance: ue, getCoinBalance: _, isBalanceLoading: te }),
|
1453
|
+
/* @__PURE__ */ e(e1, { fallback: /* @__PURE__ */ e("div", { children: "Loading..." }), children: /* @__PURE__ */ e(Mt, {}) }),
|
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
|
+
/* @__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
|
+
/* @__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: D, getCoinBalance: _ })
|
1458
|
+
] }) : /* @__PURE__ */ e(Lt, { handleConfirmClose: Ge, amount: v, routesData: Q, resetAmount: I1, routes: X, handleStopRoute: Te, resetBalance: T1 }) }) });
|
1459
1459
|
}
|
1460
|
-
function
|
1460
|
+
function Ot({ fetchChains: t }) {
|
1461
1461
|
const [n, s] = k(!1), { isConnected: o } = fe();
|
1462
1462
|
function r(c) {
|
1463
1463
|
s(!n);
|
1464
1464
|
}
|
1465
1465
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1466
|
-
|
1466
|
+
Et,
|
1467
1467
|
{
|
1468
1468
|
handleShowWallet: r,
|
1469
1469
|
fetchChains: t,
|
@@ -1471,15 +1471,15 @@ function Et({ fetchChains: t }) {
|
|
1471
1471
|
}
|
1472
1472
|
) });
|
1473
1473
|
}
|
1474
|
-
const
|
1474
|
+
const Ut = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1475
1475
|
__proto__: null,
|
1476
|
-
default:
|
1476
|
+
default: Ot
|
1477
1477
|
}, Symbol.toStringTag, { value: "Module" }));
|
1478
1478
|
export {
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1479
|
+
ft as c,
|
1480
|
+
vt as g,
|
1481
|
+
Ut as i,
|
1482
1482
|
w1 as p,
|
1483
1483
|
m1 as r,
|
1484
|
-
|
1484
|
+
W1 as u
|
1485
1485
|
};
|