@meddleware/seal-ui 0.0.6 → 0.0.8

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.6",
3
+ "version": "0.0.8",
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",
@@ -39,10 +39,10 @@
39
39
  "dependencies": {
40
40
  "@meddleware/design-tokens": "^0.1.2",
41
41
  "@meddleware/seal-client": "^0.0.2",
42
- "@meddleware/ui": "^0.1.6",
43
- "@meddleware/wallet-adapter": "^0.0.4",
42
+ "@meddleware/ui": "^0.1.9",
43
+ "@meddleware/wallet-adapter": "^0.0.5",
44
44
  "@mysten/seal": "^1.4.7",
45
- "@mysten/sui": "^2.28.0",
45
+ "@mysten/sui": "^2.30.0",
46
46
  "@mysten/wallet-standard": "^0.20.0",
47
47
  "vue": "^3.5.40"
48
48
  },
package/src/seal.ts CHANGED
@@ -19,7 +19,7 @@ export async function getSealController(): Promise<SealController> {
19
19
  const { SealController } = await import('@meddleware/seal-client/controller')
20
20
  controller = new SealController(
21
21
  {
22
- suiClient: getSuiClient(NETWORK),
22
+ suiClient: getSuiClient(),
23
23
  packageId: SEAL_PACKAGE_ID,
24
24
  threshold: SEAL_THRESHOLD,
25
25
  serverConfigs: SEAL_SERVERS,
package/src/wallet.ts CHANGED
@@ -1,20 +1,22 @@
1
1
  // Thin seal-ui shim over the shared @meddleware/wallet-adapter singleton.
2
2
  //
3
- // The adapter is network-agnostic (RPC URL passed per call); this shim binds seal-ui's RPC_URLS
4
- // so call sites keep the ergonomics (`getSuiClient()` defaulting to the active network,
5
- // `signAndExecute(tx)`). Because the adapter is a module singleton, the wallet connection is
6
- // shared with any other tool view rendered in the same window (e.g. the dashboard).
3
+ // RPC URL is resolved from the runtime useNetwork() singleton so network switching
4
+ // in the dashboard propagates immediately to all tool views. Because the adapter is a
5
+ // module singleton, the wallet connection is shared with any other tool view rendered
6
+ // in the same window (e.g. the dashboard).
7
7
  import {
8
8
  useWallet as useWalletBase,
9
9
  getSuiClient as getSuiClientBase,
10
10
  buildExecutor as buildExecutorBase,
11
+ useNetwork,
11
12
  } from '@meddleware/wallet-adapter'
12
13
  import type { Transaction } from '@mysten/sui/transactions'
13
- import { NETWORK, RPC_URLS, type Network } from './config.js'
14
14
 
15
- /** Memoised Sui JSON-RPC client for the network (defaults to the active network). */
16
- export function getSuiClient(network: Network = NETWORK) {
17
- return getSuiClientBase(network, RPC_URLS[network])
15
+ const { network, rpcUrl } = useNetwork()
16
+
17
+ /** Memoised Sui gRPC client for the currently selected network. */
18
+ export function getSuiClient() {
19
+ return getSuiClientBase(network.value, rpcUrl.value)
18
20
  }
19
21
 
20
22
  /** Sign a personal message with the connected wallet (mints a Seal SessionKey). */
@@ -23,11 +25,8 @@ export function signPersonalMessage(message: Uint8Array): Promise<{ signature: s
23
25
  }
24
26
 
25
27
  /** Sign + execute a PTB with the connected wallet, returning the transaction digest. */
26
- export async function signAndExecute(
27
- tx: Transaction,
28
- network: Network = NETWORK,
29
- ): Promise<{ digest: string }> {
30
- const executor = await buildExecutorBase(network, RPC_URLS[network])
28
+ export async function signAndExecute(tx: Transaction): Promise<{ digest: string }> {
29
+ const executor = await buildExecutorBase(network.value, rpcUrl.value)
31
30
  return executor.signAndExecute(tx)
32
31
  }
33
32