@blockend/widget 1.0.54 → 1.0.55-beta.1
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-CZLcXz0H.js → AllRoutes-D6S-NFxZ.js} +9 -9
- package/dist/{Box-DeJ0aAds.js → Box-DESo1bHm.js} +6 -6
- package/dist/EstGas-Dy3XfCzY.js +1496 -0
- package/dist/{Grow-CAO6QGlH.js → Grow-DzEr7XrA.js} +2 -2
- package/dist/{InputComp-Dvng88xF.js → InputComp-GcnDqx_s.js} +3 -3
- package/dist/{LoadRoute-Cd75OEeT.js → LoadRoute-BmUgvDid.js} +4 -4
- package/dist/{QuotesProgress-DLkS2eIB.js → QuotesProgress-E5JnUMS0.js} +1 -1
- package/dist/{SwapAsset-CkPNtJ5Z.js → SwapAsset-MBXcdeBf.js} +1 -1
- package/dist/{Tooltip-Du4SfKmq.js → Tooltip-DSAJT2x7.js} +3 -3
- package/dist/TxnButton-Br8R19rF.js +215 -0
- package/dist/{add-Dy-pn86L.js → add-BryKCrpI.js} +1 -1
- package/dist/{all-wallets-DA1Z5Cop.js → all-wallets-BMVOK2Ci.js} +1 -1
- package/dist/{app-store-x_6nCb7H.js → app-store-3WurbJdI.js} +1 -1
- package/dist/{apple-9Ay4GKtb.js → apple-eM872Ubz.js} +1 -1
- package/dist/{arrow-bottom-18IDuPdg.js → arrow-bottom-HMc73fJ8.js} +1 -1
- package/dist/{arrow-bottom-circle-C-WRrwmS.js → arrow-bottom-circle-B1N_R8Ux.js} +1 -1
- package/dist/{arrow-left-DWFV43Cf.js → arrow-left-Q7GAZkD7.js} +1 -1
- package/dist/{arrow-right-CDRqwfO1.js → arrow-right-ft3TcIM3.js} +1 -1
- package/dist/{arrow-top-DpR9F1Zo.js → arrow-top-C2xmF6tK.js} +1 -1
- package/dist/{bank-Crxq2thP.js → bank-Bk-2ZR5E.js} +1 -1
- package/dist/{basic-PUh1GfJc.js → basic-CWrKgDAB.js} +3 -3
- package/dist/{browser-Dfq6PNhC.js → browser-BFB3TFfv.js} +1 -1
- package/dist/{card-B9qMqocN.js → card-DCx59si8.js} +1 -1
- package/dist/{ccip-Cf2jO5BW.js → ccip-CXr08uP1.js} +16 -16
- package/dist/{checkmark-BpwBRy8u.js → checkmark-BGsuJuhE.js} +1 -1
- package/dist/{checkmark-bold-CWJMusMr.js → checkmark-bold-DvjIl-51.js} +1 -1
- package/dist/{chevron-bottom-CEM1QdIG.js → chevron-bottom-DAEnG7QP.js} +1 -1
- package/dist/{chevron-left-8vrWG4Fd.js → chevron-left-D33h2ppx.js} +1 -1
- package/dist/{chevron-right-DUaL3bYu.js → chevron-right-C8Z_feNK.js} +1 -1
- package/dist/{chevron-top-4yRnski9.js → chevron-top-DwDMd3p9.js} +1 -1
- package/dist/{chrome-store-BrR0Mo1P.js → chrome-store-B7ZDs2Fj.js} +1 -1
- package/dist/{clock-CtzcJX1M.js → clock-DnELUxSR.js} +1 -1
- package/dist/{close-B8P3E47p.js → close-Dnt29Pss.js} +1 -1
- package/dist/{coinPlaceholder-DhDuAiLE.js → coinPlaceholder-C09pzuXv.js} +1 -1
- package/dist/{compass-BPPWXJ9J.js → compass-D8ZY16nH.js} +1 -1
- package/dist/{copy-CoDhu1Ub.js → copy-DEh4RBKI.js} +1 -1
- package/dist/{core-sNzLDgNd.js → core-CgIQaiRa.js} +16 -17
- package/dist/{cursor-CtGaAByR.js → cursor-BtzkAOER.js} +1 -1
- package/dist/{cursor-transparent-DzDZGaUH.js → cursor-transparent-B0nCflmb.js} +1 -1
- package/dist/{desktop-Cj6KJIR5.js → desktop-toTG92uH.js} +1 -1
- package/dist/{disconnect-0YabDe1z.js → disconnect-C97lbAtY.js} +1 -1
- package/dist/{discord-BliaK0NG.js → discord-BNJ3JePY.js} +1 -1
- package/dist/{down-DbUDTC9S.js → down-BFx-Bg5Q.js} +2 -2
- package/dist/{etherscan-Bu-d0d8T.js → etherscan-CK87TQMS.js} +1 -1
- package/dist/{exclamation-triangle-CkhIEkFa.js → exclamation-triangle-LWnOk0uz.js} +1 -1
- package/dist/{extension-2PmFOLpz.js → extension-5eIZU28A.js} +1 -1
- package/dist/{external-link-D5PBXR8n.js → external-link-DDlCfigP.js} +1 -1
- package/dist/{facebook-DvVHhnfi.js → facebook-1lTMXKeH.js} +1 -1
- package/dist/{farcaster-DhlI9PJI.js → farcaster-Di2TUKlZ.js} +1 -1
- package/dist/{filters-D4VXGXuc.js → filters-B_THnHaX.js} +1 -1
- package/dist/{getChainIds-Dnj79lnq.js → getChainIds-CeLEUxe0.js} +69 -69
- package/dist/getCosmosAddress-B8s9Ycj4.js +6075 -0
- package/dist/{github-DZzzrfMb.js → github-D5B1FE4K.js} +1 -1
- package/dist/{google-BJIEVX0w.js → google-C8_WSUfw.js} +1 -1
- package/dist/{hamburger-BtEtsv7a.js → hamburger-BzMrQx9y.js} +5 -5
- package/dist/{help-circle-BZN3LxgA.js → help-circle-C-ZOzjAP.js} +1 -1
- package/dist/{id-qpbgew6W.js → id-BynpKmej.js} +1 -1
- package/dist/{image-BaqsaTku.js → image-BRYUh760.js} +1 -1
- package/dist/{index-C4AhSjEZ.js → index-A8ClQmZo.js} +1 -1
- package/dist/{index-Bk1RmZa6.js → index-BFUVWgoD.js} +78 -78
- package/dist/{index-ZzUKHS4f.js → index-BK0BZT6j.js} +2600 -2622
- package/dist/index-C5bv1F_u.js +48843 -0
- package/dist/{index-DIhlHD0K.js → index-CN6pVc2G.js} +233 -241
- package/dist/index-CZwuzz6v.js +6712 -0
- package/dist/{index-B03PUlPY.js → index-DHYWnqST.js} +1 -1
- package/dist/{index-bGQWpwjq.js → index-Dnyeih-W.js} +884 -813
- package/dist/{index-ZDMBVRLP.js → index-DpHhW0_2.js} +2 -2
- package/dist/{index-BQ82b0Bz.js → index-SkYFFVLL.js} +11 -11
- package/dist/index-krrwn6Pi.js +206 -0
- package/dist/{index.es-eZ31W0zo.js → index.es-DB9y_DEM.js} +1 -1
- package/dist/index.es-vIyUKt0W.js +13232 -0
- package/dist/index.es.js +1 -1
- package/dist/{info-CT1yToBP.js → info-DSQyHS8b.js} +1 -1
- package/dist/{info-circle-CMum6ujM.js → info-circle-BfpWcI4c.js} +1 -1
- package/dist/{lightbulb-e5tzYo3T.js → lightbulb-DEMYYsZd.js} +1 -1
- package/dist/{mail-Cotk1RnP.js → mail-DNZ2to_6.js} +1 -1
- package/dist/{mobile-BQMdX8sa.js → mobile-qsyS8oMK.js} +1 -1
- package/dist/{more-B7uYy_Eq.js → more-CnBuKwll.js} +1 -1
- package/dist/{network-placeholder-CIPNNK4H.js → network-placeholder-DhJITakA.js} +1 -1
- package/dist/{nftPlaceholder-D2GoBPY-.js → nftPlaceholder-DD3-Cc9U.js} +1 -1
- package/dist/{off-BK14JFh_.js → off-CBApAdDk.js} +1 -1
- package/dist/{play-store-DwBENt3_.js → play-store-DDoeRc-b.js} +1 -1
- package/dist/{plus-C0y88Ad4.js → plus-C3J-XWCn.js} +1 -1
- package/dist/{qr-code-CMdrrElE.js → qr-code-CEoOYtHk.js} +1 -1
- package/dist/{recycle-horizontal-BNN5ndLG.js → recycle-horizontal-BHJ_s9Yx.js} +1 -1
- package/dist/{refresh-ByH9t7MU.js → refresh-CtzOoHls.js} +1 -1
- package/dist/{reown-logo-cDM3ybDW.js → reown-logo-BOj4YDUQ.js} +1 -1
- package/dist/{search-vSwnIemK.js → search--Miza3A_.js} +1 -1
- package/dist/{send-DxaTA9HH.js → send-Bhl1lz4j.js} +1 -1
- package/dist/{swapHorizontal-C3T9QpOz.js → swapHorizontal-CCvKCngz.js} +1 -1
- package/dist/{swapHorizontalBold-NoD7qi56.js → swapHorizontalBold-B90V-dXL.js} +1 -1
- package/dist/{swapHorizontalMedium-BdCnGCU3.js → swapHorizontalMedium-CYjeHjnI.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-DOvYr1PV.js → swapHorizontalRoundedBold-DSMWeXdW.js} +1 -1
- package/dist/{swapVertical-B_QsPb4Z.js → swapVertical-DOJUNIvk.js} +1 -1
- package/dist/{telegram-Cgehpwsc.js → telegram-CufEY_4d.js} +1 -1
- package/dist/{three-dots-XdbxmzC6.js → three-dots-J2ngva7G.js} +1 -1
- package/dist/{twitch-BGHF2xBF.js → twitch-B4vTKVf5.js} +1 -1
- package/dist/{twitterIcon-DRtvBUSa.js → twitterIcon-DLrxpAGg.js} +1 -1
- package/dist/{unsupportedProp-9RcsuuVU.js → unsupportedProp-BLzY2-w_.js} +1 -1
- package/dist/{useRegisterError-lBlc4VLM.js → useRegisterError-Cf6oylnR.js} +1 -1
- package/dist/{verify-Cha1vhGY.js → verify-CbHqPQKs.js} +1 -1
- package/dist/{verify-filled-CpQ_9swy.js → verify-filled-CzKx9Cph.js} +1 -1
- package/dist/{w3m-modal-BbwlJ8yr.js → w3m-modal-DhpjK4cG.js} +2 -2
- package/dist/{wallet-DhTEGAG5.js → wallet-CvIeO6On.js} +1 -1
- package/dist/{wallet-placeholder-CBEwQiaT.js → wallet-placeholder-BqELXTBj.js} +1 -1
- package/dist/{walletconnect-MNB_N68_.js → walletconnect-BN4c4XQ5.js} +1 -1
- package/dist/{warning-circle-CyvNTyr_.js → warning-circle--dqxXujk.js} +1 -1
- package/dist/{x-CLNpY2cT.js → x-CkCp5gtL.js} +1 -1
- package/package.json +4 -2
- package/dist/EstGas-oDFlpjSW.js +0 -20281
- package/dist/TxnButton-B1GkXFSh.js +0 -223
- package/dist/getCosmosAddress-D5-u0UJp.js +0 -9566
- package/dist/index-Bp8U0z_r.js +0 -206
- package/dist/index-DKVwgDNZ.js +0 -29422
- package/dist/index-DTish3yr.js +0 -1014
- package/dist/index-xuyPmNnz.js +0 -160
- package/dist/index.es-CvlSpQGV.js +0 -11678
@@ -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-DKVwgDNZ.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-lBlc4VLM.js";
|
8
|
-
import "./getCosmosAddress-D5-u0UJp.js";
|
9
|
-
import { v as Je } from "./validError-CDlJpg_f.js";
|
10
|
-
import { u as Ke, g as Ue, p as Xe } from "./index-DIhlHD0K.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
|
-
};
|