From ae4e280a911ce82e85b67e37c97178ed4879fe03 Mon Sep 17 00:00:00 2001 From: Bobo Date: Mon, 8 Jan 2024 14:34:57 +0100 Subject: [PATCH] dApp staking v3 (#1023) * Defined v3 project structure * Stake, unstake skeletons * Code organization improvements * Get protocol state * Protocol change notification message * Lock and stake * Read account ledger * Unstake call * unstake and unlock, claim staker * Staker info * Started with can stake logic * Updated node types * Staker reward calculation part 1 * Staker rewards calculation part 2 * dApp rewards calculation and claim * Calculate and claim bonus rewards * Calculate claim staker batch size fix * Rewards fetch fix * can claim methods * Can Claim bug fix * feat: Prevents Errors from Occuring (#1026) * Prevents UnavailableStakeFunds * rephrase * Prevent tooManyStakedContracts, unclaimedRewardsFromPastPeriods * less logs * unstake Prevents UnstakeAmountTooLarge ZeroAmount Disabled * UnclaimedRewardsFromPastPeriods * feat: added top page (#1033) * Vote mobile page and logic (#1036) * Voting page created * Voting page - part 1 * Vote logic --------- Co-authored-by: impelcrypto * Vote batch bug fixes * vote and dictionary changes (#1037) * vote and dictionary changes * fix value and more * vote checks * Vote on multiple dApps (#1046) * FeatureDapp logic * Search dApps * Implemented stake on multiple dApps * dApp tiers * Switch periods on UI * Removed separate link for staking v3 * Dapp rewards per period calculation * feat: link to the project page (#1049) * feat: link to the project page * fix: display dapp data * fix: clean up * fix: clean up * fix: clean up * styles: added 'current tier' and 'total earned' (#1053) * pulled latest main branch (#1057) * merge the `release-hotfix` to `main` branch (#1025) * fix: enables Snap on the production (#1024) * Add a link to the docs (#1027) * fix: words (#1028) * fix: display the staking list for EVM accounts (#1030) --------- Co-authored-by: Ayumi Takahashi * dApp fetching optimization (#1041) * dApp fetching optimization * An additional tiny optimization * Update assets page layout (#956) * Update assets page layout * style update * clean up * replace transfer button to icon * Align icon buttons on the right side * Add navy-4 colour * Update text color from default black to navy-1 * align token balance positions * Adjust breakpoint for account section * fix pointer events depends on screen size * use i18n * update asset search style * Add faucet icon * align token balance * add reward animation * remove static texts from account section * Update AstarUI and replace icons * remove claim button from reward section * fix rewards section * fix background image * set max width * update styles * update delete button style * move reward button next to account info * Header style update * update header color * Add border color variation * update to simple style * remove old background image * fix account icon size * update sidebar size * add border color for zKatana * Update header icon styles * update * update style * add icons * Ads * remove dynamic links * update asset page style * adjust border thickness 3px * add background images * add accout background * update evm native token section style * add ads style * asset page wrapper space * update header style * add mobile nav * Update styles * add side ad area * update Erx20Currency * update account bg * Add Rewards section * Add rewards style * update mobile nav * update rewards style * add mobile nav * hide expand icon for mobile * remove duplicated transfable * display none * revert * Add assets list icon * change-dark-bk * add claim function * fix mobile nav scroll * update styles * Remove transferable and comment out e2e test * replace rewards section div to button * add-account-images * add shiden and testnet background * Add transfer button for shibuya * update native asset list style * fix: updated rewards UI on the assets page (#1042) * fix: fetch estimated rewards * fix: updated rewards UI on the assets page * fix: clean up * fix: do not allow to select ZK network if the portal connects to native wallet * fix: display background when the app is claiming rewards (#1045) * fix: E2E test for new assets page (#1044) * fix: E2E test * fix: E2E test (2) * fix: remove --debug from 'playwright' command * fix: include vesting amount in locked tokens (#1043) * amend-style (#1047) * fix: clean up * fix: clean up * use i18n * clean up * replace numers to endpointKey enum * replace svg icons to astar ui --------- Co-authored-by: Kahori Razzell Co-authored-by: kahonnohak Co-authored-by: impelcrypto <92044428+impelcrypto@users.noreply.github.com> Co-authored-by: impelcrypto Co-authored-by: Kahori <77480847+Kahonnohak@users.noreply.github.com> * fix-styling (#1054) * merge 'release-hotfix' to 'main' (#1052) * fix: enables Snap on the production (#1024) * Add a link to the docs (#1027) * fix: words (#1028) * fix: display the staking list for EVM accounts (#1030) * Ignore gas station (#1050) * Ignore gas station * Turned off Gas station everywhere * Ignore another one gas station call --------- Co-authored-by: Ayumi Takahashi Co-authored-by: Bobo * fix: resolved new assets page bugs (#1055) * fix: close the modal after claiming EVM withdrawal * fix: close the modal after claiming EVM withdrawal (2) * fix: ModalVesting.vue * fix: link to subscan for WASM projects * feat: added Reserved section * feat: added Reserved section (2) * fix: words * fix: refactor --------- Co-authored-by: Ayumi Takahashi Co-authored-by: Bobo Co-authored-by: Kahori Razzell Co-authored-by: kahonnohak Co-authored-by: Kahori <77480847+Kahonnohak@users.noreply.github.com> * Staking panels and leaderboard (#1056) * Get contract stake * Initial leaderboard version * voting call refactoring * Tier rewards updates * Leaderboard rendering fix * My staking components * Staking components logic done * Re-lock unlocking chunks * Unbonding modal * Bonus rewards calculation bug fix * Minor navigation refactoring * Display total stake * PropType fix * Total stake calculation fix * feat: added owner section on the assets page (#1059) * merge the `release-hotfix` to `main` branch (#1025) * fix: enables Snap on the production (#1024) * Add a link to the docs (#1027) * fix: words (#1028) * fix: display the staking list for EVM accounts (#1030) --------- Co-authored-by: Ayumi Takahashi * dApp fetching optimization (#1041) * dApp fetching optimization * An additional tiny optimization * Update assets page layout (#956) * Update assets page layout * style update * clean up * replace transfer button to icon * Align icon buttons on the right side * Add navy-4 colour * Update text color from default black to navy-1 * align token balance positions * Adjust breakpoint for account section * fix pointer events depends on screen size * use i18n * update asset search style * Add faucet icon * align token balance * add reward animation * remove static texts from account section * Update AstarUI and replace icons * remove claim button from reward section * fix rewards section * fix background image * set max width * update styles * update delete button style * move reward button next to account info * Header style update * update header color * Add border color variation * update to simple style * remove old background image * fix account icon size * update sidebar size * add border color for zKatana * Update header icon styles * update * update style * add icons * Ads * remove dynamic links * update asset page style * adjust border thickness 3px * add background images * add accout background * update evm native token section style * add ads style * asset page wrapper space * update header style * add mobile nav * Update styles * add side ad area * update Erx20Currency * update account bg * Add Rewards section * Add rewards style * update mobile nav * update rewards style * add mobile nav * hide expand icon for mobile * remove duplicated transfable * display none * revert * Add assets list icon * change-dark-bk * add claim function * fix mobile nav scroll * update styles * Remove transferable and comment out e2e test * replace rewards section div to button * add-account-images * add shiden and testnet background * Add transfer button for shibuya * update native asset list style * fix: updated rewards UI on the assets page (#1042) * fix: fetch estimated rewards * fix: updated rewards UI on the assets page * fix: clean up * fix: do not allow to select ZK network if the portal connects to native wallet * fix: display background when the app is claiming rewards (#1045) * fix: E2E test for new assets page (#1044) * fix: E2E test * fix: E2E test (2) * fix: remove --debug from 'playwright' command * fix: include vesting amount in locked tokens (#1043) * amend-style (#1047) * fix: clean up * fix: clean up * use i18n * clean up * replace numers to endpointKey enum * replace svg icons to astar ui --------- Co-authored-by: Kahori Razzell Co-authored-by: kahonnohak Co-authored-by: impelcrypto <92044428+impelcrypto@users.noreply.github.com> Co-authored-by: impelcrypto Co-authored-by: Kahori <77480847+Kahonnohak@users.noreply.github.com> * fix-styling (#1054) * merge 'release-hotfix' to 'main' (#1052) * fix: enables Snap on the production (#1024) * Add a link to the docs (#1027) * fix: words (#1028) * fix: display the staking list for EVM accounts (#1030) * Ignore gas station (#1050) * Ignore gas station * Turned off Gas station everywhere * Ignore another one gas station call --------- Co-authored-by: Ayumi Takahashi Co-authored-by: Bobo * fix: resolved new assets page bugs (#1055) * fix: close the modal after claiming EVM withdrawal * fix: close the modal after claiming EVM withdrawal (2) * fix: ModalVesting.vue * fix: link to subscan for WASM projects * feat: added Reserved section * feat: added Reserved section (2) * fix: words * fix: refactor * fix: display the amount of estimated rewards for Shibuya (#1058) * feat: added owner page * feat: added your-project section * feat: resolve errors when the app connected to Astar * feat: resolve errors when the app connected to Astar (2) * feat: updated owner section * fix: clean up * fix: link to the owner page --------- Co-authored-by: Ayumi Takahashi Co-authored-by: Bobo Co-authored-by: Kahori Razzell Co-authored-by: kahonnohak Co-authored-by: Kahori <77480847+Kahonnohak@users.noreply.github.com> * Staking v3 data (#1064) * Data list component and refactoring * Leader board properly assign tiers ans style improvements * Day of a period calculation fix * Prevent multiple dapps data loading * Update src/App.vue Co-authored-by: impelcrypto <92044428+impelcrypto@users.noreply.github.com> --------- Co-authored-by: impelcrypto <92044428+impelcrypto@users.noreply.github.com> * Compatibility issues fix (#1075) * Refresh TVL on unstake * Compatibility issues fix * feat: maxUnlockingChunks (#1071) * maxUnlockingChunks * using getDapp method * Remove commented * feat: added owner section (#1079) * feat: added rewards section * feat: added edit section * fix: refactor * fix: i18 * fix: copy the project page components to the staking-v3 folder (#1085) * fix: copy project page components to staking-v3 folder * fix: updated astar.yml * fix: rollback the endpoint in astar.yml * Owner page logic and unstake from unregistered (#1088) * Unstake from unregistered * usePeriod hook * era lengths * Owner page logic * Owner page fixes * Fixes on your projects and dapp select modal * Successful vote message * Feat/staking v3 improvements4 (#1089) * Unstake from unregistered * usePeriod hook * era lengths * Owner page logic * Owner page fixes * Fixes on your projects and dapp select modal * Successful vote message * Leaderboard voting * Group dApps by category * Cleanup expired entries * dApp page logic * Minor Dapps component styling * Select up to max number of staked contracts for voting * Navigate to staking home if a dApp doesn't exists * Add Shibuya Scope Style (#1078) * add feature dApp area style * add dapps list and data list area style * add ad area style * add Leaderboard area style * move staking section to assets page * update the your projects section style on the assets page * move css files * add staking section style on the assets page * add vote and stake page style * adjust tvl text size * add owner page style * update astar ui * remove dark theme style from the vote page * update vote page style * remove dark theme from dapp staking pages * add project page style * clean up * add Leaderboard style * update dapp style * update lang * add input search * update * update leaderboard style * add category style * add tier paging * Small fix for loading a dApp * Changed a way how to subscribe and handle protocol state * clean up * update dapps search logic * remove operator from filter function --------- Co-authored-by: Bobo * Show success messages and tier rewards (#1097) * add feature dApp area style * add dapps list and data list area style * add ad area style * add Leaderboard area style * move staking section to assets page * update the your projects section style on the assets page * move css files * add staking section style on the assets page * add vote and stake page style * adjust tvl text size * add owner page style * update astar ui * remove dark theme style from the vote page * update vote page style * remove dark theme from dapp staking pages * add project page style * clean up * add Leaderboard style * update dapp style * update lang * add input search * Added success message to all calls * update * update leaderboard style * add category style * add tier paging * Small fix for loading a dApp * Changed a way how to subscribe and handle protocol state * clean up * update dapps search logic * Show error message from canUnstake function * Display tier daily rewards --------- Co-authored-by: Ayumi Takahashi * dApp search bug fix, amount to be locked fix * Build error fix * Nomination transfer * Disable Vote button if no stakes. * Reward calculation fix, unlock * v3 vote period style (#1098) * remove the unnecessary div from assets page * adjust vote page style * add hover color to search, selector * update vote page style * add animated vote button * add vote period hero * update dapps slide style * update leaderboard text * update vote page column order * Show nomination transfer info on Voting page * feat: added EVM supports (#1102) * Vote with EVM * Fetch rewards for evm account * feat: updated V3 via EVM logic (#1101) * feat: updated claimUnstakeAndUnlock * fix: clean up * feat: added EVM calls * fix: link to the vote page * fix: clean up * fix: conflicts (2) * fix: claimUnstakeAndUnlock fn * Build errors fix * Build error fix 2 * Fix for initial loading of ledger and stakerInfo * Ledger subscription fix * Removed gas estimation * refactor: added batch methods * Remove senderSs58Account from hook since address mapping logic is moved to the service * Disable canUnstake * Linter fix --------- Co-authored-by: Bobo * EVM unlock fix * fix: added todo comment * GetTier bug fix and removed some comments * fix: removed unused files * Comments cleanup * Gas price provider fix * Message subscriptions, check value before assignment. * Nomination transfer bug fix, styling and translations * Nomination transfer amount, total stake * Leaderboard fix, multiplier removed * Staker reward calculation optimisation * Clam banner text update for Shibuya * Voting period countdown * Current period day and canConfirm fixes * feat: update project page styles (#1109) * add project icon background * add project icon background to the owner page * update all vote/stake button background * fix app height * move the register button to the assets page * fix assets page container * remove the license section from the project page * made the header scroll * add small dapp header * fix v2 style * remove the register banner from the assets page for now * fix vote page layout * fix vote period background * adjust small header style and heart icon button * update maintenance mode style * update * feat: add migrate support style (#1114) * add migrate support style * fix lang file * Hide migration support for now * feat: added staker and bonus rewards APR (#1113) * feat: added useAprV3 * wip: staker rewards * wip: staker rewards (2) * wip: staker rewards (3) * wip: staker rewards (4) * wip: staker rewards (5) * wip: staker rewards (6) * wip: staker rewards (7) * wip: staker rewards (8) * feat: added basic rewards in the voting section * fix: clean up * fix: refactor * feat: added bonus APR * fix: clean up * fix: set the periodsPerCycle from network name temporarily * fix: set the periodsPerCycle from network name temporarily (2) --------- Co-authored-by: impelcrypto Co-authored-by: Gregory Luneau Co-authored-by: impelcrypto <92044428+impelcrypto@users.noreply.github.com> Co-authored-by: Ayumi Takahashi Co-authored-by: Kahori Razzell Co-authored-by: kahonnohak Co-authored-by: Kahori <77480847+Kahonnohak@users.noreply.github.com> --- .eslintignore | 1 + .gitignore | 5 +- package.json | 2 +- src/App.vue | 82 ++- src/components/assets/Assets.vue | 29 +- src/components/assets/Erc20Currency.vue | 9 +- src/components/assets/Rewards.vue | 26 +- src/components/assets/YourProject.vue | 49 ++ src/components/assets/styles/account.scss | 12 +- .../assets/styles/your-project.scss | 84 +++ src/components/common/Balance.vue | 4 +- src/components/common/FormatBalance.vue | 4 +- src/components/common/TokenBalanceNative.vue | 42 ++ .../common/styles/back-to-page.scss | 6 + .../common/themes/DividerNewYear.vue | 2 +- .../common/themes/DividerNewYearMobile.vue | 2 +- src/components/common/themes/LunarPack.vue | 2 +- src/components/common/themes/SnowPack.vue | 2 +- src/components/dapp-staking/StakingTop.vue | 2 + .../dapp-staking/dapp/DappStatistics.vue | 27 + .../dapp-staking/my-staking/BannerArea.vue | 2 +- .../dapp-staking/my-staking/Register.vue | 1 - .../my-staking/styles/top-metric.scss | 1 - .../dapp-staking/stake-manage/StakeForm.vue | 20 +- src/components/header/ClaimWarningBanner.vue | 2 +- src/components/header/Header.vue | 9 +- src/components/header/mobile/MobileNav.vue | 1 - src/components/sidenav/SidebarDesktop.vue | 1 - .../sidenav/styles/sidebar-desktop.scss | 1 + src/css/quasar.variables.scss | 9 +- src/i18n/en-US/index.ts | 143 ++++ src/layouts/DashboardLayout.vue | 41 +- src/modules/dapp-staking/index.ts | 2 +- src/modules/dapp-staking/utils/index.ts | 5 + src/pages/AssetsPage.vue | 3 +- src/pages/BridgePage.vue | 3 +- src/pages/DappPage.vue | 18 +- src/pages/DappStaking.vue | 2 +- src/pages/DappStakingV3.vue | 18 + src/pages/Dashboard.vue | 3 - src/router/index.ts | 2 +- src/router/routes.ts | 21 +- src/router/utils/index.ts | 2 + src/staking-v3/assets/burn.png | Bin 0 -> 14138 bytes .../assets/unclaimed_rewards_bg.webp | Bin 0 -> 96746 bytes src/staking-v3/assets/vote_bg.webp | Bin 0 -> 177116 bytes src/staking-v3/assets/vote_hero_bg.webp | Bin 0 -> 358666 bytes src/staking-v3/components/Amount.vue | 84 +++ src/staking-v3/components/Dapps.vue | 99 +++ src/staking-v3/components/DiscoverV3.vue | 81 +++ src/staking-v3/components/DynamicAdsArea.vue | 93 +++ src/staking-v3/components/Edit.vue | 52 ++ src/staking-v3/components/FeatureDapp.vue | 112 +++ src/staking-v3/components/KpiCard.vue | 31 + src/staking-v3/components/MaintenanceMode.vue | 6 +- src/staking-v3/components/Owner.vue | 106 +++ src/staking-v3/components/RewardsPanel.vue | 39 + src/staking-v3/components/ToggleButtons.vue | 73 ++ src/staking-v3/components/Vote.vue | 332 +++++++++ .../components/VoteStakeButtonBg.vue | 16 + src/staking-v3/components/YourRewards.vue | 175 +++++ .../components/dapp-selector/DappSelector.vue | 88 +++ .../dapp-selector/ModalSelectDapp.vue | 218 ++++++ .../components/dapp-selector/Model.ts | 7 + .../components/dapp-selector/index.ts | 5 + src/staking-v3/components/dapp/Builders.vue | 94 +++ src/staking-v3/components/dapp/DappAvatar.vue | 93 +++ .../components/dapp/DappBackground.vue | 54 ++ src/staking-v3/components/dapp/DappImages.vue | 146 ++++ .../components/dapp/DappStatistics.vue | 63 ++ .../components/dapp/DappStatsCharts.vue | 73 ++ src/staking-v3/components/dapp/DappV3.vue | 143 ++++ .../components/dapp/ProjectDetails.vue | 266 +++++++ .../components/dapp/ProjectOverview.vue | 29 + src/staking-v3/components/dapp/StatsChart.vue | 58 ++ .../components/dapp/styles/builders.scss | 106 +++ .../components/dapp/styles/dapp-avatar.scss | 146 ++++ .../components/dapp/styles/dapp-images.scss | 105 +++ .../dapp/styles/dapp-statistics.scss | 70 ++ .../dapp/styles/dapp-stats-charts.scss | 28 + .../components/dapp/styles/dapp.scss | 70 ++ .../dapp/styles/project-details.scss | 115 +++ .../dapp/styles/project-overview.scss | 11 + src/staking-v3/components/data/DataCard.vue | 60 ++ src/staking-v3/components/data/DataList.vue | 77 ++ .../components/leaderboard/DappItem.vue | 48 ++ .../components/leaderboard/Leaderboard.vue | 92 +++ .../leaderboard/LeaderboardVote.vue | 51 ++ .../components/leaderboard/Tier.vue | 121 ++++ .../components/leaderboard/noEntry.vue | 37 + .../leaderboard/styles/leaderboard.scss | 47 ++ .../components/leaderboard/styles/tier.scss | 100 +++ .../my-staking/MigrationSupport.vue | 117 +++ .../components/my-staking/ModalUnbondDapp.vue | 284 ++++++++ .../components/my-staking/MyDapps.vue | 182 +++++ .../components/my-staking/MyStaking.vue | 172 +++++ .../components/my-staking/MyStakingCard.vue | 65 ++ .../components/my-staking/Staking.vue | 121 ++++ .../components/my-staking/TabComponent.vue | 115 +++ .../components/my-staking/Unbonding.vue | 147 ++++ .../components/styles/ads-area.scss | 100 +++ src/staking-v3/components/styles/dapps.scss | 107 +++ .../components/styles/discover-v3.scss | 88 +++ src/staking-v3/components/styles/edit.scss | 65 ++ .../components/styles/feature-dapp.scss | 207 ++++++ src/staking-v3/components/styles/owner.scss | 90 +++ src/staking-v3/components/styles/vote.scss | 220 ++++++ .../components/styles/your-rewards.scss | 121 ++++ src/staking-v3/configureLocalNode.mjs | 48 ++ src/staking-v3/hooks/index.ts | 8 + src/staking-v3/hooks/useAprV3.ts | 160 +++++ src/staking-v3/hooks/useCampaign.ts | 46 ++ src/staking-v3/hooks/useDappStaking.ts | 539 ++++++++++++++ .../hooks/useDappStakingNavigation.ts | 42 ++ src/staking-v3/hooks/useDapps.ts | 88 +++ src/staking-v3/hooks/useLeaderboard.ts | 63 ++ src/staking-v3/hooks/usePeriod.ts | 52 ++ src/staking-v3/hooks/useVotingCountdown.ts | 31 + src/staking-v3/index.ts | 2 + src/staking-v3/logic/astar.json | 1 + src/staking-v3/logic/index.ts | 3 + .../logic/interfaces/DappStakingV3.ts | 151 ++++ src/staking-v3/logic/interfaces/index.ts | 1 + src/staking-v3/logic/models/DappStaking.ts | 190 +++++ src/staking-v3/logic/models/Node.ts | 42 ++ src/staking-v3/logic/models/index.ts | 2 + .../repositories/DappStakingRepository.ts | 556 ++++++++++++++ .../repositories/IDappStakingRepository.ts | 222 ++++++ src/staking-v3/logic/repositories/index.ts | 2 + .../logic/services/DappStakingService.ts | 680 ++++++++++++++++++ .../logic/services/DappStakingServiceEvm.ts | 244 +++++++ .../logic/services/IDappStakingService.ts | 146 ++++ src/staking-v3/logic/services/index.ts | 3 + src/staking-v3/store/actions.ts | 7 + src/staking-v3/store/getters.ts | 48 ++ src/staking-v3/store/index.ts | 18 + src/staking-v3/store/mutations.ts | 107 +++ src/staking-v3/store/state.ts | 63 ++ src/store/index.ts | 4 + src/v2/app.container.ts | 32 + src/v2/common/util.ts | 8 +- .../AccountUnificationRepository.ts | 5 + .../implementations/DappStakingRepository.ts | 68 +- .../implementations/GasPriceProvider.ts | 4 +- src/v2/symbols.ts | 4 + tsconfig.json | 2 +- yarn.lock | 16 +- 147 files changed, 10384 insertions(+), 147 deletions(-) create mode 100644 src/components/assets/YourProject.vue create mode 100644 src/components/assets/styles/your-project.scss create mode 100644 src/components/common/TokenBalanceNative.vue create mode 100644 src/pages/DappStakingV3.vue create mode 100644 src/staking-v3/assets/burn.png create mode 100644 src/staking-v3/assets/unclaimed_rewards_bg.webp create mode 100644 src/staking-v3/assets/vote_bg.webp create mode 100644 src/staking-v3/assets/vote_hero_bg.webp create mode 100644 src/staking-v3/components/Amount.vue create mode 100644 src/staking-v3/components/Dapps.vue create mode 100644 src/staking-v3/components/DiscoverV3.vue create mode 100644 src/staking-v3/components/DynamicAdsArea.vue create mode 100644 src/staking-v3/components/Edit.vue create mode 100644 src/staking-v3/components/FeatureDapp.vue create mode 100644 src/staking-v3/components/KpiCard.vue create mode 100644 src/staking-v3/components/Owner.vue create mode 100644 src/staking-v3/components/RewardsPanel.vue create mode 100644 src/staking-v3/components/ToggleButtons.vue create mode 100644 src/staking-v3/components/Vote.vue create mode 100644 src/staking-v3/components/VoteStakeButtonBg.vue create mode 100644 src/staking-v3/components/YourRewards.vue create mode 100644 src/staking-v3/components/dapp-selector/DappSelector.vue create mode 100644 src/staking-v3/components/dapp-selector/ModalSelectDapp.vue create mode 100644 src/staking-v3/components/dapp-selector/Model.ts create mode 100644 src/staking-v3/components/dapp-selector/index.ts create mode 100644 src/staking-v3/components/dapp/Builders.vue create mode 100644 src/staking-v3/components/dapp/DappAvatar.vue create mode 100644 src/staking-v3/components/dapp/DappBackground.vue create mode 100644 src/staking-v3/components/dapp/DappImages.vue create mode 100644 src/staking-v3/components/dapp/DappStatistics.vue create mode 100644 src/staking-v3/components/dapp/DappStatsCharts.vue create mode 100644 src/staking-v3/components/dapp/DappV3.vue create mode 100644 src/staking-v3/components/dapp/ProjectDetails.vue create mode 100644 src/staking-v3/components/dapp/ProjectOverview.vue create mode 100644 src/staking-v3/components/dapp/StatsChart.vue create mode 100644 src/staking-v3/components/dapp/styles/builders.scss create mode 100644 src/staking-v3/components/dapp/styles/dapp-avatar.scss create mode 100644 src/staking-v3/components/dapp/styles/dapp-images.scss create mode 100644 src/staking-v3/components/dapp/styles/dapp-statistics.scss create mode 100644 src/staking-v3/components/dapp/styles/dapp-stats-charts.scss create mode 100644 src/staking-v3/components/dapp/styles/dapp.scss create mode 100644 src/staking-v3/components/dapp/styles/project-details.scss create mode 100644 src/staking-v3/components/dapp/styles/project-overview.scss create mode 100644 src/staking-v3/components/data/DataCard.vue create mode 100644 src/staking-v3/components/data/DataList.vue create mode 100644 src/staking-v3/components/leaderboard/DappItem.vue create mode 100644 src/staking-v3/components/leaderboard/Leaderboard.vue create mode 100644 src/staking-v3/components/leaderboard/LeaderboardVote.vue create mode 100644 src/staking-v3/components/leaderboard/Tier.vue create mode 100644 src/staking-v3/components/leaderboard/noEntry.vue create mode 100644 src/staking-v3/components/leaderboard/styles/leaderboard.scss create mode 100644 src/staking-v3/components/leaderboard/styles/tier.scss create mode 100644 src/staking-v3/components/my-staking/MigrationSupport.vue create mode 100644 src/staking-v3/components/my-staking/ModalUnbondDapp.vue create mode 100644 src/staking-v3/components/my-staking/MyDapps.vue create mode 100644 src/staking-v3/components/my-staking/MyStaking.vue create mode 100644 src/staking-v3/components/my-staking/MyStakingCard.vue create mode 100644 src/staking-v3/components/my-staking/Staking.vue create mode 100644 src/staking-v3/components/my-staking/TabComponent.vue create mode 100644 src/staking-v3/components/my-staking/Unbonding.vue create mode 100644 src/staking-v3/components/styles/ads-area.scss create mode 100644 src/staking-v3/components/styles/dapps.scss create mode 100644 src/staking-v3/components/styles/discover-v3.scss create mode 100644 src/staking-v3/components/styles/edit.scss create mode 100644 src/staking-v3/components/styles/feature-dapp.scss create mode 100644 src/staking-v3/components/styles/owner.scss create mode 100644 src/staking-v3/components/styles/vote.scss create mode 100644 src/staking-v3/components/styles/your-rewards.scss create mode 100644 src/staking-v3/configureLocalNode.mjs create mode 100644 src/staking-v3/hooks/index.ts create mode 100644 src/staking-v3/hooks/useAprV3.ts create mode 100644 src/staking-v3/hooks/useCampaign.ts create mode 100644 src/staking-v3/hooks/useDappStaking.ts create mode 100644 src/staking-v3/hooks/useDappStakingNavigation.ts create mode 100644 src/staking-v3/hooks/useDapps.ts create mode 100644 src/staking-v3/hooks/useLeaderboard.ts create mode 100644 src/staking-v3/hooks/usePeriod.ts create mode 100644 src/staking-v3/hooks/useVotingCountdown.ts create mode 100644 src/staking-v3/index.ts create mode 100644 src/staking-v3/logic/astar.json create mode 100644 src/staking-v3/logic/index.ts create mode 100644 src/staking-v3/logic/interfaces/DappStakingV3.ts create mode 100644 src/staking-v3/logic/interfaces/index.ts create mode 100644 src/staking-v3/logic/models/DappStaking.ts create mode 100644 src/staking-v3/logic/models/Node.ts create mode 100644 src/staking-v3/logic/models/index.ts create mode 100644 src/staking-v3/logic/repositories/DappStakingRepository.ts create mode 100644 src/staking-v3/logic/repositories/IDappStakingRepository.ts create mode 100644 src/staking-v3/logic/repositories/index.ts create mode 100644 src/staking-v3/logic/services/DappStakingService.ts create mode 100644 src/staking-v3/logic/services/DappStakingServiceEvm.ts create mode 100644 src/staking-v3/logic/services/IDappStakingService.ts create mode 100644 src/staking-v3/logic/services/index.ts create mode 100644 src/staking-v3/store/actions.ts create mode 100644 src/staking-v3/store/getters.ts create mode 100644 src/staking-v3/store/index.ts create mode 100644 src/staking-v3/store/mutations.ts create mode 100644 src/staking-v3/store/state.ts diff --git a/.eslintignore b/.eslintignore index 294d360a4..81332340f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,5 +7,6 @@ .eslintrc.js babel.config.js /src-ssr +/src-pwa /tests/polkadot_wallet /tests/metamask_wallet \ No newline at end of file diff --git a/.gitignore b/.gitignore index e26d0db58..b730a6afe 100644 --- a/.gitignore +++ b/.gitignore @@ -47,5 +47,8 @@ zombienet-macos polkadot astar-collator +# Temp folder +*temp + # Chopstick binaries -db.sqlite* \ No newline at end of file +db.sqlite* diff --git a/package.json b/package.json index 5ca954acf..64dd4baa2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "@astar-network/astar-sdk-core": "^0.2.8", - "@astar-network/astar-ui": "^0.0.136", + "@astar-network/astar-ui": "^0.0.137", "@astar-network/metamask-astar-adapter": "^0.5.4", "@astar-network/metamask-astar-types": "^0.6.1", "@ethersproject/bignumber": "^5.5.0", diff --git a/src/App.vue b/src/App.vue index 473e7f165..84a826cc5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,7 +40,7 @@ // https://polkadot.js.org/docs/api/FAQ/#since-upgrading-to-the-7x-series-typescript-augmentation-is-missing import 'reflect-metadata'; import '@polkadot/api-augment'; -import { defineComponent, computed, ref, watch } from 'vue'; +import { defineComponent, computed, ref, watch, onMounted } from 'vue'; import DashboardLayout from 'layouts/DashboardLayout.vue'; import { useStore } from 'src/store'; import ModalLoading from 'components/common/ModalLoading.vue'; @@ -61,6 +61,13 @@ import { container } from 'src/v2/common'; import { Symbols } from 'src/v2/symbols'; import { useAccount, useAppRouter } from 'src/hooks'; import { LOCAL_STORAGE } from 'src/config/localStorage'; +import { + AccountLedgerChangedMessage, + IDappStakingService, + ProtocolStateChangedMessage, +} from './staking-v3'; +import { useDappStaking, useDapps } from './staking-v3/hooks'; +import { IDappStakingRepository as IDappStakingRepositoryV3 } from 'src/staking-v3/logic/repositories'; export default defineComponent({ name: 'App', @@ -75,7 +82,18 @@ export default defineComponent({ setup() { useAppRouter(); const store = useStore(); - const { currentAccountName } = useAccount(); + const { currentAccountName, currentAccount } = useAccount(); + const { + protocolState, + getAllRewards, + getCurrentEraInfo, + getDappTiers, + fetchStakerInfoToStore, + fetchTiersConfigurationToStore, + fetchEraLengthsToStore, + isDappStakingV3, + } = useDappStaking(); + const { fetchStakeAmountsToStore, fetchDappsToStore } = useDapps(); const isLoading = computed(() => store.getters['general/isLoading']); const showAlert = computed(() => store.getters['general/showAlert']); @@ -94,7 +112,7 @@ export default defineComponent({ showDisclaimerModal.value = isOpen; }; - // Handle busy and extrisnsic call status messages. + // Handle busy and extrinsic call status messages. const eventAggregator = container.get(Symbols.EventAggregator); eventAggregator.subscribe(ExtrinsicStatusMessage.name, (m) => { const message = m as ExtrinsicStatusMessage; @@ -124,9 +142,65 @@ export default defineComponent({ store.commit('dapps/setCurrentEra', message.era, { root: true }); }); + // **** dApp staking v3 + // dApp staking v3 data changed subscriptions. + onMounted(() => { + if (isDappStakingV3.value) { + container + .get(Symbols.DappStakingRepositoryV3) + .startProtocolStateSubscription(); + } + }); + + eventAggregator.subscribe(ProtocolStateChangedMessage.name, async (m) => { + const message = m as ProtocolStateChangedMessage; + + if (message.state) { + console.log('protocol state', message.state); + store.commit('stakingV3/setProtocolState', message.state, { root: true }); + await fetchDappsToStore(); + await Promise.all([ + getAllRewards(), + getCurrentEraInfo(), + getDappTiers(message.state.era - 1), + fetchStakeAmountsToStore(), + fetchStakerInfoToStore(), + fetchEraLengthsToStore(), + ]); + } + }); + + eventAggregator.subscribe(AccountLedgerChangedMessage.name, (m) => { + const message = m as AccountLedgerChangedMessage; + if (message.ledger) { + store.commit('stakingV3/setLedger', message.ledger, { root: true }); + console.log('ledger', message.ledger); + } + }); + // **** end dApp staking v3 + // Handle wallet change so we can inject proper wallet - watch([isEthWallet, currentWallet, isH160, currentAccountName], () => { + let previousAddress: string | undefined = undefined; + watch([isEthWallet, currentWallet, isH160, currentAccountName], async () => { setCurrentWallet(isEthWallet.value, currentWallet.value); + + // Subscribe to an account specific dApp staking v3 data. + if (!isDappStakingV3.value) return; + + // Memo: Can't use senderSs58Account here because unified account is not stored to vuex yet + // and senderSs58Account contains evm mapped address which is incorrect for unified account. + if (currentAccount.value && currentAccount.value !== previousAddress) { + const stakingService = container.get<() => IDappStakingService>( + Symbols.DappStakingServiceFactoryV3 + )(); + await stakingService.startAccountLedgerSubscription(currentAccount.value); + fetchStakerInfoToStore(); + getAllRewards(); + fetchTiersConfigurationToStore(); + getDappTiers((protocolState.value?.era ?? 0) - 1); + + previousAddress = currentAccount.value; + } }); const removeSplashScreen = () => { diff --git a/src/components/assets/Assets.vue b/src/components/assets/Assets.vue index 5762ffd77..92752a7e6 100644 --- a/src/components/assets/Assets.vue +++ b/src/components/assets/Assets.vue @@ -10,14 +10,25 @@ :is-loading-xcm-assets-amount="isLoadingXcmAssetsAmount" /> -
+ + + +
- +
- +
@@ -30,19 +41,22 @@ + + diff --git a/src/components/assets/styles/account.scss b/src/components/assets/styles/account.scss index b5ac0e35f..2c52b32a5 100644 --- a/src/components/assets/styles/account.scss +++ b/src/components/assets/styles/account.scss @@ -4,6 +4,10 @@ display: flex; flex-direction: column; gap: 32px; + margin-top: -36px; + @media (min-width: $lg) { + margin-top: 0; + } } .row--details-signatory { @@ -60,8 +64,6 @@ img { width: 32px; height: 32px; - // object-fit: cover; - // border-radius: 9999px; } } @@ -218,7 +220,7 @@ background-color: white; padding: 16px; min-height: 180px; - @media (min-width: $sm) { + @media (min-width: $lg) { border-radius: 16px; margin: 0; } @@ -270,7 +272,7 @@ color: white; background: linear-gradient(270deg, #6c6c6c 25%, #b7b7b7 100%); } - &:not(.active){ + &:not(.active) { cursor: pointer; } } @@ -330,7 +332,7 @@ } } } - } + } } .row--account-rewards { diff --git a/src/components/assets/styles/your-project.scss b/src/components/assets/styles/your-project.scss new file mode 100644 index 000000000..119c12ae9 --- /dev/null +++ b/src/components/assets/styles/your-project.scss @@ -0,0 +1,84 @@ +@import 'src/css/quasar.variables.scss'; + +.wrapper--your-project { + padding: 8px 16px; + @media (min-width: $lg) { + padding: 16px; + } +} + +.box--dapps { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 16px; + + @media (min-width: $md) { + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 32px; + } + @media (min-width: $xxl) { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } +} + +.text--title { + font-weight: 600; + @media (min-width: $lg) { + font-size: 14px; + } +} + +.row--title { + display: flex; + align-items: center; + gap: 16px; + svg { + width: 32px; + height: 32px; + } +} + +.card--dapp { + cursor: pointer; + background-color: $gray-1; + border-radius: 16px; + column-gap: 10px; + display: flex; + align-items: center; + padding: 16px; + font-size: 16px; + font-weight: 600; + color: $navy-1; + line-height: 1.25; + transition: all 0.2s ease; + &:hover{ + background-color: $gray-2; + } +} + +.icon--dapp-logo { + width: 32px; + height: 32px; + border-radius: 8px; + object-fit: contain; +} + +.separator { + background-color: $gray-2; + height: 1px; + margin-top: 24px; + margin-bottom: 24px; +} + +.body--dark { + .card--dapp { + background-color: $navy-3; + color: $gray-1; + &:hover{ + background-color: lighten($navy-3,5%); + } + } + .separator { + background-color: $navy-3; + } +} diff --git a/src/components/common/Balance.vue b/src/components/common/Balance.vue index a85b37b2f..732e354ef 100644 --- a/src/components/common/Balance.vue +++ b/src/components/common/Balance.vue @@ -2,14 +2,14 @@
{{ `${formattedBalance}` }}
diff --git a/src/components/common/styles/back-to-page.scss b/src/components/common/styles/back-to-page.scss index 8012d499d..4ddcb8c7e 100644 --- a/src/components/common/styles/back-to-page.scss +++ b/src/components/common/styles/back-to-page.scss @@ -24,3 +24,9 @@ .icon--back { font-size: 18px; } + +.body--dark{ + .container--back { + color: $gray-3; + } +} diff --git a/src/components/common/themes/DividerNewYear.vue b/src/components/common/themes/DividerNewYear.vue index cd5197a62..196ccf754 100644 --- a/src/components/common/themes/DividerNewYear.vue +++ b/src/components/common/themes/DividerNewYear.vue @@ -56,4 +56,4 @@ export default defineComponent({ #793b02 104.05% ); } - \ No newline at end of file + diff --git a/src/components/common/themes/DividerNewYearMobile.vue b/src/components/common/themes/DividerNewYearMobile.vue index 747dd4f30..5c38b7d8b 100644 --- a/src/components/common/themes/DividerNewYearMobile.vue +++ b/src/components/common/themes/DividerNewYearMobile.vue @@ -28,4 +28,4 @@ export default defineComponent({ #793b02 104.05% ); } - \ No newline at end of file + diff --git a/src/components/common/themes/LunarPack.vue b/src/components/common/themes/LunarPack.vue index 73e9f9821..3157cea03 100644 --- a/src/components/common/themes/LunarPack.vue +++ b/src/components/common/themes/LunarPack.vue @@ -151,4 +151,4 @@ export default defineComponent({ height: 240px; z-index: 9999; } - \ No newline at end of file + diff --git a/src/components/common/themes/SnowPack.vue b/src/components/common/themes/SnowPack.vue index 0e7491ad3..d38f60491 100644 --- a/src/components/common/themes/SnowPack.vue +++ b/src/components/common/themes/SnowPack.vue @@ -210,4 +210,4 @@ export default defineComponent({ } } } - \ No newline at end of file + diff --git a/src/components/dapp-staking/StakingTop.vue b/src/components/dapp-staking/StakingTop.vue index 80da710dd..109e02c41 100644 --- a/src/components/dapp-staking/StakingTop.vue +++ b/src/components/dapp-staking/StakingTop.vue @@ -118,6 +118,8 @@ export default defineComponent({ .extra-wrapper { max-width: $container-max-width; margin: 0 auto; + z-index: 1; + position: relative; } .container--main { diff --git a/src/components/dapp-staking/dapp/DappStatistics.vue b/src/components/dapp-staking/dapp/DappStatistics.vue index 1c3ab5e50..9447db13d 100644 --- a/src/components/dapp-staking/dapp/DappStatistics.vue +++ b/src/components/dapp-staking/dapp/DappStatistics.vue @@ -29,6 +29,33 @@ +
+
+
+ + {{ $t('stakingV3.currentTier') }} + +
+
+ + {{ $n(1) }} + +
+
+
+
+
+ + {{ $t('stakingV3.totalEarned') }} + +
+
+ + + {{ $t('amountToken', { amount: 10, token: nativeTokenSymbol }) }} + +
+
diff --git a/src/components/dapp-staking/my-staking/BannerArea.vue b/src/components/dapp-staking/my-staking/BannerArea.vue index 79fdacaf9..183b3371f 100644 --- a/src/components/dapp-staking/my-staking/BannerArea.vue +++ b/src/components/dapp-staking/my-staking/BannerArea.vue @@ -31,4 +31,4 @@ export default defineComponent({ gap: 24px; } } - \ No newline at end of file + diff --git a/src/components/dapp-staking/my-staking/Register.vue b/src/components/dapp-staking/my-staking/Register.vue index d0eb5519c..3c7581a4e 100644 --- a/src/components/dapp-staking/my-staking/Register.vue +++ b/src/components/dapp-staking/my-staking/Register.vue @@ -65,7 +65,6 @@ export default defineComponent({ border-radius: 6px; padding: 24px; cursor: pointer; - margin-top: 50px; color: $gray-1; font-size: 16px; } diff --git a/src/components/dapp-staking/my-staking/styles/top-metric.scss b/src/components/dapp-staking/my-staking/styles/top-metric.scss index 2d869f0b0..dfe5af515 100644 --- a/src/components/dapp-staking/my-staking/styles/top-metric.scss +++ b/src/components/dapp-staking/my-staking/styles/top-metric.scss @@ -2,7 +2,6 @@ .panel { background-size: cover; - padding-top: 55px; padding-left: 16px; padding-right: 16px; @media (min-width: $md) { diff --git a/src/components/dapp-staking/stake-manage/StakeForm.vue b/src/components/dapp-staking/stake-manage/StakeForm.vue index 4a4a3587b..82ed2b880 100644 --- a/src/components/dapp-staking/stake-manage/StakeForm.vue +++ b/src/components/dapp-staking/stake-manage/StakeForm.vue @@ -83,17 +83,15 @@
{{ $t(warningMsg) }}
-
- - - {{ $t('confirm') }} - - -
+ + + {{ $t('confirm') }} + + diff --git a/src/components/header/ClaimWarningBanner.vue b/src/components/header/ClaimWarningBanner.vue index f2ab354d9..e6aee85e4 100644 --- a/src/components/header/ClaimWarningBanner.vue +++ b/src/components/header/ClaimWarningBanner.vue @@ -1,6 +1,6 @@ diff --git a/src/components/header/Header.vue b/src/components/header/Header.vue index 80b6057f0..f745f91d2 100644 --- a/src/components/header/Header.vue +++ b/src/components/header/Header.vue @@ -264,13 +264,10 @@ export default defineComponent({ @import 'src/css/quasar.variables.scss'; .wrapper { z-index: 100; + position: sticky; + top: 0; @media (min-width: $lg) { - border-left: solid 1px $navy-3; - width: 100%; - position: absolute; - top: 0; - left: 224px; - padding-right: 224px; + position: relative; } } diff --git a/src/components/header/mobile/MobileNav.vue b/src/components/header/mobile/MobileNav.vue index a915e4e47..dc8682af6 100644 --- a/src/components/header/mobile/MobileNav.vue +++ b/src/components/header/mobile/MobileNav.vue @@ -167,7 +167,6 @@ export default defineComponent({ color: $gray-1; display: flex; flex-direction: column; - // gap: 40px; padding-top: 40px; height: calc(100vh - 64px); overflow-y: auto; diff --git a/src/components/sidenav/SidebarDesktop.vue b/src/components/sidenav/SidebarDesktop.vue index e62b35506..f379ff317 100644 --- a/src/components/sidenav/SidebarDesktop.vue +++ b/src/components/sidenav/SidebarDesktop.vue @@ -91,7 +91,6 @@ -
diff --git a/src/components/sidenav/styles/sidebar-desktop.scss b/src/components/sidenav/styles/sidebar-desktop.scss index ff964d7fd..84e44b089 100644 --- a/src/components/sidenav/styles/sidebar-desktop.scss +++ b/src/components/sidenav/styles/sidebar-desktop.scss @@ -31,6 +31,7 @@ background: #081029; display: flex; flex-direction: column; + border-right: solid 1px $navy-3; } .menu { diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index b4195a231..9a25fe68b 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -1,3 +1,4 @@ +$white: #fff; $gray-1: #f7f7f8; $gray-2: #e6e9ee; $gray-3: #9da3ae; @@ -11,15 +12,17 @@ $gray-7: #222829; $navy-1: #080f2e; $navy-2: #060b23; $navy-3: #1f2f5f; -$navy-4: #141E3E; +$navy-4: #141e3e; $object-light: #e6e9ee; $modal-item-bg-dark: #141c34; $astar-blue: #0085ff; $astar-blue-dark: #05b6fd; -$astar-pink: #E0338F; -$astar-purple: #703AC2; +$astar-pink: #e0338f; +$astar-pink-01: rgba(230, 0, 122, 1); + +$astar-purple: #703ac2; $shiden-purple: #770cff; $shiden-purple-dark: #a67cff; $warning-red: #ff5621; diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index ed75811c8..b10abce38 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -69,6 +69,8 @@ export default { ledgerNotOpened: 'Ledger has not opened Astar App. Please open it and refresh this page.', claimRewards: 'DApp Staking V3 is coming early 2024! Make sure to claim your rewards and stay tuned for the release date.', + underDevelopmentShibuyaWarning: + 'dApp Staking V3 is in beta. We are adding fixes and improves everyday to get ready for the launch.', }, toast: { transactionFailed: 'Transaction failed with error: {message}', @@ -110,6 +112,7 @@ export default { youtube: 'YouTube', docs: 'Documentation', loading: 'Loading...', + comingSoon: 'Coming soon', speed: { speed: 'Transaction speed', speedTip: 'Transaction speed (Tip)', @@ -328,6 +331,13 @@ export default { uaw: 'Unique Active Wallets', cantClaimWihtoutError: 'You cannot claim with automatic re-stake because it is been a while since you claimed your rewards. Please turn off the Auto Re-Stake feature to be able to claim. After you claimed rewards you can turn on re-stake again. The UI team is working to fix this issue.', + migrationSupport: { + actionRequired: 'Action Required', + yourTokensAreLocked: + 'Your tokens are locked in dAppStaking V2. Please migrate your funds to V3 today and start participating.', + balanceFromV2: 'Balance from V2 (locked)', + migrateNow: 'Migrate Now', + }, stakePage: { backToDappList: 'Back to dApps list', whereFundsFrom: 'Where would you like to bring your funds from?', @@ -500,6 +510,7 @@ export default { removeFromFavorite: 'Remove from favorite', unifyAccounts: 'Unify accounts', yourEstimatedRewards: 'Claim your estimated rewards', + yourProject: 'Your Project', toast: { completedMessage: 'You have sent {transferAmt} {symbol} to {toAddress}', completedBridgeMessage: 'You have sent {transferAmt} {symbol} from {fromChain} to {toChain}', @@ -684,6 +695,138 @@ export default { agree: 'Agree', decline: 'Decline', }, + stakingV3: { + title: 'dApp Staking v3', + noDappSelected: 'No dApp selected.', + stakerRewardsExpired: 'Staker rewards expired.', + dappStaking: { + Disabled: 'Pallet is disabled/in maintenance mode.', + NoExpiredEntries: 'There are no expired entries to clean up.', + NoStakingInfo: 'Account has no staking information for the contract', + NotOperatedDApp: 'dApp is part of dApp staking but is not active anymore.', + PeriodEndsNextEra: 'Period ends in the next era.', + TooManyStakedContracts: + 'There are too many contract stake entries for the account. This can be cleaned up by either unstaking or cleaning expired entries.', + TooManyUnlockingChunks: + 'Contract has too many unlocking chunks. Withdraw the existing chunks if possible or wait for current chunks to complete unlocking process to withdraw them.', + UnavailableStakeFunds: + 'The staking amount surpasses the current balance available for staking.', + UnclaimedRewards: + 'There are unclaimed rewards remaining from past eras or periods. They should be claimed before attempting any stake modification again.', + UnstakeAmountTooLarge: 'Unstake amount is greater than the staked amount.', + UnstakeFromPastPeriod: + 'Unstaking is rejected since the period in which past stake was active has passed.', + ZeroAmount: 'Amount must be greater than 0.', + }, + successfullyStaked: 'You successfully staked to {contractAddress}', + voteTitle: 'Vote!', + voteText: 'I would like to vote my tokens with', + transferText: 'I would like to move my funds from', + stakeVoteOn: 'And vote/stake on', + stakeTitle: 'Stake!', + minimumStakingAmount: 'Minimum staking amount is {amount} {symbol}', + minBalanceAfterStaking: + 'Account must hold more than {amount} {symbol} transferrable tokens after you stake.', + selectProjects: 'Select projects', + chooseProject: 'Choose a project to vote', + availableToVote: 'Available to vote', + totalVote: 'Total vote', + totalStake: 'Total stake', + totalTransferable: 'Total transferable', + lockedBalance: 'Locked balance', + alreadyVoted: 'Already voted', + alreadyStaked: 'Already staked', + remainingLockedBalance: 'Remaining locked balance', + voteLockedTokensWarning: + 'Be sure you vote on dapps otherwise those tokens are not eligible for any rewards.', + rewardsWillBeClaimed: 'Your unclaimed rewards will be claimed.', + basicRewards: 'Basic rewards', + bonusRewards: 'Bonus rewards', + dAppRewards: 'dApp rewards', + done: 'Done', + search: 'Search', + build: 'Build', + newDappPromotion: 'New dApp promotion', + votingNow: 'Voting Now', + voteNow: 'Vote now', + voteStakeToday: 'Vote / Stake today', + vote: 'Vote', + voteToday: 'Be entitled to bonus pool today', + stakeOn: 'Stake on {name}', + tier: 'Tier', + tierLeaderboard: 'Tier Leaderboard', + projectLeaderboards: 'Project Leaderboards', + rewardPerDay: 'Reward per era', + myStaking: 'My Staking', + myDapps: 'My dApps', + unbonding: 'Unbonding', + totalEstimatedRewards: 'Total estimated rewards', + claim: 'Claim', + dApp: 'dApp', + stakedAmount: 'Staked amount', + unstakedAmount: 'Locked but unstaked amount', + bonusReward: 'Bonus reward', + manage: 'Manage', + add: 'Add', + unbond: 'Unbond', + unlock: 'Unlock', + stake: 'Stake', + move: 'Move', + index: 'Index', + chunk: 'Chunk', + unbondingAmount: 'Unbonding amount', + withdraw: 'Withdraw', + relock: 'Re-lock', + currentTier: 'Current Tier', + numberOfStakers: 'Number of Stakers', + totalEarned: 'Total Earned', + yourDashboard: 'Your Dashboard', + edit: 'Edit', + editProjectPage: { + title: 'Edit Project Page', + text: 'You can change the images, description at any time.', + }, + editYourInfo: { + title: 'Edit your owner info', + text: 'If you wish to change registered smart contract or rewards receiving address.', + }, + addPromotion: { + title: 'Add a promotion card', + text: 'If you have anything to share with the community, you can create a card on the top page to promote about it!', + }, + yourRewards: 'Your Rewards', + availableToClaim: 'Available to claim', + alreadyClaimed: 'Already claimed', + eras: '{era} eras', + claimed: 'Claimed', + period: 'Period {period}', + claimNow: 'Claim these rewards now, as they will expire at the end of the current period.', + remainingEras: 'Remaining eras / blocks', + back: 'Back', + era: 'Era', + numberOfDapps: 'Number of dApps', + tvl: 'TVL', + filledSlot: 'Filled slots', + unfilledSlot: 'Unfilled slots', + ourDapps: 'Our dApps', + ourData: 'Our data', + dapp: { + voteAndStake: 'Vote & Stake', + overview: 'Overview', + }, + unregisteredDappInfo: + "This project has been unregistered. You don't have to do anything - If you do not move funds within this period, you will continue to earn basic rewards and be entitled to receive bonus.", + voteSuccess: 'You successfully voted on {number} dApp(s). All pending rewards are claimed.', + unbondSuccess: 'You successfully unbonded from {dapp}.', + unbondFromUnregisteredSuccess: 'You successfully unbonded from unregistered dApp {dapp}.', + claimRewardSuccess: 'You successfully claimed your rewards.', + withdrawSuccess: 'You successfully withdrew your locked tokens.', + relockSuccess: 'You successfully re-locked your tokens.', + searchDapps: 'Search dapps', + startStakingNow: 'Start Staking Now', + noEntry: 'No entry', + burn: 'Burn', + }, bridge: { bridge: 'Bridge', history: 'Recent History', diff --git a/src/layouts/DashboardLayout.vue b/src/layouts/DashboardLayout.vue index 65be0c791..606d5cc17 100644 --- a/src/layouts/DashboardLayout.vue +++ b/src/layouts/DashboardLayout.vue @@ -1,19 +1,11 @@