diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..7e2e52f2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +node_modules/ +.nuxt/ +.output/ +dist/ + +pnpm-lock.yaml + +.git/ +.gitignore + +.dockerignore +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..dc2b8230 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20 + +WORKDIR /app + +COPY . . + +ENV NODE_OPTIONS="--max-old-space-size=4096" + +RUN npm install --legacy-peer-deps +RUN npm run build + +CMD ["npm", "run", "start"] diff --git a/README.md b/README.md index 98c5aa5b..ca9a464f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ Clone the repository and run on the root folder: pnpm i pnpm dev ``` - ### Node.js Server When running `nuxt build` with the Node server preset, the result will be an entry point that launches a ready-to-run Node server. @@ -41,3 +40,57 @@ module.exports = { Also, you can use different [presets](https://nuxt.com/docs/getting-started/deployment#hosting-providers). E.g. **Cloudflare Pages**: `cloudflare_pages`. Note, some providers do not support server-side rendering. + +--- + +### Docker Setup + +You can also run the application in Docker. +Build the image and run the container: +``` +docker build -t celenium-app +docker run -p 3000:3000 --env-file .env celenium-app +``` +Make sure to create a ```.env``` file in the root directory or pass the required environment variables directly with ```-e```. + +### Run with Docker Compose +Start with: +``` +docker-compose up -d +``` + +By default: +- Builds the image from the local `Dockerfile` +- Runs the app on `127.0.0.1:3000` +- Automatically restarts the container on failure +- Uses `npm run start` as the startup command +- Limits logs (10 MB per file, max 5 files) + +If you want to use a prebuilt image from **GitHub Container Registry**, specify a tag: +- `TAG=latest docker-compose up -d` + +--- + +### Environment Variables + +#### Required for App Startup +- **NUXT_PUBLIC_API_DEV** — indexer API (e.g. `https://api.localhost:9876/v1`). +- **NUXT_PUBLIC_WSS_DEV** — webSocket endpoint (e.g. `wss://api.localhost:9876/v1/ws`). +- **NUXT_PUBLIC_SELFHOSTED** — set to `true` when running in self-hosted mode. + +#### Blobstream Configuration +- **NUXT_PUBLIC_BLOBSTREAM_MAINNET** — API for blobstream data. + +#### Faucet Configuration +- **NUXT_PUBLIC_FAUCET_ADDRESS** — faucet address. +- **NUXT_PUBLIC_FAUCET_MOCHA** — faucet API for the Mocha network. +- **NUXT_PUBLIC_FAUCET_ARABICA** — faucet API for the Arabica network. +- **NUXT_PUBLIC_FAUCET_MAMMOTH** — faucet API for the Mammoth network. + +#### External Services Configuration +- **NUXT_PUBLIC_BLOCKSCOUT** — used to check whether a batch exists in Blockscout. If found, a dedicated button will appear on the blob form/page. +- **NUXT_PUBLIC_NODE_STATS** — provides statistics about node types, versions, and geographic distribution across the Celestia ecosystem. +- **NUXT_PUBLIC_QUOTE** — provides price data. It is used to display the current TIA price in the header and to convert all values from TIA to USD. +- **NUXT_PUBLIC_ROLLUP_RANKING** — fetches rollup ranking data displayed on the rollup leaderboard, individual rollup pages, and a dedicated rollup ranking page. The ranking page also includes detailed calculations, as well as repository and commit statistics. +- **NUXT_PUBLIC_GITHUB** — required for retrieving repository statistics on a rollup ranking page. +- **NUXT_PUBLIC_TVL** — provides TVL (Total Value Locked) statistics for rollups and TVS (Total Value Secured) for the Celestia network. These values are displayed in the header, on the statistics page, and on individual rollup pages. diff --git a/app.vue b/app.vue index e06286b4..695dc095 100644 --- a/app.vue +++ b/app.vue @@ -24,7 +24,6 @@ import { useSettingsStore } from "@/store/settings.store" import { useEnumStore } from "@/store/enums.store" import { useLegalStore } from "@/store/legal.store" import { useNotificationsStore } from "@/store/notifications.store" -import { useActivityStore } from "@/store/activity.store" const nodeStore = useNodeStore() const appStore = useAppStore() const bookmarksStore = useBookmarksStore() @@ -32,7 +31,6 @@ const settingsStore = useSettingsStore() const enumStore = useEnumStore() const legalStore = useLegalStore() const notificationsStore = useNotificationsStore() -const activityStore = useActivityStore() bookmarksStore.$subscribe((mutation, state) => { localStorage.setItem("bookmarks", JSON.stringify(state.bookmarks)) @@ -43,9 +41,6 @@ settingsStore.$subscribe((mutation, state) => { legalStore.$subscribe((mutation, state) => { localStorage.setItem("legal", JSON.stringify(state.legal)) }) -activityStore.$subscribe((mutation, state) => { - localStorage.setItem("rollups_ranking", JSON.stringify(state.rollups_ranking)) -}) appStore.initConstants() @@ -98,8 +93,9 @@ onMounted(async () => { } settingsStore.init() - activityStore.init() + appStore.initGlobalUpdates() + const runtimeConfig = useRuntimeConfig() amp.init(runtimeConfig.public.AMP) diff --git a/assets/icons.json b/assets/icons.json index 421bc45f..70e69d55 100644 --- a/assets/icons.json +++ b/assets/icons.json @@ -1,7 +1,18 @@ { "ibc": "M18.5 3a2.5 2.5 0 1 1-.912 4.828l-4.556 4.555a5.48 5.48 0 0 1 .936 3.714l2.624.787a2.5 2.5 0 1 1-.575 1.916l-2.623-.788a5.5 5.5 0 0 1-10.39-2.29L3 15.5l.004-.221a5.5 5.5 0 0 1 2.984-4.673L5.2 7.982a2.5 2.5 0 0 1-2.194-2.304L3 5.5l.005-.164a2.5 2.5 0 1 1 4.111 2.071l.787 2.625a5.48 5.48 0 0 1 3.714.936l4.555-4.556a2.5 2.5 0 0 1-.167-.748L16 5.5l.005-.164A2.5 2.5 0 0 1 18.5 3", "explorable": "M8.393 2.67C7.883 3.172 7.423 3.76 7.026 4.401C5.795 6.381 5 9.067 5 12.001C5 14.946 5.847 17.633 7.1 19.607C7.50413 20.2519 7.98276 20.847 8.526 21.38C6.61034 20.6703 4.95799 19.3909 3.79127 17.7139C2.62455 16.037 1.99942 14.0429 2 12C2 7.75 4.653 4.117 8.393 2.67ZM11 3.236V20.735C10.29 20.381 9.505 19.665 8.788 18.535C7.745 16.892 7 14.578 7 12C7 9.41 7.705 7.096 8.724 5.457C9.385 4.394 10.121 3.693 10.824 3.322L11 3.236ZM15.607 2.67C17.4898 3.39815 19.1082 4.67909 20.2492 6.34437C21.3903 8.00965 22.0006 9.98129 22 12C22 16.251 19.347 19.883 15.607 21.33C16.117 20.828 16.577 20.24 16.974 19.6C18.205 17.618 19 14.932 19 12C19 9.068 18.205 6.381 16.974 4.401C16.5878 3.7727 16.129 3.19104 15.607 2.67ZM13 3.236C13.755 3.579 14.56 4.306 15.276 5.457C16.295 7.097 17 9.411 17 12C17 14.589 16.295 16.904 15.276 18.543C14.615 19.606 13.879 20.307 13.176 20.679L13 20.765V3.235V3.236Z", + "widgets": "M2 6.5C2 5.30653 2.47411 4.16193 3.31802 3.31802C4.16193 2.47411 5.30653 2 6.5 2C7.69347 2 8.83807 2.47411 9.68198 3.31802C10.5259 4.16193 11 5.30653 11 6.5V9.5C11 9.849 11 10.023 10.962 10.166C10.9109 10.3569 10.8105 10.531 10.6707 10.6707C10.531 10.8105 10.3569 10.9109 10.166 10.962C10.023 11 9.85 11 9.5 11H6.5C5.30653 11 4.16193 10.5259 3.31802 9.68198C2.47411 8.83807 2 7.69348 2 6.5ZM13 14.5C13 14.151 13 13.977 13.038 13.834C13.142 13.446 13.446 13.142 13.834 13.038C13.977 13 14.151 13 14.5 13H17.5C18.39 13 19.26 13.2639 20.0001 13.7584C20.7401 14.2529 21.3169 14.9557 21.6575 15.7779C21.998 16.6002 22.0872 17.505 21.9135 18.3779C21.7399 19.2508 21.3113 20.0526 20.682 20.682C20.0526 21.3113 19.2508 21.7399 18.3779 21.9135C17.505 22.0872 16.6002 21.9981 15.7779 21.6575C14.9557 21.3169 14.2529 20.7401 13.7584 20.0001C13.2639 19.26 13 18.39 13 17.5V14.5ZM2 17.5C2 16.3065 2.47411 15.1619 3.31802 14.318C4.16193 13.4741 5.30653 13 6.5 13H9.2C9.83 13 10.145 13 10.386 13.123C10.597 13.23 10.77 13.403 10.877 13.614C11 13.854 11 14.17 11 14.8V17.5C11 18.0909 10.8836 18.6761 10.6575 19.2221C10.4313 19.768 10.0998 20.2641 9.68198 20.682C9.26412 21.0998 8.76804 21.4313 8.22207 21.6575C7.67611 21.8836 7.09095 22 6.5 22C5.90905 22 5.32389 21.8836 4.77792 21.6575C4.23196 21.4313 3.73588 21.0998 3.31802 20.682C2.90016 20.2641 2.56869 19.768 2.34254 19.2221C2.1164 18.6761 2 18.0909 2 17.5ZM13 6.5C13 5.60999 13.2639 4.73996 13.7584 3.99994C14.2529 3.25991 14.9557 2.68314 15.7779 2.34254C16.6002 2.00195 17.505 1.91283 18.3779 2.08647C19.2508 2.2601 20.0526 2.68868 20.682 3.31802C21.3113 3.94736 21.7399 4.74918 21.9135 5.62209C22.0872 6.49501 21.998 7.39981 21.6575 8.22208C21.3169 9.04434 20.7401 9.74715 20.0001 10.2416C19.26 10.7361 18.39 11 17.5 11H14.286C14.136 11 14.062 11 13.999 10.993C13.7457 10.9645 13.5097 10.8508 13.3294 10.6706C13.1492 10.4903 13.0355 10.2543 13.007 10.001C13 9.938 13 9.864 13 9.714V6.5Z", "zap": "M 13.398 1.083 C 13.805 1.26 14.047 1.684 13.992 2.124 L 13.132 9 L 19.328 9 C 19.568 9 19.813 9 20.012 9.018 C 20.201 9.035 20.562 9.08 20.875 9.333 C 21.234 9.623 21.439 10.062 21.432 10.523 C 21.426 10.925 21.23 11.232 21.122 11.387 C 21.008 11.552 20.852 11.74 20.698 11.925 L 11.768 22.64 C 11.484 22.98 11.009 23.093 10.602 22.916 C 10.195 22.74 9.953 22.316 10.008 21.876 L 10.868 15 L 4.671 15 C 4.431 15 4.186 15 3.987 14.982 C 3.798 14.965 3.437 14.92 3.124 14.667 C 2.765 14.377 2.56 13.938 2.567 13.477 C 2.573 13.075 2.769 12.768 2.877 12.613 C 2.991 12.448 3.147 12.26 3.301 12.075 L 3.324 12.048 L 12.232 1.36 C 12.516 1.019 12.991 0.906 13.398 1.083 Z", + "hyperlane": [ + { + "path": "M5.06664 3.59961C4.87226 3.59968 4.73659 3.78055 4.80297 3.95117L7.88695 11.834L4.79515 20.1094C4.73162 20.2795 4.86706 20.4578 5.0598 20.458H3.08031C2.88752 20.4579 2.75211 20.2795 2.81566 20.1094L5.90746 11.834L2.82347 3.95117C2.75707 3.78062 2.89192 3.59986 3.08617 3.59961H5.06664ZM14.0217 3.59961C13.8273 3.59961 13.6916 3.7805 13.758 3.95117L16.842 11.834L13.7502 20.1094C13.6867 20.2795 13.8221 20.4579 14.0149 20.458H12.0354C11.8425 20.458 11.7071 20.2795 11.7707 20.1094L14.8625 11.834L11.7786 3.95117C11.7121 3.78057 11.8469 3.5998 12.0412 3.59961H14.0217Z", + "opacity": 0.5 + }, + { + "path": "M8.49683 3.6001C8.96483 3.6001 9.38386 3.87195 9.54722 4.28174L11.916 10.2235H16.2125L13.7582 3.95166C13.6914 3.7809 13.8269 3.6001 14.0214 3.6001H17.4519C17.9199 3.60013 18.3385 3.87197 18.5019 4.28174L21.5129 11.8341C21.5361 11.8923 21.5364 11.9565 21.5136 12.0149L21.4968 12.0583V12.0587L18.4984 19.7685C18.3375 20.1823 17.9165 20.4578 17.4453 20.4579H14.0152C13.8223 20.4579 13.6872 20.28 13.7507 20.1099L16.0793 13.8771H11.8347L9.54332 19.7685C9.38236 20.1824 8.96151 20.4579 8.49019 20.4579H5.06011C4.86732 20.4578 4.73211 20.28 4.79566 20.1099L7.88746 11.8341L4.80347 3.95166C4.73669 3.78091 4.87181 3.60017 5.06636 3.6001H8.49683Z", + "opacity": 1 + } + ], "moon": "M9.06693 2.41209C9.23841 2.03292 9.15714 1.58718 8.86288 1.29292C8.56862 0.998664 8.12289 0.917397 7.74371 1.08887C3.76893 2.88642 1 6.88764 1 11.5377C1 17.8682 6.13185 23 12.4623 23C17.1124 23 21.1136 20.2311 22.9112 16.2563C23.0826 15.8771 23.0014 15.4314 22.7071 15.1371C22.4128 14.8429 21.9671 14.7616 21.5879 14.9331C20.4015 15.4697 19.0838 15.7689 17.6935 15.7689C12.4676 15.7689 8.23116 11.5325 8.23116 6.30656C8.23116 4.91628 8.53036 3.59857 9.06693 2.41209Z", "sun": "M13 2C13 1.44772 12.5523 1 12 1C11.4477 1 11 1.44772 11 2V4C11 4.55228 11.4477 5 12 5C12.5523 5 13 4.55228 13 4V2ZM13 20C13 19.4477 12.5523 19 12 19C11.4477 19 11 19.4477 11 20V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V20ZM2 11C1.44772 11 1 11.4477 1 12C1 12.5523 1.44772 13 2 13H4C4.55228 13 5 12.5523 5 12C5 11.4477 4.55228 11 4 11H2ZM5.60701 4.1928C5.21649 3.80227 4.58332 3.80227 4.1928 4.1928C3.80227 4.58332 3.80227 5.21649 4.1928 5.60701L5.60701 7.02122C5.99753 7.41175 6.6307 7.41175 7.02122 7.02122C7.41175 6.6307 7.41175 5.99753 7.02122 5.60701L5.60701 4.1928ZM19.8073 5.60701C20.1979 5.21649 20.1979 4.58332 19.8073 4.1928C19.4168 3.80227 18.7836 3.80227 18.3931 4.1928L16.9789 5.60701C16.5884 5.99753 16.5884 6.6307 16.9789 7.02122C17.3694 7.41175 18.0026 7.41175 18.3931 7.02122L19.8073 5.60701ZM7.02122 18.397C7.41175 18.0065 7.41175 17.3734 7.02122 16.9828C6.6307 16.5923 5.99753 16.5923 5.60701 16.9828L4.1928 18.397C3.80227 18.7876 3.80227 19.4207 4.1928 19.8113C4.58332 20.2018 5.21649 20.2018 5.60701 19.8113L7.02122 18.397ZM18.3931 16.9828C18.0026 16.5923 17.3694 16.5923 16.9789 16.9828C16.5884 17.3734 16.5884 18.0065 16.9789 18.397L18.3931 19.8113C18.7836 20.2018 19.4168 20.2018 19.8073 19.8113C20.1979 19.4207 20.1979 18.7876 19.8073 18.397L18.3931 16.9828ZM20 11C19.4477 11 19 11.4477 19 12C19 12.5523 19.4477 13 20 13H22C22.5523 13 23 12.5523 23 12C23 11.4477 22.5523 11 22 11H20ZM6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12Z", "namespace": "M 1 6.162 C 1 5.635 1 5.18 1.03 4.805 C 1.063 4.41 1.134 4.017 1.327 3.638 C 1.615 3.074 2.074 2.615 2.638 2.328 C 3.016 2.134 3.41 2.063 3.805 2.031 C 4.18 2 4.635 2 5.161 2 L 9.147 2 C 9.74 1.998 10.262 1.998 10.742 2.163 C 11.162 2.308 11.545 2.545 11.863 2.856 C 12.226 3.211 12.459 3.678 12.723 4.21 L 13.618 6 L 17.241 6 C 18.046 6 18.711 6 19.251 6.044 C 19.814 6.09 20.331 6.189 20.816 6.436 C 21.569 6.819 22.181 7.431 22.564 8.184 C 22.811 8.669 22.91 9.186 22.956 9.748 C 23 10.289 23 10.954 23 11.758 L 23 16.241 C 23 17.046 23 17.711 22.956 18.251 C 22.91 18.814 22.811 19.331 22.564 19.816 C 22.181 20.569 21.569 21.181 20.816 21.564 C 20.331 21.811 19.814 21.91 19.252 21.956 C 18.711 22 18.046 22 17.242 22 L 6.758 22 C 5.953 22 5.288 22 4.748 21.956 C 4.185 21.91 3.668 21.811 3.183 21.564 C 2.43 21.181 1.818 20.569 1.435 19.816 C 1.188 19.331 1.089 18.814 1.043 18.252 C 1 17.71 1 17.046 1 16.242 Z M 5.2 4 C 4.623 4 4.25 4.001 3.968 4.024 C 3.696 4.046 3.596 4.084 3.546 4.109 C 3.358 4.205 3.205 4.358 3.109 4.546 C 3.084 4.596 3.046 4.696 3.024 4.968 C 3.004 5.217 3 5.535 3 6 L 11.382 6 L 10.99 5.216 C 10.637 4.509 10.554 4.375 10.464 4.285 C 10.358 4.182 10.23 4.103 10.09 4.055 C 9.969 4.013 9.812 4 9.022 4 Z", @@ -154,6 +165,7 @@ "clock-forward-2": "M21,10.12H14.22L16.96,7.3C14.23,4.6 9.81,4.5 7.08,7.2C4.35,9.91 4.35,14.28 7.08,17C9.81,19.7 14.23,19.7 16.96,17C18.32,15.65 19,14.08 19,12.1H21C21,14.08 20.12,16.65 18.36,18.39C14.85,21.87 9.15,21.87 5.64,18.39C2.14,14.92 2.11,9.28 5.62,5.81C9.13,2.34 14.76,2.34 18.27,5.81L21,3V10.12M12.5,8V12.25L16,14.33L15.28,15.54L11,13V8H12.5Z", "calendar-date": "M 15 2.001 C 15.476 2.003 15.891 2.013 16.252 2.043 C 16.814 2.089 17.331 2.188 17.816 2.435 C 18.569 2.818 19.181 3.43 19.564 4.183 C 19.811 4.668 19.91 5.185 19.956 5.748 C 20 6.288 20 6.953 20 7.758 L 20 16.242 C 20 17.046 20 17.711 19.956 18.252 C 19.91 18.814 19.811 19.331 19.564 19.816 C 19.181 20.569 18.569 21.181 17.816 21.564 C 17.331 21.811 16.814 21.91 16.251 21.956 C 15.711 22 15.046 22 14.241 22 L 5.758 22 C 4.954 22 4.29 22 3.748 21.956 C 3.186 21.91 2.669 21.811 2.184 21.564 C 1.431 21.181 0.819 20.569 0.436 19.816 C 0.189 19.331 0.09 18.814 0.044 18.251 C 0 17.711 0 17.046 0 16.241 L 0 7.758 C 0 6.954 0 6.29 0.044 5.748 C 0.09 5.186 0.189 4.669 0.436 4.184 C 0.819 3.431 1.431 2.819 2.184 2.436 C 2.669 2.189 3.186 2.09 3.748 2.044 C 4.109 2.015 4.525 2.005 5 2.002 L 5 1 C 5 0.448 5.448 0 6 0 C 6.552 0 7 0.448 7 1 L 7 2 L 13 2 L 13 1 C 13 0.448 13.448 0 14 0 C 14.552 0 15 0.448 15 1 Z M 5 5 L 5 4.002 C 4.554 4.005 4.205 4.014 3.911 4.038 C 3.473 4.073 3.248 4.138 3.092 4.218 C 2.716 4.41 2.41 4.716 2.218 5.092 C 2.138 5.248 2.073 5.472 2.038 5.911 C 2 6.361 2 6.943 2 7.8 L 2 8 L 18 8 L 18 7.8 C 18 6.943 18 6.361 17.962 5.911 C 17.927 5.473 17.862 5.248 17.782 5.092 C 17.59 4.716 17.284 4.41 16.908 4.218 C 16.752 4.138 16.528 4.073 16.089 4.038 C 15.727 4.013 15.363 4.001 15 4.002 L 15 5 C 15 5.552 14.552 6 14 6 C 13.448 6 13 5.552 13 5 L 13 4 L 7 4 L 7 5 C 7 5.552 6.552 6 6 6 C 5.448 6 5 5.552 5 5 Z M 9.445 11.168 L 7.945 12.168 C 7.495 12.467 7.364 13.07 7.649 13.529 C 7.934 13.988 8.533 14.137 9 13.866 L 9 16 L 8.75 16 C 8.198 16 7.75 16.448 7.75 17 C 7.75 17.552 8.198 18 8.75 18 L 11.25 18 C 11.802 18 12.25 17.552 12.25 17 C 12.25 16.448 11.802 16 11.25 16 L 11 16 L 11 12 C 11 11.631 10.797 11.292 10.472 11.118 C 10.147 10.944 9.752 10.963 9.445 11.168 Z", "merge": "M7.04652 9.86171C8.74809 9.4017 10 7.84705 10 6C10 3.79086 8.20914 2 6 2C3.79086 2 2 3.79086 2 6C2 7.86384 3.27477 9.42994 5 9.87398V21C5 21.5523 5.44772 22 6 22C6.55228 22 7 21.5523 7 21V15.0001C7.28228 15.3764 7.59237 15.7345 7.92893 16.0711C9.59483 17.737 11.788 18.7544 14.1162 18.9609C14.5465 20.7059 16.1221 22 18 22C20.2091 22 22 20.2091 22 18C22 15.7909 20.2091 14 18 14C16.153 14 14.5983 15.2519 14.1383 16.9535C12.3334 16.758 10.6389 15.9526 9.34315 14.6569C8.04737 13.3611 7.24201 11.6666 7.04652 9.86171Z", + "node": "M 18 8 C 18 12.032 15 15.434 11 15.938 L 11 16.171 C 11.854 16.474 12.527 17.146 12.83 18 L 19 18 C 19.552 18 20 18.448 20 19 C 20 19.552 19.552 20 19 20 L 12.83 20 C 12.407 21.2 11.272 22.002 10 22.002 C 8.728 22.002 7.593 21.2 7.17 20 L 1 20 C 0.448 20 0 19.552 0 19 C 0 18.448 0.448 18 1 18 L 7.17 18 C 7.473 17.145 8.145 16.473 9 16.17 L 9 15.938 C 4.813 15.405 1.76 11.712 2.025 7.5 C 2.289 3.288 5.78 0.005 10 0 C 14.418 0 18 3.582 18 8 Z M 7.722 13.552 C 6.928 12.151 6.431 10.602 6.263 9 L 4.083 9 C 4.43 11.043 5.805 12.764 7.722 13.552 Z M 15.917 9 L 13.74 9 C 13.571 10.601 13.074 12.15 12.28 13.551 C 14.196 12.763 15.57 11.043 15.917 9 Z M 15.918 7 C 15.571 4.957 14.197 3.238 12.281 2.449 C 13.075 3.85 13.572 5.399 13.74 7 Z M 7.722 2.448 C 5.805 3.236 4.43 4.957 4.083 7 L 6.263 7 C 6.431 5.398 6.928 3.849 7.722 2.448 Z M 10 2.588 C 9.07 3.894 8.478 5.41 8.276 7 L 11.726 7 C 11.524 5.409 10.931 3.894 10.001 2.588 Z M 10.001 13.412 C 10.001 13.412 10.001 13.412 10.001 13.411 C 10 13.412 10 13.412 10 13.412 Z M 10.001 13.411 C 10.931 12.106 11.524 10.59 11.726 9 L 8.276 9 C 8.478 10.59 9.07 12.106 10.001 13.411 Z", "eye": "M 5.077 6.707 C 6.805 5.265 9.138 4 12 4 C 14.862 4 17.195 5.265 18.923 6.707 C 20.649 8.148 21.833 9.814 22.426 10.753 L 22.45 10.791 C 22.568 10.976 22.72 11.217 22.797 11.553 C 22.859 11.848 22.859 12.152 22.797 12.447 C 22.72 12.783 22.567 13.024 22.45 13.209 L 22.426 13.247 C 21.833 14.186 20.649 15.852 18.923 17.293 C 17.195 18.735 14.862 20 12 20 C 9.138 20 6.805 18.735 5.077 17.293 C 3.35 15.852 2.167 14.186 1.574 13.247 L 1.55 13.209 C 1.389 12.978 1.272 12.72 1.203 12.447 C 1.141 12.152 1.141 11.848 1.203 11.553 C 1.28 11.216 1.433 10.976 1.55 10.791 L 1.574 10.753 C 2.167 9.814 3.35 8.148 5.077 6.707 Z M 12 16 C 14.209 16 16 14.209 16 12 C 16 9.791 14.209 8 12 8 C 9.791 8 8 9.791 8 12 C 8 14.209 9.791 16 12 16 Z M 14 12 C 14 13.105 13.105 14 12 14 C 10.895 14 10 13.105 10 12 C 10 10.895 10.895 10 12 10 C 13.105 10 14 10.895 14 12 Z", "eye-off": "M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z", "edit": "M16.2927 2.29295C17.7878 0.797857 20.2118 0.797859 21.7069 2.29295C23.202 3.78805 23.202 6.21207 21.7069 7.70717L20.5454 8.86869L20.5454 8.86873C20.1494 9.26471 19.9514 9.46271 19.723 9.5369C19.5222 9.60216 19.3058 9.60216 19.105 9.5369C18.8768 9.46274 18.6789 9.26484 18.2831 8.86911L18.2826 8.86869L15.1312 5.71722L15.1305 5.71645C14.735 5.32094 14.5371 5.12304 14.463 4.89486C14.3977 4.69402 14.3977 4.47767 14.463 4.27683C14.5371 4.04865 14.735 3.85075 15.1305 3.45524L15.1312 3.45447L16.2927 2.29295ZM16.8694 12.5448L16.8686 12.5456L8.451 20.9633C8.2061 21.2086 7.99008 21.4249 7.7334 21.5942C7.50774 21.743 7.26301 21.8606 7.00584 21.9439C6.71345 22.0385 6.40966 22.0721 6.0653 22.11L6.06494 22.1101L2.61044 22.4939C2.30851 22.5274 2.00771 22.4219 1.7929 22.2071C1.57809 21.9923 1.47258 21.6915 1.50612 21.3896L1.88992 17.9351L1.88992 17.9351C1.92792 17.5906 1.96144 17.2867 2.05613 16.9942C2.13938 16.737 2.25701 16.4923 2.40582 16.2666C2.57502 16.01 2.79132 15.794 3.03652 15.5492L3.03673 15.549L11.4544 7.13134C11.8504 6.73532 12.0484 6.53732 12.2768 6.46313C12.4776 6.39787 12.694 6.39787 12.8948 6.46313C13.123 6.53729 13.321 6.73519 13.7168 7.13091L13.7172 7.13134L16.8686 10.2828L16.8698 10.2839C17.265 10.6793 17.4628 10.8771 17.5368 11.1052C17.6021 11.306 17.6021 11.5224 17.5368 11.7232C17.4628 11.9514 17.2649 12.1493 16.8694 12.5448Z", @@ -172,6 +184,7 @@ "square": "M14 2.75C15.907 2.75 17.262 2.752 18.29 2.89C19.295 3.025 19.875 3.279 20.298 3.702C20.721 4.125 20.975 4.705 21.11 5.711C21.248 6.739 21.25 8.093 21.25 10C21.25 10.1989 21.329 10.3897 21.4697 10.5303C21.6103 10.671 21.8011 10.75 22 10.75C22.1989 10.75 22.3897 10.671 22.5303 10.5303C22.671 10.3897 22.75 10.1989 22.75 10V9.944C22.75 8.106 22.75 6.65 22.597 5.511C22.439 4.339 22.107 3.39 21.359 2.641C20.61 1.893 19.661 1.561 18.489 1.403C17.349 1.25 15.894 1.25 14.056 1.25H14C13.8011 1.25 13.6103 1.32902 13.4697 1.46967C13.329 1.61032 13.25 1.80109 13.25 2C13.25 2.19891 13.329 2.38968 13.4697 2.53033C13.6103 2.67098 13.8011 2.75 14 2.75ZM9.944 1.25H10C10.1989 1.25 10.3897 1.32902 10.5303 1.46967C10.671 1.61032 10.75 1.80109 10.75 2C10.75 2.19891 10.671 2.38968 10.5303 2.53033C10.3897 2.67098 10.1989 2.75 10 2.75C8.093 2.75 6.739 2.752 5.71 2.89C4.705 3.025 4.125 3.279 3.702 3.702C3.279 4.125 3.025 4.705 2.89 5.711C2.752 6.739 2.75 8.093 2.75 10C2.75 10.1989 2.67098 10.3897 2.53033 10.5303C2.38968 10.671 2.19891 10.75 2 10.75C1.80109 10.75 1.61032 10.671 1.46967 10.5303C1.32902 10.3897 1.25 10.1989 1.25 10V9.944C1.25 8.106 1.25 6.65 1.403 5.511C1.561 4.339 1.893 3.39 2.641 2.641C3.39 1.893 4.339 1.561 5.511 1.403C6.651 1.25 8.106 1.25 9.944 1.25ZM5.527 5.527C5 6.054 5 6.903 5 8.6C5 9.731 5 10.297 5.351 10.649C5.703 11 6.27 11 7.4 11H8.6C9.731 11 10.297 11 10.649 10.649C11 10.296 11 9.73 11 8.6V7.4C11 6.269 11 5.703 10.649 5.351C10.296 5 9.73 5 8.6 5C6.903 5 6.054 5 5.527 5.527ZM5.527 18.473C5 17.946 5 17.097 5 15.4C5 14.269 5 13.703 5.351 13.351C5.703 13 6.27 13 7.4 13H8.6C9.731 13 10.297 13 10.649 13.351C11 13.703 11 14.269 11 15.4V16.6C11 17.731 11 18.297 10.649 18.648C10.296 19 9.73 19 8.6 19C6.903 19 6.054 19 5.527 18.473ZM13 7.4C13 6.269 13 5.703 13.351 5.351C13.704 5 14.27 5 15.4 5C17.097 5 17.946 5 18.473 5.527C19 6.054 19 6.903 19 8.6C19 9.731 19 10.297 18.648 10.649C18.298 11 17.731 11 16.6 11H15.4C14.269 11 13.703 11 13.351 10.649C13 10.296 13 9.73 13 8.6V7.4ZM13.351 18.648C13 18.298 13 17.731 13 16.6V15.4C13 14.269 13 13.703 13.351 13.351C13.704 13 14.27 13 15.4 13H16.6C17.731 13 18.297 13 18.648 13.351C19 13.703 19 14.269 19 15.4C19 17.097 19 17.946 18.473 18.473C17.946 19 17.097 19 15.4 19C14.269 19 13.703 19 13.351 18.648ZM22.5303 13.4697C22.3897 13.329 22.1989 13.25 22 13.25C21.8011 13.25 21.6103 13.329 21.4697 13.4697C21.329 13.6103 21.25 13.8011 21.25 14C21.25 15.907 21.248 17.262 21.11 18.289C20.975 19.295 20.721 19.875 20.298 20.298C19.875 20.721 19.295 20.975 18.29 21.11C17.262 21.248 15.907 21.25 14 21.25C13.8011 21.25 13.6103 21.329 13.4697 21.4697C13.329 21.6103 13.25 21.8011 13.25 22C13.25 22.1989 13.329 22.3897 13.4697 22.5303C13.6103 22.671 13.8011 22.75 14 22.75H14.056H14.0561C15.894 22.75 17.349 22.75 18.489 22.597C19.661 22.439 20.61 22.107 21.359 21.359C22.107 20.61 22.439 19.661 22.597 18.489C22.75 17.35 22.75 15.894 22.75 14.056V14C22.75 13.8011 22.671 13.6103 22.5303 13.4697ZM2.53033 13.4697C2.67098 13.6103 2.75 13.8011 2.75 14C2.75 15.907 2.752 17.262 2.89 18.289C3.025 19.295 3.279 19.875 3.702 20.298C4.125 20.721 4.705 20.975 5.71 21.11C6.739 21.248 8.093 21.25 10 21.25C10.1989 21.25 10.3897 21.329 10.5303 21.4697C10.671 21.6103 10.75 21.8011 10.75 22C10.75 22.1989 10.671 22.3897 10.5303 22.5303C10.3897 22.671 10.1989 22.75 10 22.75H9.944H9.94393C8.10596 22.75 6.65099 22.75 5.511 22.597C4.339 22.439 3.39 22.107 2.641 21.359C1.893 20.61 1.561 19.661 1.403 18.489C1.25 17.35 1.25 15.894 1.25 14.056V14C1.25 13.8011 1.32902 13.6103 1.46967 13.4697C1.61032 13.329 1.80109 13.25 2 13.25C2.19891 13.25 2.38968 13.329 2.53033 13.4697Z", "arrow-narrow-right": "M14.7071 5.29289C14.3166 4.90237 13.6834 4.90237 13.2929 5.29289C12.9024 5.68342 12.9024 6.31658 13.2929 6.70711L17.5858 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H17.5858L13.2929 17.2929C12.9024 17.6834 12.9024 18.3166 13.2929 18.7071C13.6834 19.0976 14.3166 19.0976 14.7071 18.7071L20.7071 12.7071C21.0976 12.3166 21.0976 11.6834 20.7071 11.2929L14.7071 5.29289Z", "arrow-narrow-left": "M10.7071 6.70711C11.0976 6.31658 11.0976 5.68342 10.7071 5.29289C10.3166 4.90237 9.68342 4.90237 9.29289 5.29289L3.29289 11.2929C2.90237 11.6834 2.90237 12.3166 3.29289 12.7071L9.29289 18.7071C9.68342 19.0976 10.3166 19.0976 10.7071 18.7071C11.0976 18.3166 11.0976 17.6834 10.7071 17.2929L6.41421 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H6.41421L10.7071 6.70711Z", + "repeat": "M15.7071 3.29289C15.3166 2.90237 14.6834 2.90237 14.2929 3.29289C13.9024 3.68342 13.9024 4.31658 14.2929 4.70711L17.5858 8H13.5556C11.913 7.99999 10.6191 7.99999 9.57778 8.08507C8.51543 8.17186 7.62827 8.35217 6.82207 8.76295C5.50493 9.43407 4.43407 10.5049 3.76295 11.8221C3.35217 12.6283 3.17186 13.5154 3.08507 14.5778C2.99999 15.6191 2.99999 16.913 3 18.5556V20C3 20.5523 3.44772 21 4 21C4.55229 21 5 20.5523 5 20V18.6C5 16.9033 5.00078 15.691 5.07842 14.7406C5.15512 13.802 5.30179 13.2073 5.54497 12.73C6.02433 11.7892 6.78924 11.0243 7.73005 10.545C8.20732 10.3018 8.80197 10.1551 9.74064 10.0784C10.691 10.0008 11.9033 10 13.6 10H17.5858L14.2929 13.2929C13.9024 13.6834 13.9024 14.3166 14.2929 14.7071C14.6834 15.0976 15.3166 15.0976 15.7071 14.7071L20.7071 9.70711C21.0976 9.31658 21.0976 8.68342 20.7071 8.29289L15.7071 3.29289Z", "level": "M 23 12 C 23 18.075 18.075 23 12 23 C 5.925 23 1 18.075 1 12 C 1 5.925 5.925 1 12 1 C 18.075 1 23 5.925 23 12 Z M 6 12 C 5.999 10.223 6.787 8.536 8.15 7.396 C 9.514 6.256 11.313 5.778 13.062 6.093 C 13.419 6.169 13.79 6.044 14.028 5.767 C 14.266 5.49 14.335 5.106 14.206 4.764 C 14.078 4.422 13.774 4.177 13.412 4.125 C 10.226 3.553 7.009 4.957 5.262 7.682 C 3.515 10.408 3.583 13.917 5.434 16.573 C 5.75 17.026 6.374 17.137 6.826 16.82 C 7.279 16.504 7.39 15.881 7.074 15.428 C 6.372 14.423 5.997 13.226 6 12 Z M 19.816 10.287 C 19.743 9.935 19.486 9.649 19.144 9.539 C 18.802 9.428 18.427 9.51 18.161 9.753 C 17.896 9.996 17.782 10.362 17.862 10.713 C 18.217 12.347 17.878 14.054 16.925 15.428 C 16.623 15.881 16.738 16.492 17.185 16.803 C 17.631 17.115 18.245 17.012 18.565 16.572 C 19.836 14.741 20.289 12.465 19.815 10.287 Z M 17.207 8.207 C 17.586 7.815 17.581 7.191 17.195 6.805 C 16.809 6.419 16.185 6.414 15.793 6.793 L 12.518 10.068 C 11.766 9.864 10.964 10.115 10.462 10.711 C 9.96 11.307 9.851 12.141 10.181 12.847 C 10.511 13.552 11.221 14.003 12 14 C 12.622 14 13.208 13.711 13.587 13.217 C 13.966 12.724 14.093 12.083 13.932 11.482 Z", "layers": "M11.7234 1.0848C11.9062 1.05051 12.0938 1.05051 12.2766 1.0848C12.493 1.12541 12.6861 1.22394 12.7794 1.27155L12.805 1.28452L22.4472 6.10564C22.786 6.27503 23 6.62129 23 7.00006C23 7.37884 22.786 7.7251 22.4472 7.89449L12.805 12.7156L12.7794 12.7286C12.6861 12.7762 12.493 12.8747 12.2766 12.9153C12.0938 12.9496 11.9062 12.9496 11.7234 12.9153C11.507 12.8747 11.3139 12.7762 11.2206 12.7286L11.195 12.7156L1.55279 7.89449C1.214 7.7251 1 7.37884 1 7.00006C1 6.62129 1.214 6.27503 1.55279 6.10564L11.195 1.28452L11.2206 1.27155C11.3139 1.22394 11.507 1.12541 11.7234 1.0848ZM2.52769 10.618L1.55279 11.1054C1.214 11.2748 1 11.6211 1 11.9999C1 12.3786 1.214 12.7249 1.55279 12.8943L11.195 17.7154L11.2206 17.7284C11.3139 17.776 11.507 17.8745 11.7234 17.9151C11.9062 17.9494 12.0938 17.9494 12.2766 17.9151C12.493 17.8745 12.6861 17.776 12.7794 17.7284L12.805 17.7154L22.4472 12.8943C22.786 12.7249 23 12.3786 23 11.9999C23 11.6211 22.786 11.2748 22.4472 11.1054L21.4723 10.618L13.6994 14.5044L13.6876 14.5103C13.6388 14.5349 13.5187 14.5951 13.3985 14.6474C13.2382 14.7172 12.9785 14.8185 12.6454 14.881C12.2189 14.961 11.7811 14.961 11.3546 14.881C11.0215 14.8185 10.7618 14.7172 10.6015 14.6474C10.4813 14.5951 10.3612 14.5349 10.3124 14.5103L10.3006 14.5044L2.52769 10.618ZM1.55279 16.1055L2.52784 15.618L10.3006 19.5044L10.3124 19.5103L10.3125 19.5104C10.3614 19.5349 10.4814 19.5952 10.6015 19.6474C10.7618 19.7172 11.0215 19.8185 11.3546 19.881C11.7811 19.961 12.2189 19.961 12.6454 19.881C12.9785 19.8185 13.2382 19.7172 13.3985 19.6474C13.5186 19.5952 13.6386 19.5349 13.6875 19.5104L13.6876 19.5103L13.6994 19.5044L21.4722 15.618L22.4472 16.1055C22.786 16.2749 23 16.6212 23 17C23 17.3787 22.786 17.725 22.4472 17.8944L12.805 22.7155L12.7794 22.7285C12.6861 22.7761 12.493 22.8746 12.2766 22.9152C12.0938 22.9495 11.9062 22.9495 11.7234 22.9152C11.507 22.8746 11.3139 22.7761 11.2206 22.7285L11.195 22.7155L1.55279 17.8944C1.214 17.725 1 17.3787 1 17C1 16.6212 1.214 16.2749 1.55279 16.1055Z", "return": "M6.2929 18.7071C6.6834 19.0976 7.3166 19.0976 7.7071 18.7071C8.0976 18.3166 8.0976 17.6834 7.7071 17.2929L5.4142 15H16.5C19.5376 15 22 12.5376 22 9.5C22 6.4624 19.5376 4 16.5 4H12C11.4477 4 11 4.4477 11 5C11 5.5523 11.4477 6 12 6H16.5C18.433 6 20 7.567 20 9.5C20 11.433 18.433 13 16.5 13H5.4142L7.7071 10.7071C8.0976 10.3166 8.0976 9.6834 7.7071 9.2929C7.3166 8.9024 6.6834 8.9024 6.2929 9.2929L2.2929 13.2929C1.9024 13.6834 1.9024 14.3166 2.2929 14.7071L6.2929 18.7071Z", diff --git a/assets/styles/base.scss b/assets/styles/base.scss index b2d9a8b4..09d262e5 100644 --- a/assets/styles/base.scss +++ b/assets/styles/base.scss @@ -78,7 +78,7 @@ $grayscale: ( --block-progress-fill-background: #33a853; --logo-name: var(--txt-primary); --bar-fill: rgb(243, 147, 45); - --validator-active: #85f891; + --validator-active: #18d2a5; --validator-inactive: #1ca7ed; --validator-jailed: #f8774a; --supply: #1ca7ed; @@ -378,6 +378,21 @@ body { transform: translateY(-25px); } +.slide-fade-enter-active, +.slide-fade-leave-active { + transition: all 0.2s ease; + position: absolute; + width: 100%; +} +.slide-fade-enter-from { + opacity: 0; + transform: translateX(-30%); +} +.slide-fade-leave-to { + opacity: 0; + transform: translateX(30%); +} + .table_column_alias { max-width: 125px; diff --git a/components/Feed.vue b/components/Feed.vue index bd840e6c..4d5e0583 100644 --- a/components/Feed.vue +++ b/components/Feed.vue @@ -3,38 +3,26 @@ import { DateTime } from "luxon" /** Services */ -import { abbreviate, comma, formatBytes, isMainnet, roundTo } from "@/services/utils" +import { abbreviate, capitilize, comma, formatBytes, isMainnet, roundTo } from "@/services/utils" import { getRankCategory } from "@/services/constants/rollups" +import { quoteServiceURL, rollupRankingServiceURL } from "@/services/config" /** UI */ import Tooltip from "@/components/ui/Tooltip.vue" /** API */ +import { fetchRollupsRanking } from "@/services/api/rollup" import { fetchPriceSeries, fetchSummary, fetchTVS } from "@/services/api/stats" /** Store */ import { useAppStore } from "@/store/app.store" -import { useActivityStore } from "@/store/activity.store" const appStore = useAppStore() -const activityStore = useActivityStore() const head = computed(() => appStore.lastHead) const currentPrice = computed(() => appStore.currentPrice) const totalFees = computed(() => head.value.total_fee / 1_000_000) const totalFeesUSD = computed(() => totalFees.value * currentPrice.value?.close) -const topRollup = computed(() => { - let rankCategory = getRankCategory(roundTo(activityStore?.rollups_ranking?.top_rollup?.rank / 10, 0)) - return { - slug: activityStore?.rollups_ranking?.top_rollup?.slug, - name: activityStore?.rollups_ranking?.top_rollup?.name, - rank: { - name: rankCategory?.name, - score: activityStore?.rollups_ranking?.top_rollup?.rank, - color: rankCategory?.color, - }, - } -}) const isLoading = ref(true) const series = ref([]) @@ -43,24 +31,43 @@ const price = reactive({ diff: 0, side: null, }) +const showPrice = ref(!!quoteServiceURL()) +const topRollup = ref(null) +const showTopRollup = ref(isMainnet() && !!rollupRankingServiceURL()) const tvs = computed(() => appStore.tvs) const txCount24h = ref(0) const bytesInBlocks24h = ref(0) onMounted(async () => { - const dataSeries = await fetchPriceSeries({ from: parseInt(DateTime.now().minus({ days: 3 }).ts / 1_000) }) - series.value = dataSeries - appStore.currentPrice = series.value[0] - price.value = parseFloat(series.value[0].close) - - const prevDayClosePrice = parseFloat(series.value[1].close) - price.diff = (Math.abs(prevDayClosePrice - price.value) / ((prevDayClosePrice + price.value) / 2)) * 100 - let side = "stay" - if (price.value - prevDayClosePrice !== 0) { - side = price.value - prevDayClosePrice > 0 ? "rise" : "fall" + if (showPrice.value) { + const dataSeries = await fetchPriceSeries({ from: parseInt(DateTime.now().minus({ days: 3 }).ts / 1_000) }) + if (dataSeries.length) { + series.value = dataSeries + appStore.currentPrice = series.value[0] + price.value = parseFloat(series.value[0].close) + + const prevDayClosePrice = parseFloat(series.value[1].close) + price.diff = (Math.abs(prevDayClosePrice - price.value) / ((prevDayClosePrice + price.value) / 2)) * 100 + let side = "stay" + if (price.value - prevDayClosePrice !== 0) { + side = price.value - prevDayClosePrice > 0 ? "rise" : "fall" + } + price.side = side + } } - price.side = side + if (showTopRollup.value) { + const _topRollups = await fetchRollupsRanking({ limit: 1 }) + if (_topRollups.length) { + const _r = _topRollups[0] + topRollup.value = { + ..._r, + category: getRankCategory(roundTo(_r.rank / 10, 0)), + name: _r.slug.split("-").map(el => capitilize(el)).join(" "), + } + } + } + const _tvs = await fetchTVS({ period: null }) if (_tvs.value) { appStore.tvs = _tvs.value @@ -83,7 +90,7 @@ onMounted(async () => { - diff --git a/components/modals/RollupRankModal.vue b/components/modals/RollupRankModal.vue index c284909e..5b03b4cc 100644 --- a/components/modals/RollupRankModal.vue +++ b/components/modals/RollupRankModal.vue @@ -18,50 +18,57 @@ const rank = ref({}) const rollup = ref({}) const metrics = ref([ { - key: "day_blobs_count", + key: "blobs", name: "Blobs count", coefficient: 0.2, - type: "Quantitative", - }, - { - key: "avg_pfb_size", - name: "Avg PFB Size", - coefficient: 0.3, - type: "Quantitative", + type: "Logarithmic", }, { - key: "last_message_time", + key: "last_msg", name: "Last activity time", - coefficient: 0.3, + coefficient: 0.2, type: "Time-Based", }, { - key: "commits_weekly", + key: "commits", name: "Weekly commits", - coefficient: 0.1, + coefficient: 0.05, type: "Quantitative", }, { - key: "last_pushed_at", + key: "last_push", name: "Last pushed", - coefficient: 0.1, + coefficient: 0.05, type: "Time-Based", }, + { + key: "mb_price", + name: "MB price", + coefficient: 0.2, + type: "Reciprocal quantitative", + }, + { + key: "tvl", + name: "TVL", + coefficient: 0.3, + type: "Custom", + }, ]) const getMetricValue = (key) => { const coefficient = metrics.value.find((m) => m.key === key)?.coefficient - const metricValue = +rank.value?.ranking[key]?.score / +coefficient + const metricValue = rank.value?.scores[key] / coefficient return roundTo(metricValue, 2) } + watch( () => props.show, () => { if (props.show) { - rank.value = cacheStore.selectedRollupRank rollup.value = cacheStore.selectedRollup - + rank.value = rollup.value?.ranking + metrics.value = metrics.value.map((m) => { return { ...m, @@ -77,7 +84,7 @@ watch( = - - {{ rank.ranking.rank.score }} + + {{ rank.rank }} - + @@ -396,6 +319,10 @@ math { object-fit: cover; } +.summary { + font-size: 14px; +} + @media (max-width: 550px) { .rank_calculation { width: 100%; diff --git a/components/modules/address/AddressCharts.vue b/components/modules/address/AddressCharts.vue index 233053bb..c1c102e5 100644 --- a/components/modules/address/AddressCharts.vue +++ b/components/modules/address/AddressCharts.vue @@ -1,17 +1,20 @@ @@ -659,207 +222,23 @@ onBeforeUnmount(() => { - - Txs - - - - - {{ abbreviate(Math.max(...txSeries.map((d) => d.value)), 0) }} - - - - - {{ abbreviate(Math.round(Math.max(...txSeries.map((d) => d.value)) / 2), 0) }} - - - - 0 - - - - - - - {{ - DateTime.now() - .minus({ days: selectedPeriod.value - 1 }) - .toFormat("LLL dd") - }} - - - {{ DateTime.now().minus({ hours: selectedPeriod.value }).set({ minutes: 0 }).toFormat("hh:mm a") }} - - - {{ - selectedPeriod.timeframe === "day" ? "Today" : "Now" - }} - - - - -
-
-
-
- - {{ badgeText }} - -
- - - Txs - {{ tooltipText }} - - -
- - - - - - - - Fee Spent - - - - - {{ - tia(Math.max(...feeSeries.map((d) => d.value)), 0) > 1 - ? tia(Math.max(...feeSeries.map((d) => d.value)), 0) - : tia(Math.max(...feeSeries.map((d) => d.value)), 2) - }} - TIA - - - - - {{ - tia(Math.round(Math.max(...feeSeries.map((d) => d.value)) / 2), 0) > 1 - ? tia(Math.round(Math.max(...feeSeries.map((d) => d.value)) / 2), 0) - : tia(Math.round(Math.max(...feeSeries.map((d) => d.value)) / 2), 2) - }} - TIA - - - - 0 - - - - - - - {{ - DateTime.now() - .minus({ days: selectedPeriod.value - 1 }) - .toFormat("LLL dd") - }} - - - {{ DateTime.now().minus({ hours: selectedPeriod.value }).set({ minutes: 0 }).toFormat("hh:mm a") }} - - - {{ - selectedPeriod.timeframe === "day" ? "Today" : "Now" - }} - - - - -
-
-
-
- - {{ badgeText }} - -
- - - Spent - {{ tia(tooltipText) }} TIA - - -
- - - - - + + + diff --git a/components/modules/block/BlobsTable.vue b/components/modules/block/BlobsTable.vue index 10f5212e..8246ab79 100644 --- a/components/modules/block/BlobsTable.vue +++ b/components/modules/block/BlobsTable.vue @@ -115,9 +115,9 @@ watch( const handleViewBlob = (blob) => { /** normalize the blob */ cacheStore.selectedBlob = { - hash: blob.namespace.hash, - namespace_id: blob.namespace.namespace_id, - namespace_name: blob.namespace.name, + hash: blob.namespace?.hash, + namespace_id: blob.namespace?.namespace_id, + namespace_name: blob.namespace?.name, commitment: blob.commitment, height: blob.height, signer: blob.signer, @@ -196,29 +196,29 @@ const handlePrev = () => { - + - {{ $getDisplayName("namespaces", blob.namespace.namespace_id) }} + {{ $getDisplayName("namespaces", blob.namespace?.namespace_id) }} - + - {{ blob.namespace.name }} + {{ blob.namespace?.name }} @@ -265,7 +265,7 @@ const handlePrev = () => { - {{ blob.namespace.version }} + {{ blob.namespace?.version }} diff --git a/components/modules/block/BlockOverview.vue b/components/modules/block/BlockOverview.vue index d4ecabd2..18e57100 100644 --- a/components/modules/block/BlockOverview.vue +++ b/components/modules/block/BlockOverview.vue @@ -14,9 +14,10 @@ import Popover from "@/components/ui/Popover.vue" import Tooltip from "@/components/ui/Tooltip.vue" /** Shared Components */ -import MessageTypeBadge from "@/components/shared/MessageTypeBadge.vue" import Events from "@/components/shared/tables/Events.vue" +import MessageTypeBadge from "@/components/shared/MessageTypeBadge.vue" import TablePlaceholderView from "@/components/shared/TablePlaceholderView.vue" +import UpcomingUpdate from "@/components/shared/tables/UpcomingUpdate.vue" /** Components */ import UpcomingBlockCard from "./UpcomingBlockCard.vue" @@ -78,11 +79,13 @@ const secondsToSelectedBlock = computed(() => { return (props.height - latestBlock.value.height) * avgBlockTime.value }) -const preselectedTab = route.query.tab && ["transactions", "events"].includes(route.query.tab) ? route.query.tab : "transactions" -const activeTab = ref(preselectedTab) +// const preselectedTab = route.query.tab && ["transactions", "events"].includes(route.query.tab) ? route.query.tab : "transactions" +// const activeTab = ref(preselectedTab) +const activeTab = ref() const isLoading = ref(false) const transactions = ref([]) +const update = ref() const page = ref(1) const handleNext = () => { @@ -267,7 +270,18 @@ const getTransactions = async () => { await getTransactions() +onBeforeMount(async () => { +}) + onMounted(async () => { + update.value = appStore.globalUpdates.find(upd => upd.block === props.height) + if (update.value?.kind) { + activeTab.value = "upcoming_update" + } else { + const preselectedTab = route.query.tab && ["transactions", "events"].includes(route.query.tab) ? route.query.tab : "transactions" + activeTab.value = preselectedTab + } + router.replace({ query: { tab: activeTab.value, @@ -307,6 +321,15 @@ watch( }, ) +watch( + () => appStore.globalUpdates, + () => { + update.value = appStore.globalUpdates.find(upd => { + return upd.block === props.height + }) + }, +) + const handleViewODSBlock = () => { modalsStore.open("ods") } @@ -522,6 +545,18 @@ const handleViewRawTransactions = () => { + + + + Upcoming Update + + { - + +