@blockend/widget 1.0.49-beta.3 → 1.0.49-beta.5
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-CMV2Aikv.js → AllRoutes-LD5p98zn.js} +9 -9
- package/dist/{Box-BLU3JkBD.js → Box-Cs3JEIFG.js} +6 -6
- package/dist/EstGas-H-UdwS1f.js +12659 -0
- package/dist/{Grow-BNGsloYF.js → Grow-BvHTdetx.js} +2 -2
- package/dist/{InputComp-My-aSA0q.js → InputComp-COwG8q-J.js} +3 -3
- package/dist/{LoadRoute-DEc0qJGB.js → LoadRoute-DsdVO6Oo.js} +4 -4
- package/dist/{QuotesProgress-DyCbRkmW.js → QuotesProgress-B8bDI4r6.js} +1 -1
- package/dist/{SwapAsset-VBFtcbjw.js → SwapAsset-Ddh66LWB.js} +1 -1
- package/dist/{Tooltip-DkFdda4P.js → Tooltip-hBxzXSU3.js} +3 -3
- package/dist/TxnButton-jGgemD8y.js +205 -0
- package/dist/{add-CIcwZ7BM.js → add-DGq3NqFo.js} +1 -1
- package/dist/{all-wallets-Bh1_cRVE.js → all-wallets-CzWn7-6X.js} +1 -1
- package/dist/{app-store-1QxQqMCa.js → app-store-BGFzY2oe.js} +1 -1
- package/dist/{apple-CtdqvHaM.js → apple-D5zFxCbx.js} +1 -1
- package/dist/{arrow-bottom-D-GL64pV.js → arrow-bottom-D25Ef730.js} +1 -1
- package/dist/{arrow-bottom-circle-BZZ6oS3I.js → arrow-bottom-circle-CskusJTk.js} +1 -1
- package/dist/{arrow-left-CtM73IFh.js → arrow-left-Bn-AuY99.js} +1 -1
- package/dist/{arrow-right-C_3it8wU.js → arrow-right-DJQCv_ak.js} +1 -1
- package/dist/{arrow-top-B_akssLE.js → arrow-top-Do8qEhLT.js} +1 -1
- package/dist/{bank-BAZaWTHP.js → bank-CBeLsi0M.js} +1 -1
- package/dist/{basic-BQ6VlY2V.js → basic-DLf5LiFg.js} +3 -3
- package/dist/{browser-D-m8U4qp.js → browser-DVamy-m2.js} +1 -1
- package/dist/{card-CZMLg_hs.js → card-tFF7X_nt.js} +1 -1
- package/dist/{ccip-Cr2zG-xI.js → ccip-C4idlAuS.js} +16 -16
- package/dist/{checkmark-Db5ONmjX.js → checkmark-DkVW1LY2.js} +1 -1
- package/dist/{checkmark-bold-CNdIOniu.js → checkmark-bold-BbQos6bO.js} +1 -1
- package/dist/{chevron-bottom-B4LZ07P4.js → chevron-bottom-DokKka1d.js} +1 -1
- package/dist/{chevron-left-BOiLmc3e.js → chevron-left-BPwuTnF_.js} +1 -1
- package/dist/{chevron-right-C8aUeQEC.js → chevron-right-Djdm9Vly.js} +1 -1
- package/dist/{chevron-top-DQnpWjJP.js → chevron-top-DviiO5xj.js} +1 -1
- package/dist/{chrome-store-B2Ctt_Iw.js → chrome-store-BFukaYHs.js} +1 -1
- package/dist/{clock-4Nkh4x1b.js → clock-gPhvJPEh.js} +1 -1
- package/dist/{close-CiK1EUke.js → close-CWK6JCCg.js} +1 -1
- package/dist/{coinPlaceholder-CcnyeBg0.js → coinPlaceholder-DuZ2QujM.js} +1 -1
- package/dist/{compass-C8XMPb-_.js → compass-DlrcJ8Hk.js} +1 -1
- package/dist/{copy-D-ZlELIO.js → copy-CNAncK5I.js} +1 -1
- package/dist/{core-CE7ZvgmO.js → core-BkrnmkI7.js} +17 -16
- package/dist/{cursor-RiCqhq_2.js → cursor-BknQSZIa.js} +1 -1
- package/dist/{cursor-transparent-Cpuw-bx1.js → cursor-transparent-D7K-weum.js} +1 -1
- package/dist/{desktop-BcnqlO6_.js → desktop-Dvki1QtU.js} +1 -1
- package/dist/{disconnect-BXI_7OV3.js → disconnect-QbJ6g-Q9.js} +1 -1
- package/dist/{discord-DZgQjBjt.js → discord-BtkOmfcK.js} +1 -1
- package/dist/{down-C8I1GmTa.js → down-DRC2u-nt.js} +2 -2
- package/dist/{etherscan-DHArh1Kg.js → etherscan-C4RKkVrP.js} +1 -1
- package/dist/{exclamation-triangle-Dp1k7Xyg.js → exclamation-triangle-CEoAdk7x.js} +1 -1
- package/dist/{extension-Dav7fjmZ.js → extension-DkOomXUg.js} +1 -1
- package/dist/{external-link-DWQsWqey.js → external-link-D9HfOXel.js} +1 -1
- package/dist/{facebook-xI7TIm3V.js → facebook-zQmBHowA.js} +1 -1
- package/dist/{farcaster-ByqbNlsO.js → farcaster-Cfy-sjqY.js} +1 -1
- package/dist/{filters-CPWYBjRc.js → filters-Cq1K6QWb.js} +1 -1
- package/dist/{getChainIds-DY_neilc.js → getChainIds-Btq6EjyX.js} +2 -2
- package/dist/getCosmosAddress-Bu-V7Ot0.js +9565 -0
- package/dist/{github-prZ8t34_.js → github-gNR-tm3O.js} +1 -1
- package/dist/{google-CcUsHax7.js → google-rmnuGsrL.js} +1 -1
- package/dist/{hamburger-BJOW28p-.js → hamburger-CEQO6OZs.js} +5 -5
- package/dist/{help-circle-XwyOApi8.js → help-circle-Cj4bjfia.js} +1 -1
- package/dist/{id-Ftjt1pHJ.js → id-nb5m-NKY.js} +1 -1
- package/dist/{image-D3UyCNRs.js → image-BlK2k80L.js} +1 -1
- package/dist/{index-V7wGfBWj.js → index-1OzJ9Z6-.js} +2192 -2170
- package/dist/{index-Cea3JIZ5.js → index-7R8NiD42.js} +1 -1
- package/dist/index-7iRnvPpN.js +159 -0
- package/dist/{index-DmHzoK8Z.js → index-CZQdiy7b.js} +2 -2
- package/dist/{index-B518UW03.js → index-CbycATvf.js} +78 -78
- package/dist/{index-vg6UIFZD.js → index-D0tb6mUR.js} +11 -11
- package/dist/index-D5aVEHZL.js +206 -0
- package/dist/index-DTish3yr.js +1014 -0
- package/dist/index-Fv4UV6Sc.js +30707 -0
- package/dist/{index-BHDpDBXv.js → index-pieshoDv.js} +542 -507
- package/dist/{index-ME6WmREi.js → index-salSLcoU.js} +1 -1
- package/dist/{index-BykNQI23.js → index-vM1noC-w.js} +1320 -1194
- package/dist/{index.es-ng6OTpYR.js → index.es-CJ-ZznBF.js} +1712 -1625
- package/dist/{index.es-TqUYQAoH.js → index.es-Ce_QYzsk.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-DBsGMB_O.js → info-6RBhKgcd.js} +1 -1
- package/dist/{info-circle-Bx2PIRGJ.js → info-circle-BlIbWe25.js} +1 -1
- package/dist/{lightbulb-KoBLmJby.js → lightbulb-CS3_wKY8.js} +1 -1
- package/dist/{mail-CZKrqpFU.js → mail-CRsD8jAA.js} +1 -1
- package/dist/{mobile-CN4pmWVU.js → mobile-DMLTKouh.js} +1 -1
- package/dist/{more-1brm4Q7X.js → more-uoTJ3kvy.js} +1 -1
- package/dist/{network-placeholder-CAlA46Kt.js → network-placeholder-D-XL3hqx.js} +1 -1
- package/dist/{nftPlaceholder-DHzDfy6E.js → nftPlaceholder-CiYWPSAY.js} +1 -1
- package/dist/{off-1usMfWM7.js → off-B79emGaW.js} +1 -1
- package/dist/{play-store-C_t-IwRL.js → play-store-B828L964.js} +1 -1
- package/dist/{plus-B5w-_zg6.js → plus-BRVCC9lV.js} +1 -1
- package/dist/{qr-code-DQh--5Nd.js → qr-code-qp9DeEO9.js} +1 -1
- package/dist/{recycle-horizontal-CBNgoZdm.js → recycle-horizontal-DoDvFScD.js} +1 -1
- package/dist/{refresh-gjkJ3fAS.js → refresh-BuegBzBd.js} +1 -1
- package/dist/{reown-logo-BmVLHjjQ.js → reown-logo-BrUAyTxC.js} +1 -1
- package/dist/{search-CuK6y19Q.js → search-CzpyG7ky.js} +1 -1
- package/dist/{send-CIaAYk7c.js → send-BHMxC1xj.js} +1 -1
- package/dist/{swapHorizontal-Dl8NLG_i.js → swapHorizontal-Bq8mR1QZ.js} +1 -1
- package/dist/{swapHorizontalBold-BnPyIFiA.js → swapHorizontalBold-2ueiC4L9.js} +1 -1
- package/dist/{swapHorizontalMedium-CEivQ8L0.js → swapHorizontalMedium-9jh3zunE.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-C9ACKZnM.js → swapHorizontalRoundedBold-BIk7kp2S.js} +1 -1
- package/dist/{swapVertical-ZEEyof9e.js → swapVertical-DM_T3EzD.js} +1 -1
- package/dist/{telegram-B3c-a3zh.js → telegram-CbeDajqU.js} +1 -1
- package/dist/{three-dots-DUit7LCw.js → three-dots-DUntIedp.js} +1 -1
- package/dist/{twitch-3MyiQW6J.js → twitch-DIXNVK7h.js} +1 -1
- package/dist/{twitterIcon-DrkQHEH8.js → twitterIcon-nHRKKmzg.js} +1 -1
- package/dist/{unsupportedProp-BXXskXK0.js → unsupportedProp-BAk0ueJt.js} +1 -1
- package/dist/{useRegisterError-D172QfL7.js → useRegisterError-tq4Tke9I.js} +150 -150
- package/dist/{verify-Ez0YdpbL.js → verify-CbyVHS7l.js} +1 -1
- package/dist/{verify-filled-Cof7FJLP.js → verify-filled-QZDBE0oP.js} +1 -1
- package/dist/{w3m-modal-D9qNteo9.js → w3m-modal-Bp3nI0EC.js} +2 -2
- package/dist/{wallet-D8n_ZZlC.js → wallet-DVjsV39Q.js} +1 -1
- package/dist/{wallet-placeholder-C7X2GW9S.js → wallet-placeholder-BgrGGLNk.js} +1 -1
- package/dist/{walletconnect-CKYpGIEb.js → walletconnect-zriuFVFg.js} +1 -1
- package/dist/{warning-circle-BcBltCn2.js → warning-circle-CpWwL8_f.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-BppUkwM-.js → x-DN0-dY3F.js} +1 -1
- package/package.json +4 -7
- package/dist/EstGas-ywgk-29s.js +0 -1486
- package/dist/TxnButton-DtS9Dw0R.js +0 -211
- package/dist/getCosmosAddress-_BeZxDkv.js +0 -6075
- package/dist/index-BaPgYkZ_.js +0 -42277
- package/dist/index-BtI5pdx-.js +0 -6711
- package/dist/index-klVp-SBb.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-Fv4UV6Sc.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-tq4Tke9I.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-Fv4UV6Sc.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-tq4Tke9I.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-pieshoDv.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-Fv4UV6Sc.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-DRC2u-nt.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-7R8NiD42.js";
|
10
|
+
import { F as J, i as ae } from "./useRegisterError-tq4Tke9I.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-Fv4UV6Sc.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-Fv4UV6Sc.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-BvHTdetx.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-tq4Tke9I.js";
|
6
6
|
function Lo(r) {
|
7
7
|
return To("MuiTooltip", r);
|
8
8
|
}
|
@@ -0,0 +1,205 @@
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
2
|
+
import { useState as V, useEffect as P } from "react";
|
3
|
+
import { useSwitchNetwork as Le, useDynamicContext as je, useIsLoggedIn as Ae } from "@dynamic-labs/sdk-react-core";
|
4
|
+
import { a as _, u as h, aA as ve, aB as ze } from "./index-Fv4UV6Sc.js";
|
5
|
+
import { s as f } from "./WidgetForm.module-QHJ0-m5f.js";
|
6
|
+
import { useAccount as Me, useConfig as Oe, useSwitchChain as Re, useBalance as Ve } from "wagmi";
|
7
|
+
import { u as we, d as Pe, c as _e, C as be } from "./useRegisterError-tq4Tke9I.js";
|
8
|
+
import "./getCosmosAddress-Bu-V7Ot0.js";
|
9
|
+
import { v as qe } from "./validError-CDlJpg_f.js";
|
10
|
+
import { u as Qe, g as He, p as Je } from "./index-pieshoDv.js";
|
11
|
+
function Ke(n) {
|
12
|
+
const { wallet: x, address: p } = _(), [$, G] = V(0);
|
13
|
+
async function m() {
|
14
|
+
const j = await window.tronWeb.trx.getBalance(p);
|
15
|
+
G(j / Math.pow(10, 6));
|
16
|
+
}
|
17
|
+
return P(() => {
|
18
|
+
p && (n == null ? void 0 : n.networkType) === "tron" && m();
|
19
|
+
}, [p, n == null ? void 0 : n.networkType]), { tronBal: $ };
|
20
|
+
}
|
21
|
+
function L(n) {
|
22
|
+
if (n.key.toLowerCase() === "backpacksol")
|
23
|
+
return !0;
|
24
|
+
}
|
25
|
+
function is({ routesData: n, routes: x, amount: p, isAmountTyped: $, handleShowWallet: G, setConnectWalletField: m, handleConfirmClose: j, balanceSol: E, getCoinBalance: pe, handleSuccess: ue }) {
|
26
|
+
var Z, W, k, D, C, ee, se, te, re, ce, ne, ie, de;
|
27
|
+
const l = h((t) => t.gradient), I = h((t) => t.configuration), e = h((t) => t.fromChain), i = h((t) => t.fromCoin), r = h((t) => t.toChain), o = h((t) => t.toCoin), { isConnected: F, address: q, chain: T } = Me(), { address: Q, isConnected: Ue } = _(), ge = Oe(), ye = Le(), { getBothWalletConnection: xe, getConnectWallet: Ie } = we({
|
28
|
+
chainData: e
|
29
|
+
}), { connected: H, address: J, disconnect: Xe } = _(), A = h((t) => t.toDisconnect), d = h((t) => t.customWallet), { getWallet: Te } = we({ chainData: e }), he = Ie(e, r), [v, me] = V("101"), { tronBal: z } = Ke(e), { cosmosBalance: K } = Qe(), M = ((Z = e.chain) == null ? void 0 : Z.length) && ((W = r.chain) == null ? void 0 : W.length), O = ((k = i.address) == null ? void 0 : k.length) && ((D = o.address) == null ? void 0 : D.length), Ne = Pe(), fe = ve(), { switchChain: Ye, switchChainAsync: Be, isPending: Ge } = Re({
|
30
|
+
chainId: Number((e == null ? void 0 : e.chainId) || "0"),
|
31
|
+
config: ge,
|
32
|
+
throwForSwitchChainNotSupported: !0,
|
33
|
+
onError(t) {
|
34
|
+
qe(t.message) && Ne({ module: "wallet-error-switch", error: t.message });
|
35
|
+
}
|
36
|
+
}), u = Ve({
|
37
|
+
address: q,
|
38
|
+
token: "",
|
39
|
+
chainId: Number((e == null ? void 0 : e.chainId) || 0),
|
40
|
+
enabled: (e == null ? void 0 : e.networkType) == "evm"
|
41
|
+
}), U = _e(pe || 0, 11), [w, a] = V({
|
42
|
+
text: "",
|
43
|
+
isGradient: !1,
|
44
|
+
color: "bw-bg-border-primary"
|
45
|
+
});
|
46
|
+
async function Se() {
|
47
|
+
if ((e == null ? void 0 : e.networkType) === "evm" && Number((e == null ? void 0 : e.chainId) || "0") !== (T == null ? void 0 : T.id))
|
48
|
+
try {
|
49
|
+
await Be({ chainId: Number((e == null ? void 0 : e.chainId) || "0") });
|
50
|
+
} catch {
|
51
|
+
}
|
52
|
+
else if ((e == null ? void 0 : e.networkType) === "sol" && v !== ((e == null ? void 0 : e.chainId) == "eclipse-svm" ? "201" : "101"))
|
53
|
+
try {
|
54
|
+
let t = await ye({ wallet: b, network: e.chainId == "eclipse-svm" ? "201" : "101" });
|
55
|
+
X();
|
56
|
+
} catch {
|
57
|
+
}
|
58
|
+
else
|
59
|
+
fe.emit(ze.TransactionStarted, {
|
60
|
+
...n
|
61
|
+
}), S && (ue(!1), j());
|
62
|
+
}
|
63
|
+
const { primaryWallet: b } = je(), R = Ae(), S = (e == null ? void 0 : e.networkType) === r.networkType ? !!((ee = (C = Te(e)) == null ? void 0 : C.address) != null && ee.length) : xe(e == null ? void 0 : e.networkType, (d == null ? void 0 : d.length) > 30 ? "customWallet" : r == null ? void 0 : r.networkType), X = async () => {
|
64
|
+
if (b)
|
65
|
+
try {
|
66
|
+
const t = await b.getNetwork();
|
67
|
+
me(t);
|
68
|
+
} catch {
|
69
|
+
}
|
70
|
+
else
|
71
|
+
return;
|
72
|
+
};
|
73
|
+
P(() => {
|
74
|
+
X();
|
75
|
+
}, [b]);
|
76
|
+
function Y(t, g) {
|
77
|
+
let y = t / Math.pow(10, g);
|
78
|
+
return y < 1e-6 ? y.toFixed(20) : y;
|
79
|
+
}
|
80
|
+
function $e() {
|
81
|
+
var t;
|
82
|
+
return Number(((t = u == null ? void 0 : u.data) == null ? void 0 : t.formatted) || 0);
|
83
|
+
}
|
84
|
+
function Ee(t) {
|
85
|
+
var g;
|
86
|
+
return Number(((g = K[Je(t.address)]) == null ? void 0 : g.amount) || 0) / Math.pow(10, t.decimals);
|
87
|
+
}
|
88
|
+
function Fe() {
|
89
|
+
var ae;
|
90
|
+
let t = {};
|
91
|
+
function g(s, c) {
|
92
|
+
let B = Object.keys(t);
|
93
|
+
t[s == null ? void 0 : s.chainId] ? (t[s == null ? void 0 : s.chainId].amountInToken += c.amountInToken, t[s == null ? void 0 : s.chainId].gas += Y(c.amountInToken, s == null ? void 0 : s.decimals)) : t[s == null ? void 0 : s.chainId] = {
|
94
|
+
amountInToken: c.amountInToken,
|
95
|
+
gas: Y(c.amountInToken, s == null ? void 0 : s.decimals),
|
96
|
+
token: s,
|
97
|
+
nativeBal: (d == null ? void 0 : d.length) > 30 && !A && (s == null ? void 0 : s.chainId) == (r == null ? void 0 : r.chainId) && (r == null ? void 0 : r.chainId) !== (e == null ? void 0 : e.chainId) ? 0 : (s == null ? void 0 : s.networkType) == "sol" ? E : (s == null ? void 0 : s.networkType) == "tron" ? z : (s == null ? void 0 : s.networkType) == "cosmos" ? Ee(s) : (s == null ? void 0 : s.networkType) == "tron" ? He(Q) : $e(),
|
98
|
+
isFromChain: (e == null ? void 0 : e.chainId) === (s == null ? void 0 : s.chainId.toString()),
|
99
|
+
order: (e == null ? void 0 : e.chainId) === (s == null ? void 0 : s.chainId) ? 1 : (r == null ? void 0 : r.chainId) === (s == null ? void 0 : s.chainId) ? 2 : B.length > 2 ? 3 : 2
|
100
|
+
};
|
101
|
+
}
|
102
|
+
(ae = n == null ? void 0 : n.fee) == null || ae.forEach((s) => {
|
103
|
+
const { token: c } = s;
|
104
|
+
s.source.toLowerCase() == "from_source_wallet" && g(c, s);
|
105
|
+
});
|
106
|
+
let y = U;
|
107
|
+
if (Number(p) > Number(y))
|
108
|
+
a({
|
109
|
+
text: `Insufficient Balance ${i.coin || ""}`,
|
110
|
+
isGradient: !1,
|
111
|
+
color: "bw-bg-border-primary"
|
112
|
+
});
|
113
|
+
else if ((u != null && u.isLoading || u.isFetching) && (e == null ? void 0 : e.networkType) === "evm" || (typeof E > "u" || E === null) && (e == null ? void 0 : e.networkType) === "sol" || !z && (e == null ? void 0 : e.networkType) === "tron")
|
114
|
+
a({
|
115
|
+
text: "Fetching Balance..",
|
116
|
+
isGradient: !1,
|
117
|
+
color: "bw-bg-border-primary"
|
118
|
+
});
|
119
|
+
else {
|
120
|
+
let s = Object.values(t).sort((c, B) => c.order - B.order);
|
121
|
+
s.some((c) => {
|
122
|
+
var B, le, oe;
|
123
|
+
return c != null && c.isFromChain && Number(p) <= Number(y) && Number(c.nativeBal) - Number(p) < c.gas && (i != null && i.isNative) || Number(p) <= Number(y) && Number(c.nativeBal) < c.gas && !(i != null && i.isNative) && (c != null && c.isFromChain) ? (a({
|
124
|
+
text: `Insufficient ${((B = c == null ? void 0 : c.token) == null ? void 0 : B.symbol) || ""} for gas on ${c.token.blockchain}`,
|
125
|
+
isGradient: !1,
|
126
|
+
color: "bw-bg-border-primary"
|
127
|
+
}), !0) : c.nativeBal < c.gas && !((d == null ? void 0 : d.length) > 30 && ((le = c == null ? void 0 : c.token) == null ? void 0 : le.chainId) == (r == null ? void 0 : r.chainId)) ? (a({
|
128
|
+
text: `Insufficient ${((oe = c == null ? void 0 : c.token) == null ? void 0 : oe.symbol) || ""} for gas on ${c.token.blockchain}`,
|
129
|
+
isGradient: !1,
|
130
|
+
color: "bw-bg-border-primary"
|
131
|
+
}), !0) : (a({
|
132
|
+
text: "",
|
133
|
+
isGradient: !0,
|
134
|
+
color: l || f.gradientbutton
|
135
|
+
}), !0);
|
136
|
+
}), s.length == 0 && (n != null && n.gasless || (n == null ? void 0 : n.provider) == "meson") && a({
|
137
|
+
text: "",
|
138
|
+
isGradient: !0,
|
139
|
+
color: l || f.gradientbutton
|
140
|
+
});
|
141
|
+
}
|
142
|
+
}
|
143
|
+
return P(() => {
|
144
|
+
var t, g, y;
|
145
|
+
!i.coin.length || !(o != null && o.coin.length) ? a({
|
146
|
+
text: "Select Token",
|
147
|
+
isGradient: !0,
|
148
|
+
color: l || f.gradientbutton
|
149
|
+
}) : S ? typeof p < "u" && Number(p || 0) <= 0 ? a({
|
150
|
+
text: "Enter Amount",
|
151
|
+
isGradient: !1,
|
152
|
+
color: "bw-bg-border-primary"
|
153
|
+
}) : x.isFetching || !$ ? a({
|
154
|
+
text: "Loading Routes...",
|
155
|
+
isGradient: !1,
|
156
|
+
color: "bw-bg-border-primary"
|
157
|
+
}) : e.chainId === "eclipse-svm" && !L(b) ? a({
|
158
|
+
text: `Select ${e.name} wallet`,
|
159
|
+
isGradient: !0,
|
160
|
+
color: l || f.gradientbutton
|
161
|
+
}) : r.chainId === "eclipse-svm" && e.chainId !== "eclipse-svm" && !L(b) && d.length < 30 ? a({
|
162
|
+
text: "Enter recipient wallet address",
|
163
|
+
isGradient: !0,
|
164
|
+
color: l || f.gradientbutton
|
165
|
+
}) : (i == null ? void 0 : i.address) == (o == null ? void 0 : o.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) == (o == null ? void 0 : o.address) || (e == null ? void 0 : e.networkType) == "sol" && (b == null ? void 0 : b.address) === d && (i == null ? void 0 : i.address) == (o == null ? void 0 : o.address) ? a({
|
166
|
+
text: "From and To asset can not be the same!",
|
167
|
+
isGradient: !1,
|
168
|
+
color: "bw-bg-border-primary"
|
169
|
+
}) : (y = (g = (t = x == null ? void 0 : x.data) == null ? void 0 : t.data) == null ? void 0 : g.quotes) != null && y.length ? x != null && x.error ? a({
|
170
|
+
text: "Failed to fetch Quotes",
|
171
|
+
isGradient: !1,
|
172
|
+
color: "bw-bg-border-primary"
|
173
|
+
}) : F && Number((e == null ? void 0 : e.chainId) || "0") !== (T == null ? void 0 : T.id) && (e == null ? void 0 : e.networkType) === "evm" || R && ((e == null ? void 0 : e.chainId) === "eclipse-svm" ? "201" : "101") !== v && (e == null ? void 0 : e.networkType) === "sol" ? a({
|
174
|
+
text: `Switch Chain to ${e.chain}`,
|
175
|
+
isGradient: !0,
|
176
|
+
color: l || f.gradientbutton
|
177
|
+
}) : Fe() : a({
|
178
|
+
text: "No Routes Found",
|
179
|
+
isGradient: !1,
|
180
|
+
color: "bw-bg-border-primary"
|
181
|
+
}) : a({
|
182
|
+
text: "",
|
183
|
+
isGradient: !0,
|
184
|
+
color: l || f.gradientbutton
|
185
|
+
});
|
186
|
+
}, [v, b, i, o, p, e, r, (se = u.data) == null ? void 0 : se.formatted, n, u.isFetching, u.isLoading, F, U, S, x.isFetching, T == null ? void 0 : T.id, $, z, E, d, K, Q]), `${(te = e.chain) == null ? void 0 : te.toLowerCase()}`, `${(re = e.chain) == null ? void 0 : re.toLowerCase()}`, /* @__PURE__ */ N(
|
187
|
+
"button",
|
188
|
+
{
|
189
|
+
style: w != null && w.isGradient && M && O ? {
|
190
|
+
...I == null ? void 0 : I.gradientStyle,
|
191
|
+
boxShadow: I && I.customTheme && ((ne = (ce = I.customTheme) == null ? void 0 : ce.shadow) == null ? void 0 : ne.boxShadow) || "1px 1px 7px rgba(0, 0, 0, 0.15)"
|
192
|
+
} : {
|
193
|
+
boxShadow: I && I.customTheme && ((de = (ie = I.customTheme) == null ? void 0 : ie.shadow) == null ? void 0 : de.boxShadow) || "1px 1px 7px rgba(0, 0, 0, 0.15)"
|
194
|
+
},
|
195
|
+
className: `bw-w-full bw-rounded-sm bw-h-[52px] ${w != null && w.isGradient ? "bw-p-[3px]" : "bw-p-[1px]"} bw-mt-3 bw-border-0 bw-relative bw-z-0 disabled:bw-opacity-70 ${M && O && w.color} ${w.text.length > 29 ? "bw-text-xl" : "bw-text-2xl"} ${w != null && w.isGradient ? "bw-font-bold bw-text-text-primary" : "bw-font-normal bw-text-text-secondary"}`,
|
196
|
+
onClick: () => {
|
197
|
+
S || (G(!0), ((e == null ? void 0 : e.networkType) !== "evm" && F || (e == null ? void 0 : e.networkType) !== "sol" && R && b !== null || (e == null ? void 0 : e.networkType) !== "tron" && H && J) && !A ? m("from") : F && (r == null ? void 0 : r.networkType) !== "evm" || R && (r == null ? void 0 : r.networkType) !== "sol" || (r == null ? void 0 : r.networkType) !== "tron" && H && J || A ? m("to") : m("from")), e.chainId === "eclipse-svm" && !L(b) ? (G(!0), m("from")) : r.chainId === "eclipse-svm" && e.chainId !== "eclipse-svm" && !L(b) && d.length < 30 ? (G(!0), m("to")) : Se();
|
198
|
+
},
|
199
|
+
children: /* @__PURE__ */ N("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__ */ N("p", { className: "bw-relative bw-z-20", children: M && O ? Ge ? /* @__PURE__ */ N("div", { className: "bw-w-[30px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[30px]", children: /* @__PURE__ */ N(be, { size: 22, thickness: 5, color: "inherit" }) }) : S ? w.text.length ? w.text : "Start Transaction" : `Connect ${he} Wallet` : /* @__PURE__ */ N("div", { className: "bw-w-[30px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[30px]", children: /* @__PURE__ */ N(be, { size: 22, thickness: 5, color: "inherit" }) }) }) })
|
200
|
+
}
|
201
|
+
);
|
202
|
+
}
|
203
|
+
export {
|
204
|
+
is as default
|
205
|
+
};
|
@@ -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 { n 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-BkrnmkI7.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-CbycATvf.js";
|
3
|
+
import { n as Wn } from "./index-Fv4UV6Sc.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-Fv4UV6Sc.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
|