@blockend/widget 1.0.32 → 1.0.34
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-CPwuTwqd.js → AllRoutes-DW-2t6-d.js} +25 -25
- package/dist/{Box-CIChapvH.js → Box-C4X6PUtu.js} +21 -22
- package/dist/{EstGas-CEFILtyf.js → EstGas-Lj2vKAmO.js} +26 -30
- package/dist/{Grow-DJZj9zjv.js → Grow-CCS_DglL.js} +78 -78
- package/dist/{InputComp-DqF1JGIu.js → InputComp-FIX0Q9qG.js} +13 -14
- package/dist/{LoadRoute-r3sHTYXM.js → LoadRoute-Di4rBHfs.js} +6 -7
- package/dist/{QuotesProgress-BXVLxZ8U.js → QuotesProgress-CDe2mdH1.js} +1 -1
- package/dist/{SwapAsset-07WvVwl-.js → SwapAsset-B0GIHqge.js} +1 -1
- package/dist/{Tooltip-CNAsCF8n.js → Tooltip-CsLgOKrX.js} +62 -62
- package/dist/{TxnButton-D2TTkFYA.js → TxnButton-CFquc6ws.js} +19 -19
- package/dist/{add-t2GqC9VA.js → add-Cb5Hpxtd.js} +1 -1
- package/dist/{all-wallets-DFyf0q31.js → all-wallets-IvJFyonp.js} +1 -1
- package/dist/{app-store-aAahwmBP.js → app-store-DGHaTAGg.js} +1 -1
- package/dist/{apple-DeRgpwlc.js → apple-BzfrhDcG.js} +1 -1
- package/dist/{arrow-bottom-DdEOkaAj.js → arrow-bottom-BTM5yMbs.js} +1 -1
- package/dist/{arrow-bottom-circle-BWwREWcv.js → arrow-bottom-circle-wJZrQ1UB.js} +1 -1
- package/dist/{arrow-left-CulyLmoH.js → arrow-left-yb9jvZLF.js} +1 -1
- package/dist/{arrow-right-Dwr7TISn.js → arrow-right-CNq-seAV.js} +1 -1
- package/dist/{arrow-top-pL4rM_y8.js → arrow-top-viS3mMCD.js} +1 -1
- package/dist/{bank-CPuyK_08.js → bank-BCcggibH.js} +1 -1
- package/dist/{basic-CVc9xEvb.js → basic-DaTq2wkc.js} +3 -3
- package/dist/{browser-Cbq2Zbp4.js → browser-CmA0GPLB.js} +1 -1
- package/dist/{card-B_hUtPWK.js → card-BO4I6Psi.js} +1 -1
- package/dist/{ccip-BLVGcR4A.js → ccip-CkXLKCYn.js} +20 -20
- package/dist/{checkmark-WEqTsFAc.js → checkmark-DF8VoFaX.js} +1 -1
- package/dist/{checkmark-bold-Du_ZvhqM.js → checkmark-bold-C6OPR-mV.js} +1 -1
- package/dist/{chevron-bottom-C-s-lv4L.js → chevron-bottom-BTjaTIFm.js} +1 -1
- package/dist/{chevron-left-C7NcRElx.js → chevron-left-D6wphcsV.js} +1 -1
- package/dist/{chevron-right-CSzmAmdn.js → chevron-right-Ba05aF4G.js} +1 -1
- package/dist/{chevron-top-Dd99Wfel.js → chevron-top-I_q0NhsC.js} +1 -1
- package/dist/{chrome-store-C4p77Of0.js → chrome-store-DvzERGX1.js} +1 -1
- package/dist/{clock-Cib24qjH.js → clock-GIv_XdGS.js} +1 -1
- package/dist/{close-BXjEkTvS.js → close-ChDp2HIX.js} +1 -1
- package/dist/{coinPlaceholder-BFNC7cQN.js → coinPlaceholder-D6rBGR5B.js} +1 -1
- package/dist/{compass-CXPX5Ycp.js → compass-DFCkTDdC.js} +1 -1
- package/dist/{copy-BEawMbmF.js → copy-DyQCksHx.js} +1 -1
- package/dist/{core-Bez9Ow7F.js → core-BnRPnZUj.js} +3 -3
- package/dist/{cursor-Cxq4Q9jk.js → cursor-BhR8wfWc.js} +1 -1
- package/dist/{cursor-transparent-ZjJ0P2vr.js → cursor-transparent-CYfTh9TG.js} +1 -1
- package/dist/{desktop-BhZVovAp.js → desktop-CdNR2WGz.js} +1 -1
- package/dist/{disconnect-AC-bffZO.js → disconnect-Bbfhuf4x.js} +1 -1
- package/dist/{discord-dT97h-CC.js → discord-04uw628s.js} +1 -1
- package/dist/{down-DP56YSKp.js → down-DmSxEW66.js} +2 -2
- package/dist/{etherscan-rYFRhRTM.js → etherscan-D7Ga60vG.js} +1 -1
- package/dist/{exclamation-triangle-C-pCuC08.js → exclamation-triangle-CMEJoc37.js} +1 -1
- package/dist/{extension-BnqauLSn.js → extension-C0IOh4C8.js} +1 -1
- package/dist/{external-link-M9D6e_F3.js → external-link-CEy2KY-H.js} +1 -1
- package/dist/{facebook-DHezcoD-.js → facebook-XHE6-OiD.js} +1 -1
- package/dist/{farcaster-D0Ky-Imv.js → farcaster-BVsAZpup.js} +1 -1
- package/dist/{filters-B02NYLWq.js → filters-BjuqhDXY.js} +1 -1
- package/dist/{getChainIds-CJd2TZYT.js → getChainIds-cRV7v4Vu.js} +75 -75
- package/dist/{getCosmosAddress-DTZfw04G.js → getCosmosAddress-Cm0YEa9v.js} +2 -2
- package/dist/{github-BzQkIMuE.js → github-C5YGtlqc.js} +1 -1
- package/dist/{google-BpwCJ4Fs.js → google-DFDexaN0.js} +1 -1
- package/dist/{hamburger-BzqwkUjE.js → hamburger-CZPNB-Jp.js} +20 -20
- package/dist/{help-circle-C0nOySHC.js → help-circle-C2OFxIs0.js} +1 -1
- package/dist/{id-DFP_kFd4.js → id-CforGy9u.js} +1 -1
- package/dist/{image-QiYOAGjM.js → image-BLq9nQ13.js} +1 -1
- package/dist/{index-D5hLIe-N.js → index-BRrWKwgI.js} +1 -1
- package/dist/{index-DDk00SOL.js → index-Bw4t164c.js} +45 -45
- package/dist/{index-DaJ1272l.js → index-ByWf22Y4.js} +43 -43
- package/dist/index-C6pDnqRd.js +30456 -0
- package/dist/{index-DXdD3L9f.js → index-Cx-XaRo6.js} +243 -243
- package/dist/{index-CrC4B7xn.js → index-D7-VO30b.js} +22 -23
- package/dist/{index-DxPp2gBS.js → index-DKPTk58K.js} +78 -78
- package/dist/{index-CjtwASJt.js → index-DrWi5MDR.js} +4 -4
- package/dist/{index-DW3W7zaF.js → index-EuXqE26M.js} +53 -54
- package/dist/{index-Dy_n2MPD.js → index-HOk_h4cO.js} +14 -14
- package/dist/{index-oc8HPfOF.js → index-sSdagBAC.js} +93 -93
- package/dist/{index.es-C-j-Ghef.js → index.es-B1r2oZcy.js} +2 -2
- package/dist/{index.es-Bsr7zP98.js → index.es-DP4lrxUS.js} +5 -5
- package/dist/index.es.js +1 -1
- package/dist/{info-BTLQJ-wd.js → info-CJ1NTOxH.js} +1 -1
- package/dist/{info-circle-Dla9169_.js → info-circle-Daj7vZoR.js} +1 -1
- package/dist/{lightbulb-PN8DA_Wh.js → lightbulb-BLkY2HTh.js} +1 -1
- package/dist/{mail-BGYZut_4.js → mail-CAKz4cbl.js} +1 -1
- package/dist/{mobile-BM760ZzX.js → mobile-BopKRCBe.js} +1 -1
- package/dist/{more-rHGnl2ck.js → more-X_2v_wZ3.js} +1 -1
- package/dist/{network-placeholder-CyQl-3_2.js → network-placeholder-C1OcyWkc.js} +1 -1
- package/dist/{nftPlaceholder-nuUJ8nKY.js → nftPlaceholder-B3ZKQ1U2.js} +1 -1
- package/dist/{off-GYlwYDrT.js → off-OZ4tqosO.js} +1 -1
- package/dist/{play-store-Ck01Ez1F.js → play-store-HsWGEr_g.js} +1 -1
- package/dist/{plus-CQfXWgLw.js → plus-C7yRM6wl.js} +1 -1
- package/dist/{qr-code-CyLVwLY7.js → qr-code-DfWVQYKi.js} +1 -1
- package/dist/{recycle-horizontal-DvnWPcEQ.js → recycle-horizontal-C5u6LBUM.js} +1 -1
- package/dist/{refresh-BOxj8b2n.js → refresh-BYw1HzOO.js} +1 -1
- package/dist/{reown-logo-D1iprOTg.js → reown-logo-CXMihtcp.js} +1 -1
- package/dist/{search-DrPaZPnc.js → search-ByiAQZVh.js} +1 -1
- package/dist/{send-ybBREe4b.js → send-Bs5FwLBZ.js} +1 -1
- package/dist/shareicon-CG3v7iKI.js +10 -0
- package/dist/{swapHorizontal-BddjZdXK.js → swapHorizontal-B7d_h2Se.js} +1 -1
- package/dist/{swapHorizontalBold-B6AWjPZ9.js → swapHorizontalBold-xBnEd6a1.js} +1 -1
- package/dist/{swapHorizontalMedium-CNacWoBn.js → swapHorizontalMedium-aLC75TbM.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-B8VcPnqt.js → swapHorizontalRoundedBold-D1ph5kGS.js} +1 -1
- package/dist/{swapVertical-zY2BbSyQ.js → swapVertical-DtfbArUn.js} +1 -1
- package/dist/{telegram-DS4l-8Oc.js → telegram-0Il36fMk.js} +1 -1
- package/dist/{three-dots-RctNqamK.js → three-dots-wNW622nV.js} +1 -1
- package/dist/{twitch-CJ0llIIH.js → twitch-Dt1-Wtif.js} +1 -1
- package/dist/{twitterIcon-pgvN9-bP.js → twitterIcon-CpSpHPYu.js} +1 -1
- package/dist/{unsupportedProp-BJVuEW_b.js → unsupportedProp-DBVCAgxp.js} +1 -1
- package/dist/{useRegisterError-C_YLA1dw.js → useRegisterError-Cs0PKbRQ.js} +3257 -4302
- package/dist/{verify-BeZLo1Fq.js → verify-BFIm6NMn.js} +1 -1
- package/dist/{verify-filled-meyb7E16.js → verify-filled-bGZT7egL.js} +1 -1
- package/dist/{w3m-modal-C-Jp9NVv.js → w3m-modal-C6VaThR4.js} +2 -2
- package/dist/{wallet-CFcOgSsz.js → wallet-BeQcPBdd.js} +1 -1
- package/dist/{wallet-placeholder-CeUMILZq.js → wallet-placeholder-CCGVvv4Q.js} +1 -1
- package/dist/{walletconnect-D6LB1PyC.js → walletconnect-BnSO61ut.js} +1 -1
- package/dist/{warning-circle-BRtzofvT.js → warning-circle-D80fIuKG.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-DKQAOOh3.js → x-4jy71myv.js} +1 -1
- package/package.json +7 -19
- package/dist/index-CLzkn733.js +0 -28223
- package/dist/secp256k1-DgmH1qVg.js +0 -1251
- package/dist/shareicon-D3Qj5j1T.js +0 -262
@@ -1,17 +1,17 @@
|
|
1
|
-
import { jsxs as u, jsx as e, Fragment as
|
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 I1, Suspense as B1 } from "react";
|
3
|
-
import { B as A1, i as
|
4
|
-
import { u as a, l as pe, a as i1, c as Ve } from "./index-
|
5
|
-
import { C as
|
3
|
+
import { B as A1, i as Ee, u as ke, F as De, f as $e, C as _e, W as s1 } from "./useRegisterError-Cs0PKbRQ.js";
|
4
|
+
import { u as a, l as pe, a as i1, c as Ve, S as j1, M as P1 } from "./index-C6pDnqRd.js";
|
5
|
+
import { C as L1, M as F1, g as e1 } from "./getChainIds-cRV7v4Vu.js";
|
6
6
|
import { useQuery as l1 } from "@tanstack/react-query";
|
7
|
-
import { useAccount as ge, useConnect as
|
8
|
-
import { useDynamicContext as Ne, useIsLoggedIn as
|
9
|
-
import { S as
|
10
|
-
import { u as
|
11
|
-
import { useAccount as
|
12
|
-
import { S as
|
13
|
-
import { R as
|
14
|
-
import { C as ze, P as be, u as
|
7
|
+
import { useAccount as ge, useConnect as M1, useConnections as E1, useBalance as O1 } from "wagmi";
|
8
|
+
import { useDynamicContext as Ne, useIsLoggedIn as R1, useUserWallets as $1 } from "@dynamic-labs/sdk-react-core";
|
9
|
+
import { S as _1 } from "./shareicon-CG3v7iKI.js";
|
10
|
+
import { u as V1, B as z1 } from "./index-EuXqE26M.js";
|
11
|
+
import { useAccount as Oe, useStargateClient as a1, useSuggestChainAndConnect as S1, WalletType as Z1 } from "graz";
|
12
|
+
import { S as H1, D as G1 } from "./down-DmSxEW66.js";
|
13
|
+
import { R as K1 } from "./index-CDq3vNnP.js";
|
14
|
+
import { C as ze, P as be, u as J1, g as t1 } from "./getCosmosAddress-Cm0YEa9v.js";
|
15
15
|
function c1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ u(
|
17
17
|
"svg",
|
@@ -46,8 +46,8 @@ function c1({ fill: t }) {
|
|
46
46
|
}
|
47
47
|
);
|
48
48
|
}
|
49
|
-
function
|
50
|
-
const [r, c] = N(t), [b, d] = N(""), { tick: l, defaultCoin: p } =
|
49
|
+
function q1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
50
|
+
const [r, c] = N(t), [b, d] = N(""), { tick: l, 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(
|
@@ -94,8 +94,8 @@ function J1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
|
94
94
|
"div",
|
95
95
|
{
|
96
96
|
onClick: () => {
|
97
|
-
let
|
98
|
-
n(y), o(
|
97
|
+
let P = { chain: y.name, ...y };
|
98
|
+
n(y), o(P);
|
99
99
|
},
|
100
100
|
className: `first-letter:bw-py-2 bw-cursor-pointer bw-border-b bw-flex bw-items-center bw-justify-between bw-gap-x-3 bw-border-border-primary bw-text-sm bw-font-normal bw-text-text-primary
|
101
101
|
|
@@ -106,7 +106,7 @@ function J1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
|
106
106
|
/* @__PURE__ */ e("img", { src: (T = y.image) != null && T.length ? y.image : p, className: "bw-rounded-[50%] bw-border bw-border-border-primary", width: 25, height: 25, alt: "img" }),
|
107
107
|
" ",
|
108
108
|
/* @__PURE__ */ e("p", { children: y.name }),
|
109
|
-
s.chain === y.name ? /* @__PURE__ */ e("img", { src: l, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(
|
109
|
+
s.chain === y.name ? /* @__PURE__ */ e("img", { src: l, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(K, {})
|
110
110
|
] }),
|
111
111
|
/* @__PURE__ */ u("div", { className: "bw-pr-2", children: [
|
112
112
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal", children: "Tokens" }),
|
@@ -119,16 +119,16 @@ function J1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
|
119
119
|
}) })
|
120
120
|
] });
|
121
121
|
}
|
122
|
-
const
|
123
|
-
gradientbackground:
|
124
|
-
overlay:
|
122
|
+
const X1 = "_gradientbackground_7x8s8_1", Q1 = "_overlay_7x8s8_5", n1 = {
|
123
|
+
gradientbackground: X1,
|
124
|
+
overlay: Q1
|
125
125
|
};
|
126
|
-
function
|
126
|
+
function W1(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
|
131
|
-
const [n, o] = N({}), s = a((l) => l.cosmosChainIds), { data: r } =
|
130
|
+
function U1(t) {
|
131
|
+
const [n, o] = N({}), s = a((l) => l.cosmosChainIds), { data: r } = Oe({
|
132
132
|
chainId: s,
|
133
133
|
multiChain: !0
|
134
134
|
}), c = a((l) => l.fromChain), { data: b } = a1({
|
@@ -140,8 +140,8 @@ function W1(t) {
|
|
140
140
|
if ((p = r == null ? void 0 : r[l]) != null && p.bech32Address && b) {
|
141
141
|
let T = await (b[l] || b).getAllBalances(
|
142
142
|
(y = r == null ? void 0 : r[l]) == null ? void 0 : y.bech32Address
|
143
|
-
),
|
144
|
-
o(
|
143
|
+
), P = pe.keyBy(T, "denom");
|
144
|
+
o(P);
|
145
145
|
}
|
146
146
|
}
|
147
147
|
return B(() => {
|
@@ -156,7 +156,7 @@ function b1(t) {
|
|
156
156
|
} else
|
157
157
|
return t;
|
158
158
|
}
|
159
|
-
function
|
159
|
+
function Y1({ fill: t }) {
|
160
160
|
return /* @__PURE__ */ u(
|
161
161
|
"svg",
|
162
162
|
{
|
@@ -191,7 +191,7 @@ function U1({ fill: t }) {
|
|
191
191
|
}
|
192
192
|
);
|
193
193
|
}
|
194
|
-
function
|
194
|
+
function D1({ selectedChain: t }) {
|
195
195
|
return /* @__PURE__ */ u("div", { className: "bw-h-[100%] bw-flex bw-flex-col bw-justify-center bw-items-center", children: [
|
196
196
|
/* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center bw-items-center", children: /* @__PURE__ */ u("div", { className: "bw-relative", children: [
|
197
197
|
t != null && t.image ? /* @__PURE__ */ e(
|
@@ -201,8 +201,8 @@ function Y1({ selectedChain: t }) {
|
|
201
201
|
className: "bw-w-[80px] bw-h-[80px] bw-border-border-primary bw-border-2 bw-opacity-50 bw-rounded-[50%]",
|
202
202
|
alt: "chain"
|
203
203
|
}
|
204
|
-
) : /* @__PURE__ */ e(
|
205
|
-
/* @__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(
|
204
|
+
) : /* @__PURE__ */ e(K, {}),
|
205
|
+
/* @__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(Y1, { fill: "var(--tw-text-secondary)" }) })
|
206
206
|
] }) }),
|
207
207
|
/* @__PURE__ */ u("h2", { className: "bw-text-base bw-text-center bw-mt-3 bw-font-bold bw-text-text-primary", children: [
|
208
208
|
"No Tokens found on ",
|
@@ -216,84 +216,84 @@ function Y1({ selectedChain: t }) {
|
|
216
216
|
] })
|
217
217
|
] });
|
218
218
|
}
|
219
|
-
const
|
220
|
-
var
|
219
|
+
const et = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s, showExchangeList: r, setCoinData: c, setChainData: b }) {
|
220
|
+
var Be, Ae;
|
221
221
|
a((w) => w.searchCustomCoin);
|
222
|
-
const d = a((w) => w.setSearchCustomCoin), { ref: l, inView: p } =
|
223
|
-
|
224
|
-
const C = y(n), A = a((w) => w.fromChain), v = a((w) => w.fromCoin), Z = a((w) => w.toChain),
|
222
|
+
const d = a((w) => w.setSearchCustomCoin), { ref: l, inView: p } = V1(), { getWallet: y } = ke({}), { connected: I, address: T } = i1(), { isConnected: P, address: f } = ge(), { primaryWallet: h } = Ne();
|
223
|
+
R1();
|
224
|
+
const C = y(n), A = a((w) => w.fromChain), v = a((w) => w.fromCoin), Z = a((w) => w.toChain), H = a((w) => w.toCoin), [re, L] = N(!1), { cosmosBalance: R } = U1(n), { defaultCoin: _ } = Ee, [J, g] = N(0), m = I1(null), { data: k } = Oe({
|
225
225
|
chainId: [n.chainId],
|
226
226
|
multiChain: !0
|
227
|
-
}), M = (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" && T || (n == null ? void 0 : n.networkType) === "cosmos" && ((
|
227
|
+
}), M = (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" && 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 = a((w) => w.toDisconnect);
|
228
228
|
a((w) => w.setToDisconnect);
|
229
|
-
const x = a((w) => w.customWallet),
|
229
|
+
const x = a((w) => w.customWallet), O = a((w) => w.setCustomWallet), $ = a((w) => w.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
|
-
enabled: !!((
|
232
|
+
enabled: !!((Ae = C == null ? void 0 : C.address) != null && Ae.length && n.chainId),
|
233
233
|
refetchOnWindowFocus: !1
|
234
234
|
});
|
235
|
-
function
|
236
|
-
var
|
237
|
-
let
|
238
|
-
return w.networkType == "cosmos" ? $e(((
|
235
|
+
function z(w) {
|
236
|
+
var ee, ae, oe, se, q, W, U, te, S, X, ce, ne;
|
237
|
+
let D = b1(w.address);
|
238
|
+
return w.networkType == "cosmos" ? $e(((ee = R == null ? void 0 : R[D]) == null ? void 0 : ee.amount) / Math.pow(10, w.decimals) || 0) || "" : $e((((W = (q = (se = (oe = (ae = Q.data) == null ? void 0 : ae.data) == null ? void 0 : oe[n == null ? void 0 : n.networkType]) == null ? void 0 : se[n.chainId]) == null ? void 0 : q[w.address]) == null ? void 0 : W.balance) || 0) / Math.pow(10, ((ne = (ce = (X = (S = (te = (U = Q.data) == null ? void 0 : U.data) == null ? void 0 : te[n == null ? void 0 : n.networkType]) == null ? void 0 : S[n.chainId]) == null ? void 0 : X[w.address]) == null ? void 0 : ce.asset) == null ? void 0 : ne.decimals) || 0) || 0) || "";
|
239
239
|
}
|
240
240
|
B(() => {
|
241
|
-
o.length > 40 &&
|
241
|
+
o.length > 40 && W1(o) && !V.length ? (L(!0), d({
|
242
242
|
chainId: n.chainId,
|
243
243
|
address: o
|
244
|
-
})) : o.length || (
|
245
|
-
}, [o,
|
244
|
+
})) : o.length || (L(!1), d({ chainId: "", address: "" }));
|
245
|
+
}, [o, V]), B(() => {
|
246
246
|
g(0);
|
247
247
|
}, [o]);
|
248
|
-
function
|
249
|
-
g(0),
|
248
|
+
function Ie() {
|
249
|
+
g(0), ie([]), m.current.scrollTo(0, 0);
|
250
250
|
}
|
251
251
|
B(() => {
|
252
|
-
var w,
|
253
|
-
|
254
|
-
}, [
|
255
|
-
|
252
|
+
var w, D;
|
253
|
+
G != null && G.isSuccess && (n != null && n.chainId) && j(((D = (w = G == null ? void 0 : G.data) == null ? void 0 : w.data) == null ? void 0 : D[n == null ? void 0 : n.chainId]) || []);
|
254
|
+
}, [G, n.chainId]), B(() => {
|
255
|
+
Ie();
|
256
256
|
}, [n.chainId]);
|
257
257
|
function ye() {
|
258
|
-
var
|
259
|
-
let w = (
|
260
|
-
var
|
261
|
-
return ((
|
262
|
-
})) == null ? void 0 :
|
263
|
-
if (M) return
|
264
|
-
}),
|
265
|
-
|
258
|
+
var se;
|
259
|
+
let w = (se = E == null ? void 0 : E.filter((q) => {
|
260
|
+
var W, U, te, 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 = (te = q.address) == null ? void 0 : te.toLowerCase()) == null ? void 0 : S.includes(o == null ? void 0 : o.toLowerCase()));
|
262
|
+
})) == null ? void 0 : se.sort((q, W) => {
|
263
|
+
if (M) return z(W) * W.lastPrice - z(q) * q.lastPrice;
|
264
|
+
}), D = 20, ee = J * D, ae = ee + D, oe = w.slice(ee, ae);
|
265
|
+
J == 0 ? ie([...oe]) : ie([...V, ...oe]);
|
266
266
|
}
|
267
267
|
return B(() => {
|
268
268
|
E != null && E.length && ye();
|
269
|
-
}, [E, o,
|
269
|
+
}, [E, o, J, M, R, Q.data]), B(() => {
|
270
270
|
p && g((w) => w + 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:
|
272
|
-
var ae,
|
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((w, D, ee) => {
|
272
|
+
var ae, oe, se, q, W, U;
|
273
273
|
return /* @__PURE__ */ u(
|
274
274
|
"div",
|
275
275
|
{
|
276
|
-
ref:
|
276
|
+
ref: ee.length >= 20 && ee.length - 1 === D ? l : null,
|
277
277
|
className: `bw-py-2
|
278
|
-
${r == "from" &&
|
278
|
+
${r == "from" && H._id !== w._id || r == "to" && v._id !== w._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,
|
284
|
-
let
|
283
|
+
var S, X, ce, ne, Ce, le, we, je, ve, Pe, Le;
|
284
|
+
let te = {
|
285
285
|
// ...coinData,
|
286
286
|
coin: w.symbol,
|
287
287
|
...w,
|
288
|
-
availBal: ((Ce = (
|
288
|
+
availBal: ((Ce = (ne = (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 : ne[w.address.toLowerCase()]) == null ? void 0 : Ce.balance) / Math.pow(10, ((Le = (Pe = (ve = (je = (we = (le = Q.data) == null ? void 0 : le.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[w.address.toLowerCase()]) == null ? void 0 : Pe.asset) == null ? void 0 : Le.decimals) || 0)
|
289
289
|
};
|
290
|
-
c(
|
290
|
+
c(te), b(n), s(n, te), (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
294
|
/* @__PURE__ */ u("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(ae = w.image) != null && ae.length ? "bw-bg-background-coin" : ""}`, children: [
|
295
|
-
(
|
296
|
-
(
|
295
|
+
(oe = w.image) != null && oe.length ? /* @__PURE__ */ e("img", { src: w.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
|
+
(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-coin" : ""} 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-coin 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: [
|
@@ -310,78 +310,78 @@ const D1 = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s
|
|
310
310
|
/* @__PURE__ */ e(
|
311
311
|
"a",
|
312
312
|
{
|
313
|
-
href: (
|
313
|
+
href: (U = (W = n.explorer) == null ? void 0 : W.token) == null ? void 0 : U.replace("{tokenAddress}", w.address),
|
314
314
|
target: "_blank",
|
315
|
-
onClick: (
|
316
|
-
|
315
|
+
onClick: (te) => {
|
316
|
+
te.stopPropagation();
|
317
317
|
},
|
318
318
|
className: "hover:bw-opacity-70",
|
319
|
-
children: /* @__PURE__ */ e(
|
319
|
+
children: /* @__PURE__ */ e(_1, { fill: "var(--tw-text-secondary)" })
|
320
320
|
}
|
321
321
|
)
|
322
322
|
] })
|
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(
|
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(w) > 0 ? /* @__PURE__ */ u(K, { children: [
|
327
327
|
/* @__PURE__ */ e(
|
328
328
|
De,
|
329
329
|
{
|
330
|
-
value:
|
330
|
+
value: z(w) || "",
|
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:
|
336
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: z(w) * w.lastPrice > 0 ? /* @__PURE__ */ u(K, { children: [
|
337
337
|
"$",
|
338
338
|
/* @__PURE__ */ e(
|
339
339
|
De,
|
340
340
|
{
|
341
|
-
value: $e(
|
341
|
+
value: $e(z(w) * w.lastPrice),
|
342
342
|
options: {
|
343
343
|
maxDecimals: 10
|
344
344
|
}
|
345
345
|
}
|
346
346
|
)
|
347
347
|
] }) : "" })
|
348
|
-
] }) : /* @__PURE__ */ e(
|
348
|
+
] }) : /* @__PURE__ */ e(K, {}) : /* @__PURE__ */ e(K, {}) }) })
|
349
349
|
]
|
350
350
|
},
|
351
|
-
|
351
|
+
D
|
352
352
|
);
|
353
|
-
}) :
|
353
|
+
}) : re && !($.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
|
-
function
|
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 [d, l] = N(!1), [p, y] = N(""), I = a((x) => x.tokens), [T,
|
357
|
+
const [d, l] = N(!1), [p, y] = N(""), I = a((x) => x.tokens), [T, P] = N([]), [f, h] = N(0), [C, A] = N({ chain: "" }), v = a((x) => x.gradient), Z = a((x) => x.configuration), H = a((x) => x.chainObj);
|
358
358
|
B(() => {
|
359
|
-
var x,
|
360
|
-
if ((
|
361
|
-
let
|
362
|
-
|
359
|
+
var x, O, $, E;
|
360
|
+
if ((O = (x = b.data) == null ? void 0 : x.data) != null && O.length) {
|
361
|
+
let j = [...(E = ($ = b.data) == null ? void 0 : $.data) == null ? void 0 : E.slice(0, 9)], V = j.findIndex((z) => z.chainId === "137"), ie = j.findIndex((z) => z.chainId === "324"), Te = j.findIndex((z) => z.chainId === "10"), Y = j.findIndex((z) => z.chainId === "43114");
|
362
|
+
j.splice(V, 1, H[80094]), j.splice(ie, 1, H[2741]), j.splice(Te, 1, H["eclipse-svm"]), j.splice(Y, 1, H[999]), !!pe.keyBy(j, "chainId")[C.chainId] || (j.pop(), j.push(C)), P(j);
|
363
363
|
}
|
364
|
-
}, [
|
364
|
+
}, [H, (g = b.data) == null ? void 0 : g.data, s, C]), B(() => {
|
365
365
|
A(s);
|
366
366
|
}, [s]), B(() => {
|
367
|
-
var x,
|
368
|
-
if ((
|
369
|
-
let E = ($ = b.data) == null ? void 0 : $.data.filter((
|
367
|
+
var x, O, $;
|
368
|
+
if ((O = (x = b.data) == null ? void 0 : x.data) != null && O.length) {
|
369
|
+
let E = ($ = b.data) == null ? void 0 : $.data.filter((j) => !0);
|
370
370
|
h(E.length);
|
371
371
|
}
|
372
372
|
}, [(m = b.data) == null ? void 0 : m.data]);
|
373
|
-
function
|
373
|
+
function re(x, O) {
|
374
374
|
var $, E;
|
375
|
-
($ = x.chain) != null && $.length && ((E =
|
375
|
+
($ = x.chain) != null && $.length && ((E = O == null ? void 0 : O.coin) != null && E.length) && o();
|
376
376
|
}
|
377
|
-
function
|
377
|
+
function L() {
|
378
378
|
l(!1);
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function R(x) {
|
381
381
|
A(x);
|
382
382
|
}
|
383
|
-
const { tick:
|
384
|
-
return d ? /* @__PURE__ */ e(
|
383
|
+
const { tick: _, defaultCoin: J } = Ee;
|
384
|
+
return d ? /* @__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(
|
@@ -391,7 +391,7 @@ function et({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
391
391
|
o(), (!r.coin.length || !s.chain.length) && (n({ coin: "" }), t({ chain: "" }));
|
392
392
|
},
|
393
393
|
className: "bw-absolute bw-left-0 bw-top-[25%]",
|
394
|
-
children: /* @__PURE__ */ e(
|
394
|
+
children: /* @__PURE__ */ e(L1, { fill: "var(--tw-text-secondary)" })
|
395
395
|
}
|
396
396
|
),
|
397
397
|
/* @__PURE__ */ u("div", { className: "bw-text-base bw-font-normal bw-text-text-secondary", children: [
|
@@ -399,8 +399,8 @@ function et({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
399
399
|
" Network"
|
400
400
|
] })
|
401
401
|
] }),
|
402
|
-
b.isLoading ? /* @__PURE__ */ e(
|
403
|
-
b.isSuccess && T.map((x,
|
402
|
+
b.isLoading ? /* @__PURE__ */ e(j1, { 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__ */ u("div", { className: "bw-grid bw-grid-cols-5 bw-gap-1 bw-overflow-y-auto bw-w-full", children: [
|
403
|
+
b.isSuccess && T.map((x, O) => {
|
404
404
|
var $, E;
|
405
405
|
return /* @__PURE__ */ e(
|
406
406
|
"div",
|
@@ -413,26 +413,26 @@ function et({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
413
413
|
"div",
|
414
414
|
{
|
415
415
|
onClick: () => {
|
416
|
-
let
|
416
|
+
let j = {
|
417
417
|
chain: x.name,
|
418
418
|
...x
|
419
419
|
// networkType: "cosmos",
|
420
420
|
};
|
421
|
-
|
421
|
+
R(j);
|
422
422
|
},
|
423
423
|
className: "bw-p-2 bw-w-full bw-aspect-video bw-relative bw-z-10 bw-bg-background-networkcard bw-rounded-md bw-flex bw-flex-col bw-justify-center bw-items-center",
|
424
424
|
style: { cursor: "pointer" },
|
425
425
|
children: [
|
426
|
-
/* @__PURE__ */ e("img", { src: ($ = x.image) != null && $.length ? x.image :
|
426
|
+
/* @__PURE__ */ e("img", { src: ($ = x.image) != null && $.length ? x.image : J, width: 25, className: "bw-rounded-[50%] bw-border bw-border-border-primary", height: 25, alt: "img" }),
|
427
427
|
" ",
|
428
428
|
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${C.name == x.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((E = x.name) == null ? void 0 : E.length) > 7 ? x.name.substring(0, 7) + ".." : x.name }),
|
429
|
-
(C == null ? void 0 : C.chain) == x ? /* @__PURE__ */ e("img", { width: 10, height: 10, src:
|
429
|
+
(C == null ? void 0 : C.chain) == x ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: _ }) : /* @__PURE__ */ e(K, {})
|
430
430
|
]
|
431
431
|
},
|
432
|
-
|
432
|
+
O
|
433
433
|
)
|
434
434
|
},
|
435
|
-
|
435
|
+
O
|
436
436
|
);
|
437
437
|
}),
|
438
438
|
b.isSuccess && T.length ? /* @__PURE__ */ e("div", { className: "bw-p-[2px] bw-w-full", children: /* @__PURE__ */ u(
|
@@ -448,7 +448,7 @@ function et({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
448
448
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-primary", children: "Networks" })
|
449
449
|
]
|
450
450
|
}
|
451
|
-
) }) : /* @__PURE__ */ e(
|
451
|
+
) }) : /* @__PURE__ */ e(K, {})
|
452
452
|
] })
|
453
453
|
] }),
|
454
454
|
/* @__PURE__ */ u("div", { children: [
|
@@ -474,15 +474,15 @@ function et({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coi
|
|
474
474
|
placeholder: "Search Token Name or Contract Address"
|
475
475
|
}
|
476
476
|
),
|
477
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (I.isLoading || I.isFetching) && p.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(
|
477
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (I.isLoading || I.isFetching) && p.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(H1, {}) }) : /* @__PURE__ */ e(c1, { fill: "var(--tw-background-secondary)" }) })
|
478
478
|
]
|
479
479
|
}
|
480
480
|
),
|
481
|
-
/* @__PURE__ */ e(
|
481
|
+
/* @__PURE__ */ e(et, { value: p, handleClosePopup: re, showExchangeList: c, setChainData: t, setCoinData: n, selectChainState: C })
|
482
482
|
] })
|
483
483
|
] });
|
484
484
|
}
|
485
|
-
function
|
485
|
+
function nt({
|
486
486
|
walletDetails: t,
|
487
487
|
handleToDisconnect: n,
|
488
488
|
show: o,
|
@@ -490,18 +490,18 @@ function tt({
|
|
490
490
|
handleShowWallet: r,
|
491
491
|
setConnectWalletField: c
|
492
492
|
}) {
|
493
|
-
const [b, d] = N(null), { address: l, chain: p, data: y, disconnect: I, ...T } = t, [
|
493
|
+
const [b, d] = N(null), { address: l, chain: p, data: y, disconnect: I, ...T } = t, [P, f] = N(), { connector: h } = ge(), { connectors: C } = M1(), A = () => {
|
494
494
|
c(o), o == "to" ? (v(), n(!0)) : v();
|
495
495
|
};
|
496
|
-
|
496
|
+
E1(), B(() => {
|
497
497
|
C.length && f(
|
498
498
|
pe.keyBy(C, (Z) => Z.uid)
|
499
499
|
);
|
500
500
|
}, [C]);
|
501
501
|
async function v() {
|
502
|
-
s === "evm" && (p == null ? void 0 : p.network) !== "custom" && (
|
502
|
+
s === "evm" && (p == null ? void 0 : p.network) !== "custom" && (P != null && P[h == null ? void 0 : h.uid]), r();
|
503
503
|
}
|
504
|
-
return /* @__PURE__ */ e(
|
504
|
+
return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
|
505
505
|
"button",
|
506
506
|
{
|
507
507
|
"aria-haspopup": "true",
|
@@ -509,7 +509,7 @@ function tt({
|
|
509
509
|
id: "basic-button",
|
510
510
|
style: { fontSize: "12px" },
|
511
511
|
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",
|
512
|
-
children: l ? /* @__PURE__ */ u(
|
512
|
+
children: l ? /* @__PURE__ */ u(K, { children: [
|
513
513
|
/* @__PURE__ */ e("p", { className: "bw-text-text-primary bw-text-xs bw-font-normal", children: ((l == null ? void 0 : l.substring(0, 4)) || "") + "..." + ((l == null ? void 0 : l.substring(l.length - 4, l.length)) || "") }),
|
514
514
|
/* @__PURE__ */ e(
|
515
515
|
"div",
|
@@ -522,10 +522,10 @@ function tt({
|
|
522
522
|
) });
|
523
523
|
}
|
524
524
|
function r1({ chainData: t, setShowExchangeList: n, handleShowWallet: o, setConnectWalletField: s, coinData: r, show: c }) {
|
525
|
-
var A, v, Z,
|
525
|
+
var A, v, Z, H, re, L, R, _, J;
|
526
526
|
const b = a((g) => g.configuration), d = a((g) => g.customWallet), { isConnected: l, isConnecting: p, isReconnecting: y } = ge();
|
527
527
|
Ne();
|
528
|
-
const { defaultCoin: I } =
|
528
|
+
const { defaultCoin: I } = Ee, { isAnyWalletConnected: T, getWallet: P } = ke({
|
529
529
|
chainData: t,
|
530
530
|
show: c
|
531
531
|
});
|
@@ -557,26 +557,26 @@ function r1({ chainData: t, setShowExchangeList: n, handleShowWallet: o, setConn
|
|
557
557
|
children: [
|
558
558
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-min-w-[78px] bw-min-h-[28px] bw-items-center bw-gap-x-2", children: [
|
559
559
|
(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" }),
|
560
|
-
/* @__PURE__ */ e(
|
560
|
+
/* @__PURE__ */ e(G1, { fill: (H = r == null ? void 0 : r.coin) != null && H.length ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" })
|
561
561
|
] }),
|
562
|
-
(
|
562
|
+
(re = t == null ? void 0 : t.chain) != null && re.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" })
|
563
563
|
]
|
564
564
|
}
|
565
565
|
)
|
566
566
|
]
|
567
567
|
}
|
568
568
|
),
|
569
|
-
/* @__PURE__ */ e(
|
569
|
+
/* @__PURE__ */ e(rt, { isConnected: c == "to" ? (f == null ? void 0 : f.networkType) === (h == null ? void 0 : h.networkType) ? !!((R = (L = P(f)) == null ? void 0 : L.address) != null && R.length || (d == null ? void 0 : d.length) > 30) : !!((J = (_ = P(h)) == null ? void 0 : _.address) != null && J.length || (d == null ? void 0 : d.length) > 30) : T, setConnectWalletField: s, handleShowWallet: o, show: c, chainData: t, handleToDisconnect: C })
|
570
570
|
] });
|
571
571
|
}
|
572
|
-
function
|
572
|
+
function rt({ isConnected: t, setConnectWalletField: n, handleShowWallet: o, show: s, chainData: r, handleToDisconnect: c }) {
|
573
573
|
var y;
|
574
574
|
const b = a((I) => I.customWallet), d = a((I) => I.fromChain), l = a((I) => I.toChain), { getWallet: p } = ke({
|
575
575
|
chainData: r,
|
576
576
|
show: s
|
577
577
|
});
|
578
578
|
return /* @__PURE__ */ e("div", { className: "bw-mt-2 bw-flex bw-justify-end", children: t ? /* @__PURE__ */ e(
|
579
|
-
|
579
|
+
nt,
|
580
580
|
{
|
581
581
|
walletDetails: (b == null ? void 0 : b.length) > 30 && s == "to" ? p({}) : (d == null ? void 0 : d.networkType) == (l == null ? void 0 : l.networkType) && s == "to" ? {
|
582
582
|
disconnect: c,
|
@@ -602,10 +602,10 @@ function nt({ isConnected: t, setConnectWalletField: n, handleShowWallet: o, sho
|
|
602
602
|
}
|
603
603
|
) });
|
604
604
|
}
|
605
|
-
const
|
606
|
-
gradient:
|
605
|
+
const ot = "_gradient_15zwe_1", Se = {
|
606
|
+
gradient: ot
|
607
607
|
};
|
608
|
-
function
|
608
|
+
function st({ mode: t, handleMode: n }) {
|
609
609
|
var s, r;
|
610
610
|
const o = a((c) => c.configuration);
|
611
611
|
return /* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center", children: /* @__PURE__ */ u(
|
@@ -695,7 +695,7 @@ function ot({ mode: t, handleMode: n }) {
|
|
695
695
|
}
|
696
696
|
) });
|
697
697
|
}
|
698
|
-
function
|
698
|
+
function it({ fill: t }) {
|
699
699
|
return /* @__PURE__ */ e(
|
700
700
|
"svg",
|
701
701
|
{
|
@@ -748,11 +748,11 @@ function d1({ options: t, handleOptions: n }) {
|
|
748
748
|
bw-flex bw-flex-1 bw-relative bw-h-full bw-rounded-md bw-gap-x-1 bw-justify-center bw-items-center `,
|
749
749
|
children: [
|
750
750
|
b.value === "ultra" ? /* @__PURE__ */ e(
|
751
|
-
|
751
|
+
it,
|
752
752
|
{
|
753
753
|
fill: b.value === t.value ? "var(--tw-text-primary)" : "var(--tw-text-secondary)"
|
754
754
|
}
|
755
|
-
) : /* @__PURE__ */ e(
|
755
|
+
) : /* @__PURE__ */ e(K, {}),
|
756
756
|
/* @__PURE__ */ e(
|
757
757
|
"p",
|
758
758
|
{
|
@@ -850,7 +850,7 @@ function p1({ handleClose: t }) {
|
|
850
850
|
return /* @__PURE__ */ u("div", { className: "bw-w-full bw-relative bw-flex bw-items-center bw-justify-center", children: [
|
851
851
|
/* @__PURE__ */ e("h2", { className: "bw-text-2xl bw-font-bold bw-text-text-primary", children: "Config" }),
|
852
852
|
/* @__PURE__ */ e(
|
853
|
-
|
853
|
+
z1,
|
854
854
|
{
|
855
855
|
disableRipple: !0,
|
856
856
|
onClick: t,
|
@@ -907,12 +907,12 @@ function x1() {
|
|
907
907
|
/* @__PURE__ */ e("div", { className: "bw-h-[1px] bw-flex-1 bw-bg-border-primary " })
|
908
908
|
] });
|
909
909
|
}
|
910
|
-
function
|
911
|
-
const [n, o] = N(""), [s, r] = N({ name: "Low", value: "low" }), [c, b] = N(""), [d, l] = N(""), [p, y] = N(""), I = a((g) => g.broadCastMode), T = a((g) => g.customFee),
|
912
|
-
function
|
910
|
+
function lt({ handleClose: t }) {
|
911
|
+
const [n, o] = N(""), [s, r] = N({ name: "Low", value: "low" }), [c, b] = N(""), [d, l] = N(""), [p, y] = N(""), I = a((g) => g.broadCastMode), T = a((g) => g.customFee), P = a((g) => g.setCustomFee), f = a((g) => g.slippage), h = a((g) => g.setSlippage), C = a((g) => g.setBroadCastMode), A = a((g) => g.option), v = a((g) => g.setOption), Z = n == T && A.name == s.name && f == p && (d === I && d !== "" || !n.length && !A.name.length);
|
912
|
+
function H(g) {
|
913
913
|
b(""), o(g.target.value);
|
914
914
|
}
|
915
|
-
function
|
915
|
+
function re(g, m) {
|
916
916
|
b(""), r(g);
|
917
917
|
}
|
918
918
|
B(() => {
|
@@ -920,43 +920,43 @@ function it({ handleClose: t }) {
|
|
920
920
|
}, [A]), B(() => {
|
921
921
|
T != null && T.length ? o(T) : o("");
|
922
922
|
}, [T]);
|
923
|
-
function
|
923
|
+
function L() {
|
924
924
|
v(s);
|
925
925
|
}
|
926
926
|
B(() => {
|
927
927
|
y(f);
|
928
928
|
}, [h]);
|
929
|
-
function
|
929
|
+
function R(g) {
|
930
930
|
y(g.target.value);
|
931
931
|
}
|
932
932
|
B(() => {
|
933
933
|
l(I);
|
934
934
|
}, [I]);
|
935
|
-
function
|
935
|
+
function _() {
|
936
936
|
if (d == "" && (n.length || s.name.length)) {
|
937
937
|
C(""), b("Please select a mode");
|
938
938
|
return;
|
939
939
|
}
|
940
|
-
n.length ? (
|
940
|
+
n.length ? (P(n), v(s)) : (P(""), L()), C(d), h(p), t();
|
941
941
|
}
|
942
|
-
function
|
942
|
+
function J(g) {
|
943
943
|
b(""), l(g);
|
944
944
|
}
|
945
945
|
return B(() => {
|
946
946
|
!T && !A.name.length && (C(""), l(""));
|
947
947
|
}, [T, A.name]), /* @__PURE__ */ u("div", { className: "bw-w-full md:bw-w-[443px] bw-h-[447px] bw-rounded-lg bw-border bw-p-3 px-4 md:bw-px-6 bw-border-border-primary bw-text-white bw-bg-background-container", children: [
|
948
948
|
/* @__PURE__ */ e(p1, { handleClose: t }),
|
949
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(g1, { slippage: p, handleSlippage:
|
949
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(g1, { slippage: p, handleSlippage: R }) }),
|
950
950
|
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(x1, {}) }),
|
951
|
-
/* @__PURE__ */ e(
|
952
|
-
/* @__PURE__ */ e(d1, { options: s, handleOptions:
|
951
|
+
/* @__PURE__ */ e(st, { mode: d, handleMode: J }),
|
952
|
+
/* @__PURE__ */ e(d1, { options: s, handleOptions: re }),
|
953
953
|
/* @__PURE__ */ e(
|
954
954
|
u1,
|
955
955
|
{
|
956
956
|
title: "Max Cap",
|
957
957
|
inputSideText: "SOL",
|
958
958
|
inputVal: n,
|
959
|
-
handleCustomVal:
|
959
|
+
handleCustomVal: H
|
960
960
|
}
|
961
961
|
),
|
962
962
|
/* @__PURE__ */ u("div", { className: "bw-relative", children: [
|
@@ -964,15 +964,15 @@ function it({ handleClose: t }) {
|
|
964
964
|
/* @__PURE__ */ e(
|
965
965
|
m1,
|
966
966
|
{
|
967
|
-
handleSave:
|
967
|
+
handleSave: _,
|
968
968
|
isSaveButtonDisabled: Z
|
969
969
|
}
|
970
970
|
)
|
971
971
|
] })
|
972
972
|
] });
|
973
973
|
}
|
974
|
-
function
|
975
|
-
const [n, o] = N({ name: "Low", value: "low" }), [s, r] = N(""), [c, b] = N(""), d = a((v) => v.setEvmGas), l = a((v) => v.setEvmSpeed), p = a((v) => v.evmSpeed), y = a((v) => v.evmGas), I = a((v) => v.slippage), T = a((v) => v.setSlippage),
|
974
|
+
function at({ handleClose: t }) {
|
975
|
+
const [n, o] = N({ name: "Low", value: "low" }), [s, r] = N(""), [c, b] = N(""), d = a((v) => v.setEvmGas), l = a((v) => v.setEvmSpeed), p = a((v) => v.evmSpeed), y = a((v) => v.evmGas), I = a((v) => v.slippage), T = a((v) => v.setSlippage), P = s == y && p.name == n.name && I == c;
|
976
976
|
function f(v, Z) {
|
977
977
|
o(v);
|
978
978
|
}
|
@@ -1011,15 +1011,15 @@ function lt({ handleClose: t }) {
|
|
1011
1011
|
m1,
|
1012
1012
|
{
|
1013
1013
|
handleSave: C,
|
1014
|
-
isSaveButtonDisabled:
|
1014
|
+
isSaveButtonDisabled: P
|
1015
1015
|
}
|
1016
1016
|
)
|
1017
1017
|
] });
|
1018
1018
|
}
|
1019
|
-
function
|
1019
|
+
function ct({ open: t, handleClose: n }) {
|
1020
1020
|
const o = a((r) => r.fromChain);
|
1021
1021
|
return /* @__PURE__ */ e(
|
1022
|
-
|
1022
|
+
F1,
|
1023
1023
|
{
|
1024
1024
|
open: t,
|
1025
1025
|
disablePortal: !0,
|
@@ -1034,11 +1034,11 @@ function at({ open: t, handleClose: n }) {
|
|
1034
1034
|
// left: "47%",
|
1035
1035
|
// transform: "translate(-50%, -50%)",
|
1036
1036
|
bgcolor: "var(--tw-bg-container)"
|
1037
|
-
}, children: o.networkType == "sol" ? /* @__PURE__ */ e(
|
1037
|
+
}, children: o.networkType == "sol" ? /* @__PURE__ */ e(lt, { handleClose: n }) : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(at, { handleClose: n }) }) })
|
1038
1038
|
}
|
1039
1039
|
);
|
1040
1040
|
}
|
1041
|
-
function
|
1041
|
+
function bt({ fill: t }) {
|
1042
1042
|
return /* @__PURE__ */ u(
|
1043
1043
|
"svg",
|
1044
1044
|
{
|
@@ -1077,7 +1077,7 @@ function ct({ fill: t }) {
|
|
1077
1077
|
}
|
1078
1078
|
);
|
1079
1079
|
}
|
1080
|
-
function
|
1080
|
+
function dt() {
|
1081
1081
|
const t = a((s) => s.configuration), n = t == null ? void 0 : t.headingStyles, o = (t == null ? void 0 : t.headingText) || "";
|
1082
1082
|
return o.length ? /* @__PURE__ */ e(
|
1083
1083
|
"span",
|
@@ -1095,7 +1095,7 @@ function bt() {
|
|
1095
1095
|
"Y.exchange"
|
1096
1096
|
] });
|
1097
1097
|
}
|
1098
|
-
function
|
1098
|
+
function wt() {
|
1099
1099
|
const t = a((o) => o.configuration), n = t == null ? void 0 : t.headingContainerStyles;
|
1100
1100
|
return /* @__PURE__ */ e(
|
1101
1101
|
"div",
|
@@ -1124,32 +1124,32 @@ function dt() {
|
|
1124
1124
|
paddingLeft: "10px",
|
1125
1125
|
...n
|
1126
1126
|
},
|
1127
|
-
children: /* @__PURE__ */ e(
|
1127
|
+
children: /* @__PURE__ */ e(dt, {})
|
1128
1128
|
}
|
1129
1129
|
);
|
1130
1130
|
}
|
1131
|
-
function
|
1131
|
+
function ut() {
|
1132
1132
|
const [t, n] = N(!1), o = a((r) => r.fromChain);
|
1133
1133
|
function s() {
|
1134
1134
|
n(!1);
|
1135
1135
|
}
|
1136
|
-
return /* @__PURE__ */ u(
|
1136
|
+
return /* @__PURE__ */ u(K, { children: [
|
1137
1137
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-w-full -bw-mt-2 bw-mb-3 bw-items-center bw-justify-end", children: [
|
1138
|
-
/* @__PURE__ */ e(
|
1138
|
+
/* @__PURE__ */ e(wt, {}),
|
1139
1139
|
/* @__PURE__ */ e(
|
1140
1140
|
"div",
|
1141
1141
|
{
|
1142
1142
|
onClick: () => (o == null ? void 0 : o.networkType) !== "cosmos" && n(!0),
|
1143
1143
|
className: "bw-flex bw-relative bw-right-0 bw-items-center bw-gap-x-2",
|
1144
|
-
children: /* @__PURE__ */ e(
|
1144
|
+
children: /* @__PURE__ */ e(K1, { classnames: " ", children: /* @__PURE__ */ e(bt, { fill: "var(--tw-text-secondary)" }) })
|
1145
1145
|
}
|
1146
1146
|
)
|
1147
1147
|
] }),
|
1148
|
-
/* @__PURE__ */ e(
|
1148
|
+
/* @__PURE__ */ e(ct, { open: t, handleClose: s })
|
1149
1149
|
] });
|
1150
1150
|
}
|
1151
|
-
let o1,
|
1152
|
-
function
|
1151
|
+
let o1, Fe, he, Me = 0;
|
1152
|
+
function mt({ confirmRoute: t, setConfirmRoute: n, routes: o, routesData: s, isRoutesEnabled: r, fetchBalance: c }) {
|
1153
1153
|
const [b, d] = N(0), { getWallet: l } = ke({}), p = a((h) => h.fromChain), y = l(p), { isConnected: I } = ge();
|
1154
1154
|
B(() => {
|
1155
1155
|
t && clearInterval(he);
|
@@ -1157,10 +1157,10 @@ function ut({ confirmRoute: t, setConfirmRoute: n, routes: o, routesData: s, isR
|
|
1157
1157
|
var h;
|
1158
1158
|
b === 0 && document.visibilityState === "visible" && !t && r && ((h = y.address) != null && h.length && c.refetch(), o.refetch());
|
1159
1159
|
}, [b, t, r]), B(() => {
|
1160
|
-
o.isFetching && (
|
1160
|
+
o.isFetching && (Me = 0);
|
1161
1161
|
}, [o.isFetching]), B(() => {
|
1162
1162
|
if (!pe.isEmpty(s)) {
|
1163
|
-
const h = Math.max(0, s.deadline -
|
1163
|
+
const h = Math.max(0, s.deadline - Me);
|
1164
1164
|
d(h);
|
1165
1165
|
}
|
1166
1166
|
return () => {
|
@@ -1170,25 +1170,25 @@ function ut({ confirmRoute: t, setConfirmRoute: n, routes: o, routesData: s, isR
|
|
1170
1170
|
document.removeEventListener("visibilitychange", f);
|
1171
1171
|
}), [s]);
|
1172
1172
|
function T() {
|
1173
|
-
o1 = Date.now(), d((h) => (
|
1173
|
+
o1 = Date.now(), d((h) => (Fe = h, h));
|
1174
1174
|
}
|
1175
|
-
function
|
1175
|
+
function P() {
|
1176
1176
|
let h = Date.now(), C = Math.round((h - o1) / 1e3);
|
1177
|
-
s.deadline -
|
1177
|
+
s.deadline - Fe + C > s.deadline ? n((A) => {
|
1178
1178
|
var v;
|
1179
1179
|
return A || ((v = y.address) != null && v.length && c.refetch(), o.refetch(), d(s.deadline)), A;
|
1180
|
-
}) :
|
1180
|
+
}) : Fe && C && d(Fe - C);
|
1181
1181
|
}
|
1182
1182
|
function f() {
|
1183
|
-
document.visibilityState === "visible" ?
|
1183
|
+
document.visibilityState === "visible" ? P() : T();
|
1184
1184
|
}
|
1185
1185
|
return B(() => (pe.isEmpty(s) ? he && clearInterval(he) : he = setInterval(() => {
|
1186
|
-
d((h) => h <= 0 ? (
|
1186
|
+
d((h) => h <= 0 ? (Me = 0, s.deadline) : (Me++, h - 1));
|
1187
1187
|
}, 1e3), () => {
|
1188
1188
|
he && clearInterval(he);
|
1189
1189
|
}), [s]), a((h) => h.timerValue), { quoteTimer: b, setQuoteTimer: d };
|
1190
1190
|
}
|
1191
|
-
function
|
1191
|
+
function pt(t, n, o) {
|
1192
1192
|
const { primaryWallet: s } = Ne(), [r, c] = N(0), b = async (d) => {
|
1193
1193
|
if (!s) return;
|
1194
1194
|
const l = new ze(d || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed");
|
@@ -1208,17 +1208,17 @@ function mt(t, n, o) {
|
|
1208
1208
|
(t == null ? void 0 : t.networkType) === "sol" && b((t == null ? void 0 : t.chainId) === "eclipse-svm" ? "https://eclipse.lgns.net/" : null);
|
1209
1209
|
}, [t == null ? void 0 : t.networkType, s, t == null ? void 0 : t.chainId, s == null ? void 0 : s.address]), { balanceSol: r, getBalanceSol: b };
|
1210
1210
|
}
|
1211
|
-
function
|
1211
|
+
function gt(t) {
|
1212
1212
|
return t == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ? "" : t;
|
1213
1213
|
}
|
1214
|
-
const
|
1214
|
+
const xt = new be("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), ft = new be("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
1215
1215
|
new be("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
1216
1216
|
new be("So11111111111111111111111111111111111111112");
|
1217
1217
|
new be("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
1218
|
-
async function
|
1218
|
+
async function ht(t, n) {
|
1219
1219
|
if (!t) return;
|
1220
1220
|
const o = new ze(n || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed"), s = new be(t), r = await o.getParsedTokenAccountsByOwner(s, {
|
1221
|
-
programId: n ?
|
1221
|
+
programId: n ? ft : xt
|
1222
1222
|
});
|
1223
1223
|
let c = {};
|
1224
1224
|
for (const { account: b } of r.value) {
|
@@ -1227,26 +1227,26 @@ async function ft(t, n) {
|
|
1227
1227
|
}
|
1228
1228
|
return c;
|
1229
1229
|
}
|
1230
|
-
function
|
1231
|
-
const [o, s] = N(0), { primaryWallet: r, setPrimaryWallet: c } = Ne(), [b, d] = N(!1), l = a((m) => m.fromChain), { address: p, isConnected: y } = ge(), I = a((m) => m.cosmosChainIds), { data: T, isConnected:
|
1230
|
+
function yt(t, n) {
|
1231
|
+
const [o, s] = N(0), { primaryWallet: r, setPrimaryWallet: c } = Ne(), [b, d] = N(!1), l = a((m) => m.fromChain), { address: p, isConnected: y } = ge(), I = a((m) => m.cosmosChainIds), { data: T, isConnected: P } = Oe({
|
1232
1232
|
chainId: I,
|
1233
1233
|
multiChain: !0
|
1234
|
-
}), f = a((m) => m.fromCoin), { data: h, isLoading: C } =
|
1234
|
+
}), f = a((m) => m.fromCoin), { data: h, isLoading: C } = O1({
|
1235
1235
|
address: p,
|
1236
|
-
token:
|
1236
|
+
token: gt((f == null ? void 0 : f.address) || ""),
|
1237
1237
|
chainId: Number((l == null ? void 0 : l.chainId) || 0),
|
1238
1238
|
enabled: !!((l.networkType == "evm" || n) && p && (p != null && p.length))
|
1239
1239
|
}), {
|
1240
1240
|
data: A,
|
1241
1241
|
isLoading: v,
|
1242
1242
|
isFetching: Z,
|
1243
|
-
isInitialLoading:
|
1244
|
-
isRefetching:
|
1243
|
+
isInitialLoading: H,
|
1244
|
+
isRefetching: re
|
1245
1245
|
} = a1({
|
1246
1246
|
chainId: [l.chainId],
|
1247
1247
|
multiChain: !0
|
1248
1248
|
});
|
1249
|
-
async function
|
1249
|
+
async function L(m) {
|
1250
1250
|
if (!r) return;
|
1251
1251
|
const k = new ze(m || "https://solana-rpc.publicnode.com");
|
1252
1252
|
if (k)
|
@@ -1259,104 +1259,104 @@ function ht(t, n) {
|
|
1259
1259
|
d(!1);
|
1260
1260
|
}
|
1261
1261
|
}
|
1262
|
-
async function
|
1262
|
+
async function R(m) {
|
1263
1263
|
try {
|
1264
1264
|
d(!0);
|
1265
|
-
let k = await
|
1265
|
+
let k = await ht(r.address, m);
|
1266
1266
|
d(!1), s(k == null ? void 0 : k[f == null ? void 0 : f.address]);
|
1267
1267
|
} catch {
|
1268
1268
|
d(!1);
|
1269
1269
|
}
|
1270
1270
|
}
|
1271
|
-
let
|
1272
|
-
async function
|
1271
|
+
let _;
|
1272
|
+
async function J() {
|
1273
1273
|
if (!r) return;
|
1274
1274
|
const m = await r.connector.getPublicClient();
|
1275
1275
|
if (!m) return;
|
1276
1276
|
const k = new be(r.address);
|
1277
|
-
k && (
|
1277
|
+
k && (_ = m.onAccountChange(k, (M) => {
|
1278
1278
|
var F;
|
1279
|
-
l.networkType == "sol" && (r != null && r.address) && (((F = f == null ? void 0 : f.symbol) == null ? void 0 : F.toLowerCase()) === "sol" ?
|
1279
|
+
l.networkType == "sol" && (r != null && r.address) && (((F = f == null ? void 0 : f.symbol) == null ? void 0 : F.toLowerCase()) === "sol" ? L() : l.chainId === "eclipse-svm" ? f.symbol == "ETH" ? L("https://eclipse.lgns.net/") : R("https://eclipse.lgns.net/") : R());
|
1280
1280
|
}));
|
1281
1281
|
}
|
1282
|
-
B(() => ((l == null ? void 0 : l.networkType) === "sol" &&
|
1282
|
+
B(() => ((l == null ? void 0 : l.networkType) === "sol" && J(), async () => {
|
1283
1283
|
if (!r) return;
|
1284
|
-
(await r.connector.getPublicClient()).removeAccountChangeListener(
|
1284
|
+
(await r.connector.getPublicClient()).removeAccountChangeListener(_);
|
1285
1285
|
}), [r == null ? void 0 : r.address, l == null ? void 0 : l.networkType, f]);
|
1286
1286
|
async function g(m) {
|
1287
1287
|
var M, F;
|
1288
1288
|
let k = A[m] || A;
|
1289
1289
|
try {
|
1290
1290
|
d(!0);
|
1291
|
-
let x = await k.getAllBalances((M = T == null ? void 0 : T[m]) == null ? void 0 : M.bech32Address),
|
1292
|
-
s(((F =
|
1291
|
+
let x = await k.getAllBalances((M = T == null ? void 0 : T[m]) == null ? void 0 : M.bech32Address), O = pe.keyBy(x, "denom");
|
1292
|
+
s(((F = O[b1(f.address)]) == null ? void 0 : F.amount) / Math.pow(10, f.decimals) || 0), d(!1);
|
1293
1293
|
} catch {
|
1294
1294
|
d(!1);
|
1295
1295
|
}
|
1296
1296
|
}
|
1297
1297
|
return B(() => {
|
1298
1298
|
var m;
|
1299
|
-
l.networkType == "sol" && (r != null && r.address) ? ((m = f == null ? void 0 : f.symbol) == null ? void 0 : m.toLowerCase()) === "sol" ?
|
1300
|
-
}, [l.networkType, l == null ? void 0 : l.chainId, f.symbol, f == null ? void 0 : f.address, h, p, r == null ? void 0 : r.address, p,
|
1299
|
+
l.networkType == "sol" && (r != null && r.address) ? ((m = f == null ? void 0 : f.symbol) == null ? void 0 : m.toLowerCase()) === "sol" ? L() : l.chainId == "eclipse-svm" ? f.symbol == "ETH" ? L("https://eclipse.lgns.net/") : R("https://eclipse.lgns.net/") : R() : l.networkType == "evm" && p && (p != null && p.length) ? s(Number((h == null ? void 0 : h.formatted) || 0)) : l.networkType == "cosmos" && P && !v && g(l == null ? void 0 : l.chainId);
|
1300
|
+
}, [l.networkType, l == null ? void 0 : l.chainId, f.symbol, f == null ? void 0 : f.address, h, p, r == null ? void 0 : r.address, p, P, v, t]), {
|
1301
1301
|
getbal: o,
|
1302
1302
|
isBalanceLoading: (l == null ? void 0 : l.networkType) == "sol" || (l == null ? void 0 : l.networkType) == "cosmos" ? b : (l == null ? void 0 : l.networkType) == "evm" ? C : !1
|
1303
1303
|
};
|
1304
1304
|
}
|
1305
|
-
const
|
1306
|
-
function
|
1305
|
+
const Ct = de.lazy(() => import("./SwapAsset-B0GIHqge.js")), vt = de.lazy(() => import("./InputComp-FIX0Q9qG.js")), kt = de.lazy(() => import("./QuotesProgress-CDe2mdH1.js")), Nt = de.lazy(() => import("./TxnButton-CFquc6ws.js")), Tt = de.lazy(() => import("./index-HOk_h4cO.js").then((t) => t.i)), It = de.lazy(() => import("./index-DrWi5MDR.js")), Bt = de.lazy(() => import("./LoadRoute-Di4rBHfs.js")), At = de.lazy(() => import("./AllRoutes-DW-2t6-d.js"));
|
1306
|
+
function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
1307
1307
|
var Ge, Ke, Je, qe, Xe, Qe, We;
|
1308
|
-
const [s, r] = N(), [c, b] = N(!1), [d, l] = N(!1), [p, y] = N(!1), [I, T] = N(!1), [
|
1309
|
-
|
1310
|
-
const { address: v } = ge(), { address: Z } = i1(), { getbal:
|
1308
|
+
const [s, r] = N(), [c, b] = N(!1), [d, l] = N(!1), [p, y] = N(!1), [I, T] = N(!1), [P, f] = N("all"), [h, C] = N(!1), { primaryWallet: A } = Ne();
|
1309
|
+
$1();
|
1310
|
+
const { address: v } = ge(), { address: Z } = i1(), { getbal: H, isBalanceLoading: re } = yt(h), { data: L, isConnected: R } = Oe({ chainId: "cosmoshub-4" });
|
1311
1311
|
a((i) => i.configuration);
|
1312
|
-
const
|
1312
|
+
const _ = a((i) => i.persist), J = a((i) => i.setPersist), g = a((i) => i.route), m = a((i) => i.fromChain), k = a((i) => i.toChain), M = a((i) => i.fromCoin), F = a((i) => i.toCoin), x = a((i) => i.setFromChain), O = a((i) => i.setToChain), $ = a((i) => i.setFromCoin), E = a((i) => i.setToCoin), j = a((i) => i.amount), V = a((i) => i.setAmount), ie = a((i) => i.customWallet);
|
1313
1313
|
a((i) => i.setToDisconnect);
|
1314
|
-
const
|
1315
|
-
let
|
1316
|
-
const
|
1317
|
-
enabled:
|
1314
|
+
const Te = a((i) => i.setCosmosChainIds), Y = a((i) => i.customFee), G = a((i) => i.broadCastMode), Q = a((i) => i.evmGas), z = a((i) => i.evmSpeed), Ie = a((i) => i.slippage), ye = a((i) => i.option), Be = a((i) => i.setCustomWallet), Ae = a((i) => i.setSelectedProvider), { balanceSol: w } = pt(m, h, Re), { suggestAndConnectAsync: D } = S1(), ee = !!(j.length && m.chain.length && M.coin.length && k.chain.length && F.coin.length && !p && I), ae = ["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];
|
1315
|
+
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;
|
1316
|
+
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: te } = ke({}), { routes: S, routesData: X, setRoutesData: ce, errorMessage: ne, setErrorMessage: Ce } = J1({
|
1317
|
+
enabled: ee,
|
1318
1318
|
dependency: ae,
|
1319
|
-
payload: [(m == null ? void 0 : m.networkType) === "cosmos" ? t1(
|
1320
|
-
}),
|
1321
|
-
queryKey: ["balance",
|
1322
|
-
queryFn: async () => await (await Ve.fetchBalance(
|
1323
|
-
enabled: !!((Qe =
|
1319
|
+
payload: [(m == null ? void 0 : m.networkType) === "cosmos" ? t1(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" ? t1(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]
|
1320
|
+
}), le = U(m), we = l1({
|
1321
|
+
queryKey: ["balance", le == null ? void 0 : le.address, m],
|
1322
|
+
queryFn: async () => await (await Ve.fetchBalance(le.address, m.chainId)).json(),
|
1323
|
+
enabled: !!((Qe = le == null ? void 0 : le.address) != null && Qe.length && m.chainId),
|
1324
1324
|
refetchOnWindowFocus: !1
|
1325
|
-
}), { quoteTimer:
|
1325
|
+
}), { quoteTimer: je } = mt({
|
1326
1326
|
routes: S,
|
1327
|
-
routesData:
|
1327
|
+
routesData: X,
|
1328
1328
|
confirmRoute: d,
|
1329
1329
|
setConfirmRoute: l,
|
1330
|
-
isRoutesEnabled:
|
1330
|
+
isRoutesEnabled: ee,
|
1331
1331
|
fetchBalance: we
|
1332
1332
|
});
|
1333
1333
|
B(() => {
|
1334
|
-
|
1334
|
+
j || ce({});
|
1335
1335
|
let i;
|
1336
|
-
return Number(
|
1336
|
+
return Number(j) > 0 && (i = setTimeout(() => {
|
1337
1337
|
T(!0);
|
1338
1338
|
}, 500)), () => {
|
1339
1339
|
clearTimeout(i), T(!1);
|
1340
1340
|
};
|
1341
|
-
}, [
|
1341
|
+
}, [j]), B(() => {
|
1342
1342
|
S.isFetching && ce({});
|
1343
1343
|
}, [S.isFetching]);
|
1344
1344
|
function ve(i) {
|
1345
1345
|
y(i);
|
1346
1346
|
}
|
1347
|
-
function
|
1347
|
+
function Pe() {
|
1348
1348
|
r();
|
1349
1349
|
}
|
1350
1350
|
async function Le(i) {
|
1351
|
-
if (
|
1351
|
+
if (R)
|
1352
1352
|
try {
|
1353
1353
|
let ue = await e1();
|
1354
1354
|
if (ue.length && !ue.includes(i.chainId)) {
|
1355
|
-
let xe = await
|
1355
|
+
let xe = await D({
|
1356
1356
|
chainInfo: i,
|
1357
|
-
walletType:
|
1358
|
-
}), me = await
|
1359
|
-
|
1357
|
+
walletType: Z1.KEPLR
|
1358
|
+
}), me = await te(), fe = await e1();
|
1359
|
+
Te(fe);
|
1360
1360
|
}
|
1361
1361
|
} catch {
|
1362
1362
|
}
|
@@ -1364,10 +1364,10 @@ function At({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1364
1364
|
return;
|
1365
1365
|
}
|
1366
1366
|
function f1(i) {
|
1367
|
-
(i == null ? void 0 : i.networkType) == "cosmos" && Le(i.chainInfo),
|
1367
|
+
(i == null ? void 0 : i.networkType) == "cosmos" && Le(i.chainInfo), V(""), Ce({ error: "" }), s == "from" ? x({ ...i }) : s == "to" && O({ ...i });
|
1368
1368
|
}
|
1369
1369
|
function h1(i) {
|
1370
|
-
Ce({ error: "" }),
|
1370
|
+
Ce({ error: "" }), V(""), s == "from" ? $({ ...i }) : s == "to" && E({ ...i });
|
1371
1371
|
}
|
1372
1372
|
function Ze() {
|
1373
1373
|
b(!c);
|
@@ -1375,19 +1375,19 @@ function At({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1375
1375
|
function He(i) {
|
1376
1376
|
l(typeof i < "u" ? i : !d);
|
1377
1377
|
}
|
1378
|
-
function
|
1378
|
+
function Re(i) {
|
1379
1379
|
C(i);
|
1380
1380
|
}
|
1381
1381
|
function y1(i) {
|
1382
|
-
|
1382
|
+
Ae(i == null ? void 0 : i.provider), ce(i);
|
1383
1383
|
}
|
1384
1384
|
function C1() {
|
1385
1385
|
setTimeout(() => {
|
1386
|
-
|
1386
|
+
Re(!0), we.refetch();
|
1387
1387
|
}, 1e3);
|
1388
1388
|
}
|
1389
1389
|
function v1() {
|
1390
|
-
|
1390
|
+
V("");
|
1391
1391
|
}
|
1392
1392
|
function k1(i, ue, xe) {
|
1393
1393
|
Ve.fetchTokens(i.chainId, xe).then((me) => me.json()).then((me) => {
|
@@ -1403,11 +1403,11 @@ function At({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1403
1403
|
});
|
1404
1404
|
}
|
1405
1405
|
function N1() {
|
1406
|
-
|
1406
|
+
V(""), x(k), $(F), O(m), E(M), m.networkType !== k.networkType && Be("");
|
1407
1407
|
}
|
1408
1408
|
B(() => {
|
1409
|
-
|
1410
|
-
}, [
|
1409
|
+
_.isHistory && g === "" && (J({}), ve(!1));
|
1410
|
+
}, [_]);
|
1411
1411
|
function T1(i) {
|
1412
1412
|
var ue;
|
1413
1413
|
if (i && o.isSuccess && i !== (k == null ? void 0 : k.networkType) && i !== (m == null ? void 0 : m.networkType)) {
|
@@ -1419,27 +1419,27 @@ function At({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
|
1419
1419
|
} else
|
1420
1420
|
return;
|
1421
1421
|
}
|
1422
|
-
return /* @__PURE__ */ e(B1, { fallback: /* @__PURE__ */ e(
|
1423
|
-
/* @__PURE__ */ e(
|
1422
|
+
return /* @__PURE__ */ e(B1, { fallback: /* @__PURE__ */ e(P1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(Tt, { connectWalletField: P, handleShowWallet: t, handleRecentSelectedWallet: T1 }) : !d && !((We = _ == null ? void 0 : _.routeId) != null && We.length) ? c ? /* @__PURE__ */ e(At, { routes: S, handleShowAllRoutes: Ze, handleRoutesData: y1, 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: f1, setCoinData: h1, handleReset: Pe, showExchangeList: s, fetchBalance: we, fetchChains: o }) : /* @__PURE__ */ u(K, { children: [
|
1423
|
+
/* @__PURE__ */ e(ut, {}),
|
1424
1424
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
1425
|
-
/* @__PURE__ */ e(
|
1425
|
+
/* @__PURE__ */ e(Ct, { handleSwap: N1 }),
|
1426
1426
|
/* @__PURE__ */ e(r1, { chainData: m, show: "from", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: f, coinData: M }),
|
1427
1427
|
/* @__PURE__ */ e(r1, { chainData: k, show: "to", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: f, coinData: F })
|
1428
1428
|
] }),
|
1429
|
-
/* @__PURE__ */ e(
|
1430
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1431
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (
|
1432
|
-
/* @__PURE__ */ e(
|
1433
|
-
/* @__PURE__ */ e(
|
1434
|
-
] }) : /* @__PURE__ */ e(
|
1429
|
+
/* @__PURE__ */ e(vt, { amount: j, setAmount: V, fetchBalance: we, getCoinBalance: H, isBalanceLoading: re }),
|
1430
|
+
/* @__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) }) }),
|
1431
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (ne == null ? void 0 : ne.error) == "string" ? ne == null ? void 0 : ne.error : "" }),
|
1432
|
+
/* @__PURE__ */ e(kt, { routes: S, routesData: X, confirmRoute: d, setConfirmRoute: l, isRoutesEnabled: ee, quoteTimer: je }),
|
1433
|
+
/* @__PURE__ */ e(Nt, { routesData: X, handleSuccess: Re, routes: S, fetchBalancePrev: we, amount: j, isAmountTyped: I, handleShowWallet: t, setConnectWalletField: f, handleConfirmClose: He, balanceSol: w, getCoinBalance: H })
|
1434
|
+
] }) : /* @__PURE__ */ e(It, { handleConfirmClose: He, amount: j, routesData: X, resetAmount: v1, routes: S, handleStopRoute: ve, resetBalance: C1 }) }) });
|
1435
1435
|
}
|
1436
|
-
function
|
1436
|
+
function Pt({ fetchChains: t }) {
|
1437
1437
|
const [n, o] = N(!1), { isConnected: s } = ge();
|
1438
1438
|
function r(c) {
|
1439
1439
|
o(!n);
|
1440
1440
|
}
|
1441
1441
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1442
|
-
|
1442
|
+
jt,
|
1443
1443
|
{
|
1444
1444
|
handleShowWallet: r,
|
1445
1445
|
fetchChains: t,
|
@@ -1447,14 +1447,14 @@ function jt({ fetchChains: t }) {
|
|
1447
1447
|
}
|
1448
1448
|
) });
|
1449
1449
|
}
|
1450
|
-
const
|
1450
|
+
const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1451
1451
|
__proto__: null,
|
1452
|
-
default:
|
1452
|
+
default: Pt
|
1453
1453
|
}, Symbol.toStringTag, { value: "Module" }));
|
1454
1454
|
export {
|
1455
|
-
|
1456
|
-
|
1455
|
+
gt as c,
|
1456
|
+
Kt as i,
|
1457
1457
|
b1 as p,
|
1458
1458
|
w1 as r,
|
1459
|
-
|
1459
|
+
U1 as u
|
1460
1460
|
};
|