From 2471263eed79fa27aec808f2e8b62dc93455f1f7 Mon Sep 17 00:00:00 2001 From: Christopher Cali Date: Mon, 6 Nov 2023 08:28:52 -0500 Subject: [PATCH 1/2] Update .eslintrc with new rules and npm run lint --- .eslintrc | 12 +- apps/docs/scripts/docgen.ts | 22 +- apps/docs/templates/solidity/helpers.ts | 2 +- apps/landing/src/App.vue | 2 +- .../src/composables/QuestionsAndAnswers.ts | 194 +-- apps/landing/src/composables/blog.ts | 96 +- apps/landing/src/composables/roadmapItems.ts | 86 +- apps/landing/src/composables/router.ts | 58 +- apps/landing/src/env.d.ts | 6 +- apps/landing/src/main.ts | 10 +- apps/landing/src/pages/blog/Blog.vue | 12 +- .../src/pages/blog/components/Article.vue | 40 +- .../landing/src/pages/changelog/Changelog.vue | 40 +- apps/landing/src/pages/landing/Landing.vue | 46 +- apps/landing/vite.config.ts | 29 +- apps/web/src/@types/index.d.ts | 4 +- apps/web/src/App.vue | 4 +- apps/web/src/components/Carousel.vue | 14 +- .../web/src/components/ConnectWalletsFlow.vue | 128 +- apps/web/src/components/USDAmount.vue | 20 +- .../web/src/components/charts/LineChartJS.vue | 224 +-- apps/web/src/composables/analytics.ts | 425 +++--- apps/web/src/composables/auth.ts | 112 +- apps/web/src/composables/breakdownMetrics.ts | 512 +++---- apps/web/src/composables/contracts.ts | 56 +- apps/web/src/composables/environment.ts | 52 +- apps/web/src/composables/ethers.ts | 190 +-- apps/web/src/composables/files.ts | 92 +- apps/web/src/composables/format.ts | 88 +- apps/web/src/composables/ledger.ts | 56 +- apps/web/src/composables/operators.ts | 371 +++-- apps/web/src/composables/price.ts | 124 +- apps/web/src/composables/router.ts | 43 +- apps/web/src/composables/screenDimensions.ts | 48 +- apps/web/src/composables/siwe.ts | 124 +- apps/web/src/composables/staking.ts | 250 ++-- apps/web/src/composables/trezor.ts | 222 +-- apps/web/src/composables/user.ts | 14 +- apps/web/src/composables/walletConnectV2.ts | 140 +- apps/web/src/composables/wallets.ts | 152 +- apps/web/src/env.d.ts | 4 +- apps/web/src/layouts/default-layout.vue | 28 +- apps/web/src/main.ts | 14 +- .../web/src/mockData/mock_transaction_data.ts | 31 +- apps/web/src/pages/operators/Operator.vue | 114 +- apps/web/src/pages/overview/Overview.vue | 25 +- .../overview/components/Announcements.vue | 18 +- .../overview/components/BreakdownChart.vue | 96 +- .../overview/components/BreakdownTable.vue | 134 +- .../src/pages/overview/components/Staking.vue | 170 +-- .../pages/overview/components/StakingAvg.vue | 34 +- apps/web/src/sessions.config.ts | 10 +- apps/web/vite.config.ts | 34 +- common/aws/src/index.ts | 44 +- common/data/src/index.ts | 38 +- common/data/src/providers/schema.ts | 130 +- common/env/src/index.ts | 88 +- common/events/src/index.ts | 90 +- common/fetch/src/index.ts | 30 +- common/format/src/index.ts | 40 +- common/logs/src/index.ts | 14 +- common/shell/src/index.ts | 52 +- common/ssv/src/index.ts | 4 +- common/ssv/src/interfaces/Cluster.ts | 2 +- common/ssv/src/interfaces/Operator.ts | 2 +- common/ssv/src/interfaces/ScannerOptions.ts | 2 +- common/ssv/src/providers/scanner.ts | 244 ++-- common/types/src/index.ts | 168 +-- common/types/src/interfaces/Account.ts | 6 +- .../AccountWithStakingAndOperatorInfo.ts | 2 +- common/types/src/interfaces/ApiResponse.ts | 2 +- .../types/src/interfaces/BreakdownString.ts | 2 +- .../types/src/interfaces/BrowserProviders.ts | 2 +- common/types/src/interfaces/ContractConfig.ts | 2 +- common/types/src/interfaces/Currency.ts | 2 +- .../types/src/interfaces/DeploymentConfig.ts | 2 +- common/types/src/interfaces/EthersProvider.ts | 2 +- common/types/src/interfaces/Event.ts | 8 +- .../src/interfaces/FormattedWalletOption.ts | 2 +- .../types/src/interfaces/LoginCredentials.ts | 4 +- common/types/src/interfaces/ManagerConfig.ts | 2 +- common/types/src/interfaces/MessageInit.ts | 4 +- common/types/src/interfaces/MessageRequest.ts | 4 +- .../types/src/interfaces/OperatorDetails.ts | 4 +- common/types/src/interfaces/PoolConfig.ts | 2 +- common/types/src/interfaces/ProviderString.ts | 14 +- .../RegisterOperatorWithCasimirParams.ts | 4 +- .../src/interfaces/RegisteredOperator.ts | 4 +- .../SignInWithEthereumCredentials.ts | 2 +- .../src/interfaces/TransactionRequest.ts | 6 +- common/types/src/interfaces/User.ts | 2 +- .../types/src/interfaces/UserAnalyticsData.ts | 2 +- common/types/src/interfaces/UserAuthState.ts | 18 +- .../UserWithAccountsAndOperators.ts | 2 +- common/uniswap/src/index.ts | 2 +- .../uniswap/src/interfaces/FactoryOptions.ts | 2 +- common/uniswap/src/providers/factory.ts | 48 +- common/wallets/src/index.ts | 10 +- common/wallets/src/providers/ledger.ts | 266 ++-- common/wallets/src/providers/trezor.ts | 230 +-- common/wallets/src/providers/walletConnect.ts | 84 +- contracts/ethereum/hardhat.config.ts | 194 +-- contracts/ethereum/helpers/math.ts | 4 +- contracts/ethereum/helpers/network.ts | 20 +- contracts/ethereum/helpers/oracle.ts | 463 +++--- contracts/ethereum/helpers/upkeep.ts | 134 +- contracts/ethereum/scripts/clean.ts | 4 +- contracts/ethereum/scripts/deploy.ts | 301 ++-- contracts/ethereum/scripts/dev.ts | 462 +++--- contracts/ethereum/scripts/rebalance-bug-1.ts | 78 +- contracts/ethereum/scripts/report.ts | 74 +- contracts/ethereum/scripts/test.ts | 68 +- contracts/ethereum/scripts/upgrade-all.ts | 238 ++-- contracts/ethereum/scripts/upgrade-proxies.ts | 160 +-- contracts/ethereum/test/debug.ts | 186 +-- contracts/ethereum/test/fixtures/shared.ts | 1257 +++++++++-------- contracts/ethereum/test/integration.ts | 370 ++--- contracts/ethereum/test/operators.ts | 268 ++-- contracts/ethereum/test/users.ts | 252 ++-- infrastructure/cdk/src/index.ts | 48 +- .../cdk/src/interfaces/StackProps.ts | 8 +- infrastructure/cdk/src/providers/analytics.ts | 84 +- infrastructure/cdk/src/providers/blog.ts | 94 +- infrastructure/cdk/src/providers/config.ts | 101 +- infrastructure/cdk/src/providers/dns.ts | 58 +- infrastructure/cdk/src/providers/docs.ts | 151 +- infrastructure/cdk/src/providers/landing.ts | 149 +- infrastructure/cdk/src/providers/network.ts | 30 +- infrastructure/cdk/src/providers/nodes.ts | 44 +- infrastructure/cdk/src/providers/users.ts | 210 +-- infrastructure/cdk/src/providers/web.ts | 137 +- infrastructure/cdk/test/all.test.ts | 106 +- infrastructure/cdk/test/analytics.test.ts | 90 +- scripts/actions/test.ts | 14 +- scripts/cdk/deploy.ts | 94 +- scripts/cdk/test.ts | 32 +- scripts/ethereum/debug.ts | 42 +- scripts/ethereum/deploy.ts | 30 +- scripts/ethereum/report.ts | 28 +- scripts/ethereum/upgrade.ts | 34 +- scripts/migrations/users.ts | 76 +- scripts/root/check.ts | 106 +- scripts/root/clean.ts | 54 +- scripts/root/dev.ts | 214 +-- services/blog/src/index.ts | 76 +- .../functions/Functions-request-config.d.ts | 2 +- services/functions/scripts/dev.ts | 46 +- services/functions/scripts/simulate.ts | 56 +- services/functions/src/index.ts | 104 +- .../functions/src/interfaces/HandlerInput.ts | 2 +- services/functions/src/providers/config.ts | 34 +- services/functions/src/providers/format.ts | 42 +- services/functions/src/providers/handlers.ts | 84 +- services/oracle/scripts/dev.ts | 70 +- services/oracle/scripts/generate.ts | 171 +-- services/oracle/src/index.ts | 196 +-- .../oracle/src/interfaces/HandlerInput.ts | 4 +- services/oracle/src/providers/config.ts | 88 +- services/oracle/src/providers/dkg.ts | 168 +-- services/oracle/src/providers/handlers.ts | 769 +++++----- services/redirect/src/index.ts | 8 +- services/users/scripts/clean.ts | 10 +- services/users/scripts/db.ts | 108 +- services/users/src/index.ts | 67 +- services/users/src/providers/db.ts | 418 +++--- services/users/src/providers/ethers.ts | 50 +- services/users/src/providers/postgres.ts | 30 +- services/users/src/routes/analytics.ts | 142 +- services/users/src/routes/auth.ts | 222 +-- services/users/src/routes/health.ts | 6 +- services/users/src/routes/user.ts | 454 +++--- services/users/src/sessions.config.ts | 32 +- 172 files changed, 8365 insertions(+), 8189 deletions(-) diff --git a/.eslintrc b/.eslintrc index f827c32e0..2540a9997 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,12 +21,20 @@ "@typescript-eslint" ], "rules": { + "indent": ["error", 2], "semi": ["error", "never"], + "quotes": ["error", "double"], "vue/multi-word-component-names": "off", - "quotes": ["error", "single"] + "max-len": ["error", { "code": 120, "ignoreStrings": true, "comments":300, "ignoreTemplateLiterals": true }], + "space-before-blocks": ["error", "always"], + "object-curly-spacing": ["error", "always"], + "space-in-parens": ["error", "never"], + "keyword-spacing": ["error", { "before": true, "after": true }], + "array-element-newline": ["error", { "minItems": 3 }] }, "ignorePatterns": [ - "lib", + "contracts/**/scripts/resources", + "scripts/**/resources", "cdk.out", "*.js" ] diff --git a/apps/docs/scripts/docgen.ts b/apps/docs/scripts/docgen.ts index 394253889..2215a3c94 100644 --- a/apps/docs/scripts/docgen.ts +++ b/apps/docs/scripts/docgen.ts @@ -1,16 +1,16 @@ -import fs from 'fs' -import { run } from '@casimir/shell' +import fs from "fs" +import { run } from "@casimir/shell" void async function () { - const referenceDir = `${process.cwd()}/src/reference` - const solidityTemplateDir = `${process.cwd()}/templates/solidity` - await run(`DOCS_OUTPUT_DIR=${referenceDir} DOCS_TEMPLATE_DIR=${solidityTemplateDir} npm run docgen --workspace @casimir/ethereum`) + const referenceDir = `${process.cwd()}/src/reference` + const solidityTemplateDir = `${process.cwd()}/templates/solidity` + await run(`DOCS_OUTPUT_DIR=${referenceDir} DOCS_TEMPLATE_DIR=${solidityTemplateDir} npm run docgen --workspace @casimir/ethereum`) - const casimirOperatorReadmeUrl = 'https://raw.githubusercontent.com/consensusnetworks/casimir-operator/master/README.md' - const casimirOperatorReadme = await fetch(casimirOperatorReadmeUrl) - const casimirOperatorReadmeText = await casimirOperatorReadme.text() + const casimirOperatorReadmeUrl = "https://raw.githubusercontent.com/consensusnetworks/casimir-operator/master/README.md" + const casimirOperatorReadme = await fetch(casimirOperatorReadmeUrl) + const casimirOperatorReadmeText = await casimirOperatorReadme.text() - const partsDir = `${process.cwd()}/src/parts` - if (!fs.existsSync(partsDir)) fs.mkdirSync(partsDir) - fs.writeFileSync(`${partsDir}/casimir-operator-README.md`, casimirOperatorReadmeText) + const partsDir = `${process.cwd()}/src/parts` + if (!fs.existsSync(partsDir)) fs.mkdirSync(partsDir) + fs.writeFileSync(`${partsDir}/casimir-operator-README.md`, casimirOperatorReadmeText) }() \ No newline at end of file diff --git a/apps/docs/templates/solidity/helpers.ts b/apps/docs/templates/solidity/helpers.ts index b890bf57a..77c54b9a1 100644 --- a/apps/docs/templates/solidity/helpers.ts +++ b/apps/docs/templates/solidity/helpers.ts @@ -1,3 +1,3 @@ export function notInternal(visibility: string) { - return visibility !== 'internal' + return visibility !== "internal" } \ No newline at end of file diff --git a/apps/landing/src/App.vue b/apps/landing/src/App.vue index 623dcac89..1117cf53b 100644 --- a/apps/landing/src/App.vue +++ b/apps/landing/src/App.vue @@ -1,6 +1,6 @@ diff --git a/apps/landing/src/composables/QuestionsAndAnswers.ts b/apps/landing/src/composables/QuestionsAndAnswers.ts index afbc9e6a1..c0d958ecc 100644 --- a/apps/landing/src/composables/QuestionsAndAnswers.ts +++ b/apps/landing/src/composables/QuestionsAndAnswers.ts @@ -1,109 +1,109 @@ -import { onMounted, onUnmounted, readonly, ref } from 'vue' +import { onMounted, onUnmounted, readonly, ref } from "vue" const initializeComposable = ref(false) const questionsAndAnswers = ref([ - { - question: 'What’s the minimum I can stake?', - answer: 'There is no minimum! However, there is a point at which gas fees make very small amounts staked not worth it.', - link: '' - }, - { - question: 'How are rewards generated?', - answer: 'Rewards are generated natively on the Ethereum beacon chain as if you were solo staking. Casimir pools users’ ETH into 32 ETH pools and builds a validator group of 4 operators using Distributed Validator Technology. Rewards are distributed to the users’ proportionate to their share of the 32 ETH in the pool. More information on how staking works here. Additionally, MEV and any other block rewards will be shared across validators. ', - link: 'https://ethereum.org/en/staking/#:~:text=Rewards%20are%20given%20for%20actions,keeps%20the%20chain%20running%20securely.' - }, - { - question: 'How does Casimir work? What does it mean to create an account?', - answer: 'Casimir utilizes distributed validator technology to pool users’ ETH into 32 ETH pools that are distributed across four node operators. Individual users (stakers) are able to maintain custody of their ETH because of our use of distributed key generation (DKG). Rewards are managed through Casimir’s open source manager contract and distributed back to users in native ETH proportionate to their share of the 32 ETH in the pool. ', - link: 'https://github.com/RockX-SG/rockx-dkg-cli' - }, - { - question: 'What are the advantages of staking with Casimir over other protocols?', - answer: 'Casimir is a first of its kind pooled staking solution that allows users to stake any amount of ETH while maintaining custody of their ethereum and receiving rewards in native ETH (not a secondary liquid staking token). Staking with Casimir gives you the flexibility and ease of use of a liquid staking protocol with the decentralization benefits of solo staking, the reward upside of solo staking and additional security because your stake is distributed across multiple validators (DVT). Additionally, because you are staking native ETH, you will be able to use solutions, like Eigenlayer, that liquid stakers are limited in their ability to access.', - link: '' - }, - { - question: 'What are the risks?', - answer: ' There is an inherent risk that Casimir could contain a smart contract vulnerability or bug. The Casimir code is open-sourced, audited, and covered by a bug bounty program to minimize this risk. To mitigate smart contract risks, all of the core Casimir contracts are audited. Validators/operators risk penalties, with up to 100% of staked funds at risk if validators/operators fail. To minimize this risk, Casimir utilizes Distributed Validator Technology (DVT) so that failure of a validator/operator will not result in slashed or lost funds.', - link: '' - }, - { - question: 'Who is behind Casimir? Are the smart contracts audited and open source?', - answer: 'Casimir is being built by Consensus Networks, a US based team who have been active in crypto for several years. The team were early node operators in many PoS protocols and have been awarded grants from both Web3 and government grants for the development of digital asset management tools.', - link: '' - }, - { - question: 'What is Distributed Validator Technology (DVT)?', - answer: 'DVT supports Ethereum’s validation layer by distributing validator operations to the network’s multiple non-trusting nodes (a.k.a Operators). Clusters of operator nodes operate validators on behalf of the staker and simultaneously help solve the fundamental issues of centralization, redundancy, and security that exist within Ethereum’s PoS consensus.', - link: 'https://ssv.network/glossary/#operator' - }, - { - question: 'Why don’t you use a Liquid Staking Derivative or Token (LSD or LST)?', - answer: 'There are inherent risks with LSDs, most significantly counterparty risk. Since the LSD is functionally an IOU, if the issuer of the LSD were to become insolvent, the user’s ETH could be lost forever.', - link: '' - }, - { - question: 'Are there ways I can use my staked ETH for additional yield?', - answer: 'Yes, although Casimir is not launching an LSD, there are opportunities for stakers to provide their native staked ETH to be used as a liquidity provider (to support a DAO, for example). Additionally, we will be onboarding restaking mechanisms like Eigenlayer that will allow users to natively restake their ETH to maximize their APR, if desired.', - link: '' - }, - { - question: 'Am I giving up custody of my staked ETH?', - answer: 'No! You will always be able to withdraw your staked ETH from your smart contract.', - link: '' - }, - { - question: 'How frequently do I get my rewards? ', - answer: 'Rewards will be distributed as they are awarded by the Ethereum protocol, at least daily.', - link: '' - }, - { - question: 'Where are my rewards distributed, is there a secondary token?', - answer: 'Your rewards will be distributed to your wallet, there is no need to deal with the hassle of swapping a token to get your rewards.', - link: '' - }, - { - question: 'What Wallets are supported?', - answer: 'Today we support Metamask, Wallet Connect, Trezor, Ledger, Trust Wallet and Coinbase Wallet.', - link: '' - }, - { - question: 'Is there a lockup period or waiting period for withdrawals? ', - answer: 'Since you are staking native ETH, there may be a wait time for a validator to exit to receive your withdrawal. If you desire a quicker exit, we will soon be launching a native ETH liquidity pool for those who wish for an instant withdrawal.', - link: '' - }, - { - question: 'Where is my stake going, who is running the validators?', - answer: 'Casimir is launching with a small set of validators but will soon open a permissionless set so that anyone can join for a small (1ETH) collateral. Validator performance is monitored by a decentralized oracle network to ensure performance and validator performance specs are made available and used in evaluation for the selection of validator operators.', - link: '' - }, - { - question: 'What is the fee?', - answer: 'There is a small fee, paid for by part of the block rewards to cover validator and other network payments to ensure Casimir keeps running.', - link: '' - }, - { - question: 'Can I run a validator?', - answer: 'If you have the technical ability and desire, you soon will be able to run a validator as part of our protocol. Today we are launching with a smaller set of white listed validators but will soon start opening to a permissionless set. Join our Discord for the latest updates.', - link: '' - }, + { + question: "What’s the minimum I can stake?", + answer: "There is no minimum! However, there is a point at which gas fees make very small amounts staked not worth it.", + link: "" + }, + { + question: "How are rewards generated?", + answer: "Rewards are generated natively on the Ethereum beacon chain as if you were solo staking. Casimir pools users’ ETH into 32 ETH pools and builds a validator group of 4 operators using Distributed Validator Technology. Rewards are distributed to the users’ proportionate to their share of the 32 ETH in the pool. More information on how staking works here. Additionally, MEV and any other block rewards will be shared across validators. ", + link: "https://ethereum.org/en/staking/#:~:text=Rewards%20are%20given%20for%20actions,keeps%20the%20chain%20running%20securely." + }, + { + question: "How does Casimir work? What does it mean to create an account?", + answer: "Casimir utilizes distributed validator technology to pool users’ ETH into 32 ETH pools that are distributed across four node operators. Individual users (stakers) are able to maintain custody of their ETH because of our use of distributed key generation (DKG). Rewards are managed through Casimir’s open source manager contract and distributed back to users in native ETH proportionate to their share of the 32 ETH in the pool. ", + link: "https://github.com/RockX-SG/rockx-dkg-cli" + }, + { + question: "What are the advantages of staking with Casimir over other protocols?", + answer: "Casimir is a first of its kind pooled staking solution that allows users to stake any amount of ETH while maintaining custody of their ethereum and receiving rewards in native ETH (not a secondary liquid staking token). Staking with Casimir gives you the flexibility and ease of use of a liquid staking protocol with the decentralization benefits of solo staking, the reward upside of solo staking and additional security because your stake is distributed across multiple validators (DVT). Additionally, because you are staking native ETH, you will be able to use solutions, like Eigenlayer, that liquid stakers are limited in their ability to access.", + link: "" + }, + { + question: "What are the risks?", + answer: " There is an inherent risk that Casimir could contain a smart contract vulnerability or bug. The Casimir code is open-sourced, audited, and covered by a bug bounty program to minimize this risk. To mitigate smart contract risks, all of the core Casimir contracts are audited. Validators/operators risk penalties, with up to 100% of staked funds at risk if validators/operators fail. To minimize this risk, Casimir utilizes Distributed Validator Technology (DVT) so that failure of a validator/operator will not result in slashed or lost funds.", + link: "" + }, + { + question: "Who is behind Casimir? Are the smart contracts audited and open source?", + answer: "Casimir is being built by Consensus Networks, a US based team who have been active in crypto for several years. The team were early node operators in many PoS protocols and have been awarded grants from both Web3 and government grants for the development of digital asset management tools.", + link: "" + }, + { + question: "What is Distributed Validator Technology (DVT)?", + answer: "DVT supports Ethereum’s validation layer by distributing validator operations to the network’s multiple non-trusting nodes (a.k.a Operators). Clusters of operator nodes operate validators on behalf of the staker and simultaneously help solve the fundamental issues of centralization, redundancy, and security that exist within Ethereum’s PoS consensus.", + link: "https://ssv.network/glossary/#operator" + }, + { + question: "Why don’t you use a Liquid Staking Derivative or Token (LSD or LST)?", + answer: "There are inherent risks with LSDs, most significantly counterparty risk. Since the LSD is functionally an IOU, if the issuer of the LSD were to become insolvent, the user’s ETH could be lost forever.", + link: "" + }, + { + question: "Are there ways I can use my staked ETH for additional yield?", + answer: "Yes, although Casimir is not launching an LSD, there are opportunities for stakers to provide their native staked ETH to be used as a liquidity provider (to support a DAO, for example). Additionally, we will be onboarding restaking mechanisms like Eigenlayer that will allow users to natively restake their ETH to maximize their APR, if desired.", + link: "" + }, + { + question: "Am I giving up custody of my staked ETH?", + answer: "No! You will always be able to withdraw your staked ETH from your smart contract.", + link: "" + }, + { + question: "How frequently do I get my rewards? ", + answer: "Rewards will be distributed as they are awarded by the Ethereum protocol, at least daily.", + link: "" + }, + { + question: "Where are my rewards distributed, is there a secondary token?", + answer: "Your rewards will be distributed to your wallet, there is no need to deal with the hassle of swapping a token to get your rewards.", + link: "" + }, + { + question: "What Wallets are supported?", + answer: "Today we support Metamask, Wallet Connect, Trezor, Ledger, Trust Wallet and Coinbase Wallet.", + link: "" + }, + { + question: "Is there a lockup period or waiting period for withdrawals? ", + answer: "Since you are staking native ETH, there may be a wait time for a validator to exit to receive your withdrawal. If you desire a quicker exit, we will soon be launching a native ETH liquidity pool for those who wish for an instant withdrawal.", + link: "" + }, + { + question: "Where is my stake going, who is running the validators?", + answer: "Casimir is launching with a small set of validators but will soon open a permissionless set so that anyone can join for a small (1ETH) collateral. Validator performance is monitored by a decentralized oracle network to ensure performance and validator performance specs are made available and used in evaluation for the selection of validator operators.", + link: "" + }, + { + question: "What is the fee?", + answer: "There is a small fee, paid for by part of the block rewards to cover validator and other network payments to ensure Casimir keeps running.", + link: "" + }, + { + question: "Can I run a validator?", + answer: "If you have the technical ability and desire, you soon will be able to run a validator as part of our protocol. Today we are launching with a smaller set of white listed validators but will soon start opening to a permissionless set. Join our Discord for the latest updates.", + link: "" + }, ]) export default function useQuestionsAndAnswers() { - onMounted(() => { - if(!initializeComposable.value){ - initializeComposable.value = true - } + onMounted(() => { + if (!initializeComposable.value) { + initializeComposable.value = true + } - }) + }) - onUnmounted(() =>{ - initializeComposable.value = false - }) + onUnmounted(() =>{ + initializeComposable.value = false + }) - return { - questionsAndAnswers: readonly(questionsAndAnswers), - } + return { + questionsAndAnswers: readonly(questionsAndAnswers), + } } \ No newline at end of file diff --git a/apps/landing/src/composables/blog.ts b/apps/landing/src/composables/blog.ts index 9533d241d..9d2f7349f 100644 --- a/apps/landing/src/composables/blog.ts +++ b/apps/landing/src/composables/blog.ts @@ -1,60 +1,60 @@ -import { onMounted, onUnmounted, readonly, ref } from 'vue' -import snarkdown from 'snarkdown' -import { Article } from '@casimir/types' +import { onMounted, onUnmounted, readonly, ref } from "vue" +import snarkdown from "snarkdown" +import { Article } from "@casimir/types" const initializeComposable = ref(false) -const blogUrl = import.meta.env.PUBLIC_BLOG_URL || 'http://localhost:4001' +const blogUrl = import.meta.env.PUBLIC_BLOG_URL || "http://localhost:4001" const articles = ref([] as Article[]) const loadingArticles = ref(true) export default function useBlog() { - async function getArticleContent(itemId: string) { - const response = await fetch(`${blogUrl}/articles/${itemId}`) - const json = await response.json() - const md = snarkdown(json.content) - return md - } - - onMounted(async () => { - if (!initializeComposable.value) { - loadingArticles.value = true - try { - const response = await fetch(`${blogUrl}/articles`) - const jsonList = await response.json() - const articleList = [] - - for (let i = 0; i < jsonList.length; i++) { - const title = jsonList[i].title - const content = await getArticleContent(jsonList[i].id) - const timestamp = jsonList[i].publishedAt - const id = jsonList[i].id - articleList.push({ - title: title, - content: content, - timestamp: timestamp, - type: 'Blog', - id: id, - }) - } - - articles.value = articleList - loadingArticles.value = false - } catch (error) { - console.log('Error fetching articles', error) - loadingArticles.value = false - } - - initializeComposable.value = true + async function getArticleContent(itemId: string) { + const response = await fetch(`${blogUrl}/articles/${itemId}`) + const json = await response.json() + const md = snarkdown(json.content) + return md + } + + onMounted(async () => { + if (!initializeComposable.value) { + loadingArticles.value = true + try { + const response = await fetch(`${blogUrl}/articles`) + const jsonList = await response.json() + const articleList = [] + + for (let i = 0; i < jsonList.length; i++) { + const title = jsonList[i].title + const content = await getArticleContent(jsonList[i].id) + const timestamp = jsonList[i].publishedAt + const id = jsonList[i].id + articleList.push({ + title: title, + content: content, + timestamp: timestamp, + type: "Blog", + id: id, + }) } - }) - onUnmounted(() => { - initializeComposable.value = false - }) + articles.value = articleList + loadingArticles.value = false + } catch (error) { + console.log("Error fetching articles", error) + loadingArticles.value = false + } - return { - articles: readonly(articles), - loadingArticles: readonly(loadingArticles), + initializeComposable.value = true } + }) + + onUnmounted(() => { + initializeComposable.value = false + }) + + return { + articles: readonly(articles), + loadingArticles: readonly(loadingArticles), + } } diff --git a/apps/landing/src/composables/roadmapItems.ts b/apps/landing/src/composables/roadmapItems.ts index 996394bf3..340c8f693 100644 --- a/apps/landing/src/composables/roadmapItems.ts +++ b/apps/landing/src/composables/roadmapItems.ts @@ -1,4 +1,4 @@ -import { onMounted, onUnmounted, readonly, ref } from 'vue' +import { onMounted, onUnmounted, readonly, ref } from "vue" const initializeComposable = ref(false) @@ -12,53 +12,53 @@ const casimirRoadmapLocation = ref(2) // Liquid withdrawal pools: native ETH pool launched for users who want instant unstaking const roadmapItems = ref([ - { - step: 1, - title: 'Internal Testnet', - description: 'Deploy and test beta version.' - }, - { - step: 2, - title: 'Goerli Launch', - description: 'Launch publicly for Goerli Testnet. Coming Soon!!' - }, - { - step: 3, - title: 'Mainnet Beta', - description: 'Launch with Mainnet and selected validator set.' - }, - { - step: 4, - title: 'Full Mainnet', - description: 'Launch with permissionless validators on Mainnet.' - }, - { - step: 5, - title: 'Eigenlayer Restaking', - description: 'Integrate with Eigenlayer to enable native restaking and eigenpod creation. ' - }, - { - step: 6, - title: 'Liquid Withdrawl Pools', - description: 'Launch with native ETH pools to allow users instant unstaking if desired.' - }, + { + step: 1, + title: "Internal Testnet", + description: "Deploy and test beta version." + }, + { + step: 2, + title: "Goerli Launch", + description: "Launch publicly for Goerli Testnet. Coming Soon!!" + }, + { + step: 3, + title: "Mainnet Beta", + description: "Launch with Mainnet and selected validator set." + }, + { + step: 4, + title: "Full Mainnet", + description: "Launch with permissionless validators on Mainnet." + }, + { + step: 5, + title: "Eigenlayer Restaking", + description: "Integrate with Eigenlayer to enable native restaking and eigenpod creation. " + }, + { + step: 6, + title: "Liquid Withdrawl Pools", + description: "Launch with native ETH pools to allow users instant unstaking if desired." + }, ]) export default function useRoadmap() { - onMounted(() => { - if(!initializeComposable.value){ - initializeComposable.value = true - } + onMounted(() => { + if (!initializeComposable.value) { + initializeComposable.value = true + } - }) + }) - onUnmounted(() =>{ - initializeComposable.value = false - }) + onUnmounted(() =>{ + initializeComposable.value = false + }) - return { - roadmapItems: readonly(roadmapItems), - casimirRoadmapLocation: readonly(casimirRoadmapLocation), - } + return { + roadmapItems: readonly(roadmapItems), + casimirRoadmapLocation: readonly(casimirRoadmapLocation), + } } \ No newline at end of file diff --git a/apps/landing/src/composables/router.ts b/apps/landing/src/composables/router.ts index 962428b3e..47f469f00 100644 --- a/apps/landing/src/composables/router.ts +++ b/apps/landing/src/composables/router.ts @@ -1,36 +1,36 @@ -import { createWebHistory, createRouter } from 'vue-router' -import Landing from '@/pages/landing/Landing.vue' -import Changelog from '@/pages/changelog/Changelog.vue' -import Blog from '@/pages/blog/Blog.vue' -import Article from '@/pages/blog/components/Article.vue' +import { createWebHistory, createRouter } from "vue-router" +import Landing from "@/pages/landing/Landing.vue" +import Changelog from "@/pages/changelog/Changelog.vue" +import Blog from "@/pages/blog/Blog.vue" +import Article from "@/pages/blog/components/Article.vue" const routes = [ - { - path: '/', - name: Landing, - component: Landing, - }, - { - path: '/blog', - name: Blog, - component: Blog, - }, - { - path: '/blog/:id', - component: Article, - children: [{ path: '', name: Article, component: Article }], - }, - { - path: '/changelog', - name: Changelog, - component: Changelog, - }, + { + path: "/", + name: Landing, + component: Landing, + }, + { + path: "/blog", + name: Blog, + component: Blog, + }, + { + path: "/blog/:id", + component: Article, + children: [{ path: "", name: Article, component: Article }], + }, + { + path: "/changelog", + name: Changelog, + component: Changelog, + }, ] const router = createRouter({ - history: createWebHistory(), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - routes, + history: createWebHistory(), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + routes, }) export default router diff --git a/apps/landing/src/env.d.ts b/apps/landing/src/env.d.ts index be15b0dcb..7bb571c3b 100644 --- a/apps/landing/src/env.d.ts +++ b/apps/landing/src/env.d.ts @@ -4,10 +4,10 @@ import { SendMessagesCommandOutput, UpdateEndpointCommandOutput -} from '@aws-sdk/client-pinpoint' +} from "@aws-sdk/client-pinpoint" -declare module '*.vue' { - import type { DefineComponent } from 'vue' +declare module "*.vue" { + import type { DefineComponent } from "vue" // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types const component: DefineComponent<{}, {}, any> export default component diff --git a/apps/landing/src/main.ts b/apps/landing/src/main.ts index ac6149a2a..c17af52f7 100644 --- a/apps/landing/src/main.ts +++ b/apps/landing/src/main.ts @@ -1,8 +1,8 @@ -import { createApp } from 'vue' -import App from '@/App.vue' -import '@/index.css' -import router from './composables/router' +import { createApp } from "vue" +import App from "@/App.vue" +import "@/index.css" +import router from "./composables/router" const app = createApp(App) app.use(router) -app.mount('#app') +app.mount("#app") diff --git a/apps/landing/src/pages/blog/Blog.vue b/apps/landing/src/pages/blog/Blog.vue index 2b7c1de81..db5302b4c 100644 --- a/apps/landing/src/pages/blog/Blog.vue +++ b/apps/landing/src/pages/blog/Blog.vue @@ -1,12 +1,12 @@ diff --git a/apps/landing/src/pages/blog/components/Article.vue b/apps/landing/src/pages/blog/components/Article.vue index 7749ff227..ca726b3be 100644 --- a/apps/landing/src/pages/blog/components/Article.vue +++ b/apps/landing/src/pages/blog/components/Article.vue @@ -1,39 +1,39 @@ diff --git a/apps/landing/src/pages/changelog/Changelog.vue b/apps/landing/src/pages/changelog/Changelog.vue index 0c5b6bfab..f6474b7fe 100644 --- a/apps/landing/src/pages/changelog/Changelog.vue +++ b/apps/landing/src/pages/changelog/Changelog.vue @@ -1,8 +1,8 @@