Skip to content

Commit 858540b

Browse files
committed
Merge remote-tracking branch 'origin/dev' into web-authenticator
2 parents efbeee8 + 656afce commit 858540b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+984
-270
lines changed

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ $(CONTRACTS)/delphioracle.ts:
4646
$(CONTRACTS)/unicove.ts:
4747
bunx @wharfkit/cli generate -u $(CONTRACTS_API) -f $(CONTRACTS)/unicove.ts unicove.gm
4848

49-
codegen: $(CONTRACTS)/system.ts $(CONTRACTS)/token.ts $(CONTRACTS)/msig.ts $(CONTRACTS)/delphioracle.ts $(CONTRACTS)/unicove.ts
49+
$(CONTRACTS)/eosntime.ts:
50+
bunx @wharfkit/cli generate -u $(CONTRACTS_API) -f $(CONTRACTS)/eosntime.ts time.eosn
51+
52+
codegen: $(CONTRACTS)/system.ts $(CONTRACTS)/token.ts $(CONTRACTS)/msig.ts $(CONTRACTS)/delphioracle.ts $(CONTRACTS)/unicove.ts $(CONTRACTS)/eosntime.ts
5053
mkdir -p $(CONTRACTS)
5154

5255
.PHONY: clean

messages/en.json

+5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
"common_about_something": "About {thing}",
2121
"common_account": "Actor",
2222
"common_account_balance": "Account Balance",
23+
"common_account_multisig_using_account": "multisig using {account}",
2324
"common_action": "Action",
2425
"common_actions": "Actions",
2526
"common_actor": "Actor",
27+
"common_add_account": "Add Account",
2628
"common_add_funds": "Add Funds",
2729
"common_amount": "Amount",
2830
"common_amount_exceeds_balance": "Amount exceeds available balance.",
@@ -41,12 +43,14 @@
4143
"common_breakdown": "Breakdown",
4244
"common_buy": "Buy",
4345
"common_bytes": "Bytes",
46+
"common_cancel": "Cancel",
4447
"common_claim": "Claim",
4548
"common_clear": "Clear",
4649
"common_close": "Close",
4750
"common_complete": "Complete",
4851
"common_confirm": "Confirm",
4952
"common_connect_wallet": "Connect Wallet",
53+
"common_connect_wallet_login": "Connect your wallet to login",
5054
"common_contract": "Contract",
5155
"common_copied_result": "Copied!",
5256
"common_copy": "Copy",
@@ -73,6 +77,7 @@
7377
"common_labeled_unit_staked": "{unit} Staked",
7478
"common_labeled_unit_value": "{unit} Value",
7579
"common_login": "Login",
80+
"common_login_to_unicove": "Login to Unicove",
7681
"common_market_cap": "Market Cap",
7782
"common_memo": "Memo",
7883
"common_must_be_logged_in": "You must be logged in with an account to use this feature.",

scripts/env/default/chains.json

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"features": {
66
"delphioracle": true,
77
"directfunding": true,
8+
"eosntime": true,
89
"giftedram": false,
910
"lightapi": true,
1011
"metamask": true,
@@ -42,6 +43,7 @@
4243
"features": {
4344
"delphioracle": false,
4445
"directfunding": false,
46+
"eosntime": false,
4547
"giftedram": true,
4648
"lightapi": false,
4749
"metamask": true,
@@ -76,6 +78,7 @@
7678
"features": {
7779
"delphioracle": false,
7880
"directfunding": false,
81+
"eosntime": false,
7982
"lightapi": false,
8083
"metamask": false,
8184
"powerup": true,

src/app.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link rel="icon" type="image/svg+xml" href="/favicon.svg" sizes="any" />
1212
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
1313
<meta name="apple-mobile-web-app-title" content="Unicove" />
14-
<link rel="manifest" href="/site.webmanifest" />
14+
<!-- <link rel="manifest" href="/site.webmanifest" /> -->
1515
<style>
1616
@font-face {
1717
font-family: 'Inter';

src/lib/components/accountswitch.svelte

+46-31
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
import UserCheck from 'lucide-svelte/icons/user-check';
2525
import UserPlus from 'lucide-svelte/icons/user-plus';
2626
import Search from 'lucide-svelte/icons/search';
27-
import { goto } from '$app/navigation';
28-
import { languageTag } from '$lib/paraglide/runtime';
27+
import { goto } from '$lib/utils';
2928
import { cn } from '$lib/utils/style';
3029
import Button from './button/button.svelte';
3130
import Text from './input/text.svelte';
@@ -84,7 +83,7 @@
8483
8584
function redirect(account: NameType) {
8685
if (!context.settings.data.preventAccountPageSwitching) {
87-
goto(`/${languageTag()}/${network}/account/${account}`);
86+
goto(`/${network}/account/${account}`);
8887
}
8988
}
9089
@@ -94,17 +93,20 @@
9493
closeDrawer();
9594
}
9695
97-
function removeSession(session?: Session | SerializedSession) {
96+
async function removeSession(session?: Session | SerializedSession) {
9897
if (session) {
99-
context.wharf.logout(session);
98+
await context.wharf.logout(session);
99+
if (currentSession) {
100+
redirect(currentSession.actor);
101+
}
100102
}
101103
}
102104
103105
async function connectWallet(wallet: WalletPlugin) {
104106
const options: LoginOptions = {
105107
walletPlugin: wallet.id
106108
};
107-
if (wallet.id !== 'cleos') {
109+
if (wallet.id !== 'cleos' && wallet.id !== 'wallet-plugin-multisig') {
108110
options.chain = context.network.chain;
109111
}
110112
const session = await context.wharf.login(options);
@@ -207,7 +209,7 @@
207209
<Button onclick={addAccount} variant="secondary" class="grow-0 text-white">
208210
<div class="flex items-center gap-2">
209211
<UserPlus class="mb-0.5 size-5" />
210-
<span>Add Account</span>
212+
<span>{m.common_add_account()}</span>
211213
</div>
212214
</Button>
213215

@@ -232,7 +234,9 @@
232234

233235
<ul class="grid gap-2">
234236
{#each chainSessions as session}
235-
{@const isCurrent = currentSession?.actor.toString() === session.actor}
237+
{@const isCurrent =
238+
currentSession?.actor.equals(session.actor) &&
239+
currentSession?.permission.equals(session.permission)}
236240
<li class="grid grid-cols-[1fr_auto] gap-2">
237241
<button
238242
data-current={isCurrent}
@@ -252,9 +256,16 @@
252256
{/if}
253257
</div>
254258

255-
<span class="font-medium">
256-
{session.actor}@{session.permission}
257-
</span>
259+
<div class="text-left font-medium">
260+
<div>{session.actor}@{session.permission}</div>
261+
{#if session.walletPlugin.id === 'wallet-plugin-multisig'}
262+
<div class="text-xs">
263+
↳ {m.common_account_multisig_using_account({
264+
account: session.walletPlugin.data.session.actor
265+
})}
266+
</div>
267+
{/if}
268+
</div>
258269
</button>
259270
<button
260271
onclick={() => removeSession(session)}
@@ -285,38 +296,42 @@
285296
<hr class="border-mineShaft-900" />
286297

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

292303
{#if context.wharf.sessionKit}
293304
<ul class="grid grid-cols-[auto_1fr_auto]">
294305
{#each context.wharf.sessionKit?.walletPlugins as wallet}
295-
<li class="table-row-background table-row-border col-span-full grid grid-cols-subgrid">
296-
<button
297-
class="col-span-full grid grid-cols-subgrid gap-4 px-2 py-4 font-semibold text-white"
298-
onclick={() => connectWallet(wallet)}
299-
>
300-
{#if wallet.metadata.logo}
301-
<img
302-
class="size-6"
303-
src={wallet.metadata.logo.toString()}
304-
alt={wallet.metadata.name}
305-
/>
306-
{:else}
307-
<Wallet class="size-6" />
308-
{/if}
309-
<span class="text-left">{wallet.metadata.name}</span>
310-
</button>
311-
</li>
306+
{#if wallet.id !== 'wallet-plugin-multisig'}
307+
<li class="table-row-background table-row-border col-span-full grid grid-cols-subgrid">
308+
<button
309+
class="col-span-full grid grid-cols-subgrid gap-4 px-2 py-4 font-semibold text-white"
310+
onclick={() => connectWallet(wallet)}
311+
>
312+
{#if wallet.metadata.logo}
313+
<img
314+
class="size-6"
315+
src={wallet.metadata.logo.toString()}
316+
alt={wallet.metadata.name}
317+
/>
318+
{:else}
319+
<Wallet class="size-6" />
320+
{/if}
321+
<span class="text-left">{wallet.metadata.name}</span>
322+
</button>
323+
</li>
324+
{/if}
312325
{/each}
313326
</ul>
314327
{/if}
315328
<div class="grid">
316329
<!-- <Button href={`/${network}/signup`} onclick={closeDrawer} variant="primary"> -->
317330
<!-- Create account -->
318331
<!-- </Button> -->
319-
<Button class="text-white" onclick={closeAddingAccount} variant="secondary">Cancel</Button>
332+
<Button class="text-white" onclick={closeAddingAccount} variant="secondary"
333+
>{m.common_cancel()}</Button
334+
>
320335
</div>
321336
</div>
322337
{/snippet}

src/lib/components/elements/action.svelte

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import {
33
Action,
4+
Checksum256,
45
Name,
56
PermissionLevel,
67
type ABISerializable,
@@ -66,7 +67,7 @@
6667
</li>
6768
{/each}
6869
</ol>
69-
{:else if isObject}
70+
{:else if isObject && value}
7071
<div class="ml-4">
7172
{#each Object.keys(value) as k}
7273
{@render KeyValue(k, value[k])}
@@ -197,6 +198,9 @@
197198
{:else if variant === 'json'}
198199
{@render CodeBox(action)}
199200
{/if}
201+
{#if objectified && objectified.code}
202+
{@render Pretty({ hash: String(Checksum256.hash(objectified.code)) })}
203+
{/if}
200204
{#if variant !== 'summary'}
201205
{@render Footer()}
202206
{/if}
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<script lang="ts">
2+
import type { Int } from '@wharfkit/antelope';
23
import ResourceCard from './resourceCard.svelte';
34
45
interface Props {
5-
cpuAvailable: number;
6-
netAvailable: number;
7-
precision?: number;
6+
cpuAvailable: Int;
7+
netAvailable: Int;
88
}
99
10-
const { cpuAvailable, netAvailable, precision = 2 }: Props = $props();
10+
const { cpuAvailable, netAvailable }: Props = $props();
1111
</script>
1212

1313
<div class="flex gap-px *:flex-1 *:bg-mineShaft-900/70 *:p-4 *:pb-2">
1414
<div class="rounded-l-lg">
15-
<ResourceCard type="cpu" value={cpuAvailable.toFixed(precision)} />
15+
<ResourceCard type="cpu" value={cpuAvailable} />
1616
</div>
1717
<div class="rounded-r-lg">
18-
<ResourceCard type="net" value={netAvailable.toFixed(precision)} />
18+
<ResourceCard type="net" value={netAvailable} />
1919
</div>
2020
</div>
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script lang="ts">
2+
import { cn } from '$lib/utils';
3+
import { type Snippet } from 'svelte';
4+
import type { HTMLAnchorAttributes } from 'svelte/elements';
5+
6+
interface Props extends HTMLAnchorAttributes {
7+
href: string;
8+
children?: Snippet;
9+
text?: string;
10+
}
11+
12+
let { href, text = '', children, ...props }: Props = $props();
13+
</script>
14+
15+
<a
16+
{href}
17+
class={cn(
18+
'inline-flex items-center gap-2 text-skyBlue-500 hover:text-skyBlue-400 focus-visible:outline focus-visible:outline-solar-500 ',
19+
props.class
20+
)}
21+
>
22+
{#if children}
23+
{@render children()}
24+
{:else}
25+
{text}
26+
{/if}
27+
</a>
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<script lang="ts">
2-
import { cn } from '$lib/utils';
2+
import type { Int } from '@wharfkit/antelope';
33
4+
import { cn } from '$lib/utils';
45
import ResourceCard from './resourceCard.svelte';
56
67
interface Props {
7-
ramAvailable: number;
8-
precision?: number;
8+
ramAvailable: Int;
99
class?: string;
1010
}
1111
12-
const { ramAvailable, precision = 2, ...props }: Props = $props();
12+
const { ramAvailable, ...props }: Props = $props();
1313
</script>
1414

1515
<div class={cn('rounded-xl bg-mineShaft-900/70 p-4 pb-2', props.class)}>
16-
<ResourceCard type="ram" value={ramAvailable.toFixed(precision)} />
16+
<ResourceCard type="ram" value={ramAvailable} />
1717
</div>

src/lib/components/elements/resourceCard.svelte

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<script lang="ts">
2+
import type { Int } from '@wharfkit/antelope';
23
import { type Icon } from 'lucide-svelte';
34
import CpuIcon from 'lucide-svelte/icons/cpu';
45
import Wifi from 'lucide-svelte/icons/wifi';
56
import HardDrive from 'lucide-svelte/icons/hard-drive';
7+
68
import * as m from '$lib/paraglide/messages';
9+
import NumberFormat from '$lib/components/elements/number.svelte';
710
811
interface Props {
912
type: keyof typeof resourceMap;
10-
value: string;
13+
value: Int;
1114
vertical?: boolean;
1215
}
1316
@@ -53,7 +56,10 @@
5356
</h3>
5457

5558
<p class="*:block">
56-
<span class="font-semibold text-white">{props.value} {unit}</span>
59+
<span class="font-semibold text-white">
60+
<NumberFormat number={props.value.dividing(1000)} />
61+
{unit}
62+
</span>
5763
<span>{m.common_available()}</span>
5864
</p>
5965
</div>

0 commit comments

Comments
 (0)