@blockend/widget 1.0.48-beta.0 → 1.0.48-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AllRoutes-D8LuuVmM.js → AllRoutes-C_rcXmmZ.js} +9 -9
- package/dist/{Box-DM9yFOex.js → Box-DC9ZsRk1.js} +8 -8
- package/dist/EstGas-CS0RqPZ_.js +12661 -0
- package/dist/{Grow-DOn6L3co.js → Grow-C_P537x-.js} +2 -2
- package/dist/{InputComp-NuVHgaJr.js → InputComp-BFISyDWr.js} +3 -3
- package/dist/{LoadRoute-B67KdzDM.js → LoadRoute-aCQoKb3B.js} +4 -4
- package/dist/{QuotesProgress-QaDMFoy1.js → QuotesProgress-kJ3vM5WP.js} +1 -1
- package/dist/{SwapAsset-DS1khTG7.js → SwapAsset-CDj2n4b6.js} +1 -1
- package/dist/{Tooltip-Ba3WFgGd.js → Tooltip-CCb4FPVY.js} +15 -15
- package/dist/TxnButton-lLEwer9x.js +212 -0
- package/dist/{add-q9Nf6prg.js → add-CoYex5Dn.js} +1 -1
- package/dist/{all-wallets-DPeT0Mif.js → all-wallets-Bd8NTrnM.js} +1 -1
- package/dist/{app-store-DN3WdWdo.js → app-store-BAO1Knf8.js} +1 -1
- package/dist/{apple-DyzMqifv.js → apple-DHPVU7kM.js} +1 -1
- package/dist/{arrow-bottom-DqoHxj9Z.js → arrow-bottom-atfLz99n.js} +1 -1
- package/dist/{arrow-bottom-circle-gYCPf_-a.js → arrow-bottom-circle-C47A6Y8e.js} +1 -1
- package/dist/{arrow-left-BCb0WGCp.js → arrow-left-D37JuXA3.js} +1 -1
- package/dist/{arrow-right-COFDKXwO.js → arrow-right-DV2KIQst.js} +1 -1
- package/dist/{arrow-top-A2hPO7gg.js → arrow-top-Bsm1aZLV.js} +1 -1
- package/dist/{bank-DzMH-tSV.js → bank-Cdw0hMrI.js} +1 -1
- package/dist/{basic-C5wivloW.js → basic-CLI82Nv2.js} +3 -3
- package/dist/{browser-pBih3Y0E.js → browser-D6tPO07U.js} +1 -1
- package/dist/{card-CnPr5FkC.js → card-HADpiv1z.js} +1 -1
- package/dist/{ccip-Di_Zaa6h.js → ccip-nfl-U5kB.js} +16 -16
- package/dist/{checkmark-DuHkawx4.js → checkmark-Cf8C-8Kd.js} +1 -1
- package/dist/{checkmark-bold-CbTyGrPC.js → checkmark-bold-1l_rH0Oc.js} +1 -1
- package/dist/{chevron-bottom-ClujWrwS.js → chevron-bottom-uVWA9_WJ.js} +1 -1
- package/dist/{chevron-left-Bk48p4Zx.js → chevron-left-C-rC9T1J.js} +1 -1
- package/dist/{chevron-right-DNGloKKX.js → chevron-right-D57aI6Wn.js} +1 -1
- package/dist/{chevron-top-BeF-AMWu.js → chevron-top-BuKiuUEw.js} +1 -1
- package/dist/{chrome-store-DbhS7z0N.js → chrome-store-Ck2xyFoO.js} +1 -1
- package/dist/{clock-C_6_l4to.js → clock-CWF1oB-7.js} +1 -1
- package/dist/{close-CSt1jFt2.js → close-xTVbgGNF.js} +1 -1
- package/dist/{coinPlaceholder-BCj1y0PN.js → coinPlaceholder-D4JNB9Cl.js} +1 -1
- package/dist/{compass-BylNTlMa.js → compass-3Sold4Ol.js} +1 -1
- package/dist/{copy-B5chXsW-.js → copy-Cj1PQEnx.js} +1 -1
- package/dist/{core-DMrbUYAd.js → core-rNskXQmO.js} +17 -16
- package/dist/{cursor-DOai1hPO.js → cursor-ClWZSZg_.js} +1 -1
- package/dist/{cursor-transparent-Cadcmy6E.js → cursor-transparent-PjygCnxx.js} +1 -1
- package/dist/{desktop-DCy_OF9q.js → desktop-DlVN2ojl.js} +1 -1
- package/dist/{disconnect-d_9YI8yP.js → disconnect-C0CEwEKo.js} +1 -1
- package/dist/{discord-C5PncbsA.js → discord-BHuKcYWu.js} +1 -1
- package/dist/{down-B0DJRPMS.js → down-cjFo92gr.js} +2 -2
- package/dist/{etherscan-ClGwr9lW.js → etherscan-DLKXZ2re.js} +1 -1
- package/dist/{exclamation-triangle-UG68kEuv.js → exclamation-triangle-DJ6mpOiU.js} +1 -1
- package/dist/{extension-Bhr-Ssau.js → extension-Y9XDVeMb.js} +1 -1
- package/dist/{external-link-BRJo7SZO.js → external-link-CnsSsrf1.js} +1 -1
- package/dist/{facebook-BnA-xxoO.js → facebook-BkBjd1Ja.js} +1 -1
- package/dist/{farcaster-CvgpGB8R.js → farcaster-BpIRv4Nx.js} +1 -1
- package/dist/{filters-2DNvXC2d.js → filters-UhqGAJq9.js} +1 -1
- package/dist/{getChainIds-BJOBostX.js → getChainIds-zCkHYBEK.js} +2 -2
- package/dist/getCosmosAddress-CsDRewn8.js +9565 -0
- package/dist/{github-CqCIZfoi.js → github-CW3Tx2DS.js} +1 -1
- package/dist/{google-Cb46Xe1N.js → google-BiM677XD.js} +1 -1
- package/dist/{hamburger-Cj81xHVG.js → hamburger-By7q3dLj.js} +5 -5
- package/dist/{help-circle-BQm3Y4uL.js → help-circle-BAr9oTmz.js} +1 -1
- package/dist/{id-DlZAWXhX.js → id-aD5RUW4F.js} +1 -1
- package/dist/{image-C-Rdb3yG.js → image-BrnuP1P9.js} +1 -1
- package/dist/index-B8z6fxJo.js +30725 -0
- package/dist/index-BHJKbDqF.js +3010 -0
- package/dist/{index-BKAQ3OTd.js → index-CA4RSUKU.js} +11 -11
- package/dist/{index-CUDhfiq5.js → index-CBxaxTOR.js} +10 -10
- package/dist/{index-CxxmgFkL.js → index-CTvnWMBo.js} +1 -1
- package/dist/{index-BJtXFuWZ.js → index-CyV4FzjL.js} +7 -8
- package/dist/{index-DeBuj-lE.js → index-DH8JxxWE.js} +1 -1
- package/dist/index-DTish3yr.js +1014 -0
- package/dist/{index-CPAph-rb.js → index-Dj6xjKNe.js} +4 -4
- package/dist/{index-DD4yqUTK.js → index-Dj8Fq1Is.js} +78 -78
- package/dist/{index-N4PNqcjR.js → index-Do5M9Oqz.js} +2 -2
- package/dist/{index-BEianCH_.js → index-l2ai1CkK.js} +349 -374
- package/dist/{index.es-DGhokHli.js → index.es-BomDku8R.js} +1 -1
- package/dist/{index.es-BkvYD6Tp.js → index.es-S0nIwG4h.js} +3244 -3032
- package/dist/index.es.js +1 -1
- package/dist/{info-o_cb8tTT.js → info-BpeJHMEs.js} +1 -1
- package/dist/{info-circle-BweemjWa.js → info-circle-BUF8iHNx.js} +1 -1
- package/dist/{lightbulb-CIREQKfQ.js → lightbulb-CAM_CmYZ.js} +1 -1
- package/dist/{mail-D7pla8qN.js → mail-DS9LYByW.js} +1 -1
- package/dist/{mobile-BfSFqXTR.js → mobile-BjyXwTPW.js} +1 -1
- package/dist/{more-Cm2OZt-4.js → more-GbR0Z_nH.js} +1 -1
- package/dist/{network-placeholder-cja_SKEh.js → network-placeholder-C0gjFAYv.js} +1 -1
- package/dist/{nftPlaceholder-CPMGC0YA.js → nftPlaceholder-ChQjBZdh.js} +1 -1
- package/dist/{off-2ov8-cMg.js → off-CICf6kT3.js} +1 -1
- package/dist/{play-store-K7jF5Tx9.js → play-store-TvZlQHyy.js} +1 -1
- package/dist/{plus-D2hT5Tke.js → plus-Bcv4f5bB.js} +1 -1
- package/dist/{qr-code-DdAcFtyy.js → qr-code-DTM2asI9.js} +1 -1
- package/dist/{recycle-horizontal-C_hgDyOE.js → recycle-horizontal-C7ljDdu9.js} +1 -1
- package/dist/{refresh-DmHZ_uHs.js → refresh-4hpNXY_X.js} +1 -1
- package/dist/{reown-logo-C7Ew_uaV.js → reown-logo-WcqQ1qtz.js} +1 -1
- package/dist/{search-DIQ1nJd8.js → search-D1BXY1T6.js} +1 -1
- package/dist/{send-oPtL6xIE.js → send-Dbeb2AZp.js} +1 -1
- package/dist/{swapHorizontal-Csk-Etan.js → swapHorizontal-CPMloADn.js} +1 -1
- package/dist/{swapHorizontalBold-BcWknhY6.js → swapHorizontalBold-lSBAmfLj.js} +1 -1
- package/dist/{swapHorizontalMedium-DmNmthd2.js → swapHorizontalMedium-B-ht2H4D.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-Cqili0jK.js → swapHorizontalRoundedBold-oCc2hdVi.js} +1 -1
- package/dist/{swapVertical-CmQhV1BW.js → swapVertical-CjPe5T2G.js} +1 -1
- package/dist/{telegram-8VqDFrbM.js → telegram-C5VkSyCC.js} +1 -1
- package/dist/{three-dots-54YC22RW.js → three-dots-u0Cjx-GT.js} +1 -1
- package/dist/{twitch-BG66DH8z.js → twitch-DD-hvh8H.js} +1 -1
- package/dist/{twitterIcon-B3TRjKnO.js → twitterIcon-YeVld2yw.js} +1 -1
- package/dist/{unsupportedProp-DxJPUr4X.js → unsupportedProp-BXjtFRgh.js} +1 -1
- package/dist/useRegisterError-C6xjmaOv.js +8812 -0
- package/dist/{verify-Cxrk9OZf.js → verify-CoE81YuX.js} +1 -1
- package/dist/{verify-filled-DTYh5fHd.js → verify-filled-tqbHCJm9.js} +1 -1
- package/dist/{w3m-modal-BtzAU8Rd.js → w3m-modal-Dp_FRyqT.js} +2 -2
- package/dist/{wallet-CqHzy9UL.js → wallet-EeOCXGZN.js} +1 -1
- package/dist/{wallet-placeholder-DUpL8Wi-.js → wallet-placeholder-WF2OpB4W.js} +1 -1
- package/dist/{walletconnect-CMShOjhI.js → walletconnect-BnLVtxLX.js} +1 -1
- package/dist/{warning-circle-C-6BUTdg.js → warning-circle-BB_SHFVd.js} +1 -1
- package/dist/widget.css +1 -1
- package/dist/{x-Bs3i9yGj.js → x-WBv03BZC.js} +1 -1
- package/package.json +2 -6
- package/dist/EstGas-BeT31S57.js +0 -13644
- package/dist/TxnButton-tr4Dz_jE.js +0 -223
- package/dist/getCosmosAddress-nYlLagxO.js +0 -8398
- package/dist/index-DQ-upUtl.js +0 -85050
- package/dist/index-eC9_VgZe.js +0 -3183
- package/dist/useRegisterError-RP3LuUvG.js +0 -8913
@@ -1,17 +1,17 @@
|
|
1
1
|
import { jsxs as u, jsx as e, Fragment as K } from "react/jsx-runtime";
|
2
2
|
import de, { useState as N, useEffect as B, useRef as B1, Suspense as A1 } from "react";
|
3
|
-
import { B as j1, i as Ee, u as ke, F as De, f as $e, C as _e, W as i1 } from "./useRegisterError-
|
4
|
-
import { u as l, l as pe, a as a1, c as
|
5
|
-
import { C as e1, M as F1, g as t1 } from "./getChainIds-
|
3
|
+
import { B as j1, i as Ee, u as ke, F as De, f as $e, C as _e, W as i1 } from "./useRegisterError-C6xjmaOv.js";
|
4
|
+
import { u as l, l as pe, a as a1, c as Ve, S as P1, M as L1 } from "./index-B8z6fxJo.js";
|
5
|
+
import { C as e1, M as F1, g as t1 } from "./getChainIds-zCkHYBEK.js";
|
6
6
|
import { useQuery as l1 } from "@tanstack/react-query";
|
7
7
|
import { useAccount as ge, useConnect as M1, useConnections as E1, useBalance as O1 } from "wagmi";
|
8
8
|
import { useDynamicContext as Ne, useIsLoggedIn as R1, useUserWallets as $1 } from "@dynamic-labs/sdk-react-core";
|
9
9
|
import { S as _1 } from "./shareicon-CG3v7iKI.js";
|
10
|
-
import { u as
|
11
|
-
import { useAccount as Oe, useStargateClient as c1, useSuggestChainAndConnect as
|
12
|
-
import { S as H1, D as G1 } from "./down-
|
10
|
+
import { u as V1, B as z1 } from "./index-Do5M9Oqz.js";
|
11
|
+
import { useAccount as Oe, useStargateClient as c1, useSuggestChainAndConnect as S1, WalletType as Z1 } from "graz";
|
12
|
+
import { S as H1, D as G1 } from "./down-cjFo92gr.js";
|
13
13
|
import { R as K1 } from "./index-CDq3vNnP.js";
|
14
|
-
import { C as
|
14
|
+
import { C as ze, P as be, u as J1, g as n1 } from "./getCosmosAddress-CsDRewn8.js";
|
15
15
|
function b1({ fill: t }) {
|
16
16
|
return /* @__PURE__ */ u(
|
17
17
|
"svg",
|
@@ -46,8 +46,8 @@ function b1({ fill: t }) {
|
|
46
46
|
}
|
47
47
|
);
|
48
48
|
}
|
49
|
-
function q1({ data: t, handleBack: n, handleSetChainData:
|
50
|
-
const [r, c] = N(t), [b,
|
49
|
+
function q1({ data: t, handleBack: n, handleSetChainData: o, network: s }) {
|
50
|
+
const [r, c] = N(t), [b, w] = N(""), { tick: a, defaultCoin: p } = Ee;
|
51
51
|
return /* @__PURE__ */ u("div", { children: [
|
52
52
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
53
53
|
/* @__PURE__ */ e(
|
@@ -78,7 +78,7 @@ function q1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
78
78
|
type: "text",
|
79
79
|
value: b,
|
80
80
|
onChange: (f) => {
|
81
|
-
|
81
|
+
w(f.target.value);
|
82
82
|
},
|
83
83
|
className: `bw-text-sm bw-px-2 bw-w-full bw-h-[34px] ${b.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"
|
@@ -94,8 +94,8 @@ function q1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
94
94
|
"div",
|
95
95
|
{
|
96
96
|
onClick: () => {
|
97
|
-
let
|
98
|
-
n(f),
|
97
|
+
let P = { chain: f.name, ...f };
|
98
|
+
n(f), o(P);
|
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,10 +103,10 @@ function q1({ data: t, handleBack: n, handleSetChainData: s, network: o }) {
|
|
103
103
|
children: [
|
104
104
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-items-center bw-gap-x-3", children: [
|
105
105
|
" ",
|
106
|
-
/* @__PURE__ */ e("img", { src: (T = f.image) != null && T.length ? f.image :
|
106
|
+
/* @__PURE__ */ e("img", { src: (T = f.image) != null && T.length ? f.image : p, className: "bw-rounded-[50%] bw-border bw-border-border-primary", width: 25, height: 25, alt: "img" }),
|
107
107
|
" ",
|
108
108
|
/* @__PURE__ */ e("p", { children: f.name }),
|
109
|
-
|
109
|
+
s.chain === f.name ? /* @__PURE__ */ e("img", { src: a, width: 10, height: 10, alt: "img" }) : /* @__PURE__ */ e(K, {})
|
110
110
|
] }),
|
111
111
|
/* @__PURE__ */ u("div", { className: "bw-pr-2", children: [
|
112
112
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal", children: "Tokens" }),
|
@@ -123,40 +123,40 @@ const X1 = "_gradientbackground_7x8s8_1", Q1 = "_overlay_7x8s8_5", r1 = {
|
|
123
123
|
gradientbackground: X1,
|
124
124
|
overlay: Q1
|
125
125
|
};
|
126
|
-
function
|
126
|
+
function W1(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,
|
132
|
-
chainId:
|
130
|
+
function U1(t) {
|
131
|
+
const [n, o] = N({}), s = l((a) => a.cosmosChainIds), { data: r } = Oe({
|
132
|
+
chainId: s,
|
133
133
|
multiChain: !0
|
134
|
-
}), c = l((
|
134
|
+
}), c = l((a) => a.fromChain), { data: b } = c1({
|
135
135
|
chainId: [(t == null ? void 0 : t.chainId) || c.chainId],
|
136
136
|
multiChain: !0
|
137
137
|
});
|
138
|
-
async function
|
139
|
-
var
|
140
|
-
if ((
|
141
|
-
let T = await (b[
|
142
|
-
(f = r == null ? void 0 : r[
|
143
|
-
),
|
144
|
-
|
138
|
+
async function w(a) {
|
139
|
+
var p, f;
|
140
|
+
if ((p = r == null ? void 0 : r[a]) != null && p.bech32Address && b) {
|
141
|
+
let T = await (b[a] || b).getAllBalances(
|
142
|
+
(f = r == null ? void 0 : r[a]) == null ? void 0 : f.bech32Address
|
143
|
+
), P = pe.keyBy(T, "denom");
|
144
|
+
o(P);
|
145
145
|
}
|
146
146
|
}
|
147
147
|
return B(() => {
|
148
|
-
((t == null ? void 0 : t.networkType) == "cosmos" || (c == null ? void 0 : c.networkType) == "cosmos") &&
|
148
|
+
((t == null ? void 0 : t.networkType) == "cosmos" || (c == null ? void 0 : c.networkType) == "cosmos") && w((t == null ? void 0 : t.chainId) || (c == null ? void 0 : c.chainId));
|
149
149
|
}, [b, c, t]), { cosmosBalance: n };
|
150
150
|
}
|
151
151
|
function d1(t) {
|
152
152
|
let n = t.split("/");
|
153
153
|
if (n.length > 1) {
|
154
|
-
let
|
155
|
-
return n[1] =
|
154
|
+
let o = n[1].toUpperCase();
|
155
|
+
return n[1] = o, n.join("/");
|
156
156
|
} else
|
157
157
|
return t;
|
158
158
|
}
|
159
|
-
function
|
159
|
+
function Y1({ fill: t }) {
|
160
160
|
return /* @__PURE__ */ u(
|
161
161
|
"svg",
|
162
162
|
{
|
@@ -202,7 +202,7 @@ function D1({ selectedChain: t }) {
|
|
202
202
|
alt: "chain"
|
203
203
|
}
|
204
204
|
) : /* @__PURE__ */ e(K, {}),
|
205
|
-
/* @__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(
|
205
|
+
/* @__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)" }) })
|
206
206
|
] }) }),
|
207
207
|
/* @__PURE__ */ u("h2", { className: "bw-text-base bw-text-center bw-mt-3 bw-font-bold bw-text-text-primary", children: [
|
208
208
|
"No Tokens found on ",
|
@@ -216,101 +216,101 @@ function D1({ selectedChain: t }) {
|
|
216
216
|
] })
|
217
217
|
] });
|
218
218
|
}
|
219
|
-
const et = de.memo(function({ selectChainState: n, value:
|
219
|
+
const et = de.memo(function({ selectChainState: n, value: o, handleClosePopup: s, showExchangeList: r, setCoinData: c, setChainData: b }) {
|
220
220
|
var Be, Ae;
|
221
|
-
l((
|
222
|
-
const
|
221
|
+
l((d) => d.searchCustomCoin);
|
222
|
+
const w = l((d) => d.setSearchCustomCoin), { ref: a, inView: p } = V1(), { getWallet: f } = ke({}), { connected: I, address: T } = a1(), { isConnected: P, address: h } = ge(), { primaryWallet: y } = Ne();
|
223
223
|
R1();
|
224
|
-
const C = f(n), A = l((
|
224
|
+
const C = f(n), A = l((d) => d.fromChain), v = l((d) => d.fromCoin), Z = l((d) => d.toChain), H = l((d) => d.toCoin), [ne, L] = N(!1), { cosmosBalance: R } = U1(n), { defaultCoin: _ } = Ee, [J, g] = N(0), m = B1(null), { data: k } = Oe({
|
225
225
|
chainId: [n.chainId],
|
226
226
|
multiChain: !0
|
227
|
-
}),
|
228
|
-
l((
|
229
|
-
const x = l((
|
227
|
+
}), M = (n == null ? void 0 : n.networkType) === "evm" && h || (n == null ? void 0 : n.networkType) === "sol" && (y == null ? void 0 : y.address) || (n == null ? void 0 : n.networkType) === "tron" && T || (n == null ? void 0 : n.networkType) === "cosmos" && ((Be = k == null ? void 0 : k[n == null ? void 0 : n.chainId]) == null ? void 0 : Be.bech32Address), F = l((d) => d.toDisconnect);
|
228
|
+
l((d) => d.setToDisconnect);
|
229
|
+
const x = l((d) => d.customWallet), O = l((d) => d.setCustomWallet), $ = l((d) => d.tokens), [E, j] = N([]), [V, ie] = N([]), [Te, Y] = N([]), G = $, Q = l1({
|
230
230
|
queryKey: ["balance", C == null ? void 0 : C.address, n],
|
231
|
-
queryFn: async () => await (await
|
231
|
+
queryFn: async () => await (await Ve.fetchBalance(C.address, n.chainId)).json(),
|
232
232
|
enabled: !!((Ae = C == null ? void 0 : C.address) != null && Ae.length && n.chainId),
|
233
233
|
refetchOnWindowFocus: !1
|
234
234
|
});
|
235
|
-
function
|
236
|
-
var re, le,
|
237
|
-
let D = d1(
|
238
|
-
return
|
235
|
+
function z(d) {
|
236
|
+
var re, le, oe, se, q, W, U, ee, S, X, ce, te;
|
237
|
+
let D = d1(d.address);
|
238
|
+
return d.networkType == "cosmos" ? $e(((re = R == null ? void 0 : R[D]) == null ? void 0 : re.amount) / Math.pow(10, d.decimals) || 0) || "" : $e((((W = (q = (se = (oe = (le = Q.data) == null ? void 0 : le.data) == null ? void 0 : oe[n == null ? void 0 : n.networkType]) == null ? void 0 : se[n.chainId]) == null ? void 0 : q[d.address]) == null ? void 0 : W.balance) || 0) / Math.pow(10, ((te = (ce = (X = (S = (ee = (U = Q.data) == null ? void 0 : U.data) == null ? void 0 : ee[n == null ? void 0 : n.networkType]) == null ? void 0 : S[n.chainId]) == null ? void 0 : X[d.address]) == null ? void 0 : ce.asset) == null ? void 0 : te.decimals) || 0) || 0) || "";
|
239
239
|
}
|
240
240
|
B(() => {
|
241
|
-
|
241
|
+
o.length > 40 && W1(o) && !V.length ? (L(!0), w({
|
242
242
|
chainId: n.chainId,
|
243
|
-
address:
|
244
|
-
})) :
|
245
|
-
}, [
|
246
|
-
|
247
|
-
}, [
|
243
|
+
address: o
|
244
|
+
})) : o.length || (L(!1), w({ chainId: "", address: "" }));
|
245
|
+
}, [o, V]), B(() => {
|
246
|
+
g(0);
|
247
|
+
}, [o]);
|
248
248
|
function Ie() {
|
249
|
-
|
249
|
+
g(0), ie([]), m.current.scrollTo(0, 0);
|
250
250
|
}
|
251
251
|
B(() => {
|
252
|
-
var
|
253
|
-
G != null && G.isSuccess && (n != null && n.chainId) && j(((D = (
|
252
|
+
var d, D;
|
253
|
+
G != null && G.isSuccess && (n != null && n.chainId) && j(((D = (d = G == null ? void 0 : G.data) == null ? void 0 : d.data) == null ? void 0 : D[n == null ? void 0 : n.chainId]) || []);
|
254
254
|
}, [G, n.chainId]), B(() => {
|
255
255
|
Ie();
|
256
256
|
}, [n.chainId]);
|
257
257
|
function ye() {
|
258
|
-
var
|
259
|
-
let
|
260
|
-
var
|
261
|
-
return ((
|
262
|
-
})) == null ? void 0 :
|
263
|
-
if (
|
264
|
-
}), D = 20, re = J * D, le = re + D,
|
265
|
-
J == 0 ? ie([...
|
258
|
+
var se;
|
259
|
+
let d = (se = E == null ? void 0 : E.filter((q) => {
|
260
|
+
var W, U, ee, S;
|
261
|
+
return ((W = q.name) == null ? void 0 : W.toLowerCase().includes(o == null ? void 0 : o.toLowerCase())) || ((U = q.symbol) == null ? void 0 : U.toLowerCase().includes(o == null ? void 0 : o.toLowerCase())) || ((S = (ee = q.address) == null ? void 0 : ee.toLowerCase()) == null ? void 0 : S.includes(o == null ? void 0 : o.toLowerCase()));
|
262
|
+
})) == null ? void 0 : se.sort((q, W) => {
|
263
|
+
if (M) return z(W) * W.lastPrice - z(q) * q.lastPrice;
|
264
|
+
}), D = 20, re = J * D, le = re + D, oe = d.slice(re, le);
|
265
|
+
J == 0 ? ie([...oe]) : ie([...V, ...oe]);
|
266
266
|
}
|
267
267
|
return B(() => {
|
268
|
-
|
269
|
-
}, [
|
270
|
-
|
271
|
-
}, [
|
272
|
-
var le,
|
268
|
+
E != null && E.length && ye();
|
269
|
+
}, [E, o, J, M, R, Q.data]), B(() => {
|
270
|
+
p && g((d) => d + 1);
|
271
|
+
}, [p]), /* @__PURE__ */ e("div", { ref: m, className: " bw-h-[200px] bw-pr-2 md:bw-h-[380px] bw-mt-2 bw-overflow-y-auto", children: V && (V == null ? void 0 : V.length) > 0 ? V == null ? void 0 : V.map((d, D, re) => {
|
272
|
+
var le, oe, se, q, W, U;
|
273
273
|
return /* @__PURE__ */ u(
|
274
274
|
"div",
|
275
275
|
{
|
276
|
-
ref: re.length >= 20 && re.length - 1 === D ?
|
276
|
+
ref: re.length >= 20 && re.length - 1 === D ? a : null,
|
277
277
|
className: `bw-py-2
|
278
|
-
${r == "from" && H._id !==
|
278
|
+
${r == "from" && H._id !== d._id || r == "to" && v._id !== d._id, ""}
|
279
279
|
bw-flex bw-items-center bw-justify-between bw-cursor-pointer bw-border-b bw-border-border-primary
|
280
280
|
|
281
281
|
}`,
|
282
282
|
onClick: async () => {
|
283
|
-
var
|
283
|
+
var S, X, ce, te, Ce, ae, we, je, ve, Pe, Le;
|
284
284
|
let ee = {
|
285
285
|
// ...coinData,
|
286
|
-
coin:
|
287
|
-
...
|
288
|
-
availBal: ((Ce = (te = (ce = (X = (
|
286
|
+
coin: d.symbol,
|
287
|
+
...d,
|
288
|
+
availBal: ((Ce = (te = (ce = (X = (S = Q.data) == null ? void 0 : S.data) == null ? void 0 : X[n == null ? void 0 : n.networkType]) == null ? void 0 : ce[n.chainId]) == null ? void 0 : te[d.address.toLowerCase()]) == null ? void 0 : Ce.balance) / Math.pow(10, ((Le = (Pe = (ve = (je = (we = (ae = Q.data) == null ? void 0 : ae.data) == null ? void 0 : we[n == null ? void 0 : n.networkType]) == null ? void 0 : je[n == null ? void 0 : n.chainId]) == null ? void 0 : ve[d.address.toLowerCase()]) == null ? void 0 : Pe.asset) == null ? void 0 : Le.decimals) || 0)
|
289
289
|
};
|
290
|
-
c(ee), b(n),
|
290
|
+
c(ee), b(n), s(n, ee), (n == null ? void 0 : n.networkType) === (Z == null ? void 0 : Z.networkType) || (n == null || n.networkType, A == null || A.networkType, O(""));
|
291
291
|
},
|
292
292
|
children: [
|
293
293
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-items-center bw-justify-center bw-w-max bw-gap-x-2", children: [
|
294
|
-
/* @__PURE__ */ u("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(le =
|
295
|
-
(
|
296
|
-
(
|
294
|
+
/* @__PURE__ */ u("div", { className: `bw-relative bw-rounded-[50%] bw-w-[30px] bw-h-[30px] ${(le = d.image) != null && le.length ? "bw-bg-background-secondary" : ""}`, children: [
|
295
|
+
(oe = d.image) != null && oe.length ? /* @__PURE__ */ e("img", { src: d.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: _, className: "bw-rounded-[50%]", width: 30, height: 30, alt: "img" }),
|
296
|
+
(se = n == null ? void 0 : n.image) != null && se.length ? /* @__PURE__ */ e("img", { src: n.image, className: `bw-absolute ${(q = n == null ? void 0 : n.image) != null && q.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: _, 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" })
|
297
297
|
] }),
|
298
298
|
/* @__PURE__ */ u("div", { children: [
|
299
299
|
/* @__PURE__ */ u("p", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: [
|
300
300
|
/* @__PURE__ */ u("span", { className: "bw-font-bold bw-text-text-primary", children: [
|
301
|
-
|
301
|
+
d.symbol || "",
|
302
302
|
" "
|
303
303
|
] }),
|
304
|
-
|
304
|
+
d.name
|
305
305
|
] }),
|
306
306
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-items-center bw-gap-x-2", children: [
|
307
307
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-secondary", children: n.name }),
|
308
308
|
/* @__PURE__ */ u("div", { className: "bw-bg-background-networkcard bw-flex bw-items-center bw-gap-x-2 bw-px-2", children: [
|
309
|
-
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-secondary", children:
|
309
|
+
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-secondary", children: d != null && d.address ? d.address.substring(0, 6) + "..." + d.address.substring(d.address.length - 6, d.address.length) : "" }),
|
310
310
|
/* @__PURE__ */ e(
|
311
311
|
"a",
|
312
312
|
{
|
313
|
-
href: (
|
313
|
+
href: (U = (W = n.explorer) == null ? void 0 : W.token) == null ? void 0 : U.replace("{tokenAddress}", d.address),
|
314
314
|
target: "_blank",
|
315
315
|
onClick: (ee) => {
|
316
316
|
ee.stopPropagation();
|
@@ -323,22 +323,22 @@ const et = de.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
323
323
|
] })
|
324
324
|
] })
|
325
325
|
] }),
|
326
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && x && ((x == null ? void 0 : x.length) > 30 ||
|
326
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-right bw-font-medium bw-text-text-primary", children: r === "to" && x && ((x == null ? void 0 : x.length) > 30 || F) ? /* @__PURE__ */ e(K, {}) : Q.isFetching ? /* @__PURE__ */ e(_e, { size: 12, thickness: 4, color: "inherit" }) : M ? z(d) > 0 ? /* @__PURE__ */ u(K, { children: [
|
327
327
|
/* @__PURE__ */ e(
|
328
328
|
De,
|
329
329
|
{
|
330
|
-
value:
|
330
|
+
value: z(d) || "",
|
331
331
|
options: {
|
332
332
|
maxDecimals: 10
|
333
333
|
}
|
334
334
|
}
|
335
335
|
),
|
336
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children:
|
336
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-secondary bw-font-normal bw-text-xs", children: z(d) * d.lastPrice > 0 ? /* @__PURE__ */ u(K, { children: [
|
337
337
|
"$",
|
338
338
|
/* @__PURE__ */ e(
|
339
339
|
De,
|
340
340
|
{
|
341
|
-
value: $e(
|
341
|
+
value: $e(z(d) * d.lastPrice),
|
342
342
|
options: {
|
343
343
|
maxDecimals: 10
|
344
344
|
}
|
@@ -350,45 +350,45 @@ const et = de.memo(function({ selectChainState: n, value: s, handleClosePopup: o
|
|
350
350
|
},
|
351
351
|
D
|
352
352
|
);
|
353
|
-
}) : ne && !(
|
353
|
+
}) : ne && !($.isLoading && $.isFetching) ? /* @__PURE__ */ e(D1, { selectedChain: n }) : !o.length && /* @__PURE__ */ e("div", { className: "bw-w-full bw-flex bw-justify-center bw-mt-4 bw-text-text-primary", children: /* @__PURE__ */ e(_e, { color: "inherit", size: 30 }) }) });
|
354
354
|
});
|
355
|
-
function tt({ setChainData: t, setCoinData: n, handleReset:
|
356
|
-
var
|
357
|
-
const [
|
355
|
+
function tt({ setChainData: t, setCoinData: n, handleReset: o, chainData: s, coinData: r, showExchangeList: c, fetchChains: b }) {
|
356
|
+
var g, m, k, M, F;
|
357
|
+
const [w, a] = N(!1), [p, f] = N(""), I = l((x) => x.tokens), [T, P] = N([]), [h, y] = N(0), [C, A] = N({ chain: "" }), v = l((x) => x.gradient), Z = l((x) => x.configuration), H = l((x) => x.chainObj);
|
358
358
|
B(() => {
|
359
|
-
var x,
|
360
|
-
if ((
|
361
|
-
let j = [...(
|
362
|
-
j.splice(
|
359
|
+
var x, O, $, E;
|
360
|
+
if ((O = (x = b.data) == null ? void 0 : x.data) != null && O.length) {
|
361
|
+
let j = [...(E = ($ = b.data) == null ? void 0 : $.data) == null ? void 0 : E.slice(0, 9)], V = j.findIndex((z) => z.chainId === "137"), ie = j.findIndex((z) => z.chainId === "324"), Te = j.findIndex((z) => z.chainId === "10"), Y = j.findIndex((z) => z.chainId === "43114");
|
362
|
+
j.splice(V, 1, H[80094] || {}), j.splice(ie, 1, H[2741] || {}), j.splice(Te, 1, H["eclipse-svm"] || {}), j.splice(Y, 1, H[999] || {}), !!pe.keyBy(j, "chainId")[C.chainId] || (j.pop(), j.push(C)), P(j);
|
363
363
|
}
|
364
|
-
}, [H, (
|
365
|
-
A(
|
366
|
-
}, [
|
367
|
-
var x,
|
368
|
-
if ((
|
369
|
-
let
|
370
|
-
y(
|
364
|
+
}, [H, (g = b.data) == null ? void 0 : g.data, s, C]), B(() => {
|
365
|
+
A(s);
|
366
|
+
}, [s]), B(() => {
|
367
|
+
var x, O, $;
|
368
|
+
if ((O = (x = b.data) == null ? void 0 : x.data) != null && O.length) {
|
369
|
+
let E = ($ = b.data) == null ? void 0 : $.data.filter((j) => !0);
|
370
|
+
y(E.length);
|
371
371
|
}
|
372
|
-
}, [(
|
373
|
-
function ne(x,
|
374
|
-
var
|
375
|
-
(
|
372
|
+
}, [(m = b.data) == null ? void 0 : m.data]);
|
373
|
+
function ne(x, O) {
|
374
|
+
var $, E;
|
375
|
+
($ = x.chain) != null && $.length && ((E = O == null ? void 0 : O.coin) != null && E.length) && o();
|
376
376
|
}
|
377
|
-
function
|
378
|
-
|
377
|
+
function L() {
|
378
|
+
a(!1);
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function R(x) {
|
381
381
|
A(x), f("");
|
382
382
|
}
|
383
383
|
const { tick: _, defaultCoin: J } = Ee;
|
384
|
-
return
|
384
|
+
return w ? /* @__PURE__ */ e(q1, { handleSetChainData: R, data: (k = b.data) == null ? void 0 : k.data, handleBack: L, network: C }) : /* @__PURE__ */ u(K, { children: [
|
385
385
|
/* @__PURE__ */ u("div", { children: [
|
386
386
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-justify-center bw-mb-2", children: [
|
387
387
|
/* @__PURE__ */ e(
|
388
388
|
"button",
|
389
389
|
{
|
390
390
|
onClick: () => {
|
391
|
-
|
391
|
+
o(), (!r.coin.length || !s.chain.length) && (n({ coin: "" }), t({ chain: "" }));
|
392
392
|
},
|
393
393
|
className: "bw-absolute bw-left-0 bw-top-[25%]",
|
394
394
|
children: /* @__PURE__ */ e(e1, { fill: "var(--tw-text-secondary)" })
|
@@ -400,8 +400,8 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
400
400
|
] })
|
401
401
|
] }),
|
402
402
|
b.isLoading ? /* @__PURE__ */ e(P1, { 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__ */ u("div", { className: "bw-grid bw-grid-cols-5 bw-gap-1 bw-overflow-y-auto bw-w-full", children: [
|
403
|
-
b.isSuccess && T.map((x,
|
404
|
-
var
|
403
|
+
b.isSuccess && T.map((x, O) => {
|
404
|
+
var $, E;
|
405
405
|
return /* @__PURE__ */ e(
|
406
406
|
"div",
|
407
407
|
{
|
@@ -418,33 +418,33 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
418
418
|
...x
|
419
419
|
// networkType: "cosmos",
|
420
420
|
};
|
421
|
-
|
421
|
+
R(j);
|
422
422
|
},
|
423
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",
|
424
424
|
style: { cursor: "pointer" },
|
425
425
|
children: [
|
426
|
-
/* @__PURE__ */ e("img", { src: (
|
426
|
+
/* @__PURE__ */ e("img", { src: ($ = x.image) != null && $.length ? x.image : J, width: 25, className: "bw-rounded-[50%] bw-border bw-border-border-primary", height: 25, alt: "img" }),
|
427
427
|
" ",
|
428
|
-
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${C.name == x.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((
|
428
|
+
/* @__PURE__ */ e("p", { className: `bw-text-xs bw-text-center ${C.name == x.name ? "bw-text-text-primary bw-font-semibold" : "bw-text-text-primary bw-font-normal"}`, children: ((E = x.name) == null ? void 0 : E.length) > 7 ? x.name.substring(0, 7) + ".." : x.name }),
|
429
429
|
(C == null ? void 0 : C.chain) == x ? /* @__PURE__ */ e("img", { width: 10, height: 10, src: _ }) : /* @__PURE__ */ e(K, {})
|
430
430
|
]
|
431
431
|
},
|
432
|
-
|
432
|
+
O
|
433
433
|
)
|
434
434
|
},
|
435
|
-
|
435
|
+
O
|
436
436
|
);
|
437
437
|
}),
|
438
438
|
b.isSuccess && T.length ? /* @__PURE__ */ e("div", { className: "bw-p-[2px] bw-w-full", children: /* @__PURE__ */ u(
|
439
439
|
"div",
|
440
440
|
{
|
441
441
|
onClick: () => {
|
442
|
-
|
442
|
+
a(!0);
|
443
443
|
},
|
444
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",
|
445
445
|
style: { cursor: "pointer" },
|
446
446
|
children: [
|
447
|
-
/* @__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: (F = (M = b.data) == null ? void 0 : M.data) != null && F.length ? `+${h - 9}` : "0" }),
|
448
448
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-text-text-primary", children: "Networks" })
|
449
449
|
]
|
450
450
|
}
|
@@ -456,7 +456,7 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
456
456
|
"div",
|
457
457
|
{
|
458
458
|
className: "bw-relative bw-mt-4",
|
459
|
-
style:
|
459
|
+
style: p.length ? {
|
460
460
|
background: "linear-gradient(to right,#A45EFF ,#2CFFE4)",
|
461
461
|
padding: "1px",
|
462
462
|
borderRadius: "5px"
|
@@ -466,15 +466,15 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
466
466
|
"input",
|
467
467
|
{
|
468
468
|
type: "text",
|
469
|
-
value:
|
469
|
+
value: p,
|
470
470
|
onChange: (x) => {
|
471
471
|
f(x.target.value);
|
472
472
|
},
|
473
|
-
className: `bw-text-sm bw-px-2 bw-w-full bw-h-[34px] ${
|
473
|
+
className: `bw-text-sm bw-px-2 bw-w-full bw-h-[34px] ${p.length ? "bw-border-0 bw-border-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`,
|
474
474
|
placeholder: "Search Token Name or Contract Address"
|
475
475
|
}
|
476
476
|
),
|
477
|
-
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (I.isLoading || I.isFetching) &&
|
477
|
+
/* @__PURE__ */ e("div", { className: "bw-absolute bw-right-2 bw-bg-background-container bw-top-[6px]", children: (I.isLoading || I.isFetching) && p.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(H1, {}) }) : p.length ? /* @__PURE__ */ e(
|
478
478
|
"button",
|
479
479
|
{
|
480
480
|
onClick: () => {
|
@@ -487,20 +487,20 @@ function tt({ setChainData: t, setCoinData: n, handleReset: s, chainData: o, coi
|
|
487
487
|
]
|
488
488
|
}
|
489
489
|
),
|
490
|
-
/* @__PURE__ */ e(et, { value:
|
490
|
+
/* @__PURE__ */ e(et, { value: p, handleClosePopup: ne, showExchangeList: c, setChainData: t, setCoinData: n, selectChainState: C })
|
491
491
|
] })
|
492
492
|
] });
|
493
493
|
}
|
494
494
|
function nt({
|
495
495
|
walletDetails: t,
|
496
496
|
handleToDisconnect: n,
|
497
|
-
show:
|
498
|
-
networkType:
|
497
|
+
show: o,
|
498
|
+
networkType: s,
|
499
499
|
handleShowWallet: r,
|
500
500
|
setConnectWalletField: c
|
501
501
|
}) {
|
502
|
-
const [b,
|
503
|
-
c(
|
502
|
+
const [b, w] = N(null), { address: a, chain: p, data: f, disconnect: I, ...T } = t, [P, h] = N(), { connector: y } = ge(), { connectors: C } = M1(), A = () => {
|
503
|
+
c(o), o == "to" ? (v(), n(!0)) : v();
|
504
504
|
};
|
505
505
|
E1(), B(() => {
|
506
506
|
C.length && h(
|
@@ -508,7 +508,7 @@ function nt({
|
|
508
508
|
);
|
509
509
|
}, [C]);
|
510
510
|
async function v() {
|
511
|
-
|
511
|
+
s === "evm" && (p == null ? void 0 : p.network) !== "custom" && (P != null && P[y == null ? void 0 : y.uid]), r();
|
512
512
|
}
|
513
513
|
return /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(
|
514
514
|
"button",
|
@@ -518,8 +518,8 @@ function nt({
|
|
518
518
|
id: "basic-button",
|
519
519
|
style: { fontSize: "12px" },
|
520
520
|
className: "bw-bg-background-container bw-flex bw-items-center bw-justify-center bw-gap-x-2 bw-mb-[4px] bw-w-[100px] bw-h-[25px] bw-rounded-xl bw-border bw-border-border-primary",
|
521
|
-
children:
|
522
|
-
/* @__PURE__ */ e("p", { className: "bw-text-text-primary bw-text-xs bw-font-normal", children: ((
|
521
|
+
children: a ? /* @__PURE__ */ u(K, { children: [
|
522
|
+
/* @__PURE__ */ e("p", { className: "bw-text-text-primary bw-text-xs bw-font-normal", children: ((a == null ? void 0 : a.substring(0, 4)) || "") + "..." + ((a == null ? void 0 : a.substring(a.length - 4, a.length)) || "") }),
|
523
523
|
/* @__PURE__ */ e(
|
524
524
|
"div",
|
525
525
|
{
|
@@ -530,17 +530,17 @@ function nt({
|
|
530
530
|
}
|
531
531
|
) });
|
532
532
|
}
|
533
|
-
function
|
534
|
-
var A, v, Z, H, ne,
|
535
|
-
const b = l((
|
533
|
+
function o1({ chainData: t, setShowExchangeList: n, handleShowWallet: o, setConnectWalletField: s, coinData: r, show: c }) {
|
534
|
+
var A, v, Z, H, ne, L, R, _, J;
|
535
|
+
const b = l((g) => g.configuration), w = l((g) => g.customWallet), { isConnected: a, isConnecting: p, isReconnecting: f } = ge();
|
536
536
|
Ne();
|
537
|
-
const { defaultCoin: I } = Ee, { isAnyWalletConnected: T, getWallet:
|
537
|
+
const { defaultCoin: I } = Ee, { isAnyWalletConnected: T, getWallet: P } = ke({
|
538
538
|
chainData: t,
|
539
539
|
show: c
|
540
540
|
});
|
541
|
-
l((
|
542
|
-
const h = l((
|
543
|
-
function C(
|
541
|
+
l((g) => g.toDisconnect), l((g) => g.setToDisconnect);
|
542
|
+
const h = l((g) => g.fromChain), y = l((g) => g.toChain);
|
543
|
+
function C(g) {
|
544
544
|
}
|
545
545
|
return /* @__PURE__ */ u("div", { className: "bw-w-[50%] ", children: [
|
546
546
|
/* @__PURE__ */ e("p", { className: "bw-text-sm bw-text-left bw-font-medium bw-mb-1 bw-text-text-secondary", children: c == "from" ? "Give" : "Get" }),
|
@@ -575,33 +575,33 @@ function s1({ chainData: t, setShowExchangeList: n, handleShowWallet: s, setConn
|
|
575
575
|
]
|
576
576
|
}
|
577
577
|
),
|
578
|
-
/* @__PURE__ */ e(rt, { isConnected: c == "to" ? (h == null ? void 0 : h.networkType) === (y == null ? void 0 : y.networkType) ? !!((
|
578
|
+
/* @__PURE__ */ e(rt, { isConnected: c == "to" ? (h == null ? void 0 : h.networkType) === (y == null ? void 0 : y.networkType) ? !!((R = (L = P(h)) == null ? void 0 : L.address) != null && R.length || (w == null ? void 0 : w.length) > 30) : !!((J = (_ = P(y)) == null ? void 0 : _.address) != null && J.length || (w == null ? void 0 : w.length) > 30) : T, setConnectWalletField: s, handleShowWallet: o, show: c, chainData: t, handleToDisconnect: C })
|
579
579
|
] });
|
580
580
|
}
|
581
|
-
function rt({ isConnected: t, setConnectWalletField: n, handleShowWallet:
|
581
|
+
function rt({ isConnected: t, setConnectWalletField: n, handleShowWallet: o, show: s, chainData: r, handleToDisconnect: c }) {
|
582
582
|
var f;
|
583
|
-
const b = l((I) => I.customWallet),
|
583
|
+
const b = l((I) => I.customWallet), w = l((I) => I.fromChain), a = l((I) => I.toChain), { getWallet: p } = ke({
|
584
584
|
chainData: r,
|
585
|
-
show:
|
585
|
+
show: s
|
586
586
|
});
|
587
587
|
return /* @__PURE__ */ e("div", { className: "bw-mt-2 bw-flex bw-justify-end", children: t ? /* @__PURE__ */ e(
|
588
588
|
nt,
|
589
589
|
{
|
590
|
-
walletDetails: (b == null ? void 0 : b.length) > 30 &&
|
590
|
+
walletDetails: (b == null ? void 0 : b.length) > 30 && s == "to" ? p({}) : (w == null ? void 0 : w.networkType) == (a == null ? void 0 : a.networkType) && s == "to" ? {
|
591
591
|
disconnect: c,
|
592
|
-
address: (f =
|
593
|
-
} :
|
592
|
+
address: (f = p(w)) == null ? void 0 : f.address
|
593
|
+
} : p(r),
|
594
594
|
handleToDisconnect: c,
|
595
|
-
show:
|
595
|
+
show: s,
|
596
596
|
networkType: r == null ? void 0 : r.networkType,
|
597
597
|
setConnectWalletField: n,
|
598
|
-
handleShowWallet:
|
598
|
+
handleShowWallet: o
|
599
599
|
}
|
600
600
|
) : /* @__PURE__ */ u(
|
601
601
|
"button",
|
602
602
|
{
|
603
603
|
onClick: () => {
|
604
|
-
n(
|
604
|
+
n(s), o();
|
605
605
|
},
|
606
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",
|
607
607
|
children: [
|
@@ -611,17 +611,17 @@ function rt({ isConnected: t, setConnectWalletField: n, handleShowWallet: s, sho
|
|
611
611
|
}
|
612
612
|
) });
|
613
613
|
}
|
614
|
-
const
|
615
|
-
gradient:
|
614
|
+
const ot = "_gradient_15zwe_1", Se = {
|
615
|
+
gradient: ot
|
616
616
|
};
|
617
|
-
function
|
618
|
-
var
|
619
|
-
const
|
617
|
+
function st({ mode: t, handleMode: n }) {
|
618
|
+
var s, r;
|
619
|
+
const o = l((c) => c.configuration);
|
620
620
|
return /* @__PURE__ */ e("div", { className: "bw-flex bw-justify-center", children: /* @__PURE__ */ u(
|
621
621
|
"div",
|
622
622
|
{
|
623
623
|
style: {
|
624
|
-
boxShadow:
|
624
|
+
boxShadow: o && o.customTheme && ((r = (s = o.customTheme) == null ? void 0 : s.shadow) == null ? void 0 : r.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
625
625
|
},
|
626
626
|
className: "bw-flex bw-relative bw-h-[40px] bw-w-full md:bw-w-[90%] bw-items-center",
|
627
627
|
children: [
|
@@ -647,9 +647,9 @@ function ot({ mode: t, handleMode: n }) {
|
|
647
647
|
style: {
|
648
648
|
transition: "left 0.5s",
|
649
649
|
width: "calc(100% / 3)",
|
650
|
-
...
|
650
|
+
...o == null ? void 0 : o.gradientStyle
|
651
651
|
},
|
652
|
-
className: `${!(
|
652
|
+
className: `${!(o != null && o.gradientStyle) && Se.gradient} ${t === "Both" ? "bw-left-[66.5%]" : t === "Priority Fee" ? "bw-left-0" : t === "Jito Tip" ? "bw-left-[33%]" : "bw-hidden"} bw-z-10 bw-cursor-pointer bw-absolute bw-h-[40px] bw-p-[2px] bw-rounded-md `,
|
653
653
|
children: /* @__PURE__ */ e("div", { className: "bw-w-full bw-h-full bw-text-text-primary bw-text-sm bw-font-extrabold bw-flex bw-justify-center bw-items-center bw-rounded-md bw-bg-background-container", children: t })
|
654
654
|
}
|
655
655
|
),
|
@@ -706,21 +706,21 @@ function it({ fill: t }) {
|
|
706
706
|
}
|
707
707
|
function w1({ options: t, handleOptions: n }) {
|
708
708
|
var r, c;
|
709
|
-
const
|
709
|
+
const o = [
|
710
710
|
{ name: "Medium", value: "medium" },
|
711
711
|
{ name: "High", value: "high" },
|
712
712
|
{ name: "Degen", value: "ultra" }
|
713
|
-
],
|
713
|
+
], s = l((b) => b.configuration);
|
714
714
|
return /* @__PURE__ */ u("div", { className: "bw-mt-5 bw-flex bw-items-center bw-justify-between", children: [
|
715
715
|
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal bw-text-text-secondary", children: "Speed" }),
|
716
716
|
/* @__PURE__ */ e(
|
717
717
|
"div",
|
718
718
|
{
|
719
719
|
style: {
|
720
|
-
boxShadow:
|
720
|
+
boxShadow: s && s.customTheme && ((c = (r = s.customTheme) == null ? void 0 : r.shadow) == null ? void 0 : c.boxShadow) || "0px 0px 12.5px 0px #0000001A"
|
721
721
|
},
|
722
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",
|
723
|
-
children:
|
723
|
+
children: o.map((b, w, a) => /* @__PURE__ */ u(
|
724
724
|
"button",
|
725
725
|
{
|
726
726
|
onClick: () => {
|
@@ -743,17 +743,17 @@ function w1({ options: t, handleOptions: n }) {
|
|
743
743
|
children: b.name
|
744
744
|
}
|
745
745
|
),
|
746
|
-
|
746
|
+
a.length - 1 !== w && /* @__PURE__ */ e("div", { className: "bw-h-[70%] bw-absolute bw-right-0 bw-w-[1px] bw-border bw-border-border-primary" }),
|
747
747
|
/* @__PURE__ */ e(
|
748
748
|
"div",
|
749
749
|
{
|
750
750
|
style: {
|
751
751
|
transition: "opacity 0.5s ease-in-out",
|
752
|
-
...
|
752
|
+
...s == null ? void 0 : s.gradientStyle
|
753
753
|
},
|
754
754
|
className: `bw-w-full
|
755
755
|
|
756
|
-
${b.value === t.value ? "bw-opacity-100" : "bw-opacity-0"} bw-absolute bw-bottom-0 bw-h-[2px] bw-rounded-md ${!(
|
756
|
+
${b.value === t.value ? "bw-opacity-100" : "bw-opacity-0"} bw-absolute bw-bottom-0 bw-h-[2px] bw-rounded-md ${!(s != null && s.gradientStyle) && Se.gradient}`
|
757
757
|
}
|
758
758
|
)
|
759
759
|
]
|
@@ -777,11 +777,11 @@ function u1(t) {
|
|
777
777
|
];
|
778
778
|
/^\d$/.test(t.key) || n.includes(t.key) || t.preventDefault();
|
779
779
|
}
|
780
|
-
function m1({ inputVal: t, handleCustomVal: n, title:
|
780
|
+
function m1({ inputVal: t, handleCustomVal: n, title: o, inputSideText: s }) {
|
781
781
|
var c, b;
|
782
|
-
const r = l((
|
782
|
+
const r = l((w) => w.configuration);
|
783
783
|
return /* @__PURE__ */ u("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: [
|
784
|
-
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal", children:
|
784
|
+
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-font-normal", children: o }),
|
785
785
|
/* @__PURE__ */ u(
|
786
786
|
"div",
|
787
787
|
{
|
@@ -797,14 +797,14 @@ function m1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
797
797
|
className: "bw-bg-transparent bw-border-none bw-text-text-primary bw-text-xl bw-font-medium bw-pl-3 bw-pr-2 bw-w-[80%] bw-h-full bw-text-right",
|
798
798
|
value: t,
|
799
799
|
onChange: n,
|
800
|
-
onKeyDown: (
|
801
|
-
u1(
|
800
|
+
onKeyDown: (w) => {
|
801
|
+
u1(w);
|
802
802
|
}
|
803
803
|
}
|
804
804
|
),
|
805
805
|
/* @__PURE__ */ u("div", { className: "bw-w-[20%] bw-h-full bw-flex bw-justify-center bw-items-center", children: [
|
806
806
|
" ",
|
807
|
-
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-text-text-secondary bw-font-normal", children:
|
807
|
+
/* @__PURE__ */ e("h2", { className: "bw-text-sm bw-text-text-secondary bw-font-normal", children: s })
|
808
808
|
] })
|
809
809
|
]
|
810
810
|
}
|
@@ -812,12 +812,12 @@ function m1({ inputVal: t, handleCustomVal: n, title: s, inputSideText: o }) {
|
|
812
812
|
] });
|
813
813
|
}
|
814
814
|
function p1({ handleSave: t, isSaveButtonDisabled: n }) {
|
815
|
-
const
|
816
|
-
return l((
|
815
|
+
const o = l((s) => s.configuration);
|
816
|
+
return l((s) => s.slippage), /* @__PURE__ */ e(
|
817
817
|
"div",
|
818
818
|
{
|
819
|
-
style: { ...
|
820
|
-
className: `${n ? "bw-bg-border-primary" : !(
|
819
|
+
style: { ...o == null ? void 0 : o.gradientStyle },
|
820
|
+
className: `${n ? "bw-bg-border-primary" : !(o != null && o.gradientStyle) && Se.gradient} bw-rounded-sm bw-p-[2px] bw-mt-10`,
|
821
821
|
children: /* @__PURE__ */ e(
|
822
822
|
"button",
|
823
823
|
{
|
@@ -833,7 +833,7 @@ function g1({ handleClose: t }) {
|
|
833
833
|
return /* @__PURE__ */ u("div", { className: "bw-w-full bw-relative bw-flex bw-items-center bw-justify-center", children: [
|
834
834
|
/* @__PURE__ */ e("h2", { className: "bw-text-2xl bw-font-bold bw-text-text-primary", children: "Config" }),
|
835
835
|
/* @__PURE__ */ e(
|
836
|
-
|
836
|
+
z1,
|
837
837
|
{
|
838
838
|
disableRipple: !0,
|
839
839
|
onClick: t,
|
@@ -844,15 +844,15 @@ function g1({ handleClose: t }) {
|
|
844
844
|
] });
|
845
845
|
}
|
846
846
|
function x1({ slippage: t, handleSlippage: n }) {
|
847
|
-
var
|
848
|
-
const
|
847
|
+
var s, r;
|
848
|
+
const o = l((c) => c.configuration);
|
849
849
|
return /* @__PURE__ */ u("div", { className: "bw-flex bw-items-center bw-justify-between", children: [
|
850
850
|
/* @__PURE__ */ e("p", { className: "bw-text-lg bw-font-normal bw-text-text-primary", children: "Max Slippage" }),
|
851
851
|
/* @__PURE__ */ u(
|
852
852
|
"div",
|
853
853
|
{
|
854
854
|
style: {
|
855
|
-
boxShadow:
|
855
|
+
boxShadow: o && o.customTheme && ((r = (s = o.customTheme) == null ? void 0 : s.shadow) == null ? void 0 : r.boxShadow) || "0px 0px 12.5px 0px #0000001A",
|
856
856
|
border: "1px solid var(--tw-border-primary)"
|
857
857
|
},
|
858
858
|
className: " bw-text-lg bw-w-[131px] bw-h-[40px] bw-rounded-md bw-flex bw-items-center ",
|
@@ -891,48 +891,48 @@ function f1() {
|
|
891
891
|
] });
|
892
892
|
}
|
893
893
|
function at({ handleClose: t }) {
|
894
|
-
const [n,
|
895
|
-
function H(
|
896
|
-
b(""),
|
894
|
+
const [n, o] = N(""), [s, r] = N({ name: "Low", value: "low" }), [c, b] = N(""), [w, a] = N(""), [p, f] = N(""), I = l((g) => g.broadCastMode), T = l((g) => g.customFee), P = l((g) => g.setCustomFee), h = l((g) => g.slippage), y = l((g) => g.setSlippage), C = l((g) => g.setBroadCastMode), A = l((g) => g.option), v = l((g) => g.setOption), Z = n == T && A.name == s.name && h == p && (w === I && w !== "" || !n.length && !A.name.length);
|
895
|
+
function H(g) {
|
896
|
+
b(""), o(g.target.value);
|
897
897
|
}
|
898
|
-
function ne(
|
899
|
-
b(""), r(
|
898
|
+
function ne(g, m) {
|
899
|
+
b(""), r(g);
|
900
900
|
}
|
901
901
|
B(() => {
|
902
902
|
r(A);
|
903
903
|
}, [A]), B(() => {
|
904
|
-
T != null && T.length ?
|
904
|
+
T != null && T.length ? o(T) : o("");
|
905
905
|
}, [T]);
|
906
|
-
function
|
907
|
-
v(
|
906
|
+
function L() {
|
907
|
+
v(s);
|
908
908
|
}
|
909
909
|
B(() => {
|
910
910
|
f(h);
|
911
911
|
}, [y]);
|
912
|
-
function
|
913
|
-
f(
|
912
|
+
function R(g) {
|
913
|
+
f(g.target.value);
|
914
914
|
}
|
915
915
|
B(() => {
|
916
|
-
|
916
|
+
a(I);
|
917
917
|
}, [I]);
|
918
918
|
function _() {
|
919
|
-
if (
|
919
|
+
if (w == "" && (n.length || s.name.length)) {
|
920
920
|
C(""), b("Please select a mode");
|
921
921
|
return;
|
922
922
|
}
|
923
|
-
n.length ? (
|
923
|
+
n.length ? (P(n), v(s)) : (P(""), L()), C(w), y(p), t();
|
924
924
|
}
|
925
|
-
function J(
|
926
|
-
b(""),
|
925
|
+
function J(g) {
|
926
|
+
b(""), a(g);
|
927
927
|
}
|
928
928
|
return B(() => {
|
929
|
-
!T && !A.name.length && (C(""),
|
929
|
+
!T && !A.name.length && (C(""), a(""));
|
930
930
|
}, [T, A.name]), /* @__PURE__ */ u("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
931
|
/* @__PURE__ */ e(g1, { handleClose: t }),
|
932
|
-
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage:
|
932
|
+
/* @__PURE__ */ e("div", { className: "bw-mt-5 bw-mb-5", children: /* @__PURE__ */ e(x1, { slippage: p, handleSlippage: R }) }),
|
933
933
|
/* @__PURE__ */ e("div", { className: "bw-mb-5", children: /* @__PURE__ */ e(f1, {}) }),
|
934
|
-
/* @__PURE__ */ e(
|
935
|
-
/* @__PURE__ */ e(w1, { options:
|
934
|
+
/* @__PURE__ */ e(st, { mode: w, handleMode: J }),
|
935
|
+
/* @__PURE__ */ e(w1, { options: s, handleOptions: ne }),
|
936
936
|
/* @__PURE__ */ e(
|
937
937
|
m1,
|
938
938
|
{
|
@@ -955,20 +955,20 @@ function at({ handleClose: t }) {
|
|
955
955
|
] });
|
956
956
|
}
|
957
957
|
function lt({ handleClose: t }) {
|
958
|
-
const [n,
|
958
|
+
const [n, o] = N({ name: "Low", value: "low" }), [s, r] = N(""), [c, b] = N(""), w = l((v) => v.setEvmGas), a = l((v) => v.setEvmSpeed), p = l((v) => v.evmSpeed), f = l((v) => v.evmGas), I = l((v) => v.slippage), T = l((v) => v.setSlippage), P = s == f && p.name == n.name && I == c;
|
959
959
|
function h(v, Z) {
|
960
|
-
|
960
|
+
o(v);
|
961
961
|
}
|
962
962
|
function y(v) {
|
963
963
|
r(v.target.value);
|
964
964
|
}
|
965
965
|
B(() => {
|
966
|
-
|
966
|
+
o(p);
|
967
967
|
}, []), B(() => {
|
968
968
|
f != null && f.length ? r(f) : r("");
|
969
969
|
}, [f]);
|
970
970
|
function C() {
|
971
|
-
|
971
|
+
s.length ? (w(s), a(n)) : (w(""), a(n)), T(c), t();
|
972
972
|
}
|
973
973
|
B(() => {
|
974
974
|
b(I);
|
@@ -986,7 +986,7 @@ function lt({ handleClose: t }) {
|
|
986
986
|
{
|
987
987
|
title: "Gas Price",
|
988
988
|
inputSideText: "GWEI",
|
989
|
-
inputVal:
|
989
|
+
inputVal: s,
|
990
990
|
handleCustomVal: y
|
991
991
|
}
|
992
992
|
),
|
@@ -994,13 +994,13 @@ function lt({ handleClose: t }) {
|
|
994
994
|
p1,
|
995
995
|
{
|
996
996
|
handleSave: C,
|
997
|
-
isSaveButtonDisabled:
|
997
|
+
isSaveButtonDisabled: P
|
998
998
|
}
|
999
999
|
)
|
1000
1000
|
] });
|
1001
1001
|
}
|
1002
1002
|
function ct({ open: t, handleClose: n }) {
|
1003
|
-
const
|
1003
|
+
const o = l((r) => r.fromChain);
|
1004
1004
|
return /* @__PURE__ */ e(
|
1005
1005
|
F1,
|
1006
1006
|
{
|
@@ -1017,7 +1017,7 @@ function ct({ open: t, handleClose: n }) {
|
|
1017
1017
|
// left: "47%",
|
1018
1018
|
// transform: "translate(-50%, -50%)",
|
1019
1019
|
bgcolor: "var(--tw-bg-container)"
|
1020
|
-
}, children:
|
1020
|
+
}, children: o.networkType == "sol" ? /* @__PURE__ */ e(at, { handleClose: n }) : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(lt, { handleClose: n }) }) })
|
1021
1021
|
}
|
1022
1022
|
);
|
1023
1023
|
}
|
@@ -1061,8 +1061,8 @@ function bt({ fill: t }) {
|
|
1061
1061
|
);
|
1062
1062
|
}
|
1063
1063
|
function dt() {
|
1064
|
-
const t = l((
|
1065
|
-
return
|
1064
|
+
const t = l((s) => s.configuration), n = t == null ? void 0 : t.headingStyles, o = (t == null ? void 0 : t.headingText) || "";
|
1065
|
+
return o.length ? /* @__PURE__ */ e(
|
1066
1066
|
"span",
|
1067
1067
|
{
|
1068
1068
|
style: {
|
@@ -1070,7 +1070,7 @@ function dt() {
|
|
1070
1070
|
letterSpacing: "0.05em",
|
1071
1071
|
...n
|
1072
1072
|
},
|
1073
|
-
children:
|
1073
|
+
children: o
|
1074
1074
|
}
|
1075
1075
|
) : /* @__PURE__ */ u("span", { style: { transform: "skewX(20deg)" }, className: "bw-tracking-wider", children: [
|
1076
1076
|
"LA",
|
@@ -1079,7 +1079,7 @@ function dt() {
|
|
1079
1079
|
] });
|
1080
1080
|
}
|
1081
1081
|
function wt() {
|
1082
|
-
const t = l((
|
1082
|
+
const t = l((o) => o.configuration), n = t == null ? void 0 : t.headingContainerStyles;
|
1083
1083
|
return /* @__PURE__ */ e(
|
1084
1084
|
"div",
|
1085
1085
|
{
|
@@ -1112,8 +1112,8 @@ function wt() {
|
|
1112
1112
|
);
|
1113
1113
|
}
|
1114
1114
|
function ut() {
|
1115
|
-
const [t, n] = N(!1),
|
1116
|
-
function
|
1115
|
+
const [t, n] = N(!1), o = l((r) => r.fromChain);
|
1116
|
+
function s() {
|
1117
1117
|
n(!1);
|
1118
1118
|
}
|
1119
1119
|
return /* @__PURE__ */ u(K, { children: [
|
@@ -1122,74 +1122,74 @@ function ut() {
|
|
1122
1122
|
/* @__PURE__ */ e(
|
1123
1123
|
"div",
|
1124
1124
|
{
|
1125
|
-
onClick: () => (
|
1125
|
+
onClick: () => (o == null ? void 0 : o.networkType) !== "cosmos" && n(!0),
|
1126
1126
|
className: "bw-flex bw-relative bw-right-0 bw-items-center bw-gap-x-2",
|
1127
1127
|
children: /* @__PURE__ */ e(K1, { classnames: " ", children: /* @__PURE__ */ e(bt, { fill: "var(--tw-text-secondary)" }) })
|
1128
1128
|
}
|
1129
1129
|
)
|
1130
1130
|
] }),
|
1131
|
-
/* @__PURE__ */ e(ct, { open: t, handleClose:
|
1131
|
+
/* @__PURE__ */ e(ct, { open: t, handleClose: s })
|
1132
1132
|
] });
|
1133
1133
|
}
|
1134
|
-
let
|
1135
|
-
function mt({ confirmRoute: t, setConfirmRoute: n, routes:
|
1136
|
-
const [b,
|
1134
|
+
let s1, Fe, he, Me = 0;
|
1135
|
+
function mt({ confirmRoute: t, setConfirmRoute: n, routes: o, routesData: s, isRoutesEnabled: r, fetchBalance: c }) {
|
1136
|
+
const [b, w] = N(0), { getWallet: a } = ke({}), p = l((y) => y.fromChain), f = a(p), { isConnected: I } = ge();
|
1137
1137
|
B(() => {
|
1138
1138
|
t && clearInterval(he);
|
1139
1139
|
}, [t]), B(() => {
|
1140
1140
|
var y;
|
1141
|
-
b === 0 && document.visibilityState === "visible" && !t && r && ((y = f.address) != null && y.length && c.refetch(),
|
1141
|
+
b === 0 && document.visibilityState === "visible" && !t && r && ((y = f.address) != null && y.length && c.refetch(), o.refetch());
|
1142
1142
|
}, [b, t, r]), B(() => {
|
1143
|
-
|
1144
|
-
}, [
|
1145
|
-
if (!pe.isEmpty(
|
1146
|
-
const y = Math.max(0,
|
1147
|
-
|
1143
|
+
o.isFetching && (Me = 0);
|
1144
|
+
}, [o.isFetching]), B(() => {
|
1145
|
+
if (!pe.isEmpty(s)) {
|
1146
|
+
const y = Math.max(0, s.deadline - Me);
|
1147
|
+
w(y);
|
1148
1148
|
}
|
1149
1149
|
return () => {
|
1150
|
-
|
1150
|
+
w(0);
|
1151
1151
|
};
|
1152
|
-
}, [
|
1152
|
+
}, [s]), B(() => (pe.isEmpty(s) || document.addEventListener("visibilitychange", h), () => {
|
1153
1153
|
document.removeEventListener("visibilitychange", h);
|
1154
|
-
}), [
|
1154
|
+
}), [s]);
|
1155
1155
|
function T() {
|
1156
|
-
|
1156
|
+
s1 = Date.now(), w((y) => (Fe = y, y));
|
1157
1157
|
}
|
1158
|
-
function
|
1159
|
-
let y = Date.now(), C = Math.round((y -
|
1160
|
-
|
1158
|
+
function P() {
|
1159
|
+
let y = Date.now(), C = Math.round((y - s1) / 1e3);
|
1160
|
+
s.deadline - Fe + C > s.deadline ? n((A) => {
|
1161
1161
|
var v;
|
1162
|
-
return A || ((v = f.address) != null && v.length && c.refetch(),
|
1163
|
-
}) : Fe && C &&
|
1162
|
+
return A || ((v = f.address) != null && v.length && c.refetch(), o.refetch(), w(s.deadline)), A;
|
1163
|
+
}) : Fe && C && w(Fe - C);
|
1164
1164
|
}
|
1165
1165
|
function h() {
|
1166
|
-
document.visibilityState === "visible" ?
|
1166
|
+
document.visibilityState === "visible" ? P() : T();
|
1167
1167
|
}
|
1168
|
-
return B(() => (pe.isEmpty(
|
1169
|
-
|
1168
|
+
return B(() => (pe.isEmpty(s) ? he && clearInterval(he) : he = setInterval(() => {
|
1169
|
+
w((y) => y <= 0 ? (Me = 0, s.deadline) : (Me++, y - 1));
|
1170
1170
|
}, 1e3), () => {
|
1171
1171
|
he && clearInterval(he);
|
1172
|
-
}), [
|
1172
|
+
}), [s]), l((y) => y.timerValue), { quoteTimer: b, setQuoteTimer: w };
|
1173
1173
|
}
|
1174
|
-
function pt(t, n,
|
1175
|
-
const { primaryWallet:
|
1176
|
-
if (!
|
1177
|
-
const
|
1178
|
-
if (
|
1174
|
+
function pt(t, n, o) {
|
1175
|
+
const { primaryWallet: s } = Ne(), [r, c] = N(0), b = async (w) => {
|
1176
|
+
if (!s) return;
|
1177
|
+
const a = new ze(w || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed");
|
1178
|
+
if (a)
|
1179
1179
|
try {
|
1180
|
-
const
|
1181
|
-
|
1180
|
+
const p = new be(s.address);
|
1181
|
+
a.onAccountChange(p, (T) => {
|
1182
1182
|
c(T.lamports / 1e9);
|
1183
1183
|
});
|
1184
|
-
const I = await
|
1185
|
-
c(I),
|
1184
|
+
const I = await a.getBalance(p) / 1e9;
|
1185
|
+
c(I), o(!1);
|
1186
1186
|
} catch {
|
1187
|
-
|
1187
|
+
o(!1);
|
1188
1188
|
}
|
1189
1189
|
};
|
1190
1190
|
return B(() => {
|
1191
1191
|
(t == null ? void 0 : t.networkType) === "sol" && b((t == null ? void 0 : t.chainId) === "eclipse-svm" ? "https://eclipse.lgns.net/" : null);
|
1192
|
-
}, [t == null ? void 0 : t.networkType,
|
1192
|
+
}, [t == null ? void 0 : t.networkType, s, t == null ? void 0 : t.chainId, s == null ? void 0 : s.address]), { balanceSol: r, getBalanceSol: b };
|
1193
1193
|
}
|
1194
1194
|
function gt(t) {
|
1195
1195
|
return t == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" ? "" : t;
|
@@ -1200,25 +1200,25 @@ new be("So11111111111111111111111111111111111111112");
|
|
1200
1200
|
new be("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");
|
1201
1201
|
async function ht(t, n) {
|
1202
1202
|
if (!t) return;
|
1203
|
-
const
|
1203
|
+
const o = new ze(n || "https://tammi-n3hltb-fast-mainnet.helius-rpc.com/", "confirmed"), s = new be(t), r = await o.getParsedTokenAccountsByOwner(s, {
|
1204
1204
|
programId: n ? ft : xt
|
1205
1205
|
});
|
1206
1206
|
let c = {};
|
1207
1207
|
for (const { account: b } of r.value) {
|
1208
|
-
const
|
1209
|
-
c[
|
1208
|
+
const w = b.data.parsed.info.mint, a = b.data.parsed.info.tokenAmount.uiAmount;
|
1209
|
+
c[w] = a;
|
1210
1210
|
}
|
1211
1211
|
return c;
|
1212
1212
|
}
|
1213
1213
|
function yt(t, n) {
|
1214
|
-
const [
|
1214
|
+
const [o, s] = N(0), { primaryWallet: r, setPrimaryWallet: c } = Ne(), [b, w] = N(!1), a = l((m) => m.fromChain), { address: p, isConnected: f } = ge(), I = l((m) => m.cosmosChainIds), { data: T, isConnected: P } = Oe({
|
1215
1215
|
chainId: I,
|
1216
1216
|
multiChain: !0
|
1217
|
-
}), h = l((
|
1218
|
-
address:
|
1217
|
+
}), h = l((m) => m.fromCoin), { data: y, isLoading: C } = O1({
|
1218
|
+
address: p,
|
1219
1219
|
token: gt((h == null ? void 0 : h.address) || ""),
|
1220
|
-
chainId: Number((
|
1221
|
-
enabled: !!((
|
1220
|
+
chainId: Number((a == null ? void 0 : a.chainId) || 0),
|
1221
|
+
enabled: !!((a.networkType == "evm" || n) && p && (p != null && p.length))
|
1222
1222
|
}), {
|
1223
1223
|
data: A,
|
1224
1224
|
isLoading: v,
|
@@ -1226,142 +1226,117 @@ function yt(t, n) {
|
|
1226
1226
|
isInitialLoading: H,
|
1227
1227
|
isRefetching: ne
|
1228
1228
|
} = c1({
|
1229
|
-
chainId: [
|
1229
|
+
chainId: [a.chainId],
|
1230
1230
|
multiChain: !0
|
1231
1231
|
});
|
1232
|
-
async function
|
1232
|
+
async function L(m) {
|
1233
1233
|
if (!r) return;
|
1234
|
-
const
|
1235
|
-
if (
|
1234
|
+
const k = new ze(m || "https://solana-rpc.publicnode.com");
|
1235
|
+
if (k)
|
1236
1236
|
try {
|
1237
1237
|
const M = new be(r.address);
|
1238
|
-
|
1239
|
-
const
|
1240
|
-
|
1238
|
+
w(!0);
|
1239
|
+
const x = await k.getBalance(M) / 1e9;
|
1240
|
+
s(x), w(!1);
|
1241
1241
|
} catch {
|
1242
|
-
|
1242
|
+
w(!1);
|
1243
1243
|
}
|
1244
1244
|
}
|
1245
|
-
async function
|
1245
|
+
async function R(m) {
|
1246
1246
|
try {
|
1247
|
-
|
1248
|
-
let
|
1249
|
-
|
1247
|
+
w(!0);
|
1248
|
+
let k = await ht(r.address, m);
|
1249
|
+
w(!1), s(k == null ? void 0 : k[h == null ? void 0 : h.address]);
|
1250
1250
|
} catch {
|
1251
|
-
|
1251
|
+
w(!1);
|
1252
1252
|
}
|
1253
1253
|
}
|
1254
1254
|
let _;
|
1255
1255
|
async function J() {
|
1256
1256
|
if (!r) return;
|
1257
|
-
const
|
1258
|
-
if (!
|
1259
|
-
const
|
1260
|
-
|
1261
|
-
var
|
1262
|
-
|
1263
|
-
if (((x = h == null ? void 0 : h.symbol) == null ? void 0 : x.toLowerCase()) === "sol")
|
1264
|
-
F();
|
1265
|
-
else if (i.chainId === "eclipse-svm")
|
1266
|
-
h.symbol == "ETH" ? F("https://eclipse.lgns.net/") : $("https://eclipse.lgns.net/");
|
1267
|
-
else {
|
1268
|
-
if (i.networkType === "btc" || i.networkType === "sui")
|
1269
|
-
return;
|
1270
|
-
$();
|
1271
|
-
}
|
1257
|
+
const m = await r.connector.getPublicClient();
|
1258
|
+
if (!m) return;
|
1259
|
+
const k = new be(r.address);
|
1260
|
+
k && (_ = m.onAccountChange(k, (M) => {
|
1261
|
+
var F;
|
1262
|
+
a.networkType == "sol" && (r != null && r.address) && (((F = h == null ? void 0 : h.symbol) == null ? void 0 : F.toLowerCase()) === "sol" ? L() : a.chainId === "eclipse-svm" ? h.symbol == "ETH" ? L("https://eclipse.lgns.net/") : R("https://eclipse.lgns.net/") : R());
|
1272
1263
|
}));
|
1273
1264
|
}
|
1274
|
-
|
1275
|
-
d(!0);
|
1276
|
-
const g = await r.getBalance();
|
1277
|
-
o(g), d(!1);
|
1278
|
-
}
|
1279
|
-
B(() => ((i == null ? void 0 : i.networkType) === "sol" && J(), async () => {
|
1265
|
+
B(() => ((a == null ? void 0 : a.networkType) === "sol" && J(), async () => {
|
1280
1266
|
if (!r) return;
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
let P = A[g] || A;
|
1267
|
+
(await r.connector.getPublicClient()).removeAccountChangeListener(_);
|
1268
|
+
}), [r == null ? void 0 : r.address, a == null ? void 0 : a.networkType, h]);
|
1269
|
+
async function g(m) {
|
1270
|
+
var M, F;
|
1271
|
+
let k = A[m] || A;
|
1287
1272
|
try {
|
1288
|
-
|
1289
|
-
let
|
1290
|
-
|
1273
|
+
w(!0);
|
1274
|
+
let x = await k.getAllBalances((M = T == null ? void 0 : T[m]) == null ? void 0 : M.bech32Address), O = pe.keyBy(x, "denom");
|
1275
|
+
s(((F = O[d1(h.address)]) == null ? void 0 : F.amount) / Math.pow(10, h.decimals) || 0), w(!1);
|
1291
1276
|
} catch {
|
1292
|
-
|
1277
|
+
w(!1);
|
1293
1278
|
}
|
1294
1279
|
}
|
1295
1280
|
return B(() => {
|
1296
|
-
var
|
1297
|
-
|
1298
|
-
}, [
|
1299
|
-
getbal:
|
1300
|
-
isBalanceLoading: (
|
1281
|
+
var m;
|
1282
|
+
a.networkType == "sol" && (r != null && r.address) ? ((m = h == null ? void 0 : h.symbol) == null ? void 0 : m.toLowerCase()) === "sol" ? L() : a.chainId == "eclipse-svm" ? h.symbol == "ETH" ? L("https://eclipse.lgns.net/") : R("https://eclipse.lgns.net/") : R() : a.networkType == "evm" && p && (p != null && p.length) ? s(Number((y == null ? void 0 : y.formatted) || 0)) : a.networkType == "cosmos" && P && !v && g(a == null ? void 0 : a.chainId);
|
1283
|
+
}, [a.networkType, a == null ? void 0 : a.chainId, h.symbol, h == null ? void 0 : h.address, y, p, r == null ? void 0 : r.address, p, P, v, t]), {
|
1284
|
+
getbal: o,
|
1285
|
+
isBalanceLoading: (a == null ? void 0 : a.networkType) == "sol" || (a == null ? void 0 : a.networkType) == "cosmos" ? b : (a == null ? void 0 : a.networkType) == "evm" ? C : !1
|
1301
1286
|
};
|
1302
1287
|
}
|
1303
|
-
const Ct = de.lazy(() => import("./SwapAsset-
|
1304
|
-
function jt({ handleShowWallet: t, showWallet: n, fetchChains:
|
1305
|
-
var Ge, Ke, Je, qe, Xe, Qe,
|
1306
|
-
const [
|
1288
|
+
const Ct = de.lazy(() => import("./SwapAsset-CDj2n4b6.js")), vt = de.lazy(() => import("./InputComp-BFISyDWr.js")), kt = de.lazy(() => import("./QuotesProgress-kJ3vM5WP.js")), Nt = de.lazy(() => import("./TxnButton-lLEwer9x.js")), Tt = de.lazy(() => import("./index-BHJKbDqF.js").then((t) => t.i)), It = de.lazy(() => import("./index-Dj6xjKNe.js")), Bt = de.lazy(() => import("./LoadRoute-aCQoKb3B.js")), At = de.lazy(() => import("./AllRoutes-C_rcXmmZ.js"));
|
1289
|
+
function jt({ handleShowWallet: t, showWallet: n, fetchChains: o }) {
|
1290
|
+
var Ge, Ke, Je, qe, Xe, Qe, We;
|
1291
|
+
const [s, r] = N(), [c, b] = N(!1), [w, a] = N(!1), [p, f] = N(!1), [I, T] = N(!1), [P, h] = N("all"), [y, C] = N(!1), { primaryWallet: A } = Ne();
|
1307
1292
|
$1();
|
1308
|
-
const { address: v } = ge(), { address: Z } = a1(), { getbal: H, isBalanceLoading: ne } = yt(y), { data:
|
1309
|
-
l((
|
1310
|
-
const _ = l((
|
1311
|
-
l((
|
1312
|
-
const Te = l((
|
1313
|
-
let
|
1314
|
-
const
|
1293
|
+
const { address: v } = ge(), { address: Z } = a1(), { getbal: H, isBalanceLoading: ne } = yt(y), { data: L, isConnected: R } = Oe({ chainId: "cosmoshub-4" });
|
1294
|
+
l((i) => i.configuration);
|
1295
|
+
const _ = l((i) => i.persist), J = l((i) => i.setPersist), g = l((i) => i.route), m = l((i) => i.fromChain), k = l((i) => i.toChain), M = l((i) => i.fromCoin), F = l((i) => i.toCoin), x = l((i) => i.setFromChain), O = l((i) => i.setToChain), $ = l((i) => i.setFromCoin), E = l((i) => i.setToCoin), j = l((i) => i.amount), V = l((i) => i.setAmount), ie = l((i) => i.customWallet);
|
1296
|
+
l((i) => i.setToDisconnect);
|
1297
|
+
const Te = l((i) => i.setCosmosChainIds), Y = l((i) => i.customFee), G = l((i) => i.broadCastMode), Q = l((i) => i.evmGas), z = l((i) => i.evmSpeed), Ie = l((i) => i.slippage), ye = l((i) => i.option), Be = l((i) => i.setCustomWallet), Ae = l((i) => i.setSelectedProvider), { balanceSol: d } = pt(m, y, Re), { suggestAndConnectAsync: D } = S1(), re = !!(j.length && m.chain.length && M.coin.length && k.chain.length && F.coin.length && !p && I), le = ["routes", v, m, k, M, F, j, A == null ? void 0 : A.address, Z, ie, L == null ? void 0 : L.bech32Address, Y, Q, z, Ie, G, ye.value];
|
1298
|
+
let oe = (G === "Priority Fee" || G === "Both") && (Y != null && Y.length) ? Y : ye.value, se = (G === "Jito Tip" || G === "Both") && (Y != null && Y.length) ? Y : ye.value, q = Q != null && Q.length ? Q : z.value;
|
1299
|
+
const W = (m == null ? void 0 : m.networkType) === "sol" ? G === "Priority Fee" ? `&solanaPriorityFee=${oe}` : G === "Jito Tip" ? `&solanaJitoTip=${se}` : `&solanaPriorityFee=${oe}&solanaJitoTip=${se}` : (m == null ? void 0 : m.networkType) === "evm" ? `&evmPriorityFee=${q}` : "", { getWallet: U, refetch: ee } = ke({}), { routes: S, routesData: X, setRoutesData: ce, errorMessage: te, setErrorMessage: Ce } = J1({
|
1315
1300
|
enabled: re,
|
1316
1301
|
dependency: le,
|
1317
|
-
payload: [
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
M,
|
1323
|
-
j,
|
1324
|
-
Number(Ie) * 100,
|
1325
|
-
(ie == null ? void 0 : ie.length) > 30 ? ((Je = Y({})) == null ? void 0 : Je.address) || "" : (g == null ? void 0 : g.networkType) === "cosmos" ? n1(F == null ? void 0 : F.bech32Address, (qe = g == null ? void 0 : g.chainInfo) == null ? void 0 : qe.bech32Config.bech32PrefixAccAddr) : ((Xe = Y(g)) == null ? void 0 : Xe.address) || "",
|
1326
|
-
U
|
1327
|
-
]
|
1328
|
-
}), ae = Y(k), we = l1({
|
1329
|
-
queryKey: ["balance", ae == null ? void 0 : ae.address, k],
|
1330
|
-
queryFn: async () => await (await Se.fetchBalance(ae.address, k.chainId)).json(),
|
1331
|
-
enabled: !!((Qe = ae == null ? void 0 : ae.address) != null && Qe.length && k.chainId),
|
1302
|
+
payload: [(m == null ? void 0 : m.networkType) === "cosmos" ? n1(L == null ? void 0 : L.bech32Address, (Ge = m == null ? void 0 : m.chainInfo) == null ? void 0 : Ge.bech32Config.bech32PrefixAccAddr) : ((Ke = U(m)) == null ? void 0 : Ke.address) || "", m, k, M, F, j, Number(Ie) * 100, (ie == null ? void 0 : ie.length) > 30 ? ((Je = U({})) == null ? void 0 : Je.address) || "" : (k == null ? void 0 : k.networkType) === "cosmos" ? n1(L == null ? void 0 : L.bech32Address, (qe = k == null ? void 0 : k.chainInfo) == null ? void 0 : qe.bech32Config.bech32PrefixAccAddr) : ((Xe = U(k)) == null ? void 0 : Xe.address) || "", W]
|
1303
|
+
}), ae = U(m), we = l1({
|
1304
|
+
queryKey: ["balance", ae == null ? void 0 : ae.address, m],
|
1305
|
+
queryFn: async () => await (await Ve.fetchBalance(ae.address, m.chainId)).json(),
|
1306
|
+
enabled: !!((Qe = ae == null ? void 0 : ae.address) != null && Qe.length && m.chainId),
|
1332
1307
|
refetchOnWindowFocus: !1
|
1333
1308
|
}), { quoteTimer: je } = mt({
|
1334
|
-
routes:
|
1309
|
+
routes: S,
|
1335
1310
|
routesData: X,
|
1336
|
-
confirmRoute:
|
1337
|
-
setConfirmRoute:
|
1311
|
+
confirmRoute: w,
|
1312
|
+
setConfirmRoute: a,
|
1338
1313
|
isRoutesEnabled: re,
|
1339
1314
|
fetchBalance: we
|
1340
1315
|
});
|
1341
1316
|
B(() => {
|
1342
1317
|
j || ce({});
|
1343
|
-
let
|
1344
|
-
return Number(j) > 0 && (
|
1318
|
+
let i;
|
1319
|
+
return Number(j) > 0 && (i = setTimeout(() => {
|
1345
1320
|
T(!0);
|
1346
1321
|
}, 500)), () => {
|
1347
|
-
clearTimeout(
|
1322
|
+
clearTimeout(i), T(!1);
|
1348
1323
|
};
|
1349
1324
|
}, [j]), B(() => {
|
1350
|
-
|
1351
|
-
}, [
|
1352
|
-
function ve(
|
1353
|
-
f(
|
1325
|
+
S.isFetching && ce({});
|
1326
|
+
}, [S.isFetching]);
|
1327
|
+
function ve(i) {
|
1328
|
+
f(i);
|
1354
1329
|
}
|
1355
1330
|
function Pe() {
|
1356
1331
|
r();
|
1357
1332
|
}
|
1358
|
-
async function Le(
|
1359
|
-
if (
|
1333
|
+
async function Le(i) {
|
1334
|
+
if (R)
|
1360
1335
|
try {
|
1361
1336
|
let ue = await t1();
|
1362
|
-
if (ue.length && !ue.includes(
|
1337
|
+
if (ue.length && !ue.includes(i.chainId)) {
|
1363
1338
|
let xe = await D({
|
1364
|
-
chainInfo:
|
1339
|
+
chainInfo: i,
|
1365
1340
|
walletType: Z1.KEPLR
|
1366
1341
|
}), me = await ee(), fe = await t1();
|
1367
1342
|
Te(fe);
|
@@ -1371,23 +1346,23 @@ function jt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1371
1346
|
else
|
1372
1347
|
return;
|
1373
1348
|
}
|
1374
|
-
function h1(
|
1375
|
-
(
|
1349
|
+
function h1(i) {
|
1350
|
+
(i == null ? void 0 : i.networkType) == "cosmos" && Le(i.chainInfo), V(""), Ce({ error: "" }), s == "from" ? x({ ...i }) : s == "to" && O({ ...i });
|
1376
1351
|
}
|
1377
|
-
function y1(
|
1378
|
-
Ce({ error: "" }),
|
1352
|
+
function y1(i) {
|
1353
|
+
Ce({ error: "" }), V(""), s == "from" ? $({ ...i }) : s == "to" && E({ ...i });
|
1379
1354
|
}
|
1380
1355
|
function Ze() {
|
1381
1356
|
b(!c);
|
1382
1357
|
}
|
1383
|
-
function He(
|
1384
|
-
|
1358
|
+
function He(i) {
|
1359
|
+
a(typeof i < "u" ? i : !w);
|
1385
1360
|
}
|
1386
|
-
function Re(
|
1387
|
-
C(
|
1361
|
+
function Re(i) {
|
1362
|
+
C(i);
|
1388
1363
|
}
|
1389
|
-
function C1(
|
1390
|
-
Ae(
|
1364
|
+
function C1(i) {
|
1365
|
+
Ae(i == null ? void 0 : i.provider), ce(i);
|
1391
1366
|
}
|
1392
1367
|
function v1() {
|
1393
1368
|
setTimeout(() => {
|
@@ -1395,56 +1370,56 @@ function jt({ handleShowWallet: t, showWallet: n, fetchChains: s }) {
|
|
1395
1370
|
}, 1e3);
|
1396
1371
|
}
|
1397
1372
|
function k1() {
|
1398
|
-
|
1373
|
+
V("");
|
1399
1374
|
}
|
1400
|
-
function N1(
|
1401
|
-
|
1402
|
-
var fe,
|
1403
|
-
(
|
1375
|
+
function N1(i, ue, xe) {
|
1376
|
+
Ve.fetchTokens(i.chainId, xe).then((me) => me.json()).then((me) => {
|
1377
|
+
var fe, Ue;
|
1378
|
+
(Ue = (fe = me.data) == null ? void 0 : fe[i.chainId]) == null || Ue.forEach((Ye) => {
|
1404
1379
|
ue({
|
1405
|
-
...
|
1406
|
-
coin:
|
1407
|
-
...
|
1380
|
+
...M,
|
1381
|
+
coin: Ye.symbol,
|
1382
|
+
...Ye,
|
1408
1383
|
availBal: ""
|
1409
1384
|
});
|
1410
1385
|
});
|
1411
1386
|
});
|
1412
1387
|
}
|
1413
1388
|
function T1() {
|
1414
|
-
|
1389
|
+
V(""), x(k), $(F), O(m), E(M), m.networkType !== k.networkType && Be("");
|
1415
1390
|
}
|
1416
1391
|
B(() => {
|
1417
|
-
_.isHistory &&
|
1392
|
+
_.isHistory && g === "" && (J({}), ve(!1));
|
1418
1393
|
}, [_]);
|
1419
|
-
function I1(
|
1394
|
+
function I1(i) {
|
1420
1395
|
var ue;
|
1421
|
-
if (
|
1422
|
-
let xe = pe.keyBy(
|
1396
|
+
if (i && o.isSuccess && i !== (k == null ? void 0 : k.networkType) && i !== (m == null ? void 0 : m.networkType)) {
|
1397
|
+
let xe = pe.keyBy(o.data.data, "chainId"), me = i == "evm" ? "8453" : i == "sol" ? "sol" : "cosmoshub-4", fe = i == "evm" ? "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" : i == "sol" ? "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" : "uatom";
|
1423
1398
|
x({
|
1424
1399
|
...xe[me],
|
1425
1400
|
chain: ((ue = xe[me]) == null ? void 0 : ue.name) || ""
|
1426
|
-
}), N1(xe[me],
|
1401
|
+
}), N1(xe[me], $, fe);
|
1427
1402
|
} else
|
1428
1403
|
return;
|
1429
1404
|
}
|
1430
|
-
return /* @__PURE__ */ e(A1, { fallback: /* @__PURE__ */ e(L1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(Tt, { connectWalletField:
|
1405
|
+
return /* @__PURE__ */ e(A1, { fallback: /* @__PURE__ */ e(L1, {}), children: /* @__PURE__ */ e("div", { children: n ? /* @__PURE__ */ e(Tt, { connectWalletField: P, handleShowWallet: t, handleRecentSelectedWallet: I1 }) : !w && !((We = _ == null ? void 0 : _.routeId) != null && We.length) ? c ? /* @__PURE__ */ e(At, { routes: S, handleShowAllRoutes: Ze, handleRoutesData: C1, convertVal: (F == null ? void 0 : F.lastPrice) || 0, amount: j }) : s ? /* @__PURE__ */ e(tt, { chainData: s == "from" ? m : k, coinData: s == "from" ? M : F, setChainData: h1, setCoinData: y1, handleReset: Pe, showExchangeList: s, fetchBalance: we, fetchChains: o }) : /* @__PURE__ */ u(K, { children: [
|
1431
1406
|
/* @__PURE__ */ e(ut, {}),
|
1432
1407
|
/* @__PURE__ */ u("div", { className: "bw-flex bw-relative bw-items-center bw-gap-x-2 bw-justify-between", children: [
|
1433
1408
|
/* @__PURE__ */ e(Ct, { handleSwap: T1 }),
|
1434
|
-
/* @__PURE__ */ e(
|
1435
|
-
/* @__PURE__ */ e(
|
1409
|
+
/* @__PURE__ */ e(o1, { chainData: m, show: "from", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: h, coinData: M }),
|
1410
|
+
/* @__PURE__ */ e(o1, { chainData: k, show: "to", handleShowWallet: t, setShowExchangeList: r, setConnectWalletField: h, coinData: F })
|
1436
1411
|
] }),
|
1437
|
-
/* @__PURE__ */ e(vt, { amount: j, setAmount:
|
1438
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Bt, { routes:
|
1412
|
+
/* @__PURE__ */ e(vt, { amount: j, setAmount: V, fetchBalance: we, getCoinBalance: H, isBalanceLoading: ne }),
|
1413
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(Bt, { routes: S, handleShowAllRoutes: Ze, routesData: X, amount: j, isRoutesEnabled: I, price: ((X == null ? void 0 : X.outputAmountDisplay) || "") * ((F == null ? void 0 : F.lastPrice) || 0) }) }),
|
1439
1414
|
/* @__PURE__ */ e("p", { className: "bw-text-xs bw-font-normal bw-py-1 bw-text-text-redtext", children: typeof (te == null ? void 0 : te.error) == "string" ? te == null ? void 0 : te.error : "" }),
|
1440
|
-
/* @__PURE__ */ e(kt, { amount: I, routes:
|
1441
|
-
/* @__PURE__ */ e(Nt, { routesData: X, handleSuccess: Re, routes:
|
1442
|
-
] }) : /* @__PURE__ */ e(It, { handleConfirmClose: He, amount: j, routesData: X, resetAmount: k1, routes:
|
1415
|
+
/* @__PURE__ */ e(kt, { amount: I, routes: S, routesData: X, quoteTimer: je }),
|
1416
|
+
/* @__PURE__ */ e(Nt, { routesData: X, handleSuccess: Re, routes: S, fetchBalancePrev: we, amount: j, isAmountTyped: I, handleShowWallet: t, setConnectWalletField: h, handleConfirmClose: He, balanceSol: d, getCoinBalance: H })
|
1417
|
+
] }) : /* @__PURE__ */ e(It, { handleConfirmClose: He, amount: j, routesData: X, resetAmount: k1, routes: S, handleStopRoute: ve, resetBalance: v1 }) }) });
|
1443
1418
|
}
|
1444
1419
|
function Pt({ fetchChains: t }) {
|
1445
|
-
const [n,
|
1420
|
+
const [n, o] = N(!1), { isConnected: s } = ge();
|
1446
1421
|
function r(c) {
|
1447
|
-
|
1422
|
+
o(!n);
|
1448
1423
|
}
|
1449
1424
|
return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
1450
1425
|
jt,
|
@@ -1464,5 +1439,5 @@ export {
|
|
1464
1439
|
Kt as i,
|
1465
1440
|
d1 as p,
|
1466
1441
|
u1 as r,
|
1467
|
-
|
1442
|
+
U1 as u
|
1468
1443
|
};
|