rujira.ui 1.0.16 → 1.0.18

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.
Files changed (66) hide show
  1. package/lib/cjs/components/footer/Footer.js +1 -1
  2. package/lib/cjs/components/header/Accounts.js +8 -9
  3. package/lib/cjs/components/header/Header.js +25 -19
  4. package/lib/cjs/components/header/ResolveLink.js +1 -1
  5. package/lib/cjs/components/logos/RujiraLogo.js +2 -2
  6. package/lib/cjs/context/GlobalModal.js +1 -1
  7. package/lib/cjs/hooks/useWindowSize.js +12 -13
  8. package/lib/cjs/i18n/config.js +2 -0
  9. package/lib/cjs/wallets/providers/eip6963.js +4 -2
  10. package/lib/cjs/wallets/providers/keplr.js +5 -1
  11. package/lib/cjs/wallets/providers/leap.js +4 -1
  12. package/lib/cjs/wallets/providers/okx.js +4 -1
  13. package/lib/cjs/wallets/providers/station.js +4 -1
  14. package/lib/cjs/wallets/providers/ton.js +9 -3
  15. package/lib/cjs/wallets/providers/xaman.js +30 -9
  16. package/lib/cjs/wallets/storage.js +20 -19
  17. package/lib/esm/components/footer/Footer.js +1 -1
  18. package/lib/esm/components/header/Accounts.d.ts +1 -1
  19. package/lib/esm/components/header/Accounts.d.ts.map +1 -1
  20. package/lib/esm/components/header/Accounts.js +8 -9
  21. package/lib/esm/components/header/Header.d.ts.map +1 -1
  22. package/lib/esm/components/header/Header.js +25 -19
  23. package/lib/esm/components/header/ResolveLink.js +1 -1
  24. package/lib/esm/components/logos/RujiraLogo.js +2 -2
  25. package/lib/esm/context/GlobalModal.d.ts.map +1 -1
  26. package/lib/esm/context/GlobalModal.js +1 -1
  27. package/lib/esm/hooks/useWindowSize.d.ts.map +1 -1
  28. package/lib/esm/hooks/useWindowSize.js +13 -14
  29. package/lib/esm/i18n/config.d.ts.map +1 -1
  30. package/lib/esm/i18n/config.js +2 -0
  31. package/lib/esm/wallets/providers/eip6963.d.ts.map +1 -1
  32. package/lib/esm/wallets/providers/eip6963.js +4 -2
  33. package/lib/esm/wallets/providers/keplr.d.ts.map +1 -1
  34. package/lib/esm/wallets/providers/keplr.js +5 -1
  35. package/lib/esm/wallets/providers/leap.d.ts.map +1 -1
  36. package/lib/esm/wallets/providers/leap.js +4 -1
  37. package/lib/esm/wallets/providers/okx.d.ts.map +1 -1
  38. package/lib/esm/wallets/providers/okx.js +4 -1
  39. package/lib/esm/wallets/providers/station.d.ts.map +1 -1
  40. package/lib/esm/wallets/providers/station.js +4 -1
  41. package/lib/esm/wallets/providers/ton.d.ts +2 -1
  42. package/lib/esm/wallets/providers/ton.d.ts.map +1 -1
  43. package/lib/esm/wallets/providers/ton.js +9 -3
  44. package/lib/esm/wallets/providers/xaman.d.ts +4 -1
  45. package/lib/esm/wallets/providers/xaman.d.ts.map +1 -1
  46. package/lib/esm/wallets/providers/xaman.js +30 -9
  47. package/lib/esm/wallets/storage.d.ts +0 -9
  48. package/lib/esm/wallets/storage.d.ts.map +1 -1
  49. package/lib/esm/wallets/storage.js +20 -19
  50. package/package.json +1 -1
  51. package/src/components/footer/Footer.tsx +5 -5
  52. package/src/components/header/Accounts.tsx +13 -13
  53. package/src/components/header/Header.tsx +29 -29
  54. package/src/components/header/ResolveLink.tsx +1 -1
  55. package/src/components/logos/RujiraLogo.tsx +2 -2
  56. package/src/context/GlobalModal.tsx +2 -1
  57. package/src/hooks/useWindowSize.ts +15 -14
  58. package/src/i18n/config.ts +1 -0
  59. package/src/wallets/providers/eip6963.ts +7 -6
  60. package/src/wallets/providers/keplr.ts +6 -4
  61. package/src/wallets/providers/leap.ts +8 -4
  62. package/src/wallets/providers/okx.ts +9 -5
  63. package/src/wallets/providers/station.ts +8 -4
  64. package/src/wallets/providers/ton.ts +9 -3
  65. package/src/wallets/providers/xaman.ts +32 -12
  66. package/src/wallets/storage.ts +20 -19
@@ -22,7 +22,7 @@ const footerSections = [
22
22
  {
23
23
  kind: "internal",
24
24
  label: "Automated Trading",
25
- to: "/trade/BTC/USDC?orders=range&order=tracking&range=t",
25
+ to: "/trade/BTC/USDC?orders=range&order=tracking",
26
26
  },
27
27
  {
28
28
  kind: "internal",
@@ -6,7 +6,6 @@ const clsx_1 = require("clsx");
6
6
  const react_1 = require("motion/react");
7
7
  const react_2 = require("react");
8
8
  const react_hot_toast_1 = require("react-hot-toast");
9
- const react_router_dom_1 = require("react-router-dom");
10
9
  const react_tooltip_1 = require("react-tooltip");
11
10
  const rujira_js_1 = require("rujira.js");
12
11
  const __1 = require("../..");
@@ -19,7 +18,7 @@ const Icons_1 = require("../icons/Icons");
19
18
  const NetworkIcon_1 = require("../icons/NetworkIcon");
20
19
  const Fiat_1 = require("../numbers/Fiat");
21
20
  const ResolveLink_1 = require("./ResolveLink");
22
- let referral = localStorage.getItem("referral");
21
+ let referral = typeof window !== "undefined" ? localStorage.getItem("referral") : null;
23
22
  const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, customActions, }) => {
24
23
  const { t } = (0, i18n_1.useTranslation)("header");
25
24
  const { accounts: allAccounts, disconnectAll, selected } = provider;
@@ -37,7 +36,7 @@ const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, c
37
36
  }, children: (0, jsx_runtime_1.jsx)(__1.Input, { value: `https://rujira.network/?ref=${referral}`, readOnly: true, label: t("clickToCopy") }) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 color-grey mt-2", children: t("referralValidUntil") }), (0, jsx_runtime_1.jsx)("div", { className: "modal__footer mt-4 px-3 py-2 text-right", children: (0, jsx_runtime_1.jsx)(__1.Button, { label: t("close"), onClick: hideModal }) })] })),
38
37
  });
39
38
  };
40
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !accounts || accounts.length === 0 ? ((0, jsx_runtime_1.jsx)(ConnectAnimation, { children: (0, jsx_runtime_1.jsx)(exports.Wallets, { provider: provider, wallets: wallets }) })) : ((0, jsx_runtime_1.jsxs)(MyAccount, { routingElement: routingElement, provider: provider, value: selected ? getValue(rujira_js_1.Account.fromAddress(selected.address)) : false, onHide: () => setShowBlur(false), children: [selected ? ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "balance", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex ai-b", children: showBalance === "true" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: getValue(rujira_js_1.Account.fromAddress(selected.address)), decimals: 12, symbol: "~$", padSymbol: false, className: "color-white fs-26 condensed" }), (0, jsx_runtime_1.jsx)("button", { className: "transparent ml-1 color-grey hover-white", onClick: (e) => {
39
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !accounts || accounts.length === 0 ? ((0, jsx_runtime_1.jsx)(ConnectAnimation, { routingElement: routingElement, children: (0, jsx_runtime_1.jsx)(exports.Wallets, { provider: provider, wallets: wallets, routingElement: routingElement }) })) : ((0, jsx_runtime_1.jsxs)(MyAccount, { routingElement: routingElement, provider: provider, value: selected ? getValue(rujira_js_1.Account.fromAddress(selected.address)) : false, onHide: () => setShowBlur(false), children: [selected ? ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, to: "portfolio", className: "balance", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex ai-b", children: showBalance === "true" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Fiat_1.Fiat, { amount: getValue(rujira_js_1.Account.fromAddress(selected.address)), decimals: 12, symbol: "~$", padSymbol: false, className: "color-white fs-26 condensed" }), (0, jsx_runtime_1.jsx)("button", { className: "transparent ml-1 color-grey hover-white", onClick: (e) => {
41
40
  e.stopPropagation();
42
41
  e.preventDefault();
43
42
  setShowBalance("false");
@@ -48,19 +47,19 @@ const Accounts = ({ provider, routingElement, wallets, ProviderIcon, getValue, c
48
47
  setShowBalance("true");
49
48
  return false;
50
49
  }, style: { marginRight: "-1rem" }, children: (0, jsx_runtime_1.jsx)(Icons_1.EyeSlash, { className: "w-2 h-2" }) })] })) }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 condensed color-grey mt-0.5", children: t("viewPortfolio") })] })) : null, accounts.map((account) => ((0, jsx_runtime_1.jsx)(AddressC, { provider: provider, ProviderIcon: ProviderIcon, account: account, selected: selected?.address.address === account.address.address &&
51
- selected.provider === account.provider }, `${account.address.address}:${account.provider}`))), (0, jsx_runtime_1.jsxs)("nav", { className: "actions", children: [referral && ((0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: ReferralModal, children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, {}), (0, jsx_runtime_1.jsx)("span", { children: t("referralLink") })] })), (0, jsx_runtime_1.jsxs)(react_router_dom_1.Link, { className: "action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)(Icons_1.Plus, {}), (0, jsx_runtime_1.jsx)("span", { children: t("connectAnotherWallet") })] }), customActions &&
50
+ selected.provider === account.provider }, `${account.address.address}:${account.provider}`))), (0, jsx_runtime_1.jsxs)("nav", { className: "actions", children: [referral && ((0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: ReferralModal, children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, {}), (0, jsx_runtime_1.jsx)("span", { children: t("referralLink") })] })), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, className: "action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)(Icons_1.Plus, {}), (0, jsx_runtime_1.jsx)("span", { children: t("connectAnotherWallet") })] }), customActions &&
52
51
  customActions.map((e, index) => (0, react_2.cloneElement)(e, { key: index })), (0, jsx_runtime_1.jsxs)("button", { className: "action transparent", onClick: disconnectAll, children: [(0, jsx_runtime_1.jsx)(Icons_1.LinkDisconnect, {}), (0, jsx_runtime_1.jsx)("span", { children: t("disconnectAll") })] })] }), showBlur && (0, jsx_runtime_1.jsx)("div", { className: "blur" })] })) }));
53
52
  };
54
53
  exports.Accounts = Accounts;
55
54
  /* const Component = forwardRef<HTMLAnchorElement, ComponentProps<typeof Link>>((props, ref) => {
56
55
  return <Link {...props} ref={ref} />;
57
56
  }); */
58
- const ConnectAnimation = ({ children }) => {
57
+ const ConnectAnimation = ({ children, routingElement }) => {
59
58
  const { t } = (0, i18n_1.useTranslation)("header");
60
59
  const [show, setShow] = (0, react_2.useState)(false);
61
- return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1 no-underline", onMouseOver: () => setShow(true), onMouseOut: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__connect", children: [(0, jsx_runtime_1.jsx)("div", { className: "fs-14 fw-500 fs-15 condensed", children: t("connect") }), (0, jsx_runtime_1.jsx)("img", { className: "w-3 h-3 filter-white", src: show ? connect_gif_1.default : connect_png_1.default, alt: "Connect" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup right condensed w-32 text-center p-2", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 4 }, exit: { opacity: 0, marginTop: -4 }, children: [(0, jsx_runtime_1.jsxs)(react_router_dom_1.Link, { className: "flex dir-c action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)("p", { className: "color-white", children: t("connectYourWallet") }), (0, jsx_runtime_1.jsx)("small", { className: "color-grey mb-1", children: t("createOrConnectWallet") })] }), children] })) })] }));
60
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "relative py-q1 no-underline", onMouseOver: () => setShow(true), onMouseOut: () => setShow(false), children: [(0, jsx_runtime_1.jsxs)("div", { className: "rujira-header__connect", children: [(0, jsx_runtime_1.jsx)("div", { className: "fs-14 fw-500 fs-15 condensed", children: t("connect") }), (0, jsx_runtime_1.jsx)("img", { className: "w-3 h-3 filter-white", src: show ? connect_gif_1.default : connect_png_1.default, alt: "Connect" })] }), (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: show && ((0, jsx_runtime_1.jsxs)(react_1.motion.div, { className: "rujira-header__popup right condensed w-32 text-center p-2", initial: { opacity: 0, marginTop: -4 }, animate: { opacity: 1, marginTop: 4 }, exit: { opacity: 0, marginTop: -4 }, children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, className: "flex dir-c action transparent", to: "connect", children: [(0, jsx_runtime_1.jsx)("p", { className: "color-white", children: t("connectYourWallet") }), (0, jsx_runtime_1.jsx)("small", { className: "color-grey mb-1", children: t("createOrConnectWallet") })] }), children] })) })] }));
62
61
  };
63
- const Wallets = ({ modalLayout = false, provider, wallets, }) => {
62
+ const Wallets = ({ modalLayout = false, provider, wallets, routingElement, }) => {
64
63
  const { t } = (0, i18n_1.useTranslation)("header");
65
64
  const { connect, isAvailable } = provider;
66
65
  const { hideModal } = (0, GlobalModal_1.useGlobalModalContext)();
@@ -86,11 +85,11 @@ const Wallets = ({ modalLayout = false, provider, wallets, }) => {
86
85
  }
87
86
  x.provider && connect(x.provider).then(hideModal);
88
87
  }, children: x.icon }, x.label));
89
- }) }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: "/tou", className: "terms mb-1", children: "By connecting a wallet, you agree to Rujira's Terms of Use." }), (0, jsx_runtime_1.jsx)("hr", { className: (0, clsx_1.default)({
88
+ }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routingElement, to: "/tou", className: "terms mb-1", children: "By connecting a wallet, you agree to Rujira's Terms of Use." }), (0, jsx_runtime_1.jsx)("hr", { className: (0, clsx_1.default)({
90
89
  hr: true,
91
90
  "mt-0 mb-1": !modalLayout,
92
91
  "my-2": modalLayout,
93
- }) }), (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: "ecosystem/wallets", onClick: hideModal, children: t("needHelpDeciding") })] }), (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { id: "wallet-tip", className: "tooltip" })] }));
92
+ }) }), (0, jsx_runtime_1.jsx)(ResolveLink_1.ResolveLink, { as: routingElement, to: "ecosystem/wallets", onClick: hideModal, children: t("needHelpDeciding") })] }), (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { id: "wallet-tip", className: "tooltip" })] }));
94
93
  };
95
94
  exports.Wallets = Wallets;
96
95
  const MyAccount = ({ provider, children, onHide, routingElement, value, }) => {
@@ -39,6 +39,13 @@ const Header = ({ accountProvider, className, domain = "", routingElement, walle
39
39
  const [scrollY, setScrollY] = (0, react_2.useState)(0);
40
40
  const { accounts } = accountProvider;
41
41
  const { showModal } = (0, GlobalModal_1.useGlobalModalContext)();
42
+ const ConnectModal = () => {
43
+ showModal({
44
+ title: t("connectYourAccount"),
45
+ backgroundClose: true,
46
+ children: ((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "header", children: (0, jsx_runtime_1.jsx)(Accounts_1.Wallets, { modalLayout: true, provider: accountProvider, wallets: wallets, routingElement: routingElement }) })),
47
+ });
48
+ };
42
49
  (0, react_2.useEffect)(() => {
43
50
  const handleScroll = () => {
44
51
  setIsScrolled(window.scrollY > 56);
@@ -49,13 +56,6 @@ const Header = ({ accountProvider, className, domain = "", routingElement, walle
49
56
  window.removeEventListener("scroll", handleScroll);
50
57
  };
51
58
  }, []);
52
- const ConnectModal = () => {
53
- showModal({
54
- title: t("connectYourAccount"),
55
- backgroundClose: true,
56
- children: ((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "header", children: (0, jsx_runtime_1.jsx)(Accounts_1.Wallets, { modalLayout: true, provider: accountProvider, wallets: wallets }) })),
57
- });
58
- };
59
59
  return ((0, jsx_runtime_1.jsxs)(exports.Container, { style: { backgroundColor: `rgba(15, 17, 23, ${(scrollY / 56) * 0.9})` }, className: (0, clsx_1.default)({
60
60
  [`${className}`]: className,
61
61
  "rujira-header--scrolled": isScrolled,
@@ -75,7 +75,9 @@ const Container = ({ children, className, style = {} }) => {
75
75
  exports.Container = Container;
76
76
  const Logo = () => {
77
77
  const size = (0, useWindowSize_1.useWindowSize)();
78
- return ((0, jsx_runtime_1.jsx)(RujiraLogo_1.RujiraLogo, { textColor: "#fff", className: "rujira-header__logo", showText: size.width >= 520, animate: true }));
78
+ // `useWindowSize` returns 0 on SSR and first client render. Treat unknown as desktop
79
+ // so the wordmark ships in initial HTML and doesn't pop in after hydration.
80
+ return ((0, jsx_runtime_1.jsx)(RujiraLogo_1.RujiraLogo, { textColor: "#fff", className: "rujira-header__logo", showText: size.width === 0 || size.width >= 520, animate: true }));
79
81
  };
80
82
  exports.Logo = Logo;
81
83
  const MainNav = ({ domain,
@@ -158,15 +160,19 @@ const MobileNav = ({ domain, routingElement, accountProvider, staticRoutes, }) =
158
160
  document.body.style.overflow = "auto";
159
161
  }
160
162
  }, [showMobile]);*/
161
- let url = location.href;
162
- document.body.addEventListener("click", () => {
163
- requestAnimationFrame(() => {
164
- if (url !== location.href) {
165
- setShowDrawer(false);
166
- url = location.href;
167
- }
168
- });
169
- }, true);
163
+ (0, react_2.useEffect)(() => {
164
+ let url = location.href;
165
+ const handler = () => {
166
+ requestAnimationFrame(() => {
167
+ if (url !== location.href) {
168
+ setShowDrawer(false);
169
+ url = location.href;
170
+ }
171
+ });
172
+ };
173
+ document.body.addEventListener("click", handler, true);
174
+ return () => document.body.removeEventListener("click", handler, true);
175
+ }, []);
170
176
  return ((0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Root, { direction: "left", open: showDrawer, onOpenChange: (open) => setShowDrawer(open), children: [(0, jsx_runtime_1.jsx)("button", { className: "rujira-header__hamburger", onClick: () => setShowDrawer(true), children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 64H448v48H0V64zM0 224H448v48H0V224zM448 384v48H0V384H448z", fill: "currentColor" }) }) }), (0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Portal, { children: [(0, jsx_runtime_1.jsx)(vaul_1.Drawer.Overlay, { className: "drawer__overlay" }), (0, jsx_runtime_1.jsxs)(vaul_1.Drawer.Content, { className: "drawer__content drawer__content--left", children: [(0, jsx_runtime_1.jsx)(vaul_1.Drawer.Description, { className: "visually-hidden", children: "Main navigation menu" }), (0, jsx_runtime_1.jsx)(vaul_1.Drawer.Title, { className: "visually-hidden", children: "Main Menu" }), (0, jsx_runtime_1.jsxs)("div", { className: "drawer__card mobile-drawer", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: ".", className: "flex ai-c", children: [(0, jsx_runtime_1.jsx)(Icons_1.Home, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("home") }) })] }), accounts && accounts.length > 0 && ((0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, domain: domain, to: "portfolio", className: "flex ai-c mt-2", children: [(0, jsx_runtime_1.jsx)(Icons_1.Coins, { className: "color-grey h-3.5 w-a block mr-2 no-shrink" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("portfolio") }) })] })), (0, jsx_runtime_1.jsx)("h4", { children: t("trade") }), (0, jsx_runtime_1.jsx)(SubTrade, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("earn") }), (0, jsx_runtime_1.jsx)(SubEarn, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("borrow") }), (0, jsx_runtime_1.jsx)(SubBorrow, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("utilities") }), (0, jsx_runtime_1.jsx)(SubUtilities, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("entertainment") }), (0, jsx_runtime_1.jsx)(SubEntertainment, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes }), (0, jsx_runtime_1.jsx)("h4", { children: t("learnAndHelp") }), (0, jsx_runtime_1.jsx)(SubLearn, { useRef: (0, react_2.useRef)(null), domain: domain, routingElement: routingElement, className: "", staticRoutes: staticRoutes })] })] })] })] }));
171
177
  };
172
178
  exports.MobileNav = MobileNav;
@@ -185,7 +191,7 @@ const SubBorrow = ({ domain, routingElement, useRef, className, staticRoutes, })
185
191
  };
186
192
  const SubUtilities = ({ domain, routingElement, useRef, className, staticRoutes, }) => {
187
193
  const { t } = (0, i18n_1.useTranslation)("header");
188
- return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)("a", { href: "https://ai.autorujira.app/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600", children: [t("rujiAi"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("rujiAiDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("analytics"), domain: domain, to: "analytics", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.ChartMixed, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("analytics") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("analyticsDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("buy"), domain: domain, to: "buy", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.CreditCard, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("buyCrypto") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("buyCryptoDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://daodao.zone", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("daodao"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("daodaoDesc") })] })] })] }) }));
194
+ return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)("a", { href: "https://ai.autorujira.app/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("rujiAi"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("rujiAiDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("analytics"), domain: domain, to: "/analytics", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.ChartMixed, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("analytics") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("analyticsDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("buy"), domain: domain, to: "buy", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.CreditCard, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("buyCrypto") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("buyCryptoDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://daodao.zone", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Users, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("daodao"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("daodaoDesc") })] })] })] }) }));
189
195
  };
190
196
  const SubEntertainment = ({ domain, routingElement, useRef, className, staticRoutes, }) => {
191
197
  const { t } = (0, i18n_1.useTranslation)("header");
@@ -193,5 +199,5 @@ const SubEntertainment = ({ domain, routingElement, useRef, className, staticRou
193
199
  };
194
200
  const SubLearn = ({ domain, routingElement, useRef, className, staticRoutes, }) => {
195
201
  const { t } = (0, i18n_1.useTranslation)("header");
196
- return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("get-started"), domain: domain, to: "get-started", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Graduate, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("getStarted") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("getStartedDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("support"), domain: domain, to: "/support", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Support, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("support") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("educationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Code, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("documentation"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("documentationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/developers/getting-started", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("developers"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("developersDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("faq"), domain: domain, to: "faq", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Info, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("commonQuestions") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("supportDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("articles"), domain: domain, to: "articles", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.History, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("articles") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("articlesDesc") })] })] })] }) }));
202
+ return ((0, jsx_runtime_1.jsx)(Popup, { useRef: useRef, className: className, children: (0, jsx_runtime_1.jsxs)("div", { className: "grid w-60 mt-1", children: [(0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("get-started"), domain: domain, to: "/get-started", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Graduate, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("getStarted") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("getStartedDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("support"), domain: domain, to: "/support", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Support, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("support") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("educationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Code, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("documentation"), " ", (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("documentationDesc") })] })] }), (0, jsx_runtime_1.jsxs)("a", { href: "https://docs.rujira.network/developers/getting-started", target: "_blank", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.Terminal, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h4", { className: "fs-14 fw-600 flex ai-c", children: [t("developers"), (0, jsx_runtime_1.jsx)(Icons_1.External, { className: "h-1.5 w-a ml-1" })] }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("developersDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("faq"), domain: domain, to: "/faq", className: "flex", children: [(0, jsx_runtime_1.jsx)(Icons_1.Info, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("commonQuestions") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("supportDesc") })] })] }), (0, jsx_runtime_1.jsxs)(ResolveLink_1.ResolveLink, { as: routingElement, isStatic: staticRoutes?.includes("articles"), domain: domain, to: "/articles", className: "flex ai-s", children: [(0, jsx_runtime_1.jsx)(Icons_1.History, { className: "color-grey h-3.5 w-a block mr-2 no-shrink mt-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h4", { className: "fs-14 fw-600", children: t("articles") }), (0, jsx_runtime_1.jsx)("p", { className: "fs-12 mt-0.5", children: t("articlesDesc") })] })] })] }) }));
197
203
  };
@@ -6,7 +6,7 @@ const react_1 = require("react");
6
6
  const fixedForwardRef = react_1.forwardRef;
7
7
  const UnwrappedAnyComponent = (props, ref) => {
8
8
  const { as: Comp = "a", children, domain, isStatic, ...rest } = props;
9
- if (!isStatic && props.as !== "a") {
9
+ if (!isStatic && props.as && props.as !== "a") {
10
10
  return ((0, jsx_runtime_1.jsx)(Comp, { ...rest, ref: ref, children: children }));
11
11
  }
12
12
  return ((0, jsx_runtime_1.jsx)("a", { href: props.to || props.href, ...rest, children: children }));
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RujiraLogo = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const helpers_1 = require("../../helpers");
5
+ const react_1 = require("react");
6
6
  const RujiraLogo = ({ textColor = "#fff", showText = true, animate = false, className, }) => {
7
- const id = (0, helpers_1.uuidv4)();
7
+ const id = (0, react_1.useId)();
8
8
  return ((0, jsx_runtime_1.jsxs)("svg", { viewBox: `0 0 ${showText ? 3710 : 1000} 1000`, xmlns: "http://www.w3.org/2000/svg", className: className, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { x1: "97.12%", y1: "12.295%", x2: "15.952%", y2: "88.858%", id: id, children: [(0, jsx_runtime_1.jsx)("stop", { stopColor: "#D615EB", offset: "0%" }), (0, jsx_runtime_1.jsx)("stop", { stopColor: "#8436F5", offset: "100%" })] }) }), (0, jsx_runtime_1.jsxs)("g", { fill: "none", fillRule: "nonzero", children: [!animate ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M109.713 718.57c64.466 183.188 203.797 276.949 417.99 281.283 214.195 4.334 357.082-87.26 428.663-274.782 71.581-187.522 55.091-346.445-49.47-476.768C802.337 117.981 666.289 37.628 498.753 7.246 331.216-23.136 208.376 42.026 130.23 202.73c-78.145 160.705-84.984 332.652-20.517 515.84Z", fillOpacity: ".45", fill: "#CE18EC" }), (0, jsx_runtime_1.jsx)("path", { d: "M938.285 742.674c-81.778 172.834-217.066 249.65-405.863 230.445C343.625 953.916 193.193 867.5 81.127 713.868-30.94 560.238-26.902 413.177 93.242 272.686c120.143-140.491 271.08-228.424 452.81-263.8C727.782-26.489 859.03 43.756 939.8 219.623c80.768 175.866 80.264 350.216-1.515 523.05Z", fillOpacity: ".45", fill: "#8535F4" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { fill: "#CE18EC", fillOpacity: ".45", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "3897ms", repeatCount: "indefinite", values: "M908.65 772.515c-119.423 173.188-259.837 247.488-421.243 222.9C326 970.826 191.184 884.232 82.957 735.633-25.268 587.033-27.6 434.158 75.96 277.006 179.522 119.854 316.67 28.984 487.407 4.396c170.736-24.59 313.482 53.987 428.24 235.727 114.757 181.74 112.424 359.205-6.998 532.392Z;\n M905.657 701.408C781.589 850.992 630.329 930.883 451.876 941.082c-178.453 10.199-308.47-64.593-390.048-224.376-81.579-159.782-82.428-320.415-2.55-481.897C139.159 73.326 270.874-4.865 454.426.234c183.552 5.1 335.662 85.84 456.33 242.224 120.67 156.383 118.97 309.366-5.098 458.95Z;\n M938.285 742.674c-81.778 172.834-217.066 249.65-405.863 230.445C343.625 953.916 193.193 867.5 81.127 713.868-30.94 560.238-26.902 413.177 93.242 272.686c120.143-140.491 271.08-228.424 452.81-263.8C727.782-26.489 859.03 43.756 939.8 219.623c80.768 175.866 80.264 350.216-1.515 523.05Z;\n M909.194 698.092C791.124 849.094 646.258 945.89 474.596 988.48c-171.662 42.59-307.317-32.91-406.964-226.503-99.648-193.591-89.18-365.888 31.401-516.89C219.615 94.086 358.201 12.777 514.79 1.162c156.589-11.616 290.988 63.885 403.196 226.502 112.208 162.617 109.277 319.426-8.792 470.428Z;\n M908.65 772.515c-119.423 173.188-259.837 247.488-421.243 222.9C326 970.826 191.184 884.232 82.957 735.633-25.268 587.033-27.6 434.158 75.96 277.006 179.522 119.854 316.67 28.984 487.407 4.396c170.736-24.59 313.482 53.987 428.24 235.727 114.757 181.74 112.424 359.205-6.998 532.392Z;" }) }), (0, jsx_runtime_1.jsx)("path", { fill: "#8535F4", fillOpacity: ".45", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "d", dur: "2975ms", repeatCount: "indefinite", values: "M932.532 715.172C854.38 889.747 710.761 984.14 501.676 998.35 292.591 1012.56 146.943 925.27 64.73 736.486c-82.213-188.785-68.51-353.718 41.106-494.8C215.453 100.607 357.042 20.93 530.603 2.66c173.56-18.27 303.477 52.271 389.75 211.622 86.273 159.351 90.332 326.314 12.18 500.89Z;\n M885.654 705.273C746.066 828.795 579.708 919.904 386.58 978.599c-193.128 58.695-311.204-3.066-354.228-185.284-43.024-182.217-43.502-364.873-1.434-547.967C72.984 62.255 202.534-18.342 419.564 3.56c217.03 21.9 383.867 113.448 500.51 274.64 116.641 161.193 105.168 303.55-34.42 427.073Z;\n M962.274 793.5c-49.124 177.855-169.888 240.71-362.29 188.563-192.402-52.145-355.126-141.072-488.17-266.78C-21.23 589.572-36.069 440.585 67.296 268.318 170.66 96.052 333.896 6.659 557 .141c223.104-6.518 358.707 79.615 406.808 258.4 48.1 178.786 47.589 357.106-1.535 534.96Z;\n M897.318 638.271C761.297 778.402 603.636 888.36 424.336 968.141c-179.3 79.783-306.047 9.718-380.24-210.196-74.193-219.913-54.762-400.958 58.295-543.135C215.447 72.633 343.077 1.034 485.28.01c142.203-1.022 280.432 70.066 414.686 213.266 134.255 143.2 133.371 284.864-2.65 424.995Z;\n M932.532 715.172C854.38 889.747 710.761 984.14 501.676 998.35 292.591 1012.56 146.943 925.27 64.73 736.486c-82.213-188.785-68.51-353.718 41.106-494.8C215.453 100.607 357.042 20.93 530.603 2.66c173.56-18.27 303.477 52.271 389.75 211.622 86.273 159.351 90.332 326.314 12.18 500.89Z;" }) })] })), (0, jsx_runtime_1.jsxs)("g", { transform: "translate(49 24)", children: [(0, jsx_runtime_1.jsx)("circle", { fill: `url(#${id})`, cx: "475.5", cy: "475.5", r: "475.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M475.5 57.011c-231.125 0-418.489 187.364-418.489 418.489 0 231.125 187.364 418.489 418.489 418.489 231.125 0 418.489-187.364 418.489-418.489 0-231.125-187.364-418.489-418.489-418.489Z", fill: "#1B1821" }), (0, jsx_runtime_1.jsx)("path", { d: "M460.284 232.995v159.944h-58.52l58.52 67.345h-68.973l-60.794-67.345h-45.61v67.345h-51.912V341.027h50.66l-50.66-56.12v-51.912h227.289Zm-152.396 51.912 48.766 56.12h51.718v-56.12H307.888Zm182.828 433.098v-51.912h88.39V542.628h-88.39v-51.912h227.289v51.912h-86.987v123.465h86.987v51.912H490.716Zm-257.721 0V598.748h51.912v67.345h93.716l29.75-29.155v-94.31H346.64v-51.912h113.644v166.96l-60.33 60.329H232.995Zm318.05-257.721-60.329-60.33V232.995h51.912v146.222l29.748 29.155h93.717V232.995h51.912v227.289h-166.96Z", fill: `url(#${id})` })] }), showText && ((0, jsx_runtime_1.jsx)("path", { d: "M1466.453 256.11c96.524 0 159.415 63.144 159.415 153.455 0 87.374-57.043 134.366-115.543 143.91l119.196 192.37h-98.719l-108.22-182.824h-84.827v182.825H1252.2V256.11h214.254Zm-11.697 75.626h-117v155.658h117c48.262 0 83.36-30.838 83.36-77.83 0-46.99-35.098-77.828-83.36-77.828ZM1926.077 751.71c141.25 0 210.775-80.446 210.775-201.848v-294.73h-86.357v292.535c0 77.522-43.178 127.985-124.418 127.985-81.969 0-125.155-50.463-125.155-127.985V255.132h-86.357v295.46c0 119.94 69.524 201.119 211.512 201.119ZM2209.279 937.439c94.103 0 164.133-52.144 164.133-163.783V255.132h-85.346v517.055c0 53.612-32.832 88.866-85.352 88.866-37.205 0-63.465-19.092-83.16-40.395l-39.398 65.366c34.29 36.727 78.788 51.415 129.123 51.415ZM2610.948 745.846V256.11h-84.067v489.736zM2977.695 256.11c96.523 0 159.414 63.144 159.414 153.455 0 87.374-57.042 134.366-115.535 143.91l119.188 192.37h-98.718l-108.22-182.824h-84.827v182.825h-85.556V256.11h214.254Zm-11.697 75.626h-117.001v155.658h117c48.262 0 83.361-30.838 83.361-77.83 0-46.99-35.099-77.828-83.36-77.828ZM3518.168 256.11l191.51 489.736h-97.216l-35.818-93.983h-223.67l-35.817 93.983h-97.216l191.51-489.736h106.717Zm-53.355 86.64-87.715 233.487h175.43l-87.715-233.487Z", fill: textColor }))] })] }));
9
9
  };
10
10
  exports.RujiraLogo = RujiraLogo;
@@ -37,7 +37,7 @@ const GlobalModal = ({ children, }) => {
37
37
  document.body.style.overflow = "";
38
38
  setModalProps({});
39
39
  };
40
- const dest = document.getElementById("modal");
40
+ const dest = typeof document !== "undefined" ? document.getElementById("modal") : null;
41
41
  const renderComponent = () => {
42
42
  return dest
43
43
  ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)(i18n_1.TranslationProvider, { namespace: "common", children: (0, jsx_runtime_1.jsx)(react_1.AnimatePresence, { children: !(0, helpers_1.isEmpty)(modalProps) && ((0, jsx_runtime_1.jsx)(ModalContent, { modalProps: modalProps, hideModal: hideModal })) }) }), dest)
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useWindowDimensions = exports.BreakPoints = void 0;
4
4
  exports.useWindowSize = useWindowSize;
5
5
  const react_1 = require("react");
6
+ // useLayoutEffect fires synchronously before browser paint, eliminating the
7
+ // flash where size-dependent layout hasn't updated yet. On the server it
8
+ // would warn, so we fall back to useEffect there.
9
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" ? react_1.useLayoutEffect : react_1.useEffect;
6
10
  exports.BreakPoints = {
7
11
  xsmall: 420,
8
12
  small: 576,
@@ -15,10 +19,10 @@ exports.BreakPoints = {
15
19
  };
16
20
  function useWindowSize() {
17
21
  const [windowSize, setWindowSize] = (0, react_1.useState)({
18
- width: window.outerWidth,
19
- height: window.outerHeight,
22
+ width: 0,
23
+ height: 0,
20
24
  });
21
- (0, react_1.useEffect)(() => {
25
+ useIsomorphicLayoutEffect(() => {
22
26
  function handleResize() {
23
27
  setWindowSize({
24
28
  width: window.innerWidth,
@@ -32,20 +36,15 @@ function useWindowSize() {
32
36
  return windowSize;
33
37
  }
34
38
  const useWindowDimensions = (innerWidth) => {
35
- const [isMobileSize, setIsMobileSize] = (0, react_1.useState)(window.innerWidth <= innerWidth);
36
- (0, react_1.useEffect)(() => {
39
+ const [isMobileSize, setIsMobileSize] = (0, react_1.useState)(false);
40
+ useIsomorphicLayoutEffect(() => {
37
41
  const windowResizeHandler = () => {
38
- const matchMediaString = `(max-width: ${innerWidth}px)`;
39
- if (matchMedia(matchMediaString).matches) {
40
- setIsMobileSize(true);
41
- }
42
- else {
43
- setIsMobileSize(false);
44
- }
42
+ setIsMobileSize(matchMedia(`(max-width: ${innerWidth}px)`).matches);
45
43
  };
46
44
  window.addEventListener('resize', windowResizeHandler);
45
+ windowResizeHandler();
47
46
  return () => window.removeEventListener('resize', windowResizeHandler);
48
- }, []);
47
+ }, [innerWidth]);
49
48
  return isMobileSize;
50
49
  };
51
50
  exports.useWindowDimensions = useWindowDimensions;
@@ -33,6 +33,8 @@ const SUPPORTED_LANGUAGES = ["en", "de"];
33
33
  exports.SUPPORTED_LANGUAGES = SUPPORTED_LANGUAGES;
34
34
  exports.SUPPORTED_LANGUAGE_PATTERN = SUPPORTED_LANGUAGES.join("|");
35
35
  const detectLanguage = () => {
36
+ if (typeof window === "undefined")
37
+ return "en";
36
38
  const stored = localStorage.getItem(STORAGE_KEY);
37
39
  if (stored && SUPPORTED_LANGUAGES.includes(stored)) {
38
40
  return stored;
@@ -8,8 +8,10 @@ class Eip6963Adapter extends eip1193_1.Eip1193Adapter {
8
8
  constructor(rdns, eip712 = false) {
9
9
  super(() => this.provider, eip712);
10
10
  this.rdns = rdns;
11
- window.addEventListener("eip6963:announceProvider", this.handleAnnounce.bind(this));
12
- window.dispatchEvent(new Event("eip6963:requestProvider"));
11
+ if (typeof window !== "undefined") {
12
+ window.addEventListener("eip6963:announceProvider", this.handleAnnounce.bind(this));
13
+ window.dispatchEvent(new Event("eip6963:requestProvider"));
14
+ }
13
15
  }
14
16
  handleAnnounce(res) {
15
17
  if (res.detail.info.rdns.includes(this.rdns)) {
@@ -79,5 +79,9 @@ class KeplrAdapter {
79
79
  }
80
80
  }
81
81
  exports.KeplrAdapter = KeplrAdapter;
82
- const provider = new KeplrAdapter(new eip6963_1.Eip6963Adapter("app.keplr"), () => window.keplr);
82
+ // Construction reads `window.*` so it must be gated for SSR (Next.js, Remix, etc.).
83
+ // The provider is never consumed on the server, so casting the null branch is safe.
84
+ const provider = typeof window === "undefined"
85
+ ? null
86
+ : new KeplrAdapter(new eip6963_1.Eip6963Adapter("app.keplr"), () => window.keplr);
83
87
  exports.default = provider;
@@ -32,5 +32,8 @@ class LeapAdapter {
32
32
  }
33
33
  }
34
34
  exports.LeapAdapter = LeapAdapter;
35
- const provider = new LeapAdapter(new eip6963_1.Eip6963Adapter("io.leapwallet.LeapWallet"), () => window.leap);
35
+ // Construction reads `window.*` so it must be gated for SSR.
36
+ const provider = typeof window === "undefined"
37
+ ? null
38
+ : new LeapAdapter(new eip6963_1.Eip6963Adapter("io.leapwallet.LeapWallet"), () => window.leap);
36
39
  exports.default = provider;
@@ -75,5 +75,8 @@ class OkxAdapter {
75
75
  }
76
76
  }
77
77
  exports.OkxAdapter = OkxAdapter;
78
- const provider = new OkxAdapter(new eip6963_1.Eip6963Adapter("com.okex.wallet"), new cosmos_1.CosmosAdapter(() => window.okxwallet?.keplr), window.okxwallet?.bitcoin);
78
+ // Construction reads `window.*` so it must be gated for SSR.
79
+ const provider = typeof window === "undefined"
80
+ ? null
81
+ : new OkxAdapter(new eip6963_1.Eip6963Adapter("com.okex.wallet"), new cosmos_1.CosmosAdapter(() => window.okxwallet?.keplr), window.okxwallet?.bitcoin);
79
82
  exports.default = provider;
@@ -2,5 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const eip6963_1 = require("./eip6963");
4
4
  const keplr_1 = require("./keplr");
5
- const provider = new keplr_1.KeplrAdapter(new eip6963_1.Eip6963Adapter("station"), () => window.station?.keplr);
5
+ // Construction reads `window.*` so it must be gated for SSR.
6
+ const provider = typeof window === "undefined"
7
+ ? null
8
+ : new keplr_1.KeplrAdapter(new eip6963_1.Eip6963Adapter("station"), () => window.station?.keplr);
6
9
  exports.default = provider;
@@ -4,9 +4,15 @@ const sdk_1 = require("@tonconnect/sdk");
4
4
  const rujira_js_1 = require("rujira.js");
5
5
  const ton_core_1 = require("ton-core");
6
6
  class TonKeeper {
7
- connector = new sdk_1.default({
8
- manifestUrl: `https://next.rujira.network/tonconnect-manifest.json`,
9
- });
7
+ _connector;
8
+ get connector() {
9
+ if (!this._connector) {
10
+ this._connector = new sdk_1.default({
11
+ manifestUrl: `https://next.rujira.network/tonconnect-manifest.json`,
12
+ });
13
+ }
14
+ return this._connector;
15
+ }
10
16
  constructor() { }
11
17
  async connect() {
12
18
  const wallets = await this.connector.getWallets();
@@ -4,12 +4,24 @@ exports.signAndBroadcast = exports.simulate = exports.XamanAdapter = void 0;
4
4
  const rujira_js_1 = require("rujira.js");
5
5
  const xumm_1 = require("xumm");
6
6
  class XamanAdapter {
7
+ apiKey;
7
8
  xumm;
9
+ pendingCallbacks = [];
8
10
  constructor(apiKey) {
9
- this.xumm = new xumm_1.Xumm(apiKey);
11
+ this.apiKey = apiKey;
12
+ }
13
+ getXumm() {
14
+ if (!this.xumm) {
15
+ this.xumm = new xumm_1.Xumm(this.apiKey);
16
+ for (const cb of this.pendingCallbacks) {
17
+ this.xumm.on("success", cb);
18
+ }
19
+ this.pendingCallbacks = [];
20
+ }
21
+ return this.xumm;
10
22
  }
11
23
  async connect() {
12
- const x = await this.xumm.authorize();
24
+ const x = await this.getXumm().authorize();
13
25
  if (x instanceof Error)
14
26
  throw x;
15
27
  if (!x)
@@ -23,9 +35,10 @@ class XamanAdapter {
23
35
  return (0, exports.signAndBroadcast)(this, msg);
24
36
  }
25
37
  async submit(payment) {
26
- if (!this.xumm.payload)
38
+ const xumm = this.getXumm();
39
+ if (!xumm.payload)
27
40
  throw new Error(`No xumm payload`);
28
- const { resolved, payload } = await this.xumm.payload.createAndSubscribe(payment, (x) => {
41
+ const { resolved, payload } = await xumm.payload.createAndSubscribe(payment, (x) => {
29
42
  if ("signed" in x.data)
30
43
  return x;
31
44
  });
@@ -46,10 +59,15 @@ class XamanAdapter {
46
59
  return true;
47
60
  }
48
61
  disconnect() {
49
- this.xumm.logout();
62
+ this.xumm?.logout();
50
63
  }
51
64
  onChange(cb) {
52
- this.xumm.on("success", cb);
65
+ if (this.xumm) {
66
+ this.xumm.on("success", cb);
67
+ }
68
+ else {
69
+ this.pendingCallbacks.push(cb);
70
+ }
53
71
  }
54
72
  networks() {
55
73
  return [rujira_js_1.XRP];
@@ -76,7 +94,10 @@ const signAndBroadcast = async (context, msg) => {
76
94
  };
77
95
  };
78
96
  exports.signAndBroadcast = signAndBroadcast;
79
- const provider = new XamanAdapter(
80
- // Rujira public API key
81
- "9ce0c336-4724-47e6-8f35-21ce088226bf");
97
+ // Construction wires the SDK to `window.*` so it must be gated for SSR.
98
+ const provider = typeof window === "undefined"
99
+ ? null
100
+ : new XamanAdapter(
101
+ // Rujira public API key
102
+ "9ce0c336-4724-47e6-8f35-21ce088226bf");
82
103
  exports.default = provider;
@@ -2,14 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.clearProviderKeys = exports.removeProviderKey = exports.addProviderKey = exports.loadProviderKeys = exports.clearSelected = exports.saveSelected = exports.loadSelected = void 0;
4
4
  const providers_1 = require("./providers");
5
- const STORAGE = window.localStorage;
6
5
  const KEY_SELECTED = "rujira-accounts-selected";
7
6
  const KEY_CONNECTED = "rujira-accounts-connected";
8
- /**
9
- * Fetches the persisted Account
10
- */
7
+ const store = {
8
+ getItem: (key) => typeof localStorage !== "undefined" ? localStorage.getItem(key) : null,
9
+ setItem: (key, value) => {
10
+ if (typeof localStorage !== "undefined")
11
+ localStorage.setItem(key, value);
12
+ },
13
+ removeItem: (key) => {
14
+ if (typeof localStorage !== "undefined")
15
+ localStorage.removeItem(key);
16
+ },
17
+ };
11
18
  const loadSelected = () => {
12
- const stored = STORAGE.getItem(KEY_SELECTED);
19
+ const stored = store.getItem(KEY_SELECTED);
13
20
  if (!stored)
14
21
  return undefined;
15
22
  const parsed = JSON.parse(stored);
@@ -21,22 +28,16 @@ const loadSelected = () => {
21
28
  }
22
29
  };
23
30
  exports.loadSelected = loadSelected;
24
- /**
25
- * Persists a selected account
26
- */
27
31
  const saveSelected = (address) => {
28
- STORAGE.setItem(KEY_SELECTED, JSON.stringify({ address }));
32
+ store.setItem(KEY_SELECTED, JSON.stringify({ address }));
29
33
  };
30
34
  exports.saveSelected = saveSelected;
31
- /**
32
- * Clears the persisted Account
33
- */
34
35
  const clearSelected = () => {
35
- STORAGE.removeItem(KEY_SELECTED);
36
+ store.removeItem(KEY_SELECTED);
36
37
  };
37
38
  exports.clearSelected = clearSelected;
38
39
  const loadProviderKeys = () => {
39
- const stored = JSON.parse(STORAGE.getItem(KEY_CONNECTED) || "{}");
40
+ const stored = JSON.parse(store.getItem(KEY_CONNECTED) || "{}");
40
41
  return Object.entries(stored)
41
42
  .filter(([_, v]) => v)
42
43
  .map(([k]) => k)
@@ -44,17 +45,17 @@ const loadProviderKeys = () => {
44
45
  };
45
46
  exports.loadProviderKeys = loadProviderKeys;
46
47
  const addProviderKey = (p) => {
47
- const stored = JSON.parse(STORAGE.getItem(KEY_CONNECTED) || "{}");
48
- STORAGE.setItem(KEY_CONNECTED, JSON.stringify({ ...stored, [p]: true }));
48
+ const stored = JSON.parse(store.getItem(KEY_CONNECTED) || "{}");
49
+ store.setItem(KEY_CONNECTED, JSON.stringify({ ...stored, [p]: true }));
49
50
  };
50
51
  exports.addProviderKey = addProviderKey;
51
52
  const removeProviderKey = (p) => {
52
- const stored = JSON.parse(STORAGE.getItem(KEY_CONNECTED) || "{}");
53
+ const stored = JSON.parse(store.getItem(KEY_CONNECTED) || "{}");
53
54
  const { [p]: _d, ...rest } = stored;
54
- STORAGE.setItem(KEY_CONNECTED, JSON.stringify(rest));
55
+ store.setItem(KEY_CONNECTED, JSON.stringify(rest));
55
56
  };
56
57
  exports.removeProviderKey = removeProviderKey;
57
58
  const clearProviderKeys = () => {
58
- STORAGE.removeItem(KEY_CONNECTED);
59
+ store.removeItem(KEY_CONNECTED);
59
60
  };
60
61
  exports.clearProviderKeys = clearProviderKeys;
@@ -19,7 +19,7 @@ const footerSections = [
19
19
  {
20
20
  kind: "internal",
21
21
  label: "Automated Trading",
22
- to: "/trade/BTC/USDC?orders=range&order=tracking&range=t",
22
+ to: "/trade/BTC/USDC?orders=range&order=tracking",
23
23
  },
24
24
  {
25
25
  kind: "internal",
@@ -28,6 +28,6 @@ interface WalletsProps {
28
28
  routingElement?: any;
29
29
  wallets: WalletProps[];
30
30
  }
31
- export declare const Wallets: ({ modalLayout, provider, wallets, }: WalletsProps) => ReactElement;
31
+ export declare const Wallets: ({ modalLayout, provider, wallets, routingElement, }: WalletsProps) => ReactElement;
32
32
  export {};
33
33
  //# sourceMappingURL=Accounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accounts.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Accounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,EAAE,EAAE,YAAY,EAAuB,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,OAAO,EAAyB,MAAM,WAAW,CAAC;AAC3D,OAAO,EACL,eAAe,EAGf,QAAQ,EAGT,MAAM,OAAO,CAAC;AAaf,UAAU,aAAa;IACrB,QAAQ,EAAE,eAAe,CAAC;IAC1B,cAAc,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,YAAY,EAAE,EAAE,CAAC;QACf,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IACvC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,kFAOlB,aAAa,KAAG,YA+IlB,CAAC;AA4CF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAY;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;IAC1B,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,wCAIjB,YAAY,KAAG,YAwEjB,CAAC"}
1
+ {"version":3,"file":"Accounts.d.ts","sourceRoot":"","sources":["../../../../src/components/header/Accounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgB,EAAE,EAAE,YAAY,EAAuB,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,OAAO,EAAyB,MAAM,WAAW,CAAC;AAC3D,OAAO,EACL,eAAe,EAGf,QAAQ,EAGT,MAAM,OAAO,CAAC;AAaf,UAAU,aAAa;IACrB,QAAQ,EAAE,eAAe,CAAC;IAC1B,cAAc,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,YAAY,EAAE,EAAE,CAAC;QACf,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;IACvC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,kFAOlB,aAAa,KAAG,YA+IlB,CAAC;AA4CF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAY;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;IAC1B,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,wDAKjB,YAAY,KAAG,YAwEjB,CAAC"}