@blockend/widget 1.0.47 → 1.0.48-beta.0
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-DzeVxLDj.js → AllRoutes-D8LuuVmM.js} +9 -9
- package/dist/{Box-Ci2zRQrs.js → Box-DM9yFOex.js} +8 -8
- package/dist/EstGas-BeT31S57.js +13644 -0
- package/dist/{Grow-BE3H0oa5.js → Grow-DOn6L3co.js} +2 -2
- package/dist/{InputComp-CJp-XwEr.js → InputComp-NuVHgaJr.js} +5 -5
- package/dist/{LoadRoute-eUX6vrIQ.js → LoadRoute-B67KdzDM.js} +18 -18
- package/dist/QuotesProgress-QaDMFoy1.js +28 -0
- package/dist/{SwapAsset-Dk21ATof.js → SwapAsset-DS1khTG7.js} +1 -1
- package/dist/{Tooltip-BZfJNVn-.js → Tooltip-Ba3WFgGd.js} +15 -15
- package/dist/TxnButton-tr4Dz_jE.js +223 -0
- package/dist/{add-ZLHbLJJu.js → add-q9Nf6prg.js} +1 -1
- package/dist/{all-wallets-d2aKzL33.js → all-wallets-DPeT0Mif.js} +1 -1
- package/dist/{app-store-D64ScJNv.js → app-store-DN3WdWdo.js} +1 -1
- package/dist/{apple-Du4IHASB.js → apple-DyzMqifv.js} +1 -1
- package/dist/{arrow-bottom-Dv2epYGz.js → arrow-bottom-DqoHxj9Z.js} +1 -1
- package/dist/{arrow-bottom-circle-UWVTMTVh.js → arrow-bottom-circle-gYCPf_-a.js} +1 -1
- package/dist/{arrow-left-BKfIGA7r.js → arrow-left-BCb0WGCp.js} +1 -1
- package/dist/{arrow-right-2mONf0tM.js → arrow-right-COFDKXwO.js} +1 -1
- package/dist/{arrow-top-X4pWUiKn.js → arrow-top-A2hPO7gg.js} +1 -1
- package/dist/{bank-CsABCgFp.js → bank-DzMH-tSV.js} +1 -1
- package/dist/{basic-BPWB_wOx.js → basic-C5wivloW.js} +3 -3
- package/dist/{browser-DwbBRE2D.js → browser-pBih3Y0E.js} +1 -1
- package/dist/{card-BewgfynW.js → card-CnPr5FkC.js} +1 -1
- package/dist/{ccip-CLnQdUd7.js → ccip-Di_Zaa6h.js} +16 -16
- package/dist/{checkmark-CQhUJTfi.js → checkmark-DuHkawx4.js} +1 -1
- package/dist/{checkmark-bold-CedqjnnO.js → checkmark-bold-CbTyGrPC.js} +1 -1
- package/dist/{chevron-bottom-DJ4X9Prx.js → chevron-bottom-ClujWrwS.js} +1 -1
- package/dist/{chevron-left-DWynSM9B.js → chevron-left-Bk48p4Zx.js} +1 -1
- package/dist/{chevron-right-DvWAAqhV.js → chevron-right-DNGloKKX.js} +1 -1
- package/dist/{chevron-top-BR530r9H.js → chevron-top-BeF-AMWu.js} +1 -1
- package/dist/{chrome-store-_0c6caxN.js → chrome-store-DbhS7z0N.js} +1 -1
- package/dist/{clock-VdAYDjqL.js → clock-C_6_l4to.js} +1 -1
- package/dist/{close-CO-0N2CX.js → close-CSt1jFt2.js} +1 -1
- package/dist/{coinPlaceholder-ujAsyqU0.js → coinPlaceholder-BCj1y0PN.js} +1 -1
- package/dist/{compass-VKJy5_W5.js → compass-BylNTlMa.js} +1 -1
- package/dist/{copy-osfd8JXZ.js → copy-B5chXsW-.js} +1 -1
- package/dist/{core-B_HqNWOu.js → core-DMrbUYAd.js} +16 -17
- package/dist/{cursor-DpjQo7re.js → cursor-DOai1hPO.js} +1 -1
- package/dist/{cursor-transparent-xK4CF8Hs.js → cursor-transparent-Cadcmy6E.js} +1 -1
- package/dist/{desktop-BMPBQv2t.js → desktop-DCy_OF9q.js} +1 -1
- package/dist/{disconnect-Cl9LGKMz.js → disconnect-d_9YI8yP.js} +1 -1
- package/dist/{discord-CZVHD-wp.js → discord-C5PncbsA.js} +1 -1
- package/dist/{down-Ct-xismN.js → down-B0DJRPMS.js} +2 -2
- package/dist/{etherscan-DdrzJHLk.js → etherscan-ClGwr9lW.js} +1 -1
- package/dist/{exclamation-triangle-CIQaYDSx.js → exclamation-triangle-UG68kEuv.js} +1 -1
- package/dist/{extension-Bb_ygQH_.js → extension-Bhr-Ssau.js} +1 -1
- package/dist/{external-link-Ddh7vP38.js → external-link-BRJo7SZO.js} +1 -1
- package/dist/{facebook-D6zpX69B.js → facebook-BnA-xxoO.js} +1 -1
- package/dist/{farcaster-ifhEe-N4.js → farcaster-CvgpGB8R.js} +1 -1
- package/dist/{filters-DkeDbJhM.js → filters-2DNvXC2d.js} +1 -1
- package/dist/{getChainIds-B9EIXuqY.js → getChainIds-BJOBostX.js} +2 -2
- package/dist/getCosmosAddress-nYlLagxO.js +8398 -0
- package/dist/{github-DBFD3-Hx.js → github-CqCIZfoi.js} +1 -1
- package/dist/{google-CoR2VD6q.js → google-Cb46Xe1N.js} +1 -1
- package/dist/{hamburger-Bw36etpI.js → hamburger-Cj81xHVG.js} +5 -5
- package/dist/{help-circle-DUrhwW6n.js → help-circle-BQm3Y4uL.js} +1 -1
- package/dist/{id-Bq9kGLxW.js → id-DlZAWXhX.js} +1 -1
- package/dist/{image-m0IwqZ1Z.js → image-C-Rdb3yG.js} +1 -1
- package/dist/{index-DOop9kfD.js → index-BEianCH_.js} +374 -349
- package/dist/{index-DbRR6GNq.js → index-BJtXFuWZ.js} +8 -7
- package/dist/{index-ZWAnsHEz.js → index-BKAQ3OTd.js} +11 -11
- package/dist/{index-D2EfKDiV.js → index-CPAph-rb.js} +4 -4
- package/dist/{index-C-aKTD_P.js → index-CUDhfiq5.js} +10 -10
- package/dist/{index-BsWWdDAF.js → index-CxxmgFkL.js} +1 -1
- package/dist/{index-Cdagj5-o.js → index-DD4yqUTK.js} +78 -78
- package/dist/index-DQ-upUtl.js +85050 -0
- package/dist/{index-CUx6_xcj.js → index-DeBuj-lE.js} +1 -1
- package/dist/{index-U2mQgSOl.js → index-N4PNqcjR.js} +2 -2
- package/dist/index-eC9_VgZe.js +3183 -0
- package/dist/{index.es-BYDUqEHk.js → index.es-BkvYD6Tp.js} +3032 -3244
- package/dist/{index.es-D8AzsbDB.js → index.es-DGhokHli.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-circle-Cpd8vFSP.js → info-circle-BweemjWa.js} +1 -1
- package/dist/{info-anm9CSBd.js → info-o_cb8tTT.js} +1 -1
- package/dist/{lightbulb-DPXldPzr.js → lightbulb-CIREQKfQ.js} +1 -1
- package/dist/{mail-r4sP3-4z.js → mail-D7pla8qN.js} +1 -1
- package/dist/{mobile-D0nLhS3C.js → mobile-BfSFqXTR.js} +1 -1
- package/dist/{more-BKn6NMxN.js → more-Cm2OZt-4.js} +1 -1
- package/dist/{network-placeholder-YBGnG39d.js → network-placeholder-cja_SKEh.js} +1 -1
- package/dist/{nftPlaceholder-B2s--N4I.js → nftPlaceholder-CPMGC0YA.js} +1 -1
- package/dist/{off-BMZ4jVAS.js → off-2ov8-cMg.js} +1 -1
- package/dist/{play-store-BjMQicZs.js → play-store-K7jF5Tx9.js} +1 -1
- package/dist/{plus-CYx41gPe.js → plus-D2hT5Tke.js} +1 -1
- package/dist/{qr-code-Drc3pJQ_.js → qr-code-DdAcFtyy.js} +1 -1
- package/dist/{recycle-horizontal-rWs7v9lF.js → recycle-horizontal-C_hgDyOE.js} +1 -1
- package/dist/{refresh-D2BcFG4j.js → refresh-DmHZ_uHs.js} +1 -1
- package/dist/{reown-logo-wUSSdW9D.js → reown-logo-C7Ew_uaV.js} +1 -1
- package/dist/{search-B-YtHXtd.js → search-DIQ1nJd8.js} +1 -1
- package/dist/{send-DLvL_BbY.js → send-oPtL6xIE.js} +1 -1
- package/dist/{swapHorizontal-D44_OZ9u.js → swapHorizontal-Csk-Etan.js} +1 -1
- package/dist/{swapHorizontalBold-Cep1eyxj.js → swapHorizontalBold-BcWknhY6.js} +1 -1
- package/dist/{swapHorizontalMedium-CwPNAHyv.js → swapHorizontalMedium-DmNmthd2.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-s5nQTCKq.js → swapHorizontalRoundedBold-Cqili0jK.js} +1 -1
- package/dist/{swapVertical-Bc1o38Xk.js → swapVertical-CmQhV1BW.js} +1 -1
- package/dist/{telegram-BW1hx271.js → telegram-8VqDFrbM.js} +1 -1
- package/dist/{three-dots-BY9EVUEH.js → three-dots-54YC22RW.js} +1 -1
- package/dist/{twitch-Cte3S7e8.js → twitch-BG66DH8z.js} +1 -1
- package/dist/{twitterIcon-CSNk9-ke.js → twitterIcon-B3TRjKnO.js} +1 -1
- package/dist/{unsupportedProp-7kgM9Qp3.js → unsupportedProp-DxJPUr4X.js} +1 -1
- package/dist/useRegisterError-RP3LuUvG.js +8913 -0
- package/dist/{verify-D1ht4LA_.js → verify-Cxrk9OZf.js} +1 -1
- package/dist/{verify-filled-dnv72m5L.js → verify-filled-DTYh5fHd.js} +1 -1
- package/dist/{w3m-modal-C6GoV_9z.js → w3m-modal-BtzAU8Rd.js} +2 -2
- package/dist/{wallet-Bprt1UAo.js → wallet-CqHzy9UL.js} +1 -1
- package/dist/{wallet-placeholder-Gxhin3eq.js → wallet-placeholder-DUpL8Wi-.js} +1 -1
- package/dist/{walletconnect-BtGZzptI.js → walletconnect-CMShOjhI.js} +1 -1
- package/dist/{warning-circle-Dg0PEAqK.js → warning-circle-C-6BUTdg.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-DvzFvpB5.js → x-Bs3i9yGj.js} +1 -1
- package/package.json +6 -2
- package/dist/EstGas-CObudv5z.js +0 -12661
- package/dist/QuotesProgress-DCNTk9oc.js +0 -28
- package/dist/TxnButton-DEs1au8L.js +0 -208
- package/dist/getCosmosAddress-CyskK48O.js +0 -9565
- package/dist/index-BcWL0DrD.js +0 -30399
- package/dist/index-BeQiCUcq.js +0 -3010
- package/dist/index-DTish3yr.js +0 -1014
- package/dist/useRegisterError-JoAAYTsQ.js +0 -8812
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as D from "react";
|
2
2
|
import kt from "react";
|
3
|
-
import { p as J, P as i,
|
3
|
+
import { p as J, P as i, aV as St, m as Bt, g as Wt, b as Lt, _ as Te, d as z, h as Nt, i as Ht, s as Vt } from "./index-DQ-upUtl.js";
|
4
4
|
import { jsx as de } from "react/jsx-runtime";
|
5
|
-
import { o as et, P as It, b as Se, a as tt, m as Ut, r as mt, h as qt, H as Ee, T as Ft, q as _t, j as Xt, n as zt, t as rt, v as Yt, w as Gt } from "./useRegisterError-
|
5
|
+
import { o as et, P as It, b as Se, a as tt, m as Ut, r as mt, h as qt, H as Ee, T as Ft, q as _t, j as Xt, n as zt, t as rt, v as Yt, w as Gt } from "./useRegisterError-RP3LuUvG.js";
|
6
6
|
let nt = 0;
|
7
7
|
function Jt(e) {
|
8
8
|
const [t, r] = D.useState(e), n = e || t;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsxs as b, jsx as t, Fragment as k } from "react/jsx-runtime";
|
2
|
-
import { u as n, S as W } from "./index-
|
2
|
+
import { u as n, S as W } from "./index-DQ-upUtl.js";
|
3
3
|
import { useState as S, useRef as x } from "react";
|
4
|
-
import { u as j, i as I, W as D, F, f as p, c as u, z as R } from "./useRegisterError-
|
4
|
+
import { u as j, i as I, W as D, F, f as p, c as u, z as R } from "./useRegisterError-RP3LuUvG.js";
|
5
5
|
import { useAccount as T, useBalance as A } from "wagmi";
|
6
6
|
import "@dynamic-labs/sdk-react-core";
|
7
|
-
import { c as B, r as G } from "./index-
|
7
|
+
import { c as B, r as G } from "./index-BEianCH_.js";
|
8
8
|
function H({ amount: w, setAmount: l, fetchBalance: M, getCoinBalance: h, isBalanceLoading: f }) {
|
9
9
|
var d, o;
|
10
10
|
const s = n((a) => a.configuration), e = n((a) => a.fromCoin), r = n((a) => a.fromChain), { isAnyWalletConnected: g } = j({ chainData: r }), [$, z] = S(40), { address: N } = T(), v = x(), { defaultCoin: y } = I;
|
@@ -61,7 +61,7 @@ function H({ amount: w, setAmount: l, fetchBalance: M, getCoinBalance: h, isBala
|
|
61
61
|
G(a);
|
62
62
|
},
|
63
63
|
placeholder: "0.0",
|
64
|
-
className: "bw-text-3xl bw-border-none focus:bw-placeholder:bw-opacity-0 placeholder:bw-text-left bw-h-[36px] bw-ml-auto bw-mb-1 bw-pl-1 bw-min-w-[45px] bw-max-w-[200px] bw-font-medium placeholder:bw-text-text-placeholder bw-text-text-primary bw-bg-transparent"
|
64
|
+
className: "bw-text-2xl md:bw-text-3xl bw-border-none focus:bw-placeholder:bw-opacity-0 placeholder:bw-text-left bw-h-[36px] bw-ml-auto bw-mb-1 bw-pl-1 bw-min-w-[45px] bw-max-w-[200px] bw-font-medium placeholder:bw-text-text-placeholder bw-text-text-primary bw-bg-transparent"
|
65
65
|
}
|
66
66
|
)
|
67
67
|
] })
|
@@ -91,7 +91,7 @@ function H({ amount: w, setAmount: l, fetchBalance: M, getCoinBalance: h, isBala
|
|
91
91
|
] }) : /* @__PURE__ */ t(k, {}) })
|
92
92
|
] })
|
93
93
|
] }),
|
94
|
-
/* @__PURE__ */ t("div", { className: "bw-flex bw-justify-between bw-items-center", children: /* @__PURE__ */ t("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: /* @__PURE__ */ b("p", { className: ` bw-font-normal bw-pl-2 ${w.length ? "bw-text-text-secondary bw-text-sm" : "bw-text-text-placeholder bw-text-[10px]"}`, children: [
|
94
|
+
/* @__PURE__ */ t("div", { className: "bw-flex bw-justify-between bw-items-center", children: /* @__PURE__ */ t("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: /* @__PURE__ */ b("p", { className: ` bw-font-normal bw-pl-2 ${w.length ? "bw-text-text-secondary bw-text-xs md:bw-text-sm" : "bw-text-text-placeholder bw-text-[10px]"}`, children: [
|
95
95
|
"$",
|
96
96
|
u(R(w * (e == null ? void 0 : e.lastPrice)), 10)
|
97
97
|
] }) }) })
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { jsx as e, jsxs as t, Fragment as m } from "react/jsx-runtime";
|
2
2
|
import { t as te } from "./truncate-D9t92mVX.js";
|
3
|
-
import { u as r, S as o, l as we } from "./index-
|
3
|
+
import { u as r, S as o, l as we } from "./index-DQ-upUtl.js";
|
4
4
|
import { useState as ie, useEffect as le } from "react";
|
5
5
|
import { s as a } from "./WidgetForm.module-QHJ0-m5f.js";
|
6
6
|
import { G as ce, C as de, S as me } from "./clockIcon-C2W5xvyt.js";
|
7
|
-
import { S as re } from "./down-
|
7
|
+
import { S as re } from "./down-B0DJRPMS.js";
|
8
8
|
import { e as se } from "./ethertousd-CC_ezooz.js";
|
9
|
-
import { O as H } from "./index-
|
10
|
-
import {
|
11
|
-
function
|
9
|
+
import { O as H } from "./index-CxxmgFkL.js";
|
10
|
+
import { F as J, i as ae } from "./useRegisterError-RP3LuUvG.js";
|
11
|
+
function oe({ fill: n }) {
|
12
12
|
return /* @__PURE__ */ e(
|
13
13
|
"svg",
|
14
14
|
{
|
@@ -28,9 +28,9 @@ function xe({ fill: n }) {
|
|
28
28
|
}
|
29
29
|
);
|
30
30
|
}
|
31
|
-
function
|
32
|
-
var y, N, F,
|
33
|
-
const x = n.data, [c, Y] = ie(), l = r((i) => i.gradient), w = r((i) => i.configuration), h = r((i) => i.fromChain), g = r((i) => i.fromCoin), p = r((i) => i.toChain), d = r((i) => i.toCoin), { defaultCoin: D } =
|
31
|
+
function ue({ routes: n, handleShowAllRoutes: K, routesData: b, price: Q, amount: X, isRoutesEnabled: v }) {
|
32
|
+
var y, N, F, S, u, k, C, $, E, j, I, L, U, A, G, O, T, z, M, R, _, B, V, q, P, W;
|
33
|
+
const x = n.data, [c, Y] = ie(), l = r((i) => i.gradient), w = r((i) => i.configuration), h = r((i) => i.fromChain), g = r((i) => i.fromCoin), p = r((i) => i.toChain), d = r((i) => i.toCoin), { defaultCoin: D } = ae;
|
34
34
|
le(() => {
|
35
35
|
var i;
|
36
36
|
if (b) {
|
@@ -40,8 +40,8 @@ function ke({ routes: n, handleShowAllRoutes: K, routesData: b, price: Q, amount
|
|
40
40
|
}), Y({ tempGasObj: f, token: Z });
|
41
41
|
}
|
42
42
|
}, [b]);
|
43
|
-
let ee = (b == null ? void 0 : b.outputAmountDisplay) || "", be =
|
44
|
-
return /* @__PURE__ */ e("div", { className: "bw-mt-2", children: (
|
43
|
+
let ee = (b == null ? void 0 : b.outputAmountDisplay) || "", be = Q.toString(), ne = (N = (y = b == null ? void 0 : b.providerDetails) == null ? void 0 : y.logoUrl) != null && N.length ? (F = b == null ? void 0 : b.providerDetails) == null ? void 0 : F.logoUrl : D;
|
44
|
+
return /* @__PURE__ */ e("div", { className: "bw-mt-2", children: (S = h == null ? void 0 : h.chain) != null && S.length && ((u = g == null ? void 0 : g.coin) != null && u.length) && ((k = p == null ? void 0 : p.chain) != null && k.length) && ((C = d == null ? void 0 : d.coin) != null && C.length) && X.length && v ? n.isSuccess && !((j = (E = ($ = n.data) == null ? void 0 : $.data) == null ? void 0 : E.quotes) != null && j.length) && !n.isFetching ? /* @__PURE__ */ e("div", { className: "bw-bg-background-container bw-text-text-secondary bw-flex bw-justify-center bw-items-center bw-h-[80px] bw-relative bw-flex-col bw-border bw-border-border-primary", children: "No Routes Available" }) : n.isSuccess || n.isLoading || n.isFetching ? /* @__PURE__ */ t("div", { children: [
|
45
45
|
/* @__PURE__ */ t("div", { className: "bw-flex bw-items-center bw-justify-between", children: [
|
46
46
|
" ",
|
47
47
|
/* @__PURE__ */ t("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: [
|
@@ -56,10 +56,10 @@ function ke({ routes: n, handleShowAllRoutes: K, routesData: b, price: Q, amount
|
|
56
56
|
/* @__PURE__ */ t("div", { className: "bw-flex bw-items-start bw-gap-x-2", children: [
|
57
57
|
d != null && d.image && !n.isFetching ? /* @__PURE__ */ e("img", { src: d.image, width: 30, height: 30, className: "bw-mt-1 bw-max-w-[30px] bw-max-h-[30px] bw-object-contain bw-bg-background-secondary bw-rounded-[50%]" }) : /* @__PURE__ */ e(m, {}),
|
58
58
|
/* @__PURE__ */ t("div", { children: [
|
59
|
-
n.isFetching ? /* @__PURE__ */ e(o, { className: "bw-bg-background-secondary bw-mt-3 bw-rounded-sm bw-h-[36px] bw-min-h-[36px]", animation: "wave", variant: "rectangular", height: 36, width: 250 }) : /* @__PURE__ */ e("p", { className: "bw-text-3xl bw-mb-1 bw-font-medium bw-text-text-primary", children: /* @__PURE__ */ e(H, { value: ee, decimal: 12 }) }),
|
59
|
+
n.isFetching ? /* @__PURE__ */ e(o, { className: "bw-bg-background-secondary bw-mt-3 bw-rounded-sm bw-h-[36px] bw-min-h-[36px]", animation: "wave", variant: "rectangular", height: 36, width: 250 }) : /* @__PURE__ */ e("p", { className: "bw-text-2xl md:bw-text-3xl bw-mb-1 bw-font-medium bw-text-text-primary", children: /* @__PURE__ */ e(H, { value: ee, decimal: 12 }) }),
|
60
60
|
n.isFetching ? /* @__PURE__ */ e(o, { className: "bw-bg-background-secondary bw-mt-2 bw-rounded-sm bw-h-[20px] bw-w-[100px] bw-min-h-[20px]", variant: "rectangular", animation: "wave", height: 20, width: 100 }) : /* @__PURE__ */ t("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: [
|
61
61
|
/* @__PURE__ */ e(ce, { fill: "var(--tw-text-primary)" }),
|
62
|
-
/* @__PURE__ */ t("p", { className: "bw-text-sm bw-font-medium bw-text-text-primary", children: [
|
62
|
+
/* @__PURE__ */ t("p", { className: "bw-text-xs md:bw-text-sm bw-font-medium bw-text-text-primary", children: [
|
63
63
|
"Total Fee:",
|
64
64
|
" $",
|
65
65
|
/* @__PURE__ */ e(J, { value: ((U = c == null ? void 0 : c.tempGasObj) == null ? void 0 : U.amountInUSD) || 0, options: { maxDecimals: 8 } }),
|
@@ -71,9 +71,9 @@ function ke({ routes: n, handleShowAllRoutes: K, routesData: b, price: Q, amount
|
|
71
71
|
] })
|
72
72
|
] }),
|
73
73
|
/* @__PURE__ */ t("div", { className: " bw-text-sm bw-font-medium bw-mt-2 bw-text-text-loaderbar ", children: [
|
74
|
-
n.isFetching ? /* @__PURE__ */ e(o, { className: "bw-bg-background-secondary bw-w-[50px] bw-rounded-sm bw-h-[20px] bw-min-h-[20px]", variant: "rectangular", animation: "wave", height: 20, width: 50 }) : /* @__PURE__ */ t("p", { className: "bw-text-text-secondary bw-font-medium bw-text-sm", children: [
|
74
|
+
n.isFetching ? /* @__PURE__ */ e(o, { className: "bw-bg-background-secondary bw-w-[50px] bw-rounded-sm bw-h-[20px] bw-min-h-[20px]", variant: "rectangular", animation: "wave", height: 20, width: 50 }) : /* @__PURE__ */ t("p", { className: "bw-text-text-secondary bw-font-medium bw-text-xs md:bw-text-sm", children: [
|
75
75
|
"$",
|
76
|
-
/* @__PURE__ */ e(H, { value: be, decimal:
|
76
|
+
/* @__PURE__ */ e(H, { value: be, decimal: 10 })
|
77
77
|
] }),
|
78
78
|
n.isFetching ? /* @__PURE__ */ e(o, { className: "bw-bg-background-secondary bw-w-[50px] bw-mt-2 bw-rounded-sm bw-h-[20px] bw-min-h-[20px] ", variant: "rectangular", animation: "wave", height: 20, width: 50 }) : ((M = (z = (T = x == null ? void 0 : x.data) == null ? void 0 : T.quotes) == null ? void 0 : z[0]) == null ? void 0 : M._id) === b._id ? /* @__PURE__ */ e("div", { style: { ...w.gradientStyle }, className: `${l || `${(R = w.gradientStyle) != null && R.background ? "" : "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]"} `} bw-mt-3 bw-text-right bw-text-transparent bw-text-[10px] bw-font-bold bw-bg-clip-text ${a.gradienttext}`, children: "BEST" }) : /* @__PURE__ */ e(m, {})
|
79
79
|
] })
|
@@ -98,12 +98,12 @@ function ke({ routes: n, handleShowAllRoutes: K, routesData: b, price: Q, amount
|
|
98
98
|
" "
|
99
99
|
] }) : /* @__PURE__ */ e(m, {}),
|
100
100
|
/* @__PURE__ */ e("div", { style: n.isFetching ? {} : { ...w.gradientStyle }, className: ` ${n.isFetching ? "bw-bg-background-secondary" : ` ${l || ` ${a.overlay} ${(q = w == null ? void 0 : w.gradientStyle) != null && q.background ? "" : "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]"}`}`} bw-absolute bw-right-0 bw-rounded-[50%] bw-w-[4px] bw-h-[4px] ` }),
|
101
|
-
/* @__PURE__ */ e("div", { style: n.isFetching ? {} : { ...w.gradientStyle }, className: ` ${n.isFetching ? "bw-bg-background-secondary" : ` ${l || ` ${a.overlay} ${(
|
101
|
+
/* @__PURE__ */ e("div", { style: n.isFetching ? {} : { ...w.gradientStyle }, className: ` ${n.isFetching ? "bw-bg-background-secondary" : ` ${l || ` ${a.overlay} ${(P = w == null ? void 0 : w.gradientStyle) != null && P.background ? "" : "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]"}`}`} bw-absolute bw-rounded-[50%] bw-w-[4px] bw-h-[4px] ` })
|
102
102
|
] })
|
103
103
|
] }),
|
104
104
|
/* @__PURE__ */ e("div", { className: "bw-bg-background-container bw-flex bw-items-center bw-w-[85%] bw-mx-auto bw-rounded-b-md bw-justify-center bw-h-[60px]", children: n.isFetching ? /* @__PURE__ */ e("div", { className: "bw-mt-6 bw-w-full bw-h-[20px]" }) : /* @__PURE__ */ t("div", { className: "bw-flex bw-items-center bw-gap-x-4 bw-mt-2 bw-bg-background-container bw-justify-center ", children: [
|
105
105
|
/* @__PURE__ */ t("div", { className: "bw-flex bw-items-center bw-gap-x-1", children: [
|
106
|
-
/* @__PURE__ */ e(
|
106
|
+
/* @__PURE__ */ e(oe, { fill: "var(--tw-text-secondary)" }),
|
107
107
|
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: "Fee" }),
|
108
108
|
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-line-through bw-font-medium bw-text-text-secondary", children: "0.1%" }),
|
109
109
|
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: "0" })
|
@@ -114,12 +114,12 @@ function ke({ routes: n, handleShowAllRoutes: K, routesData: b, price: Q, amount
|
|
114
114
|
] }),
|
115
115
|
/* @__PURE__ */ t("div", { className: " bw-gap-x-1 bw-flex bw-items-center bw-text-xs bw-font-normal bw-text-text-primary", children: [
|
116
116
|
/* @__PURE__ */ e(me, { fill: "var(--tw-text-secondary)" }),
|
117
|
-
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: `${((
|
117
|
+
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: `${((W = b == null ? void 0 : b.steps) == null ? void 0 : W.length) || ""} step` })
|
118
118
|
] })
|
119
119
|
] }) })
|
120
120
|
] })
|
121
121
|
] }) : v ? /* @__PURE__ */ e("div", { className: "bw-bg-background-container bw-text-text-secondary bw-justify-center bw-items-center bw-h-[80px] bw-relative bw-flex bw-flex-col bw-border bw-border-border-primary", children: "Failed to load routes" }) : /* @__PURE__ */ e(m, {}) : /* @__PURE__ */ e(m, {}) });
|
122
122
|
}
|
123
123
|
export {
|
124
|
-
|
124
|
+
ue as default
|
125
125
|
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { jsxs as o, jsx as a, Fragment as m } from "react/jsx-runtime";
|
2
|
+
import { s as l } from "./WidgetForm.module-QHJ0-m5f.js";
|
3
|
+
import { u as g } from "./index-DQ-upUtl.js";
|
4
|
+
function y({ routesData: x, routes: e, quoteTimer: n, amount: c }) {
|
5
|
+
var s, b, d, w;
|
6
|
+
const r = g((i) => i.configuration), t = g((i) => i.gradient);
|
7
|
+
return c && !e.isFetching && typeof e.data < "u" && ((d = (b = (s = e.data) == null ? void 0 : s.data) == null ? void 0 : b.quotes) != null && d.length) && !e.isError ? /* @__PURE__ */ o("div", { className: "bw-flex bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
8
|
+
/* @__PURE__ */ a("p", { className: "bw-text-sm bw-font-medium bw-text-text-secondary", children: "New Quote in" }),
|
9
|
+
/* @__PURE__ */ a("div", { className: " bw-w-[250px] bw-flex-1 bw-bg-border-primary bw-h-[3px] bw-overflow-x-hidden", children: /* @__PURE__ */ a(
|
10
|
+
"div",
|
11
|
+
{
|
12
|
+
style: {
|
13
|
+
height: "100%",
|
14
|
+
...r.gradientStyle,
|
15
|
+
width: `${100 - n / x.deadline * 100}%`
|
16
|
+
},
|
17
|
+
className: ` ${t || `${(w = r.gradientStyle) != null && w.background ? "" : "bw-bg-gradient-to-r bw-from-[#A45EFF] bw-to-[#2CFFE4]"} ${l.overlay}`} bw-relative `
|
18
|
+
}
|
19
|
+
) }),
|
20
|
+
/* @__PURE__ */ o("div", { style: { ...r.gradientStyle }, className: `${t ? `${t} bw-bg-clip-text bw-text-transparent` : l.gradienttext} bw-relative bw-text-right bw-w-max bw-text-2xl bw-font-semibold bw-text-transparent `, children: [
|
21
|
+
n,
|
22
|
+
"s"
|
23
|
+
] })
|
24
|
+
] }) : /* @__PURE__ */ a(m, {});
|
25
|
+
}
|
26
|
+
export {
|
27
|
+
y as default
|
28
|
+
};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { b as go, g as To, i as yo, _ as vo, p as B, d as n, e as D, s as Q, f as Ve, h as Po, j as ze, P as e } from "./index-
|
1
|
+
import { b as go, g as To, i as yo, _ as vo, p as B, d as n, e as D, s as Q, f as Ve, h as Po, j as ze, P as e } from "./index-DQ-upUtl.js";
|
2
2
|
import * as p from "react";
|
3
|
-
import { G as Be, b as wo, u as Ro, a as Co, P as He } from "./Grow-
|
3
|
+
import { G as Be, b as wo, u as Ro, a as Co, P as He } from "./Grow-DOn6L3co.js";
|
4
4
|
import { jsx as j, jsxs as Se } from "react/jsx-runtime";
|
5
|
-
import { j as xo, q as I, l as Ue, s as Oo, b as Eo, n as Mo,
|
5
|
+
import { j as xo, q as I, l as Ue, s as Oo, b as Eo, n as Mo, E as A, G as _o, w as No } from "./useRegisterError-RP3LuUvG.js";
|
6
6
|
function Lo(r) {
|
7
7
|
return To("MuiTooltip", r);
|
8
8
|
}
|
@@ -194,10 +194,10 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
194
194
|
children: U,
|
195
195
|
components: O = {},
|
196
196
|
componentsProps: h = {},
|
197
|
-
describeChild:
|
198
|
-
disableFocusListener:
|
197
|
+
describeChild: Ge = !1,
|
198
|
+
disableFocusListener: Ye = !1,
|
199
199
|
disableHoverListener: he = !1,
|
200
|
-
disableInteractive:
|
200
|
+
disableInteractive: qe = !1,
|
201
201
|
disableTouchListener: Ke = !1,
|
202
202
|
enterDelay: be = 100,
|
203
203
|
enterNextDelay: ge = 0,
|
@@ -219,7 +219,7 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
219
219
|
TransitionProps: eo
|
220
220
|
} = S, Re = vo(S, $o), c = /* @__PURE__ */ p.isValidElement(U) ? U : /* @__PURE__ */ j("span", {
|
221
221
|
children: U
|
222
|
-
}), Ce = xo(), oo = wo(), [l, xe] = p.useState(), [z, to] = p.useState(null), M = p.useRef(!1), H =
|
222
|
+
}), Ce = xo(), oo = wo(), [l, xe] = p.useState(), [z, to] = p.useState(null), M = p.useRef(!1), H = qe || W, Oe = I(), G = I(), _ = I(), Ee = I(), [ro, Me] = Ro({
|
223
223
|
controlled: Pe,
|
224
224
|
default: !1,
|
225
225
|
name: "Tooltip",
|
@@ -234,7 +234,7 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
234
234
|
l && l.disabled && !o && m !== "" && l.tagName.toLowerCase();
|
235
235
|
}, [m, l, o]);
|
236
236
|
}
|
237
|
-
const
|
237
|
+
const Y = Co(Je), T = p.useRef(), N = Ue(() => {
|
238
238
|
T.current !== void 0 && (document.body.style.WebkitUserSelect = T.current, T.current = void 0), Ee.clear();
|
239
239
|
});
|
240
240
|
p.useEffect(() => N, [N]);
|
@@ -252,11 +252,11 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
252
252
|
});
|
253
253
|
}
|
254
254
|
), $ = (o) => {
|
255
|
-
M.current && o.type !== "touchstart" || (l && l.removeAttribute("title"),
|
255
|
+
M.current && o.type !== "touchstart" || (l && l.removeAttribute("title"), G.clear(), _.clear(), be || F && ge ? G.start(F ? ge : be, () => {
|
256
256
|
_e(o);
|
257
257
|
}) : _e(o));
|
258
|
-
},
|
259
|
-
|
258
|
+
}, q = (o) => {
|
259
|
+
G.clear(), _.start(Te, () => {
|
260
260
|
L(o);
|
261
261
|
});
|
262
262
|
}, {
|
@@ -265,7 +265,7 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
265
265
|
onFocus: so,
|
266
266
|
ref: po
|
267
267
|
} = Oo(), [, Le] = p.useState(!1), $e = (o) => {
|
268
|
-
no(o), Ne.current === !1 && (Le(!1),
|
268
|
+
no(o), Ne.current === !1 && (Le(!1), q(o));
|
269
269
|
}, De = (o) => {
|
270
270
|
l || xe(o.currentTarget), so(o), Ne.current === !0 && (Le(!0), $(o));
|
271
271
|
}, je = (o) => {
|
@@ -300,7 +300,7 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
300
300
|
y: o.clientY
|
301
301
|
}, K.current && K.current.update();
|
302
302
|
}, y = {}, X = typeof m == "string";
|
303
|
-
|
303
|
+
Ge ? (y.title = !u && X && !he ? m : null, y["aria-describedby"] = u ? Y : null) : (y["aria-label"] = X ? m : null, y["aria-labelledby"] = u && !X ? Y : null);
|
304
304
|
const a = n({}, y, Re, c.props, {
|
305
305
|
className: D(Re.className, c.props.className),
|
306
306
|
onTouchStart: je,
|
@@ -312,7 +312,7 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
312
312
|
l && l.getAttribute("data-mui-internal-clone-element");
|
313
313
|
}, [l]));
|
314
314
|
const v = {};
|
315
|
-
Ke || (a.onTouchStart = io, a.onTouchEnd = lo), he || (a.onMouseOver = k($, a.onMouseOver), a.onMouseLeave = k(
|
315
|
+
Ke || (a.onTouchStart = io, a.onTouchEnd = lo), he || (a.onMouseOver = k($, a.onMouseOver), a.onMouseLeave = k(q, a.onMouseLeave), H || (v.onMouseOver = $, v.onMouseLeave = q)), Ye || (a.onFocus = k(De, a.onFocus), a.onBlur = k($e, a.onBlur), H || (v.onFocus = De, v.onBlur = $e)), B.env.NODE_ENV !== "production" && c.props.title;
|
316
316
|
const uo = p.useMemo(() => {
|
317
317
|
var o;
|
318
318
|
let i = [{
|
@@ -356,7 +356,7 @@ const ko = /* @__PURE__ */ p.forwardRef(function(t, s) {
|
|
356
356
|
} : l,
|
357
357
|
popperRef: K,
|
358
358
|
open: l ? u : !1,
|
359
|
-
id:
|
359
|
+
id: Y,
|
360
360
|
transition: !0
|
361
361
|
}, v, mo, {
|
362
362
|
popperOptions: uo,
|
@@ -0,0 +1,223 @@
|
|
1
|
+
import { jsx as G } from "react/jsx-runtime";
|
2
|
+
import { useState as v, useEffect as z } from "react";
|
3
|
+
import { useDynamicContext as ge, useSwitchNetwork as ze, useIsLoggedIn as Me } from "@dynamic-labs/sdk-react-core";
|
4
|
+
import { a as ye, u as h, aD as Oe, aE as be } from "./index-DQ-upUtl.js";
|
5
|
+
import { s as S } from "./WidgetForm.module-QHJ0-m5f.js";
|
6
|
+
import { useAccount as Re, useConfig as Ve, useSwitchChain as qe, useBalance as Pe } from "wagmi";
|
7
|
+
import { u as ue, d as _e, c as Qe, C as pe } from "./useRegisterError-RP3LuUvG.js";
|
8
|
+
import "./getCosmosAddress-nYlLagxO.js";
|
9
|
+
import { v as He } from "./validError-CDlJpg_f.js";
|
10
|
+
import { u as Je, p as Ke } from "./index-BEianCH_.js";
|
11
|
+
function Ue(n) {
|
12
|
+
const { wallet: u, address: l } = ye(), [f, N] = v(0);
|
13
|
+
async function x() {
|
14
|
+
const F = await window.tronWeb.trx.getBalance(l);
|
15
|
+
N(F / Math.pow(10, 6));
|
16
|
+
}
|
17
|
+
return z(() => {
|
18
|
+
l && (n == null ? void 0 : n.networkType) === "tron" && x();
|
19
|
+
}, [l, n == null ? void 0 : n.networkType]), { tronBal: f };
|
20
|
+
}
|
21
|
+
function A(n) {
|
22
|
+
if (n.key.toLowerCase() === "backpacksol")
|
23
|
+
return !0;
|
24
|
+
}
|
25
|
+
function Xe() {
|
26
|
+
const [n, u] = v(0), l = h((x) => x.fromChain), { primaryWallet: f } = ge();
|
27
|
+
async function N() {
|
28
|
+
let x = await f.getBalance();
|
29
|
+
u(Number(x) || 0);
|
30
|
+
}
|
31
|
+
return z(() => {
|
32
|
+
(l.networkType === "btc" || l.networkType === "sui") && N();
|
33
|
+
}, [l.networkType, f]), n;
|
34
|
+
}
|
35
|
+
function dt({ routesData: n, routes: u, amount: l, isAmountTyped: f, handleShowWallet: N, setConnectWalletField: x, handleConfirmClose: F, balanceSol: L, getCoinBalance: xe, handleSuccess: _ }) {
|
36
|
+
var D, k, C, ee, te, se, re, ce, ne, ie, de, ae, le;
|
37
|
+
const w = h((s) => s.gradient), m = h((s) => s.configuration), e = h((s) => s.fromChain), i = h((s) => s.fromCoin), r = h((s) => s.toChain), b = h((s) => s.toCoin), { isConnected: j, address: Q, chain: I } = Re(), Te = Ve(), me = ze(), { getBothWalletConnection: Ie, getConnectWallet: he } = ue({
|
38
|
+
chainData: e
|
39
|
+
}), { connected: H, address: J, disconnect: Ye } = ye(), M = h((s) => s.toDisconnect), d = h((s) => s.customWallet), { getWallet: fe } = ue({ chainData: e }), Ne = he(e, r), [O, Be] = v("101"), { tronBal: R } = Ue(e), { cosmosBalance: K } = Je(), U = Xe(), V = ((D = e.chain) == null ? void 0 : D.length) && ((k = r.chain) == null ? void 0 : k.length), q = ((C = i.address) == null ? void 0 : C.length) && ((ee = b.address) == null ? void 0 : ee.length), Ge = _e(), X = Oe(), { switchChain: Ze, switchChainAsync: Se, isPending: Ee } = qe({
|
40
|
+
chainId: Number((e == null ? void 0 : e.chainId) || "0"),
|
41
|
+
config: Te,
|
42
|
+
throwForSwitchChainNotSupported: !0,
|
43
|
+
onError(s) {
|
44
|
+
He(s.message) && Ge({ module: "wallet-error-switch", error: s.message });
|
45
|
+
}
|
46
|
+
}), T = Pe({
|
47
|
+
address: Q,
|
48
|
+
token: "",
|
49
|
+
chainId: Number((e == null ? void 0 : e.chainId) || 0),
|
50
|
+
enabled: (e == null ? void 0 : e.networkType) == "evm"
|
51
|
+
}), Y = Qe(xe || 0, 11), [o, a] = v({
|
52
|
+
text: "",
|
53
|
+
isGradient: !1,
|
54
|
+
color: "bw-bg-border-primary"
|
55
|
+
});
|
56
|
+
async function $e() {
|
57
|
+
if ((e == null ? void 0 : e.networkType) === "evm" && Number((e == null ? void 0 : e.chainId) || "0") !== (I == null ? void 0 : I.id))
|
58
|
+
try {
|
59
|
+
await Se({ chainId: Number((e == null ? void 0 : e.chainId) || "0") });
|
60
|
+
} catch {
|
61
|
+
}
|
62
|
+
else if ((e == null ? void 0 : e.networkType) === "sol" && O !== ((e == null ? void 0 : e.chainId) == "eclipse-svm" ? "201" : "101"))
|
63
|
+
try {
|
64
|
+
let s = await me({ wallet: p, network: e.chainId == "eclipse-svm" ? "201" : "101" });
|
65
|
+
Z();
|
66
|
+
} catch {
|
67
|
+
}
|
68
|
+
else (e == null ? void 0 : e.networkType) === "sui" ? (X.emit(be.TransactionStarted, {
|
69
|
+
...n
|
70
|
+
}), B && (_(!1), F())) : (X.emit(be.TransactionStarted, {
|
71
|
+
...n
|
72
|
+
}), B && (_(!1), F()));
|
73
|
+
}
|
74
|
+
const { primaryWallet: p } = ge(), P = Me(), B = (e == null ? void 0 : e.networkType) === r.networkType ? !!((se = (te = fe(e)) == null ? void 0 : te.address) != null && se.length) : Ie(e == null ? void 0 : e.networkType, (d == null ? void 0 : d.length) > 30 ? "customWallet" : r == null ? void 0 : r.networkType), Z = async () => {
|
75
|
+
if (p)
|
76
|
+
try {
|
77
|
+
const s = await p.getNetwork();
|
78
|
+
Be(s);
|
79
|
+
} catch {
|
80
|
+
}
|
81
|
+
else
|
82
|
+
return;
|
83
|
+
};
|
84
|
+
z(() => {
|
85
|
+
Z();
|
86
|
+
}, [p]);
|
87
|
+
function W(s, g) {
|
88
|
+
let y = s / Math.pow(10, g);
|
89
|
+
return y < 1e-6 ? y.toFixed(20) : y;
|
90
|
+
}
|
91
|
+
function Fe() {
|
92
|
+
var s;
|
93
|
+
return Number(((s = T == null ? void 0 : T.data) == null ? void 0 : s.formatted) || 0);
|
94
|
+
}
|
95
|
+
function Le(s) {
|
96
|
+
var g;
|
97
|
+
return Number(((g = K[Ke(s.address)]) == null ? void 0 : g.amount) || 0) / Math.pow(10, s.decimals);
|
98
|
+
}
|
99
|
+
function je() {
|
100
|
+
var $;
|
101
|
+
let s = {};
|
102
|
+
async function g(t, c) {
|
103
|
+
let E = Object.keys(s);
|
104
|
+
s[t == null ? void 0 : t.chainId] ? (s[t == null ? void 0 : t.chainId].amountInToken += c.amountInToken, s[t == null ? void 0 : t.chainId].gas += W(c.amountInToken, t == null ? void 0 : t.decimals)) : s[t == null ? void 0 : t.chainId] = {
|
105
|
+
amountInToken: c.amountInToken,
|
106
|
+
gas: W(c.amountInToken, t == null ? void 0 : t.decimals),
|
107
|
+
token: t,
|
108
|
+
nativeBal: (d == null ? void 0 : d.length) > 30 && !M && (t == null ? void 0 : t.chainId) == (r == null ? void 0 : r.chainId) && (r == null ? void 0 : r.chainId) !== (e == null ? void 0 : e.chainId) ? 0 : (t == null ? void 0 : t.networkType) == "sol" ? L : (t == null ? void 0 : t.networkType) == "tron" ? R : (t == null ? void 0 : t.networkType) == "btc" || (t == null ? void 0 : t.networkType) == "sui" ? U : (t == null ? void 0 : t.networkType) == "cosmos" ? Le(t) : Fe(),
|
109
|
+
isFromChain: (e == null ? void 0 : e.chainId) === (t == null ? void 0 : t.chainId.toString()),
|
110
|
+
order: (e == null ? void 0 : e.chainId) === (t == null ? void 0 : t.chainId) ? 1 : (r == null ? void 0 : r.chainId) === (t == null ? void 0 : t.chainId) ? 2 : E.length > 2 ? 3 : 2
|
111
|
+
};
|
112
|
+
}
|
113
|
+
($ = n == null ? void 0 : n.fee) == null || $.forEach((t) => {
|
114
|
+
const { token: c } = t;
|
115
|
+
t.source.toLowerCase() == "from_source_wallet" && g(c, t);
|
116
|
+
});
|
117
|
+
let y = Y;
|
118
|
+
if (Number(l) > Number(y))
|
119
|
+
a({
|
120
|
+
text: `Insufficient Balance ${i.coin || ""}`,
|
121
|
+
isGradient: !1,
|
122
|
+
color: "bw-bg-border-primary"
|
123
|
+
});
|
124
|
+
else if ((T != null && T.isLoading || T.isFetching) && (e == null ? void 0 : e.networkType) === "evm" || (typeof L > "u" || L === null) && (e == null ? void 0 : e.networkType) === "sol" || !R && (e == null ? void 0 : e.networkType) === "tron")
|
125
|
+
a({
|
126
|
+
text: "Fetching Balance..",
|
127
|
+
isGradient: !1,
|
128
|
+
color: "bw-bg-border-primary"
|
129
|
+
});
|
130
|
+
else {
|
131
|
+
let t = Object.values(s).sort((c, E) => c.order - E.order);
|
132
|
+
t.some((c) => {
|
133
|
+
var E, oe, we;
|
134
|
+
return c != null && c.isFromChain && Number(l) <= Number(y) && Number(c.nativeBal) - Number(l) < c.gas && (i != null && i.isNative) || Number(l) <= Number(y) && Number(c.nativeBal) < c.gas && !(i != null && i.isNative) && (c != null && c.isFromChain) ? (a({
|
135
|
+
text: `Insufficient ${((E = c == null ? void 0 : c.token) == null ? void 0 : E.symbol) || ""} for gas on ${c.token.blockchain}`,
|
136
|
+
isGradient: !1,
|
137
|
+
color: "bw-bg-border-primary"
|
138
|
+
}), !0) : c.nativeBal < c.gas && !((d == null ? void 0 : d.length) > 30 && ((oe = c == null ? void 0 : c.token) == null ? void 0 : oe.chainId) == (r == null ? void 0 : r.chainId)) ? (a({
|
139
|
+
text: `Insufficient ${((we = c == null ? void 0 : c.token) == null ? void 0 : we.symbol) || ""} for gas on ${c.token.blockchain}`,
|
140
|
+
isGradient: !1,
|
141
|
+
color: "bw-bg-border-primary"
|
142
|
+
}), !0) : (a({
|
143
|
+
text: "",
|
144
|
+
isGradient: !0,
|
145
|
+
color: w || S.gradientbutton
|
146
|
+
}), !0);
|
147
|
+
}), t.length == 0 && (n != null && n.gasless || (n == null ? void 0 : n.provider) == "meson") && a({
|
148
|
+
text: "",
|
149
|
+
isGradient: !0,
|
150
|
+
color: w || S.gradientbutton
|
151
|
+
});
|
152
|
+
}
|
153
|
+
}
|
154
|
+
z(() => {
|
155
|
+
var s, g, y;
|
156
|
+
!i.coin.length || !(b != null && b.coin.length) ? a({
|
157
|
+
text: "Select Token",
|
158
|
+
isGradient: !0,
|
159
|
+
color: w || S.gradientbutton
|
160
|
+
}) : B ? typeof l < "u" && Number(l || 0) <= 0 ? a({
|
161
|
+
text: "Enter Amount",
|
162
|
+
isGradient: !1,
|
163
|
+
color: "bw-bg-border-primary"
|
164
|
+
}) : u.isFetching || !f ? a({
|
165
|
+
text: "Loading Routes...",
|
166
|
+
isGradient: !1,
|
167
|
+
color: "bw-bg-border-primary"
|
168
|
+
}) : e.chainId === "eclipse-svm" && !A(p) ? a({
|
169
|
+
text: `Select ${e.name} wallet`,
|
170
|
+
isGradient: !0,
|
171
|
+
color: w || S.gradientbutton
|
172
|
+
}) : r.chainId === "eclipse-svm" && e.chainId !== "eclipse-svm" && !A(p) && d.length < 30 ? a({
|
173
|
+
text: "Enter recipient wallet address",
|
174
|
+
isGradient: !0,
|
175
|
+
color: w || S.gradientbutton
|
176
|
+
}) : (i == null ? void 0 : i.address) == (b == null ? void 0 : b.address) && (e == null ? void 0 : e.chainId) == (r == null ? void 0 : r.chainId) && !(d != null && d.length) || (e == null ? void 0 : e.networkType) == "evm" && Q === d && (i == null ? void 0 : i.address) == (b == null ? void 0 : b.address) || (e == null ? void 0 : e.networkType) == "sol" && (p == null ? void 0 : p.address) === d && (i == null ? void 0 : i.address) == (b == null ? void 0 : b.address) ? a({
|
177
|
+
text: "From and To asset can not be the same!",
|
178
|
+
isGradient: !1,
|
179
|
+
color: "bw-bg-border-primary"
|
180
|
+
}) : (y = (g = (s = u == null ? void 0 : u.data) == null ? void 0 : s.data) == null ? void 0 : g.quotes) != null && y.length ? u != null && u.error ? a({
|
181
|
+
text: "Failed to fetch Quotes",
|
182
|
+
isGradient: !1,
|
183
|
+
color: "bw-bg-border-primary"
|
184
|
+
}) : j && Number((e == null ? void 0 : e.chainId) || "0") !== (I == null ? void 0 : I.id) && (e == null ? void 0 : e.networkType) === "evm" || P && ((e == null ? void 0 : e.chainId) === "eclipse-svm" ? "201" : "101") !== O && (e == null ? void 0 : e.networkType) === "sol" ? a({
|
185
|
+
text: `Switch Chain to ${e.chain}`,
|
186
|
+
isGradient: !0,
|
187
|
+
color: w || S.gradientbutton
|
188
|
+
}) : je() : a({
|
189
|
+
text: "No Routes Found",
|
190
|
+
isGradient: !1,
|
191
|
+
color: "bw-bg-border-primary"
|
192
|
+
}) : a({
|
193
|
+
text: "",
|
194
|
+
isGradient: !0,
|
195
|
+
color: w || S.gradientbutton
|
196
|
+
});
|
197
|
+
}, [O, p, i, b, l, e, r, (re = T.data) == null ? void 0 : re.formatted, n, T.isFetching, T.isLoading, j, Y, B, u.isFetching, I == null ? void 0 : I.id, f, R, L, d, U, K]);
|
198
|
+
let Ae = [`switch chain to ${(ce = e.chain) == null ? void 0 : ce.toLowerCase()}`, `select ${(ne = e.chain) == null ? void 0 : ne.toLowerCase()} wallet`, "connect custom wallet", "enter recipient wallet address"];
|
199
|
+
function ve() {
|
200
|
+
var s, g, y, $;
|
201
|
+
return B ? u.isFetching ? !0 : o.text.length ? !Ae.includes((s = o.text) == null ? void 0 : s.toLowerCase()) : !(($ = (y = (g = u.data) == null ? void 0 : g.data) == null ? void 0 : y.quotes) != null && $.length) : !1;
|
202
|
+
}
|
203
|
+
return /* @__PURE__ */ G(
|
204
|
+
"button",
|
205
|
+
{
|
206
|
+
disabled: ve(),
|
207
|
+
style: o != null && o.isGradient && V && q ? {
|
208
|
+
...m == null ? void 0 : m.gradientStyle,
|
209
|
+
boxShadow: m && m.customTheme && ((de = (ie = m.customTheme) == null ? void 0 : ie.shadow) == null ? void 0 : de.boxShadow) || "1px 1px 7px rgba(0, 0, 0, 0.15)"
|
210
|
+
} : {
|
211
|
+
boxShadow: m && m.customTheme && ((le = (ae = m.customTheme) == null ? void 0 : ae.shadow) == null ? void 0 : le.boxShadow) || "1px 1px 7px rgba(0, 0, 0, 0.15)"
|
212
|
+
},
|
213
|
+
className: `bw-w-full bw-rounded-sm bw-h-[52px] ${o != null && o.isGradient ? "bw-p-[3px]" : "bw-p-[1px]"} bw-mt-3 bw-border-0 bw-relative bw-z-0 disabled:bw-opacity-70 ${V && q && o.color} ${o.text.length > 29 ? "bw-text-xl" : "bw-text-2xl"} ${o != null && o.isGradient ? "bw-font-bold bw-text-text-primary" : "bw-font-normal bw-text-text-secondary"}`,
|
214
|
+
onClick: () => {
|
215
|
+
B || (N(!0), ((e == null ? void 0 : e.networkType) !== "evm" && j || (e == null ? void 0 : e.networkType) !== "sol" && P && p !== null || (e == null ? void 0 : e.networkType) !== "tron" && H && J) && !M ? x("from") : j && (r == null ? void 0 : r.networkType) !== "evm" || P && (r == null ? void 0 : r.networkType) !== "sol" || (r == null ? void 0 : r.networkType) !== "tron" && H && J || M ? x("to") : x("from")), e.chainId === "eclipse-svm" && !A(p) ? (N(!0), x("from")) : r.chainId === "eclipse-svm" && e.chainId !== "eclipse-svm" && !A(p) && d.length < 30 ? (N(!0), x("to")) : $e();
|
216
|
+
},
|
217
|
+
children: /* @__PURE__ */ G("div", { className: "bw-rounded-sm bw-bg-background-container bw-flex bw-items-center bw-justify-center b-w-full bw-h-full", children: /* @__PURE__ */ G("p", { className: "bw-relative bw-z-20", children: V && q ? Ee ? /* @__PURE__ */ G("div", { className: "bw-w-[30px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[30px]", children: /* @__PURE__ */ G(pe, { size: 22, thickness: 5, color: "inherit" }) }) : B ? o.text.length ? o.text : "Start Transaction" : `Connect ${Ne} Wallet` : /* @__PURE__ */ G("div", { className: "bw-w-[30px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[30px]", children: /* @__PURE__ */ G(pe, { size: 22, thickness: 5, color: "inherit" }) }) }) })
|
218
|
+
}
|
219
|
+
);
|
220
|
+
}
|
221
|
+
export {
|
222
|
+
dt as default
|
223
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { i as D, e as G, r as q, a as A, x as c, C as U, A as M, O as tt, b as z, E as et, R as O, c as Ut, d as K, f as N, S as pe, g as Cn, W as fe, h as Ze, j as vi, T as ti, k as Xt, M as on, l as rn, m as Dt, n as yi, o as $n } from "./core-
|
2
|
-
import { n as u, c as B, o as W, r as E, U as ht, e as Rn, f as En, a as In } from "./index-
|
3
|
-
import { m as Wn } from "./index-
|
1
|
+
import { i as D, e as G, r as q, a as A, x as c, C as U, A as M, O as tt, b as z, E as et, R as O, c as Ut, d as K, f as N, S as pe, g as Cn, W as fe, h as Ze, j as vi, T as ti, k as Xt, M as on, l as rn, m as Dt, n as yi, o as $n } from "./core-DMrbUYAd.js";
|
2
|
+
import { n as u, c as B, o as W, r as E, U as ht, e as Rn, f as En, a as In } from "./index-DD4yqUTK.js";
|
3
|
+
import { m as Wn } from "./index-DQ-upUtl.js";
|
4
4
|
const Sn = D`
|
5
5
|
:host {
|
6
6
|
position: relative;
|