@blockend/widget 1.0.55-beta.1 → 1.0.55
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-D6S-NFxZ.js → AllRoutes-CInC9QGQ.js} +9 -9
- package/dist/{Box-DESo1bHm.js → Box-_vN-nB2g.js} +6 -6
- package/dist/EstGas-BaKv_yk7.js +20281 -0
- package/dist/{Grow-DzEr7XrA.js → Grow-CahJ50bG.js} +2 -2
- package/dist/{InputComp-GcnDqx_s.js → InputComp-BA0m0-BG.js} +3 -3
- package/dist/{LoadRoute-BmUgvDid.js → LoadRoute-myKaCOSm.js} +4 -4
- package/dist/{QuotesProgress-E5JnUMS0.js → QuotesProgress-p8uGXu3L.js} +1 -1
- package/dist/{SwapAsset-MBXcdeBf.js → SwapAsset-sqEVoQ3t.js} +1 -1
- package/dist/{Tooltip-DSAJT2x7.js → Tooltip-BrCb3x7_.js} +3 -3
- package/dist/TxnButton-D10GjiUs.js +223 -0
- package/dist/{add-BryKCrpI.js → add-VsfWD7ni.js} +1 -1
- package/dist/{all-wallets-BMVOK2Ci.js → all-wallets-BkUqFobk.js} +1 -1
- package/dist/{app-store-3WurbJdI.js → app-store-Dhz1I2UU.js} +1 -1
- package/dist/{apple-eM872Ubz.js → apple-B1A9FWmD.js} +1 -1
- package/dist/{arrow-bottom-HMc73fJ8.js → arrow-bottom-CU0SNN_M.js} +1 -1
- package/dist/{arrow-bottom-circle-B1N_R8Ux.js → arrow-bottom-circle-CkK0nZyv.js} +1 -1
- package/dist/{arrow-left-Q7GAZkD7.js → arrow-left-B3tHSyMd.js} +1 -1
- package/dist/{arrow-right-ft3TcIM3.js → arrow-right-C9GNeMpg.js} +1 -1
- package/dist/{arrow-top-C2xmF6tK.js → arrow-top-CROlaURs.js} +1 -1
- package/dist/{bank-Bk-2ZR5E.js → bank-C9ws6grO.js} +1 -1
- package/dist/{basic-CWrKgDAB.js → basic-CNZusk3T.js} +3 -3
- package/dist/{browser-BFB3TFfv.js → browser-CsDSjYxB.js} +1 -1
- package/dist/{card-DCx59si8.js → card-DEbxL9v9.js} +1 -1
- package/dist/{ccip-CXr08uP1.js → ccip-BzuzcsZy.js} +16 -16
- package/dist/{checkmark-BGsuJuhE.js → checkmark-DE5590E3.js} +1 -1
- package/dist/{checkmark-bold-DvjIl-51.js → checkmark-bold-QCiYoLBv.js} +1 -1
- package/dist/{chevron-bottom-DAEnG7QP.js → chevron-bottom-DwDL4YMH.js} +1 -1
- package/dist/{chevron-left-D33h2ppx.js → chevron-left-f-cfElLv.js} +1 -1
- package/dist/{chevron-right-C8Z_feNK.js → chevron-right-CUqumYdc.js} +1 -1
- package/dist/{chevron-top-DwDMd3p9.js → chevron-top-B51EfBCn.js} +1 -1
- package/dist/{chrome-store-B7ZDs2Fj.js → chrome-store-Bye9an43.js} +1 -1
- package/dist/{clock-DnELUxSR.js → clock-B7Sev0vn.js} +1 -1
- package/dist/{close-Dnt29Pss.js → close-0BVUAR_a.js} +1 -1
- package/dist/{coinPlaceholder-C09pzuXv.js → coinPlaceholder-BV86Cpoi.js} +1 -1
- package/dist/{compass-D8ZY16nH.js → compass-BG0JGmer.js} +1 -1
- package/dist/{copy-DEh4RBKI.js → copy-BK_ak0uV.js} +1 -1
- package/dist/{core-CgIQaiRa.js → core-CK5YGudk.js} +17 -16
- package/dist/{cursor-BtzkAOER.js → cursor-DYlGZYqP.js} +1 -1
- package/dist/{cursor-transparent-B0nCflmb.js → cursor-transparent-C66dlXx_.js} +1 -1
- package/dist/{desktop-toTG92uH.js → desktop-MPzP06em.js} +1 -1
- package/dist/{disconnect-C97lbAtY.js → disconnect-S1mgcbm2.js} +1 -1
- package/dist/{discord-BNJ3JePY.js → discord-C1lCIbjj.js} +1 -1
- package/dist/{down-BFx-Bg5Q.js → down-Bs8dpUrC.js} +2 -2
- package/dist/{etherscan-CK87TQMS.js → etherscan-QQa80RLT.js} +1 -1
- package/dist/{exclamation-triangle-LWnOk0uz.js → exclamation-triangle-4oHle7Ol.js} +1 -1
- package/dist/{extension-5eIZU28A.js → extension-B3zd6NTN.js} +1 -1
- package/dist/{external-link-DDlCfigP.js → external-link-DaiDaJke.js} +1 -1
- package/dist/{facebook-1lTMXKeH.js → facebook-BSHOu5Eh.js} +1 -1
- package/dist/{farcaster-Di2TUKlZ.js → farcaster-CNUiCN9L.js} +1 -1
- package/dist/{filters-B_THnHaX.js → filters-CDlQ6RDt.js} +1 -1
- package/dist/{getChainIds-CeLEUxe0.js → getChainIds-B0koox0j.js} +69 -69
- package/dist/getCosmosAddress-CCWtYVNX.js +9566 -0
- package/dist/{github-D5B1FE4K.js → github-B7OCLZiT.js} +1 -1
- package/dist/{google-C8_WSUfw.js → google-Cf3xXFpT.js} +1 -1
- package/dist/{hamburger-BzMrQx9y.js → hamburger-B0j3zDc0.js} +5 -5
- package/dist/{help-circle-C-ZOzjAP.js → help-circle-DP7zV3_w.js} +1 -1
- package/dist/{id-BynpKmej.js → id-BQRwktVK.js} +1 -1
- package/dist/{image-BRYUh760.js → image-DFBrbvvT.js} +1 -1
- package/dist/{index-BFUVWgoD.js → index-1Vs2kWG_.js} +78 -78
- package/dist/{index-DHYWnqST.js → index-BDzrNgTC.js} +1 -1
- package/dist/index-BmVN9MUZ.js +160 -0
- package/dist/{index-SkYFFVLL.js → index-CMAhUTez.js} +11 -11
- package/dist/{index-BK0BZT6j.js → index-CTGrN6JB.js} +2622 -2600
- package/dist/{index-A8ClQmZo.js → index-D1GIjZ4K.js} +1 -1
- package/dist/index-DRwDQTB-.js +29422 -0
- package/dist/index-DTish3yr.js +1014 -0
- package/dist/{index-DpHhW0_2.js → index-DpZHXmue.js} +2 -2
- package/dist/{index-Dnyeih-W.js → index-DrSY5n-x.js} +8 -11
- package/dist/{index-CN6pVc2G.js → index-FGz1V6AR.js} +241 -233
- package/dist/index-RtfOj4GQ.js +206 -0
- package/dist/{index.es-DB9y_DEM.js → index.es-BS6PwZoN.js} +1 -1
- package/dist/{index.es-vIyUKt0W.js → index.es-D0JK47eg.js} +26 -24
- package/dist/index.es.js +1 -1
- package/dist/{info-DSQyHS8b.js → info-C1ZJCPTD.js} +1 -1
- package/dist/{info-circle-BfpWcI4c.js → info-circle-Dhmi_tCI.js} +1 -1
- package/dist/{lightbulb-DEMYYsZd.js → lightbulb-0j0AYNED.js} +1 -1
- package/dist/{mail-DNZ2to_6.js → mail-BtTEWpBH.js} +1 -1
- package/dist/{mobile-qsyS8oMK.js → mobile-DvxVPngz.js} +1 -1
- package/dist/{more-CnBuKwll.js → more-B7Wl87te.js} +1 -1
- package/dist/{network-placeholder-DhJITakA.js → network-placeholder-9GbY6RXW.js} +1 -1
- package/dist/{nftPlaceholder-DD3-Cc9U.js → nftPlaceholder-omPs3Tyh.js} +1 -1
- package/dist/{off-CBApAdDk.js → off-DzwEOAXj.js} +1 -1
- package/dist/{play-store-DDoeRc-b.js → play-store-fB4OGgDD.js} +1 -1
- package/dist/{plus-C3J-XWCn.js → plus-QdziAxSu.js} +1 -1
- package/dist/{qr-code-CEoOYtHk.js → qr-code-C2U72CiI.js} +1 -1
- package/dist/{recycle-horizontal-BHJ_s9Yx.js → recycle-horizontal-Bl8nBo5T.js} +1 -1
- package/dist/{refresh-CtzOoHls.js → refresh-CHVcAm40.js} +1 -1
- package/dist/{reown-logo-BOj4YDUQ.js → reown-logo-C5CEAzfh.js} +1 -1
- package/dist/{search--Miza3A_.js → search-CRYtwGKs.js} +1 -1
- package/dist/{send-Bhl1lz4j.js → send-DgcEtdkH.js} +1 -1
- package/dist/{swapHorizontal-CCvKCngz.js → swapHorizontal-bGAC2ORL.js} +1 -1
- package/dist/{swapHorizontalBold-B90V-dXL.js → swapHorizontalBold-7AVtDAdB.js} +1 -1
- package/dist/{swapHorizontalMedium-CYjeHjnI.js → swapHorizontalMedium-BPEj2jrH.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-DSMWeXdW.js → swapHorizontalRoundedBold-KZW7Q7m8.js} +1 -1
- package/dist/{swapVertical-DOJUNIvk.js → swapVertical-R6wYRmxl.js} +1 -1
- package/dist/{telegram-CufEY_4d.js → telegram-BU7tcQ98.js} +1 -1
- package/dist/{three-dots-J2ngva7G.js → three-dots-DcRrr590.js} +1 -1
- package/dist/{twitch-B4vTKVf5.js → twitch-CiWBdFQ5.js} +1 -1
- package/dist/{twitterIcon-DLrxpAGg.js → twitterIcon-Dx4rfeax.js} +1 -1
- package/dist/{unsupportedProp-BLzY2-w_.js → unsupportedProp-I75ZFHZ3.js} +1 -1
- package/dist/{useRegisterError-Cf6oylnR.js → useRegisterError-BGuw8xn6.js} +1 -1
- package/dist/{verify-CbHqPQKs.js → verify-OIjFr-Yf.js} +1 -1
- package/dist/{verify-filled-CzKx9Cph.js → verify-filled-CuIbxxfK.js} +1 -1
- package/dist/{w3m-modal-DhpjK4cG.js → w3m-modal-C1jV1wrT.js} +2 -2
- package/dist/{wallet-CvIeO6On.js → wallet-Bk-xbtkS.js} +1 -1
- package/dist/{wallet-placeholder-BqELXTBj.js → wallet-placeholder-D74DpYqS.js} +1 -1
- package/dist/{walletconnect-BN4c4XQ5.js → walletconnect-BklYaQAX.js} +1 -1
- package/dist/{warning-circle--dqxXujk.js → warning-circle-DlDxhMDL.js} +1 -1
- package/dist/{x-CkCp5gtL.js → x-BNL67S5v.js} +1 -1
- package/package.json +2 -4
- package/dist/EstGas-Dy3XfCzY.js +0 -1496
- package/dist/TxnButton-Br8R19rF.js +0 -215
- package/dist/getCosmosAddress-B8s9Ycj4.js +0 -6075
- package/dist/index-C5bv1F_u.js +0 -48843
- package/dist/index-CZwuzz6v.js +0 -6712
- package/dist/index-krrwn6Pi.js +0 -206
@@ -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, aE as St, n as Bt, g as Wt, b as Lt, _ as Te, d as z, h as Nt, i as Ht, s as Vt } from "./index-DRwDQTB-.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-BGuw8xn6.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-DRwDQTB-.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-BGuw8xn6.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-FGz1V6AR.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;
|
@@ -1,13 +1,13 @@
|
|
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-DRwDQTB-.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-Bs8dpUrC.js";
|
8
8
|
import { e as se } from "./ethertousd-CC_ezooz.js";
|
9
|
-
import { O as H } from "./index-
|
10
|
-
import { F as J, i as ae } from "./useRegisterError-
|
9
|
+
import { O as H } from "./index-D1GIjZ4K.js";
|
10
|
+
import { F as J, i as ae } from "./useRegisterError-BGuw8xn6.js";
|
11
11
|
function oe({ fill: n }) {
|
12
12
|
return /* @__PURE__ */ e(
|
13
13
|
"svg",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsxs as o, jsx as a, Fragment as m } from "react/jsx-runtime";
|
2
2
|
import { s as l } from "./WidgetForm.module-QHJ0-m5f.js";
|
3
|
-
import { u as g } from "./index-
|
3
|
+
import { u as g } from "./index-DRwDQTB-.js";
|
4
4
|
function y({ routesData: x, routes: e, quoteTimer: n, amount: c }) {
|
5
5
|
var s, b, d, w;
|
6
6
|
const r = g((i) => i.configuration), t = g((i) => i.gradient);
|
@@ -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-DRwDQTB-.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-CahJ50bG.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, D as A, E as _o, w as No } from "./useRegisterError-
|
5
|
+
import { j as xo, q as I, l as Ue, s as Oo, b as Eo, n as Mo, D as A, E as _o, w as No } from "./useRegisterError-BGuw8xn6.js";
|
6
6
|
function Lo(r) {
|
7
7
|
return To("MuiTooltip", r);
|
8
8
|
}
|
@@ -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 xe, useSwitchNetwork as Me, useIsLoggedIn as Oe } from "@dynamic-labs/sdk-react-core";
|
4
|
+
import { a as _, u as h, aA as Re, aB as pe } from "./index-DRwDQTB-.js";
|
5
|
+
import { s as S } from "./WidgetForm.module-QHJ0-m5f.js";
|
6
|
+
import { useAccount as Ve, useConfig as qe, useSwitchChain as Pe, useBalance as _e } from "wagmi";
|
7
|
+
import { u as ge, d as Qe, c as He, C as ye } from "./useRegisterError-BGuw8xn6.js";
|
8
|
+
import "./getCosmosAddress-CCWtYVNX.js";
|
9
|
+
import { v as Je } from "./validError-CDlJpg_f.js";
|
10
|
+
import { u as Ke, g as Ue, p as Xe } from "./index-FGz1V6AR.js";
|
11
|
+
function Ye(n) {
|
12
|
+
const { wallet: u, address: l } = _(), [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 Ze() {
|
26
|
+
const [n, u] = v(0), l = h((x) => x.fromChain), { primaryWallet: f } = xe();
|
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 ot({ routesData: n, routes: u, amount: l, isAmountTyped: f, handleShowWallet: N, setConnectWalletField: x, handleConfirmClose: F, balanceSol: L, getCoinBalance: Te, handleSuccess: Q }) {
|
36
|
+
var C, ee, te, se, re, ce, ne, ie, de, ae, le, oe, we;
|
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: H, chain: I } = Ve(), { address: J, isConnected: We } = _(), me = qe(), Ie = Me(), { getBothWalletConnection: he, getConnectWallet: fe } = ge({
|
38
|
+
chainData: e
|
39
|
+
}), { connected: K, address: U, disconnect: De } = _(), M = h((s) => s.toDisconnect), d = h((s) => s.customWallet), { getWallet: Ne } = ge({ chainData: e }), Be = fe(e, r), [O, Ge] = v("101"), { tronBal: R } = Ye(e), { cosmosBalance: X } = Ke(), Y = Ze(), V = ((C = e.chain) == null ? void 0 : C.length) && ((ee = r.chain) == null ? void 0 : ee.length), q = ((te = i.address) == null ? void 0 : te.length) && ((se = b.address) == null ? void 0 : se.length), Se = Qe(), Z = Re(), { switchChain: ke, switchChainAsync: $e, isPending: Ee } = Pe({
|
40
|
+
chainId: Number((e == null ? void 0 : e.chainId) || "0"),
|
41
|
+
config: me,
|
42
|
+
throwForSwitchChainNotSupported: !0,
|
43
|
+
onError(s) {
|
44
|
+
Je(s.message) && Se({ module: "wallet-error-switch", error: s.message });
|
45
|
+
}
|
46
|
+
}), T = _e({
|
47
|
+
address: H,
|
48
|
+
token: "",
|
49
|
+
chainId: Number((e == null ? void 0 : e.chainId) || 0),
|
50
|
+
enabled: (e == null ? void 0 : e.networkType) == "evm"
|
51
|
+
}), W = He(Te || 0, 11), [o, a] = v({
|
52
|
+
text: "",
|
53
|
+
isGradient: !1,
|
54
|
+
color: "bw-bg-border-primary"
|
55
|
+
});
|
56
|
+
async function Fe() {
|
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 $e({ 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 Ie({ wallet: p, network: e.chainId == "eclipse-svm" ? "201" : "101" });
|
65
|
+
D();
|
66
|
+
} catch {
|
67
|
+
}
|
68
|
+
else (e == null ? void 0 : e.networkType) === "sui" ? (Z.emit(pe.TransactionStarted, {
|
69
|
+
...n
|
70
|
+
}), B && (Q(!1), F())) : (Z.emit(pe.TransactionStarted, {
|
71
|
+
...n
|
72
|
+
}), B && (Q(!1), F()));
|
73
|
+
}
|
74
|
+
const { primaryWallet: p } = xe(), P = Oe(), B = (e == null ? void 0 : e.networkType) === r.networkType ? !!((ce = (re = Ne(e)) == null ? void 0 : re.address) != null && ce.length) : he(e == null ? void 0 : e.networkType, (d == null ? void 0 : d.length) > 30 ? "customWallet" : r == null ? void 0 : r.networkType), D = async () => {
|
75
|
+
if (p)
|
76
|
+
try {
|
77
|
+
const s = await p.getNetwork();
|
78
|
+
Ge(s);
|
79
|
+
} catch {
|
80
|
+
}
|
81
|
+
else
|
82
|
+
return;
|
83
|
+
};
|
84
|
+
z(() => {
|
85
|
+
D();
|
86
|
+
}, [p]);
|
87
|
+
function k(s, g) {
|
88
|
+
let y = s / Math.pow(10, g);
|
89
|
+
return y < 1e-6 ? y.toFixed(20) : y;
|
90
|
+
}
|
91
|
+
function Le() {
|
92
|
+
var s;
|
93
|
+
return Number(((s = T == null ? void 0 : T.data) == null ? void 0 : s.formatted) || 0);
|
94
|
+
}
|
95
|
+
function je(s) {
|
96
|
+
var g;
|
97
|
+
return Number(((g = X[Xe(s.address)]) == null ? void 0 : g.amount) || 0) / Math.pow(10, s.decimals);
|
98
|
+
}
|
99
|
+
function Ae() {
|
100
|
+
var E;
|
101
|
+
let s = {};
|
102
|
+
async function g(t, c) {
|
103
|
+
let $ = 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 += k(c.amountInToken, t == null ? void 0 : t.decimals)) : s[t == null ? void 0 : t.chainId] = {
|
105
|
+
amountInToken: c.amountInToken,
|
106
|
+
gas: k(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" ? Y : (t == null ? void 0 : t.networkType) == "cosmos" ? je(t) : (t == null ? void 0 : t.networkType) == "tron" ? Ue(J) : Le(),
|
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 : $.length > 2 ? 3 : 2
|
111
|
+
};
|
112
|
+
}
|
113
|
+
(E = n == null ? void 0 : n.fee) == null || E.forEach((t) => {
|
114
|
+
const { token: c } = t;
|
115
|
+
t.source.toLowerCase() == "from_source_wallet" && g(c, t);
|
116
|
+
});
|
117
|
+
let y = W;
|
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, $) => c.order - $.order);
|
132
|
+
t.some((c) => {
|
133
|
+
var $, be, ue;
|
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 ${(($ = c == null ? void 0 : c.token) == null ? void 0 : $.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 && ((be = c == null ? void 0 : c.token) == null ? void 0 : be.chainId) == (r == null ? void 0 : r.chainId)) ? (a({
|
139
|
+
text: `Insufficient ${((ue = c == null ? void 0 : c.token) == null ? void 0 : ue.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" && H === 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
|
+
}) : Ae() : 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, (ne = T.data) == null ? void 0 : ne.formatted, n, T.isFetching, T.isLoading, j, W, B, u.isFetching, I == null ? void 0 : I.id, f, R, L, d, Y, X, J]);
|
198
|
+
let ve = [`switch chain to ${(ie = e.chain) == null ? void 0 : ie.toLowerCase()}`, `select ${(de = e.chain) == null ? void 0 : de.toLowerCase()} wallet`, "connect custom wallet", "enter recipient wallet address"];
|
199
|
+
function ze() {
|
200
|
+
var s, g, y, E;
|
201
|
+
return B ? u.isFetching ? !0 : o.text.length ? !ve.includes((s = o.text) == null ? void 0 : s.toLowerCase()) : !((E = (y = (g = u.data) == null ? void 0 : g.data) == null ? void 0 : y.quotes) != null && E.length) : !1;
|
202
|
+
}
|
203
|
+
return /* @__PURE__ */ G(
|
204
|
+
"button",
|
205
|
+
{
|
206
|
+
disabled: ze(),
|
207
|
+
style: o != null && o.isGradient && V && q ? {
|
208
|
+
...m == null ? void 0 : m.gradientStyle,
|
209
|
+
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)"
|
210
|
+
} : {
|
211
|
+
boxShadow: m && m.customTheme && ((we = (oe = m.customTheme) == null ? void 0 : oe.shadow) == null ? void 0 : we.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" && K && U) && !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" && K && U || 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")) : Fe();
|
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(ye, { size: 22, thickness: 5, color: "inherit" }) }) : B ? o.text.length ? o.text : "Start Transaction" : `Connect ${Be} 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(ye, { size: 22, thickness: 5, color: "inherit" }) }) }) })
|
218
|
+
}
|
219
|
+
);
|
220
|
+
}
|
221
|
+
export {
|
222
|
+
ot 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 {
|
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-CK5YGudk.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-1Vs2kWG_.js";
|
3
|
+
import { n as Wn } from "./index-DRwDQTB-.js";
|
4
4
|
const Sn = D`
|
5
5
|
:host {
|
6
6
|
position: relative;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ad as L, ae as b, af as F, ag as N, ah as P, ai as w, aj as S, ak as E, al as $, am as C, an as I, ao as m, ap as G, aq as R, ar as k, as as y, at as O, au as q, av as T, aw as v, ax as D, ay as A, az as H } from "./index-DRwDQTB-.js";
|
2
2
|
const h = "/docs/contract/encodeErrorResult";
|
3
3
|
function x(t) {
|
4
4
|
const { abi: s, errorName: a, args: r } = t;
|
@@ -21,7 +21,7 @@ function x(t) {
|
|
21
21
|
return S([n, o]);
|
22
22
|
}
|
23
23
|
const p = "/docs/contract/encodeFunctionResult";
|
24
|
-
function
|
24
|
+
function j(t) {
|
25
25
|
const { abi: s, functionName: a, result: r } = t;
|
26
26
|
let e = s[0];
|
27
27
|
if (a) {
|
@@ -46,15 +46,15 @@ function B(t) {
|
|
46
46
|
return w(e.outputs, c);
|
47
47
|
}
|
48
48
|
const U = "x-batch-gateway:true";
|
49
|
-
async function
|
50
|
-
const { data: s, ccipRequest: a } = t, { args: [r] } =
|
49
|
+
async function B(t) {
|
50
|
+
const { data: s, ccipRequest: a } = t, { args: [r] } = I({ abi: m, data: s }), e = [], c = [];
|
51
51
|
return await Promise.all(r.map(async (n, o) => {
|
52
52
|
try {
|
53
53
|
c[o] = await a(n), e[o] = !1;
|
54
54
|
} catch (u) {
|
55
55
|
e[o] = !0, c[o] = _(u);
|
56
56
|
}
|
57
|
-
})),
|
57
|
+
})), j({
|
58
58
|
abi: m,
|
59
59
|
functionName: "query",
|
60
60
|
result: [e, c]
|
@@ -66,16 +66,16 @@ function _(t) {
|
|
66
66
|
errorName: "HttpError",
|
67
67
|
args: [t.status, t.shortMessage]
|
68
68
|
}) : x({
|
69
|
-
abi: [
|
69
|
+
abi: [G],
|
70
70
|
errorName: "Error",
|
71
71
|
args: ["shortMessage" in t ? t.shortMessage : t.message]
|
72
72
|
});
|
73
73
|
}
|
74
74
|
function z(t, s) {
|
75
|
-
if (!
|
76
|
-
throw new
|
77
|
-
if (!
|
78
|
-
throw new
|
75
|
+
if (!R(t, { strict: !1 }))
|
76
|
+
throw new k({ address: t });
|
77
|
+
if (!R(s, { strict: !1 }))
|
78
|
+
throw new k({ address: s });
|
79
79
|
return t.toLowerCase() === s.toLowerCase();
|
80
80
|
}
|
81
81
|
class J extends y {
|
@@ -149,20 +149,20 @@ const Y = "0x556f1830", Q = {
|
|
149
149
|
]
|
150
150
|
};
|
151
151
|
async function Z(t, { blockNumber: s, blockTag: a, data: r, to: e }) {
|
152
|
-
const { args: c } =
|
152
|
+
const { args: c } = T({
|
153
153
|
data: r,
|
154
154
|
abi: [Q]
|
155
155
|
}), [n, o, u, f, d] = c, { ccipRead: i } = t, g = i && typeof (i == null ? void 0 : i.request) == "function" ? i.request : V;
|
156
156
|
try {
|
157
157
|
if (!z(e, n))
|
158
158
|
throw new K({ sender: n, to: e });
|
159
|
-
const l = o.includes(U) ? await
|
159
|
+
const l = o.includes(U) ? await B({
|
160
160
|
data: u,
|
161
161
|
ccipRequest: g
|
162
|
-
}) : await g({ data: u, sender: n, urls: o }), { data: M } = await
|
162
|
+
}) : await g({ data: u, sender: n, urls: o }), { data: M } = await v(t, {
|
163
163
|
blockNumber: s,
|
164
164
|
blockTag: a,
|
165
|
-
data:
|
165
|
+
data: D([
|
166
166
|
f,
|
167
167
|
w([{ type: "bytes" }, { type: "bytes" }], [l, d])
|
168
168
|
]),
|
@@ -193,7 +193,7 @@ async function V({ data: t, sender: s, urls: a }) {
|
|
193
193
|
});
|
194
194
|
let i;
|
195
195
|
if ((e = d.headers.get("Content-Type")) != null && e.startsWith("application/json") ? i = (await d.json()).data : i = await d.text(), !d.ok) {
|
196
|
-
r = new
|
196
|
+
r = new A({
|
197
197
|
body: u,
|
198
198
|
details: i != null && i.error ? q(i.error) : d.statusText,
|
199
199
|
headers: d.headers,
|
@@ -211,7 +211,7 @@ async function V({ data: t, sender: s, urls: a }) {
|
|
211
211
|
}
|
212
212
|
return i;
|
213
213
|
} catch (d) {
|
214
|
-
r = new
|
214
|
+
r = new A({
|
215
215
|
body: u,
|
216
216
|
details: d.message,
|
217
217
|
url: n
|