@meddleware/token-deployer-ui 0.0.9 → 0.0.10

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/.env.example CHANGED
@@ -16,12 +16,11 @@ VITE_FEE_MIST=1000000000
16
16
  VITE_FEE_TREASURY_TESTNET=0xe6b2810abfc5a6f37a375f73e3ba76cfc37584196e453255ad3c9ca2f0ede0ed
17
17
  VITE_FEE_TREASURY_MAINNET=0xe6b2810abfc5a6f37a375f73e3ba76cfc37584196e453255ad3c9ca2f0ede0ed
18
18
 
19
- # Optional RPC overrides. Set a paid/private endpoint for production to avoid public
20
- # rate limits. NOTE: the official testnet fullnode (fullnode.testnet.sui.io) is gRPC-only
21
- # and 404s for JSON-RPC — use a JSON-RPC-capable endpoint for testnet (the app defaults to
22
- # https://sui-testnet-rpc.publicnode.com). The same VITE_RPC_TESTNET is what the real-chain
23
- # e2e (npm run e2e:testnet) builds against; point E2E_RPC at the same endpoint.
24
- # VITE_RPC_TESTNET=https://sui-testnet-rpc.publicnode.com
19
+ # Optional gRPC fullnode overrides. Set a paid/private endpoint for production to avoid
20
+ # public rate limits. These must be gRPC(-web) endpoints — public fullnodes have deprecated
21
+ # JSON-RPC. The same VITE_RPC_TESTNET is what the real-chain e2e (npm run e2e:testnet)
22
+ # builds against; point E2E_RPC at the same endpoint.
23
+ # VITE_RPC_TESTNET=https://fullnode.testnet.sui.io:443
25
24
  # VITE_RPC_MAINNET=https://fullnode.mainnet.sui.io:443
26
25
 
27
26
  # Optional publish gas budget (MIST).
@@ -35,10 +34,8 @@ VITE_FEE_TREASURY_MAINNET=0xe6b2810abfc5a6f37a375f73e3ba76cfc37584196e453255ad3c
35
34
  # VITE_WALRUS_RELAY_TESTNET=https://sui-walrus-relay-testnet.meddleware.co.uk
36
35
  # VITE_WALRUS_RELAY_MAINNET=https://sui-walrus-relay.meddleware.co.uk
37
36
 
38
- # gRPC fullnode for the Walrus icon-upload client (a SuiGrpcClient). This is a
39
- # *gRPC* endpoint and is SEPARATE from VITE_RPC_* (the JSON-RPC deploy endpoints) —
40
- # the two protocols are not interchangeable. Defaults to the public gRPC fullnodes
41
- # (rate-limited); set your own for production to avoid limits.
37
+ # Optional separate gRPC fullnode for the Walrus icon-upload client. Defaults to
38
+ # VITE_RPC_* (also gRPC); set only if Walrus traffic should use a different node.
42
39
  # VITE_WALRUS_RPC_TESTNET=https://fullnode.testnet.sui.io:443
43
40
  # VITE_WALRUS_RPC_MAINNET=https://fullnode.mainnet.sui.io:443
44
41
 
@@ -72,4 +69,4 @@ VITE_FEE_TREASURY_MAINNET=0xe6b2810abfc5a6f37a375f73e3ba76cfc37584196e453255ad3c
72
69
  # Public site origin for canonical/OpenGraph/JSON-LD URLs (index.html). Committed
73
70
  # defaults live in .env.production / .env.development; a staging deploy should set
74
71
  # this so it never claims the production URL.
75
- # VITE_PUBLIC_URL=https://tokens.meddleware.co.uk
72
+ # VITE_PUBLIC_URL=https://sui-token-deployer.meddleware.co.uk
@@ -8,7 +8,7 @@
8
8
  # Secrets required (repository or environment secrets):
9
9
  # SUI_PRIV_TESTNET / SUI_PRIV_MAINNET — bech32 suiprivkey1… for a funded deployer key.
10
10
  # FEE_TREASURY_TESTNET / FEE_TREASURY_MAINNET — operator treasury address (fee recipient).
11
- # RPC_TESTNET / RPC_MAINNET (optional) — JSON-RPC endpoint override (public testnet is gRPC-only).
11
+ # RPC_TESTNET / RPC_MAINNET (optional) — gRPC endpoint override (defaults to the public fullnodes).
12
12
 
13
13
  name: token-deployer real-chain e2e
14
14
 
package/CLAUDE.md CHANGED
@@ -27,11 +27,18 @@ The pattern mirrors `@meddleware/walrus-ui`, `@meddleware/seal-ui`, and
27
27
  must **not** render its own wallet bar, header, or footer when embedded.
28
28
 
29
29
  **Deploy executor note:** The wallet-adapter `Executor` only returns `{ digest }` — insufficient
30
- for the deploy flow, which requires `objectChanges` to extract the packageId, coin type,
31
- TreasuryCap, and MetadataCap. `src/lib/deployExecutor.ts` uses the wallet-adapter singleton for
32
- wallet connection state, but builds its own `SuiJsonRpcClient` (`@mysten/sui/jsonRpc`) to execute
33
- with `showEffects + showObjectChanges`. This is intentional — do not replace it with the
34
- wallet-adapter `buildExecutor`.
30
+ for the deploy flow, which requires the created objects to extract the packageId, coin type,
31
+ TreasuryCap, MetadataCap and the Currency ref. `src/lib/deployExecutor.ts` uses the wallet-adapter
32
+ singleton for wallet connection state, but executes through the app's own `SuiGrpcClient`
33
+ (`getReadClient`) with `include: { effects, objectTypes }`, and `toSuiTxResult` (`src/lib/deploy.ts`)
34
+ maps `effects.changedObjects` onto the `objectChanges` shape `extractPublishResult` reads. This is
35
+ intentional — do not replace it with the wallet-adapter `buildExecutor`.
36
+
37
+ **gRPC only.** Public fullnodes have deprecated JSON-RPC; every chain call (app and `scripts/`)
38
+ goes through `SuiGrpcClient`, and `VITE_RPC_*` / `E2E_RPC` must be gRPC(-web) endpoints. Do not
39
+ reintroduce `@mysten/sui/jsonRpc`. gRPC may render framework addresses in long form
40
+ (`0x000…02::coin::…`) — match types tolerantly. E2E builds (`VITE_E2E=1`) inject a stub client via
41
+ `setReadClient` because gRPC-web responses cannot be faked at the `fetch` layer.
35
42
 
36
43
  ## Architecture (the money/parity paths matter most)
37
44
 
@@ -105,7 +112,7 @@ the relay source `crates/walrus-upload-relay`.)
105
112
  - **NFT / usage-ticket per-wallet gating is IMPLEMENTED (2026-08-05)** via the standalone
106
113
  `nft-gate` project: an `nft-gate` gateway fronts the operator relay and admits only
107
114
  holders of an `access_gate` NFT. The app gates the operator-relay option on ownership
108
- (`useAccessGate` → `getOwnedObjects`), offers a permissionless purchase CTA, and attaches
115
+ (`useAccessGate` → `listOwnedObjects`), offers a permissionless purchase CTA, and attaches
109
116
  a wallet-signed access proof (`sui:signPersonalMessage` → `uploadRelayAuthToken`) when the
110
117
  operator relay is used. Unset `VITE_ACCESS_GATE_*` → no gating (unchanged behaviour). The
111
118
  tip and the NFT are **independent levers** (tip = per-upload cost; NFT = access/abuse).
package/Dockerfile CHANGED
@@ -18,7 +18,7 @@
18
18
  # VITE_WALRUS_RELAY_MAINNET — operator relay URL for mainnet (optional)
19
19
  # VITE_WALRUS_RPC_TESTNET — gRPC fullnode for Walrus testnet (optional)
20
20
  # VITE_WALRUS_RPC_MAINNET — gRPC fullnode for Walrus mainnet (optional)
21
- # VITE_RPC_TESTNET / VITE_RPC_MAINNET — override JSON-RPC fullnode URLs (optional)
21
+ # VITE_RPC_TESTNET / VITE_RPC_MAINNET — override gRPC fullnode URLs (optional)
22
22
  # VITE_ACCESS_GATE_ID_{NET} — operator's Gate shared object ID (optional)
23
23
  # VITE_ACCESS_GATE_NFT_TYPE_{NET} — access NFT type (optional)
24
24
  # VITE_ACCESS_GATE_SOULBOUND_{NET} — "true" if soulbound (optional)
package/LICENSE CHANGED
@@ -1,121 +1,14 @@
1
- Creative Commons Legal Code
1
+ BSD Zero Clause License
2
2
 
3
- CC0 1.0 Universal
3
+ Copyright (c) 2026 MeddleWare
4
4
 
5
- CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
- LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
- ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
- INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
- REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
- PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
- THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
- HEREUNDER.
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
13
7
 
14
- Statement of Purpose
15
-
16
- The laws of most jurisdictions throughout the world automatically confer
17
- exclusive Copyright and Related Rights (defined below) upon the creator
18
- and subsequent owner(s) (each and all, an "owner") of an original work of
19
- authorship and/or a database (each, a "Work").
20
-
21
- Certain owners wish to permanently relinquish those rights to a Work for
22
- the purpose of contributing to a commons of creative, cultural and
23
- scientific works ("Commons") that the public can reliably and without fear
24
- of later claims of infringement build upon, modify, incorporate in other
25
- works, reuse and redistribute as freely as possible in any form whatsoever
26
- and for any purposes, including without limitation commercial purposes.
27
- These owners may contribute to the Commons to promote the ideal of a free
28
- culture and the further production of creative, cultural and scientific
29
- works, or to gain reputation or greater distribution for their Work in
30
- part through the use and efforts of others.
31
-
32
- For these and/or other purposes and motivations, and without any
33
- expectation of additional consideration or compensation, the person
34
- associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
- is an owner of Copyright and Related Rights in the Work, voluntarily
36
- elects to apply CC0 to the Work and publicly distribute the Work under its
37
- terms, with knowledge of his or her Copyright and Related Rights in the
38
- Work and the meaning and intended legal effect of CC0 on those rights.
39
-
40
- 1. Copyright and Related Rights. A Work made available under CC0 may be
41
- protected by copyright and related or neighboring rights ("Copyright and
42
- Related Rights"). Copyright and Related Rights include, but are not
43
- limited to, the following:
44
-
45
- i. the right to reproduce, adapt, distribute, perform, display,
46
- communicate, and translate a Work;
47
- ii. moral rights retained by the original author(s) and/or performer(s);
48
- iii. publicity and privacy rights pertaining to a person's image or
49
- likeness depicted in a Work;
50
- iv. rights protecting against unfair competition in regards to a Work,
51
- subject to the limitations in paragraph 4(a), below;
52
- v. rights protecting the extraction, dissemination, use and reuse of data
53
- in a Work;
54
- vi. database rights (such as those arising under Directive 96/9/EC of the
55
- European Parliament and of the Council of 11 March 1996 on the legal
56
- protection of databases, and under any national implementation
57
- thereof, including any amended or successor version of such
58
- directive); and
59
- vii. other similar, equivalent or corresponding rights throughout the
60
- world based on applicable law or treaty, and any national
61
- implementations thereof.
62
-
63
- 2. Waiver. To the greatest extent permitted by, but not in contravention
64
- of, applicable law, Affirmer hereby overtly, fully, permanently,
65
- irrevocably and unconditionally waives, abandons, and surrenders all of
66
- Affirmer's Copyright and Related Rights and associated claims and causes
67
- of action, whether now known or unknown (including existing as well as
68
- future claims and causes of action), in the Work (i) in all territories
69
- worldwide, (ii) for the maximum duration provided by applicable law or
70
- treaty (including future time extensions), (iii) in any current or future
71
- medium and for any number of copies, and (iv) for any purpose whatsoever,
72
- including without limitation commercial, advertising or promotional
73
- purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
- member of the public at large and to the detriment of Affirmer's heirs and
75
- successors, fully intending that such Waiver shall not be subject to
76
- revocation, rescission, cancellation, termination, or any other legal or
77
- equitable action to disrupt the quiet enjoyment of the Work by the public
78
- as contemplated by Affirmer's express Statement of Purpose.
79
-
80
- 3. Public License Fallback. Should any part of the Waiver for any reason
81
- be judged legally invalid or ineffective under applicable law, then the
82
- Waiver shall be preserved to the maximum extent permitted taking into
83
- account Affirmer's express Statement of Purpose. In addition, to the
84
- extent the Waiver is so judged Affirmer hereby grants to each affected
85
- person a royalty-free, non transferable, non sublicensable, non exclusive,
86
- irrevocable and unconditional license to exercise Affirmer's Copyright and
87
- Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
- maximum duration provided by applicable law or treaty (including future
89
- time extensions), (iii) in any current or future medium and for any number
90
- of copies, and (iv) for any purpose whatsoever, including without
91
- limitation commercial, advertising or promotional purposes (the
92
- "License"). The License shall be deemed effective as of the date CC0 was
93
- applied by Affirmer to the Work. Should any part of the License for any
94
- reason be judged legally invalid or ineffective under applicable law, such
95
- partial invalidity or ineffectiveness shall not invalidate the remainder
96
- of the License, and in such case Affirmer hereby affirms that he or she
97
- will not (i) exercise any of his or her remaining Copyright and Related
98
- Rights in the Work or (ii) assert any associated claims and causes of
99
- action with respect to the Work, in either case contrary to Affirmer's
100
- express Statement of Purpose.
101
-
102
- 4. Limitations and Disclaimers.
103
-
104
- a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
- surrendered, licensed or otherwise affected by this document.
106
- b. Affirmer offers the Work as-is and makes no representations or
107
- warranties of any kind concerning the Work, express, implied,
108
- statutory or otherwise, including without limitation warranties of
109
- title, merchantability, fitness for a particular purpose, non
110
- infringement, or the absence of latent or other defects, accuracy, or
111
- the present or absence of errors, whether or not discoverable, all to
112
- the greatest extent permissible under applicable law.
113
- c. Affirmer disclaims responsibility for clearing rights of other persons
114
- that may apply to the Work or any use thereof, including without
115
- limitation any person's Copyright and Related Rights in the Work.
116
- Further, Affirmer disclaims responsibility for obtaining any necessary
117
- consents, permissions or other rights required for any use of the
118
- Work.
119
- d. Affirmer understands and acknowledges that Creative Commons is not a
120
- party to this document and has no duty or obligation with respect to
121
- this CC0 or use of the Work.
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -68,9 +68,9 @@ host dashboard. See [.env.example](.env.example) for the full list.
68
68
  | --- | --- | --- |
69
69
  | `VITE_FEE_TREASURY_TESTNET` / `_MAINNET` | Operator treasury that receives the fee. **A production build fails if either is the zero address** (bypass with `VITE_ALLOW_UNSET_TREASURY=1`). | committed operator address |
70
70
  | `VITE_FEE_MIST` | Flat fee split from the user's gas coin. | `1000000000` (1 SUI) |
71
- | `VITE_RPC_TESTNET` / `_MAINNET` | JSON-RPC endpoint (set a paid RPC for production). | public endpoints |
71
+ | `VITE_RPC_TESTNET` / `_MAINNET` | gRPC fullnode endpoint (set a paid RPC for production). JSON-RPC-only endpoints do not work. | public fullnodes |
72
72
  | `VITE_PUBLISH_GAS_BUDGET` | Publish gas budget (MIST). | `500000000` |
73
- | `VITE_PUBLIC_URL` | Site origin for canonical/OG/JSON-LD URLs. | `https://tokens.meddleware.co.uk` |
73
+ | `VITE_PUBLIC_URL` | Site origin (no trailing slash) for the canonical URL and Open Graph tags in `index.html`. | `https://sui-token-deployer.meddleware.co.uk` (`.env.production`) |
74
74
  | `VITE_WALRUS_RELAY_TESTNET` / `_MAINNET` | Your own upload relay (to collect the tip). Unset → public Mysten relay (earns nothing). | public relay |
75
75
  | `VITE_WALRUS_MAX_TIP_MIST` | Client-side max relay tip. **Must exceed your relay's tip** or uploads fail. | `50000000` (0.05 SUI) |
76
76
  | `VITE_ICON_MAX_BYTES` / `VITE_ICON_ALLOWED_TYPES` | Client icon size/type gate (UX only). | `102400` / PNG,JPEG,WebP,SVG |
@@ -192,7 +192,7 @@ testnet mode with the RPC pointed at the local node).
192
192
  | `SUI_PRIV` | bech32 `suiprivkey1…` for a **funded** deployer key. Export the CLI key: `sui keytool export --key-identity <addr>`. Never faucet-funded on a real network. |
193
193
  | `VITE_FEE_TREASURY_TESTNET` / `_MAINNET` | Operator treasury baked into the build (already set in `.env.production`). The build fails if it is the zero address. |
194
194
  | `E2E_FEE_ADDR` | The treasury to watch for the fee-delta assertion — set it equal to the built treasury. If unset, the fee check is skipped (the app still charges the fee). |
195
- | `VITE_RPC_TESTNET` / `_MAINNET` and `E2E_RPC` | JSON-RPC endpoint for the build (browser) and the node-side verifier. Use a JSON-RPC-capable endpoint — the official testnet fullnode is gRPC-only. |
195
+ | `VITE_RPC_TESTNET` / `_MAINNET` and `E2E_RPC` | gRPC endpoint for the build (browser) and the node-side verifier. Defaults to the public fullnodes. |
196
196
  | `E2E_MAINNET_CONFIRM=1` | **Mainnet only.** Without it the mainnet runner aborts cleanly (fail-safe default) so it can never publish by accident. |
197
197
 
198
198
  A full fee-charging run needs the key to hold **≥ gas + fee** (~0.5 SUI gas + 1 SUI fee = ~1.5 SUI).
@@ -203,8 +203,6 @@ Example (testnet):
203
203
 
204
204
  ```bash
205
205
  export SUI_PRIV="$(sui keytool export --key-identity 0xYOURADDR --json | jq -r .exportedPrivateKey)"
206
- VITE_RPC_TESTNET=https://sui-testnet-rpc.publicnode.com \
207
- E2E_RPC=https://sui-testnet-rpc.publicnode.com \
208
206
  VITE_FEE_TREASURY_TESTNET=0xYOURTREASURY \
209
207
  E2E_FEE_ADDR=0xYOURTREASURY \
210
208
  npm run e2e:testnet
package/index.html CHANGED
@@ -2,9 +2,18 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
- <link rel="icon" href="/favicon.ico">
5
+ <link rel="icon" href="/favicon.svg" type="image/svg+xml">
6
+ <link rel="icon" href="/favicon.ico" sizes="any">
6
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Vite App</title>
8
+ <title>Token Deployer · MeddleWare</title>
9
+ <meta name="description" content="Create your own Sui coin in the browser — your wallet signs and pays gas, nothing is compiled or signed on a server, and you keep the full, verifiable source package.">
10
+ <link rel="canonical" href="%VITE_PUBLIC_URL%/">
11
+ <meta property="og:type" content="website">
12
+ <meta property="og:title" content="Token Deployer · MeddleWare">
13
+ <meta property="og:description" content="Create your own Sui coin in the browser — no server, no custody, full source included.">
14
+ <meta property="og:url" content="%VITE_PUBLIC_URL%/">
15
+ <meta property="og:image" content="%VITE_PUBLIC_URL%/og-image.png">
16
+ <meta name="twitter:card" content="summary_large_image">
8
17
  </head>
9
18
  <body>
10
19
  <div id="app"></div>
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@meddleware/token-deployer-ui",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
+ "license": "0BSD",
5
6
  "exports": {
6
7
  ".": {
7
8
  "default": "./src/index.ts"
@@ -39,11 +40,11 @@
39
40
  "dependencies": {
40
41
  "@meddleware/design-tokens": "^0.1.7",
41
42
  "@meddleware/ui": "^0.1.28",
42
- "@meddleware/wallet-adapter": "^0.0.9",
43
- "@meddleware/walrus-relay": "^0.1.18",
43
+ "@meddleware/wallet-adapter": "^0.0.10",
44
+ "@meddleware/walrus-relay": "^0.1.19",
44
45
  "@mysten/bcs": "~2.1.0",
45
46
  "@mysten/move-bytecode-template": "~0.4.0",
46
- "@mysten/sui": "^2.33.0",
47
+ "@mysten/sui": "^2.33.1",
47
48
  "@mysten/walrus": "~1.2.0",
48
49
  "fflate": "^0.8.3",
49
50
  "vue": "^3.5.0"
@@ -81,7 +82,7 @@
81
82
  "vue-tsc": "~3.3.0"
82
83
  },
83
84
  "optionalDependencies": {
84
- "@meddleware/sui-token-template": "^1.0.4"
85
+ "@meddleware/sui-token-template": "^1.0.5"
85
86
  },
86
87
  "engines": {
87
88
  "node": "^22.18.0 || >=24.12.0"
Binary file
package/public/robots.txt CHANGED
@@ -1,3 +1,3 @@
1
1
  User-agent: *
2
2
  Allow: /
3
- Sitemap: https://tokens.meddleware.co.uk/sitemap.xml
3
+ Sitemap: https://sui-token-deployer.meddleware.co.uk/sitemap.xml
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
3
  <url>
4
- <loc>https://tokens.meddleware.co.uk/</loc>
4
+ <loc>https://sui-token-deployer.meddleware.co.uk/</loc>
5
5
  <changefreq>monthly</changefreq>
6
6
  <priority>1.0</priority>
7
7
  </url>
@@ -19,7 +19,7 @@
19
19
 
20
20
  import { readFileSync, existsSync } from 'node:fs'
21
21
  import { chromium } from 'playwright'
22
- import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc'
22
+ import { SuiGrpcClient } from '@mysten/sui/grpc'
23
23
  import { requestSuiFromFaucetV2 } from '@mysten/sui/faucet'
24
24
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'
25
25
  import { Transaction } from '@mysten/sui/transactions'
@@ -37,7 +37,7 @@ const APP_NETWORK = NETWORK === 'mainnet' ? 'mainnet' : 'testnet'
37
37
 
38
38
  const DEFAULT_RPC = {
39
39
  localnet: 'http://127.0.0.1:9000',
40
- testnet: 'https://sui-testnet-rpc.publicnode.com',
40
+ testnet: 'https://fullnode.testnet.sui.io:443',
41
41
  mainnet: 'https://fullnode.mainnet.sui.io:443',
42
42
  }
43
43
  const RPC = process.env.E2E_RPC || DEFAULT_RPC[NETWORK]
@@ -83,9 +83,15 @@ if (NETWORK === 'localnet') {
83
83
  }
84
84
  const address = keypair.toSuiAddress()
85
85
 
86
- // Node-side client points at the PHYSICAL RPC; its `network` label is the app network so the
87
- // built transaction's chain identifier matches what the wallet/app sign under.
88
- const client = new SuiJsonRpcClient({ url: RPC, network: APP_NETWORK })
86
+ // Node-side gRPC client points at the PHYSICAL RPC; its `network` label is the app network so
87
+ // the built transaction's chain identifier matches what the wallet/app sign under.
88
+ const client = new SuiGrpcClient({ baseUrl: RPC, network: APP_NETWORK })
89
+
90
+ /** Total SUI balance (MIST) of `owner`. */
91
+ async function suiBalance(owner) {
92
+ const { balance } = await client.getBalance({ owner })
93
+ return BigInt(balance.balance)
94
+ }
89
95
 
90
96
  const EXPECT_FEE = Boolean(FEE_ADDR) && FEE_ADDR !== ZERO_ADDR
91
97
 
@@ -95,19 +101,16 @@ async function main() {
95
101
  if (NETWORK === 'localnet') {
96
102
  await requestSuiFromFaucetV2({ host: FAUCET, recipient: address })
97
103
  for (let i = 0; i < 25; i++) {
98
- const b = await client.getBalance({ owner: address })
99
- if (BigInt(b.totalBalance) > 0n) break
104
+ if ((await suiBalance(address)) > 0n) break
100
105
  await new Promise((r) => setTimeout(r, 1000))
101
106
  }
102
107
  }
103
108
 
104
- const balance = BigInt((await client.getBalance({ owner: address })).totalBalance)
109
+ const balance = await suiBalance(address)
105
110
  console.log('sender:', address, 'balance:', balance.toString(), 'MIST')
106
111
  if (balance === 0n) fail(`sender ${address} has no SUI on ${NETWORK}`)
107
112
 
108
- const feeBefore = EXPECT_FEE
109
- ? BigInt((await client.getBalance({ owner: FEE_ADDR })).totalBalance)
110
- : 0n
113
+ const feeBefore = EXPECT_FEE ? await suiBalance(FEE_ADDR) : 0n
111
114
 
112
115
  // Browser resolution: explicit CHROME_PATH → a locally-installed Chrome → Playwright's
113
116
  // bundled Chromium (CI installs it via `npx playwright install chromium`).
@@ -167,7 +170,7 @@ async function main() {
167
170
 
168
171
  // Connect: open the dialog, select the app network if it differs from the testnet default,
169
172
  // then pick the injected wallet.
170
- await page.getByRole('button', { name: 'Connect Wallet' }).click()
173
+ await page.getByRole('button', { name: 'Connect Wallet', exact: true }).click()
171
174
  if (APP_NETWORK !== 'testnet') {
172
175
  await page.locator('#dialog-network-select').selectOption(APP_NETWORK)
173
176
  }
@@ -175,15 +178,17 @@ async function main() {
175
178
  await page.getByText(/Mock Test Wallet ·/).waitFor({ timeout: 10000 })
176
179
  console.log('wallet connected in UI')
177
180
 
178
- // Fill the form.
181
+ // Fill the wizard: identity → token → settings (defaults) → terms (first run) → review.
182
+ await page.locator('#package').fill('browser_coin')
183
+ await page.locator('#module').fill('browsercoin')
184
+ await page.getByRole('button', { name: 'Next', exact: true }).click()
179
185
  await page.locator('#name').fill('Browser Coin')
180
186
  await page.locator('#symbol').fill('BRWC')
181
187
  await page.locator('#description').fill('Deployed via headless browser e2e')
182
188
  await page.locator('#decimals').fill('6')
183
- await page.locator('#package').fill('browser_coin')
184
- await page.locator('#module').fill('browsercoin')
185
-
189
+ await page.getByRole('button', { name: 'Next', exact: true }).click()
186
190
  await page.getByRole('button', { name: /Review & deploy/ }).click()
191
+ await page.getByRole('button', { name: /I understand — continue/ }).click()
187
192
  await page.getByRole('button', { name: /Confirm & deploy/ }).click()
188
193
  console.log('confirmed; deploying (real publish + confirmation)…')
189
194
 
@@ -208,7 +213,7 @@ async function main() {
208
213
  if (!coinType.includes('::browsercoin::BROWSERCOIN')) fail(`unexpected coin type: ${coinType}`)
209
214
 
210
215
  if (EXPECT_FEE) {
211
- const feeAfter = BigInt((await client.getBalance({ owner: FEE_ADDR })).totalBalance)
216
+ const feeAfter = await suiBalance(FEE_ADDR)
212
217
  const feeDelta = feeAfter - feeBefore
213
218
  console.log('fee delivered this run:', feeDelta.toString(), 'MIST (to', FEE_ADDR + ')')
214
219
  if (feeDelta !== EXPECT_FEE_MIST) fail(`expected ${EXPECT_FEE_MIST} MIST fee this run, got ${feeDelta}`)
@@ -1,18 +1,21 @@
1
1
  // End-to-end: patch -> publish (fee + immutable) -> finalize (mint + fixed supply
2
2
  // + frozen metadata) against localnet, using the actual app lib.
3
3
  import init from '@mysten/move-bytecode-template';
4
- import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
4
+ import { SuiGrpcClient } from '@mysten/sui/grpc';
5
5
  import { requestSuiFromFaucetV2 } from '@mysten/sui/faucet';
6
6
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
7
7
  import { patchTemplateModule } from '../src/lib/template.ts';
8
8
  import { buildPublishTransaction, buildFinalizeTransaction, extractPublishResult, needsFinalize } from '../src/lib/buildPublishTx.ts';
9
+ import { toSuiTxResult } from '../src/lib/deploy.ts';
9
10
 
10
11
  await (init)();
11
- const client = new SuiJsonRpcClient({ url: 'http://127.0.0.1:9000' });
12
+ const client = new SuiGrpcClient({ baseUrl: 'http://127.0.0.1:9000', network: 'localnet' });
13
+ const balanceOf = async (owner, coinType) => BigInt((await client.getBalance({ owner, coinType })).balance.balance);
14
+ const include = { effects: true, objectTypes: true };
12
15
  const kp = new Ed25519Keypair(); const sender = kp.toSuiAddress();
13
16
  const feeRecipient = new Ed25519Keypair().toSuiAddress();
14
17
  await requestSuiFromFaucetV2({ host: 'http://127.0.0.1:9123', recipient: sender });
15
- for (let i=0;i<25;i++){ const b=await client.getBalance({owner:sender}); if(BigInt(b.totalBalance)>0n)break; await new Promise(r=>setTimeout(r,1000)); }
18
+ for (let i=0;i<25;i++){ if((await balanceOf(sender))>0n)break; await new Promise(r=>setTimeout(r,1000)); }
16
19
 
17
20
  const config = {
18
21
  packageName:'fixed_token', moduleName:'fixedtok', structName:'FIXEDTOK',
@@ -24,7 +27,7 @@ const config = {
24
27
  const moduleBytes = await patchTemplateModule(config);
25
28
  const feeMist = 250000000n;
26
29
  const pubTx = buildPublishTransaction({ moduleBytes, sender, feeMist, feeRecipient, gasBudget: 500000000n, packagePolicy: config.packagePolicy });
27
- const pub = await client.signAndExecuteTransaction({ signer: kp, transaction: pubTx, options: { showEffects:true, showObjectChanges:true, showBalanceChanges:true } });
30
+ const pub = toSuiTxResult(await client.signAndExecuteTransaction({ signer: kp, transaction: pubTx, include }));
28
31
  console.log('publish status:', pub.effects?.status?.status);
29
32
  if (pub.effects?.status?.status !== 'success') { console.log(JSON.stringify(pub.effects?.status)); process.exit(1); }
30
33
 
@@ -35,30 +38,29 @@ console.log('coinType:', result.coinType);
35
38
  console.log('caps:', { t: !!result.treasuryCapId, m: !!result.metadataCapId, upgrade: result.upgradeCapId ?? '(burned=immutable)' });
36
39
 
37
40
  // fee arrived?
38
- const feeBal = await client.getBalance({ owner: feeRecipient });
39
- console.log('fee recipient balance:', feeBal.totalBalance, feeBal.totalBalance === feeMist.toString() ? 'OK' : 'MISMATCH');
41
+ const feeBal = await balanceOf(feeRecipient);
42
+ console.log('fee recipient balance:', feeBal.toString(), feeBal === feeMist ? 'OK' : 'MISMATCH');
40
43
 
41
44
  // finalize
42
45
  console.log('needsFinalize:', needsFinalize(config, sender));
43
46
  const finTx = buildFinalizeTransaction({ config, coinType: result.coinType, treasuryCapId: result.treasuryCapId, metadataCapId: result.metadataCapId, sender, gasBudget: 500000000n });
44
- const fin = await client.signAndExecuteTransaction({ signer: kp, transaction: finTx, options: { showEffects:true, showObjectChanges:true } });
47
+ const fin = toSuiTxResult(await client.signAndExecuteTransaction({ signer: kp, transaction: finTx, include }));
45
48
  await client.waitForTransaction({ digest: fin.digest });
46
49
  console.log('finalize status:', fin.effects?.status?.status);
47
50
  if (fin.effects?.status?.status !== 'success') { console.log(JSON.stringify(fin.effects?.status)); process.exit(1); }
48
51
 
49
52
  // minted coin present?
50
- const coins = await client.getCoins({ owner: sender, coinType: result.coinType });
51
- const total = coins.data.reduce((a,c)=>a+BigInt(c.balance), 0n);
53
+ const total = await balanceOf(sender, result.coinType);
52
54
  const expected = 1000n * 10n**6n;
53
55
  console.log('minted balance:', total.toString(), total===expected ? 'OK (1000 * 10^6)' : 'MISMATCH exp '+expected);
54
56
 
55
57
  // treasury cap frozen (immutable owner)?
56
- const tcap = await client.getObject({ id: result.treasuryCapId, options:{ showOwner:true } });
57
- const owner = tcap.data?.owner ?? tcap.object?.owner ?? tcap.owner;
58
+ const { object: tcap } = await client.getObject({ objectId: result.treasuryCapId });
59
+ const owner = tcap.owner;
58
60
  console.log('treasuryCap owner after fixed-supply freeze:', JSON.stringify(owner));
59
61
 
60
62
  const ok = result.coinType.endsWith('::fixedtok::FIXEDTOK')
61
- && feeBal.totalBalance === feeMist.toString()
63
+ && feeBal === feeMist
62
64
  && !result.upgradeCapId
63
65
  && total === expected;
64
66
  console.log('\nE2E', ok ? 'PASS ✓' : 'FAIL ✗');
@@ -8,15 +8,12 @@
8
8
 
9
9
  import { readFileSync } from 'node:fs'
10
10
  import { chromium } from 'playwright'
11
- import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc'
12
11
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'
13
12
  import { toBase64 } from '@mysten/sui/utils'
14
13
 
15
14
  const APP_URL = process.env.APP_URL || 'http://localhost:4173'
16
- const RPC = process.env.RPC || 'https://sui-testnet-rpc.publicnode.com'
17
15
  const ICON = '/tmp/test-icon.svg'
18
16
 
19
- const _client = new SuiJsonRpcClient({ url: RPC, network: 'testnet' })
20
17
  const keypair = Ed25519Keypair.fromSecretKey(process.env.SUI_PRIV)
21
18
  const address = keypair.toSuiAddress()
22
19
 
@@ -30,7 +27,7 @@ async function main() {
30
27
  const browser = await chromium.launch({
31
28
  headless: true,
32
29
  executablePath: process.env.CHROME_PATH || '/usr/bin/google-chrome',
33
- // Bypass CORS so the in-browser tx.build() can hit the testnet RPC.
30
+ // Bypass CORS so the in-browser tx.build() can hit the testnet gRPC endpoint.
34
31
  args: ['--disable-web-security', '--disable-features=IsolateOrigins,site-per-process'],
35
32
  })
36
33
  const page = await browser.newPage()
@@ -14,13 +14,13 @@ h1 .accent{color:#6ea8fe}
14
14
  p{font-size:34px;line-height:1.35;color:#aebfd6;max-width:960px}
15
15
  .row{display:flex;gap:18px;margin-top:52px}
16
16
  .chip{font-size:24px;color:#cfe0f7;background:#16233d;border:1px solid #26365a;border-radius:10px;padding:12px 20px}
17
- .url{position:absolute;bottom:56px;right:80px;font-size:26px;color:#6ea8fe;font-weight:600}
17
+ .url{position:absolute;top:84px;right:80px;font-size:26px;color:#6ea8fe;font-weight:600}
18
18
  </style></head><body>
19
19
  <div class="badge">Sui &middot; client-side</div>
20
20
  <h1>Create your own <span class="accent">Sui coin</span><br>in the browser</h1>
21
21
  <p>Your wallet signs and pays gas &mdash; nothing is compiled or signed on a server. Keep the full, verifiable source package.</p>
22
22
  <div class="row"><div class="chip">No server</div><div class="chip">No custody</div><div class="chip">Full source included</div></div>
23
- <div class="url">tokens.meddleware.co.uk</div>
23
+ <div class="url">sui-token-deployer.meddleware.co.uk</div>
24
24
  </body></html>`
25
25
 
26
26
  const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH || '/usr/bin/google-chrome' })
@@ -1,16 +1,17 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { bcs } from '@mysten/bcs';
3
3
  import * as tpl from '@mysten/move-bytecode-template';
4
- import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
4
+ import { SuiGrpcClient } from '@mysten/sui/grpc';
5
5
  import { requestSuiFromFaucetV2 } from '@mysten/sui/faucet';
6
6
  import { Transaction } from '@mysten/sui/transactions';
7
7
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
8
8
  import { toBase64 } from '@mysten/sui/utils';
9
+ import { toSuiTxResult } from '../src/lib/deploy.ts';
9
10
 
10
11
  const init = tpl.default ?? tpl.init;
11
12
  try { if (typeof init === 'function') await init(); } catch {}
12
13
 
13
- const client = new SuiJsonRpcClient({ url: 'http://127.0.0.1:9000' });
14
+ const client = new SuiGrpcClient({ baseUrl: 'http://127.0.0.1:9000', network: 'localnet' });
14
15
 
15
16
  const orig = new Uint8Array(readFileSync(new URL('../src/move-template/sui_token_template.mv', import.meta.url)));
16
17
  const json = tpl.deserialize(orig);
@@ -29,7 +30,7 @@ const addr = kp.toSuiAddress();
29
30
  console.log('address:', addr);
30
31
  await requestSuiFromFaucetV2({ host: 'http://127.0.0.1:9123', recipient: addr });
31
32
  let bal = '0';
32
- for (let i=0;i<25;i++){ const b = await client.getBalance({ owner: addr }); if (BigInt(b.totalBalance) > 0n){ bal=b.totalBalance; break;} await new Promise(r=>setTimeout(r,1000)); }
33
+ for (let i=0;i<25;i++){ const { balance } = await client.getBalance({ owner: addr }); if (BigInt(balance.balance) > 0n){ bal=balance.balance; break;} await new Promise(r=>setTimeout(r,1000)); }
33
34
  console.log('balance:', bal);
34
35
 
35
36
  const tx = new Transaction();
@@ -39,7 +40,7 @@ tx.transferObjects([upgradeCap], addr);
39
40
  tx.setGasBudget(500000000);
40
41
 
41
42
  try {
42
- const res = await client.signAndExecuteTransaction({ signer: kp, transaction: tx, options: { showEffects: true, showObjectChanges: true } });
43
+ const res = toSuiTxResult(await client.signAndExecuteTransaction({ signer: kp, transaction: tx, include: { effects: true, objectTypes: true } }));
43
44
  const status = res.effects?.status?.status;
44
45
  console.log('\nstatus:', status);
45
46
  if (status !== 'success') { console.log('ERR:', JSON.stringify(res.effects?.status)); process.exit(1); }
@@ -73,7 +73,8 @@ async function openLicenseModal(): Promise<void> {
73
73
  <UiFieldHint field-id="license-select">
74
74
  Applies only to the downloadable Move source package — embedded in the LICENSE file and
75
75
  source headers. Has <b>no effect on the on-chain token</b> or its transferability. Choose
76
- <b>CC0-1.0</b> (default) for public domain. Choose <b>None</b> to retain all rights.
76
+ <b>0BSD</b> (default) for a minimal permissive licence, or <b>CC0-1.0</b> for public domain.
77
+ Choose <b>None</b> to retain all rights.
77
78
  </UiFieldHint>
78
79
  </template>
79
80
  <template #default="{ attrs }">
@@ -22,7 +22,7 @@ export type PersonalMessageSigner = (message: Uint8Array) => Promise<{ signature
22
22
  * When no gate is configured for the network (`ACCESS_GATE[network] == null`), the relay is
23
23
  * treated as OPEN (`hasAccess === true`) and this composable is inert — behaviour is
24
24
  * unchanged from before gating existed. When a gate IS configured, `checkOwnership` decides
25
- * access with a single `getOwnedObjects` call (the same cheap pattern as the relay health
25
+ * access with a single `listOwnedObjects` call (the same cheap pattern as the relay health
26
26
  * check), and `purchase`/`buildRelayAccessToken` drive the buy + prove flows.
27
27
  */
28
28
  export function useAccessGate(