diff --git a/docker-compose.yaml b/docker-compose.yaml index e3fda035..7902a329 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -version: "3.8" +version: '3.8' services: nginx: image: nginx:latest @@ -7,7 +7,7 @@ services: networks: - unicove ports: - - "8000:8000" + - '8000:8000' volumes: - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro sveltekit: @@ -15,10 +15,10 @@ services: context: . dockerfile: Dockerfile expose: - - "3000" + - '3000' networks: - unicove restart: always networks: - unicove: \ No newline at end of file + unicove: diff --git a/src/lib/components/chart/rampricehistory.svelte b/src/lib/components/chart/rampricehistory.svelte index 43cf0c9a..c62054eb 100644 --- a/src/lib/components/chart/rampricehistory.svelte +++ b/src/lib/components/chart/rampricehistory.svelte @@ -17,8 +17,6 @@ let { data }: Props = $props(); - console.log({ length: data.length, first20: data.slice(0, 20), last20: data.slice(-20) }); - let ctx: HTMLCanvasElement; let chart: Chart<'line'>; diff --git a/src/lib/components/input/bytes.svelte b/src/lib/components/input/bytes.svelte index 53ae023d..2920792e 100644 --- a/src/lib/components/input/bytes.svelte +++ b/src/lib/components/input/bytes.svelte @@ -44,8 +44,6 @@ return; } - console.log({ value, previousValue, valueSetByParent }); - if (value) { const newInput = String(value / UNIT_MULTIPLIERS[unit]); if (input !== newInput && !isAddingDecimal) { diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index b49e7d79..02900ee8 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -64,10 +64,10 @@ export function parseRicardian(action: ABI.Action | undefined): RicardianData | }; } -export function detectEnvironment(): 'mobile' | 'desktop' { +export function detectEnvironment(): 'mobile' | 'desktop' | undefined { if (typeof window === 'undefined') { - // Server-side rendering, default to desktop - return 'desktop'; + // Server-side rendering + return; } const userAgent = window.navigator.userAgent.toLowerCase(); diff --git a/src/routes/[network]/(account)/signup/+layout.svelte b/src/routes/[network]/(account)/signup/+layout.svelte index 78412fb4..adc8d40a 100644 --- a/src/routes/[network]/(account)/signup/+layout.svelte +++ b/src/routes/[network]/(account)/signup/+layout.svelte @@ -1,11 +1,9 @@ - - + let currentEnvironment = $state(detectEnvironment()); - -

Lets's get started

-

- There are many options to setup your first account, but for new users we recommend the following - wallet for your current platform. Feel free to explore other platforms and wallet options. -

-
+ const currentWalletType = $derived( + currentEnvironment ? walletTypes[currentEnvironment] : undefined + ); + const recommendedWallet = $derived(currentWalletType?.wallets[0]); + const otherWallets = $derived(currentWalletType?.networkWallets(data.network.shortname).slice(1)); - - -
- -
-
-

- {currentWalletType.title} -

-

{currentWalletType.description}

-
- -
-
+ const WalletComponent = $derived(currentWalletType?.icon); + - -
-
- {#if recommendedWallet.logo} - {`${recommendedWallet.name} - {/if} -
-
-

{recommendedWallet.name}

-

{recommendedWallet.description}

-
-
+{#if !recommendedWallet || !currentWalletType || !WalletComponent} - - +

Detecting your environment...

+

Please wait while we determine the best options for you.

-
+{:else} + +

Let's get started

+

+ There are many options to create your first account but we recommend {recommendedWallet.name} for + most people new to EOS. +

+
+ + +
+
+ {`${recommendedWallet.name} +
+
+

{recommendedWallet.name}

+

{recommendedWallet.description}

+ + + +
+
+
+
+ +

Other {currentWalletType?.title}

- -

Why do I need an account?

-

- An account on the blockchain is your unique identity, enabling you to perform transactions, - store assets, and participate in the network. -

-
+ {#if otherWallets} + {#each otherWallets as wallet} + + +
+ {#if wallet.logo} + {`${wallet.name} + {/if} +
+
+

+ {wallet.name} +

+

{wallet.description}

+
+ +
+
+ {/each} + {/if} - -

Why do I need a wallet?

-

- A wallet is your gateway to the blockchain, allowing you to manage your digital assets and - interact with decentralized applications. -

-
+ {#if currentWalletType} + + +
+ {#if currentWalletType.icon} + {@const Component = currentWalletType.icon} + + {/if} +
+
+

More Options

+

+ Choose from {Object.values(walletTypes) + .filter((type) => type.type !== currentWalletType.type) + .map((type) => type.title.toLowerCase()) + .join(', ') + .replace(/,([^,]*)$/, ' and$1')} +

+
+ +
+
+ {/if} +{/if} diff --git a/src/routes/[network]/(account)/signup/walletTypes.ts b/src/routes/[network]/(account)/signup/walletTypes.ts index fd62e291..42703aaf 100644 --- a/src/routes/[network]/(account)/signup/walletTypes.ts +++ b/src/routes/[network]/(account)/signup/walletTypes.ts @@ -14,9 +14,10 @@ export interface Wallet { route: string; description?: string; logo?: string; + supportedNetworks?: string[]; // if empty, all networks are supported } -export interface WalletType { +interface WalletTypeProps { type: 'hardware' | 'desktop' | 'mobile' | 'extensions'; title: string; description: string; @@ -25,6 +26,30 @@ export interface WalletType { wallets: Wallet[]; } +export class WalletType { + readonly type: 'hardware' | 'desktop' | 'mobile' | 'extensions'; + readonly title: string; + readonly description: string; + readonly icon: typeof Icon; + readonly benefits: string[]; + readonly wallets: Wallet[]; + + constructor({ type, title, description, icon, benefits, wallets }: WalletTypeProps) { + this.type = type; + this.title = title; + this.description = description; + this.icon = icon; + this.benefits = benefits; + this.wallets = wallets; + } + + networkWallets(network: string): Wallet[] { + return this.wallets.filter( + (wallet) => !wallet.supportedNetworks || wallet.supportedNetworks.includes(network) + ); + } +} + export const walletTypes: Record = { // webAuths: { // type: 'webAuths', @@ -39,7 +64,7 @@ export const walletTypes: Record = { // ], // wallets: [{ name: 'Anchor Web', route: 'anchor' }] // }, - hardware: { + hardware: new WalletType({ type: 'hardware', title: 'Hardware Wallets', description: 'Hardware wallets are physical devices that securely store your private keys.', @@ -49,11 +74,18 @@ export const walletTypes: Record = { 'Offline storage of private keys', 'Support for multiple cryptocurrencies' ], - wallets: [{ name: 'Ledger', route: 'signup/wallets/hardware/ledger', logo: LedgerLogo }] - }, - desktop: { + wallets: [ + { + name: 'Ledger', + route: 'signup/wallets/hardware/ledger', + logo: LedgerLogo, + supportedNetworks: ['eos', 'jungle4'] + } + ] + }), + desktop: new WalletType({ type: 'desktop', - title: 'Desktop', + title: 'Desktop Wallets', description: 'Desktop wallets are applications that you install on your computer.', icon: LaptopMinimal, benefits: [ @@ -62,16 +94,32 @@ export const walletTypes: Record = { 'Often free to download and use' ], wallets: [ + { + name: 'MetaMask', + route: 'signup/wallets/extensions/metamask', + logo: MetaMaskLogo, + description: 'Secure and easy-to-use browser extension wallet.', + supportedNetworks: ['eos', 'jungle4'] + }, { name: 'Anchor', route: 'signup/wallets/desktop/anchor', logo: AnchorLogo, - description: 'Anchor is a secure and easy-to-use mobile wallet.' + description: + 'Popular option with a user-friendly interface. Supports multiple EOSIO chains.', + supportedNetworks: ['eos', 'jungle4'] }, - { name: 'Wombat', route: 'signup/wallets/desktop/wombat', logo: WombatLogo } + { + name: 'Wombat', + route: 'signup/wallets/desktop/wombat', + logo: WombatLogo, + description: + 'Fast and secure with multi-chain support. Offers a smooth onboarding experience.', + supportedNetworks: ['eos'] + } ] - }, - mobile: { + }), + mobile: new WalletType({ type: 'mobile', title: 'Mobile Wallets', description: 'Mobile wallets are applications you install on your mobile device.', @@ -82,12 +130,32 @@ export const walletTypes: Record = { 'Quick and easy transactions from your smartphone' ], wallets: [ - { name: 'Anchor Mobile', route: 'signup/wallets/mobile/anchor', logo: AnchorLogo }, - { name: 'Wombat Mobile', route: 'signup/wallets/mobile/wombat', logo: WombatLogo }, - { name: 'TokenPocket', route: 'signup/wallets/mobile/tokenpocket', logo: TokenPocketLogo } + { + name: 'Anchor Mobile', + route: 'signup/wallets/mobile/anchor', + logo: AnchorLogo, + description: + 'Popular mobile option with a user-friendly interface. Supports multiple EOSIO chains.', + supportedNetworks: ['eos', 'jungle4'] + }, + { + name: 'Wombat Mobile', + route: 'signup/wallets/mobile/wombat', + logo: WombatLogo, + description: + 'Fast and secure with multi-chain support. Offers a smooth onboarding experience.', + supportedNetworks: ['eos'] + }, + { + name: 'TokenPocket', + route: 'signup/wallets/mobile/tokenpocket', + logo: TokenPocketLogo, + description: 'A leading crypto wallet that supports multiple chains.', + supportedNetworks: ['eos'] + } ] - }, - extensions: { + }), + extensions: new WalletType({ type: 'extensions', title: 'Browser Extensions', description: @@ -103,11 +171,19 @@ export const walletTypes: Record = { name: 'MetaMask', route: 'signup/wallets/extensions/metamask', logo: MetaMaskLogo, - description: 'MetaMask is a secure and easy-to-use browser extension wallet.' + description: 'MetaMask is a secure and easy-to-use browser extension wallet.', + supportedNetworks: ['eos', 'jungle4'] }, - { name: 'Wombat', route: 'signup/wallets/extensions/wombat', logo: WombatLogo } + { + name: 'Wombat', + route: 'signup/wallets/extensions/wombat', + logo: WombatLogo, + description: + 'Fast and secure with multi-chain support. Offers a smooth onboarding experience.', + supportedNetworks: ['eos'] + } ] - } + }) }; export function getWalletTypeFromPath(path: string) { diff --git a/src/routes/[network]/(account)/signup/wallets/+page.svelte b/src/routes/[network]/(account)/signup/wallets/+page.svelte index 5bd0e5cb..f0a7e585 100644 --- a/src/routes/[network]/(account)/signup/wallets/+page.svelte +++ b/src/routes/[network]/(account)/signup/wallets/+page.svelte @@ -7,21 +7,23 @@ const { data } = $props(); -{#snippet walletButton(wallet: WalletType)} - {@const WalletIcon = wallet.icon} +{#snippet walletTypeButton(walletType: WalletType)}
- + {#if walletType.icon} + {@const Component = walletType.icon} + + {/if}

- {wallet.title} + {walletType.title}

-

{wallet.description}

+

{walletType.description}

@@ -30,8 +32,8 @@ hover:bg-mineShaft-950 focus-visible:outline focus-visible:outline-transparent f

Choose A Wallet Type

- {#each Object.values(walletTypes) as wallet} - {@render walletButton(wallet)} + {#each Object.values(walletTypes) as walletType} + {@render walletTypeButton(walletType)} {/each} diff --git a/src/routes/[network]/(account)/signup/wallets/[walletType]/+page.svelte b/src/routes/[network]/(account)/signup/wallets/[walletType]/+page.svelte index be31a3a6..616c978d 100644 --- a/src/routes/[network]/(account)/signup/wallets/[walletType]/+page.svelte +++ b/src/routes/[network]/(account)/signup/wallets/[walletType]/+page.svelte @@ -49,7 +49,7 @@

Available Wallets

- {#each currentWalletType.wallets as wallet} + {#each currentWalletType.networkWallets(data.network.shortname) as wallet} - import { page } from '$app/stores'; - import Button from '$lib/components/button/button.svelte'; + import Pageheader from '$lib/components/pageheader.svelte'; import Stack from '$lib/components/layout/stack.svelte'; - import { walletTypes } from '../../../walletTypes'; - import { ChevronRight } from 'lucide-svelte'; - - const { data } = $props(); - - // const tabOptions = $derived.by(() => { - // const network = String(data.network); - // return Object.entries(walletTypes).map(([key, value]) => ({ - // href: `/${network}/signup/${key}`, - // text: value.title - // })); - // }); - - const defaultWalletType = Object.keys(walletTypes)[0]; - - let currentTab = $derived($page.params.walletType || defaultWalletType); - - // let options = $derived( - // tabOptions.map((option) => ({ - // ...option, - // active: option.href.split('/')[3] === currentTab - // })) - // ); + import Button from '$lib/components/button/button.svelte'; - let currentWalletType = $derived( - walletTypes[currentTab as keyof typeof walletTypes] || walletTypes[defaultWalletType] - ); + let { data } = $props(); - -

Sign Up with {currentWalletType.title}

-

{currentWalletType.description}

-
- - -

Benefits

- -
    - {#each currentWalletType.benefits as benefit} -
  • {benefit}
  • - {/each} -
-
- -

Available Wallets

- - {#each currentWalletType.wallets as wallet} -
-
- {#if wallet.logo} - {wallet.name} - {:else} -
- {/if} -
-
-

- {wallet.name} -

- -
- -
- {/each} + + +
+
    +
  1. +

    Download Wombat

    +

    + Visit your device's app store (Google Play Store for Android or App Store for iOS) to + download the Wombat wallet application. +

    + +
  2. +
  3. +

    Install the App

    +

    + Tap the "Install" button and wait for Wombat to download and install on your device. +

    +
  4. +
  5. +

    Launch Wombat

    +

    + Open the Wombat app by tapping its icon on your device's home screen or app drawer. +

    +
  6. +
  7. +

    Create a New Wallet

    +

    + In Wombat, follow the prompts to create a new wallet. You may need to set up a PIN or use + biometric authentication for security. +

    +
  8. +
  9. +

    Secure Your Wallet

    +

    + Write down your recovery phrase and store it in a safe place. This is crucial for account + recovery and should never be shared. +

    +
  10. +
  11. +

    Visit the Welcome Page

    +

    + Visit the Wombat welcome page for next steps. +

    +
  12. +
- - +
+

Why Choose Wombat?

+
    +
  • User-friendly interface designed for simplicity
  • +
  • Multi-chain support including EOS and other popular blockchains
  • +
  • Built-in dApp browser for easy access to decentralized applications
  • +
  • Fast and secure transactions
  • +
  • Regular updates and new features to enhance user experience
  • +
  • Cross-platform availability (mobile and browser extension)
  • +
  • Smooth onboarding experience for crypto newcomers
  • +
+
+