Skip to content

Commit

Permalink
Merge pull request #278 from greymass/dev
Browse files Browse the repository at this point in the history
Next Release
  • Loading branch information
aaroncox authored Nov 30, 2024
2 parents 1d4000b + 22eba7f commit 41d17c9
Show file tree
Hide file tree
Showing 75 changed files with 1,592 additions and 886 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ on:
env:
PUBLIC_ENVIRONMENT: 'development'
PUBLIC_LOCAL_SIGNER: ''
PUBLIC_ACCOUNT_UPDATE_INTERVAL: 3000
PUBLIC_NETWORK_UPDATE_INTERVAL: 3000
PUBLIC_METAMASK_SNAP_ORIGIN: 'npm:@greymass/eos-wallet'
PUBLIC_METAMASK_SERVICE_URL: 'https://eos.account.unicove.com/buy'
API_EOS_CHAIN: ''
API_EOS_HISTORY: ''
API_EOS_LIGHTAPI: ''
API_EOS_METRICS: ''
API_JUNGLE4_CHAIN: ''
API_JUNGLE4_HISTORY: ''
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Add a `.env` file to the root of the project with the following content:
PUBLIC_LOCAL_SIGNER=""
API_EOS_HISTORY=https://eos.greymass.com
API_EOS_CHAIN=https://eos.greymass.com
API_EOS_LIGHTAPI=https://eos.light-api.net
API_JUNGLE4_HISTORY=https://jungle4.greymass.com
API_JUNGLE4_CHAIN=https://jungle4.greymass.com
API_KYLIN_HISTORY=https://kylintestnet.greymass.com
Expand Down
Binary file modified bun.lockb
Binary file not shown.
88 changes: 86 additions & 2 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,75 @@
"active_session": "Active Session",
"block_height_numbered": "Block #{height}",
"block_height_numbered_description": "Block #{height} was produced by {producer} on {timestamp}, which included {transactions} transactions performing {actions} actions.",
"common_about_something": "About {thing}",
"common_action": "Action",
"common_amount_exceeds_balance": "Amount exceeds available balance.",
"common_amount_to_act": "Amount to {action}",
"common_apr_current": "Current APR",
"common_asset": "Asset",
"common_back": "Back",
"common_balance": "Balance",
"common_buy": "Buy",
"common_bytes": "Bytes",
"common_clear": "Clear",
"common_close": "Close",
"common_complete": "Complete",
"common_confirm": "Confirm",
"common_date_available": "Date Available",
"common_debugging": "Debugging",
"common_details": "Details",
"common_error": "Error",
"common_expected_receive": "Expected to receive",
"common_fill_max": "Fill Max",
"common_invalid_number_decimals": "Invalid number, too many decimal places.",
"common_labeled_unit_available": "{unit} Available",
"common_labeled_unit_balance": "{unit} Balance",
"common_labeled_unit_price": "{unit} Price",
"common_labeled_unit_staked": "{unit} Staked",
"common_labeled_unit_value": "{unit} Value",
"common_market_cap": "Market Cap",
"common_memo": "Memo",
"common_network_fees": "Network Fees",
"common_next": "Next",
"common_not_logged_in": "Not logged in",
"common_optional": "Optional",
"common_recent_activity": "Recent Activity",
"common_recipient": "Recipient",
"common_refund": "Refund",
"common_refund_tokens": "Claim previously delegated {token} tokens",
"common_refunding": "Refunding",
"common_restart": "Restart",
"common_search": "Search...",
"common_search_unicove": "Search Unicove",
"common_search_instructions": "Search for Unicove features or enter an account name, public key, or transaction ID on the network.",
"common_search_no_results": "No results found",
"common_search_results": "Search Results",
"common_search_unicove": "Search Unicove",
"common_sell": "Sell",
"common_stake": "Stake",
"common_stake_tokens": "Stake {token} Tokens",
"common_staked": "Staked",
"common_staked_currently": "Currently staked",
"common_staking": "Staking",
"common_submit": "Submit",
"common_supply": "Supply",
"common_timeframe_daily": "Daily",
"common_timeframe_monthly": "Monthly",
"common_timeframe_yearly": "Yearly",
"common_tokens": "tokens",
"common_total_cost": "Total Cost",
"common_transaction_complete": "Transaction Complete",
"common_transaction_error": "Transaction Error",
"common_transaction_error_subtitle": "There was an error submitting your transaction.",
"common_unit_buy": "Buy {unit}",
"common_unit_sell": "Sell {unit}",
"common_unstake": "Unstake",
"common_unstake_tokens": "Unstake {token} tokens",
"common_unstaked": "Unstaked",
"common_unstaking": "Unstaking",
"common_value_with_amount": "Value: {amount}",
"common_withdraw": "Withdraw",
"common_withdraw_tokens": "Withdraw {token} tokens from staking",
"common_withdrawable_currently": "Currently Withdrawable",
"contract_abi_page_description": "The ABI defining the {contract} smart contract on the {network} network.",
"contract_abi_page_title": "ABI",
"contract_action_view_description": "The {action} action for the {contract} smart contract on the {network} network.",
Expand All @@ -49,13 +90,30 @@
"contract_tables_view_title": "Table: {table}",
"contract_view_description": "An overview of the {contract} smart contract on the {network} network. This contract contains {actions} actions, {tables} tables, and {structs} structs.",
"contract_view_title": "Contract: {contract} | {network}",
"delegation_metadata_refund_description": "Claim previously delegated {network} tokens.",
"delegation_metadata_refund_title": "Refund Delegated {network} Tokens",
"error_loading_accounts": "Error loading accounts: {error}",
"form_validation_insufficient_balance": "Insufficient {unit} balance. Please enter a smaller amount.",
"form_validation_invalid_number_decimals": "Invalid number, too many decimal places.",
"key_page_description": "A public key associated with {accounts} account(s) on the {network} network.",
"key_page_subtitle": "The {accounts} account(s) associated with this public key",
"key_page_title": "Public Key",
"legacy_key": "Legacy Key",
"loading_accounts": "Loading accounts...",
"no_accounts_found": "No accounts found",
"ram_available_balance": "RAM Available",
"ram_form_buy_amount": "Amount of RAM to buy:",
"ram_metadata_buy_description": "Exchange {token} for RAM on the {network} network using an {network} compatible wallet.",
"ram_metadata_buy_title": "{token}/RAM Market | {network} Network",
"ram_metadata_overview_description": "An overview of RAM Market on the {network} network that provides access to buy and sell RAM with {token} using an {network} compatible wallet.",
"ram_metadata_sell_description": "Exchange RAM for {token} on the {network} network using an {network} compatible wallet.",
"ram_page_sell_subtitle": "Exchange RAM for {token} on the {network} network.",
"ram_page_subtitle": "Exchange {token} for RAM on the {network} network.",
"ram_purchase_value": "RAM Purchase Value",
"ram_sale_value": "Amount of RAM to sell:",
"ram_to_purchase": "RAM to be bought",
"ram_to_sell": "RAM to be sold",
"search_view_type": "View {type}",
"send_amount_to_send": "Amount to send",
"send_enter_amount": "Enter the amount of {token} to send",
"send_memo_placeholder": "Specify a public memo for this transfer (optional)",
Expand All @@ -64,5 +122,31 @@
"send_receiving_placeholder": "Enter the account name of the recipient",
"send_start_new": "Start new send",
"send_tokens_to_send": "Token to send",
"test_locale_string": "This is a test"
"settings_advanced": "Advanced",
"settings_developer": "Developer",
"settings_enable_advanced": "Enable Advanced Options",
"settings_enable_advanced_desc": "Manage network resources, enhanced asset precision, etc.",
"settings_enable_developer": "Enable Developer Mode",
"settings_enable_developer_desc": "Show raw data used for development and debugging",
"settings_general": "General",
"settings_language_selector": "Language Selector",
"settings_prevent_account_page_switching": "Remain on current page when switching accounts",
"settings_prevent_account_page_switching_desc": "Prevents the automatic navigation to the account overview page",
"settings_search_account_switch": "Allow account switching in search prompt",
"settings_search_account_switch_desc": "Adds logged in accounts to search results for quick switching.",
"settings_search_show_pages": "Allow page navigation in search prompt",
"settings_search_show_pages_desc": "Adds popular Unicove pages to search results.",
"staking_calculator": "Staking Calculator",
"staking_calculator_description": "Enter an amount of {token} to calculate estimated rewards based\t\ton the current APR of {apr}%. This rate will change over time based on the amount of tokens\t\tstaked.",
"staking_estimated_yield_yearly": "Estimated Yield (Yearly)",
"staking_metadata_overview_description": "An overview of staking on the {network} network providing easy access to stake, unstake, and withdraw {token} tokens using an {network} compatible wallet.",
"staking_metadata_stake_description": "Stake {token} tokens and earn rewards using an {network} compatible wallet.",
"staking_metadata_unstake_description": "Unstake {token} tokens and begin claiming the balance of your rewards using an {network} compatible wallet.",
"staking_metadata_withdraw_description": "Withdraw {token} tokens from the staking contract to add them to your available balance using an {network} compatible wallet.",
"staking_minimum_lockup": "Minimum lockup",
"staking_network_subtitle": "Stake {token} to earn rewards.",
"staking_network_title": "{network} Network Staking",
"staking_withdraw_timeframe": "Withdrawable in 21 days",
"test_locale_string": "This is a test",
"total_proceeds": "Total Proceeds"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@tailwindcss/container-queries": "^0.1.1",
"@wharfkit/account": "^1.2.0",
"@wharfkit/account-creation-plugin-greymass": "^1.2.0",
"@wharfkit/account-creation-plugin-metamask": "^1.0.0",
"@wharfkit/account-creation-plugin-metamask": "^1.0.2",
"@wharfkit/antelope": "^1.0.11",
"@wharfkit/common": "^1.4.0",
"@wharfkit/contract": "^1.1.5",
Expand Down
10 changes: 3 additions & 7 deletions src/lib/components/accountswitch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { createDialog, melt } from '@melt-ui/svelte';
import { Session, type SerializedSession } from '@wharfkit/session';
import { chainLogos } from '@wharfkit/common';
import { getSetting } from '$lib/state/settings.svelte';
import type { UnicoveContext } from '$lib/state/client.svelte';
import type { NetworkState } from '$lib/state/network.svelte';
Expand All @@ -21,9 +20,6 @@
const context = getContext<UnicoveContext>('state');
const { value: preventAccountPageSwitch } = getSetting('prevent-account-page-switching', false);
const advancedMode = $derived(getSetting('advanced-mode', false).value);
interface PageProps {
class?: string;
network: NetworkState;
Expand All @@ -45,7 +41,7 @@
function switchSession(session: SerializedSession) {
context.wharf.switch(session);
if (!preventAccountPageSwitch) {
if (!context.settings.data.preventAccountPageSwitching) {
goto(`/${languageTag()}/${network}/account/${session.actor}`);
}
closeDrawer();
Expand Down Expand Up @@ -142,13 +138,13 @@
}}
>
<section
data-advanced={advancedMode}
data-advanced={context.settings.data.advancedMode}
class="flex flex-row-reverse justify-between gap-2 data-[advanced=false]:items-center md:gap-4"
>
<button
use:melt={$close}
aria-label="Close"
data-advanced={advancedMode}
data-advanced={context.settings.data.advancedMode}
class="text-muted grid size-12 appearance-none place-items-center rounded-lg focus:text-white focus:outline-none md:data-[advanced=false]:pt-0 md:data-[advanced=true]:pt-2.5"
>
<X class="size-4 " />
Expand Down
22 changes: 22 additions & 0 deletions src/lib/components/breakdown/breakdown.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script lang="ts">
import { Stack } from '$lib/components/layout';
import type { Snippet } from 'svelte';
interface Props {
children: Snippet;
isCurrentUser?: boolean;
}
let props: Props = $props();
</script>

<Stack class="gap-2 @container">
<h5 class="h5">Breakdown</h5>
{#if props.isCurrentUser}
<div class="grid grid-cols-3 gap-0">
{@render props.children()}
</div>
{:else}
<div class="grid grid-cols-2 gap-0">
{@render props.children()}
</div>
{/if}
</Stack>
48 changes: 48 additions & 0 deletions src/lib/components/breakdown/breakdownRow.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<script lang="ts">
import { Asset } from '@wharfkit/antelope';
import AssetText from '$lib/components/elements/asset.svelte';
import { cn } from '$lib/utils';
type BreakdownAction = {
href: string;
text: string;
visible?: boolean;
};
interface Props {
key: string;
value: Asset | undefined;
action?: BreakdownAction;
}
let { key, value, action }: Props = $props();
const isTotal = key === 'Total';
</script>

<div
class={cn(
'col-span-full grid min-h-12 grid-cols-subgrid items-center gap-x-4 border-b border-mineShaft-900 last:border-none ',
isTotal && 'font-semibold'
)}
>
<div
class="col-start-1 col-end-3 row-start-1 flex flex-col py-2 @xs:flex-row @xs:justify-between"
>
<div class="text-muted">{key}</div>
<div class="text-white">
<AssetText class="text-nowrap" variant="full" {value} />
</div>
</div>

{#if action && action.visible}
<div class="col-span-2 col-start-2 row-start-1 text-right @xs:col-span-1 @xs:col-start-3">
<a
class="inline-block h-12 content-center text-skyBlue-500 hover:text-skyBlue-400"
href={action.href}
>
{action.text}
</a>
</div>
{/if}
</div>
2 changes: 2 additions & 0 deletions src/lib/components/breakdown/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Breakdown } from './breakdown.svelte';
export { default as BreakdownRow } from './breakdownRow.svelte';
11 changes: 6 additions & 5 deletions src/lib/components/button/copy.svelte
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<script lang="ts">
import { getSetting } from '$lib/state/settings.svelte';
import Copy from 'lucide-svelte/icons/copy';
import { quadIn, quartOut } from 'svelte/easing';
import { fade, fly } from 'svelte/transition';
import { browser } from '$app/environment';
import type { UnicoveContext } from '$lib/state/client.svelte';
import { getContext } from 'svelte';
const context = getContext<UnicoveContext>('state');
interface Props {
data: string;
}
let { value: debugMode } = getSetting('debug-mode', false);
let props: Props = $props();
let hint = $state(false);
async function copyToClipboard() {
try {
await navigator.clipboard.writeText(props.data);
if (debugMode) console.log(props.data, 'copied to clipboard');
if (context.settings.data.debugMode) console.log(props.data, 'copied to clipboard');
hint = true;
setTimeout(() => (hint = false), 300);
} catch (err) {
if (debugMode) console.error('Failed to copy text: ', err);
if (context.settings.data.debugMode) console.error('Failed to copy text: ', err);
}
}
</script>
Expand Down
48 changes: 48 additions & 0 deletions src/lib/components/card/accountbalance.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<script lang="ts">
import { getContext } from 'svelte';
import type { UnicoveContext } from '$lib/state/client.svelte';
import { Card, Stack } from '$lib/components/layout';
import Button from '$lib/components/button/button.svelte';
import Chip from '$lib/components/chip.svelte';
import AssetText from '$lib/components/elements/asset.svelte';
const context = getContext<UnicoveContext>('state');
interface Props {
cta?: {
label: string;
href: string;
};
title?: string;
}
const { cta, title = 'Account Balance' }: Props = $props();
</script>

<Card {title}>
<Stack>
<Stack class="gap-2">
<h4 class="text-muted text-base leading-none">Available</h4>
<p class="text-xl font-semibold leading-none text-white">
{#if context.account}
<AssetText variant="full" value={context.account?.balance?.liquid} />
{:else}
Not logged in
{/if}
</p>
{#if context.account?.value?.liquid}
<Chip>
<AssetText variant="full" value={context.account?.value?.liquid} />
<!-- TODO: Percent change -->
</Chip>
{/if}
</Stack>

{#if cta}
<Stack class="gap-2">
<Button href={cta.href}>{cta.label}</Button>
</Stack>
{/if}
</Stack>
</Card>
6 changes: 4 additions & 2 deletions src/lib/components/descriptionlist.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts">
import type { Snippet } from 'svelte';
type DescriptionItem = {
key: string;
value: string;
value: string | Snippet;
};
interface Props {
Expand All @@ -17,7 +19,7 @@
class="flex flex-wrap items-center justify-between gap-x-4 border-b border-mineShaft-900 py-3 *:grow last:border-none"
>
<dt class="caption">{item.key}</dt>
<dd class="text-right tabular-nums">{item.value}</dd>
<dd class="text-balance break-all text-right tabular-nums">{item.value}</dd>
</div>
{/each}
</dl>
Loading

0 comments on commit 41d17c9

Please sign in to comment.