@blockend/widget 1.0.61-beta.6 → 1.0.62
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-Cxr3Nkrq.js → AllRoutes-pT_GYhLz.js} +198 -201
- package/dist/{Box-PCm99lPs.js → Box-CMXImt80.js} +1 -1
- package/dist/{EstGas-DAqnmtXg.js → EstGas-BEwQc47B.js} +802 -922
- package/dist/{Grow-PUq8zLdG.js → Grow-CYJk-72r.js} +192 -196
- package/dist/{InputComp-Cpbiu4nw.js → InputComp-B0QgFbsj.js} +3 -3
- package/dist/{LoadRoute-DMvruPxQ.js → LoadRoute-I--KmXYZ.js} +4 -4
- package/dist/{QuotesProgress-B8gCi4mg.js → QuotesProgress-Ct53CRUU.js} +1 -1
- package/dist/{SwapAsset-LXjTHOyg.js → SwapAsset-X7gAsFxL.js} +1 -1
- package/dist/{Tooltip-BBzQ_Niy.js → Tooltip-CsxhxDbM.js} +6 -9
- package/dist/{TxnButton-CzynEgC-.js → TxnButton-BZf2lfxu.js} +62 -65
- package/dist/{add-Dy5-Nff0.js → add-fqHpy_n_.js} +1 -1
- package/dist/{all-wallets-jwMVTU0s.js → all-wallets-BEiHad26.js} +1 -1
- package/dist/{app-store-DEcg75wd.js → app-store-BUrtll4M.js} +1 -1
- package/dist/{apple-C3gcxaZN.js → apple-DeP0r4ax.js} +1 -1
- package/dist/{arrow-bottom-Dz-dufK1.js → arrow-bottom-DOUsYrpS.js} +1 -1
- package/dist/{arrow-bottom-circle-CbmTfpof.js → arrow-bottom-circle-3zt0oM9l.js} +1 -1
- package/dist/{arrow-left-MSV3EbO3.js → arrow-left-CZi8gizN.js} +1 -1
- package/dist/{arrow-right-BIh4_fkF.js → arrow-right-Bp2k-sRU.js} +1 -1
- package/dist/{arrow-top-BKC3U-ao.js → arrow-top-Bdu-g3eb.js} +1 -1
- package/dist/{bank-DBtyASC7.js → bank-UM_6-xYg.js} +1 -1
- package/dist/{basic-BgV8RQ-A.js → basic-CfaJcj31.js} +4 -4
- package/dist/{browser-DC9IClot.js → browser-DE4dHUIn.js} +1 -1
- package/dist/{card-BT6koHhk.js → card-CpV_uFyN.js} +1 -1
- package/dist/{ccip-3LoUUUH-.js → ccip-CA2a9SDo.js} +1 -1
- package/dist/{checkmark-DSeqDz_Y.js → checkmark-CK8NZa3x.js} +1 -1
- package/dist/{checkmark-bold-BIkQqCzJ.js → checkmark-bold-DgI_WWpK.js} +1 -1
- package/dist/{chevron-bottom-CBXmsDV5.js → chevron-bottom-C_3_Lg-x.js} +1 -1
- package/dist/{chevron-left-DhVqX1hi.js → chevron-left-Dn-8RUKj.js} +1 -1
- package/dist/{chevron-right-B3rsG14_.js → chevron-right-BrzGCKbe.js} +1 -1
- package/dist/{chevron-top-BEjzOADe.js → chevron-top-DH4uxqMd.js} +1 -1
- package/dist/{chrome-store-DRLnmUBT.js → chrome-store-C6ftVKRM.js} +1 -1
- package/dist/{clock-eV75Aej3.js → clock-BMAqcMX9.js} +1 -1
- package/dist/{close-zdZMwNem.js → close-B99wQvJ_.js} +1 -1
- package/dist/{coinPlaceholder-CDI_BOjw.js → coinPlaceholder-DmuYNsmb.js} +1 -1
- package/dist/{compass-VmDWLUk0.js → compass-C4wdl146.js} +1 -1
- package/dist/{copy-BPf4wDQR.js → copy-DMJQyfJj.js} +1 -1
- package/dist/{core-FKJijvR4.js → core-v6ho39ji.js} +324 -390
- package/dist/{cursor-DyqcSARn.js → cursor-C-0knOkC.js} +1 -1
- package/dist/{cursor-transparent-BYUs3PjC.js → cursor-transparent-BLuqOo6k.js} +1 -1
- package/dist/{desktop-ajSWZf14.js → desktop-DpJrO84H.js} +1 -1
- package/dist/{disconnect-CesQDkW7.js → disconnect-k6w6zlk-.js} +1 -1
- package/dist/{discord-DRpBdD6a.js → discord-DLgkGibC.js} +1 -1
- package/dist/{down-BvpSLqv4.js → down-C4N-wh2D.js} +3 -4
- package/dist/{etherscan-T2x0uGqy.js → etherscan-DJTxjIAP.js} +1 -1
- package/dist/{exclamation-triangle-jiEvqZCt.js → exclamation-triangle-B1YdY5CX.js} +1 -1
- package/dist/{extension-VNmHHnl3.js → extension-CnhByDAh.js} +1 -1
- package/dist/{external-link-C1cNXEY_.js → external-link-CZmI3Q92.js} +1 -1
- package/dist/{facebook-BMo02i5k.js → facebook-CRHPGcBq.js} +1 -1
- package/dist/{farcaster-DGe5MIGO.js → farcaster-BYs6AvgJ.js} +1 -1
- package/dist/{filters-CUJYlRnZ.js → filters-BqJFiFCl.js} +1 -1
- package/dist/{getChainIds-D11guRHs.js → getChainIds-CPQkM2Fw.js} +4 -6
- package/dist/{getCosmosAddress-DgfHG7Hd.js → getCosmosAddress-CrzIqoe8.js} +2304 -2370
- package/dist/{github-Cs2pYb7C.js → github-WI_fsQyX.js} +1 -1
- package/dist/{google-DHT6lJFv.js → google-PDPeuX25.js} +1 -1
- package/dist/{hamburger-Yws20Vz4.js → hamburger-JHCSR4wq.js} +427 -436
- package/dist/{help-circle-DgP-m-Uz.js → help-circle-CC1LutMp.js} +1 -1
- package/dist/{id-B_EdR-1o.js → id-Dg4qm85K.js} +1 -1
- package/dist/{image-Cj7amYSJ.js → image-DvH3pCRi.js} +1 -1
- package/dist/{index-HFb_3Q0W.js → index-4DGqOb0b.js} +1 -1
- package/dist/{index-CWhe50Ec.js → index-BAjx9Sij.js} +451 -451
- package/dist/{index-D2IU_xeZ.js → index-BII8gr4h.js} +1134 -1151
- package/dist/{index-SFtx8RRR.js → index-Bl06WOfD.js} +14 -19
- package/dist/{index-BxH9oOBu.js → index-BrgwPS_u.js} +21 -32
- package/dist/{index-BXD_AzIx.js → index-ByNEeX9y.js} +1 -1
- package/dist/{index-BMBfrbLJ.js → index-CBMjkxpP.js} +5034 -5110
- package/dist/{index-BLrg6aM7.js → index-D8oYLVSL.js} +2 -2
- package/dist/{index-Bl2UpALc.js → index-DTish3yr.js} +1 -3
- package/dist/{index-mhA4TOGx.js → index-DbOqrlxW.js} +4 -4
- package/dist/{index-tEVjSKpt.js → index-Mqg8CWuX.js} +18 -32
- package/dist/{index-_c95MH6R.js → index-qIeZpXcg.js} +78 -78
- package/dist/{index.es-Cf2P8B_E.js → index.es-DV8y1ve_.js} +958 -978
- package/dist/{index.es-svtwMaZq.js → index.es-DkTmjrB8.js} +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{info-Cp9JCjqN.js → info-Cjmzqm5P.js} +1 -1
- package/dist/{info-circle-DRaVj-ap.js → info-circle-Dimf4UPG.js} +1 -1
- package/dist/{lightbulb-CsW2vktv.js → lightbulb-BsZjMPbK.js} +1 -1
- package/dist/{mail-CWnCoK8z.js → mail-KNgNgUMG.js} +1 -1
- package/dist/{mobile-CA14tPHx.js → mobile-hJMru58F.js} +1 -1
- package/dist/{more-QAxcbEKq.js → more-B1Hz9ISJ.js} +1 -1
- package/dist/{network-placeholder-TIBJyj_I.js → network-placeholder-Ba37-PVe.js} +1 -1
- package/dist/{nftPlaceholder-CjKZ96cX.js → nftPlaceholder-Br6ZCUyX.js} +1 -1
- package/dist/{off-pDtmSFmO.js → off-DZv0f5qk.js} +1 -1
- package/dist/{play-store-CSc6NscT.js → play-store-PVT99oFp.js} +1 -1
- package/dist/{plus-C_Utdahs.js → plus-0JhMk1yC.js} +1 -1
- package/dist/{qr-code-DyK3HPLw.js → qr-code-CYMnN7H6.js} +1 -1
- package/dist/{recycle-horizontal-B2PCZE0j.js → recycle-horizontal-BODX35XL.js} +1 -1
- package/dist/{refresh-DCyPlTQE.js → refresh-KT2nzf4V.js} +1 -1
- package/dist/{reown-logo-BZtSC222.js → reown-logo-x-a1ehju.js} +1 -1
- package/dist/{search-zmw8hnGf.js → search-floOYVWE.js} +1 -1
- package/dist/{send-qpVD_BnX.js → send-rBEZNvkT.js} +1 -1
- package/dist/{swapHorizontal-DeiTZysc.js → swapHorizontal-FpW50anF.js} +1 -1
- package/dist/{swapHorizontalBold-DxXPoYvj.js → swapHorizontalBold-DJo2s6QM.js} +1 -1
- package/dist/{swapHorizontalMedium-Bk5t746S.js → swapHorizontalMedium-AdMIxAQ-.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-BKNTjAMS.js → swapHorizontalRoundedBold-DB7VaS-l.js} +1 -1
- package/dist/{swapVertical-BgErJn7M.js → swapVertical-CStjk8mq.js} +1 -1
- package/dist/{telegram-DLZsj0GL.js → telegram-B7o9hZwP.js} +1 -1
- package/dist/{three-dots-C639cevE.js → three-dots-DogTUFsH.js} +1 -1
- package/dist/{twitch-BjX2MWAc.js → twitch-B_TRhhNU.js} +1 -1
- package/dist/{twitterIcon-_EGscQMD.js → twitterIcon-ujuPKvRN.js} +1 -1
- package/dist/{unsupportedProp-qsTU86qU.js → unsupportedProp-BC6azYXA.js} +1 -1
- package/dist/useRegisterError-DMILz6N1.js +8918 -0
- package/dist/{verify-B9nCXXUk.js → verify-BRWSwLhn.js} +1 -1
- package/dist/{verify-filled-Cfe5su-B.js → verify-filled-z7UoRJXn.js} +1 -1
- package/dist/{w3m-modal-pIdI-nLd.js → w3m-modal-CuXPdser.js} +2 -2
- package/dist/{wallet-BLNq3D4p.js → wallet-BMFvv3DF.js} +1 -1
- package/dist/{wallet-placeholder-DNL9SHUB.js → wallet-placeholder-DFg6CZXP.js} +1 -1
- package/dist/{walletconnect-B8OExIGD.js → walletconnect-WSdSSZfM.js} +1 -1
- package/dist/{warning-circle-CbRvsp3p.js → warning-circle-BDW9xnhM.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-Booefzx8.js → x-DUDktTjC.js} +1 -1
- package/package.json +1 -1
- package/dist/AdvancedSettings-D7odvw7r.js +0 -47
- package/dist/useRegisterError-B1CjkI-p.js +0 -8923
@@ -1,18 +1,18 @@
|
|
1
1
|
import { jsxs as p, jsx as e, Fragment as J } from "react/jsx-runtime";
|
2
|
-
import
|
3
|
-
import { B as
|
4
|
-
import { u as l, l as
|
5
|
-
import { C as
|
6
|
-
import { useQuery as
|
7
|
-
import { useAccount as
|
8
|
-
import { useDynamicContext as Be, useIsLoggedIn as
|
9
|
-
import { S as
|
10
|
-
import { u as
|
11
|
-
import { useAccount as Oe, useStargateClient as
|
12
|
-
import { S as
|
13
|
-
import { R as
|
14
|
-
import { C as
|
15
|
-
function
|
2
|
+
import ue, { useState as v, useEffect as A, useRef as B1, Suspense as A1 } from "react";
|
3
|
+
import { B as j1, i as Ee, u as Ie, F as e1, f as $e, C as Se, W as i1 } from "./useRegisterError-DMILz6N1.js";
|
4
|
+
import { u as l, l as fe, a as Ve, c as _e, S as L1, M as P1 } from "./index-CBMjkxpP.js";
|
5
|
+
import { C as t1, M as F1, g as n1 } from "./getChainIds-CPQkM2Fw.js";
|
6
|
+
import { useQuery as l1 } from "@tanstack/react-query";
|
7
|
+
import { useAccount as xe, useConnect as M1, useConnections as E1, useBalance as O1 } from "wagmi";
|
8
|
+
import { useDynamicContext as Be, useIsLoggedIn as R1 } from "@dynamic-labs/sdk-react-core";
|
9
|
+
import { S as $1 } from "./shareicon-CG3v7iKI.js";
|
10
|
+
import { u as S1, B as _1 } from "./index-D8oYLVSL.js";
|
11
|
+
import { useAccount as Oe, useStargateClient as c1, useSuggestChainAndConnect as V1, WalletType as z1 } from "graz";
|
12
|
+
import { S as Z1, D as H1 } from "./down-C4N-wh2D.js";
|
13
|
+
import { R as G1 } from "./index-CDq3vNnP.js";
|
14
|
+
import { C as ze, P as we, u as K1, g as r1 } from "./getCosmosAddress-CrzIqoe8.js";
|
15
|
+
function b1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ p(
|
17
17
|
"svg",
|
18
18
|
{
|
@@ -46,8 +46,8 @@ function d1({ fill: t }) {
|
|
46
46
|
}
|
47
47
|
);
|
48
48
|
}
|
49
|
-
function
|
50
|
-
const [r,
|
49
|
+
function J1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
50
|
+
const [r, b] = v(t), [c, d] = v(""), { tick: i, defaultCoin: g } = Ee;
|
51
51
|
return /* @__PURE__ */ p("div", { children: [
|
52
52
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
53
53
|
/* @__PURE__ */ e(
|
@@ -57,7 +57,7 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
57
57
|
n();
|
58
58
|
},
|
59
59
|
className: "bw-absolute bw-left-0 bw-top-[25%]",
|
60
|
-
children: /* @__PURE__ */ e(
|
60
|
+
children: /* @__PURE__ */ e(j1, { fill: "var(--tw-text-secondary)" })
|
61
61
|
}
|
62
62
|
),
|
63
63
|
/* @__PURE__ */ e("div", { className: "bw-text-base bw-font-normal bw-text-text-secondary", children: "Network" })
|
@@ -65,7 +65,7 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
65
65
|
/* @__PURE__ */ p(
|
66
66
|
"div",
|
67
67
|
{
|
68
|
-
style:
|
68
|
+
style: c.length ? {
|
69
69
|
background: "linear-gradient(to right,#A45EFF ,#2CFFE4)",
|
70
70
|
padding: "1px",
|
71
71
|
borderRadius: "5px"
|
@@ -76,26 +76,26 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
76
76
|
"input",
|
77
77
|
{
|
78
78
|
type: "text",
|
79
|
-
value:
|
79
|
+
value: c,
|
80
80
|
onChange: (x) => {
|
81
81
|
d(x.target.value);
|
82
82
|
},
|
83
|
-
className: `bw-text-sm bw-px-2 bw-w-full bw-h-[34px] ${
|
83
|
+
className: `bw-text-sm bw-px-2 bw-w-full bw-h-[34px] ${c.length ? "bw-border-0 bw-border-transparent" : "bw-border bw-border-border-primary"} bw-rounded-[5px] bw-font-normal bw-bg-background-container placeholder:bw-text-text-placeholder bw-text-text-primary`,
|
84
84
|
placeholder: "Search Network"
|
85
85
|
}
|
86
86
|
),
|
87
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: /* @__PURE__ */ e(
|
87
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: /* @__PURE__ */ e(b1, { fill: "var(--tw-background-secondary)" }) })
|
88
88
|
]
|
89
89
|
}
|
90
90
|
),
|
91
|
-
/* @__PURE__ */ e("div", { className: "bw-h-[500px] bw-pr-2 bw-mt-3 bw-overflow-y-auto", children: (r == null ? void 0 : r.length) && r.filter((x) => x.name.toLowerCase().includes(
|
92
|
-
var
|
91
|
+
/* @__PURE__ */ e("div", { className: "bw-h-[500px] bw-pr-2 bw-mt-3 bw-overflow-y-auto", children: (r == null ? void 0 : r.length) && r.filter((x) => x.name.toLowerCase().includes(c.toLowerCase())).map((x, k) => {
|
92
|
+
var I;
|
93
93
|
return /* @__PURE__ */ p(
|
94
94
|
"div",
|
95
95
|
{
|
96
96
|
onClick: () => {
|
97
|
-
let
|
98
|
-
n(x), s(
|
97
|
+
let F = { chain: x.name, ...x };
|
98
|
+
n(x), s(F);
|
99
99
|
},
|
100
100
|
className: `first-letter:bw-py-2 bw-cursor-pointer bw-border-b bw-flex bw-items-center bw-justify-between bw-gap-x-3 bw-border-border-primary bw-text-sm bw-font-normal bw-text-text-primary
|
101
101
|
|
@@ -103,7 +103,7 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
103
103
|
children: [
|
104
104
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-gap-x-3", children: [
|
105
105
|
" ",
|
106
|
-
/* @__PURE__ */ e("img", { src: (
|
106
|
+
/* @__PURE__ */ e("img", { src: (I = x.image) != null && I.length ? x.image : g, className: "bw-rounded-[50%] bw-border bw-border-border-primary", width: 25, height: 25, alt: "img" }),
|
107
107
|
" ",
|
108
108
|
/* @__PURE__ */ e("p", { children: x.name }),
|
109
109
|
o.chain === x.name ? /* @__PURE__ */ e("img", { src: i, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(J, {})
|
@@ -114,39 +114,39 @@ function X1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
114
114
|
] })
|
115
115
|
]
|
116
116
|
},
|
117
|
-
|
117
|
+
k
|
118
118
|
);
|
119
119
|
}) })
|
120
120
|
] });
|
121
121
|
}
|
122
|
-
const
|
123
|
-
gradientbackground:
|
124
|
-
overlay:
|
122
|
+
const q1 = "_gradientbackground_7x8s8_1", X1 = "_overlay_7x8s8_5", s1 = {
|
123
|
+
gradientbackground: q1,
|
124
|
+
overlay: X1
|
125
125
|
};
|
126
|
-
function
|
126
|
+
function Q1(t) {
|
127
127
|
let n = t.match(/[1-9A-HJ-NP-Za-km-z]{32,44}/);
|
128
128
|
return t.slice(0, 2) === "0x" ? !0 : n ? t == n : !1;
|
129
129
|
}
|
130
|
-
function
|
131
|
-
const [n, s] =
|
130
|
+
function U1(t) {
|
131
|
+
const [n, s] = v({}), o = l((i) => i.cosmosChainIds), { data: r } = Oe({
|
132
132
|
chainId: o,
|
133
133
|
multiChain: !0
|
134
|
-
}),
|
135
|
-
chainId: [(t == null ? void 0 : t.chainId) ||
|
134
|
+
}), b = l((i) => i.fromChain), { data: c } = c1({
|
135
|
+
chainId: [(t == null ? void 0 : t.chainId) || b.chainId],
|
136
136
|
multiChain: !0
|
137
137
|
});
|
138
138
|
async function d(i) {
|
139
139
|
var g, x;
|
140
|
-
if ((g = r == null ? void 0 : r[i]) != null && g.bech32Address &&
|
141
|
-
let
|
142
|
-
s(
|
140
|
+
if ((g = r == null ? void 0 : r[i]) != null && g.bech32Address && c) {
|
141
|
+
let I = await (c[i] || c).getAllBalances((x = r == null ? void 0 : r[i]) == null ? void 0 : x.bech32Address), F = fe.keyBy(I, "denom");
|
142
|
+
s(F);
|
143
143
|
}
|
144
144
|
}
|
145
|
-
return
|
146
|
-
((t == null ? void 0 : t.networkType) == "cosmos" || (
|
147
|
-
}, [
|
145
|
+
return A(() => {
|
146
|
+
((t == null ? void 0 : t.networkType) == "cosmos" || (b == null ? void 0 : b.networkType) == "cosmos") && d((t == null ? void 0 : t.chainId) || (b == null ? void 0 : b.chainId));
|
147
|
+
}, [c, b, t]), { cosmosBalance: n };
|
148
148
|
}
|
149
|
-
function
|
149
|
+
function d1(t) {
|
150
150
|
let n = t.split("/");
|
151
151
|
if (n.length > 1) {
|
152
152
|
let s = n[1].toUpperCase();
|
@@ -154,7 +154,7 @@ function w1(t) {
|
|
154
154
|
} else
|
155
155
|
return t;
|
156
156
|
}
|
157
|
-
function
|
157
|
+
function Y1({ fill: t }) {
|
158
158
|
return /* @__PURE__ */ p(
|
159
159
|
"svg",
|
160
160
|
{
|
@@ -189,7 +189,7 @@ function D1({ fill: t }) {
|
|
189
189
|
}
|
190
190
|
);
|
191
191
|
}
|
192
|
-
function
|
192
|
+
function W1({ selectedChain: t }) {
|
193
193
|
return /* @__PURE__ */ p("div", { className: "bw-h-[100%] bw-flex bw-flex-col bw-justify-center bw-items-center", children: [
|
194
194
|
/* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center bw-items-center", children: /* @__PURE__ */ p("div", { className: "bw-relative", children: [
|
195
195
|
t != null && t.image ? /* @__PURE__ */ e(
|
@@ -200,7 +200,7 @@ function et({ selectedChain: t }) {
|
|
200
200
|
alt: "chain"
|
201
201
|
}
|
202
202
|
) : /* @__PURE__ */ e(J, {}),
|
203
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-bg-background-container -bw-bottom-2 -bw-right-2 bw-flex bw-items-center bw-justify-center bw-rounded-full bw-border bw-border-border-primary bw-w-[44px] bw-h-[44px]", children: /* @__PURE__ */ e(
|
203
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-bg-background-container -bw-bottom-2 -bw-right-2 bw-flex bw-items-center bw-justify-center bw-rounded-full bw-border bw-border-border-primary bw-w-[44px] bw-h-[44px]", children: /* @__PURE__ */ e(Y1, { fill: "var(--tw-text-secondary)" }) })
|
204
204
|
] }) }),
|
205
205
|
/* @__PURE__ */ p("h2", { className: "bw-text-base bw-text-center bw-mt-3 bw-font-bold bw-text-text-primary", children: [
|
206
206
|
"No Tokens found on ",
|
@@ -214,84 +214,84 @@ function et({ selectedChain: t }) {
|
|
214
214
|
] })
|
215
215
|
] });
|
216
216
|
}
|
217
|
-
const
|
218
|
-
var
|
217
|
+
const D1 = ue.memo(function({ selectChainState: n, value: s, handleClosePopup: o, showExchangeList: r, setCoinData: b, setChainData: c }) {
|
218
|
+
var D, Ae;
|
219
219
|
l((u) => u.searchCustomCoin);
|
220
|
-
const d = l((u) => u.setSearchCustomCoin), { ref: i, inView: g } =
|
221
|
-
|
222
|
-
const m = x(n), T = l((u) => u.fromChain), y = l((u) => u.fromCoin), S = l((u) => u.toChain), _ = l((u) => u.toCoin), [
|
220
|
+
const d = l((u) => u.setSearchCustomCoin), { ref: i, inView: g } = S1(), { getWallet: x } = Ie({}), { connected: k, address: I } = Ve(), { isConnected: F, address: L } = xe(), { primaryWallet: h } = Be();
|
221
|
+
R1();
|
222
|
+
const m = x(n), T = l((u) => u.fromChain), y = l((u) => u.fromCoin), S = l((u) => u.toChain), _ = l((u) => u.toCoin), [re, O] = v(!1), { cosmosBalance: K } = U1(n), { defaultCoin: R } = Ee, [V, f] = v(0), C = B1(null), { data: P } = Oe({
|
223
223
|
chainId: [n.chainId],
|
224
224
|
multiChain: !0
|
225
|
-
}),
|
225
|
+
}), H = (n == null ? void 0 : n.networkType) === "evm" && L || (n == null ? void 0 : n.networkType) === "sol" && (h == null ? void 0 : h.address) || (n == null ? void 0 : n.networkType) === "tron" && I || (n == null ? void 0 : n.networkType) === "cosmos" && ((D = P == null ? void 0 : P[n == null ? void 0 : n.chainId]) == null ? void 0 : D.bech32Address), $ = l((u) => u.toDisconnect);
|
226
226
|
l((u) => u.setToDisconnect);
|
227
|
-
const w = l((u) => u.customWallet),
|
227
|
+
const w = l((u) => u.customWallet), N = l((u) => u.setCustomWallet), B = l((u) => u.tokens), [j, M] = v([]), [E, se] = v([]), [G, W] = v([]), z = B, q = l1({
|
228
228
|
queryKey: ["balance", m == null ? void 0 : m.address, n],
|
229
229
|
queryFn: async () => await (await _e.fetchBalance(m.address, n.chainId)).json(),
|
230
|
-
enabled: !!((
|
230
|
+
enabled: !!((Ae = m == null ? void 0 : m.address) != null && Ae.length && n.chainId),
|
231
231
|
refetchOnWindowFocus: !1
|
232
232
|
});
|
233
|
-
function
|
234
|
-
var
|
235
|
-
let
|
236
|
-
return u.networkType == "cosmos" ? $e(((
|
233
|
+
function oe(u) {
|
234
|
+
var ae, be, ie, le, X, U, Y, te, Z, Q, de, ne;
|
235
|
+
let ee = d1(u.address);
|
236
|
+
return u.networkType == "cosmos" ? $e(((ae = K == null ? void 0 : K[ee]) == null ? void 0 : ae.amount) / Math.pow(10, u.decimals) || 0) || "" : $e((((U = (X = (le = (ie = (be = q.data) == null ? void 0 : be.data) == null ? void 0 : ie[n == null ? void 0 : n.networkType]) == null ? void 0 : le[n.chainId]) == null ? void 0 : X[u.address]) == null ? void 0 : U.balance) || 0) / Math.pow(10, ((ne = (de = (Q = (Z = (te = (Y = q.data) == null ? void 0 : Y.data) == null ? void 0 : te[n == null ? void 0 : n.networkType]) == null ? void 0 : Z[n.chainId]) == null ? void 0 : Q[u.address]) == null ? void 0 : de.asset) == null ? void 0 : ne.decimals) || 0) || 0) || "";
|
237
237
|
}
|
238
|
-
|
239
|
-
s.length > 40 &&
|
238
|
+
A(() => {
|
239
|
+
s.length > 40 && Q1(s) && !E.length ? (O(!0), d({
|
240
240
|
chainId: n.chainId,
|
241
241
|
address: s
|
242
|
-
})) : s.length || (
|
243
|
-
}, [s,
|
242
|
+
})) : s.length || (O(!1), d({ chainId: "", address: "" }));
|
243
|
+
}, [s, E]), A(() => {
|
244
244
|
f(0);
|
245
245
|
}, [s]);
|
246
|
-
function
|
247
|
-
f(0),
|
246
|
+
function ke() {
|
247
|
+
f(0), se([]), C.current.scrollTo(0, 0);
|
248
248
|
}
|
249
|
-
|
250
|
-
var u,
|
251
|
-
|
252
|
-
}, [
|
253
|
-
|
249
|
+
A(() => {
|
250
|
+
var u, ee;
|
251
|
+
z != null && z.isSuccess && (n != null && n.chainId) && M(((ee = (u = z == null ? void 0 : z.data) == null ? void 0 : u.data) == null ? void 0 : ee[n == null ? void 0 : n.chainId]) || []);
|
252
|
+
}, [z, n.chainId]), A(() => {
|
253
|
+
ke();
|
254
254
|
}, [n.chainId]);
|
255
|
-
function
|
256
|
-
var
|
257
|
-
let u = (
|
258
|
-
var
|
259
|
-
return ((
|
260
|
-
})) == null ? void 0 :
|
261
|
-
if (
|
262
|
-
}),
|
263
|
-
|
255
|
+
function he() {
|
256
|
+
var le;
|
257
|
+
let u = (le = j == null ? void 0 : j.filter((X) => {
|
258
|
+
var U, Y, te, Z;
|
259
|
+
return ((U = X.name) == null ? void 0 : U.toLowerCase().includes(s == null ? void 0 : s.toLowerCase())) || ((Y = X.symbol) == null ? void 0 : Y.toLowerCase().includes(s == null ? void 0 : s.toLowerCase())) || ((Z = (te = X.address) == null ? void 0 : te.toLowerCase()) == null ? void 0 : Z.includes(s == null ? void 0 : s.toLowerCase()));
|
260
|
+
})) == null ? void 0 : le.sort((X, U) => {
|
261
|
+
if (H) return oe(U) * U.lastPrice - oe(X) * X.lastPrice;
|
262
|
+
}), ee = 20, ae = V * ee, be = ae + ee, ie = u.slice(ae, be);
|
263
|
+
V == 0 ? se([...ie]) : se([...E, ...ie]);
|
264
264
|
}
|
265
|
-
return
|
266
|
-
|
267
|
-
}, [
|
265
|
+
return A(() => {
|
266
|
+
j != null && j.length && he();
|
267
|
+
}, [j, s, V, H, K, q.data]), A(() => {
|
268
268
|
g && f((u) => u + 1);
|
269
|
-
}, [g]), /* @__PURE__ */ e("div", { ref: C, className: " bw-pr-2 bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children:
|
270
|
-
var
|
269
|
+
}, [g]), /* @__PURE__ */ e("div", { ref: C, className: " bw-pr-2 bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children: E && (E == null ? void 0 : E.length) > 0 ? E == null ? void 0 : E.map((u, ee, ae) => {
|
270
|
+
var be, ie, le, X, U, Y;
|
271
271
|
return /* @__PURE__ */ p(
|
272
272
|
"div",
|
273
273
|
{
|
274
|
-
ref:
|
274
|
+
ref: ae.length >= 20 && ae.length - 1 === ee ? i : null,
|
275
275
|
className: `bw-py-2
|
276
276
|
${r == "from" && _._id !== u._id || r == "to" && y._id !== u._id, ""}
|
277
277
|
bw-flex bw-items-center bw-justify-between bw-cursor-pointer bw-border-b bw-border-border-primary
|
278
278
|
|
279
279
|
}`,
|
280
280
|
onClick: async () => {
|
281
|
-
var
|
282
|
-
let
|
281
|
+
var Z, Q, de, ne, Ne, ce, me, je, Te, Le, Pe;
|
282
|
+
let te = {
|
283
283
|
// ...coinData,
|
284
284
|
coin: u.symbol,
|
285
285
|
...u,
|
286
|
-
availBal: ((
|
286
|
+
availBal: ((Ne = (ne = (de = (Q = (Z = q.data) == null ? void 0 : Z.data) == null ? void 0 : Q[n == null ? void 0 : n.networkType]) == null ? void 0 : de[n.chainId]) == null ? void 0 : ne[u.address.toLowerCase()]) == null ? void 0 : Ne.balance) / Math.pow(10, ((Pe = (Le = (Te = (je = (me = (ce = q.data) == null ? void 0 : ce.data) == null ? void 0 : me[n == null ? void 0 : n.networkType]) == null ? void 0 : je[n == null ? void 0 : n.chainId]) == null ? void 0 : Te[u.address.toLowerCase()]) == null ? void 0 : Le.asset) == null ? void 0 : Pe.decimals) || 0)
|
287
287
|
};
|
288
|
-
|
288
|
+
b(te), c(n), o(n, te), (n == null ? void 0 : n.networkType) === (S == null ? void 0 : S.networkType) || (n == null || n.networkType, T == null || T.networkType, N(""));
|
289
289
|
},
|
290
290
|
children: [
|
291
291
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-justify-center bw-w-max bw-gap-x-2", children: [
|
292
|
-
/* @__PURE__ */ p("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(
|
293
|
-
(
|
294
|
-
(
|
292
|
+
/* @__PURE__ */ p("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(be = u.image) != null && be.length ? "bw-bg-background-secondary" : ""}`, children: [
|
293
|
+
(ie = u.image) != null && ie.length ? /* @__PURE__ */ e("img", { src: u.image, className: "bw-rounded-[50%] bw-max-w-[30px] bw-max-h-[30px] bw-object-contain", width: 30, height: 30, alt: "img" }) : /* @__PURE__ */ e("img", { src: R, className: "bw-rounded-[50%]", width: 30, height: 30, alt: "img" }),
|
294
|
+
(le = n == null ? void 0 : n.image) != null && le.length ? /* @__PURE__ */ e("img", { src: n.image, className: `bw-absolute ${(X = n == null ? void 0 : n.image) != null && X.length ? "bw-bg-background-secondary" : ""} bw-right-0 bw-max-w-[16px] bw-max-h-[16px] bw-object-contain bw-bottom-[-4px] bw-border bw-border-border-primary bw-rounded-[50%]`, width: 16, height: 16, alt: "img" }) : /* @__PURE__ */ e("img", { src: R, className: "bw-absolute bw-bg-background-secondary bw-right-0 bw-bottom-[-4px] bw-border bw-border-border-primary bw-rounded-[50%]", width: 16, height: 16, alt: "img" })
|
295
295
|
] }),
|
296
296
|
/* @__PURE__ */ p("div", { children: [
|
297
297
|
/* @__PURE__ */ p("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
@@ -308,35 +308,35 @@ const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
308
308
|
/* @__PURE__ */ e(
|
309
309
|
"a",
|
310
310
|
{
|
311
|
-
href: (
|
311
|
+
href: (Y = (U = n.explorer) == null ? void 0 : U.token) == null ? void 0 : Y.replace("{tokenAddress}", u.address),
|
312
312
|
target: "_blank",
|
313
|
-
onClick: (
|
314
|
-
|
313
|
+
onClick: (te) => {
|
314
|
+
te.stopPropagation();
|
315
315
|
},
|
316
316
|
className: "hover:bw-opacity-70",
|
317
|
-
children: /* @__PURE__ */ e(
|
317
|
+
children: /* @__PURE__ */ e($1, { fill: "var(--tw-text-secondary)" })
|
318
318
|
}
|
319
319
|
)
|
320
320
|
] })
|
321
321
|
] })
|
322
322
|
] })
|
323
323
|
] }),
|
324
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && w && ((w == null ? void 0 : w.length) > 30 || $) ? /* @__PURE__ */ e(J, {}) :
|
324
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && w && ((w == null ? void 0 : w.length) > 30 || $) ? /* @__PURE__ */ e(J, {}) : q.isFetching ? /* @__PURE__ */ e(Se, { size: 12, thickness: 4, color: "inherit" }) : H ? oe(u) > 0 ? /* @__PURE__ */ p(J, { children: [
|
325
325
|
/* @__PURE__ */ e(
|
326
|
-
|
326
|
+
e1,
|
327
327
|
{
|
328
|
-
value:
|
328
|
+
value: oe(u) || "",
|
329
329
|
options: {
|
330
330
|
maxDecimals: 10
|
331
331
|
}
|
332
332
|
}
|
333
333
|
),
|
334
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children:
|
334
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: oe(u) * u.lastPrice > 0 ? /* @__PURE__ */ p(J, { children: [
|
335
335
|
"$",
|
336
336
|
/* @__PURE__ */ e(
|
337
|
-
|
337
|
+
e1,
|
338
338
|
{
|
339
|
-
value: $e(
|
339
|
+
value: $e(oe(u) * u.lastPrice),
|
340
340
|
options: {
|
341
341
|
maxDecimals: 10
|
342
342
|
}
|
@@ -346,40 +346,42 @@ const tt = ce.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
346
346
|
] }) : /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(J, {}) }) })
|
347
347
|
]
|
348
348
|
},
|
349
|
-
|
349
|
+
ee
|
350
350
|
);
|
351
|
-
}) :
|
351
|
+
}) : re && !(B.isLoading && B.isFetching) ? /* @__PURE__ */ e(W1, { selectedChain: n }) : !s.length && /* @__PURE__ */ e("div", { className: "bw-w-full bw-flex bw-justify-center bw-mt-4 bw-text-text-primary", children: /* @__PURE__ */ e(Se, { color: "inherit", size: 30 }) }) });
|
352
352
|
});
|
353
|
-
function
|
354
|
-
var f, C, P,
|
355
|
-
const [d, i] =
|
356
|
-
|
357
|
-
var w,
|
358
|
-
if ((
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
353
|
+
function et({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coinData: r, showExchangeList: b, fetchChains: c }) {
|
354
|
+
var f, C, P, H, $;
|
355
|
+
const [d, i] = v(!1), [g, x] = v(""), k = l((w) => w.tokens), [I, F] = v([]), [L, h] = v(0), [m, T] = v({ chain: "" }), y = l((w) => w.gradient), S = l((w) => w.configuration), _ = l((w) => w.chainObj);
|
356
|
+
A(() => {
|
357
|
+
var w, N, B, j, M, E, se;
|
358
|
+
if ((N = (w = c.data) == null ? void 0 : w.data) != null && N.length)
|
359
|
+
if (((j = (B = c.data) == null ? void 0 : B.data) == null ? void 0 : j.length) > 9) {
|
360
|
+
let G = [...(E = (M = c.data) == null ? void 0 : M.data) == null ? void 0 : E.slice(0, 9)], W = G.findIndex((D) => D.chainId === "137"), z = G.findIndex((D) => D.chainId === "324"), q = G.findIndex((D) => D.chainId === "10"), oe = G.findIndex((D) => D.chainId === "43114");
|
361
|
+
G.splice(W, 1, _[80094] || {}), G.splice(z, 1, _[2741] || {}), G.splice(q, 1, _["eclipse-svm"] || {}), G.splice(oe, 1, _[999] || {}), !!fe.keyBy(G, "chainId")[m.chainId] || (G.pop(), G.push(m)), F(G);
|
362
|
+
} else
|
363
|
+
F([...(se = c.data) == null ? void 0 : se.data]);
|
364
|
+
}, [_, (f = c.data) == null ? void 0 : f.data, o, m]), A(() => {
|
363
365
|
T(o);
|
364
|
-
}, [o]),
|
365
|
-
var w,
|
366
|
-
if ((
|
367
|
-
let
|
368
|
-
h(
|
366
|
+
}, [o]), A(() => {
|
367
|
+
var w, N, B;
|
368
|
+
if ((N = (w = c.data) == null ? void 0 : w.data) != null && N.length) {
|
369
|
+
let j = (B = c.data) == null ? void 0 : B.data.filter((M) => !0);
|
370
|
+
h(j.length);
|
369
371
|
}
|
370
|
-
}, [(C =
|
371
|
-
function
|
372
|
-
var B,
|
373
|
-
(B = w.chain) != null && B.length && ((
|
372
|
+
}, [(C = c.data) == null ? void 0 : C.data]);
|
373
|
+
function re(w, N) {
|
374
|
+
var B, j;
|
375
|
+
(B = w.chain) != null && B.length && ((j = N == null ? void 0 : N.coin) != null && j.length) && s();
|
374
376
|
}
|
375
|
-
function
|
377
|
+
function O() {
|
376
378
|
i(!1);
|
377
379
|
}
|
378
|
-
function
|
380
|
+
function K(w) {
|
379
381
|
T(w), x("");
|
380
382
|
}
|
381
|
-
const { tick:
|
382
|
-
return d ? /* @__PURE__ */ e(
|
383
|
+
const { tick: R, defaultCoin: V } = Ee;
|
384
|
+
return d ? /* @__PURE__ */ e(J1, { handleSetChainData: K, data: (P = c.data) == null ? void 0 : P.data, handleBack: O, network: m }) : /* @__PURE__ */ p(J, { children: [
|
383
385
|
/* @__PURE__ */ p("div", { children: [
|
384
386
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
385
387
|
/* @__PURE__ */ e(
|
@@ -389,17 +391,17 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
389
391
|
s(), (!r.coin.length || !o.chain.length) && (n({ coin: "" }), t({ chain: "" }));
|
390
392
|
},
|
391
393
|
className: "bw-absolute bw-left-0 bw-top-[25%]",
|
392
|
-
children: /* @__PURE__ */ e(
|
394
|
+
children: /* @__PURE__ */ e(t1, { fill: "var(--tw-text-secondary)" })
|
393
395
|
}
|
394
396
|
),
|
395
397
|
/* @__PURE__ */ p("div", { className: "bw-text-base bw-font-normal bw-text-text-secondary", children: [
|
396
|
-
|
398
|
+
b.charAt(0).toUpperCase() + b.slice(1),
|
397
399
|
" Network"
|
398
400
|
] })
|
399
401
|
] }),
|
400
|
-
|
401
|
-
|
402
|
-
var B,
|
402
|
+
c.isLoading ? /* @__PURE__ */ e(L1, { animation: "wave", variant: "rectangular", width: "100%", height: 134, className: "bw-rounded-md bw-flex bw-justify-center bw-bg-transparent bw-opacity-0 bw-items-center bw-text-text-primary" }) : /* @__PURE__ */ p("div", { className: "bw-grid bw-grid-cols-5 bw-gap-1 bw-overflow-y-auto bw-w-full", children: [
|
403
|
+
c.isSuccess && I.map((w, N) => {
|
404
|
+
var B, j;
|
403
405
|
return /* @__PURE__ */ e(
|
404
406
|
"div",
|
405
407
|
{
|
@@ -411,29 +413,29 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
411
413
|
"div",
|
412
414
|
{
|
413
415
|
onClick: () => {
|
414
|
-
let
|
416
|
+
let M = {
|
415
417
|
chain: w.name,
|
416
418
|
...w
|
417
419
|
// networkType: "cosmos",
|
418
420
|
};
|
419
|
-
|
421
|
+
K(M);
|
420
422
|
},
|
421
423
|
className: "bw-p-2 bw-w-full bw-aspect-video bw-relative bw-z-10 bw-bg-background-networkcard bw-rounded-md bw-flex bw-flex-col bw-justify-center bw-items-center",
|
422
424
|
style: { cursor: "pointer" },
|
423
425
|
children: [
|
424
|
-
/* @__PURE__ */ e("img", { src: (B = w.image) != null && B.length ? w.image :
|
426
|
+
/* @__PURE__ */ e("img", { src: (B = w.image) != null && B.length ? w.image : V, width: 25, className: "bw-rounded-[50%] bw-border bw-border-border-primary", height: 25, alt: "img" }),
|
425
427
|
" ",
|
426
|
-
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${m.name == w.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((
|
427
|
-
(m == null ? void 0 : m.chain) == w ? /* @__PURE__ */ e("img", { width: 10, height: 10, src:
|
428
|
+
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${m.name == w.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((j = w.name) == null ? void 0 : j.length) > 7 ? w.name.substring(0, 7) + ".." : w.name }),
|
429
|
+
(m == null ? void 0 : m.chain) == w ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: R }) : /* @__PURE__ */ e(J, {})
|
428
430
|
]
|
429
431
|
},
|
430
|
-
|
432
|
+
N
|
431
433
|
)
|
432
434
|
},
|
433
|
-
|
435
|
+
N
|
434
436
|
);
|
435
437
|
}),
|
436
|
-
|
438
|
+
c.isSuccess && I.length && L > 9 ? /* @__PURE__ */ e("div", { className: "bw-p-[2px] bw-w-full", children: /* @__PURE__ */ p(
|
437
439
|
"div",
|
438
440
|
{
|
439
441
|
onClick: () => {
|
@@ -442,7 +444,7 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
442
444
|
className: "bw-p-2 bw-w-full bw-aspect-video bw-bg-background-networkcard bw-rounded-md bw-flex bw-flex-col bw-justify-center bw-items-center",
|
443
445
|
style: { cursor: "pointer" },
|
444
446
|
children: [
|
445
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-medium bw-text-text-primary", children: ($ = (
|
447
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-medium bw-text-text-primary", children: ($ = (H = c.data) == null ? void 0 : H.data) != null && $.length ? `+${L - 9}` : "0" }),
|
446
448
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-primary", children: "Networks" })
|
447
449
|
]
|
448
450
|
}
|
@@ -472,41 +474,41 @@ function nt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
472
474
|
placeholder: "Search Token Name or Contract Address"
|
473
475
|
}
|
474
476
|
),
|
475
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (
|
477
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (k.isLoading || k.isFetching) && g.length ? /* @__PURE__ */ e("div", { className: " bw-bg-background-container bw-mt-1 bw-mr-1 bw-flex bw-items-center bw-w-[16px] bw-h-[16px]", children: /* @__PURE__ */ e(Z1, {}) }) : g.length ? /* @__PURE__ */ e(
|
476
478
|
"button",
|
477
479
|
{
|
478
480
|
onClick: () => {
|
479
481
|
x("");
|
480
482
|
},
|
481
483
|
className: "bw-mt-1 bw-mr-1",
|
482
|
-
children: /* @__PURE__ */ e(
|
484
|
+
children: /* @__PURE__ */ e(t1, { fill: "var(--tw-text-primary)" })
|
483
485
|
}
|
484
|
-
) : /* @__PURE__ */ e(
|
486
|
+
) : /* @__PURE__ */ e(b1, { fill: "var(--tw-background-secondary)" }) })
|
485
487
|
]
|
486
488
|
}
|
487
489
|
),
|
488
|
-
/* @__PURE__ */ e(
|
490
|
+
/* @__PURE__ */ e(D1, { value: g, handleClosePopup: re, showExchangeList: b, setChainData: t, setCoinData: n, selectChainState: m })
|
489
491
|
] })
|
490
492
|
] });
|
491
493
|
}
|
492
|
-
function
|
494
|
+
function tt({
|
493
495
|
walletDetails: t,
|
494
496
|
handleToDisconnect: n,
|
495
497
|
show: s,
|
496
498
|
networkType: o,
|
497
499
|
handleShowWallet: r,
|
498
|
-
setConnectWalletField:
|
500
|
+
setConnectWalletField: b
|
499
501
|
}) {
|
500
|
-
const [
|
501
|
-
|
502
|
+
const [c, d] = v(null), { address: i, chain: g, data: x, disconnect: k, ...I } = t, [F, L] = v(), { connector: h } = xe(), { connectors: m } = M1(), T = () => {
|
503
|
+
b(s), s == "to" ? (y(), n(!0)) : y();
|
502
504
|
};
|
503
|
-
|
504
|
-
m.length &&
|
505
|
-
|
505
|
+
E1(), A(() => {
|
506
|
+
m.length && L(
|
507
|
+
fe.keyBy(m, (S) => S.uid)
|
506
508
|
);
|
507
509
|
}, [m]);
|
508
510
|
async function y() {
|
509
|
-
o === "evm" && (g == null ? void 0 : g.network) !== "custom" && (
|
511
|
+
o === "evm" && (g == null ? void 0 : g.network) !== "custom" && (F != null && F[h == null ? void 0 : h.uid]), r();
|
510
512
|
}
|
511
513
|
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
|
512
514
|
"button",
|
@@ -521,75 +523,75 @@ function rt({
|
|
521
523
|
/* @__PURE__ */ e(
|
522
524
|
"div",
|
523
525
|
{
|
524
|
-
children: /* @__PURE__ */ e(
|
526
|
+
children: /* @__PURE__ */ e(i1, { fill: "var(--tw-text-secondary)" })
|
525
527
|
}
|
526
528
|
)
|
527
529
|
] }) : /* @__PURE__ */ e("div", { className: "bw-w-[10px] bw-flex bw-text-text-secondary bw-justify-center bw-items-center bw-h-[10px]", children: /* @__PURE__ */ e(Se, { size: 10, thickness: 5, color: "inherit" }) })
|
528
530
|
}
|
529
531
|
) });
|
530
532
|
}
|
531
|
-
function
|
532
|
-
var T, y, S, _,
|
533
|
-
const
|
533
|
+
function o1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConnectWalletField: o, coinData: r, show: b }) {
|
534
|
+
var T, y, S, _, re, O, K, R, V;
|
535
|
+
const c = l((f) => f.configuration), d = l((f) => f.customWallet), { isConnected: i, isConnecting: g, isReconnecting: x } = xe();
|
534
536
|
Be();
|
535
|
-
const { defaultCoin:
|
537
|
+
const { defaultCoin: k } = Ee, { isAnyWalletConnected: I, getWallet: F } = Ie({
|
536
538
|
chainData: t,
|
537
|
-
show:
|
539
|
+
show: b
|
538
540
|
});
|
539
541
|
l((f) => f.toDisconnect), l((f) => f.setToDisconnect);
|
540
|
-
const
|
542
|
+
const L = l((f) => f.fromChain), h = l((f) => f.toChain);
|
541
543
|
function m(f) {
|
542
544
|
}
|
543
545
|
return /* @__PURE__ */ p("div", { className: "bw-w-[50%] ", children: [
|
544
|
-
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-left bw-font-medium bw-mb-1 bw-text-text-secondary", children:
|
546
|
+
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-left bw-font-medium bw-mb-1 bw-text-text-secondary", children: b == "from" ? "Give" : "Get" }),
|
545
547
|
/* @__PURE__ */ p(
|
546
548
|
"div",
|
547
549
|
{
|
548
550
|
style: {
|
549
|
-
boxShadow:
|
551
|
+
boxShadow: c && c.customTheme && ((y = (T = c.customTheme) == null ? void 0 : T.shadow) == null ? void 0 : y.boxShadow) || "1px 1px 7px rgba(0, 0, 0, 0.15)"
|
550
552
|
},
|
551
553
|
className: "bw-w-full bw-h-[78px] bw-pl-4 md:bw-pl-5 bw-flex bw-items-center bw-gap-x-2 md:bw-gap-x-4 bw-bg-background-container bw-rounded-lg bw-border bw-border-border-primary",
|
552
554
|
children: [
|
553
555
|
/* @__PURE__ */ p("div", { className: `bw-w-[36px] bw-h-[36px] bw-flex bw-items-center bw-justify-center bw-rounded-[50%] bw-border bw-border-border-primary bw-relative ${r.image ? "bw-bg-background-secondary" : ""}`, children: [
|
554
|
-
r != null && r.image ? /* @__PURE__ */ e("img", { src: r.image, className: "bw-rounded-[50%] bw-max-w-[35px] bw-max-h-[35px] bw-object-contain", alt: "img", width: 35, height: 35 }) : /* @__PURE__ */ e("img", { src:
|
555
|
-
/* @__PURE__ */ e("div", { className: `bw-w-[21px] bw-h-[21px] bw-border bw-bg-background-secondary bw-border-border-primary bw-absolute bw-bottom-[-2px] bw-right-[-5px] bw-rounded-[50%] ${r.image ? "bw-bg-background-secondary" : ""}`, children: t != null && t.image ? /* @__PURE__ */ e("img", { className: "bw-rounded-[50%]", src: t.image, alt: "img" }) : /* @__PURE__ */ e("img", { className: "bw-rounded-[50%] ", src:
|
556
|
+
r != null && r.image ? /* @__PURE__ */ e("img", { src: r.image, className: "bw-rounded-[50%] bw-max-w-[35px] bw-max-h-[35px] bw-object-contain", alt: "img", width: 35, height: 35 }) : /* @__PURE__ */ e("img", { src: k, className: "bw-rounded-[50%] bw-object-fill ", alt: "img", width: 35, height: 35 }),
|
557
|
+
/* @__PURE__ */ e("div", { className: `bw-w-[21px] bw-h-[21px] bw-border bw-bg-background-secondary bw-border-border-primary bw-absolute bw-bottom-[-2px] bw-right-[-5px] bw-rounded-[50%] ${r.image ? "bw-bg-background-secondary" : ""}`, children: t != null && t.image ? /* @__PURE__ */ e("img", { className: "bw-rounded-[50%]", src: t.image, alt: "img" }) : /* @__PURE__ */ e("img", { className: "bw-rounded-[50%] ", src: k, alt: "img" }) })
|
556
558
|
] }),
|
557
559
|
/* @__PURE__ */ p(
|
558
560
|
"div",
|
559
561
|
{
|
560
562
|
onClick: () => {
|
561
|
-
n(
|
563
|
+
n(b);
|
562
564
|
},
|
563
565
|
className: "bw-cursor-pointer",
|
564
566
|
children: [
|
565
567
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-min-w-[78px] bw-min-h-[28px] bw-items-center bw-gap-x-2", children: [
|
566
568
|
(S = r == null ? void 0 : r.coin) != null && S.length ? /* @__PURE__ */ e("p", { className: "bw-text-xl bw-font-bold bw-text-text-primary", children: r.coin }) : /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-text-primary bw-font-bold", children: "Select Token" }),
|
567
|
-
/* @__PURE__ */ e(
|
569
|
+
/* @__PURE__ */ e(H1, { fill: (_ = r == null ? void 0 : r.coin) != null && _.length ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" })
|
568
570
|
] }),
|
569
|
-
(
|
571
|
+
(re = t == null ? void 0 : t.chain) != null && re.length ? /* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: `on ${t.chain}`.length > 12 ? `on ${t.chain.substring(0, 12)}..` : `on ${t.chain}` }) : /* @__PURE__ */ e("p", { className: "bw-text-sm bw-font-bold bw-text-text-primary", children: "& Chain" })
|
570
572
|
]
|
571
573
|
}
|
572
574
|
)
|
573
575
|
]
|
574
576
|
}
|
575
577
|
),
|
576
|
-
/* @__PURE__ */ e(
|
578
|
+
/* @__PURE__ */ e(nt, { isConnected: b == "to" ? (L == null ? void 0 : L.networkType) === (h == null ? void 0 : h.networkType) ? !!((K = (O = F(L)) == null ? void 0 : O.address) != null && K.length || (d == null ? void 0 : d.length) > 30) : !!((V = (R = F(h)) == null ? void 0 : R.address) != null && V.length || (d == null ? void 0 : d.length) > 30) : I, setConnectWalletField: o, handleShowWallet: s, show: b, chainData: t, handleToDisconnect: m })
|
577
579
|
] });
|
578
580
|
}
|
579
|
-
function
|
581
|
+
function nt({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, show: o, chainData: r, handleToDisconnect: b }) {
|
580
582
|
var x;
|
581
|
-
const
|
583
|
+
const c = l((k) => k.customWallet), d = l((k) => k.fromChain), i = l((k) => k.toChain), { getWallet: g } = Ie({
|
582
584
|
chainData: r,
|
583
585
|
show: o
|
584
586
|
});
|
585
587
|
return /* @__PURE__ */ e("div", { className: "bw-mt-2 bw-flex bw-justify-end", children: t ? /* @__PURE__ */ e(
|
586
|
-
|
588
|
+
tt,
|
587
589
|
{
|
588
|
-
walletDetails: (
|
589
|
-
disconnect:
|
590
|
+
walletDetails: (c == null ? void 0 : c.length) > 30 && o == "to" ? g({}) : (d == null ? void 0 : d.networkType) == (i == null ? void 0 : i.networkType) && o == "to" ? {
|
591
|
+
disconnect: b,
|
590
592
|
address: (x = g(d)) == null ? void 0 : x.address
|
591
593
|
} : g(r),
|
592
|
-
handleToDisconnect:
|
594
|
+
handleToDisconnect: b,
|
593
595
|
show: o,
|
594
596
|
networkType: r == null ? void 0 : r.networkType,
|
595
597
|
setConnectWalletField: n,
|
@@ -604,17 +606,17 @@ function ot({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, sho
|
|
604
606
|
className: "bw-mb-1 bw-relative bw-min-w-[100px] bw-flex bw-justify-center bw-items-center bw-gap-x-1 bw-w-[84px] bw-h-[25px] bw-text-xs bw-font-medium bw-px-2 bw-rounded-xl bw-border bw-border-border-primary bw-bg-background-container bw-text-text-primary",
|
605
607
|
children: [
|
606
608
|
/* @__PURE__ */ e("p", { className: "bw-mr-3", children: "Connect" }),
|
607
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2", children: /* @__PURE__ */ e(
|
609
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2", children: /* @__PURE__ */ e(i1, { fill: "var(--tw-text-secondary)" }) })
|
608
610
|
]
|
609
611
|
}
|
610
612
|
) });
|
611
613
|
}
|
612
|
-
const
|
613
|
-
gradient:
|
614
|
+
const rt = "_gradient_15zwe_1", Ze = {
|
615
|
+
gradient: rt
|
614
616
|
};
|
615
|
-
function
|
617
|
+
function st({ mode: t, handleMode: n }) {
|
616
618
|
var o, r;
|
617
|
-
const s = l((
|
619
|
+
const s = l((b) => b.configuration);
|
618
620
|
return /* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center", children: /* @__PURE__ */ p(
|
619
621
|
"div",
|
620
622
|
{
|
@@ -681,7 +683,7 @@ function at({ mode: t, handleMode: n }) {
|
|
681
683
|
}
|
682
684
|
) });
|
683
685
|
}
|
684
|
-
function
|
686
|
+
function ot({ fill: t }) {
|
685
687
|
return /* @__PURE__ */ e(
|
686
688
|
"svg",
|
687
689
|
{
|
@@ -702,43 +704,43 @@ function it({ fill: t }) {
|
|
702
704
|
}
|
703
705
|
);
|
704
706
|
}
|
705
|
-
function
|
706
|
-
var r,
|
707
|
+
function w1({ options: t, handleOptions: n }) {
|
708
|
+
var r, b;
|
707
709
|
const s = [
|
708
710
|
{ name: "Medium", value: "medium" },
|
709
711
|
{ name: "High", value: "high" },
|
710
712
|
{ name: "Degen", value: "ultra" }
|
711
|
-
], o = l((
|
713
|
+
], o = l((c) => c.configuration);
|
712
714
|
return /* @__PURE__ */ p("div", { className: "bw-mt-5 bw-flex bw-items-center bw-justify-between", children: [
|
713
715
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: "Speed" }),
|
714
716
|
/* @__PURE__ */ e(
|
715
717
|
"div",
|
716
718
|
{
|
717
719
|
style: {
|
718
|
-
boxShadow: o && o.customTheme && ((
|
720
|
+
boxShadow: o && o.customTheme && ((b = (r = o.customTheme) == null ? void 0 : r.shadow) == null ? void 0 : b.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
719
721
|
},
|
720
722
|
className: "bw-flex bw-border bw-bg-background-container bw-w-[70%] md:bw-w-[60%] bw-h-[40px] bw-rounded-md bw-border-border-primary bw-items-center bw-justify-between",
|
721
|
-
children: s.map((
|
723
|
+
children: s.map((c, d, i) => /* @__PURE__ */ p(
|
722
724
|
"button",
|
723
725
|
{
|
724
726
|
onClick: () => {
|
725
|
-
t.value ==
|
727
|
+
t.value == c.value ? n(
|
726
728
|
{
|
727
729
|
name: "",
|
728
730
|
value: ""
|
729
731
|
},
|
730
732
|
!1
|
731
|
-
) : n(
|
733
|
+
) : n(c, !0);
|
732
734
|
},
|
733
735
|
className: `
|
734
736
|
bw-flex bw-flex-1 bw-relative bw-h-full bw-rounded-md bw-gap-x-1 bw-justify-center bw-items-center `,
|
735
737
|
children: [
|
736
|
-
|
738
|
+
c.value === "ultra" ? /* @__PURE__ */ e(ot, { fill: c.value === t.value ? "var(--tw-text-primary)" : "var(--tw-text-secondary)" }) : /* @__PURE__ */ e(J, {}),
|
737
739
|
/* @__PURE__ */ e(
|
738
740
|
"p",
|
739
741
|
{
|
740
|
-
className: ` bw-text-center ${
|
741
|
-
children:
|
742
|
+
className: ` bw-text-center ${c.value === t.value ? "bw-font-bold bw-text-xs bw-text-text-primary" : "bw-text-xs font-normal bw-text-text-secondary "}`,
|
743
|
+
children: c.name
|
742
744
|
}
|
743
745
|
),
|
744
746
|
i.length - 1 !== d && /* @__PURE__ */ e("div", { className: "bw-h-[70%] bw-absolute bw-right-0 bw-w-[1px] bw-border bw-border-border-primary" }),
|
@@ -751,7 +753,7 @@ function u1({ options: t, handleOptions: n }) {
|
|
751
753
|
},
|
752
754
|
className: `bw-w-full
|
753
755
|
|
754
|
-
${
|
756
|
+
${c.value === t.value ? "bw-opacity-100" : "bw-opacity-0"} bw-absolute bw-bottom-0 bw-h-[2px] bw-rounded-md ${!(o != null && o.gradientStyle) && Ze.gradient}`
|
755
757
|
}
|
756
758
|
)
|
757
759
|
]
|
@@ -761,7 +763,7 @@ function u1({ options: t, handleOptions: n }) {
|
|
761
763
|
)
|
762
764
|
] });
|
763
765
|
}
|
764
|
-
function
|
766
|
+
function u1(t) {
|
765
767
|
const n = [
|
766
768
|
"Tab",
|
767
769
|
"Enter",
|
@@ -775,8 +777,8 @@ function m1(t) {
|
|
775
777
|
];
|
776
778
|
/^\d$/.test(t.key) || n.includes(t.key) || t.preventDefault();
|
777
779
|
}
|
778
|
-
function
|
779
|
-
var
|
780
|
+
function m1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
781
|
+
var b, c;
|
780
782
|
const r = l((d) => d.configuration);
|
781
783
|
return /* @__PURE__ */ p("div", { className: "bw-mt-5 bw-flex bw-items-center bw-justify-between bw-gap-x-3 bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
782
784
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal", children: s }),
|
@@ -784,7 +786,7 @@ function p1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
784
786
|
"div",
|
785
787
|
{
|
786
788
|
style: {
|
787
|
-
boxShadow: r && r.customTheme && ((
|
789
|
+
boxShadow: r && r.customTheme && ((c = (b = r.customTheme) == null ? void 0 : b.shadow) == null ? void 0 : c.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
788
790
|
},
|
789
791
|
className: "bw-h-[40px] bw-w-[70%] md:bw-w-[60%] bw-flex bw-rounded-md bw-border bw-border-border-primary bw-bg-background-container bw-p-1 bw-text-text-primary",
|
790
792
|
children: [
|
@@ -796,7 +798,7 @@ function p1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
796
798
|
value: t,
|
797
799
|
onChange: n,
|
798
800
|
onKeyDown: (d) => {
|
799
|
-
|
801
|
+
u1(d);
|
800
802
|
}
|
801
803
|
}
|
802
804
|
),
|
@@ -809,7 +811,7 @@ function p1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
809
811
|
)
|
810
812
|
] });
|
811
813
|
}
|
812
|
-
function
|
814
|
+
function p1({ handleSave: t, isSaveButtonDisabled: n }) {
|
813
815
|
const s = l((o) => o.configuration);
|
814
816
|
return l((o) => o.slippage), /* @__PURE__ */ e(
|
815
817
|
"div",
|
@@ -827,11 +829,11 @@ function g1({ handleSave: t, isSaveButtonDisabled: n }) {
|
|
827
829
|
}
|
828
830
|
);
|
829
831
|
}
|
830
|
-
function
|
832
|
+
function g1({ handleClose: t }) {
|
831
833
|
return /* @__PURE__ */ p("div", { className: "bw-w-full bw-relative bw-flex bw-items-center bw-justify-center", children: [
|
832
834
|
/* @__PURE__ */ e("h2", { className: "bw-text-2xl bw-font-bold bw-text-text-primary", children: "Config" }),
|
833
835
|
/* @__PURE__ */ e(
|
834
|
-
|
836
|
+
_1,
|
835
837
|
{
|
836
838
|
disableRipple: !0,
|
837
839
|
onClick: t,
|
@@ -841,9 +843,9 @@ function f1({ handleClose: t }) {
|
|
841
843
|
)
|
842
844
|
] });
|
843
845
|
}
|
844
|
-
function
|
846
|
+
function f1({ slippage: t, handleSlippage: n }) {
|
845
847
|
var o, r;
|
846
|
-
const s = l((
|
848
|
+
const s = l((b) => b.configuration);
|
847
849
|
return /* @__PURE__ */ p("div", { className: "bw-flex bw-items-center bw-justify-between", children: [
|
848
850
|
/* @__PURE__ */ e("p", { className: "bw-text-lg bw-font-normal bw-text-text-primary", children: "Max Slippage" }),
|
849
851
|
/* @__PURE__ */ p(
|
@@ -858,20 +860,20 @@ function x1({ slippage: t, handleSlippage: n }) {
|
|
858
860
|
/* @__PURE__ */ e(
|
859
861
|
"input",
|
860
862
|
{
|
861
|
-
onKeyUp: (
|
862
|
-
|
863
|
+
onKeyUp: (b) => {
|
864
|
+
b.key === "Enter" && b.target.blur();
|
863
865
|
},
|
864
|
-
onFocus: (
|
865
|
-
|
866
|
+
onFocus: (b) => {
|
867
|
+
b.target.parentElement.style.border = "1px solid var(--tw-text-primary)", b.target.parentElement.style.fontWeight = 600;
|
866
868
|
},
|
867
|
-
onBlur: (
|
868
|
-
|
869
|
+
onBlur: (b) => {
|
870
|
+
b.target.parentElement.style.border = "1px solid var(--tw-border-primary)", b.target.parentElement.style.fontWeight = 400;
|
869
871
|
},
|
870
872
|
value: t,
|
871
873
|
onChange: n,
|
872
874
|
type: "number",
|
873
|
-
onKeyDown: (
|
874
|
-
|
875
|
+
onKeyDown: (b) => {
|
876
|
+
u1(b);
|
875
877
|
},
|
876
878
|
className: "bw-bg-transparent bw-border-none bw-text-text-primary bw-pl-2 bw-text-right bw-w-[80%]"
|
877
879
|
}
|
@@ -882,57 +884,57 @@ function x1({ slippage: t, handleSlippage: n }) {
|
|
882
884
|
)
|
883
885
|
] });
|
884
886
|
}
|
885
|
-
function
|
887
|
+
function x1() {
|
886
888
|
return /* @__PURE__ */ p("div", { className: "bw-flex bw-gap-x-5 bw-items-center ", children: [
|
887
889
|
/* @__PURE__ */ e("h2", { className: "bw-text-lg bw-font-normal bw-text-text-primary", children: "Transaction Fee" }),
|
888
890
|
/* @__PURE__ */ e("div", { className: "bw-h-[1px] bw-flex-1 bw-bg-border-primary " })
|
889
891
|
] });
|
890
892
|
}
|
891
|
-
function
|
892
|
-
const [n, s] =
|
893
|
+
function at({ handleClose: t }) {
|
894
|
+
const [n, s] = v(""), [o, r] = v({ name: "Low", value: "low" }), [b, c] = v(""), [d, i] = v(""), [g, x] = v(""), k = l((f) => f.broadCastMode), I = l((f) => f.customFee), F = l((f) => f.setCustomFee), L = l((f) => f.slippage), h = l((f) => f.setSlippage), m = l((f) => f.setBroadCastMode), T = l((f) => f.option), y = l((f) => f.setOption), S = n == I && T.name == o.name && L == g && (d === k && d !== "" || !n.length && !T.name.length);
|
893
895
|
function _(f) {
|
894
|
-
|
896
|
+
c(""), s(f.target.value);
|
895
897
|
}
|
896
|
-
function
|
897
|
-
|
898
|
+
function re(f, C) {
|
899
|
+
c(""), r(f);
|
898
900
|
}
|
899
|
-
|
901
|
+
A(() => {
|
900
902
|
r(T);
|
901
|
-
}, [T]),
|
902
|
-
|
903
|
-
}, [
|
904
|
-
function
|
903
|
+
}, [T]), A(() => {
|
904
|
+
I != null && I.length ? s(I) : s("");
|
905
|
+
}, [I]);
|
906
|
+
function O() {
|
905
907
|
y(o);
|
906
908
|
}
|
907
|
-
|
908
|
-
x(
|
909
|
+
A(() => {
|
910
|
+
x(L);
|
909
911
|
}, [h]);
|
910
|
-
function
|
912
|
+
function K(f) {
|
911
913
|
x(f.target.value);
|
912
914
|
}
|
913
|
-
|
914
|
-
i(
|
915
|
-
}, [
|
916
|
-
function
|
915
|
+
A(() => {
|
916
|
+
i(k);
|
917
|
+
}, [k]);
|
918
|
+
function R() {
|
917
919
|
if (d == "" && (n.length || o.name.length)) {
|
918
|
-
m(""),
|
920
|
+
m(""), c("Please select a mode");
|
919
921
|
return;
|
920
922
|
}
|
921
|
-
n.length ? (
|
923
|
+
n.length ? (F(n), y(o)) : (F(""), O()), m(d), h(g), t();
|
922
924
|
}
|
923
|
-
function
|
924
|
-
|
925
|
+
function V(f) {
|
926
|
+
c(""), i(f);
|
925
927
|
}
|
926
|
-
return
|
927
|
-
|
928
|
-
}, [
|
929
|
-
/* @__PURE__ */ e(
|
930
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(
|
931
|
-
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(
|
932
|
-
/* @__PURE__ */ e(
|
933
|
-
/* @__PURE__ */ e(
|
928
|
+
return A(() => {
|
929
|
+
!I && !T.name.length && (m(""), i(""));
|
930
|
+
}, [I, T.name]), /* @__PURE__ */ p("div", { className: "bw-w-full md:bw-w-[443px] bw-h-[447px] bw-rounded-lg bw-border bw-p-3 px-4 md:bw-px-6 bw-border-border-primary bw-text-white bw-bg-background-container", children: [
|
931
|
+
/* @__PURE__ */ e(g1, { handleClose: t }),
|
932
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(f1, { slippage: g, handleSlippage: K }) }),
|
933
|
+
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(x1, {}) }),
|
934
|
+
/* @__PURE__ */ e(st, { mode: d, handleMode: V }),
|
935
|
+
/* @__PURE__ */ e(w1, { options: o, handleOptions: re }),
|
934
936
|
/* @__PURE__ */ e(
|
935
|
-
|
937
|
+
m1,
|
936
938
|
{
|
937
939
|
title: "Max Cap",
|
938
940
|
inputSideText: "SOL",
|
@@ -941,46 +943,46 @@ function lt({ handleClose: t }) {
|
|
941
943
|
}
|
942
944
|
),
|
943
945
|
/* @__PURE__ */ p("div", { className: "bw-relative", children: [
|
944
|
-
/* @__PURE__ */ e("p", { className: "bw-w-full bw-absolute bw-text-center -bw-top-5 bw-text-xs bw-text-text-redtext", children:
|
946
|
+
/* @__PURE__ */ e("p", { className: "bw-w-full bw-absolute bw-text-center -bw-top-5 bw-text-xs bw-text-text-redtext", children: b }),
|
945
947
|
/* @__PURE__ */ e(
|
946
|
-
|
948
|
+
p1,
|
947
949
|
{
|
948
|
-
handleSave:
|
950
|
+
handleSave: R,
|
949
951
|
isSaveButtonDisabled: S
|
950
952
|
}
|
951
953
|
)
|
952
954
|
] })
|
953
955
|
] });
|
954
956
|
}
|
955
|
-
function
|
956
|
-
const [n, s] =
|
957
|
-
function
|
957
|
+
function it({ handleClose: t }) {
|
958
|
+
const [n, s] = v({ name: "Low", value: "low" }), [o, r] = v(""), [b, c] = v(""), d = l((y) => y.setEvmGas), i = l((y) => y.setEvmSpeed), g = l((y) => y.evmSpeed), x = l((y) => y.evmGas), k = l((y) => y.slippage), I = l((y) => y.setSlippage), F = o == x && g.name == n.name && k == b;
|
959
|
+
function L(y, S) {
|
958
960
|
s(y);
|
959
961
|
}
|
960
962
|
function h(y) {
|
961
963
|
r(y.target.value);
|
962
964
|
}
|
963
|
-
|
965
|
+
A(() => {
|
964
966
|
s(g);
|
965
|
-
}, []),
|
967
|
+
}, []), A(() => {
|
966
968
|
x != null && x.length ? r(x) : r("");
|
967
969
|
}, [x]);
|
968
970
|
function m() {
|
969
|
-
o.length ? (d(o), i(n)) : (d(""), i(n)),
|
971
|
+
o.length ? (d(o), i(n)) : (d(""), i(n)), I(b), t();
|
970
972
|
}
|
971
|
-
|
972
|
-
|
973
|
-
}, [
|
973
|
+
A(() => {
|
974
|
+
c(k);
|
975
|
+
}, [I]);
|
974
976
|
function T(y) {
|
975
|
-
|
977
|
+
c(y.target.value);
|
976
978
|
}
|
977
979
|
return /* @__PURE__ */ p("div", { className: "bw-w-full md:bw-w-[443px] bw-h-[396px] bw-rounded-md bw-border bw-p-3 bw-border-border-primary bw-text-white bw-bg-background-container", children: [
|
978
|
-
/* @__PURE__ */ e(
|
979
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(
|
980
|
-
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(
|
981
|
-
/* @__PURE__ */ e(
|
980
|
+
/* @__PURE__ */ e(g1, { handleClose: t }),
|
981
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(f1, { slippage: b, handleSlippage: T }) }),
|
982
|
+
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(x1, {}) }),
|
983
|
+
/* @__PURE__ */ e(w1, { options: n, handleOptions: L }),
|
982
984
|
/* @__PURE__ */ e(
|
983
|
-
|
985
|
+
m1,
|
984
986
|
{
|
985
987
|
title: "Gas Price",
|
986
988
|
inputSideText: "GWEI",
|
@@ -989,18 +991,18 @@ function ct({ handleClose: t }) {
|
|
989
991
|
}
|
990
992
|
),
|
991
993
|
/* @__PURE__ */ e(
|
992
|
-
|
994
|
+
p1,
|
993
995
|
{
|
994
996
|
handleSave: m,
|
995
|
-
isSaveButtonDisabled:
|
997
|
+
isSaveButtonDisabled: F
|
996
998
|
}
|
997
999
|
)
|
998
1000
|
] });
|
999
1001
|
}
|
1000
|
-
function
|
1002
|
+
function lt({ open: t, handleClose: n }) {
|
1001
1003
|
const s = l((r) => r.fromChain);
|
1002
1004
|
return /* @__PURE__ */ e(
|
1003
|
-
|
1005
|
+
F1,
|
1004
1006
|
{
|
1005
1007
|
open: t,
|
1006
1008
|
disablePortal: !0,
|
@@ -1015,11 +1017,11 @@ function bt({ open: t, handleClose: n }) {
|
|
1015
1017
|
// left: "47%",
|
1016
1018
|
// transform: "translate(-50%, -50%)",
|
1017
1019
|
bgcolor: "var(--tw-bg-container)"
|
1018
|
-
}, children: s.networkType == "sol" ? /* @__PURE__ */ e(
|
1020
|
+
}, children: s.networkType == "sol" ? /* @__PURE__ */ e(at, { handleClose: n }) : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(it, { handleClose: n }) }) })
|
1019
1021
|
}
|
1020
1022
|
);
|
1021
1023
|
}
|
1022
|
-
function
|
1024
|
+
function ct({ fill: t }) {
|
1023
1025
|
return /* @__PURE__ */ p(
|
1024
1026
|
"svg",
|
1025
1027
|
{
|
@@ -1058,7 +1060,7 @@ function dt({ fill: t }) {
|
|
1058
1060
|
}
|
1059
1061
|
);
|
1060
1062
|
}
|
1061
|
-
function
|
1063
|
+
function bt() {
|
1062
1064
|
const t = l((o) => o.configuration), n = t == null ? void 0 : t.headingStyles, s = (t == null ? void 0 : t.headingText) || "";
|
1063
1065
|
return s.length ? /* @__PURE__ */ e(
|
1064
1066
|
"span",
|
@@ -1076,7 +1078,7 @@ function wt() {
|
|
1076
1078
|
"Y.exchange"
|
1077
1079
|
] });
|
1078
1080
|
}
|
1079
|
-
function
|
1081
|
+
function dt() {
|
1080
1082
|
const t = l((s) => s.configuration), n = t == null ? void 0 : t.headingContainerStyles;
|
1081
1083
|
return /* @__PURE__ */ e(
|
1082
1084
|
"div",
|
@@ -1105,170 +1107,170 @@ function ut() {
|
|
1105
1107
|
paddingLeft: "10px",
|
1106
1108
|
...n
|
1107
1109
|
},
|
1108
|
-
children: /* @__PURE__ */ e(
|
1110
|
+
children: /* @__PURE__ */ e(bt, {})
|
1109
1111
|
}
|
1110
1112
|
);
|
1111
1113
|
}
|
1112
|
-
function
|
1113
|
-
const [t, n] =
|
1114
|
+
function wt() {
|
1115
|
+
const [t, n] = v(!1), s = l((r) => r.fromChain);
|
1114
1116
|
function o() {
|
1115
1117
|
n(!1);
|
1116
1118
|
}
|
1117
1119
|
return /* @__PURE__ */ p(J, { children: [
|
1118
1120
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-w-full -bw-mt-2 bw-mb-3 bw-items-center bw-justify-end", children: [
|
1119
|
-
/* @__PURE__ */ e(
|
1121
|
+
/* @__PURE__ */ e(dt, {}),
|
1120
1122
|
/* @__PURE__ */ e(
|
1121
1123
|
"div",
|
1122
1124
|
{
|
1123
1125
|
onClick: () => (s == null ? void 0 : s.networkType) !== "cosmos" && n(!0),
|
1124
1126
|
className: "bw-flex bw-relative bw-right-0 bw-items-center bw-gap-x-2",
|
1125
|
-
children: /* @__PURE__ */ e(
|
1127
|
+
children: /* @__PURE__ */ e(G1, { classnames: " ", children: /* @__PURE__ */ e(ct, { fill: "var(--tw-text-secondary)" }) })
|
1126
1128
|
}
|
1127
1129
|
)
|
1128
1130
|
] }),
|
1129
|
-
/* @__PURE__ */ e(
|
1131
|
+
/* @__PURE__ */ e(lt, { open: t, handleClose: o })
|
1130
1132
|
] });
|
1131
1133
|
}
|
1132
|
-
let
|
1133
|
-
function
|
1134
|
-
const [
|
1135
|
-
|
1136
|
-
t && clearInterval(
|
1137
|
-
}, [t]),
|
1134
|
+
let a1, Fe, ve, Me = 0;
|
1135
|
+
function ut({ confirmRoute: t, setConfirmRoute: n, routes: s, routesData: o, isRoutesEnabled: r, fetchBalance: b }) {
|
1136
|
+
const [c, d] = v(0), { getWallet: i } = Ie({}), g = l((h) => h.fromChain), x = i(g), { isConnected: k } = xe();
|
1137
|
+
A(() => {
|
1138
|
+
t && clearInterval(ve);
|
1139
|
+
}, [t]), A(() => {
|
1138
1140
|
var h;
|
1139
|
-
|
1140
|
-
}, [
|
1141
|
+
c === 0 && document.visibilityState === "visible" && !t && r && ((h = x.address) != null && h.length && b.refetch(), s.refetch());
|
1142
|
+
}, [c, t, r]), A(() => {
|
1141
1143
|
s.isFetching && (Me = 0);
|
1142
|
-
}, [s.isFetching]),
|
1143
|
-
if (!
|
1144
|
+
}, [s.isFetching]), A(() => {
|
1145
|
+
if (!fe.isEmpty(o)) {
|
1144
1146
|
const h = Math.max(0, o.deadline - Me);
|
1145
1147
|
d(h);
|
1146
1148
|
}
|
1147
1149
|
return () => {
|
1148
1150
|
d(0);
|
1149
1151
|
};
|
1150
|
-
}, [o]),
|
1151
|
-
document.removeEventListener("visibilitychange",
|
1152
|
+
}, [o]), A(() => (fe.isEmpty(o) || document.addEventListener("visibilitychange", L), () => {
|
1153
|
+
document.removeEventListener("visibilitychange", L);
|
1152
1154
|
}), [o]);
|
1153
|
-
function
|
1154
|
-
|
1155
|
+
function I() {
|
1156
|
+
a1 = Date.now(), d((h) => (Fe = h, h));
|
1155
1157
|
}
|
1156
|
-
function
|
1157
|
-
let h = Date.now(), m = Math.round((h -
|
1158
|
+
function F() {
|
1159
|
+
let h = Date.now(), m = Math.round((h - a1) / 1e3);
|
1158
1160
|
o.deadline - Fe + m > o.deadline ? n((T) => {
|
1159
1161
|
var y;
|
1160
|
-
return
|
1162
|
+
return T || ((y = x.address) != null && y.length && b.refetch(), s.refetch(), d(o.deadline)), T;
|
1161
1163
|
}) : Fe && m && d(Fe - m);
|
1162
1164
|
}
|
1163
|
-
function
|
1164
|
-
document.visibilityState === "visible" ?
|
1165
|
+
function L() {
|
1166
|
+
document.visibilityState === "visible" ? F() : I();
|
1165
1167
|
}
|
1166
|
-
return
|
1168
|
+
return A(() => (fe.isEmpty(o) ? ve && clearInterval(ve) : ve = setInterval(() => {
|
1167
1169
|
d((h) => h <= 0 ? (Me = 0, o.deadline) : (Me++, h - 1));
|
1168
1170
|
}, 1e3), () => {
|
1169
|
-
|
1170
|
-
}), [o]), l((h) => h.timerValue), { quoteTimer:
|
1171
|
+
ve && clearInterval(ve);
|
1172
|
+
}), [o]), l((h) => h.timerValue), { quoteTimer: c, setQuoteTimer: d };
|
1171
1173
|
}
|
1172
|
-
function
|
1173
|
-
const { primaryWallet: o } = Be(), [r,
|
1174
|
+
function mt(t, n, s) {
|
1175
|
+
const { primaryWallet: o } = Be(), [r, b] = v(0), c = async (d) => {
|
1174
1176
|
if (!o) return;
|
1175
|
-
const i = new
|
1177
|
+
const i = new ze(d || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed");
|
1176
1178
|
if (i)
|
1177
1179
|
try {
|
1178
1180
|
const g = new we(o.address);
|
1179
|
-
i.onAccountChange(g, (
|
1180
|
-
|
1181
|
+
i.onAccountChange(g, (I) => {
|
1182
|
+
b(I.lamports / 1e9);
|
1181
1183
|
});
|
1182
|
-
const
|
1183
|
-
|
1184
|
-
} catch
|
1185
|
-
|
1184
|
+
const k = await i.getBalance(g) / 1e9;
|
1185
|
+
b(k), s(!1);
|
1186
|
+
} catch {
|
1187
|
+
s(!1);
|
1186
1188
|
}
|
1187
1189
|
};
|
1188
|
-
return
|
1189
|
-
(t == null ? void 0 : t.networkType) === "sol" &&
|
1190
|
-
}, [t == null ? void 0 : t.networkType, o, t == null ? void 0 : t.chainId, o == null ? void 0 : o.address]), { balanceSol: r, getBalanceSol:
|
1190
|
+
return A(() => {
|
1191
|
+
(t == null ? void 0 : t.networkType) === "sol" && c((t == null ? void 0 : t.chainId) === "eclipse-svm" ? "https://eclipse.lgns.net/" : null);
|
1192
|
+
}, [t == null ? void 0 : t.networkType, o, t == null ? void 0 : t.chainId, o == null ? void 0 : o.address]), { balanceSol: r, getBalanceSol: c };
|
1191
1193
|
}
|
1192
|
-
function
|
1194
|
+
function pt(t) {
|
1193
1195
|
return t == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ? "" : t;
|
1194
1196
|
}
|
1195
|
-
const
|
1197
|
+
const gt = new we("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), ft = new we("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
1196
1198
|
new we("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
1197
1199
|
new we("So11111111111111111111111111111111111111112");
|
1198
1200
|
new we("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
1199
|
-
async function
|
1201
|
+
async function xt(t, n) {
|
1200
1202
|
if (!t) return;
|
1201
|
-
const s = new
|
1202
|
-
programId: n ?
|
1203
|
+
const s = new ze(n || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed"), o = new we(t), r = await s.getParsedTokenAccountsByOwner(o, {
|
1204
|
+
programId: n ? ft : gt
|
1203
1205
|
});
|
1204
|
-
let
|
1205
|
-
for (const { account:
|
1206
|
-
const d =
|
1207
|
-
|
1206
|
+
let b = {};
|
1207
|
+
for (const { account: c } of r.value) {
|
1208
|
+
const d = c.data.parsed.info.mint, i = c.data.parsed.info.tokenAmount.uiAmount;
|
1209
|
+
b[d] = i;
|
1208
1210
|
}
|
1209
|
-
return
|
1211
|
+
return b;
|
1210
1212
|
}
|
1211
|
-
const
|
1213
|
+
const ht = "0000000000000000000000000000000000", yt = async (t) => {
|
1212
1214
|
try {
|
1213
1215
|
const n = await tronWeb.trx.getBalance(t);
|
1214
1216
|
return { balance: tronWeb.fromSun(n) };
|
1215
1217
|
} catch (n) {
|
1216
|
-
throw
|
1218
|
+
throw n;
|
1217
1219
|
}
|
1218
1220
|
};
|
1219
|
-
async function
|
1221
|
+
async function Ct(t, n) {
|
1220
1222
|
try {
|
1221
|
-
if (n ===
|
1222
|
-
return
|
1223
|
+
if (n === ht)
|
1224
|
+
return yt(t);
|
1223
1225
|
const s = await tronWeb.contract().at(n), o = await s.balanceOf(t).call(), r = await s.decimals().call();
|
1224
|
-
return
|
1226
|
+
return {
|
1225
1227
|
balance: Number(o) / Math.pow(10, Number(r)),
|
1226
1228
|
contractAddress: n,
|
1227
1229
|
decimals: r.toString()
|
1228
1230
|
};
|
1229
1231
|
} catch (s) {
|
1230
|
-
throw
|
1232
|
+
throw s;
|
1231
1233
|
}
|
1232
1234
|
}
|
1233
|
-
function
|
1234
|
-
const [s, o] =
|
1235
|
-
chainId:
|
1235
|
+
function vt(t, n) {
|
1236
|
+
const [s, o] = v(0), { primaryWallet: r, setPrimaryWallet: b } = Be(), [c, d] = v(!1), i = l((w) => w.fromChain), { address: g, isConnected: x } = xe(), { address: k, isConnected: I } = Ve(), F = l((w) => w.cosmosChainIds), { data: L, isConnected: h } = Oe({
|
1237
|
+
chainId: F,
|
1236
1238
|
multiChain: !0
|
1237
|
-
}), m = l((w) => w.fromCoin), { data: T, isLoading: y } =
|
1239
|
+
}), m = l((w) => w.fromCoin), { data: T, isLoading: y } = O1({
|
1238
1240
|
address: g,
|
1239
|
-
token:
|
1241
|
+
token: pt((m == null ? void 0 : m.address) || ""),
|
1240
1242
|
chainId: Number((i == null ? void 0 : i.chainId) || 0),
|
1241
1243
|
enabled: !!((i.networkType == "evm" || n) && g && (g != null && g.length))
|
1242
1244
|
}), {
|
1243
1245
|
data: S,
|
1244
1246
|
isLoading: _,
|
1245
|
-
isFetching:
|
1246
|
-
isInitialLoading:
|
1247
|
-
isRefetching:
|
1248
|
-
} =
|
1247
|
+
isFetching: re,
|
1248
|
+
isInitialLoading: O,
|
1249
|
+
isRefetching: K
|
1250
|
+
} = c1({
|
1249
1251
|
chainId: [i.chainId],
|
1250
1252
|
multiChain: !0
|
1251
1253
|
});
|
1252
|
-
async function
|
1254
|
+
async function R(w) {
|
1253
1255
|
if (!r) return;
|
1254
|
-
const
|
1255
|
-
if (
|
1256
|
+
const N = new ze(w || "https://solana-rpc.publicnode.com");
|
1257
|
+
if (N)
|
1256
1258
|
try {
|
1257
1259
|
const B = new we(r.address);
|
1258
1260
|
d(!0);
|
1259
|
-
const
|
1260
|
-
o(
|
1261
|
+
const M = await N.getBalance(B) / 1e9;
|
1262
|
+
o(M), d(!1);
|
1261
1263
|
} catch {
|
1262
1264
|
d(!1);
|
1263
1265
|
}
|
1264
1266
|
}
|
1265
|
-
async function
|
1267
|
+
async function V(w) {
|
1266
1268
|
try {
|
1267
1269
|
d(!0);
|
1268
|
-
let
|
1269
|
-
|
1270
|
-
} catch
|
1271
|
-
|
1270
|
+
let N = await xt(r.address, w);
|
1271
|
+
d(!1), o(N == null ? void 0 : N[m == null ? void 0 : m.address]);
|
1272
|
+
} catch {
|
1273
|
+
d(!1);
|
1272
1274
|
}
|
1273
1275
|
}
|
1274
1276
|
let f;
|
@@ -1276,18 +1278,18 @@ function Nt(t, n) {
|
|
1276
1278
|
if (!r) return;
|
1277
1279
|
const w = await r.connector.getPublicClient();
|
1278
1280
|
if (!w) return;
|
1279
|
-
const
|
1280
|
-
|
1281
|
-
var
|
1281
|
+
const N = new we(r.address);
|
1282
|
+
N && (f = w.onAccountChange(N, (B) => {
|
1283
|
+
var j;
|
1282
1284
|
if (i.networkType == "sol" && (r != null && r.address))
|
1283
|
-
if (((
|
1284
|
-
|
1285
|
+
if (((j = m == null ? void 0 : m.symbol) == null ? void 0 : j.toLowerCase()) === "sol")
|
1286
|
+
R();
|
1285
1287
|
else if (i.chainId === "eclipse-svm")
|
1286
|
-
m.symbol == "ETH" ?
|
1288
|
+
m.symbol == "ETH" ? R("https://eclipse.lgns.net/") : V("https://eclipse.lgns.net/");
|
1287
1289
|
else {
|
1288
1290
|
if (i.networkType === "btc" || i.networkType === "sui")
|
1289
1291
|
return;
|
1290
|
-
|
1292
|
+
V();
|
1291
1293
|
}
|
1292
1294
|
}));
|
1293
1295
|
}
|
@@ -1296,104 +1298,103 @@ function Nt(t, n) {
|
|
1296
1298
|
const w = await r.getBalance();
|
1297
1299
|
o(w), d(!1);
|
1298
1300
|
}
|
1299
|
-
|
1301
|
+
A(() => ((i == null ? void 0 : i.networkType) === "sol" && C(), async () => {
|
1300
1302
|
if (!r) return;
|
1301
1303
|
const w = await r.connector.getPublicClient();
|
1302
1304
|
w && w.removeAccountChangeListener(f);
|
1303
1305
|
}), [r == null ? void 0 : r.address, i == null ? void 0 : i.networkType, m]);
|
1304
|
-
async function
|
1305
|
-
var B,
|
1306
|
-
let
|
1306
|
+
async function H(w) {
|
1307
|
+
var B, j;
|
1308
|
+
let N = S[w] || S;
|
1307
1309
|
try {
|
1308
1310
|
d(!0);
|
1309
|
-
let
|
1310
|
-
o(((
|
1311
|
-
} catch
|
1312
|
-
|
1311
|
+
let M = await N.getAllBalances((B = L == null ? void 0 : L[w]) == null ? void 0 : B.bech32Address), E = fe.keyBy(M, "denom");
|
1312
|
+
o(((j = E[d1(m.address)]) == null ? void 0 : j.amount) / Math.pow(10, m.decimals) || 0), d(!1);
|
1313
|
+
} catch {
|
1314
|
+
d(!1);
|
1313
1315
|
}
|
1314
1316
|
}
|
1315
|
-
async function $(w,
|
1317
|
+
async function $(w, N) {
|
1316
1318
|
o(0);
|
1317
1319
|
try {
|
1318
1320
|
d(!0);
|
1319
|
-
let B = await
|
1320
|
-
|
1321
|
-
} catch
|
1322
|
-
|
1321
|
+
let B = await Ct(w, N);
|
1322
|
+
o((B == null ? void 0 : B.balance) || 0), d(!1);
|
1323
|
+
} catch {
|
1324
|
+
d(!1);
|
1323
1325
|
}
|
1324
1326
|
}
|
1325
|
-
return
|
1327
|
+
return A(() => {
|
1326
1328
|
var w;
|
1327
|
-
o(0), i.networkType == "sol" && (r != null && r.address) ? ((w = m == null ? void 0 : m.symbol) == null ? void 0 : w.toLowerCase()) === "sol" ?
|
1328
|
-
}, [i.networkType, i == null ? void 0 : i.chainId, m.symbol, m == null ? void 0 : m.address, T, g, r == null ? void 0 : r.address, g, h, _, r == null ? void 0 : r.chain, t,
|
1329
|
+
o(0), i.networkType == "sol" && (r != null && r.address) ? ((w = m == null ? void 0 : m.symbol) == null ? void 0 : w.toLowerCase()) === "sol" ? R() : i.chainId == "eclipse-svm" ? m.symbol == "ETH" ? R("https://eclipse.lgns.net/") : V("https://eclipse.lgns.net/") : V() : i.networkType == "sui" && (r == null ? void 0 : r.chain) == "SUI" || i.networkType == "btc" && (r == null ? void 0 : r.chain) == "BTC" ? P() : i.networkType == "evm" && g && (g != null && g.length) ? o(Number((T == null ? void 0 : T.formatted) || 0)) : i.networkType == "cosmos" && h && !_ ? H(i == null ? void 0 : i.chainId) : i.networkType == "tron" && k && $(k, m == null ? void 0 : m.address);
|
1330
|
+
}, [i.networkType, i == null ? void 0 : i.chainId, m.symbol, m == null ? void 0 : m.address, T, g, r == null ? void 0 : r.address, g, h, _, r == null ? void 0 : r.chain, t, k]), {
|
1329
1331
|
getbal: s,
|
1330
|
-
isBalanceLoading: (i == null ? void 0 : i.networkType) == "evm" ? y :
|
1332
|
+
isBalanceLoading: (i == null ? void 0 : i.networkType) == "evm" ? y : c
|
1331
1333
|
};
|
1332
1334
|
}
|
1333
|
-
const
|
1334
|
-
function
|
1335
|
+
const kt = ue.lazy(() => import("./SwapAsset-X7gAsFxL.js")), Nt = ue.lazy(() => import("./InputComp-B0QgFbsj.js")), Tt = ue.lazy(() => import("./QuotesProgress-Ct53CRUU.js")), It = ue.lazy(() => import("./TxnButton-BZf2lfxu.js")), Bt = ue.lazy(() => import("./index-BII8gr4h.js").then((t) => t.i)), At = ue.lazy(() => import("./index-DbOqrlxW.js")), jt = ue.lazy(() => import("./LoadRoute-I--KmXYZ.js")), Lt = ue.lazy(() => import("./AllRoutes-pT_GYhLz.js"));
|
1336
|
+
function Pt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
1335
1337
|
var Ke, Je, qe, Xe, Qe, Ue, Ye;
|
1336
|
-
const [o, r] =
|
1337
|
-
let
|
1338
|
-
const
|
1339
|
-
enabled:
|
1340
|
-
dependency:
|
1341
|
-
payload: [(C == null ? void 0 : C.networkType) === "cosmos" ?
|
1342
|
-
}),
|
1343
|
-
queryKey: ["balance",
|
1344
|
-
queryFn: async () => await (await _e.fetchBalance(
|
1345
|
-
enabled: !!((Ue =
|
1338
|
+
const [o, r] = v(), [b, c] = v(!1), [d, i] = v(!1), [g, x] = v(!1), [k, I] = v(!1), [F, L] = v("all"), [h, m] = v(!1), { primaryWallet: T } = Be(), { address: y } = xe(), { address: S } = Ve(), { getbal: _, isBalanceLoading: re } = vt(h), { data: O, isConnected: K } = Oe({ chainId: "cosmoshub-4" }), R = l((a) => a.persist), V = l((a) => a.setPersist), f = l((a) => a.route), C = l((a) => a.fromChain), P = l((a) => a.toChain), H = l((a) => a.fromCoin), $ = l((a) => a.toCoin), w = l((a) => a.setFromChain), N = l((a) => a.setToChain), B = l((a) => a.setFromCoin), j = l((a) => a.setToCoin), M = l((a) => a.amount), E = l((a) => a.setAmount), se = l((a) => a.customWallet), G = l((a) => a.setCosmosChainIds), W = l((a) => a.customFee), z = l((a) => a.broadCastMode), q = l((a) => a.evmGas), oe = l((a) => a.evmSpeed), ke = l((a) => a.slippage), he = l((a) => a.option), D = l((a) => a.setCustomWallet), Ae = l((a) => a.setSelectedProvider), { balanceSol: u } = mt(C, h, Re), { suggestAndConnectAsync: ee } = V1(), ae = !!(M.length && C.chain.length && H.coin.length && P.chain.length && $.coin.length && !g && k), be = ["routes", y, C, P, H, $, M, T == null ? void 0 : T.address, S, se, O == null ? void 0 : O.bech32Address, W, q, oe, ke, z, he.value];
|
1339
|
+
let ie = (z === "Priority Fee" || z === "Both") && (W != null && W.length) ? W : he.value, le = (z === "Jito Tip" || z === "Both") && (W != null && W.length) ? W : he.value, X = q != null && q.length ? q : oe.value;
|
1340
|
+
const U = (C == null ? void 0 : C.networkType) === "sol" ? z === "Priority Fee" ? `&solanaPriorityFee=${ie}` : z === "Jito Tip" ? { solanaJitoTip: le } : { solanaPriorityFee: ie, solanaJitoTip: le } : (C == null ? void 0 : C.networkType) === "evm" ? { evmPriorityFee: X } : "", { getWallet: Y, refetch: te } = Ie({}), { routes: Z, routesData: Q, setRoutesData: de, errorMessage: ne, setErrorMessage: Ne } = K1({
|
1341
|
+
enabled: ae,
|
1342
|
+
dependency: be,
|
1343
|
+
payload: [(C == null ? void 0 : C.networkType) === "cosmos" ? r1(O == null ? void 0 : O.bech32Address, (Ke = C == null ? void 0 : C.chainInfo) == null ? void 0 : Ke.bech32Config.bech32PrefixAccAddr) : ((Je = Y(C)) == null ? void 0 : Je.address) || "", C, P, H, $, M, Number(ke) * 100, (se == null ? void 0 : se.length) > 30 ? ((qe = Y({})) == null ? void 0 : qe.address) || "" : (P == null ? void 0 : P.networkType) === "cosmos" ? r1(O == null ? void 0 : O.bech32Address, (Xe = P == null ? void 0 : P.chainInfo) == null ? void 0 : Xe.bech32Config.bech32PrefixAccAddr) : ((Qe = Y(P)) == null ? void 0 : Qe.address) || "", U]
|
1344
|
+
}), ce = Y(C), me = l1({
|
1345
|
+
queryKey: ["balance", ce == null ? void 0 : ce.address, C],
|
1346
|
+
queryFn: async () => await (await _e.fetchBalance(ce.address, C.chainId)).json(),
|
1347
|
+
enabled: !!((Ue = ce == null ? void 0 : ce.address) != null && Ue.length && C.chainId),
|
1346
1348
|
refetchOnWindowFocus: !1
|
1347
|
-
}), { quoteTimer:
|
1348
|
-
routes:
|
1349
|
+
}), { quoteTimer: je } = ut({
|
1350
|
+
routes: Z,
|
1349
1351
|
routesData: Q,
|
1350
1352
|
confirmRoute: d,
|
1351
1353
|
setConfirmRoute: i,
|
1352
|
-
isRoutesEnabled:
|
1353
|
-
fetchBalance:
|
1354
|
+
isRoutesEnabled: ae,
|
1355
|
+
fetchBalance: me
|
1354
1356
|
});
|
1355
|
-
|
1356
|
-
|
1357
|
+
A(() => {
|
1358
|
+
M || de({});
|
1357
1359
|
let a;
|
1358
|
-
return Number(
|
1359
|
-
|
1360
|
+
return Number(M) > 0 && (a = setTimeout(() => {
|
1361
|
+
I(!0);
|
1360
1362
|
}, 500)), () => {
|
1361
|
-
clearTimeout(a),
|
1363
|
+
clearTimeout(a), I(!1);
|
1362
1364
|
};
|
1363
|
-
}, [
|
1364
|
-
|
1365
|
-
}, [
|
1365
|
+
}, [M]), A(() => {
|
1366
|
+
Z.isFetching && de({});
|
1367
|
+
}, [Z.isFetching]);
|
1366
1368
|
function Te(a) {
|
1367
1369
|
x(a);
|
1368
1370
|
}
|
1369
|
-
function
|
1371
|
+
function Le() {
|
1370
1372
|
r();
|
1371
1373
|
}
|
1372
|
-
async function
|
1373
|
-
if (
|
1374
|
+
async function Pe(a) {
|
1375
|
+
if (K)
|
1374
1376
|
try {
|
1375
|
-
let
|
1376
|
-
if (
|
1377
|
-
let
|
1377
|
+
let pe = await n1();
|
1378
|
+
if (pe.length && !pe.includes(a.chainId)) {
|
1379
|
+
let ye = await ee({
|
1378
1380
|
chainInfo: a,
|
1379
|
-
walletType:
|
1380
|
-
}),
|
1381
|
-
|
1381
|
+
walletType: z1.KEPLR
|
1382
|
+
}), ge = await te(), Ce = await n1();
|
1383
|
+
G(Ce);
|
1382
1384
|
}
|
1383
|
-
} catch
|
1384
|
-
console.log(de);
|
1385
|
+
} catch {
|
1385
1386
|
}
|
1386
1387
|
else
|
1387
1388
|
return;
|
1388
1389
|
}
|
1389
|
-
function
|
1390
|
-
(a == null ? void 0 : a.networkType) == "cosmos" &&
|
1390
|
+
function h1(a) {
|
1391
|
+
(a == null ? void 0 : a.networkType) == "cosmos" && Pe(a.chainInfo), E(""), Ne({ error: "" }), o == "from" ? w({ ...a }) : o == "to" && N({ ...a });
|
1391
1392
|
}
|
1392
|
-
function
|
1393
|
-
Ne({ error: "" }),
|
1393
|
+
function y1(a) {
|
1394
|
+
Ne({ error: "" }), E(""), o == "from" ? B({ ...a }) : o == "to" && j({ ...a });
|
1394
1395
|
}
|
1395
1396
|
function He() {
|
1396
|
-
|
1397
|
+
c(!b);
|
1397
1398
|
}
|
1398
1399
|
function Ge(a) {
|
1399
1400
|
i(typeof a < "u" ? a : !d);
|
@@ -1401,23 +1402,23 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1401
1402
|
function Re(a) {
|
1402
1403
|
m(a);
|
1403
1404
|
}
|
1404
|
-
function
|
1405
|
-
|
1405
|
+
function C1(a) {
|
1406
|
+
Ae(a == null ? void 0 : a.provider), de(a);
|
1406
1407
|
}
|
1407
|
-
function
|
1408
|
+
function v1() {
|
1408
1409
|
setTimeout(() => {
|
1409
|
-
Re(!0),
|
1410
|
+
Re(!0), me.refetch();
|
1410
1411
|
}, 1e3);
|
1411
1412
|
}
|
1412
|
-
function
|
1413
|
-
|
1413
|
+
function k1() {
|
1414
|
+
E("");
|
1414
1415
|
}
|
1415
|
-
function
|
1416
|
-
_e.fetchTokens(a.chainId,
|
1417
|
-
var
|
1418
|
-
(We = (
|
1419
|
-
|
1420
|
-
...
|
1416
|
+
function N1(a, pe, ye) {
|
1417
|
+
_e.fetchTokens(a.chainId, ye).then((ge) => ge.json()).then((ge) => {
|
1418
|
+
var Ce, We;
|
1419
|
+
(We = (Ce = ge.data) == null ? void 0 : Ce[a.chainId]) == null || We.forEach((De) => {
|
1420
|
+
pe({
|
1421
|
+
...H,
|
1421
1422
|
coin: De.symbol,
|
1422
1423
|
...De,
|
1423
1424
|
availBal: ""
|
@@ -1425,45 +1426,44 @@ function Et({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1425
1426
|
});
|
1426
1427
|
});
|
1427
1428
|
}
|
1428
|
-
function
|
1429
|
-
|
1429
|
+
function T1() {
|
1430
|
+
E(""), w(P), B($), N(C), j(H), C.networkType !== P.networkType && D("");
|
1430
1431
|
}
|
1431
|
-
|
1432
|
-
|
1433
|
-
}, [
|
1434
|
-
function
|
1435
|
-
var
|
1432
|
+
A(() => {
|
1433
|
+
R.isHistory && f === "" && (V({ allSteps: { steps: null, currentStep: 0 }, stepData: {} }), Te(!1));
|
1434
|
+
}, [R]);
|
1435
|
+
function I1(a) {
|
1436
|
+
var pe;
|
1436
1437
|
if (a && s.isSuccess && a !== (P == null ? void 0 : P.networkType) && a !== (C == null ? void 0 : C.networkType)) {
|
1437
|
-
let
|
1438
|
+
let ye = fe.keyBy(s.data.data, "chainId"), ge = a == "evm" ? "8453" : a == "sol" ? "sol" : a == "sui" ? "1" : a == "btc" ? "btc" : a == "tron" ? "tron" : "cosmoshub-4", Ce = a == "evm" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : a == "sol" ? "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" : a == "sui" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : a == "btc" ? "bitcoin" : a == "tron" ? "0000000000000000000000000000000000" : "uatom";
|
1438
1439
|
w({
|
1439
|
-
...
|
1440
|
-
chain: ((
|
1441
|
-
}),
|
1440
|
+
...ye[ge],
|
1441
|
+
chain: ((pe = ye[ge]) == null ? void 0 : pe.name) || ""
|
1442
|
+
}), N1(ye[ge], B, Ce);
|
1442
1443
|
} else
|
1443
1444
|
return;
|
1444
1445
|
}
|
1445
|
-
return
|
1446
|
-
/* @__PURE__ */ e(
|
1446
|
+
return /* @__PURE__ */ e(A1, { fallback: /* @__PURE__ */ e(P1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(Bt, { connectWalletField: F, handleShowWallet: t, handleRecentSelectedWallet: I1 }) : !d && !((Ye = R == null ? void 0 : R.routeId) != null && Ye.length) ? b ? /* @__PURE__ */ e(Lt, { routes: Z, handleShowAllRoutes: He, handleRoutesData: C1, convertVal: ($ == null ? void 0 : $.lastPrice) || 0, amount: M }) : o ? /* @__PURE__ */ e(et, { chainData: o == "from" ? C : P, coinData: o == "from" ? H : $, setChainData: h1, setCoinData: y1, handleReset: Le, showExchangeList: o, fetchBalance: me, fetchChains: s }) : /* @__PURE__ */ p(J, { children: [
|
1447
|
+
/* @__PURE__ */ e(wt, {}),
|
1447
1448
|
/* @__PURE__ */ p("div", { className: "bw-flex bw-relative bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
1448
|
-
/* @__PURE__ */ e(
|
1449
|
-
/* @__PURE__ */ e(
|
1450
|
-
/* @__PURE__ */ e(
|
1449
|
+
/* @__PURE__ */ e(kt, { handleSwap: T1 }),
|
1450
|
+
/* @__PURE__ */ e(o1, { chainData: C, show: "from", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: L, coinData: H }),
|
1451
|
+
/* @__PURE__ */ e(o1, { chainData: P, show: "to", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: L, coinData: $ })
|
1451
1452
|
] }),
|
1452
|
-
/* @__PURE__ */ e(
|
1453
|
-
/* @__PURE__ */ e(
|
1454
|
-
/* @__PURE__ */ e("
|
1455
|
-
/* @__PURE__ */ e(
|
1456
|
-
/* @__PURE__ */ e(
|
1457
|
-
|
1458
|
-
] }) : /* @__PURE__ */ e(Lt, { handleConfirmClose: Ge, amount: v, routesData: Q, resetAmount: I1, routes: X, handleStopRoute: Te, resetBalance: T1 }) }) });
|
1453
|
+
/* @__PURE__ */ e(Nt, { amount: M, setAmount: E, fetchBalance: me, getCoinBalance: _, isBalanceLoading: re }),
|
1454
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(jt, { routes: Z, handleShowAllRoutes: He, routesData: Q, amount: M, isRoutesEnabled: k, price: ((Q == null ? void 0 : Q.outputAmountDisplay) || "") * (($ == null ? void 0 : $.lastPrice) || 0) }) }),
|
1455
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (ne == null ? void 0 : ne.error) == "string" ? ne == null ? void 0 : ne.error : "" }),
|
1456
|
+
/* @__PURE__ */ e(Tt, { amount: k, routes: Z, routesData: Q, quoteTimer: je }),
|
1457
|
+
/* @__PURE__ */ e(It, { routesData: Q, handleSuccess: Re, routes: Z, fetchBalancePrev: me, amount: M, isAmountTyped: k, handleShowWallet: t, setConnectWalletField: L, handleConfirmClose: Ge, balanceSol: u, getCoinBalance: _ })
|
1458
|
+
] }) : /* @__PURE__ */ e(At, { handleConfirmClose: Ge, amount: M, routesData: Q, resetAmount: k1, routes: Z, handleStopRoute: Te, resetBalance: v1 }) }) });
|
1459
1459
|
}
|
1460
|
-
function
|
1461
|
-
const [n, s] =
|
1462
|
-
function r(
|
1460
|
+
function Ft({ fetchChains: t }) {
|
1461
|
+
const [n, s] = v(!1), { isConnected: o } = xe();
|
1462
|
+
function r(b) {
|
1463
1463
|
s(!n);
|
1464
1464
|
}
|
1465
1465
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1466
|
-
|
1466
|
+
Pt,
|
1467
1467
|
{
|
1468
1468
|
handleShowWallet: r,
|
1469
1469
|
fetchChains: t,
|
@@ -1471,15 +1471,15 @@ function Ot({ fetchChains: t }) {
|
|
1471
1471
|
}
|
1472
1472
|
) });
|
1473
1473
|
}
|
1474
|
-
const
|
1474
|
+
const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
1475
1475
|
__proto__: null,
|
1476
|
-
default:
|
1476
|
+
default: Ft
|
1477
1477
|
}, Symbol.toStringTag, { value: "Module" }));
|
1478
1478
|
export {
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1479
|
+
pt as c,
|
1480
|
+
yt as g,
|
1481
|
+
qt as i,
|
1482
|
+
d1 as p,
|
1483
|
+
u1 as r,
|
1484
|
+
U1 as u
|
1485
1485
|
};
|