Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next release #386

Merged
merged 37 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
999c6b0
Moved unstaking above calculator
aaroncox Feb 22, 2025
cb1136e
Use new number component for resources
aaroncox Feb 22, 2025
1029e2f
msig prototype
aaroncox Feb 23, 2025
d46b7f2
Added permission when matching current session
aaroncox Feb 23, 2025
d59678c
Redirect to new account when logging out of current
aaroncox Feb 23, 2025
92dfc65
Show multisig indicator on account
aaroncox Feb 23, 2025
c73b731
Reworked logout logic for better automatic switching
aaroncox Feb 23, 2025
9afd44a
Moved MultiSig plugin to own file
aaroncox Feb 23, 2025
7030041
Moved all Wharf plugins to own file
aaroncox Feb 23, 2025
c9b63ae
Removed unused (?) effect
aaroncox Feb 23, 2025
2af3530
Linting
aaroncox Feb 23, 2025
e50358c
Reworked resources
aaroncox Feb 23, 2025
3aa1ff3
Removed debug link + added more text
aaroncox Feb 23, 2025
a5ce003
Prevent multisig wallet from being a default login option
aaroncox Feb 23, 2025
18a3961
Added account data update timer when in debug mode
aaroncox Feb 23, 2025
0622519
Change default update to 5 seconds
aaroncox Feb 23, 2025
a3a9b3c
Renamed manifest so it won't be picked up
aaroncox Feb 24, 2025
0f0fb0c
Removed reference to manifest
aaroncox Feb 24, 2025
e7926de
Better activity filtering
aaroncox Feb 24, 2025
6adc1c9
Added support for time.eosn contract + msig preference for earliest e…
aaroncox Feb 24, 2025
b758141
Created datetime input
aaroncox Feb 24, 2025
60c3295
Made selected optional
aaroncox Feb 24, 2025
516a569
Removed excess debugging information
aaroncox Feb 24, 2025
0cb57ca
Store result for display
aaroncox Feb 24, 2025
9d64735
Indicator of no authorities
aaroncox Feb 24, 2025
e7704df
Linting
aaroncox Feb 24, 2025
8f58f89
Fixed issue with no rex balance breaking the staking page
aaroncox Feb 24, 2025
6cfe7e9
Went through and updated to wrapped `goto` call
aaroncox Feb 24, 2025
cb69f6f
Update src/routes/[network]/settings/+page.svelte
aaroncox Feb 24, 2025
e692369
Localized account switcher content
aaroncox Feb 24, 2025
5540a00
Linting
aaroncox Feb 24, 2025
df68876
Undo rename
aaroncox Feb 24, 2025
41cebc8
Deleted unused page
aaroncox Feb 24, 2025
7b1ee56
Reverted optional selected option, and force default in settings
aaroncox Feb 24, 2025
dd5dd02
Changing h2 to h4 to reduce emphasis on authorities
aaroncox Feb 24, 2025
39af9c9
Catch when network is not defined and return 404
aaroncox Feb 24, 2025
5f83e6a
Merge pull request #384 from greymass/multisig
aaroncox Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ $(CONTRACTS)/delphioracle.ts:
$(CONTRACTS)/unicove.ts:
bunx @wharfkit/cli generate -u $(CONTRACTS_API) -f $(CONTRACTS)/unicove.ts unicove.gm

codegen: $(CONTRACTS)/system.ts $(CONTRACTS)/token.ts $(CONTRACTS)/msig.ts $(CONTRACTS)/delphioracle.ts $(CONTRACTS)/unicove.ts
$(CONTRACTS)/eosntime.ts:
bunx @wharfkit/cli generate -u $(CONTRACTS_API) -f $(CONTRACTS)/eosntime.ts time.eosn

codegen: $(CONTRACTS)/system.ts $(CONTRACTS)/token.ts $(CONTRACTS)/msig.ts $(CONTRACTS)/delphioracle.ts $(CONTRACTS)/unicove.ts $(CONTRACTS)/eosntime.ts
mkdir -p $(CONTRACTS)

.PHONY: clean
Expand Down
5 changes: 5 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
"common_about_something": "About {thing}",
"common_account": "Actor",
"common_account_balance": "Account Balance",
"common_account_multisig_using_account": "multisig using {account}",
"common_action": "Action",
"common_actions": "Actions",
"common_actor": "Actor",
"common_add_account": "Add Account",
"common_add_funds": "Add Funds",
"common_amount": "Amount",
"common_amount_exceeds_balance": "Amount exceeds available balance.",
Expand All @@ -41,12 +43,14 @@
"common_breakdown": "Breakdown",
"common_buy": "Buy",
"common_bytes": "Bytes",
"common_cancel": "Cancel",
"common_claim": "Claim",
"common_clear": "Clear",
"common_close": "Close",
"common_complete": "Complete",
"common_confirm": "Confirm",
"common_connect_wallet": "Connect Wallet",
"common_connect_wallet_login": "Connect your wallet to login",
"common_contract": "Contract",
"common_copied_result": "Copied!",
"common_copy": "Copy",
Expand All @@ -73,6 +77,7 @@
"common_labeled_unit_staked": "{unit} Staked",
"common_labeled_unit_value": "{unit} Value",
"common_login": "Login",
"common_login_to_unicove": "Login to Unicove",
"common_market_cap": "Market Cap",
"common_memo": "Memo",
"common_must_be_logged_in": "You must be logged in with an account to use this feature.",
Expand Down
3 changes: 3 additions & 0 deletions scripts/env/default/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"features": {
"delphioracle": true,
"directfunding": true,
"eosntime": true,
"giftedram": false,
"lightapi": true,
"metamask": true,
Expand Down Expand Up @@ -42,6 +43,7 @@
"features": {
"delphioracle": false,
"directfunding": false,
"eosntime": false,
"giftedram": true,
"lightapi": false,
"metamask": true,
Expand Down Expand Up @@ -76,6 +78,7 @@
"features": {
"delphioracle": false,
"directfunding": false,
"eosntime": false,
"lightapi": false,
"metamask": false,
"powerup": true,
Expand Down
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" sizes="any" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="Unicove" />
<link rel="manifest" href="/site.webmanifest" />
<!-- <link rel="manifest" href="/site.webmanifest" /> -->
<style>
@font-face {
font-family: 'Inter';
Expand Down
77 changes: 46 additions & 31 deletions src/lib/components/accountswitch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
import UserCheck from 'lucide-svelte/icons/user-check';
import UserPlus from 'lucide-svelte/icons/user-plus';
import Search from 'lucide-svelte/icons/search';
import { goto } from '$app/navigation';
import { languageTag } from '$lib/paraglide/runtime';
import { goto } from '$lib/utils';
import { cn } from '$lib/utils/style';
import Button from './button/button.svelte';
import Text from './input/text.svelte';
Expand Down Expand Up @@ -84,7 +83,7 @@

function redirect(account: NameType) {
if (!context.settings.data.preventAccountPageSwitching) {
goto(`/${languageTag()}/${network}/account/${account}`);
goto(`/${network}/account/${account}`);
}
}

Expand All @@ -94,17 +93,20 @@
closeDrawer();
}

function removeSession(session?: Session | SerializedSession) {
async function removeSession(session?: Session | SerializedSession) {
if (session) {
context.wharf.logout(session);
await context.wharf.logout(session);
if (currentSession) {
redirect(currentSession.actor);
}
}
}

async function connectWallet(wallet: WalletPlugin) {
const options: LoginOptions = {
walletPlugin: wallet.id
};
if (wallet.id !== 'cleos') {
if (wallet.id !== 'cleos' && wallet.id !== 'wallet-plugin-multisig') {
options.chain = context.network.chain;
}
const session = await context.wharf.login(options);
Expand Down Expand Up @@ -207,7 +209,7 @@
<Button onclick={addAccount} variant="secondary" class="grow-0 text-white">
<div class="flex items-center gap-2">
<UserPlus class="mb-0.5 size-5" />
<span>Add Account</span>
<span>{m.common_add_account()}</span>
</div>
</Button>

Expand All @@ -232,7 +234,9 @@

<ul class="grid gap-2">
{#each chainSessions as session}
{@const isCurrent = currentSession?.actor.toString() === session.actor}
{@const isCurrent =
currentSession?.actor.equals(session.actor) &&
currentSession?.permission.equals(session.permission)}
<li class="grid grid-cols-[1fr_auto] gap-2">
<button
data-current={isCurrent}
Expand All @@ -252,9 +256,16 @@
{/if}
</div>

<span class="font-medium">
{session.actor}@{session.permission}
</span>
<div class="text-left font-medium">
<div>{session.actor}@{session.permission}</div>
{#if session.walletPlugin.id === 'wallet-plugin-multisig'}
<div class="text-xs">
↳ {m.common_account_multisig_using_account({
account: session.walletPlugin.data.session.actor
})}
</div>
{/if}
</div>
</button>
<button
onclick={() => removeSession(session)}
Expand Down Expand Up @@ -285,38 +296,42 @@
<hr class="border-mineShaft-900" />

<header class="grid justify-center gap-2 py-4 text-center">
<span class="h4">Login to Unicove</span>
<span class="text-muted text-sm font-medium">Connect your wallet to login</span>
<span class="h4">{m.common_login_to_unicove()}</span>
<span class="text-muted text-sm font-medium">{m.common_connect_wallet_login()}</span>
</header>

{#if context.wharf.sessionKit}
<ul class="grid grid-cols-[auto_1fr_auto]">
{#each context.wharf.sessionKit?.walletPlugins as wallet}
<li class="table-row-background table-row-border col-span-full grid grid-cols-subgrid">
<button
class="col-span-full grid grid-cols-subgrid gap-4 px-2 py-4 font-semibold text-white"
onclick={() => connectWallet(wallet)}
>
{#if wallet.metadata.logo}
<img
class="size-6"
src={wallet.metadata.logo.toString()}
alt={wallet.metadata.name}
/>
{:else}
<Wallet class="size-6" />
{/if}
<span class="text-left">{wallet.metadata.name}</span>
</button>
</li>
{#if wallet.id !== 'wallet-plugin-multisig'}
<li class="table-row-background table-row-border col-span-full grid grid-cols-subgrid">
<button
class="col-span-full grid grid-cols-subgrid gap-4 px-2 py-4 font-semibold text-white"
onclick={() => connectWallet(wallet)}
>
{#if wallet.metadata.logo}
<img
class="size-6"
src={wallet.metadata.logo.toString()}
alt={wallet.metadata.name}
/>
{:else}
<Wallet class="size-6" />
{/if}
<span class="text-left">{wallet.metadata.name}</span>
</button>
</li>
{/if}
{/each}
</ul>
{/if}
<div class="grid">
<!-- <Button href={`/${network}/signup`} onclick={closeDrawer} variant="primary"> -->
<!-- Create account -->
<!-- </Button> -->
<Button class="text-white" onclick={closeAddingAccount} variant="secondary">Cancel</Button>
<Button class="text-white" onclick={closeAddingAccount} variant="secondary"
>{m.common_cancel()}</Button
>
</div>
</div>
{/snippet}
12 changes: 6 additions & 6 deletions src/lib/components/elements/cpunetresource.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<script lang="ts">
import type { Int } from '@wharfkit/antelope';
import ResourceCard from './resourceCard.svelte';

interface Props {
cpuAvailable: number;
netAvailable: number;
precision?: number;
cpuAvailable: Int;
netAvailable: Int;
}

const { cpuAvailable, netAvailable, precision = 2 }: Props = $props();
const { cpuAvailable, netAvailable }: Props = $props();
</script>

<div class="flex gap-px *:flex-1 *:bg-mineShaft-900/70 *:p-4 *:pb-2">
<div class="rounded-l-lg">
<ResourceCard type="cpu" value={cpuAvailable.toFixed(precision)} />
<ResourceCard type="cpu" value={cpuAvailable} />
</div>
<div class="rounded-r-lg">
<ResourceCard type="net" value={netAvailable.toFixed(precision)} />
<ResourceCard type="net" value={netAvailable} />
</div>
</div>
27 changes: 27 additions & 0 deletions src/lib/components/elements/link.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script lang="ts">
import { cn } from '$lib/utils';
import { type Snippet } from 'svelte';
import type { HTMLAnchorAttributes } from 'svelte/elements';

interface Props extends HTMLAnchorAttributes {
href: string;
children?: Snippet;
text?: string;
}

let { href, text = '', children, ...props }: Props = $props();
</script>

<a
{href}
class={cn(
'inline-flex items-center gap-2 text-skyBlue-500 hover:text-skyBlue-400 focus-visible:outline focus-visible:outline-solar-500 ',
props.class
)}
>
{#if children}
{@render children()}
{:else}
{text}
{/if}
</a>
10 changes: 5 additions & 5 deletions src/lib/components/elements/ramresource.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script lang="ts">
import { cn } from '$lib/utils';
import type { Int } from '@wharfkit/antelope';

import { cn } from '$lib/utils';
import ResourceCard from './resourceCard.svelte';

interface Props {
ramAvailable: number;
precision?: number;
ramAvailable: Int;
class?: string;
}

const { ramAvailable, precision = 2, ...props }: Props = $props();
const { ramAvailable, ...props }: Props = $props();
</script>

<div class={cn('rounded-xl bg-mineShaft-900/70 p-4 pb-2', props.class)}>
<ResourceCard type="ram" value={ramAvailable.toFixed(precision)} />
<ResourceCard type="ram" value={ramAvailable} />
</div>
10 changes: 8 additions & 2 deletions src/lib/components/elements/resourceCard.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<script lang="ts">
import type { Int } from '@wharfkit/antelope';
import { type Icon } from 'lucide-svelte';
import CpuIcon from 'lucide-svelte/icons/cpu';
import Wifi from 'lucide-svelte/icons/wifi';
import HardDrive from 'lucide-svelte/icons/hard-drive';

import * as m from '$lib/paraglide/messages';
import NumberFormat from '$lib/components/elements/number.svelte';

interface Props {
type: keyof typeof resourceMap;
value: string;
value: Int;
vertical?: boolean;
}

Expand Down Expand Up @@ -53,7 +56,10 @@
</h3>

<p class="*:block">
<span class="font-semibold text-white">{props.value} {unit}</span>
<span class="font-semibold text-white">
<NumberFormat number={props.value.dividing(1000)} />
{unit}
</span>
<span>{m.common_available()}</span>
</p>
</div>
Loading