diff --git a/README.md b/README.md index 1c01bdcf..c78107cc 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Clone the repository and run on the root folder: ``` -pnpm i -pnpm dev +bun i +bun dev ``` ### Node.js Server diff --git a/app.vue b/app/app.vue similarity index 79% rename from app.vue rename to app/app.vue index 0043b3ac..ff4b4dd3 100644 --- a/app.vue +++ b/app/app.vue @@ -1,29 +1,28 @@ diff --git a/components/AddressBadge.vue b/app/components/AddressBadge.vue similarity index 100% rename from components/AddressBadge.vue rename to app/components/AddressBadge.vue diff --git a/components/AmountInCurrency.vue b/app/components/AmountInCurrency.vue similarity index 95% rename from components/AmountInCurrency.vue rename to app/components/AmountInCurrency.vue index 88243249..c9de7bd9 100644 --- a/components/AmountInCurrency.vue +++ b/app/components/AmountInCurrency.vue @@ -1,12 +1,12 @@ + + diff --git a/components/OgImage/BlockImage.vue b/app/components/OgImage/BlockImage.satori.vue similarity index 77% rename from components/OgImage/BlockImage.vue rename to app/components/OgImage/BlockImage.satori.vue index 110ec92c..db6ad42e 100644 --- a/components/OgImage/BlockImage.vue +++ b/app/components/OgImage/BlockImage.satori.vue @@ -3,7 +3,7 @@ import { DateTime } from "luxon" /** Services */ -import { comma, formatBytes } from "@/services/utils" +import { comma, formatBytes } from "~/services/utils/index.js" defineOptions({ inheritAttrs: false, @@ -27,10 +27,10 @@ const messages = computed(() => [...new Set(props.block.message_types)]) + + diff --git a/components/OgImage/NamespaceImage.vue b/app/components/OgImage/NamespaceImage.satori.vue similarity index 77% rename from components/OgImage/NamespaceImage.vue rename to app/components/OgImage/NamespaceImage.satori.vue index c06184fe..cc813d02 100644 --- a/components/OgImage/NamespaceImage.vue +++ b/app/components/OgImage/NamespaceImage.satori.vue @@ -1,6 +1,6 @@ + + diff --git a/components/OgImage/ProposalImage.vue b/app/components/OgImage/ProposalImage.satori.vue similarity index 81% rename from components/OgImage/ProposalImage.vue rename to app/components/OgImage/ProposalImage.satori.vue index 3bddf658..1e2cf2b1 100644 --- a/components/OgImage/ProposalImage.vue +++ b/app/components/OgImage/ProposalImage.satori.vue @@ -55,10 +55,10 @@ function truncateText(text = "", maxCharsPerLine = 30, maxLines = 2) { + + diff --git a/components/OgImage/RollupImage.vue b/app/components/OgImage/RollupImage.satori.vue similarity index 66% rename from components/OgImage/RollupImage.vue rename to app/components/OgImage/RollupImage.satori.vue index bcb4ec3c..e18b67b2 100644 --- a/components/OgImage/RollupImage.vue +++ b/app/components/OgImage/RollupImage.satori.vue @@ -3,7 +3,7 @@ import { DateTime } from "luxon" /** Services */ -import { comma, formatBytes } from "@/services/utils" +import { comma, formatBytes } from "~/services/utils/index.js" defineOptions({ inheritAttrs: false, @@ -25,10 +25,10 @@ const bgStyles = computed(() => { + + diff --git a/components/OgImage/TxImage.vue b/app/components/OgImage/TxImage.satori.vue similarity index 84% rename from components/OgImage/TxImage.vue rename to app/components/OgImage/TxImage.satori.vue index 28e694fc..8445e8f6 100644 --- a/components/OgImage/TxImage.vue +++ b/app/components/OgImage/TxImage.satori.vue @@ -3,7 +3,7 @@ import { DateTime } from "luxon" /** Services */ -import { tia, comma } from "@/services/utils" +import { tia, comma } from "~/services/utils/index.js" defineOptions({ inheritAttrs: false, @@ -27,10 +27,10 @@ const messages = computed(() => [...new Set(props.tx.message_types)]) + + diff --git a/components/OgImage/UpgradeImage.vue b/app/components/OgImage/UpgradeImage.satori.vue similarity index 73% rename from components/OgImage/UpgradeImage.vue rename to app/components/OgImage/UpgradeImage.satori.vue index 6c7ca66f..f8682c2a 100644 --- a/components/OgImage/UpgradeImage.vue +++ b/app/components/OgImage/UpgradeImage.satori.vue @@ -1,6 +1,6 @@ + + diff --git a/components/OgImage/ValidatorImage.vue b/app/components/OgImage/ValidatorImage.satori.vue similarity index 62% rename from components/OgImage/ValidatorImage.vue rename to app/components/OgImage/ValidatorImage.satori.vue index f2abe1d1..85a873f5 100644 --- a/components/OgImage/ValidatorImage.vue +++ b/app/components/OgImage/ValidatorImage.satori.vue @@ -1,6 +1,6 @@ + + diff --git a/components/Outline.vue b/app/components/Outline.vue similarity index 100% rename from components/Outline.vue rename to app/components/Outline.vue diff --git a/components/Skeleton.vue b/app/components/Skeleton.vue similarity index 100% rename from components/Skeleton.vue rename to app/components/Skeleton.vue diff --git a/components/Text.vue b/app/components/Text.vue similarity index 100% rename from components/Text.vue rename to app/components/Text.vue diff --git a/components/TheFooter.vue b/app/components/TheFooter.vue similarity index 98% rename from components/TheFooter.vue rename to app/components/TheFooter.vue index ccd29c7b..072bafac 100644 --- a/components/TheFooter.vue +++ b/app/components/TheFooter.vue @@ -1,9 +1,9 @@ @@ -54,16 +54,13 @@ const modalsStore = useModalsStore() - + - + - + diff --git a/components/modals/ODSModal.vue b/app/components/modals/ODSModal.vue similarity index 95% rename from components/modals/ODSModal.vue rename to app/components/modals/ODSModal.vue index cf47d0b1..aab5448b 100644 --- a/components/modals/ODSModal.vue +++ b/app/components/modals/ODSModal.vue @@ -1,17 +1,16 @@ - - 150 characters or fewer. Letters, digits and @/./+/-/_ only. - + 150 characters or fewer. Letters, digits and @/./+/-/_ only. @@ -128,14 +122,11 @@ const handleLogin = () => { - - Enter a valid email address. - + Enter a valid email address. - + - - Your password can’t be too similar to your other personal information.
- Your password must contain at least 8 characters.
- Your password can’t be a commonly used password.
@@ -152,28 +142,27 @@ const handleLogin = () => {
- + - - Enter the same password as before, for verification. - + Enter the same password as before, for verification. Already have an account? - - Login - + Login @@ -188,7 +177,7 @@ const handleLogin = () => { padding: 6px 8px; - transition: all .2s ease; + transition: all 0.2s ease; &.selected { background: var(--op-10); diff --git a/components/modals/StakingModal.vue b/app/components/modals/StakingModal.vue similarity index 95% rename from components/modals/StakingModal.vue rename to app/components/modals/StakingModal.vue index d09fae42..8d3ffb5f 100644 --- a/components/modals/StakingModal.vue +++ b/app/components/modals/StakingModal.vue @@ -3,25 +3,24 @@ import { Dec, DecUtils } from "@keplr-wallet/unit" /** UI */ -import Modal from "@/components/ui/Modal.vue" -import Input from "@/components/ui/Input.vue" -import Tooltip from "@/components/ui/Tooltip.vue" -import Button from "@/components/ui/Button.vue" +import Modal from "~/components/ui/Modal.vue" +import Input from "~/components/ui/Input.vue" +import Tooltip from "~/components/ui/Tooltip.vue" +import Button from "~/components/ui/Button.vue" /** API */ -import { search } from "@/services/api/search" +import { search } from "~/services/api/search.js" /** Services */ -import amp from "@/services/amp" -import { normalizeAmount, purgeNumber, comma } from "@/services/utils/amounts" -import { SIMULATE_ADDRESS_FROM, SIMULATE_VALIDATOR, simulateMsgs, sendMsgs } from "@/services/wallet" -import { MsgDelegate } from "@/services/proto/gen/staking" +import { normalizeAmount, purgeNumber, comma } from "~/services/utils/amounts.js" +import { SIMULATE_ADDRESS_FROM, SIMULATE_VALIDATOR, simulateMsgs, sendMsgs } from "~/services/wallet.js" +import { MsgDelegate } from "~/services/proto/gen/staking.ts" /** Store */ -import { useAppStore } from "@/store/app.store" -import { useModalsStore } from "@/store/modals.store" -import { useCacheStore } from "@/store/cache.store" -import { useNotificationsStore } from "@/store/notifications.store" +import { useAppStore } from "~/store/app.store.js" +import { useModalsStore } from "~/store/modals.store.js" +import { useCacheStore } from "~/store/cache.store.js" +import { useNotificationsStore } from "~/store/notifications.store.js" const appStore = useAppStore() const modalsStore = useModalsStore() const cacheStore = useCacheStore() @@ -34,6 +33,8 @@ const props = defineProps({ show: Boolean, }) +const ph = usePostHog() + const MAX_DIGITS = 6 const inputEl = ref() @@ -199,7 +200,7 @@ watch( () => props.show, async () => { if (props.show) { - amp.log("showStakingModal") + ph.capture("show_staking_modal") if (!appStore.address?.length) { warningBannerText.value = "Wallet connection is required to delegate." @@ -309,7 +310,7 @@ const handleContinue = async () => { const txHash = await sendMsgs(appStore.network, key.bech32Address, proto, stdFee) isAwaiting.value = false - amp.log("successfulDelegate") + ph.capture("successful_delegate") cacheStore.tx.hash = txHash cacheStore.tx.from = appStore.address @@ -323,7 +324,7 @@ const handleContinue = async () => { } catch (e) { isAwaiting.value = false - amp.log("failedDelegate") + ph.capture("failed_delegate") if (e.message.startsWith("Request rejected")) { notificationsStore.create({ diff --git a/components/modals/VestingDetailsModal.vue b/app/components/modals/VestingDetailsModal.vue similarity index 94% rename from components/modals/VestingDetailsModal.vue rename to app/components/modals/VestingDetailsModal.vue index 8f429d0a..1cde6927 100644 --- a/components/modals/VestingDetailsModal.vue +++ b/app/components/modals/VestingDetailsModal.vue @@ -3,18 +3,18 @@ import { DateTime } from "luxon" /** API */ -import { fetchVestingPeriods } from "@/services/api/address" +import { fetchVestingPeriods } from "~/services/api/address.js" /** UI */ -import Button from "@/components/ui/Button.vue" -import Modal from "@/components/ui/Modal.vue" -import Tooltip from "@/components/ui/Tooltip.vue" +import Button from "~/components/ui/Button.vue" +import Modal from "~/components/ui/Modal.vue" +import Tooltip from "~/components/ui/Tooltip.vue" /** Services */ -import { capitilize } from "@/services/utils" +import { capitilize } from "~/services/utils/index.js" /** Store */ -import { useCacheStore } from "@/store/cache.store" +import { useCacheStore } from "~/store/cache.store.js" const cacheStore = useCacheStore() const emit = defineEmits(["onClose"]) diff --git a/components/modules/address/AddressCharts.vue b/app/components/modules/address/AddressCharts.vue similarity index 90% rename from components/modules/address/AddressCharts.vue rename to app/components/modules/address/AddressCharts.vue index 8b0341c7..081576b1 100644 --- a/components/modules/address/AddressCharts.vue +++ b/app/components/modules/address/AddressCharts.vue @@ -3,24 +3,24 @@ import { DateTime } from "luxon" /** UI */ -import Button from "@/components/ui/Button.vue" -import { Dropdown, DropdownItem } from "@/components/ui/Dropdown" -import Popover from "@/components/ui/Popover.vue" -import Toggle from "@/components/ui/Toggle.vue" +import Button from "~/components/ui/Button.vue" +import { Dropdown, DropdownItem } from "~/components/ui/Dropdown/index.js" +import Popover from "~/components/ui/Popover.vue" +import Toggle from "~/components/ui/Toggle.vue" import ChartOnEntityPage from "~/components/shared/ChartOnEntityPage.vue" -import Icon from "@/components/Icon.vue" -import Text from "@/components/Text.vue" -import Flex from "@/components/Flex.vue" +import Icon from "~/components/Icon.vue" +import Text from "~/components/Text.vue" +import Flex from "~/components/Flex.vue" /** Services */ -import { abbreviate, tia } from "@/services/utils" -import { createDataMap, generateSeriesData, PERIODS as periods } from "@/services/utils/entityCharts" +import { abbreviate, tia } from "~/services/utils/index.js" +import { createDataMap, generateSeriesData, PERIODS as periods } from "~/services/utils/entityCharts.js" /** API */ -import { fetchAddressSeries } from "@/services/api/stats" +import { fetchAddressSeries } from "~/services/api/stats.js" /** Store */ -import { useSettingsStore } from "@/store/settings.store" +import { useSettingsStore } from "~/store/settings.store.js" const settingsStore = useSettingsStore() const props = defineProps({ @@ -75,7 +75,7 @@ const seriesConfig = [ series: feeSeries, title: "Fee Spent", tooltipLabel: "Spent", - yAxisFormatter: (val) => `${(tia(val, 0) > 1 ? tia(val, 0) : tia(val, 2))} TIA`, + yAxisFormatter: (val) => `${tia(val, 0) > 1 ? tia(val, 0) : tia(val, 2)} TIA`, tooltipValueFormatter: (val) => `${tia(val)} TIA`, }, ] @@ -362,7 +362,10 @@ onMounted(async () => { background: var(--card-background); border-radius: 6px; - box-shadow: inset 0 0 0 1px var(--op-5), 0 14px 34px rgba(0, 0, 0, 15%), 0 4px 14px rgba(0, 0, 0, 5%); + box-shadow: + inset 0 0 0 1px var(--op-5), + 0 14px 34px rgba(0, 0, 0, 15%), + 0 4px 14px rgba(0, 0, 0, 5%); padding: 8px; diff --git a/components/modules/address/AddressOverview.vue b/app/components/modules/address/AddressOverview.vue similarity index 97% rename from components/modules/address/AddressOverview.vue rename to app/components/modules/address/AddressOverview.vue index bcfb97a0..5b9dc272 100644 --- a/components/modules/address/AddressOverview.vue +++ b/app/components/modules/address/AddressOverview.vue @@ -1,18 +1,18 @@ diff --git a/components/modules/ibc/ChainsTable.vue b/app/components/modules/ibc/ChainsTable.vue similarity index 95% rename from components/modules/ibc/ChainsTable.vue rename to app/components/modules/ibc/ChainsTable.vue index caeb645b..b4d18c3f 100644 --- a/components/modules/ibc/ChainsTable.vue +++ b/app/components/modules/ibc/ChainsTable.vue @@ -1,10 +1,10 @@ @@ -67,7 +67,14 @@ const getChainName = (target) => { - + @@ -98,7 +105,9 @@ const getChainName = (target) => { {{ busiestChannel ? busiestChannel.channel_id : "" }} - {{ busiestChannel ? IbcChainName[busiestChannel.chain_id] ?? "Unknown" : "Unknown" }} + {{ + busiestChannel ? (IbcChainName[busiestChannel.chain_id] ?? "Unknown") : "Unknown" + }} diff --git a/components/modules/ibc/TransfersTable.vue b/app/components/modules/ibc/TransfersTable.vue similarity index 93% rename from components/modules/ibc/TransfersTable.vue rename to app/components/modules/ibc/TransfersTable.vue index f94e2bfd..77f9b2fa 100644 --- a/components/modules/ibc/TransfersTable.vue +++ b/app/components/modules/ibc/TransfersTable.vue @@ -3,15 +3,15 @@ import { DateTime } from "luxon" /** Services */ -import { comma } from "@/services/utils" -import { IbcChainName, IbcChainLogo } from "@/services/constants/ibc" +import { comma } from "~/services/utils/index.js" +import { IbcChainName, IbcChainLogo } from "~/services/constants/ibc.js" /** Shared Components */ -import TablePlaceholderView from "@/components/shared/TablePlaceholderView.vue" +import TablePlaceholderView from "~/components/shared/TablePlaceholderView.vue" /** Store */ -import { useModalsStore } from "@/store/modals.store" -import { useCacheStore } from "@/store/cache.store" +import { useModalsStore } from "~/store/modals.store.js" +import { useCacheStore } from "~/store/cache.store.js" const modalsStore = useModalsStore() const cacheStore = useCacheStore() @@ -34,7 +34,7 @@ const handleOpenTransferModal = (transfer) => { const getChainLogo = (transfer, target) => { return transfer[target].hash.startsWith("celestia") ? IbcChainLogo["_celestia"] - : IbcChainLogo[transfer.chain_id] ?? IbcChainLogo["_unknown"] + : (IbcChainLogo[transfer.chain_id] ?? IbcChainLogo["_unknown"]) } diff --git a/components/modules/namespace/NamespaceCharts.vue b/app/components/modules/namespace/NamespaceCharts.vue similarity index 92% rename from components/modules/namespace/NamespaceCharts.vue rename to app/components/modules/namespace/NamespaceCharts.vue index 786722b4..55ff8275 100644 --- a/components/modules/namespace/NamespaceCharts.vue +++ b/app/components/modules/namespace/NamespaceCharts.vue @@ -3,23 +3,23 @@ import { DateTime } from "luxon" /** UI */ -import Button from "@/components/ui/Button.vue" -import { Dropdown, DropdownItem } from "@/components/ui/Dropdown" -import Popover from "@/components/ui/Popover.vue" -import Toggle from "@/components/ui/Toggle.vue" +import Button from "~/components/ui/Button.vue" +import { Dropdown, DropdownItem } from "~/components/ui/Dropdown/index.js" +import Popover from "~/components/ui/Popover.vue" +import Toggle from "~/components/ui/Toggle.vue" /** Components */ import ChartOnEntityPage from "~/components/shared/ChartOnEntityPage.vue" /** Services */ -import { abbreviate, formatBytes } from "@/services/utils" -import { createDataMap, generateSeriesData, PERIODS as periods } from "@/services/utils/entityCharts" +import { abbreviate, formatBytes } from "~/services/utils/index.js" +import { createDataMap, generateSeriesData, PERIODS as periods } from "~/services/utils/entityCharts.js" /** API */ -import { fetchNamespaceSeries } from "@/services/api/stats" +import { fetchNamespaceSeries } from "~/services/api/stats.js" /** Store */ -import { useSettingsStore } from "@/store/settings.store" +import { useSettingsStore } from "~/store/settings.store.js" const settingsStore = useSettingsStore() const props = defineProps({ @@ -343,7 +343,10 @@ onMounted(async () => { background: var(--card-background); border-radius: 6px; - box-shadow: inset 0 0 0 1px var(--op-5), 0 14px 34px rgba(0, 0, 0, 15%), 0 4px 14px rgba(0, 0, 0, 5%); + box-shadow: + inset 0 0 0 1px var(--op-5), + 0 14px 34px rgba(0, 0, 0, 15%), + 0 4px 14px rgba(0, 0, 0, 5%); padding: 8px; diff --git a/components/modules/namespace/NamespaceOverview.vue b/app/components/modules/namespace/NamespaceOverview.vue similarity index 96% rename from components/modules/namespace/NamespaceOverview.vue rename to app/components/modules/namespace/NamespaceOverview.vue index 740b3ff0..c5b269b9 100644 --- a/components/modules/namespace/NamespaceOverview.vue +++ b/app/components/modules/namespace/NamespaceOverview.vue @@ -1,23 +1,23 @@ diff --git a/components/modules/proposal/VotingPower.vue b/app/components/modules/proposal/VotingPower.vue similarity index 83% rename from components/modules/proposal/VotingPower.vue rename to app/components/modules/proposal/VotingPower.vue index c1bb06cc..f6dbfd90 100644 --- a/components/modules/proposal/VotingPower.vue +++ b/app/components/modules/proposal/VotingPower.vue @@ -1,13 +1,13 @@ + + + + diff --git a/components/modules/stats/BarplotStakedChart.vue b/app/components/modules/stats/BarplotStakedChart.vue similarity index 99% rename from components/modules/stats/BarplotStakedChart.vue rename to app/components/modules/stats/BarplotStakedChart.vue index 6b348ce0..4f585d10 100644 --- a/components/modules/stats/BarplotStakedChart.vue +++ b/app/components/modules/stats/BarplotStakedChart.vue @@ -4,7 +4,7 @@ import * as d3 from "d3" import { DateTime } from "luxon" /** Services */ -import { abbreviate, comma, formatBytes, isMobile, sortArrayOfObjects, tia, truncateDecimalPart } from "@/services/utils" +import { abbreviate, comma, formatBytes, isMobile, sortArrayOfObjects, tia, truncateDecimalPart } from "~/services/utils/index.js" const props = defineProps({ series: { diff --git a/components/modules/stats/BarplotStakedRollupChart.vue b/app/components/modules/stats/BarplotStakedRollupChart.vue similarity index 99% rename from components/modules/stats/BarplotStakedRollupChart.vue rename to app/components/modules/stats/BarplotStakedRollupChart.vue index 3229da40..4db2d3b8 100644 --- a/components/modules/stats/BarplotStakedRollupChart.vue +++ b/app/components/modules/stats/BarplotStakedRollupChart.vue @@ -4,7 +4,7 @@ import * as d3 from "d3" import { DateTime } from "luxon" /** Services */ -import { abbreviate, comma, formatBytes, isMobile, sortArrayOfObjects, tia, truncateDecimalPart } from "@/services/utils" +import { abbreviate, comma, formatBytes, isMobile, sortArrayOfObjects, tia, truncateDecimalPart } from "~/services/utils/index.js" const props = defineProps({ series: { diff --git a/components/modules/stats/BlocksFeed.vue b/app/components/modules/stats/BlocksFeed.vue similarity index 92% rename from components/modules/stats/BlocksFeed.vue rename to app/components/modules/stats/BlocksFeed.vue index 2d62e9fd..9939048c 100644 --- a/components/modules/stats/BlocksFeed.vue +++ b/app/components/modules/stats/BlocksFeed.vue @@ -3,16 +3,16 @@ import { DateTime } from "luxon" /** UI */ -import Tooltip from "@/components/ui/Tooltip.vue" +import Tooltip from "~/components/ui/Tooltip.vue" /** Services */ -import { comma, formatBytes } from "@/services/utils" +import { comma, formatBytes } from "~/services/utils/index.js" /** API */ -import { fetchAvgBlockTime } from "@/services/api/block" +import { fetchAvgBlockTime } from "~/services/api/block.js" /** Store */ -import { useAppStore } from "@/store/app.store" +import { useAppStore } from "~/store/app.store.js" const appStore = useAppStore() const props = defineProps({ @@ -56,7 +56,7 @@ const timeline = computed(() => { const maxSize = computed(() => { if (!blocks.value) return 0 - + return Math.max(...blocks.value.map((b) => b.stats.bytes_in_block)) }) const avgBlockTime = ref(0) @@ -111,7 +111,11 @@ onBeforeUnmount(() => { - + { props.period.timeframe === "month" ? props.period.value * 2 : props.period.timeframe === "year" - ? props.period.value * 24 - : 0, + ? props.period.value * 24 + : 0, }).ts / 1_000, ) let to = parseInt( @@ -82,10 +82,11 @@ const getSeries = async () => { from: from, to: to, }) - ).map((v) => { - return { time: v.time, value: v.close } - }) - .reverse() + ) + .map((v) => { + return { time: v.time, value: v.close } + }) + .reverse() } else if (props.series.name === "tvl") { data = ( await fetchTVL({ @@ -384,19 +385,17 @@ watch(