@seedprotocol/publish 0.7.4 → 0.7.5-next.850.g9ab585b

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +223 -3
  2. package/README.md +31 -8
  3. package/dist/{chainConfig-DM9RSIMT.js → chainConfig-BWzE8DIF.js} +1347 -1356
  4. package/dist/chainConfig-BWzE8DIF.js.map +1 -0
  5. package/dist/config.d.ts +11 -5
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/{ensureAutomationSessionKey-DTO5lxXB.js → ensureAutomationSessionKey-BenLVZk4.js} +22 -22
  8. package/dist/{ensureAutomationSessionKey-DTO5lxXB.js.map → ensureAutomationSessionKey-BenLVZk4.js.map} +1 -1
  9. package/dist/{ensureModularPublishBootstrap-BYySx3sx.js → ensureModularPublishBootstrap-CngVyk4c.js} +9 -9
  10. package/dist/{ensureModularPublishBootstrap-BYySx3sx.js.map → ensureModularPublishBootstrap-CngVyk4c.js.map} +1 -1
  11. package/dist/{ensureSmartWalletThenPublish-DiH5CKLY.js → ensureSmartWalletThenPublish-3Q_vA8mD.js} +19 -25
  12. package/dist/ensureSmartWalletThenPublish-3Q_vA8mD.js.map +1 -0
  13. package/dist/helpers/adapters/thirdwebAccount.d.ts +3 -1
  14. package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -1
  15. package/dist/helpers/ensureSmartWalletThenPublish.d.ts +3 -4
  16. package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
  17. package/dist/helpers/ensureWalletThenPublish.d.ts +18 -4
  18. package/dist/helpers/ensureWalletThenPublish.d.ts.map +1 -1
  19. package/dist/helpers/publishItem.d.ts.map +1 -1
  20. package/dist/helpers/seedSigner.d.ts +8 -0
  21. package/dist/helpers/seedSigner.d.ts.map +1 -1
  22. package/dist/helpers/thirdweb.d.ts +4 -0
  23. package/dist/helpers/thirdweb.d.ts.map +1 -1
  24. package/dist/hooks/useCanPublishItem.d.ts +5 -0
  25. package/dist/hooks/useCanPublishItem.d.ts.map +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +274 -260
  29. package/dist/index.js.map +1 -1
  30. package/dist/{managedAccountAdmin-rhHtJC4y.js → managedAccountAdmin-CW1P40qh.js} +9 -9
  31. package/dist/{managedAccountAdmin-rhHtJC4y.js.map → managedAccountAdmin-CW1P40qh.js.map} +1 -1
  32. package/dist/{publishAuthorization-Dx-4adsz.js → publishAuthorization-BOalFNvQ.js} +24 -24
  33. package/dist/{publishAuthorization-Dx-4adsz.js.map → publishAuthorization-BOalFNvQ.js.map} +1 -1
  34. package/dist/publishWalletRegistry-Bf_Nvf_3.js +45 -0
  35. package/dist/publishWalletRegistry-Bf_Nvf_3.js.map +1 -0
  36. package/dist/react/ConnectButton.d.ts.map +1 -1
  37. package/dist/react/PublishProvider.d.ts.map +1 -1
  38. package/dist/react/PublishProvider.initOrder.test.d.ts +2 -0
  39. package/dist/react/PublishProvider.initOrder.test.d.ts.map +1 -0
  40. package/dist/react/PublishProvider.thirdweb.d.ts.map +1 -1
  41. package/dist/{resolveRevokeAccount-CC9X1H9x.js → resolveRevokeAccount-BUK9i1T4.js} +9 -9
  42. package/dist/{resolveRevokeAccount-CC9X1H9x.js.map → resolveRevokeAccount-BUK9i1T4.js.map} +1 -1
  43. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  44. package/dist/services/publish/actors/pollForConfirmation.d.ts +14 -0
  45. package/dist/services/publish/actors/pollForConfirmation.d.ts.map +1 -1
  46. package/dist/services/publish/helpers/undeployedSmartAccount.d.ts +11 -7
  47. package/dist/services/publish/helpers/undeployedSmartAccount.d.ts.map +1 -1
  48. package/dist/services/publishCost/estimatePublishCost.d.ts +14 -2
  49. package/dist/services/publishCost/estimatePublishCost.d.ts.map +1 -1
  50. package/dist/services/publishCost/types.d.ts +10 -0
  51. package/dist/services/publishCost/types.d.ts.map +1 -1
  52. package/dist/services/publishManager/index.d.ts +6 -10
  53. package/dist/services/publishManager/index.d.ts.map +1 -1
  54. package/dist/thirdweb.js +97 -95
  55. package/dist/thirdweb.js.map +1 -1
  56. package/dist/undeployedSmartAccount-B6KSTipF.js +15 -0
  57. package/dist/undeployedSmartAccount-B6KSTipF.js.map +1 -0
  58. package/dist/{worker-Bv_xadel.js → worker-DAciYSNY.js} +2 -2
  59. package/dist/{worker-Bv_xadel.js.map → worker-DAciYSNY.js.map} +1 -1
  60. package/package.json +25 -7
  61. package/dist/chainConfig-DM9RSIMT.js.map +0 -1
  62. package/dist/ensureSmartWalletThenPublish-DiH5CKLY.js.map +0 -1
  63. package/dist/services/publishManager/actions/query.d.ts +0 -2
  64. package/dist/services/publishManager/actions/query.d.ts.map +0 -1
  65. package/dist/undeployedSmartAccount-uDk6iZjl.js +0 -24
  66. package/dist/undeployedSmartAccount-uDk6iZjl.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,95 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  ### Breaking
8
8
 
9
+ - **Number properties register `string <name>` EAS schemas instead of `uint8 <name>`** (ADR 0010, through `@seedprotocol/sdk`'s data types). The first publish of a Number property after upgrading registers its new schema.
10
+ - **Direct EAS needs a wallet that says it is an EOA.** Without `useDirectEas`, a publisher with no contract attests straight to EAS only when its `PublishWallet` has `kind: 'eoa'` and signs as the publisher. `fromEip1193Provider` and `fromEthersWallet` set `kind: 'eoa'`; `fromThirdwebAccount(account, { kind })` takes it, and `ConnectButton` and the managed-account helpers set it. A wallet without a kind uses its registered session's kind when the signer is the same, and is refused otherwise. To migrate a hand-built wallet, set `kind`, or set `useDirectEas` to attest directly anyway. (Before, admins were guessed through factory reads, which let an undeployed thirdweb smart wallet through.)
11
+ - **`initPublish` requires `uploadApiBaseUrl`** when the operator pays for storage (the default), and checks that it is an http(s) URL or a path from the page's origin.
12
+ - **`PublishManager.query(seedLocalId)` only reads.** It returns the publish's current snapshot. It used to stop the publish.
13
+ - **`ensureWalletThenPublish` / `ensureSmartWalletThenPublish`** wait for the publish to spawn (not to finish). `'started'` carries the actor as `publish`; a new `'already_publishing'` outcome means nothing started. `started` is deprecated and already resolved.
14
+
15
+ ### Changed
16
+
17
+ - `useCanPublishItem` is `false` until its check finishes, and checks again when owned addresses change.
18
+ - `ConnectButton` stops running publishes only when another wallet takes over, not on every wallet sync.
19
+ - `pollForConfirmation` fails after 30 min, or after 12 failed status requests in a row.
20
+ - Cost estimates: an Arweave L1 upload is charged for at least 256 KiB, a bundle once, and Turbo uploads up to 100 KiB are free (`arweave.chargedBytes`). Gas on a testnet is priced at $0 (`evm.testnet`).
21
+ - Deprecated: `useLocalWalletAccount` (always `null`), and the `gatewayTransport` and `modularAccountModuleData` config fields (not read).
22
+
23
+ ## 0.7.4 (2026-10-15)
24
+
25
+ ### Commits
26
+
27
+ #### Features
28
+
29
+ - authorizePublish approves a publish before it spends (165481fa)
30
+ - users can pay for storage with Turbo credits (7d22873e)
31
+ - payment config and one resolution of who pays (f9fd4fe0)
32
+
33
+ #### Fixes
34
+
35
+ - ensureEasSchemas looks schemas up under the published name (1da9dc94)
36
+ - sdk, react: one easName for every name that reaches EAS (eec5ded5)
37
+ - disconnecting a wallet stops treating it as owned (d12c64c1)
38
+ - sdk: addresses saved by init are announced; connecting keeps watched addresses (a8029bcc)
39
+ - load the undeployed-account check only on the direct-EAS branch (b98ea731)
40
+ - refuse direct EAS for an undeployed smart account (ef06cf94)
41
+ - direct-EAS publish records each seed as it is attested (6819bb97)
42
+ - domain ownership attests what was proven and honours expiry (8c5ef8e3)
43
+ - revoke from the attester and skip already-revoked uids (220dcb0e)
44
+ - keep arweaveJwk and dataItemSigner out of saved publish snapshots (01d2d008)
45
+ - estimatePublishCost reports Arweave storage as not user-paid (0039b18d)
46
+ - estimatePublishCost reports who pays gas from the real sender (4655d738)
47
+
48
+ ## 0.7.3 (2026-10-14)
49
+
50
+ ### Commits
51
+
52
+ #### Features
53
+
54
+ - register publishItem as the executor behind item.publish() (79e461ec)
55
+
56
+ #### Other
57
+
58
+ - item.publish() needs @seedprotocol/publish (b90bc321)
59
+ - use the SDK's getPublishUploadData (fa8f2f84)
60
+
61
+ ## 0.7.1 (2026-10-10)
62
+
63
+ ### Commits
64
+
65
+ #### Features
66
+
67
+ - sdk: seed:property/<name> placeholders in Html resolve to the property's upload (ef4c28e9)
68
+
69
+ #### Fixes
70
+
71
+ - direct-to-EAS publish attests every list member's seed uid (9ff27038)
72
+ - sdk: publish the full graph of related drafts (c115dc30)
73
+
74
+ ## 0.7.0 (2026-10-08)
75
+
76
+ ### Commits
77
+
78
+ #### Features
79
+
80
+ - sdk: elect a leader tab for automatic EAS sync and the L1 worker (1d828074)
81
+ - sdk: record version revocations in versions.revoked_at (09649128)
82
+
83
+ #### Fixes
84
+
85
+ - resume each in-progress publish in one tab only (8d2c0d18)
86
+ - sdk: co-publish images embedded in related drafts' Html (0c47942e)
87
+ - direct-to-EAS publish records every request's own seed (0c4732ac)
88
+ - record every request of a one-transaction publish (a1875916)
89
+ - match each multiPublish request to its own receipt events (7505a50d)
90
+ - sdk: a patch publish's existing version uid is not recorded again (ecce0332)
91
+ - sdk: publishing a reference to an unpublished item fails (3c05c13c)
92
+ - sdk: propagate property revocations and replacements to stored metadata (13ddb58d)
93
+
94
+ ## 0.6.10 (2026-10-04)
95
+
96
+ ### Breaking
97
+
9
98
  - **`waitForPublishReceipt` throws on a reverted transaction** (`PublishTransactionRevertedError`, with `transactionHash` and `receipt`). It used to return the reverted receipt, so callers treated a revert as success. Functions that return its receipt (`attestPublishAuthorization`, `revokePublishAuthorization`, domain ownership and publishedBy attest/revoke) now throw instead.
10
99
  - **`ensureExecutorModuleInstalled` no longer calls `installModule` on thirdweb ModularCore accounts.** That path could never work: ModularCore installs modules by `delegatecall`, and the Seed executor is an ERC-7579 module without `getModuleConfig`. Accounts without the `SeedExecutorRouterExtension` are skipped, and `assertExecutorModuleReadyForAccount` reports why the executor can't act for them. `ensureExecutorModuleInstalled` now returns `{ status: 'skipped' | 'already-installed' }` or `{ status: 'installed', eas, transactionHash }`. `PublishConfig.modularAccountModuleData` is unused.
11
100
 
@@ -15,20 +104,116 @@ All notable changes to this project will be documented in this file.
15
104
  - **`seedPaymaster(client, chain, bundlerUrl?)`** is exported from `@seedprotocol/publish/thirdweb` for smart wallets the SDK doesn't build, such as a server's `smartWallet()` with an automation session key: pass it as `overrides.paymaster` when `sponsorGas` is on.
16
105
  - **Executor install race in `enrollPublishAutomation`:** turning on automation could fail with "The Seed executor is not installed for this ManagedAccount" right after a successful `installSeedExecutor`, because the follow-up `isInitialized` read hit a load-balanced RPC node that hadn't seen the block yet. The install is now confirmed from the receipt's `SeedExecutorInstalled` and `ModuleInitialized` logs, and the readiness check uses the EAS from that event instead of re-reading. When the executor was already installed, the `isInitialized` read is retried briefly. `ensureAutomationSessionKey` retries the `isActiveSigner` read after `addSessionKey` for the same reason.
17
106
  - **Failed executor installs report why:** an install whose receipt lacks the install events (a reverted transaction, or a sponsored EIP-7702 relayer transaction that succeeded while the inner call reverted) throws `EXECUTOR_MODULE_NOT_INSTALLED` with the decoded revert reason, instead of a misleading "not installed" from the readiness check.
107
+
108
+ ### Added
109
+
110
+ - **`readFactorySeedExecutor(factory?)`:** the executor and EAS that a ManagedAccount factory's `SeedExecutorRouterExtension` pins, or `null` when it routes none. Compare it with `modularAccountModuleContract` at startup instead of finding a stale address at the first publish or enroll.
111
+ - **`assertExecutorModuleReadyForAccount(address, { installedEas, readAttempts })`:** pass the EAS confirmed from an install receipt to skip the read, or retry a not-initialized read.
112
+
113
+ ### Commits
114
+
115
+ #### Breaking
116
+
117
+ - confirm executor installs from the receipt, not a lagging read (e111c5d0)
118
+
119
+ #### Other
120
+
121
+ - Fixing gas estimation. v0.6.10 (d5b161a1)
122
+
123
+ ## 0.6.9 (2026-10-03)
124
+
125
+ ### Commits
126
+
127
+ #### Breaking
128
+
129
+ - encode multiPublish with publishIndex for SeedProtocolExtension (69318de1)
130
+
131
+ #### Other
132
+
133
+ - one multiPublish struct for the extension and the executor (ab765b75)
134
+
135
+ ## 0.6.8 (2026-10-03)
136
+
137
+ ### Fixed
138
+
18
139
  - **List-of-relation EAS names:** a list relation such as `staff` (List → Identity) was attested as `bytes32[] staff` or `bytes32[] staff_identity_ids` depending on whether the model was loaded before the item. `getPublishPayload` and `ensureEasSchemasForItem` now derive the name from the property definition with `listRelationEasPropertyName` (exported from `@seedprotocol/sdk`) and ignore a cached `schemaUid` for list relations. `ensureEasSchemasForItem` refuses to register a list-relation schema that doesn't end in `_ids`. Locally, `createMetadata` writes list-relation rows under the storage name (`staffIdentityIds`), and an `ItemProperty` that receives its schema after construction moves to the storage name while `propertyName` stays `staff`. Already-published data (`author_identity_ids` and the like) is unchanged.
19
140
  - **Missing property schemas fail publish validation:** when a property's EAS schema can't be found, `getPublishPayload` now reports `publish_schema_not_found` instead of attesting the value under the Version schema. Call `ensureEasSchemasForItem` first, as the publish flow already does.
20
141
  - **`parseEasRelationPropertyName`** (`@seedprotocol/query`) pluralizes list names with `pluralize`: `staff_identity_ids` → `staff` (was `staffs`). Single relations return the singular (`cover_image_id` → `cover`).
21
142
  - **Failed UserOps on the permissionless / EIP-7702 sender:** a UserOp that failed inside a successful bundle transaction was returned as a success, so publish went on with no attestations. It now throws with the decoded revert reason.
22
143
  - **Readable publish failures:** every publish route now simulates `multiPublish` from the sending account before sending, and a call that would revert throws `PUBLISH_PREFLIGHT_FAILED` with the decoded Seed, EAS or `Error(string)` reason (automation keeps `AUTOMATION_PREFLIGHT_FAILED`). Outside automation, a simulation that can't run doesn't block the send. thirdweb's bare `UserOp failed at txHash: 0x…` (usually out of gas) and its undecodable custom-error message are rewritten to say what happened, as `ManagedAccountPublishError` with code `USEROP_FAILED_NO_REASON` (no revert reason; usually out of gas) or `USEROP_REVERTED`, keeping the original as `underlyingCause`. Failed UserOps on the permissionless sender use the same codes.
23
- - **Publish automation on legacy ManagedAccounts:** `enrollPublishAutomation` no longer fails when the account is an ERC-7504 Router (`Router: function does not exist`) instead of ModularCore. Those accounts cannot `installModule`; enroll adds the module-only session key and attests the sidecar. ModularCore accounts still require the executor module to be installed.
24
144
  - **EAS schema lookup:** `ensureEasSchemasForItem` normalizes property data types (`html` → `Html`) before choosing the on-chain schema, so an existing `bytes32 html` schema is reused instead of registering `string html`. `normalizeDataType` is exported from `@seedprotocol/sdk`.
25
145
  - **Automation schema registration:** session keys no longer send SchemaRegistry or EAS UserOps when a schema is missing. Publish fails first with `schema "…" is not registered; automation keys can't register schemas`. Register once with the owner wallet via `ensureEasSchemasForItem`.
146
+
147
+ ### Commits
148
+
149
+ #### Features
150
+
151
+ - error codes for failed UserOps (72211c67)
152
+ - twin robustness and a twin.json config helper (b72399a9)
153
+ - local twin support and the contract rollout's client changes (65bbde80)
154
+ - verify the publish chain before writing; hold EAS sync until the chain is known (5f4fc0ee)
155
+ - sdk: record the EAS chain in the local DB and refuse cross-chain writes (7d8af9d5)
156
+ - sdk: read EAS from the configured chain and register base schemas on new chains (91e0290e)
157
+ - make the publish chain and EAS addresses configurable (811b8fc5)
158
+
159
+ #### Fixes
160
+
161
+ - attest list relations under one EAS name (55d6cbe2)
162
+ - readable UserOp failures and a pre-send check on every route (06f8674d)
163
+ - rollout and twin follow-ups from protocol review (415c9c1b)
164
+ - check executor module readiness before automation publish and revoke (4e8a4f8a)
165
+ - treat relations to published seed uids as already published (8133d761)
166
+ - normalize EAS schema types and refuse automation registration (b68fef38)
167
+
168
+ #### Other
169
+
170
+ - Lots of bug fixes (a3a7f146)
171
+
172
+ ## 0.6.7 (2026-10-01)
173
+
174
+ _Also covers 0.6.4, 0.6.5, 0.6.6, published from commits in this range._
175
+
176
+ ### Fixed
177
+
178
+ - **Publish automation on legacy ManagedAccounts:** `enrollPublishAutomation` no longer fails when the account is an ERC-7504 Router (`Router: function does not exist`) instead of ModularCore. Those accounts cannot `installModule`; enroll adds the module-only session key and attests the sidecar. ModularCore accounts still require the executor module to be installed.
26
179
  - **First-time modular publish:** `isAutomationSessionActive` returns `false` when the ManagedAccount has no bytecode instead of throwing `MODULAR_SIGNER_ACTIVATION_FAILED` on viem `0x` / “not a contract”. Interactive first publish can reach `runModularExecutorPublishPrep` / `autoDeployManagedAccount`. Deployed-account RPC or `isActiveSigner` read failures still throw so unattended automation does not fall through to in-app bootstrap.
27
180
 
181
+ ### Commits
182
+
183
+ #### Features
184
+
185
+ - add PublishedBy batch sidecar attest/revoke/query APIs (14233083)
186
+
187
+ #### Fixes
188
+
189
+ - support Node server publishes without a browser Thirdweb client (7ef2fe66)
190
+ - import listCreatedAttestationPairsFromReceipt for PublishedBy batch (4da2fc80)
191
+
192
+ #### Other
193
+
194
+ - Final edits (687d320b)
195
+ - Build fixes (15ab8cdc)
196
+ - Fixing Vite plugin bugs (59fad217)
197
+ - Fix first-publish failing when the ManagedAccount is still undeployed. (84a921d6)
198
+
199
+ ## 0.6.3 (2026-09-25)
200
+
201
+ _Also covers 0.6.1, 0.6.2, published from commits in this range._
202
+
203
+ ### Commits
204
+
205
+ #### Other
206
+
207
+ - Fixing item ownership bugs/gaps (2539c65c)
208
+ - Adding publish cost estimator tooling (6d2f170c)
209
+ - Fixing bug so uid doesn't depend on CreatedAttestation (5e64192b)
210
+
211
+ ## 0.5.3 (2026-09-17)
212
+
213
+ _Also covers 0.5.2, published from commits in this range._
214
+
28
215
  ### Added
29
216
 
30
- - **`readFactorySeedExecutor(factory?)`:** the executor and EAS that a ManagedAccount factory's `SeedExecutorRouterExtension` pins, or `null` when it routes none. Compare it with `modularAccountModuleContract` at startup instead of finding a stale address at the first publish or enroll.
31
- - **`assertExecutorModuleReadyForAccount(address, { installedEas, readAttempts })`:** pass the EAS confirmed from an install receipt to skip the read, or retry a not-initialized read.
32
217
  - **Publish automation grants:** ManagedAccount-hosted session keys (executor-module-only `approvedTargets`), `seedprotocol.publishAuthorization` sidecar, `enrollPublishAutomation` / `revokePublishAutomation`, and `assertStorageBoundToIdentity`. See `docs/PUBLISH_AUTOMATION.md`.
33
218
  - **`prepareEasMultiRevoke`:** When `modularAccountModuleContract` is set, routes `multiRevoke` to the executor module so automation session keys can revoke as the ManagedAccount.
34
219
  - **`resolveRevokeAccount` / `revokeAttestations`:** No longer hard-block ManagedAccount attesters; legacy module-attester path attempts ManagedAccount + executor revoke when configured.
@@ -40,6 +225,41 @@ All notable changes to this project will be documented in this file.
40
225
  - **Domain ownership tooling:** `createDomainOwnershipChallenge`, multi-resolver DNS TXT verify, RDAP snapshot via `rdapper`, `ensureDomainOwnershipSchema` / `attestDomainOwnership` / `revokeDomainOwnership`, `verifyAndAttestDomainOwnership`, and `assessDomainOwnershipLive`. See `docs/DOMAIN_OWNERSHIP.md`.
41
226
  - Dependency: `@seedprotocol/eas`, `rdapper`.
42
227
 
228
+ ### Commits
229
+
230
+ #### Features
231
+
232
+ - route automation session keys through the executor (5894cbc2)
233
+ - add ManagedAccount publish automation enrollment (db6d752f)
234
+
235
+ #### Other
236
+
237
+ - Add domain ownership DNS challenge, RDAP snapshot, and EAS sidecar tooling. (c51a1226)
238
+
239
+ ## 0.5.1 (2026-08-29)
240
+
241
+ ### Commits
242
+
243
+ #### Features
244
+
245
+ - add permissionless EIP-7702 sender for gasless publish (1c907e64)
246
+ - add EIP-1193 PublishWallet and useSeedWallet (fb5dfdab)
247
+ - make Thirdweb an optional peer behind /thirdweb (2bc918dc)
248
+ - resolve chain and RPC from PublishConfig (23b24b66)
249
+
250
+ #### Fixes
251
+
252
+ - sync in-app auth tokens for managed wallet connect (4e1caadf)
253
+ - sdk: guard BaseDb readiness before platform classes init (425883c3)
254
+
255
+ #### Other
256
+
257
+ - replace setPlatformClass with instance + static facade (0bca44b7)
258
+ - Fixing imports/exports (3869c666)
259
+ - document EIP-1193, permissionless, and Thirdweb recipes (221e007f)
260
+ - split SeedSigner and SeedTxSender (11c0d8e1)
261
+ - Decouple publish contract/tx layer via SeedSigner and viem. (537c0e15)
262
+
43
263
  ## 0.5.0
44
264
 
45
265
  ### Breaking
package/README.md CHANGED
@@ -1,12 +1,24 @@
1
1
  # @seedprotocol/publish
2
2
 
3
- Publish UI components and helpers for Seed Protocol.
3
+ [![npm](https://img.shields.io/npm/v/@seedprotocol/publish.svg)](https://www.npmjs.com/package/@seedprotocol/publish)
4
+
5
+ Publish UI components and helpers for [Seed Protocol](https://seedprotocol.io): upload item content to Arweave and attest it on EAS from [`@seedprotocol/sdk`](https://www.npmjs.com/package/@seedprotocol/sdk) items, with React providers/hooks and optional Thirdweb wallets.
4
6
 
5
7
  The publish flow (ConnectButton, etc.) runs `ensureEasSchemasForItem` before `getPublishPayload`, which registers EAS schemas and adds naming attestations so EASSCAN displays them. If you build a custom publish flow that calls `item.getPublishPayload()` directly, you must run schema setup first or use this package's flow.
6
8
 
7
- **`item.publish()` and `item.unpublish()` need this package.** `initPublish()` (or `<PublishProvider config>`) registers the executors behind them: `publishItem` for `item.publish()` and the revocation executor for `item.unpublish()`. Until it runs, both throw. `item.publish(options)` passes `options` through as `CreatePublishOptions`, uses the wallet registered with `useSeedWallet().connect` or `setPublishWallet`, and resolves when the publish has finished (it rejects if it fails). See [docs/ATTESTATION_REVOCATION.md](../../docs/ATTESTATION_REVOCATION.md) for permanence and UX guidance.
9
+ **`item.publish()` and `item.unpublish()` need this package.** `initPublish()` (or `<PublishProvider config>`) registers the executors behind them: `publishItem` for `item.publish()` and the revocation executor for `item.unpublish()`. Until it runs, both throw. `item.publish(options)` passes `options` through as `CreatePublishOptions`, uses the wallet registered with `useSeedWallet().connect` or `setPublishWallet`, and resolves when the publish has finished (it rejects if it fails). See [docs/ATTESTATION_REVOCATION.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/ATTESTATION_REVOCATION.md) for permanence and UX guidance.
10
+
11
+ **Badges / on-chain vs pending:** use `@seedprotocol/sdk` `getSeedPublishState` for “any on-chain anchor for this seed”, `getPublishPendingDiff` for per-property heads missing attestation UIDs, and `Item.all` (or `useItems` from `@seedprotocol/react`) with `includeEas` (compare `publishedVersionUid` vs `latestVersionUid`) for list rows. When a publish run finishes, observe `usePublishProcess(seedLocalId)` or the `publishProcesses` table instead of ad hoc window events.
12
+
13
+ ## Installation
8
14
 
9
- **Badges / on-chain vs pending:** use `@seedprotocol/sdk` `getSeedPublishState` for “any on-chain anchor for this seed”, `getPublishPendingDiff` for per-property heads missing attestation UIDs, and `getItemsData` (`includeEas`, `publishedVersionUid` vs `latestVersionUid`) for list rows. When a publish run finishes, observe `usePublishProcess(seedLocalId)` or the `publishProcesses` table instead of ad hoc window events.
15
+ ```bash
16
+ npm install @seedprotocol/publish @seedprotocol/sdk @seedprotocol/react react react-dom @tanstack/react-query
17
+ # Optional, only for @seedprotocol/publish/thirdweb (ConnectButton, in-app / managed wallets):
18
+ npm install thirdweb
19
+ ```
20
+
21
+ Peer dependencies: `@seedprotocol/sdk` and `@seedprotocol/react` (the same version as this package; all Seed Protocol packages are released together), `react` / `react-dom` 18 or 19, `@tanstack/react-query` 5, and optionally `thirdweb` 5. The SDK is a peer so your app and this package share one SDK instance (one client, one local database).
10
22
 
11
23
  ## Setup
12
24
 
@@ -34,6 +46,9 @@ initPublish({
34
46
  rpcUrl: import.meta.env.VITE_RPC_URL,
35
47
  chain: optimismSepolia,
36
48
  accountMode: 'eoa',
49
+ // Files (images, Html, ...) go to Arweave as data items the wallet signs. Without this, uploads
50
+ // take the L1 path, which needs an Arweave key: arweaveJwk or signArweaveTransactions.
51
+ useArweaveBundler: true,
37
52
  })
38
53
 
39
54
  function Connect() {
@@ -59,7 +74,9 @@ function App() {
59
74
  // Later, once the wallet is connected:
60
75
  // await item.publish() // resolves when uploads and attestations are done
61
76
  // or, to start without waiting:
62
- // await ensureWalletThenPublish(item, { dataItemSigner: /* from useSeedWallet().signer */ })
77
+ // const result = await ensureWalletThenPublish(item) // signs data items with the wallet
78
+ // if (result.outcome === 'started') watch(result.publish) // the publish actor
79
+ // if (result.outcome === 'already_publishing') ... // this item is publishing already
63
80
  ```
64
81
 
65
82
  ### Recipe 2: EIP-1193 + permissionless EIP-7702 (gasless, no Thirdweb)
@@ -238,7 +255,7 @@ Twin quirks the SDK handles: automation pre-flight simulations retry with a bala
238
255
 
239
256
  When using your own gateway with an Arweave bundler, you can enable instant uploads instead of the default reimbursement + chunk upload flow. **This is experimental and not yet validated for production.**
240
257
 
241
- **Memory:** Large publishes hold signed DataItems and a single packed batch body in memory briefly. Electron and other Chromium renderers often cap near ~4 GB JS heap. See [docs/PUBLISH_MEMORY.md](../../docs/PUBLISH_MEMORY.md) for scaling, `publishMode`, and path differences (`signDataItems` vs `dataItemSigner`).
258
+ **Memory:** Large publishes hold signed DataItems and a single packed batch body in memory briefly. Electron and other Chromium renderers often cap near ~4 GB JS heap. See [docs/PUBLISH_MEMORY.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/PUBLISH_MEMORY.md) for scaling, `publishMode`, and path differences (`signDataItems` vs `dataItemSigner`).
242
259
 
243
260
  Set `useArweaveBundler: true`. The bundler uses the same `uploadApiBaseUrl` (e.g. `${uploadApiBaseUrl}/upload/batch`).
244
261
 
@@ -273,7 +290,7 @@ PublishManager.createPublish(item, address, account, {
273
290
 
274
291
  You can also provide `signDataItems` or `dataItemSigner` in the PublishProvider config as a fallback when the signer is available at startup.
275
292
 
276
- **Html properties with embedded `data:image/...;base64,...` (materialization):** When `useArweaveBundler: true`, the publish machine runs the same two-phase flow as L1: phase 1 uploads non-deferred payloads (including materialized Image DataItems), rewrites Html files on disk with Arweave URLs, then phase 2 builds and uploads Html-only DataItems. **`signDataItems` is invoked twice per publish** in that scenario (once per phase)—implementations should sign/upload the `uploads` array they receive each time. The in-process **`dataItemSigner`** path performs two HTTP batch uploads to your bundler API. Per-property `htmlEmbeddedDataUriPolicy: 'preserve'` skips materialization and keeps a single phase, unless the Html has `seed:property/<name>` placeholders (see docs/PUBLISHING.md), which always take the two-phase path.
293
+ **Html properties with embedded `data:image/...;base64,...` (materialization):** When `useArweaveBundler: true`, the publish machine runs the same two-phase flow as L1: phase 1 uploads non-deferred payloads (including materialized Image DataItems), rewrites Html files on disk with Arweave URLs, then phase 2 builds and uploads Html-only DataItems. **`signDataItems` is invoked twice per publish** in that scenario (once per phase)—implementations should sign/upload the `uploads` array they receive each time. The in-process **`dataItemSigner`** path performs two HTTP batch uploads to your bundler API. Per-property `htmlEmbeddedDataUriPolicy: 'preserve'` skips materialization and keeps a single phase, unless the Html has `seed:property/<name>` placeholders (see [docs/PUBLISHING.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/PUBLISHING.md)), which always take the two-phase path.
277
294
 
278
295
  ### Arweave upload tags
279
296
 
@@ -311,7 +328,7 @@ await deletePublishProcessById(runId) // numeric row id from `records`
311
328
 
312
329
  ### Publish automation (ManagedAccount grants)
313
330
 
314
- Apps can enroll a server-held session key to publish/revoke on a user’s ManagedAccount without taking the user’s root key. Requires `modularAccountModuleContract` (executor-module-only `approvedTargets`). See [docs/PUBLISH_AUTOMATION.md](../../docs/PUBLISH_AUTOMATION.md).
331
+ Apps can enroll a server-held session key to publish/revoke on a user’s ManagedAccount without taking the user’s root key. Requires `modularAccountModuleContract` (executor-module-only `approvedTargets`). See [docs/PUBLISH_AUTOMATION.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/PUBLISH_AUTOMATION.md).
315
332
 
316
333
  APIs live on `@seedprotocol/publish` (sidecar attest/revoke) and `@seedprotocol/publish/thirdweb` (`enrollPublishAutomation`, `revokePublishAutomation`, session-key helpers, `assertStorageBoundToIdentity`).
317
334
 
@@ -331,7 +348,7 @@ With **`useModularExecutor`**, two Thirdweb in-app wallets share one login:
331
348
 
332
349
  **Session keys** may only target the executor (`approvedTargetsForAutomationPublish`). `ensureManagedSignerSessionKey` and `defaultApprovedTargetsForModularPublish` are deprecated: interactive publishing needs no session key, and both now grant the executor only, never the account (which would allow any self-call) or EAS.
333
350
 
334
- **Automation** session keys publish through the executor only (see [PUBLISH_AUTOMATION.md](../../docs/PUBLISH_AUTOMATION.md)) and cannot revoke. **Revocation** is owner-only: `revokeAttestations` sends `multiRevoke` to EAS from the publishing account.
351
+ **Automation** session keys publish through the executor only (see [PUBLISH_AUTOMATION.md](https://github.com/JournoLabs/seed-protocol-sdk/blob/main/docs/PUBLISH_AUTOMATION.md)) and cannot revoke. **Revocation** is owner-only: `revokeAttestations` sends `multiRevoke` to EAS from the publishing account.
335
352
 
336
353
  **Routing:** `multiPublish` calldata uses the ABI generated from the reference deployment `MULTI_PUBLISH_ABI_REFERENCE_ADDRESS_OP_SEPOLIA` (`0xcd8c…`). The transaction `to` is the managed account for interactive publish, or the executor module for automation keys. Non-modular publish targets the deployed publisher contract. **EOAs** (no contract at `address`) never use `multiPublish`; they attest on EAS directly (`createAttestationsDirectToEas`). Set **`useDirectEas: true`** to force that path.
337
354
 
@@ -341,7 +358,13 @@ With **`useModularExecutor`**, two Thirdweb in-app wallets share one login:
341
358
 
342
359
  ## Development
343
360
 
361
+ From a checkout of the monorepo:
362
+
344
363
  ```bash
345
364
  bun install
346
365
  bun run build
347
366
  ```
367
+
368
+ ## License
369
+
370
+ MIT