@meddleware/seal-ui 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meddleware/seal-ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Standalone Vue 3 SPA for Sealed Storage — client-side Seal encryption + access-gated, decentralised Walrus storage on Sui.",
5
5
  "author": "MeddleWare <meddleware@proton.me>",
6
6
  "license": "0BSD",
@@ -40,7 +40,7 @@
40
40
  "@meddleware/design-tokens": "^0.1.2",
41
41
  "@meddleware/seal-client": "^0.0.2",
42
42
  "@meddleware/ui": "^0.1.6",
43
- "@meddleware/wallet-adapter": "^0.0.2",
43
+ "@meddleware/wallet-adapter": "^0.0.3",
44
44
  "@mysten/seal": "^1.4.7",
45
45
  "@mysten/sui": "^2.28.0",
46
46
  "@mysten/wallet-standard": "^0.20.0",
@@ -15,13 +15,14 @@ import {
15
15
  type SealPolicyProvider,
16
16
  type SealedContentPointer,
17
17
  } from '@meddleware/seal-client'
18
+ import { WalletGuard } from '@meddleware/wallet-adapter'
18
19
  import { useWallet } from '../wallet.js'
19
20
  import { registry, getSealController } from '../seal.js'
20
21
  import { storeBlob, readBlob } from '../walrus.js'
21
22
  import { discoverSealedContent } from '../sealed-content.js'
22
23
  import { NETWORK, MAINNET_PENDING, SEAL_CONFIGURED, SEAL_PACKAGE_ID } from '../config.js'
23
24
 
24
- const { wallets, account, connect, disconnect, signPersonalMessage, signAndExecute } = useWallet()
25
+ const { account, signPersonalMessage, signAndExecute } = useWallet()
25
26
 
26
27
  const providers = registry.list() as SealPolicyProvider[]
27
28
  const disabled = computed(() => MAINNET_PENDING || !SEAL_CONFIGURED)
@@ -265,10 +266,6 @@ async function performUnlock(item: SealedContentPointer): Promise<void> {
265
266
  }
266
267
  }
267
268
 
268
- const shortAddr = computed(() => {
269
- const a = account.value?.address
270
- return a ? `${a.slice(0, 6)}…${a.slice(-4)}` : ''
271
- })
272
269
  </script>
273
270
 
274
271
  <template>
@@ -284,28 +281,7 @@ const shortAddr = computed(() => {
284
281
  (<code>VITE_SEAL_PACKAGE_ID_*</code> / <code>VITE_SEAL_SERVER_OBJECT_IDS_*</code>).
285
282
  </div>
286
283
 
287
- <section class="card" style="display:flex;align-items:center;justify-content:space-between;gap:1rem">
288
- <template v-if="account">
289
- <span class="muted">Connected: {{ shortAddr }}</span>
290
- <button class="link" @click="disconnect">Disconnect</button>
291
- </template>
292
- <template v-else>
293
- <span class="muted">Wallet needed only to decrypt.</span>
294
- <span>
295
- <button
296
- v-for="w in wallets"
297
- :key="w.name"
298
- class="primary"
299
- style="margin-left:0.4rem"
300
- @click="connect(w)"
301
- >
302
- Connect {{ w.name }}
303
- </button>
304
- <span v-if="!wallets.length" class="muted">No Sui wallet detected.</span>
305
- </span>
306
- </template>
307
- </section>
308
-
284
+ <WalletGuard message="Connect a Sui wallet to encrypt and decrypt sealed content.">
309
285
  <nav class="tabs">
310
286
  <button :class="{ active: tab === 'encrypt' }" @click="tab = 'encrypt'">Encrypt</button>
311
287
  <button :class="{ active: tab === 'decrypt' }" @click="tab = 'decrypt'">Decrypt</button>
@@ -449,6 +425,7 @@ const shortAddr = computed(() => {
449
425
  Decryption keys are released by a threshold committee of independent key servers. If enough
450
426
  servers are unreachable, decryption pauses — storage and retrieval are unaffected.
451
427
  </p>
428
+ </WalletGuard>
452
429
  </div>
453
430
  </template>
454
431
 
package/src/config.ts CHANGED
@@ -30,16 +30,32 @@ export const SEAL_PACKAGE_ID: string =
30
30
  ? '0x9f0563bfe42fbd29932cd280cc47efe17f5339b4dc569eb110114665eecc231e'
31
31
  : '')
32
32
 
33
- /** Threshold `t` in the t-of-n committee (default 2). */
33
+ /** Threshold `t` in the t-of-n committee (default 2 — matches the 3-server testnet default). */
34
34
  export const SEAL_THRESHOLD = Number(env.VITE_SEAL_THRESHOLD || '2')
35
35
 
36
36
  /**
37
37
  * The key-server committee. Object ids and aggregator URLs are supplied as parallel CSV lists
38
- * (index-aligned); aggregatorUrl is required for committee-mode servers.
38
+ * (index-aligned); aggregatorUrl is required for decentralized (committee-type) servers only —
39
+ * independent servers derive their URL from the on-chain object and do not need one.
40
+ *
41
+ * Defaults are the three verified Mysten Labs testnet servers:
42
+ * [0] Decentralized (Mysten) — requires aggregatorUrl
43
+ * [1] Independent server 1
44
+ * [2] Independent server 2
45
+ * Override via VITE_SEAL_SERVER_OBJECT_IDS_TESTNET / VITE_SEAL_AGGREGATOR_URLS_TESTNET.
39
46
  */
40
47
  export const SEAL_SERVERS: KeyServerConfig[] = (() => {
41
- const ids = csv(netEnv('VITE_SEAL_SERVER_OBJECT_IDS'))
42
- const aggs = csv(netEnv('VITE_SEAL_AGGREGATOR_URLS'))
48
+ const defaultIds = [
49
+ '0xb012378c9f3799fb5b1a7083da74a4069e3c3f1c93de0b27212a5799ce1e1e98',
50
+ '0x73d05d62c18d9374e3ea529e8e0ed6161da1a141a94d3f76ae3fe4e99356db75',
51
+ '0xf5d14a81a982144ae441cd7d64b09027f116a468bd36e7eca494f750591623c8',
52
+ ]
53
+ const defaultAggs = ['https://seal-aggregator-testnet.mystenlabs.com']
54
+
55
+ const envIds = csv(netEnv('VITE_SEAL_SERVER_OBJECT_IDS'))
56
+ const envAggs = csv(netEnv('VITE_SEAL_AGGREGATOR_URLS'))
57
+ const ids = envIds.length > 0 ? envIds : (NETWORK === 'testnet' ? defaultIds : [])
58
+ const aggs = envAggs.length > 0 ? envAggs : (NETWORK === 'testnet' ? defaultAggs : [])
43
59
  return ids.map((objectId, i) => ({ objectId, weight: 1, aggregatorUrl: aggs[i] }))
44
60
  })()
45
61