Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hyperchains support #1003

Open
wants to merge 36 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3ac3ef2
feat: feature flags
michele-franchi Dec 4, 2024
51e4582
fix: lint
michele-franchi Dec 4, 2024
17987f2
feat: feature flags
michele-franchi Dec 5, 2024
73ddeef
feat: market stats flag
michele-franchi Dec 5, 2024
4425b49
fix: empty states
michele-franchi Dec 5, 2024
9b8fb27
chore: remove unwanted console logs
michele-franchi Dec 5, 2024
72d897f
feat: currency from network
michele-franchi Dec 6, 2024
06a0909
feat: hyperchain feature flag
michele-franchi Dec 16, 2024
d5d503d
fix: keyblock not updating
michele-franchi Dec 17, 2024
53ef143
feat: exclude routes
michele-franchi Dec 17, 2024
19b2e32
fix: auto width network select
michele-franchi Dec 20, 2024
dd6d18f
feat: use currency in account activities
michele-franchi Dec 20, 2024
2d858a9
fix: currency value
michele-franchi Dec 20, 2024
d445fb9
feat: new feature flags
michele-franchi Dec 20, 2024
d7092a1
feat: use new config
michele-franchi Dec 20, 2024
85d4494
fix: remove proxy nodes
michele-franchi Dec 20, 2024
197c212
fix: description
michele-franchi Dec 20, 2024
8ed93a2
fix: accounts panel empty state
michele-franchi Dec 20, 2024
ddeffaa
fix: empty microblocks
michele-franchi Dec 20, 2024
aa46726
chore: dockerhub tag
michele-franchi Dec 20, 2024
5e7349e
Merge branch 'develop' into feat/feature-flags
michele-franchi Dec 31, 2024
717fd8d
chore: revert pipeline tag
michele-franchi Dec 31, 2024
6dd0f50
fix: contract verification condition
michele-franchi Dec 31, 2024
e16bf2d
fix: token symbol
michele-franchi Dec 31, 2024
638b545
fix: coin navigation
michele-franchi Dec 31, 2024
e70274c
fix: dex listed tokens
michele-franchi Dec 31, 2024
b9076a8
chore: revert dex env variable
michele-franchi Dec 31, 2024
5b74b8a
fix: restore token symbol
michele-franchi Jan 8, 2025
896e0c6
fix: routes conditions
michele-franchi Jan 8, 2025
e0daa39
feat: reorganise routes
michele-franchi Jan 8, 2025
1f72e56
fix: routes env vars
michele-franchi Jan 8, 2025
6c6845d
fix: remove build time route rules
michele-franchi Jan 8, 2025
de0942d
fix: restore nodes proxy
michele-franchi Jan 8, 2025
5b2410b
feat: update env example
michele-franchi Jan 8, 2025
2aab864
fix: restore price icon
michele-franchi Jan 8, 2025
1161726
Merge branch 'develop' into feat/feature-flags
michele-franchi Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 48 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,33 +1,66 @@
#MAINNET
NUXT_PUBLIC_SENTRY_AUTH_TOKEN=
NUXT_PUBLIC_SENTRY_DSN=
# ------ MAINNET ------

# Required
NUXT_PUBLIC_APP_DOMAIN=localhost:8080
NUXT_PUBLIC_MIDDLEWARE_URL=https://mainnet.aeternity.io/mdw
NUXT_PUBLIC_NODE_URL=https://mainnet.aeternity.io
NUXT_PUBLIC_WEBSOCKET_URL=wss://mainnet.aeternity.io/mdw/v3/websocket
NUXT_PUBLIC_NETWORK_ID=ae_mainnet
NUXT_PUBLIC_NETWORK_NAME=MAINNET

# Alternative Network
NUXT_PUBLIC_ALTERNATIVE_NETWORK_NAME=TESTNET
NUXT_PUBLIC_NETWORK_ID=ae_mainnet
NUXT_PUBLIC_ALTERNATIVE_NETWORK_URL=http://localhost:8081

# DEX
NUXT_PUBLIC_DEX_BACKEND_URL=https://dex-backend-mainnet.prd.service.aepps.com
NUXT_PUBLIC_SH_DEX_CONTRACTS='ct_2mfj3FoZxnhkSw5RZMcP8BfPoB1QR4QiYGNCdkAvLZ1zfF6paW;ct_azbNZ1XrPjXfqBqbAh1ffLNTQ1sbnuUDFvJrXjYz7JQA1saQ3'

# Smart Contract Verification
NUXT_PUBLIC_CONTRACT_VERIFICATION_SERVICE_URL=https://scv-gateway.dev.service.aepps.com

# Market stats
NUXT_PUBLIC_ENABLE_MARKET_STATS=true

# Nodes
NUXT_PUBLIC_NODES_BACKEND_URL=http://138.68.22.27:3113/v2/debug/network

# Other
NUXT_PUBLIC_AE_TOKEN_ID=ct_J3zBY8xxjsRr3QojETNw48Eb38fjvEuJKkQ6KzECvubvEcvCa
NUXT_PUBLIC_DEBUG_MODE=false
NUXT_PUBLIC_PLAUSIBLE_URL=
NUXT_PUBLIC_SENTRY_AUTH_TOKEN=
NUXT_PUBLIC_SENTRY_DSN=

# ------ TESTNET ------

#TESTNET
#NUXT_PUBLIC_SENTRY_AUTH_TOKEN=
#NUXT_PUBLIC_SENTRY_DSN=
#NUXT_PUBLIC_APP_DOMAIN="http://localhost:8080"
#NUXT_PUBLIC_MIDDLEWARE_URL="https://testnet.aeternity.io/mdw"
#NUXT_PUBLIC_NODE_URL="https://testnet.aeternity.io"
#NUXT_PUBLIC_WEBSOCKET_URL="wss://testnet.aeternity.io/mdw/v3/websocket"
#NUXT_PUBLIC_NETWORK_NAME="TESTNET"
#NUXT_PUBLIC_ALTERNATIVE_NETWORK_NAME="MAINNET"
# Required
#NUXT_PUBLIC_APP_DOMAIN=localhost:8080
#NUXT_PUBLIC_MIDDLEWARE_URL=https://testnet.aeternity.io/mdw
#NUXT_PUBLIC_NODE_URL=https://testnet.aeternity.io
#NUXT_PUBLIC_WEBSOCKET_URL=wss://testnet.aeternity.io/mdw/v3/websocket
#NUXT_PUBLIC_NETWORK_NAME=TESTNET
#NUXT_PUBLIC_NETWORK_ID="ae_uat"
#NUXT_PUBLIC_ALTERNATIVE_NETWORK_URL="http://localhost:8081"

# Alternative network
#NUXT_PUBLIC_ALTERNATIVE_NETWORK_NAME="MAINNET"

# DEX
#NUXT_PUBLIC_DEX_BACKEND_URL=https://dex-backend-testnet.prd.service.aepps.com
#NUXT_PUBLIC_SH_DEX_CONTRACTS='ct_NhbxN8wg8NLkGuzwRNDQhMDKSKBwDAQgxQawK7tkigi2aC7i9;ct_MLXQEP12MBn99HL6WDaiTqDbG4bJQ3Q9Bzr57oLfvEkghvpFb'

# Smart Contract Verification
#NUXT_PUBLIC_CONTRACT_VERIFICATION_SERVICE_URL="https://scv-gateway-testnet.dev.service.aepps.com"
#NUXT_PUBLIC_AE_TOKEN_ID=ct_JDp175ruWd7mQggeHewSLS1PFXt9AzThCDaFedxon8mF8xTRF

# Market stats
#NUXT_PUBLIC_ENABLE_MARKET_STATS=true

# Nodes
#NUXT_PUBLIC_NODES_BACKEND_URL=http://138.68.22.27:3113/v2/debug/network

# Other
#NUXT_PUBLIC_AE_TOKEN_ID=
#NUXT_PUBLIC_DEBUG_MODE=false
#NUXT_PUBLIC_PLAUSIBLE_URL=
#NUXT_PUBLIC_SENTRY_AUTH_TOKEN=
#NUXT_PUBLIC_SENTRY_DSN=
21 changes: 17 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import fs from 'fs/promises'
import { compileTemplate } from 'vue/compiler-sfc'
import { sentryVitePlugin } from '@sentry/vite-plugin'

const routesWithConditions = {
'/dex-trades': process.env.DEX_BACKEND_URL === 'true',
'/nodes': process.env.NODES_BACKEND_URL === 'true',
'/contract-verification/**': process.env.CONTRACT_VERIFICATION_SERVICE_URL === 'true',
'/tokens/AE': process.env.ENABLE_MARKET_STATS === 'true',
}

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
srcDir: './src',
Expand All @@ -12,7 +19,6 @@ export default defineNuxtConfig({
nitro: {
routeRules: {
'/proxy/avatar/**': { proxy: 'https://avatars.z52da5wt.xyz/**', cors: true },
'/proxy/nodes': { proxy: 'http://138.68.22.27:3113/v2/debug/network', cors: true },
'/proxy/gate': { proxy: 'https://api.gateio.ws/api/v4/spot/tickers?currency_pair=AE_USDT', cors: true },
'/proxy/mexc': { proxy: 'https://api.mexc.com/api/v3/ticker/24hr?symbol=AEUSDT', cors: true },
'/proxy/coinw': { proxy: 'https://api.coinw.com/api/v1/public?command=returnTicker', cors: true },
Expand All @@ -27,7 +33,7 @@ export default defineNuxtConfig({
dirs: ['./stores'],
},
plausible: {
apiHost: 'https://plausible.dev.service.aepps.com',
apiHost: process.env.PLAUSIBLE_URL,
trackLocalhost: false,
},
appConfig: {
Expand All @@ -50,9 +56,11 @@ export default defineNuxtConfig({
DEBUG_MODE: process.env.DEBUG_MODE,
CONTRACT_VERIFICATION_SERVICE_URL: process.env.CONTRACT_VERIFICATION_SERVICE_URL,
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
PLAUSIBLE_URL: process.env.PLAUSIBLE_URL,
ENABLE_MARKET_STATS: process.env.ENABLE_MARKET_STATS,
NODES_BACKEND_URL: process.env.NODES_BACKEND_URL,
},
},

postcss: {
plugins: {
autoprefixer: {},
Expand All @@ -64,6 +72,12 @@ export default defineNuxtConfig({
'postcss-nested': {},
},
},
routeRules: Object.fromEntries(
Object.entries(routesWithConditions).map(([route, isEnabled]) => [
route,
isEnabled ? {} : { redirect: '/' },
]),
),
sourcemap: true,
vite: {
build: { target: 'es2020' },
Expand Down Expand Up @@ -106,7 +120,6 @@ export default defineNuxtConfig({
}),
],
},

monacoEditor: {
locale: 'en',
componentName: {
Expand Down
2 changes: 1 addition & 1 deletion src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ if (process.client) {
useHead({
titleTemplate: pageTitle =>
pageTitle
? `${pageTitle} ${route.params.id} | ${APP_TITLE_SHORT}`
? `${pageTitle} ${route.params.id || ''} | ${APP_TITLE_SHORT}`
: APP_TITLE,
})
Expand Down
8 changes: 6 additions & 2 deletions src/components/AccountActivityTypeCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@

<script setup>
import { useRuntimeConfig } from 'nuxt/app'
import { storeToRefs } from 'pinia'
import { ADD_LIQUIDITY_CONTRACT_CALLS, REMOVE_LIQUIDITY_CONTRACT_CALLS, SWAP_CONTRACT_CALLS } from '@/utils/constants'
import { useAppStore } from '@/stores/app'

const { SH_DEX_CONTRACTS } = useRuntimeConfig().public

const { currency } = storeToRefs(useAppStore())

const props = defineProps({
accountDetails: {
type: Object,
Expand All @@ -26,7 +30,7 @@ const tx = computed(() => props.activity.payload?.tx)
const activityType = computed(() => {
switch (props.activity.type) {
case 'SpendTxEvent':
return 'AE'
return currency.value.symbol
case 'NamePreclaimTxEvent':
case 'NameClaimTxEvent':
case 'NameTransferTxEvent':
Expand Down Expand Up @@ -66,7 +70,7 @@ const activityType = computed(() => {
return 'Wrapped Transaction'
case 'InternalTransferEvent':
if (props.activity.payload.kind === 'reward_block') {
return 'AE'
return currency.value.symbol
} else if (
SH_DEX_CONTRACTS.includes(props.activity.payload.contractId)) {
return 'SH-DEX'
Expand Down
7 changes: 6 additions & 1 deletion src/components/AppHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
<the-search-bar class="hero__search-bar"/>
</div>
</div>
<market-stats class="hero__market-stats"/>
<market-stats
v-if="featureFlags.marketStats"
class="hero__market-stats"/>
<stats-panel/>
</div>
</div>
Expand All @@ -24,6 +26,9 @@
import TheSearchBar from '@/components/TheSearchBar'
import StatsPanel from '@/components/StatsPanel'
import MarketStats from '@/components/MarketStats'
import useFeatureFlags from '@/composables/useFeatureFlags'

const featureFlags = useFeatureFlags()
</script>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion src/components/DashboardAuctionsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script setup>
import { storeToRefs } from 'pinia'
import AppPanel from '@/components/AppPanel'
import { useNamesStore } from '~/stores/names'
import { useNamesStore } from '@/stores/names'

const { auctionsEndingSoon } = storeToRefs(useNamesStore())

Expand Down
18 changes: 10 additions & 8 deletions src/components/DashboardMicroblocksPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
<template #tooltip>
{{ microblocksHints.microblock }}
</template>
<template #header>
<div class="dashboard-microblocks-panel__summary dashboard-microblocks-panel__summary--desktop">
<template
v-if="selectedMicroblockTransactionsCount > 0"
#header>
<div
class="dashboard-microblocks-panel__summary dashboard-microblocks-panel__summary--desktop">
Transactions in this microblock:
<span class="dashboard-microblocks-panel__count">
{{ selectedMicroblockTransactionsCount }}
Expand All @@ -26,12 +29,12 @@
</span>
</div>
</div>

<microblocks-sequence
v-if="selectedKeyblockMicroblocks"
v-if="selectedKeyblockMicroblocks.length > 0"
class="dashboard-microblocks-panel__microblock-sequence"
:microblocks="selectedKeyblockMicroblocks"/>
<dashboard-transaction-panel/>
<dashboard-transaction-panel v-if="selectedKeyblockMicroblocks.length > 0"/>
<blank-state v-else/>
</app-panel>
</template>

Expand All @@ -43,9 +46,8 @@ import DashboardTransactionPanel from '@/components/DashboardTransactionPanel'
import MicroblocksSequence from '@/components/MicroblocksSequence'
import { useRecentBlocksStore } from '@/stores/recentBlocks'

const { selectedKeyblockMicroblocks, selectedMicroblockTransactionsCount } = storeToRefs(
useRecentBlocksStore(),
)
const { selectedKeyblockMicroblocks, selectedMicroblockTransactionsCount } =
storeToRefs(useRecentBlocksStore())
</script>

<style scoped>
Expand Down
11 changes: 9 additions & 2 deletions src/components/DashboardNamesPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@
through an expired auction (name length &lt;= 12).
</template>
</dashboard-panel-header>
<dashboard-names-table class="u-hidden-mobile"/>
<dashboard-names-swiper class="u-hidden-desktop"/>
<template v-if="!!recentlyActivatedNames.length">
<dashboard-names-table class="u-hidden-mobile"/>
<dashboard-names-swiper class="u-hidden-desktop"/>
</template>
<blank-state v-else/>
</app-panel>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import AppPanel from '@/components/AppPanel'
import { useNamesStore } from '@/stores/names'

const { recentlyActivatedNames } = storeToRefs(useNamesStore())
</script>

<style scoped>
Expand Down
12 changes: 10 additions & 2 deletions src/components/DashboardStateChannelsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@
{{ stateChannelsHints.stateChannel }}
</template>
</dashboard-panel-header>
<dashboard-state-channels-table class="u-hidden-mobile"/>
<dashboard-state-channels-swiper class="u-hidden-desktop"/>
<template v-if="!!stateChannels.length">
<dashboard-state-channels-table class="u-hidden-mobile"/>
<dashboard-state-channels-swiper class="u-hidden-desktop"/>
</template>
<blank-state v-else/>
</app-panel>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import AppPanel from '@/components/AppPanel'
import { stateChannelsHints } from '@/utils/hints/stateChannelsHints'
import { useDashboardStateChannelsStore } from '@/stores/dashboardStateChannels'

const { stateChannels } = storeToRefs(useDashboardStateChannelsStore())
</script>

<style scoped>
Expand Down
6 changes: 4 additions & 2 deletions src/components/MenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
v-show="menu.isActive"
class="menu-item__list">
<li
v-for="submenu in menu.submenu"
v-for="submenu in visibleSubmenus"
:key="submenu.name">
<app-link
v-if="!submenu.isDisabled"
Expand All @@ -36,12 +36,14 @@
</template>

<script setup>
defineProps({
const props = defineProps({
menu: {
type: Object,
required: true,
},
})

const visibleSubmenus = computed(() => props.menu.submenu.filter(submenu => !submenu.hidden))
</script>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion src/components/NetworkSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ const navigate = selectedOption => window.location.replace(selectedOption.url)

<style scoped>
.network-select {
width: 110px;
width: auto;
}
</style>
12 changes: 10 additions & 2 deletions src/components/PriceLabel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@

<script setup>
import { useRuntimeConfig } from 'nuxt/app'
import { storeToRefs } from 'pinia'
import { formatNullable } from '@/utils/format'
import { useAppStore } from '@/stores/app'
import AppTooltip from '@/components/AppTooltip'

const { currency: defaultCurrency } = storeToRefs(useAppStore())

const props = defineProps({
price: {
type: [String, Number],
Expand All @@ -55,11 +59,11 @@ const props = defineProps({
},
currency: {
type: String,
default: 'AE',
default: null,
},
hasIcon: {
type: Boolean,
default: true,
default: false,
},
hasLink: {
type: Boolean,
Expand All @@ -80,6 +84,10 @@ const priceRounded = computed(() =>
const price = computed(() =>
formatNullable(formatAePrice(props.price, null)),
)

const currency = computed(() =>
props.currency || defaultCurrency.value.symbol,
)
</script>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion src/components/StatsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const {
} = storeToRefs(useRecentBlocksStore())

const isLoading = computed(() => {
return !(transactionsCount.value && latestReward.value)
return transactionsCount.value === null || latestReward.value === null
})

</script>
Expand Down
Loading
Loading