@blockend/widget 1.0.55 → 1.0.56
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-CInC9QGQ.js → AllRoutes-CyD25qOP.js} +9 -9
- package/dist/{Box-_vN-nB2g.js → Box-BqKR6yh2.js} +10 -10
- package/dist/EstGas-BIwMpIdu.js +1573 -0
- package/dist/{Grow-CahJ50bG.js → Grow-BVXa982_.js} +2 -2
- package/dist/{InputComp-BA0m0-BG.js → InputComp-mfg9qUQM.js} +3 -3
- package/dist/{LoadRoute-myKaCOSm.js → LoadRoute-psJpcC1g.js} +4 -4
- package/dist/{QuotesProgress-p8uGXu3L.js → QuotesProgress-DdH9coV4.js} +1 -1
- package/dist/{SwapAsset-sqEVoQ3t.js → SwapAsset-DZm2uxy-.js} +1 -1
- package/dist/{Tooltip-BrCb3x7_.js → Tooltip-BasOLFMf.js} +3 -3
- package/dist/TxnButton-7H0ziW6y.js +215 -0
- package/dist/{add-VsfWD7ni.js → add-hMkDpQJx.js} +1 -1
- package/dist/{all-wallets-BkUqFobk.js → all-wallets-TzzPsASL.js} +1 -1
- package/dist/{app-store-Dhz1I2UU.js → app-store-Bvi3lO0E.js} +1 -1
- package/dist/{apple-B1A9FWmD.js → apple-DovGBZVC.js} +1 -1
- package/dist/{arrow-bottom-CU0SNN_M.js → arrow-bottom-Bt0z0B0d.js} +1 -1
- package/dist/{arrow-bottom-circle-CkK0nZyv.js → arrow-bottom-circle-B6pKx0dw.js} +1 -1
- package/dist/{arrow-left-B3tHSyMd.js → arrow-left-I0NpmB6b.js} +1 -1
- package/dist/{arrow-right-C9GNeMpg.js → arrow-right-CmtwLDja.js} +1 -1
- package/dist/{arrow-top-CROlaURs.js → arrow-top-DokEs3HC.js} +1 -1
- package/dist/{bank-C9ws6grO.js → bank-yu5LTCzK.js} +1 -1
- package/dist/{basic-CNZusk3T.js → basic-Cuqqlzwv.js} +3 -3
- package/dist/{browser-CsDSjYxB.js → browser-D-klzbTJ.js} +1 -1
- package/dist/{card-DEbxL9v9.js → card-C7_UmEhR.js} +1 -1
- package/dist/{ccip-BzuzcsZy.js → ccip-BqcIWBNQ.js} +16 -16
- package/dist/{checkmark-DE5590E3.js → checkmark-DGmFkx4x.js} +1 -1
- package/dist/{checkmark-bold-QCiYoLBv.js → checkmark-bold-K5aQHF2s.js} +1 -1
- package/dist/{chevron-bottom-DwDL4YMH.js → chevron-bottom-D1sa5ntV.js} +1 -1
- package/dist/{chevron-left-f-cfElLv.js → chevron-left-CrTavssV.js} +1 -1
- package/dist/{chevron-right-CUqumYdc.js → chevron-right-4tHjmIzI.js} +1 -1
- package/dist/{chevron-top-B51EfBCn.js → chevron-top-BGhhItI1.js} +1 -1
- package/dist/{chrome-store-Bye9an43.js → chrome-store-BSS7R8tR.js} +1 -1
- package/dist/{clock-B7Sev0vn.js → clock-C0LASIAZ.js} +1 -1
- package/dist/{close-0BVUAR_a.js → close-u-Xm2I00.js} +1 -1
- package/dist/{coinPlaceholder-BV86Cpoi.js → coinPlaceholder-C-f0Hi8-.js} +1 -1
- package/dist/{compass-BG0JGmer.js → compass-BePsWGiq.js} +1 -1
- package/dist/{copy-BK_ak0uV.js → copy-CcmBGGYL.js} +1 -1
- package/dist/{core-CK5YGudk.js → core-DTXll9hG.js} +16 -17
- package/dist/{cursor-DYlGZYqP.js → cursor-CtyBKKIZ.js} +1 -1
- package/dist/{cursor-transparent-C66dlXx_.js → cursor-transparent-DV-nTgKw.js} +1 -1
- package/dist/{desktop-MPzP06em.js → desktop-BQk6XvDk.js} +1 -1
- package/dist/{disconnect-S1mgcbm2.js → disconnect-Bnip6tM-.js} +1 -1
- package/dist/{discord-C1lCIbjj.js → discord-CixZYk_L.js} +1 -1
- package/dist/{down-Bs8dpUrC.js → down-DveeNmNl.js} +2 -2
- package/dist/{etherscan-QQa80RLT.js → etherscan-Ca4qbKIV.js} +1 -1
- package/dist/{exclamation-triangle-4oHle7Ol.js → exclamation-triangle-DEJeWCAG.js} +1 -1
- package/dist/{extension-B3zd6NTN.js → extension-Dwkk2Z0q.js} +1 -1
- package/dist/{external-link-DaiDaJke.js → external-link-BVJzQ3gM.js} +1 -1
- package/dist/{facebook-BSHOu5Eh.js → facebook-H39HpD1e.js} +1 -1
- package/dist/{farcaster-CNUiCN9L.js → farcaster-B0C8pA-P.js} +1 -1
- package/dist/{filters-CDlQ6RDt.js → filters-BfgKjq1s.js} +1 -1
- package/dist/{getChainIds-B0koox0j.js → getChainIds-DJyYvC8w.js} +69 -69
- package/dist/getCosmosAddress-wvdpMO7J.js +6075 -0
- package/dist/{github-B7OCLZiT.js → github-CZxxY0sj.js} +1 -1
- package/dist/{google-Cf3xXFpT.js → google-DbGRWYI0.js} +1 -1
- package/dist/{hamburger-B0j3zDc0.js → hamburger-C-fmenLo.js} +5 -5
- package/dist/{help-circle-DP7zV3_w.js → help-circle-BZqpCbkX.js} +1 -1
- package/dist/{id-BQRwktVK.js → id-BohjVAp4.js} +1 -1
- package/dist/{image-DFBrbvvT.js → image-DYGqq78I.js} +1 -1
- package/dist/index-9oZmbNJz.js +206 -0
- package/dist/{index-DpZHXmue.js → index-BE1KHDcY.js} +2 -2
- package/dist/{index-BDzrNgTC.js → index-BuTM3T5V.js} +1 -1
- package/dist/{index-D1GIjZ4K.js → index-C2K4V7-H.js} +1 -1
- package/dist/index-CJJQ2LCX.js +6712 -0
- package/dist/{index-CMAhUTez.js → index-Cb-vA8WO.js} +11 -11
- package/dist/{index-FGz1V6AR.js → index-Cb6Z5QF3.js} +233 -241
- package/dist/{index-CTGrN6JB.js → index-CgCWrCyY.js} +2600 -2622
- package/dist/{index-DrSY5n-x.js → index-OBUgs_7T.js} +11 -8
- package/dist/{index-1Vs2kWG_.js → index-hXKqfCGv.js} +78 -78
- package/dist/index-qJms-6-V.js +48905 -0
- package/dist/{index.es-D0JK47eg.js → index.es-BNrhKlYX.js} +24 -26
- package/dist/{index.es-BS6PwZoN.js → index.es-Dodf_4Pq.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-C1ZJCPTD.js → info-DpJutiAx.js} +1 -1
- package/dist/{info-circle-Dhmi_tCI.js → info-circle-BwhhpI3z.js} +1 -1
- package/dist/{lightbulb-0j0AYNED.js → lightbulb-DWYKdsBz.js} +1 -1
- package/dist/{mail-BtTEWpBH.js → mail-CEBxLp-q.js} +1 -1
- package/dist/{mobile-DvxVPngz.js → mobile-jGiJK-tS.js} +1 -1
- package/dist/{more-B7Wl87te.js → more-Ceddtafo.js} +1 -1
- package/dist/{network-placeholder-9GbY6RXW.js → network-placeholder-BiDTGsDC.js} +1 -1
- package/dist/{nftPlaceholder-omPs3Tyh.js → nftPlaceholder-Bdt3xlsh.js} +1 -1
- package/dist/{off-DzwEOAXj.js → off-CjQUQbIf.js} +1 -1
- package/dist/{play-store-fB4OGgDD.js → play-store-CHlzBg61.js} +1 -1
- package/dist/{plus-QdziAxSu.js → plus-BpDW56X5.js} +1 -1
- package/dist/{qr-code-C2U72CiI.js → qr-code-Cn4ixB1y.js} +1 -1
- package/dist/{recycle-horizontal-Bl8nBo5T.js → recycle-horizontal-DBU-2t6D.js} +1 -1
- package/dist/{refresh-CHVcAm40.js → refresh-DF6FHw_b.js} +1 -1
- package/dist/{reown-logo-C5CEAzfh.js → reown-logo-DZuLV_8T.js} +1 -1
- package/dist/{search-CRYtwGKs.js → search-CtvrGHTU.js} +1 -1
- package/dist/{send-DgcEtdkH.js → send-q0rRlrWy.js} +1 -1
- package/dist/{swapHorizontal-bGAC2ORL.js → swapHorizontal-y4XZEygv.js} +1 -1
- package/dist/{swapHorizontalBold-7AVtDAdB.js → swapHorizontalBold-DbOTapbL.js} +1 -1
- package/dist/{swapHorizontalMedium-BPEj2jrH.js → swapHorizontalMedium-DjJ6sIy9.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-KZW7Q7m8.js → swapHorizontalRoundedBold-DseOC2QK.js} +1 -1
- package/dist/{swapVertical-R6wYRmxl.js → swapVertical-CtSwX7c_.js} +1 -1
- package/dist/{telegram-BU7tcQ98.js → telegram-mDVVPT-5.js} +1 -1
- package/dist/{three-dots-DcRrr590.js → three-dots-BC4W7vAE.js} +1 -1
- package/dist/{twitch-CiWBdFQ5.js → twitch-BtdlLgtD.js} +1 -1
- package/dist/{twitterIcon-Dx4rfeax.js → twitterIcon-FYpWmhWb.js} +1 -1
- package/dist/{unsupportedProp-I75ZFHZ3.js → unsupportedProp-Bk4k1APH.js} +1 -1
- package/dist/{useRegisterError-BGuw8xn6.js → useRegisterError-Dvrv5eoV.js} +1546 -1542
- package/dist/{verify-OIjFr-Yf.js → verify-Dherv62_.js} +1 -1
- package/dist/{verify-filled-CuIbxxfK.js → verify-filled-D86UrptW.js} +1 -1
- package/dist/{w3m-modal-C1jV1wrT.js → w3m-modal-DGiYzg-1.js} +2 -2
- package/dist/{wallet-Bk-xbtkS.js → wallet-BlgfCBaN.js} +1 -1
- package/dist/{wallet-placeholder-D74DpYqS.js → wallet-placeholder-BjrNOIyN.js} +1 -1
- package/dist/{walletconnect-BklYaQAX.js → walletconnect-__d1VRdN.js} +1 -1
- package/dist/{warning-circle-DlDxhMDL.js → warning-circle-CR3NTneR.js} +1 -1
- package/dist/{x-BNL67S5v.js → x-BVa5oeDy.js} +1 -1
- package/package.json +4 -2
- package/dist/EstGas-BaKv_yk7.js +0 -20281
- package/dist/TxnButton-D10GjiUs.js +0 -223
- package/dist/getCosmosAddress-CCWtYVNX.js +0 -9566
- package/dist/index-BmVN9MUZ.js +0 -160
- package/dist/index-DRwDQTB-.js +0 -29422
- package/dist/index-DTish3yr.js +0 -1014
- package/dist/index-RtfOj4GQ.js +0 -206
@@ -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 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
|
-
};
|