@blockend/widget 1.0.48-beta.0 → 1.0.49-beta.2
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-D8LuuVmM.js → AllRoutes-SK8ZFq_x.js} +9 -9
- package/dist/{Box-DM9yFOex.js → Box-DAMq9mQT.js} +5 -5
- package/dist/EstGas-B9rFXiVW.js +1486 -0
- package/dist/{Grow-DOn6L3co.js → Grow-Qzfjlf_b.js} +2 -2
- package/dist/{InputComp-NuVHgaJr.js → InputComp-BUhhYfS_.js} +3 -3
- package/dist/{LoadRoute-B67KdzDM.js → LoadRoute-B9EnT59x.js} +4 -4
- package/dist/{QuotesProgress-QaDMFoy1.js → QuotesProgress-DMyLQ_Iw.js} +1 -1
- package/dist/{SwapAsset-DS1khTG7.js → SwapAsset-mgONO1Wh.js} +1 -1
- package/dist/{Tooltip-Ba3WFgGd.js → Tooltip-CCwWxndh.js} +15 -15
- package/dist/TxnButton-CqL_9AIV.js +211 -0
- package/dist/{add-q9Nf6prg.js → add-DgNWpTbE.js} +1 -1
- package/dist/{all-wallets-DPeT0Mif.js → all-wallets-DbLggbFH.js} +1 -1
- package/dist/{app-store-DN3WdWdo.js → app-store-BM-3bzwt.js} +1 -1
- package/dist/{apple-DyzMqifv.js → apple-DGgkQglq.js} +1 -1
- package/dist/{arrow-bottom-DqoHxj9Z.js → arrow-bottom-BCcsiVDf.js} +1 -1
- package/dist/{arrow-bottom-circle-gYCPf_-a.js → arrow-bottom-circle-BxnEnxCv.js} +1 -1
- package/dist/{arrow-left-BCb0WGCp.js → arrow-left-BajNw8Bo.js} +1 -1
- package/dist/{arrow-right-COFDKXwO.js → arrow-right-Kqyf83Ue.js} +1 -1
- package/dist/{arrow-top-A2hPO7gg.js → arrow-top-P0YZuCsS.js} +1 -1
- package/dist/{bank-DzMH-tSV.js → bank-BdBlTjok.js} +1 -1
- package/dist/{basic-C5wivloW.js → basic-B7dsMTNk.js} +3 -3
- package/dist/{browser-pBih3Y0E.js → browser-CiQFAZ4t.js} +1 -1
- package/dist/{card-CnPr5FkC.js → card-D94MFuQu.js} +1 -1
- package/dist/{ccip-Di_Zaa6h.js → ccip-vv5r0Apm.js} +11 -11
- package/dist/{checkmark-DuHkawx4.js → checkmark-Cucqq4L6.js} +1 -1
- package/dist/{checkmark-bold-CbTyGrPC.js → checkmark-bold-C5WgesjY.js} +1 -1
- package/dist/{chevron-bottom-ClujWrwS.js → chevron-bottom-CyfhotQQ.js} +1 -1
- package/dist/{chevron-left-Bk48p4Zx.js → chevron-left-CXJ7R3iS.js} +1 -1
- package/dist/{chevron-right-DNGloKKX.js → chevron-right-4ex-g3or.js} +1 -1
- package/dist/{chevron-top-BeF-AMWu.js → chevron-top-BDfgSTbr.js} +1 -1
- package/dist/{chrome-store-DbhS7z0N.js → chrome-store-CX9plHu3.js} +1 -1
- package/dist/{clock-C_6_l4to.js → clock-CtQPqpVc.js} +1 -1
- package/dist/{close-CSt1jFt2.js → close-CYlyCBrT.js} +1 -1
- package/dist/{coinPlaceholder-BCj1y0PN.js → coinPlaceholder-DS0YfqOM.js} +1 -1
- package/dist/{compass-BylNTlMa.js → compass-DVktgTZ-.js} +1 -1
- package/dist/{copy-B5chXsW-.js → copy-Bk0qGavv.js} +1 -1
- package/dist/{core-DMrbUYAd.js → core-DgJB3Qno.js} +3 -3
- package/dist/{cursor-DOai1hPO.js → cursor-CCqfxECm.js} +1 -1
- package/dist/{cursor-transparent-Cadcmy6E.js → cursor-transparent-CPbYJ9jd.js} +1 -1
- package/dist/{desktop-DCy_OF9q.js → desktop-DAykpsO7.js} +1 -1
- package/dist/{disconnect-d_9YI8yP.js → disconnect-DL8vRZg2.js} +1 -1
- package/dist/{discord-C5PncbsA.js → discord-BS8TPANA.js} +1 -1
- package/dist/{down-B0DJRPMS.js → down-D6aGpC9P.js} +2 -2
- package/dist/{etherscan-ClGwr9lW.js → etherscan-YSjUjqH5.js} +1 -1
- package/dist/{exclamation-triangle-UG68kEuv.js → exclamation-triangle-Cd8s_lsN.js} +1 -1
- package/dist/{extension-Bhr-Ssau.js → extension-BfYpl1LK.js} +1 -1
- package/dist/{external-link-BRJo7SZO.js → external-link-uF5MV_9t.js} +1 -1
- package/dist/{facebook-BnA-xxoO.js → facebook-DO648yaX.js} +1 -1
- package/dist/{farcaster-CvgpGB8R.js → farcaster-DZF64pQM.js} +1 -1
- package/dist/{filters-2DNvXC2d.js → filters-DMTGJi0Y.js} +1 -1
- package/dist/{getChainIds-BJOBostX.js → getChainIds-DUKOh0Kp.js} +2 -2
- package/dist/getCosmosAddress-Cb98patK.js +6075 -0
- package/dist/{github-CqCIZfoi.js → github-DQDrN0RZ.js} +1 -1
- package/dist/{google-Cb46Xe1N.js → google-DRrIdyFk.js} +1 -1
- package/dist/{hamburger-Cj81xHVG.js → hamburger-DFh0u4ls.js} +5 -5
- package/dist/{help-circle-BQm3Y4uL.js → help-circle-n5Ls2-2F.js} +1 -1
- package/dist/{id-DlZAWXhX.js → id-DbShnIoD.js} +1 -1
- package/dist/{image-C-Rdb3yG.js → image-B5YOEd-c.js} +1 -1
- package/dist/{index-CxxmgFkL.js → index-BC_WzIG-.js} +1 -1
- package/dist/index-BIN4LE_6.js +42277 -0
- package/dist/{index-CUDhfiq5.js → index-BwAuNUFT.js} +2600 -2622
- package/dist/{index-BKAQ3OTd.js → index-CDBWyjo1.js} +11 -11
- package/dist/{index-N4PNqcjR.js → index-CL2LZuVL.js} +2 -2
- package/dist/{index-DeBuj-lE.js → index-CktG1k9u.js} +1 -1
- package/dist/index-D4uRM0hD.js +3010 -0
- package/dist/index-DEecyVOZ.js +6711 -0
- package/dist/{index-BEianCH_.js → index-DuTB7F2j.js} +279 -306
- package/dist/{index-DD4yqUTK.js → index-DvR1iioL.js} +78 -78
- package/dist/index-VUJh-JIq.js +206 -0
- package/dist/{index.es-BkvYD6Tp.js → index.es-BRVISbr4.js} +2498 -2373
- package/dist/{index.es-DGhokHli.js → index.es-DD1q2x58.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-o_cb8tTT.js → info-5rQx4FCT.js} +1 -1
- package/dist/{info-circle-BweemjWa.js → info-circle-DnNqx9Fu.js} +1 -1
- package/dist/{lightbulb-CIREQKfQ.js → lightbulb-DEa_QXWk.js} +1 -1
- package/dist/{mail-D7pla8qN.js → mail-DNWPpemE.js} +1 -1
- package/dist/{mobile-BfSFqXTR.js → mobile-CsmBvAG0.js} +1 -1
- package/dist/{more-Cm2OZt-4.js → more-Bjd7dOWF.js} +1 -1
- package/dist/{network-placeholder-cja_SKEh.js → network-placeholder-DsQ_HMHG.js} +1 -1
- package/dist/{nftPlaceholder-CPMGC0YA.js → nftPlaceholder-KsQSrTt2.js} +1 -1
- package/dist/{off-2ov8-cMg.js → off-B0hqloiu.js} +1 -1
- package/dist/{play-store-K7jF5Tx9.js → play-store-DseAgFmo.js} +1 -1
- package/dist/{plus-D2hT5Tke.js → plus-BJCNDRM3.js} +1 -1
- package/dist/{qr-code-DdAcFtyy.js → qr-code-lEBAtsO4.js} +1 -1
- package/dist/{recycle-horizontal-C_hgDyOE.js → recycle-horizontal-K4rUQslN.js} +1 -1
- package/dist/{refresh-DmHZ_uHs.js → refresh-DEZrriLV.js} +1 -1
- package/dist/{reown-logo-C7Ew_uaV.js → reown-logo-BHbe-CUO.js} +1 -1
- package/dist/{search-DIQ1nJd8.js → search-CIK9XN0-.js} +1 -1
- package/dist/{send-oPtL6xIE.js → send-Bxpdb3Vf.js} +1 -1
- package/dist/{swapHorizontal-Csk-Etan.js → swapHorizontal-BBHEuYx1.js} +1 -1
- package/dist/{swapHorizontalBold-BcWknhY6.js → swapHorizontalBold-t0VsiN4I.js} +1 -1
- package/dist/{swapHorizontalMedium-DmNmthd2.js → swapHorizontalMedium-PzUH_Th4.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-Cqili0jK.js → swapHorizontalRoundedBold-EyDyL2Bj.js} +1 -1
- package/dist/{swapVertical-CmQhV1BW.js → swapVertical-CusOd1Kd.js} +1 -1
- package/dist/{telegram-8VqDFrbM.js → telegram-DfP_Unfg.js} +1 -1
- package/dist/{three-dots-54YC22RW.js → three-dots-BcnJZFUd.js} +1 -1
- package/dist/{twitch-BG66DH8z.js → twitch-CN0F2VUn.js} +1 -1
- package/dist/{twitterIcon-B3TRjKnO.js → twitterIcon-DDA3Skm-.js} +1 -1
- package/dist/{unsupportedProp-DxJPUr4X.js → unsupportedProp-CIQ48Cx8.js} +1 -1
- package/dist/useRegisterError-DuNi8RxR.js +8812 -0
- package/dist/{verify-Cxrk9OZf.js → verify-BVsIUy32.js} +1 -1
- package/dist/{verify-filled-DTYh5fHd.js → verify-filled-bQ1f0Y-d.js} +1 -1
- package/dist/{w3m-modal-BtzAU8Rd.js → w3m-modal-Cg8vnNGL.js} +2 -2
- package/dist/{wallet-CqHzy9UL.js → wallet-OISOAGe9.js} +1 -1
- package/dist/{wallet-placeholder-DUpL8Wi-.js → wallet-placeholder-DZD3tMxc.js} +1 -1
- package/dist/{walletconnect-CMShOjhI.js → walletconnect-CCANKmqY.js} +1 -1
- package/dist/{warning-circle-C-6BUTdg.js → warning-circle-C_uh-wB2.js} +1 -1
- package/dist/{x-Bs3i9yGj.js → x-BpuzG7VO.js} +1 -1
- package/package.json +3 -5
- package/dist/EstGas-BeT31S57.js +0 -13644
- package/dist/TxnButton-tr4Dz_jE.js +0 -223
- package/dist/getCosmosAddress-nYlLagxO.js +0 -8398
- package/dist/index-BJtXFuWZ.js +0 -160
- package/dist/index-CPAph-rb.js +0 -206
- package/dist/index-DQ-upUtl.js +0 -85050
- package/dist/index-eC9_VgZe.js +0 -3183
- package/dist/useRegisterError-RP3LuUvG.js +0 -8913
@@ -1,223 +0,0 @@
|
|
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
|
-
};
|