@arcadiasystems/morse-sdk 0.4.2 → 0.5.0
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/CHANGELOG.md +39 -0
- package/README.md +85 -60
- package/dist/config.d.ts +12 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +43 -7
- package/dist/config.js.map +1 -1
- package/dist/seal/default-adapter.d.ts +12 -4
- package/dist/seal/default-adapter.d.ts.map +1 -1
- package/dist/seal/default-adapter.js +12 -4
- package/dist/seal/default-adapter.js.map +1 -1
- package/dist/walrus/http-aggregator-read-adapter.d.ts +4 -2
- package/dist/walrus/http-aggregator-read-adapter.d.ts.map +1 -1
- package/dist/walrus/http-aggregator-read-adapter.js +5 -3
- package/dist/walrus/http-aggregator-read-adapter.js.map +1 -1
- package/package.json +2 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `morse-sdk` will be documented in this file. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [0.5.0] - 2026-09-09
|
|
6
|
+
|
|
7
|
+
Mainnet support. `morseConfig({ network: "mainnet" })` previously threw `ConfigurationError`; it now returns a complete `NetworkConfig` against the mainnet deployment (`published-at`: `0x4fc7af5d1e19f96e5fab4e677948214eec35e238b252a106c7d5036dcebdcae2`, published 2026-09-09 in tx `HmiywHYifmrNLMvY2oT8cP5W9hpQc2wFTJAaaQoM8mLY`). No API shape changed and no consumer code needs editing beyond the network literal.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Canonical mainnet deployment in `morseConfig`.** All six address fields are baked in, so mainnet consumers supply no addresses. Because the mainnet publish is an unupgraded v1, `packageId`, `originalPackageId`, and `recipientFileEventOriginPackageId` are all the same address; they are still stored as three separate fields because the first upgrade splits them, and a test pins the invariant so a half-finished upgrade fails loudly rather than silently returning empty type-filtered reads.
|
|
12
|
+
- **Mainnet Seal key servers default to Mysten's decentralized committee** (`0x686098f1...`, aggregator `https://seal-aggregator-mainnet.mystenlabs.com`). Unlike testnet, mainnet has no free open key-server allowlist: the independent mainnet operators are commercial and issue per-consumer API keys, so the committee is the only zero-onboarding option. It is one endpoint fronting 8 operators with an internal 5-of-8 quorum, which `@mysten/seal` models as a single server with `serverType: "Committee"`. Two consequences worth knowing: the entry **must** carry `aggregatorUrl` (Seal throws `InvalidClientOptionsError: Committee server ... requires aggregatorUrl in config` without it, and throws the mirror-image error for an independent server that *has* it), and `DefaultSealAdapter.fromMorseConfig` correctly resolves the default threshold to 1 rather than 2, since the real quorum is enforced behind the aggregator and cannot be expressed as a share count. Pass `seal.serverConfigs` to route through your own servers instead.
|
|
13
|
+
- **Mainnet Walrus aggregator** pinned to `https://aggregator.walrus-mainnet.walrus.space` for `HttpAggregatorReadAdapter.fromMorseConfig`. Publisher stays undefined on both networks, unchanged: there is no single canonical operator and picking one is a trust decision the SDK should not make for everyone.
|
|
14
|
+
- First tests for `DefaultSealAdapter.fromMorseConfig`, which had none. Cover the default threshold for both the single-server (mainnet) and multi-server (testnet) shapes, the `originalPackageId` / `packageId` split between Seal identity binding and PTB targets, and the no-key-servers `ConfigurationError`.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- The mainnet-specific `ConfigurationError` ("Morse is not yet deployed on mainnet") is gone, along with the branch that raised it. A network with no canonical deployment and no overrides now always gets the generic message naming the network. Only localnet reaches this path.
|
|
19
|
+
- `ConfigurationError` message from `HttpAggregatorReadAdapter.fromMorseConfig` no longer claims testnet is the only network with a pinned aggregator.
|
|
20
|
+
- Doc comments that described mainnet as unpinned or "pre-freeze" now describe the committee-mode constraint instead, in `config.ts`, `seal/default-adapter.ts`, and `walrus/http-aggregator-read-adapter.ts`.
|
|
21
|
+
|
|
22
|
+
### Release + tooling
|
|
23
|
+
|
|
24
|
+
- **`prepublishOnly` now gates `npm publish`** on lint, typecheck, tests and a fresh build. `dist/` is gitignored and there was no build step wired into publish, so publishing from a clean checkout without a manual `bun run build` would have shipped a package whose `main` pointed at a file that was not in the tarball.
|
|
25
|
+
- **Smoke scripts take `MORSE_NETWORK`** (`mainnet` or `testnet`, default `testnet`); mainnet additionally requires `MORSE_ALLOW_MAINNET=1` so an inherited shell variable cannot spend real SUI and WAL. Every script now derives its Walrus adapter network from the same resolved value as its Sui client, which removes the possibility of pairing a mainnet Sui client with a testnet Walrus client. `scripts/_shared.ts` gained `smokeNetwork()` / `smokeConfig()` and `SmokeContext.network`.
|
|
26
|
+
- **README links now resolve on npmjs.com.** The `examples/` and `CONTRIBUTING.md` links were relative, and neither directory ships in the tarball, so all 13 were dead on the registry page for every published version to date. They are absolute GitHub URLs now; `./LICENSE` stays relative because it does ship.
|
|
27
|
+
|
|
28
|
+
### Known gaps
|
|
29
|
+
|
|
30
|
+
- **`TESTED_SUBSTRATE.suiNetwork` still reads `"testnet"`, deliberately.** It records where the paid `scripts/phase-N-*.ts` smoke suite has actually run end to end, and that is testnet only. Mainnet is verified at the config layer (unit tests) and the read layer (a live gRPC `listPublicationsOwnedBy` against the deployed package), not by a full paid write cycle. The constant and the README compatibility table get updated when a mainnet smoke actually runs.
|
|
31
|
+
- `scripts/` and `examples/` remain hardcoded to testnet. `scripts/_shared.ts` is the single choke point if a `MORSE_NETWORK` override is added later. Neither directory ships in the npm tarball.
|
|
32
|
+
- The Move contracts remain unaudited on both networks.
|
|
33
|
+
|
|
34
|
+
## [0.4.3] - 2026-07-07
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **`@mysten/seal` and `@mysten/walrus` are now required peer dependencies** (previously marked optional). The package's main entry re-exports the default Seal and Walrus adapters, whose static imports made both packages mandatory at runtime: a "minimal" install following the old README crashed with `ERR_MODULE_NOT_FOUND` on the very first `import` from the SDK. Declaring them required means npm 7+ auto-installs them and every documented install path yields a working import. No code changes; installs that already included all three Mysten packages are unaffected.
|
|
39
|
+
- **README regenerated against the real 0.4.x surface.** The published README still documented the pre-0.4.0 allowlist/file API (`createAllowlist`, `addMember`, `createEncryptedFile`, `uploadEncryptedFileFromBytes`, `RpcFilesReader`, `buildAllowlistSealId`, …— all removed in 0.4.0) and never mentioned the `RecipientFile` API that replaced it. API tables, reader section, Seal identity section, and types now match `dist/index.d.ts`.
|
|
40
|
+
- **Quick-start slug is collision-proof.** The README and examples used the fixed slug `"my-publication"`, which is already registered on testnet — every reader who ran the quick start verbatim hit `ESlugAlreadyExists`. Examples now derive a unique slug and call out that slugs are globally unique on-chain.
|
|
41
|
+
- **Dead Walrus faucet link replaced.** `docs.walrus.site` no longer resolves; WAL acquisition now points at the working [stake-wal.wal.app](https://stake-wal.wal.app/?network=testnet) swap, matching docs.morsecms.xyz.
|
|
42
|
+
- Stale version references cleaned up (compatibility table now lists 0.4.x; removed "at v0.1.0" qualifiers) and a "storage is epoch-funded, not permanent" note added to Known limitations.
|
|
43
|
+
|
|
5
44
|
## [0.4.2] - 2026-06-05
|
|
6
45
|
|
|
7
46
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
# morse-sdk
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for [Morse](
|
|
3
|
+
TypeScript SDK for [Morse](https://github.com/arcadiasystems/morse-dcms/tree/main/morse-contracts), a decentralized content management system on the Sui blockchain. Wraps the Move contract surface, Walrus storage, and Seal threshold encryption behind a typed adapter pattern.
|
|
4
4
|
|
|
5
5
|
## Status
|
|
6
6
|
|
|
7
|
-
Pre-release.
|
|
7
|
+
Pre-release. Mainnet and testnet are both wired: the Move contract addresses are baked in, so `morseConfig({ network: "mainnet" })` and `morseConfig({ network: "testnet" })` both return a complete config with no addresses to supply.
|
|
8
|
+
|
|
9
|
+
**The contracts are unaudited.** On mainnet, SUI and WAL cost real money, there is no faucet, and a mistake is not recoverable. The end-to-end smoke suite has been run against testnet only (see [Compatibility](#compatibility)); mainnet is verified at the config and read layer, not by a full paid write cycle. Treat mainnet as usable but young, and size your first deployment accordingly.
|
|
8
10
|
|
|
9
11
|
## Install
|
|
10
12
|
|
|
13
|
+
All three Mysten packages are required peer dependencies. Pin the minors the SDK is verified against (see [Compatibility](#compatibility)):
|
|
14
|
+
|
|
11
15
|
Bun:
|
|
12
16
|
|
|
13
17
|
```sh
|
|
14
|
-
bun add @arcadiasystems/morse-sdk @mysten/sui
|
|
15
|
-
# Optional - install only what you use:
|
|
16
|
-
bun add @mysten/walrus # for DefaultWalrusWriteAdapter
|
|
17
|
-
bun add @mysten/seal # for DefaultSealAdapter and encrypted entries
|
|
18
|
+
bun add @arcadiasystems/morse-sdk @mysten/sui@2.16.2 @mysten/walrus@1.1.6 @mysten/seal@1.1.3
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
npm:
|
|
21
22
|
|
|
22
23
|
```sh
|
|
23
|
-
npm install @arcadiasystems/morse-sdk @mysten/sui
|
|
24
|
-
npm install @mysten/walrus # optional
|
|
25
|
-
npm install @mysten/seal # optional
|
|
24
|
+
npm install @arcadiasystems/morse-sdk @mysten/sui@2.16.2 @mysten/walrus@1.1.6 @mysten/seal@1.1.3
|
|
26
25
|
```
|
|
27
26
|
|
|
28
27
|
pnpm:
|
|
29
28
|
|
|
30
29
|
```sh
|
|
31
|
-
pnpm add @arcadiasystems/morse-sdk @mysten/sui
|
|
32
|
-
pnpm add @mysten/walrus # optional
|
|
33
|
-
pnpm add @mysten/seal # optional
|
|
30
|
+
pnpm add @arcadiasystems/morse-sdk @mysten/sui@2.16.2 @mysten/walrus@1.1.6 @mysten/seal@1.1.3
|
|
34
31
|
```
|
|
35
32
|
|
|
36
|
-
`@mysten/sui`
|
|
33
|
+
`@mysten/sui` provides the client, keypairs, and transaction types; `@mysten/walrus` backs the default storage adapters (any publish path needs it); `@mysten/seal` backs threshold encryption. All three are imported by the SDK's public surface, so they must be installed even if you only use a subset — npm 7+ installs required peers automatically when you omit them.
|
|
37
34
|
|
|
38
35
|
## Compatibility
|
|
39
36
|
|
|
@@ -41,11 +38,13 @@ morse-sdk is built and tested against specific minor versions of its Mysten subs
|
|
|
41
38
|
|
|
42
39
|
| morse-sdk | `@mysten/sui` | `@mysten/walrus` | `@mysten/seal` | Sui network | Verified |
|
|
43
40
|
| --------- | ------------- | ---------------- | -------------- | ----------- | --------- |
|
|
41
|
+
| 0.5.x | 2.16.2-2.16.x | 1.1.6-1.1.x | 1.1.3-1.1.x | testnet | 2026-06-05 |
|
|
42
|
+
| 0.4.x | 2.16.2-2.16.x | 1.1.6-1.1.x | 1.1.3-1.1.x | testnet | 2026-06-05 |
|
|
44
43
|
| 0.1.x | 2.16.2-2.16.x | 1.1.6-1.1.x | 1.1.3-1.1.x | testnet | 2026-05-10 |
|
|
45
44
|
|
|
46
|
-
Mysten ships breaking changes inside major version boundaries.
|
|
45
|
+
Mysten ships breaking changes inside major version boundaries. Newer minors (e.g. `@mysten/walrus@1.2.x`, `@mysten/sui@2.17+`) are outside the verified ranges and may produce runtime errors; morse-sdk needs a coordinated bump and re-verification before a new Mysten minor is supported. Pin via `bun add @arcadiasystems/morse-sdk@~0.4.0` if you want patch updates without surprise minors.
|
|
47
46
|
|
|
48
|
-
The verification protocol is documented in [`CONTRIBUTING.md`](
|
|
47
|
+
The verification protocol is documented in [`CONTRIBUTING.md`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/CONTRIBUTING.md): every Mysten dep bump runs the full `scripts/phase-N-*.ts` smoke suite against testnet before the bump lands. The `Sui network` column records where that paid smoke suite actually ran, which is why it still reads `testnet` for 0.5.x even though mainnet addresses ship. `TESTED_SUBSTRATE.suiNetwork` reports the same thing programmatically.
|
|
49
48
|
|
|
50
49
|
### Runtime requirements
|
|
51
50
|
|
|
@@ -65,15 +64,20 @@ Setup once at startup:
|
|
|
65
64
|
|
|
66
65
|
```ts
|
|
67
66
|
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
67
|
+
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
|
|
68
68
|
import {
|
|
69
69
|
KeypairAdapter,
|
|
70
70
|
morseConfig,
|
|
71
71
|
RpcPublicationReader,
|
|
72
72
|
} from "@arcadiasystems/morse-sdk";
|
|
73
73
|
|
|
74
|
+
// The quick start uses testnet on purpose: every step below spends gas and
|
|
75
|
+
// WAL, and on mainnet that is real money. Switch both literals to "mainnet"
|
|
76
|
+
// once the flow works for you.
|
|
74
77
|
const config = morseConfig({ network: "testnet" });
|
|
75
78
|
const client = new SuiGrpcClient({ network: "testnet", baseUrl: config.rpcUrl });
|
|
76
|
-
const
|
|
79
|
+
const keypair = Ed25519Keypair.fromSecretKey(privateKey); // Bech32 "suiprivkey1..."
|
|
80
|
+
const adapter = new KeypairAdapter(keypair, client);
|
|
77
81
|
// Browser apps swap KeypairAdapter for a WalletAdapter impl against the
|
|
78
82
|
// connected wallet's signer - see "Adapter pattern" below.
|
|
79
83
|
const reader = RpcPublicationReader.fromMorseConfig(config, client);
|
|
@@ -90,9 +94,11 @@ import {
|
|
|
90
94
|
StorageMode,
|
|
91
95
|
} from "@arcadiasystems/morse-sdk";
|
|
92
96
|
|
|
97
|
+
// Slugs are globally unique on-chain (like usernames) - make yours
|
|
98
|
+
// collision-proof rather than copying a fixed example value.
|
|
93
99
|
const created = await createPublication(adapter, config, {
|
|
94
100
|
name: "My Publication",
|
|
95
|
-
slug:
|
|
101
|
+
slug: `my-pub-${Date.now()}`,
|
|
96
102
|
});
|
|
97
103
|
await createCollection(adapter, config, {
|
|
98
104
|
publicationId: created.publicationId,
|
|
@@ -121,7 +127,7 @@ const fetched = await reader.getEntry(created.publicationId, "blog", entry.entry
|
|
|
121
127
|
|
|
122
128
|
`addEntryFromBytes` runs in **2 wallet popups** (one for `register_blob`, one for the combined `certify_blob + add_entry_to_collection` PTB) instead of the 3 popups a separate `uploadBlob` + `addEntry` would emit. See "Choosing the right entry path" below for when to prefer the lower-level split form.
|
|
123
129
|
|
|
124
|
-
The compile-checked end-to-end version is in [`examples/quickstart.ts`](
|
|
130
|
+
The compile-checked end-to-end version is in [`examples/quickstart.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/quickstart.ts).
|
|
125
131
|
|
|
126
132
|
## Walrus access patterns
|
|
127
133
|
|
|
@@ -129,7 +135,7 @@ morse-sdk ships two pairs of Walrus adapters. They implement the same interfaces
|
|
|
129
135
|
|
|
130
136
|
| Pair | Trust model | Browser CORS | Popup count for upload + addEntry | Storage cost paid by |
|
|
131
137
|
| ----------------------------------------------------------------- | ---------------- | --------------- | --------------------------------- | -------------------- |
|
|
132
|
-
| `DefaultWalrusReadAdapter` + `DefaultWalrusWriteAdapter` | Trustless (direct fanout to ~30 storage nodes) | Spotty on testnet | 2 (with `addEntryFromBytes`) or 3 (split) | Consumer wallet (WAL + gas) |
|
|
138
|
+
| `DefaultWalrusReadAdapter` + `DefaultWalrusWriteAdapter` | Trustless (direct fanout to ~30 storage nodes) | Spotty on testnet; unmeasured on mainnet | 2 (with `addEntryFromBytes`) or 3 (split) | Consumer wallet (WAL + gas) |
|
|
133
139
|
| `HttpAggregatorReadAdapter` + `HttpPublisherWriteAdapter` | Operator-trusted | Reliable | 1 (`uploadBlob` is a publisher HTTP call, only `addEntry` signs) | Publisher operator (WAL); consumer (Sui gas only) |
|
|
134
140
|
|
|
135
141
|
**When to pick which:**
|
|
@@ -139,9 +145,10 @@ morse-sdk ships two pairs of Walrus adapters. They implement the same interfaces
|
|
|
139
145
|
The HTTP adapters are NOT compatible with `addEntryFromBytes` / `addEncryptedEntryFromBytes`. Those functions require `WalrusFlowCapable` for the 2-popup combined PTB; the publisher-paid path is naturally 1-popup through standard `uploadBlob` + `addEntry`.
|
|
140
146
|
|
|
141
147
|
```ts
|
|
142
|
-
// Default (direct, trustless, 2-3 popups)
|
|
143
|
-
|
|
144
|
-
const
|
|
148
|
+
// Default (direct, trustless, 2-3 popups). network is "mainnet" or "testnet";
|
|
149
|
+
// Walrus has no localnet.
|
|
150
|
+
const reader = DefaultWalrusReadAdapter.fromConfig({ network: "mainnet", suiClient });
|
|
151
|
+
const writer = DefaultWalrusWriteAdapter.fromConfig({ network: "mainnet", suiClient }, signer);
|
|
145
152
|
|
|
146
153
|
// HTTP (operator-trusted, 1 popup for upload+addEntry)
|
|
147
154
|
const reader = HttpAggregatorReadAdapter.fromMorseConfig(config, suiClient);
|
|
@@ -151,7 +158,7 @@ const writer = HttpPublisherWriteAdapter.fromConfig({
|
|
|
151
158
|
});
|
|
152
159
|
```
|
|
153
160
|
|
|
154
|
-
The aggregator URL
|
|
161
|
+
The aggregator URL is baked into `morseConfig.walrusEndpoints.aggregator` for both mainnet and testnet (Mysten's canonical service for each). The publisher URL is intentionally not baked in - publishers are operator-specific and consumers pick one explicitly. Note that the publisher in the snippet above is a testnet operator; there is no mainnet equivalent the SDK will pick for you.
|
|
155
162
|
|
|
156
163
|
`HttpPublisherWriteAdapter` parses Mysten's published publisher binary (camelCase JSON) and the documented OpenAPI schema (snake_case fallback). For non-standard publisher forks that serve a different shape, pass `parseResponse` to `HttpPublisherWriteAdapter.fromConfig({ ..., parseResponse })` — it receives the raw decoded JSON and returns an `UploadBlobResult`, replacing the built-in parser. Throws from the callback propagate verbatim.
|
|
157
164
|
|
|
@@ -177,17 +184,17 @@ Per-concern, compile-checked illustrative code. Each file is short, focused, and
|
|
|
177
184
|
|
|
178
185
|
| Concern | File | Covers |
|
|
179
186
|
| ------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
180
|
-
| Setup | [`examples/setup.ts`](
|
|
181
|
-
| Quick start | [`examples/quickstart.ts`](
|
|
182
|
-
| Publication lifecycle | [`examples/publication-lifecycle.ts`](
|
|
183
|
-
| Publisher cap roles | [`examples/publisher-caps.ts`](
|
|
184
|
-
| Collections | [`examples/collections.ts`](
|
|
185
|
-
| Entries (revisions, draft → publish) | [`examples/entries.ts`](
|
|
186
|
-
| Encrypted entries | [`examples/encrypted-entries.ts`](
|
|
187
|
-
| Reading | [`examples/reading.ts`](
|
|
188
|
-
| Browser wallet integration | [`examples/wallet-standard.ts`](
|
|
189
|
-
| React + dapp-kit + Suiet | [`examples/wallet-standard-react.md`](
|
|
190
|
-
| Walrus HTTP adapters | [`examples/walrus-http-adapters.ts`](
|
|
187
|
+
| Setup | [`examples/setup.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/setup.ts) | morseConfig, gRPC client, KeypairAdapter, reader |
|
|
188
|
+
| Quick start | [`examples/quickstart.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/quickstart.ts) | End-to-end happy path |
|
|
189
|
+
| Publication lifecycle | [`examples/publication-lifecycle.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/publication-lifecycle.ts) | createPublication, transferOwnership, deletePublication |
|
|
190
|
+
| Publisher cap roles | [`examples/publisher-caps.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/publisher-caps.ts) | issuePublisherCap, transferPublisherCap, revokePublisherCap, destroyPublisherCap |
|
|
191
|
+
| Collections | [`examples/collections.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/collections.ts) | createCollection (Blob and Quilt modes), deleteCollection |
|
|
192
|
+
| Entries (revisions, draft → publish) | [`examples/entries.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/entries.ts) | addEntry, appendDraftRevision, publishFromDraft, publishDirect, deleteEntry |
|
|
193
|
+
| Encrypted entries | [`examples/encrypted-entries.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/encrypted-entries.ts) | buildPublisherSealId, encrypt, addEncryptedEntry, appendEncryptedDraftRevision, decrypt |
|
|
194
|
+
| Reading | [`examples/reading.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/reading.ts) | getPublication, getEntry, getRevision, listEntries, scanEntries |
|
|
195
|
+
| Browser wallet integration | [`examples/wallet-standard.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/wallet-standard.ts) | WalletAdapter impl against `@mysten/dapp-kit` hooks (or any wallet-standard signer) |
|
|
196
|
+
| React + dapp-kit + Suiet | [`examples/wallet-standard-react.md`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/wallet-standard-react.md) | Worked walkthrough: providers, connect button, hook, adapter wiring, Seal SessionKey |
|
|
197
|
+
| Walrus HTTP adapters | [`examples/walrus-http-adapters.ts`](https://github.com/arcadiasystems/morse-dcms/blob/main/morse-sdk/examples/walrus-http-adapters.ts) | HttpAggregatorReadAdapter + HttpPublisherWriteAdapter (browser-friendly, operator-paid storage) |
|
|
191
198
|
|
|
192
199
|
## API reference
|
|
193
200
|
|
|
@@ -197,8 +204,8 @@ The full public surface, grouped by concern. Every export carries a JSDoc on its
|
|
|
197
204
|
|
|
198
205
|
| Export | Purpose |
|
|
199
206
|
| --- | --- |
|
|
200
|
-
| `morseConfig({ network })` | Build a `NetworkConfig` for testnet (canonical addresses baked in) or supply override fields for forks / local nodes. |
|
|
201
|
-
| `Network` | Const enum-like: `"mainnet" \| "testnet" \| "localnet"`. Mainnet
|
|
207
|
+
| `morseConfig({ network })` | Build a `NetworkConfig` for mainnet or testnet (canonical addresses baked in), or supply override fields for forks / local nodes. |
|
|
208
|
+
| `Network` | Const enum-like: `"mainnet" \| "testnet" \| "localnet"`. Mainnet and testnet resolve to canonical deployments; localnet throws `ConfigurationError` unless you pass `packageId` and `registryId`. |
|
|
202
209
|
| `DEFAULT_RPC_URLS` | Public Sui fullnode URLs per network. Read-only. |
|
|
203
210
|
| `TESTED_SUBSTRATE` | Mysten substrate versions verified end-to-end. Diagnostic constant. |
|
|
204
211
|
|
|
@@ -216,13 +223,12 @@ The full public surface, grouped by concern. Every export carries a JSDoc on its
|
|
|
216
223
|
| `addEntry` / `addEncryptedEntry` | Lower-level: add entry against a pre-uploaded `blobObjectId`. |
|
|
217
224
|
| `appendDraftRevision` / `appendEncryptedDraftRevision` / `publishFromDraft` / `publishDirect` | Revision lifecycle on existing entries. |
|
|
218
225
|
| `deleteEntry` | Remove an entry and its revisions. |
|
|
219
|
-
| `
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `updateFileMetadata` / `transferFileOwnership` / `deleteFile` | File metadata lifecycle (owner-only). |
|
|
226
|
+
| `createRecipientFile(adapter, config, args)` | Register + share a `RecipientFile` for a blob already on Walrus (single PTB). |
|
|
227
|
+
| `createEncryptedRecipientFile(adapter, config, args)` | Same, for a blob already Seal-encrypted under a caller-supplied `sealIdPrefix`. |
|
|
228
|
+
| `uploadRecipientFileFromBytes(adapter, config, args)` | **Recommended.** Upload bytes + register + share a `RecipientFile` addressed to N recipients in 2 wallet popups. |
|
|
229
|
+
| `uploadEncryptedRecipientFileFromBytes(adapter, config, args)` | **Recommended.** Encrypt via Seal + upload + register in 2 wallet popups; returns `{ sealIdPrefix, sealNonce, fileId, ... }` for later decrypt. |
|
|
230
|
+
| `addRecipient` / `removeRecipient` | Mutate the file's embedded recipient set (owner-only). |
|
|
231
|
+
| `updateRecipientFileMetadata` / `transferRecipientFileOwnership` / `deleteRecipientFile` | RecipientFile lifecycle (owner-only). |
|
|
226
232
|
|
|
227
233
|
### Reader (RPC-backed)
|
|
228
234
|
|
|
@@ -232,9 +238,10 @@ The full public surface, grouped by concern. Every export carries a JSDoc on its
|
|
|
232
238
|
| `reader.getPublication` / `getEntry` / `getRevision` / `getPublisherCap` | Single-object reads. |
|
|
233
239
|
| `reader.listPublicationsOwnedBy` / `listPublisherCapsOwnedBy` / `listEntries` | Paginated lists. |
|
|
234
240
|
| `reader.scanEntries` | Async-iterator over every entry in a collection. |
|
|
235
|
-
| `
|
|
236
|
-
| `filesReader.
|
|
237
|
-
| `
|
|
241
|
+
| `RpcRecipientFilesReader.fromMorseConfig(config, client)` | Construct a reader for the `recipient_file` module. |
|
|
242
|
+
| `filesReader.getRecipientFile(id)` | Live single-object read (parses embedded `members`, blob refs). |
|
|
243
|
+
| `buildRecipientFileEventTypes(originPackageId)` | Fully-qualified event type strings for the `RecipientFile*` events; pass `config.recipientFileEventOriginPackageId`. |
|
|
244
|
+
| `reconcileRecipientFilesOwnedBy(events, address, eventTypes)` / `reconcileRecipientFilesAccessibleBy(...)` | Pure event-reconciliation helpers — bring your own indexer, get current file sets back. |
|
|
238
245
|
|
|
239
246
|
### Adapters
|
|
240
247
|
|
|
@@ -248,7 +255,7 @@ The full public surface, grouped by concern. Every export carries a JSDoc on its
|
|
|
248
255
|
| `DefaultWalrusReadAdapter.fromConfig(config)` | Walrus reads (`readBlob`, `readBlobByObjectId`, `readQuiltPatch`, `readBlobRef`). |
|
|
249
256
|
| `HttpPublisherWriteAdapter.fromConfig({ publisherUrl, ownerAddress })` | Walrus uploads via a publisher HTTP service (operator pays storage; 1 popup for upload + addEntry). |
|
|
250
257
|
| `HttpAggregatorReadAdapter.fromMorseConfig(config, suiClient)` / `.fromConfig({ aggregatorUrl, suiClient })` | Walrus reads via a single CORS-friendly aggregator endpoint instead of fanout to ~30 storage nodes. |
|
|
251
|
-
| `DefaultSealAdapter.fromMorseConfig(config, options, suiClient)` | Threshold encryption / decryption. Defaults canonical testnet
|
|
258
|
+
| `DefaultSealAdapter.fromMorseConfig(config, options, suiClient)` | Threshold encryption / decryption. Defaults the canonical key servers for the network (two independent servers on testnet, Mysten's committee on mainnet). |
|
|
252
259
|
| `WalletAdapter` / `WalrusWriteAdapter` / `WalrusReadAdapter` / `SealAdapter` | Interfaces for substituting custom implementations. |
|
|
253
260
|
| `WalrusFlowCapable` / `isWalrusFlowCapable` | Optional capability for the 2-popup `addEntryFromBytes` path. |
|
|
254
261
|
|
|
@@ -258,8 +265,10 @@ The full public surface, grouped by concern. Every export carries a JSDoc on its
|
|
|
258
265
|
| --- | --- |
|
|
259
266
|
| `buildPublisherSealId(publicationId, nonce)` | Build a publisher-policy Seal identity (`pubId(32) \|\| tag(1) \|\| nonce`). |
|
|
260
267
|
| `decodePublisherSealId(sealId)` | Inspect a publisher identity. Throws `ValidationError` on tampered tags. |
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
268
|
+
| `buildRecipientFileSealId(prefix, nonce)` | Build a recipient-file Seal identity (`prefix \|\| tag(3) \|\| nonce`). |
|
|
269
|
+
| `decodeRecipientFileSealId(sealId, prefixLength)` | Inspect a recipient-file identity (layout is not self-delimiting; caller supplies `prefixLength`). |
|
|
270
|
+
| `randomSealPrefix()` / `randomSealNonce()` | Helpers for the common case: 32 random prefix bytes / 16 random nonce bytes. |
|
|
271
|
+
| `RECOMMENDED_SEAL_PREFIX_BYTES` / `RECOMMENDED_SEAL_NONCE_BYTES` | The recommended sizes as constants (32 / 16). |
|
|
263
272
|
|
|
264
273
|
### Codecs (branded ID constructors)
|
|
265
274
|
|
|
@@ -287,7 +296,7 @@ The full public surface, grouped by concern. Every export carries a JSDoc on its
|
|
|
287
296
|
|
|
288
297
|
### Types
|
|
289
298
|
|
|
290
|
-
`Publication`, `Collection`, `Entry`, `Revision`, `PublisherCap`, `OwnerCap`, `BlobRef`, `AccessPolicy`, `StorageMode`, `SealPolicyTag`, branded ID types (`PublicationId`, `BlobObjectId`, `WalrusBlobId`, `QuiltPatchId`, etc.).
|
|
299
|
+
`Publication`, `Collection`, `Entry`, `Revision`, `PublisherCap`, `OwnerCap`, `BlobRef`, `AccessPolicy`, `StorageMode`, `SealPolicyTag`, `RecipientFile` / `RecipientFileSummary` / `RecipientFileFull`, branded ID types (`PublicationId`, `RecipientFileId`, `BlobObjectId`, `WalrusBlobId`, `QuiltPatchId`, etc.).
|
|
291
300
|
|
|
292
301
|
## Conceptual model
|
|
293
302
|
|
|
@@ -424,13 +433,20 @@ Copy uses the protocol's own terminology ("publication", "entry", "PublisherCap"
|
|
|
424
433
|
## Network configuration
|
|
425
434
|
|
|
426
435
|
```ts
|
|
427
|
-
const config = morseConfig({ network: "
|
|
436
|
+
const config = morseConfig({ network: "mainnet" }); // or "testnet"
|
|
428
437
|
// {
|
|
429
|
-
// network, rpcUrl, packageId, originalPackageId,
|
|
430
|
-
//
|
|
438
|
+
// network, rpcUrl, packageId, originalPackageId,
|
|
439
|
+
// recipientFileEventOriginPackageId, registryId,
|
|
440
|
+
// sealKeyServers: [...], // canonical allowlist for the network
|
|
441
|
+
// walrusEndpoints: { aggregator }
|
|
431
442
|
// }
|
|
432
443
|
```
|
|
433
444
|
|
|
445
|
+
The two networks differ in their Seal allowlist, and the difference is not cosmetic:
|
|
446
|
+
|
|
447
|
+
- **testnet** pins two independent Mysten key servers, so the default threshold is 2 of 2.
|
|
448
|
+
- **mainnet** pins Mysten's decentralized committee: one endpoint that fans out to 8 operators and needs 5 to agree. Seal models it as a single server, so the default threshold is 1 - the real quorum is enforced inside the aggregator, not by this SDK. Mainnet has no free open independent servers; the independent operators are commercial and issue per-consumer API keys. Pass `seal.serverConfigs` to `DefaultSealAdapter.fromMorseConfig` if you would rather not route through one Mysten-run URL.
|
|
449
|
+
|
|
434
450
|
Override individual fields for forks or local nodes:
|
|
435
451
|
|
|
436
452
|
```ts
|
|
@@ -446,17 +462,18 @@ const config = morseConfig({
|
|
|
446
462
|
|
|
447
463
|
## Known limitations
|
|
448
464
|
|
|
449
|
-
- **
|
|
465
|
+
- **Unaudited contracts**. The Move package has not been audited. This is the main reason to be conservative about what you put on mainnet.
|
|
450
466
|
- **No encrypted publish path**. The Move contract hardcodes `encrypted=false` on `publish_from_draft` and `publish_direct`. Encrypted content stays as drafts.
|
|
451
467
|
- **`Subscription` access policy is reserved**, not enforced.
|
|
452
468
|
- **`listEntries` ordering is dynamic-field object-store order**, not chronological. Sort by `entry.id` for insertion order.
|
|
453
|
-
- **Walrus
|
|
454
|
-
- **Walrus uploads need WAL, not just SUI**.
|
|
455
|
-
- **
|
|
469
|
+
- **Walrus flakiness**. `NotEnoughBlobConfirmationsError` from the underlying client is environmental; rerun. The SDK preserves the original error as the `cause` (use `instanceof` for narrowing - Walrus error classes don't set `.name`). Browser consumers may additionally see `NoBlobMetadataReceivedError` on reads from testnet due to CORS gaps on a subset of Walrus storage nodes; `HttpAggregatorReadAdapter` exists to route around that. Mainnet node CORS coverage has not been measured by this project, so browser fanout reads there are unproven rather than known-good.
|
|
470
|
+
- **Walrus uploads need WAL, not just SUI**. Uploads error with `Insufficient balance of ::wal::WAL` if you skip this. On testnet, get SUI from the [Sui faucet](https://faucet.sui.io/) and swap some for WAL at [stake-wal.wal.app](https://stake-wal.wal.app/?network=testnet). On mainnet there is no faucet: both SUI and WAL have to be acquired, and every upload spends real value.
|
|
471
|
+
- **Walrus storage is epoch-funded, not permanent**. Blobs persist for the epochs you pay for and expire afterwards unless renewed, on both networks. Epoch length differs (a testnet epoch is roughly a day; mainnet epochs are much longer), so the same `epochs` argument buys very different durations. Walrus testnet is additionally wiped periodically, so treat testnet payloads as disposable; mainnet blobs are not wiped but still lapse if you let storage expire. The on-chain revision history is immutable either way.
|
|
472
|
+
- **gRPC client only**. The reader and adapter interfaces are typed against `Pick<SuiGrpcClient, ...>` from `@mysten/sui/grpc`. `SuiJsonRpcClient` from `@mysten/sui/jsonRpc` has differently-named methods (`getDynamicFields` vs `listDynamicFields`, etc.) and is not yet a drop-in alternative. JSON-RPC fallback is planned; for now, environments that block gRPC need to proxy or use a gRPC-compatible RPC endpoint.
|
|
456
473
|
|
|
457
474
|
## Smoke scripts
|
|
458
475
|
|
|
459
|
-
The `scripts/` directory has end-to-end
|
|
476
|
+
The `scripts/` directory has end-to-end smokes that cost real WAL and SUI. They're the canonical "this works against the live deployment" checks. All of them are hardcoded to testnet via `scripts/_shared.ts`; running them against mainnet would spend real value and is not wired up.
|
|
460
477
|
|
|
461
478
|
| Script | Exercises |
|
|
462
479
|
| ------------------------- | -------------------------------------------------- |
|
|
@@ -470,7 +487,15 @@ The `scripts/` directory has end-to-end testnet smokes that cost real WAL and SU
|
|
|
470
487
|
| `phase-6-blob-http.ts` | HTTP publisher upload + aggregator read; skips when `WALRUS_PUBLISHER_URL` unset |
|
|
471
488
|
| `phase-7-encrypted-http.ts` | HTTP variant of phase-7; skips when `WALRUS_PUBLISHER_URL` unset |
|
|
472
489
|
|
|
473
|
-
Each requires `PRIVATE_KEY` (Bech32 `suiprivkey1...`) on
|
|
490
|
+
Each requires `PRIVATE_KEY` (Bech32 `suiprivkey1...`) on a funded address; phase-5 onward also needs WAL on the same address. Phase-7 picks up Seal key servers from `morseConfig.sealKeyServers` by default - pass `SEAL_KEY_SERVERS` only if you want to override with a custom set.
|
|
491
|
+
|
|
492
|
+
`MORSE_NETWORK` selects the target network and defaults to `testnet`. Only `mainnet` and `testnet` are accepted, since Walrus has no localnet. Running against mainnet additionally requires `MORSE_ALLOW_MAINNET=1`:
|
|
493
|
+
|
|
494
|
+
```sh
|
|
495
|
+
MORSE_NETWORK=mainnet MORSE_ALLOW_MAINNET=1 bun run scripts/phase-2-publication.ts
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
The second variable is not redundant. These scripts create and delete real publications, collections, entries and Walrus blobs, which on mainnet costs real SUI and WAL. Requiring two variables means an inherited `MORSE_NETWORK` from another shell cannot quietly spend money. Every script derives its Walrus and Sui clients from the same resolved network, so a mainnet Sui client can never pair with a testnet Walrus client.
|
|
474
499
|
|
|
475
500
|
## Development
|
|
476
501
|
|
|
@@ -482,7 +507,7 @@ bun install
|
|
|
482
507
|
bun run lint
|
|
483
508
|
bun run typecheck
|
|
484
509
|
bun run test
|
|
485
|
-
bun run test:coverage #
|
|
510
|
+
bun run test:coverage # per-file coverage report
|
|
486
511
|
bun run build
|
|
487
512
|
```
|
|
488
513
|
|
package/dist/config.d.ts
CHANGED
|
@@ -59,16 +59,24 @@ export interface NetworkConfig {
|
|
|
59
59
|
/**
|
|
60
60
|
* Canonical Seal threshold-encryption key servers for the network. Used by
|
|
61
61
|
* `DefaultSealAdapter.fromMorseConfig` when the consumer omits an explicit
|
|
62
|
-
* `serverConfigs`. Empty for networks
|
|
63
|
-
*
|
|
62
|
+
* `serverConfigs`. Empty for networks with no pinned allowlist (localnet,
|
|
63
|
+
* custom deployments), which makes the encrypted paths throw
|
|
64
|
+
* `ConfigurationError` until the consumer supplies `serverConfigs`.
|
|
65
|
+
*
|
|
66
|
+
* Entries are `@mysten/seal` `KeyServerConfig` objects and are passed
|
|
67
|
+
* through untouched. Seal distinguishes two server types and enforces the
|
|
68
|
+
* distinction at client construction: a committee-mode server REQUIRES
|
|
69
|
+
* `aggregatorUrl`, an independent server must NOT have it. Getting this
|
|
70
|
+
* wrong surfaces as `InvalidClientOptionsError` at runtime, not at compile
|
|
71
|
+
* time, so `config.test.ts` guards both directions.
|
|
64
72
|
*/
|
|
65
73
|
readonly sealKeyServers: readonly KeyServerConfig[];
|
|
66
74
|
/**
|
|
67
75
|
* Canonical Walrus HTTP endpoints for the network. Used by
|
|
68
76
|
* `HttpAggregatorReadAdapter.fromMorseConfig` (and the future publisher
|
|
69
77
|
* equivalent when a "canonical" publisher exists). Aggregator is pinned
|
|
70
|
-
* to Mysten's
|
|
71
|
-
* undefined
|
|
78
|
+
* to Mysten's service for the network; publisher is intentionally left
|
|
79
|
+
* undefined - pass `walrusEndpoints.publisher` to override.
|
|
72
80
|
*/
|
|
73
81
|
readonly walrusEndpoints: WalrusEndpoints;
|
|
74
82
|
}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAIpD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxD,8BAA8B;AAC9B,eAAO,MAAM,OAAO;;;;CAIV,CAAC;AACX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,CAA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H,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,aAAa,CA6BtE"}
|
package/dist/config.js
CHANGED
|
@@ -20,11 +20,50 @@ export const DEFAULT_RPC_URLS = {
|
|
|
20
20
|
};
|
|
21
21
|
// morseConfig factory
|
|
22
22
|
/**
|
|
23
|
-
* Canonical Morse deployment addresses per network.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* Canonical Morse deployment addresses per network. Mirrors
|
|
24
|
+
* `morse-contracts/Published.toml`; update on every contract publish or
|
|
25
|
+
* upgrade. Networks absent from this map require explicit `packageId` and
|
|
26
|
+
* `registryId` overrides.
|
|
26
27
|
*/
|
|
27
28
|
const KNOWN_DEPLOYMENTS = {
|
|
29
|
+
mainnet: {
|
|
30
|
+
// Published 2026-09-09, tx HmiywHYifmrNLMvY2oT8cP5W9hpQc2wFTJAaaQoM8mLY.
|
|
31
|
+
// A fresh v1 publish with no upgrades, so published-at, original-id, and
|
|
32
|
+
// the recipient_file type origin are all the same address. They are
|
|
33
|
+
// spelled out separately rather than aliased because the FIRST upgrade
|
|
34
|
+
// splits them: packageId moves, the other two stay here. See the testnet
|
|
35
|
+
// entry below for what that divergence looks like in practice.
|
|
36
|
+
packageId: toPackageId("0x4fc7af5d1e19f96e5fab4e677948214eec35e238b252a106c7d5036dcebdcae2"),
|
|
37
|
+
originalPackageId: toPackageId("0x4fc7af5d1e19f96e5fab4e677948214eec35e238b252a106c7d5036dcebdcae2"),
|
|
38
|
+
recipientFileEventOriginPackageId: toPackageId("0x4fc7af5d1e19f96e5fab4e677948214eec35e238b252a106c7d5036dcebdcae2"),
|
|
39
|
+
// Shared PublicationRegistry created by the publish tx's init.
|
|
40
|
+
registryId: toRegistryId("0x8d8b23c7acd7c1b260c793f2c648c5be8eb06db7c107b9f06ca3f39b700868ea"),
|
|
41
|
+
// Mysten's decentralized Seal committee. Unlike testnet (two independent
|
|
42
|
+
// servers), mainnet has no free open allowlist: the independent mainnet
|
|
43
|
+
// operators are commercial and issue API keys per consumer. The committee
|
|
44
|
+
// is the one no-signup option.
|
|
45
|
+
//
|
|
46
|
+
// Committee mode is a single logical server that fans out to 8 operators
|
|
47
|
+
// and needs 5 to agree, so `aggregatorUrl` is MANDATORY here (Seal throws
|
|
48
|
+
// InvalidClientOptionsError without it) and one entry with weight 1 is
|
|
49
|
+
// the correct shape. `DefaultSealAdapter.fromMorseConfig` derives
|
|
50
|
+
// threshold = min(2, 1) = 1, which is right: the real quorum is internal
|
|
51
|
+
// to the aggregator, not something this SDK can or should express.
|
|
52
|
+
// Consumers who would rather not route through one Mysten-run URL pass
|
|
53
|
+
// their own `seal.serverConfigs`.
|
|
54
|
+
sealKeyServers: [
|
|
55
|
+
{
|
|
56
|
+
objectId: "0x686098f1439237fff9f36b99c7329683c22979d2005c2465cb891acb012a7595",
|
|
57
|
+
weight: 1,
|
|
58
|
+
aggregatorUrl: "https://seal-aggregator-mainnet.mystenlabs.com",
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
// Canonical Mysten-run Walrus mainnet aggregator. Publisher is left
|
|
62
|
+
// undefined for the same reason as testnet: no single canonical operator.
|
|
63
|
+
walrusEndpoints: {
|
|
64
|
+
aggregator: "https://aggregator.walrus-mainnet.walrus.space",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
28
67
|
testnet: {
|
|
29
68
|
// Updated 2026-06-04 for v4 upgrade (recipient_file::new_recipient_file_with_seal_prefix
|
|
30
69
|
// + seal_approve_with_prefix added; legacy file/allowlist modules unused).
|
|
@@ -55,7 +94,7 @@ const KNOWN_DEPLOYMENTS = {
|
|
|
55
94
|
// `HttpAggregatorReadAdapter.fromMorseConfig` for browser dapps that
|
|
56
95
|
// need a single CORS-friendly endpoint instead of the direct-protocol
|
|
57
96
|
// shard fanout (which has incomplete CORS coverage on testnet).
|
|
58
|
-
// Publisher is intentionally undefined
|
|
97
|
+
// Publisher is intentionally undefined - there is no single canonical
|
|
59
98
|
// testnet publisher; consumers wire their own (Nami, self-hosted, etc).
|
|
60
99
|
walrusEndpoints: {
|
|
61
100
|
aggregator: "https://aggregator.walrus-testnet.walrus.space",
|
|
@@ -76,9 +115,6 @@ export function morseConfig(options) {
|
|
|
76
115
|
deployment?.recipientFileEventOriginPackageId;
|
|
77
116
|
const registryId = options.registryId ?? deployment?.registryId;
|
|
78
117
|
if (!packageId || !registryId) {
|
|
79
|
-
if (options.network === "mainnet") {
|
|
80
|
-
throw new ConfigurationError("Morse is not yet deployed on mainnet. Use { network: 'testnet' } or supply packageId, originalPackageId, and registryId for a custom deployment.");
|
|
81
|
-
}
|
|
82
118
|
throw new ConfigurationError(`No canonical Morse deployment for network "${options.network}". Supply packageId, originalPackageId, and registryId for a custom deployment.`);
|
|
83
119
|
}
|
|
84
120
|
return {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,UAAU;AAEV,8BAA8B;AAC9B,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACX,CAAC;AAGX,wBAAwB;AAExB,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IAClE,OAAO,EAAE,qCAAqC;IAC9C,OAAO,EAAE,qCAAqC;IAC9C,QAAQ,EAAE,uBAAuB;CACjC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGjD,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,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC;QACjE,GAAG,CAAC,iCAAiC,KAAK,SAAS;YAClD,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,iCAAiC,EAAE,CAAC;QACzC,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,UAAU,EAAE,cAAc,IAAI,EAAE;QAC1E,eAAe,EAAE,OAAO,CAAC,eAAe;YACvC,UAAU,EAAE,eAAe,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;KAClD,CAAC;AACH,CAAC"}
|
|
@@ -69,8 +69,8 @@ export declare class DefaultSealAdapter implements SealAdapter {
|
|
|
69
69
|
/**
|
|
70
70
|
* Build an adapter from a morse package config (typically
|
|
71
71
|
* `morseConfig({ network })`). Defaults `serverConfigs` from
|
|
72
|
-
* `morseConfig.sealKeyServers` (the canonical
|
|
73
|
-
*
|
|
72
|
+
* `morseConfig.sealKeyServers` (the canonical allowlist baked into
|
|
73
|
+
* morse-sdk for the network) when omitted; defaults `threshold` to
|
|
74
74
|
* `min(2, serverConfigs.length)` when omitted. Picks
|
|
75
75
|
* `originalPackageId ?? packageId` internally; passing a post-upgrade
|
|
76
76
|
* `packageId` directly would silently produce ciphertexts that become
|
|
@@ -80,9 +80,17 @@ export declare class DefaultSealAdapter implements SealAdapter {
|
|
|
80
80
|
* want a custom set (paid plans, alternate trust assumptions, region
|
|
81
81
|
* pinning), or `threshold` when you want a non-default TSS shape.
|
|
82
82
|
*
|
|
83
|
+
* On the default threshold: mainnet's canonical allowlist is a single
|
|
84
|
+
* committee-mode server, so `min(2, 1)` resolves to 1. That is correct and
|
|
85
|
+
* not a weakened policy - a committee server is one endpoint fronting 8
|
|
86
|
+
* operators with its own internal quorum, which Seal enforces behind the
|
|
87
|
+
* aggregator and this SDK cannot express as a share count. Do not "fix"
|
|
88
|
+
* this by forcing a higher threshold; `fromConfig` would reject it, since
|
|
89
|
+
* threshold must be <= `serverConfigs.length`.
|
|
90
|
+
*
|
|
83
91
|
* @throws {ConfigurationError} If neither `seal.serverConfigs` nor
|
|
84
|
-
* `morseConfig.sealKeyServers` provide any servers (
|
|
85
|
-
*
|
|
92
|
+
* `morseConfig.sealKeyServers` provide any servers (localnet, or a
|
|
93
|
+
* custom deployment with no allowlist supplied).
|
|
86
94
|
*/
|
|
87
95
|
static fromMorseConfig(morseConfig: {
|
|
88
96
|
packageId: PackageId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-adapter.d.ts","sourceRoot":"","sources":["../../src/seal/default-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAIN,KAAK,eAAe,EAGpB,KAAK,oBAAoB,EACzB,KAAK,UAAU,EAEf,MAAM,cAAc,CAAC;AAUtB,OAAO,KAAK,EACX,SAAS,EAKT,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACX,WAAW,EACX,kBAAkB,EAClB,oCAAoC,EACpC,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,cAAc,CAAC;AAGtB;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,SAAS,eAAe,EAAE,CAAC;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,4EAA4E;AAC5E,UAAU,cAAc;IACvB,OAAO,CAAC,IAAI,EAAE;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,UAAU,CAAC;QACjB,GAAG,C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AAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,yBAAyB;IAQ9C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CAAC,eAAe,CACrB,WAAW,EAAE;QACZ,SAAS,EAAE,SAAS,CAAC;QACrB,iBAAiB,CAAC,EAAE,SAAS,CAAC;QAC9B,cAAc,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;KAC5C,EACD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,EACnD,SAAS,EAAE,oBAAoB,GAC7B,kBAAkB;IAiCrB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAChB,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,oBAAoB,GAC7B,kBAAkB;IAkCf,OAAO,CACZ,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAAC,iBAAiB,CAAC;IAgBvB,OAAO,CACZ,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAAC,UAAU,CAAC;IAkChB,yBAAyB,CAC9B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,oCAAoC,GAC3C,OAAO,CAAC,UAAU,CAAC;YAsBR,uBAAuB;YA6BvB,gCAAgC;CA0B9C"}
|
|
@@ -27,8 +27,8 @@ export class DefaultSealAdapter {
|
|
|
27
27
|
/**
|
|
28
28
|
* Build an adapter from a morse package config (typically
|
|
29
29
|
* `morseConfig({ network })`). Defaults `serverConfigs` from
|
|
30
|
-
* `morseConfig.sealKeyServers` (the canonical
|
|
31
|
-
*
|
|
30
|
+
* `morseConfig.sealKeyServers` (the canonical allowlist baked into
|
|
31
|
+
* morse-sdk for the network) when omitted; defaults `threshold` to
|
|
32
32
|
* `min(2, serverConfigs.length)` when omitted. Picks
|
|
33
33
|
* `originalPackageId ?? packageId` internally; passing a post-upgrade
|
|
34
34
|
* `packageId` directly would silently produce ciphertexts that become
|
|
@@ -38,9 +38,17 @@ export class DefaultSealAdapter {
|
|
|
38
38
|
* want a custom set (paid plans, alternate trust assumptions, region
|
|
39
39
|
* pinning), or `threshold` when you want a non-default TSS shape.
|
|
40
40
|
*
|
|
41
|
+
* On the default threshold: mainnet's canonical allowlist is a single
|
|
42
|
+
* committee-mode server, so `min(2, 1)` resolves to 1. That is correct and
|
|
43
|
+
* not a weakened policy - a committee server is one endpoint fronting 8
|
|
44
|
+
* operators with its own internal quorum, which Seal enforces behind the
|
|
45
|
+
* aggregator and this SDK cannot express as a share count. Do not "fix"
|
|
46
|
+
* this by forcing a higher threshold; `fromConfig` would reject it, since
|
|
47
|
+
* threshold must be <= `serverConfigs.length`.
|
|
48
|
+
*
|
|
41
49
|
* @throws {ConfigurationError} If neither `seal.serverConfigs` nor
|
|
42
|
-
* `morseConfig.sealKeyServers` provide any servers (
|
|
43
|
-
*
|
|
50
|
+
* `morseConfig.sealKeyServers` provide any servers (localnet, or a
|
|
51
|
+
* custom deployment with no allowlist supplied).
|
|
44
52
|
*/
|
|
45
53
|
static fromMorseConfig(morseConfig, seal, suiClient) {
|
|
46
54
|
const serverConfigs = seal.serverConfigs ?? morseConfig.sealKeyServers ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-adapter.js","sourceRoot":"","sources":["../../src/seal/default-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EAEtB,aAAa,EACb,UAAU,EAGV,kCAAkC,GAClC,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EACN,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,eAAe,GACf,MAAM,cAAc,CAAC;AAetB,OAAO,EAAE,qBAAqB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,aAAa,EAAE,CAAC;QACpC,OAAO,IAAI,SAAS,CAAC,WAAW,EAAE,uBAAuB,KAAK,CAAC,OAAO,EAAE,EAAE;YACzE,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,YAAY,sBAAsB,EAAE,CAAC;QAC7C,OAAO,IAAI,SAAS,CAAC,iBAAiB,EAAE,0BAA0B,EAAE;YACnE,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,KAAK,YAAY,kCAAkC,EAAE,CAAC;QACzD,OAAO,IAAI,SAAS,CACnB,cAAc,EACd,6CAA6C,EAC7C,EAAE,KAAK,EAAE,CACT,CAAC;IACH,CAAC;IACD,IACC,KAAK,YAAY,eAAe;QAChC,KAAK,YAAY,sBAAsB,EACtC,CAAC;QACF,OAAO,IAAI,SAAS,CACnB,gBAAgB,EAChB,2BAA2B,KAAK,CAAC,OAAO,EAAE,EAC1C,EAAE,KAAK,EAAE,CACT,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACvC,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,qBAAqB,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC3B,CAAC;AAED,SAAS,UAAU,CAAC,KAAiB;IACpC,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* committee. On testnet a subset of those nodes do not ship CORS headers,
|
|
8
8
|
* so browser fetches frequently fail with `NoBlobMetadataReceivedError`
|
|
9
9
|
* even when the blob is healthy. CLI smokes against the same blob succeed
|
|
10
|
-
* because the CLI does not enforce CORS.
|
|
10
|
+
* because the CLI does not enforce CORS. Mainnet node CORS coverage has not
|
|
11
|
+
* been measured by this project, so treat the fanout path there as unproven
|
|
12
|
+
* from a browser rather than assumed good. The aggregator HTTP service is a
|
|
11
13
|
* Walrus-operator-run wrapper that internally does the shard math and
|
|
12
14
|
* exposes a single CORS-friendly endpoint.
|
|
13
15
|
*
|
|
@@ -92,7 +94,7 @@ export declare class HttpAggregatorReadAdapter implements WalrusReadAdapter {
|
|
|
92
94
|
* `headers` here if you want them; everything else is inferred.
|
|
93
95
|
*
|
|
94
96
|
* @throws {ConfigurationError} If the network has no canonical aggregator
|
|
95
|
-
* URL (
|
|
97
|
+
* URL (localnet, or a custom-deployment config without
|
|
96
98
|
* `walrusEndpoints.aggregator` supplied).
|
|
97
99
|
*/
|
|
98
100
|
static fromMorseConfig(morseConfig: Pick<NetworkConfig, "walrusEndpoints">, suiClient: ObjectReader, extras?: Pick<HttpAggregatorReadAdapterOptions, "headers" | "fetch" | "verifyBlobIntegrity">): HttpAggregatorReadAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-aggregator-read-adapter.d.ts","sourceRoot":"","sources":["../../src/walrus/http-aggregator-read-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"http-aggregator-read-adapter.d.ts","sourceRoot":"","sources":["../../src/walrus/http-aggregator-read-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAOlD,OAAO,KAAK,EACX,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACX,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,2B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AAqB,CAC3C,GACC,yBAAyB;IAkBtB,QAAQ,CACb,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC;IAgBhB,kBAAkB,CACvB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC;IAQhB,cAAc,CACnB,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC;IAMhB,WAAW,CAChB,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE,iBAAsB,GAC7B,OAAO,CAAC,UAAU,CAAC;YAOR,UAAU;YAgDV,uBAAuB;CAmDrC"}
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* committee. On testnet a subset of those nodes do not ship CORS headers,
|
|
8
8
|
* so browser fetches frequently fail with `NoBlobMetadataReceivedError`
|
|
9
9
|
* even when the blob is healthy. CLI smokes against the same blob succeed
|
|
10
|
-
* because the CLI does not enforce CORS.
|
|
10
|
+
* because the CLI does not enforce CORS. Mainnet node CORS coverage has not
|
|
11
|
+
* been measured by this project, so treat the fanout path there as unproven
|
|
12
|
+
* from a browser rather than assumed good. The aggregator HTTP service is a
|
|
11
13
|
* Walrus-operator-run wrapper that internally does the shard math and
|
|
12
14
|
* exposes a single CORS-friendly endpoint.
|
|
13
15
|
*
|
|
@@ -65,13 +67,13 @@ export class HttpAggregatorReadAdapter {
|
|
|
65
67
|
* `headers` here if you want them; everything else is inferred.
|
|
66
68
|
*
|
|
67
69
|
* @throws {ConfigurationError} If the network has no canonical aggregator
|
|
68
|
-
* URL (
|
|
70
|
+
* URL (localnet, or a custom-deployment config without
|
|
69
71
|
* `walrusEndpoints.aggregator` supplied).
|
|
70
72
|
*/
|
|
71
73
|
static fromMorseConfig(morseConfig, suiClient, extras) {
|
|
72
74
|
const url = morseConfig.walrusEndpoints?.aggregator ?? "";
|
|
73
75
|
if (url.length === 0) {
|
|
74
|
-
throw new ConfigurationError("morseConfig.walrusEndpoints.aggregator is empty. Pass an aggregator URL explicitly to HttpAggregatorReadAdapter.fromConfig({ aggregatorUrl, suiClient }), or use a network where the endpoint is pinned (testnet).");
|
|
76
|
+
throw new ConfigurationError("morseConfig.walrusEndpoints.aggregator is empty. Pass an aggregator URL explicitly to HttpAggregatorReadAdapter.fromConfig({ aggregatorUrl, suiClient }), or use a network where the endpoint is pinned (mainnet, testnet).");
|
|
75
77
|
}
|
|
76
78
|
return new HttpAggregatorReadAdapter({
|
|
77
79
|
aggregatorUrl: url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-aggregator-read-adapter.js","sourceRoot":"","sources":["../../src/walrus/http-aggregator-read-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"http-aggregator-read-adapter.js","sourceRoot":"","sources":["../../src/walrus/http-aggregator-read-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,GACf,MAAM,cAAc,CAAC;AAWtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAwD3D;;;;;GAKG;AACH,MAAM,OAAO,yBAAyB;IAC5B,cAAc,CAAS;IACvB,UAAU,CAAe;IACzB,QAAQ,CAAe;IACvB,MAAM,CAAY;IAClB,oBAAoB,CAA4B;IAEzD,YAAY,OAAyC;QACpD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;YAAE,IAA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,CACT,CAAC;QACH,CAAC;IACF,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcadiasystems/morse-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "TypeScript SDK for Morse dCMS on the Sui blockchain.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"prebuild": "rm -rf dist",
|
|
44
|
+
"prepublishOnly": "bun run lint && bun run typecheck && bun test && bun run build",
|
|
44
45
|
"build": "tsc -p tsconfig.build.json",
|
|
45
46
|
"typecheck": "tsc --noEmit",
|
|
46
47
|
"lint": "biome check .",
|
|
@@ -57,14 +58,6 @@
|
|
|
57
58
|
"@mysten/sui": ">=2.16.2 <2.17.0",
|
|
58
59
|
"@mysten/walrus": ">=1.1.6 <1.2.0"
|
|
59
60
|
},
|
|
60
|
-
"peerDependenciesMeta": {
|
|
61
|
-
"@mysten/seal": {
|
|
62
|
-
"optional": true
|
|
63
|
-
},
|
|
64
|
-
"@mysten/walrus": {
|
|
65
|
-
"optional": true
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
61
|
"devDependencies": {
|
|
69
62
|
"@biomejs/biome": "2.4.7",
|
|
70
63
|
"@mysten/bcs": "2.0.3",
|