+ Unicove:
+ Your gateway to the {networkName} Network
+
+
+ Stake, Send, Manage Tokens, and Explore {networkName} – all with ease
+
+
+
+
From 7a72e6bf2c26ca44a4de8d39769c4f411bceae9d Mon Sep 17 00:00:00 2001
From: Dean Sallinen <7519573+deansallinen@users.noreply.github.com>
Date: Tue, 17 Dec 2024 14:20:20 -0800
Subject: [PATCH 05/56] fix: type errors
---
src/routes/[network]/(homepage)/components/hero.svelte | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/routes/[network]/(homepage)/components/hero.svelte b/src/routes/[network]/(homepage)/components/hero.svelte
index 1d137214..5fbbdcc9 100644
--- a/src/routes/[network]/(homepage)/components/hero.svelte
+++ b/src/routes/[network]/(homepage)/components/hero.svelte
@@ -4,7 +4,12 @@
import bgDesktop from '$lib/assets/hero/bg1@2x.png?enhanced';
import bgMobile from '$lib/assets/hero/bg2@2x.png?enhanced';
- let { networkName, networkLogo } = $props();
+ interface Props {
+ networkName: string;
+ networkLogo: string;
+ }
+
+ let { networkName, networkLogo }: Props = $props();
From c1d3511b2c6cdda6a48f64f803e019655b0df28a Mon Sep 17 00:00:00 2001
From: Dean Sallinen <7519573+deansallinen@users.noreply.github.com>
Date: Tue, 17 Dec 2024 15:06:27 -0800
Subject: [PATCH 06/56] refactor: extract carousel to component
---
src/routes/[network]/(homepage)/+page.svelte | 56 +--------------
.../(homepage)/components/carousel.svelte | 72 +++++++++++++++++++
.../(homepage)/components/text-block.svelte | 22 ++++++
3 files changed, 96 insertions(+), 54 deletions(-)
create mode 100644 src/routes/[network]/(homepage)/components/carousel.svelte
create mode 100644 src/routes/[network]/(homepage)/components/text-block.svelte
diff --git a/src/routes/[network]/(homepage)/+page.svelte b/src/routes/[network]/(homepage)/+page.svelte
index eebf2938..dcf15e8c 100644
--- a/src/routes/[network]/(homepage)/+page.svelte
+++ b/src/routes/[network]/(homepage)/+page.svelte
@@ -2,7 +2,6 @@
import { Box, Card, Stack, Subgrid, Switcher } from '$lib/components/layout';
import Button from '$lib/components/button/button.svelte';
import { chainLogos } from '@wharfkit/common';
- import Metamask from '$lib/assets/metamask.svg';
import EOSPriceHistory from '$lib/components/chart/eospricehistory.svelte';
import RamPriceHistory from '$lib/components/chart/rampricehistory.svelte';
import AssetText from '$lib/components/elements/asset.svelte';
@@ -14,6 +13,7 @@
import { getAPR } from '$lib/utils/staking';
import type { UnicoveContext } from '$lib/state/client.svelte';
import { calculateValue } from '$lib/utils';
+ import Carousel from './components/carousel.svelte';
const { data } = $props();
const context = getContext('state');
@@ -91,59 +91,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {@render textblock({
- title: `The EOS Wallet for MetaMask`,
- text: `MetaMask, an the industry leading self-custody wallet, is now compatible with Unicove and the ${networkName} network. Install the ${networkName} Wallet snap for MetaMask to get started.`,
- button: {
- text: 'Install EOS Wallet for MetaMask',
- href: `/${data.network}/metamask`
- }
- })}
-
-
-
+
+ import Metamask from '$lib/assets/metamask.svg';
+ import Box from '$lib/components/layout/box/box.svelte';
+ import { getContext } from 'svelte';
+ import type { UnicoveContext } from '$lib/state/client.svelte';
+ import TextBlock from './text-block.svelte';
+
+ const { network } = getContext('state');
+
+ interface Props {
+ networkName: string;
+ networkLogo: string;
+ }
+
+ let { networkName, networkLogo }: Props = $props();
+
+
+
+
- {@render link('MetaMask Snaps', 'https://metamask.io/snaps/')} are a new feature in MetaMask that
- allow community built plugins to extend the functionality of the wallet beyond Ethereum based blockchains.
- This means you can now access the EOS Network through MetaMask using the EOS Wallet snap.
-
-
-
How do I install the EOS Wallet?
-
- The EOS Wallet is a {@render link('MetaMask Snap', 'https://metamask.io/snaps/')}
- you can install directly from this page on Unicove or from the EOS Wallet page in the
- {@render link('MetaMask Snaps Directory', 'https://snaps.metamask.io/')}. You will need to have
- MetaMask installed before adding the EOS Wallet snap.
-
-
-
What does the EOS Wallet do?
-
- The EOS Wallet allows you to use MetaMask as a web3 wallet for an EOS Network account. Any dApp
- compatible with the EOS Wallet can be used with MetaMask.
-
-
-
What does the EOS Wallet not do?
-
- The EOS Wallet's only purpose is to sign transactions and will need to be paired with a
- companion dApp, such as Unicove, in order to manage your account.
-
-
-
How do I sign transactions using the EOS Wallet?
-
- Please see our guide on
- {@render link(
- 'How to Sign Transactions on the EOS network with MetaMask',
- 'https://support.greymass.com/a/solutions/articles/72000637277'
- )}
-
-
-
Is the EOS Wallet free to use?
-
- Yes, the EOS Wallet software is completely free to use. However, accounts on the EOS Network
- require a small amount of EOS before they are created.
-
-
- Unicove is currently covering this cost and offering one free account per user. To limit abuse,
- we require logging in with a valid 3rd party account. Only Apple and Google accounts are
- supported at this time.
-
-
Where can I view and manage my EOS account?
-
- Unicove is the first web wallet to allow you to manage your EOS account using MetaMask. We
- expect other wallets will add support in the future.
-
-
- You can view your account on any EOS Network block explorer, like Unicove, simply by searching
- for the account name.
-
-
-
- Is my private key or recovery phrase exposed when using the EOS Wallet Snap?
-
-
- The EOS Wallet uses a private key derived from your MetaMask seed phrase using the BIP-0044 and
- the EOS coin type. This private key is only ever used for EOS accounts and the EOS Wallet cannot
- access any of your other keys. The EOS Wallet never exposes this private key and does not have
- access to your seed phrase.
-
-
-
Can I access all EOS apps?
-
- It's possible to access any EOS Network app, provided the app developers have integrated the
- required SDKs. The EOS Wallet and MetaMask can be added to any web app using
- {@render link('Wharf', 'https://wharfkit.com/')}
- with the
- {@render link('MetaMask Wallet Plugin', 'https://github.com/wharfkit/wallet-plugin-metamask')}.
-
-
- Unicove itself is
- {@render link('open source', 'https://github.com/greymass/2nicove')}
- and serves as reference material for how this integration can be performed.
-
-
-
How do I reach out for EOS Wallet support?
-
If you have any issues with the EOS Wallet itself, please feel free to reach out to us at
- or by visiting our Support portal at
- {@render link('https://support.greymass.com', 'https://support.greymass.com')}
-
-
+
+
+
FAQ
+
What is a MetaMask snap?
+
+ {@render link('MetaMask Snaps', 'https://metamask.io/snaps/')} are a new feature in MetaMask that
+ allow community built plugins to extend the functionality of the wallet beyond Ethereum based blockchains.
+ This means you can now access the EOS Network through MetaMask using the EOS Wallet snap.
+
+
+
How do I install the EOS Wallet?
+
+ The EOS Wallet is a {@render link('MetaMask Snap', 'https://metamask.io/snaps/')}
+ you can install directly from this page on Unicove or from the EOS Wallet page in the
+ {@render link(
+ 'MetaMask Snaps Directory',
+ 'https://snaps.metamask.io/snap/npm/greymass/eos-wallet'
+ )}. You will need to have
+ {@render link('MetaMask', 'https://metamask.io/')}
+ installed before adding the EOS Wallet snap.
+
+
+
What does the EOS Wallet do?
+
+ The EOS Wallet allows you to use MetaMask as a web3 wallet for an EOS Network account. With it
+ you can sign in to EOS apps and perform transactions.
+
+
+
What does the EOS Wallet not do?
+
+ The EOS Wallet's only purpose is to sign transactions and will need to be paired with a
+ companion dApp, such as Unicove, in order to manage your account.
+
+
+
How do I sign transactions using the EOS Wallet?
+
+ Please see our guide on
+ {@render link(
+ 'How to Sign Transactions on the EOS network with MetaMask',
+ 'https://support.greymass.com/a/solutions/articles/72000637277'
+ )}
+
+
+
Is the EOS Wallet free to use?
+
+ Yes, the EOS Wallet software is completely free to use. However, accounts on the EOS Network
+ require a small amount of EOS before they are created.
+
+
+ Unicove is currently covering this cost and offering one free account per user. To limit
+ abuse, we require logging in with a valid 3rd party account. Only Apple and Google accounts
+ are supported at this time.
+
+
Where can I view and manage my EOS account?
+
+ Unicove is the first web wallet to allow you to manage your EOS account using MetaMask. We
+ expect other wallets will add support in the future.
+
+
+ You can view your account on any EOS Network block explorer, like Unicove, simply by searching
+ for the account name.
+
+
+
+ Is my private key or recovery phrase exposed when using the EOS Wallet Snap?
+
+
+ The EOS Wallet uses a private key derived from your MetaMask seed phrase using the BIP-0044
+ and the EOS coin type. This private key is only ever used for EOS accounts and the EOS Wallet
+ cannot access any of your other keys. The EOS Wallet never exposes this private key and does
+ not have access to your seed phrase.
+
+
+
How does MetaMask configure my owner and active keys?
+
+ The EOS Wallet derives your owner and active keys from your MetaMask seed phrase using
+ different indexes. The zero (0) index key is reserved for the owner key and is not available
+ to sign regular transactions with, while the first (1) index key is used for the active key
+ and available for transaction signing.
+
+
+ A future update to the EOS Wallet will provide a way to use the owner key to reset the active
+ key, allowing for a recovery path in the event the active keys have been changed.
+
+
+
How does find my owner and active keys?
+
+ The EOS Wallet provides an RPC method which returns the public keys associated with your
+ MetaMask seed phrase. These can be used when manually setting up a new account. Unicove can
+ display these keys to you if you visit the Settings page and enable Advanced Mode.
+
+
+
Can I access all EOS apps using EOS Wallet for MetaMask?
+
+ It's possible to access any EOS Network app, provided the app developers have integrated the
+ required SDKs. The EOS Wallet and MetaMask can be added to any web app using
+ {@render link('Wharf', 'https://wharfkit.com/')}
+ with the
+ {@render link(
+ 'MetaMask Wallet Plugin',
+ 'https://github.com/wharfkit/wallet-plugin-metamask'
+ )}.
+
+
+ Unicove itself is
+ {@render link('open source', 'https://github.com/greymass/2nicove')}
+ and serves as reference material for how this integration can be performed.
+
+
+
How do I reach out for EOS Wallet support?
+
If you have any issues with the EOS Wallet itself, please feel free to reach out to us at
- Stake {data.network.chain.systemToken?.symbol.name} today for an estimated {apr}% APR1.
-
-
- The {data.network.chain.name} staking rewards program proportionally distributes 85.6k {data
- .network.chain.systemToken?.symbol.name} daily to token holders who have staked their tokens.
- These tokens can be unstaked and will be usable against after a 21 day lockup period.
-
-
-
-
-
-
- 1 APR is based on the total amount staked and dynamically changes over time.
-
-
-
-
-
-
- {#if data.network.rexstate}
-
- {/if}
-
-
+
-
+
{#if tokenPrices.length}
diff --git a/src/routes/[network]/(homepage)/+page.ts b/src/routes/[network]/(homepage)/+page.ts
new file mode 100644
index 00000000..a8a6fdd1
--- /dev/null
+++ b/src/routes/[network]/(homepage)/+page.ts
@@ -0,0 +1,38 @@
+import type { PageLoad } from './$types';
+import type { HistoricalPrice } from '$lib/types';
+import { Asset } from '@wharfkit/antelope';
+
+export const load: PageLoad = async ({ fetch, parent }) => {
+ const { network } = await parent();
+ let ramPrices: HistoricalPrice[] = [];
+ let tokenPrices: HistoricalPrice[] = [];
+
+ const ramResponse: Response = await fetch(`/${network}/api/metrics/marketprice/ram`);
+ const parsedRamResponse: { date: string; value: number }[] | { error: string } =
+ await ramResponse.json();
+ if ('error' in parsedRamResponse && parsedRamResponse.error) {
+ throw new Error(String(parsedRamResponse.error));
+ } else if (Array.isArray(parsedRamResponse)) {
+ ramPrices = parsedRamResponse.map((price: { date: string; value: number }) => ({
+ date: new Date(price.date),
+ value: Asset.from(price.value / 10000, network.chain.systemToken?.symbol || '0,UNKNOWN')
+ }));
+ }
+
+ const tokenResponse: Response = await fetch(`/${network}/api/metrics/marketprice/token`);
+ const parsedTokenResponse: { date: string; value: number }[] | { error: string } =
+ await tokenResponse.json();
+ if ('error' in parsedTokenResponse && parsedTokenResponse.error) {
+ throw new Error(String(parsedTokenResponse.error));
+ } else if (Array.isArray(parsedTokenResponse)) {
+ tokenPrices = parsedTokenResponse.map((price: { date: string; value: number }) => ({
+ date: new Date(price.date),
+ value: Asset.from(price.value / 10000, '4,USD')
+ }));
+ }
+
+ return {
+ ramPrices,
+ tokenPrices
+ };
+};
diff --git a/src/routes/[network]/(homepage)/components/staking-rewards.svelte b/src/routes/[network]/(homepage)/components/staking-rewards.svelte
new file mode 100644
index 00000000..732db775
--- /dev/null
+++ b/src/routes/[network]/(homepage)/components/staking-rewards.svelte
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
EOS Staking Rewards
+
+ Stake {network.chain.systemToken?.symbol.name} today for an estimated {apr}% APR1.
+
+
+ The {network.chain.name} staking rewards program proportionally distributes 85.6k {network
+ .chain.systemToken?.symbol.name} daily to token holders who have staked their tokens. These
+ tokens can be unstaked and will be usable against after a 21 day lockup period.
+
+
+
+
+
+
+ 1 APR is based on the total amount staked and dynamically changes over time.
+