@artblocks/abx-cli 0.1.0-alpha.17 → 0.1.0-alpha.19

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 (121) hide show
  1. package/CHANGELOG.md +218 -0
  2. package/dist/commands/deploy.d.ts +181 -0
  3. package/dist/commands/deploy.d.ts.map +1 -0
  4. package/dist/commands/deploy.js +2974 -0
  5. package/dist/commands/deploy.js.map +1 -0
  6. package/dist/commands/project.d.ts +134 -0
  7. package/dist/commands/project.d.ts.map +1 -0
  8. package/dist/commands/project.js +919 -0
  9. package/dist/commands/project.js.map +1 -0
  10. package/dist/commands/reads.d.ts +64 -0
  11. package/dist/commands/reads.d.ts.map +1 -0
  12. package/dist/commands/reads.js +635 -0
  13. package/dist/commands/reads.js.map +1 -0
  14. package/dist/commands/scaffold.d.ts +69 -0
  15. package/dist/commands/scaffold.d.ts.map +1 -0
  16. package/dist/commands/scaffold.js +508 -0
  17. package/dist/commands/scaffold.js.map +1 -0
  18. package/dist/commands/service.d.ts +41 -0
  19. package/dist/commands/service.d.ts.map +1 -0
  20. package/dist/commands/service.js +618 -0
  21. package/dist/commands/service.js.map +1 -0
  22. package/dist/commands/storage.d.ts +37 -0
  23. package/dist/commands/storage.d.ts.map +1 -0
  24. package/dist/commands/storage.js +335 -0
  25. package/dist/commands/storage.js.map +1 -0
  26. package/dist/config.d.ts +72 -2
  27. package/dist/config.d.ts.map +1 -1
  28. package/dist/config.js +201 -4
  29. package/dist/config.js.map +1 -1
  30. package/dist/conformance.d.ts +31 -0
  31. package/dist/conformance.d.ts.map +1 -0
  32. package/dist/conformance.js +371 -0
  33. package/dist/conformance.js.map +1 -0
  34. package/dist/deps.d.ts +6 -39
  35. package/dist/deps.d.ts.map +1 -1
  36. package/dist/deps.js +4 -68
  37. package/dist/deps.js.map +1 -1
  38. package/dist/errors.d.ts +20 -0
  39. package/dist/errors.d.ts.map +1 -0
  40. package/dist/errors.js +25 -0
  41. package/dist/errors.js.map +1 -0
  42. package/dist/flags.d.ts +34 -0
  43. package/dist/flags.d.ts.map +1 -1
  44. package/dist/flags.js +74 -0
  45. package/dist/flags.js.map +1 -1
  46. package/dist/main.js +220 -6905
  47. package/dist/main.js.map +1 -1
  48. package/dist/mintpage.d.ts +3 -1
  49. package/dist/mintpage.d.ts.map +1 -1
  50. package/dist/mintpage.js +48 -48
  51. package/dist/mintpage.js.map +1 -1
  52. package/dist/output.d.ts +137 -0
  53. package/dist/output.d.ts.map +1 -0
  54. package/dist/output.js +504 -0
  55. package/dist/output.js.map +1 -0
  56. package/dist/ownerops.d.ts +23 -44
  57. package/dist/ownerops.d.ts.map +1 -1
  58. package/dist/ownerops.js +151 -233
  59. package/dist/ownerops.js.map +1 -1
  60. package/dist/preview.d.ts +8 -4
  61. package/dist/preview.d.ts.map +1 -1
  62. package/dist/preview.js +8 -17
  63. package/dist/preview.js.map +1 -1
  64. package/dist/provision.d.ts.map +1 -1
  65. package/dist/provision.js +10 -7
  66. package/dist/provision.js.map +1 -1
  67. package/dist/remote.d.ts +72 -7
  68. package/dist/remote.d.ts.map +1 -1
  69. package/dist/remote.js +211 -9
  70. package/dist/remote.js.map +1 -1
  71. package/dist/riskgate.d.ts +29 -0
  72. package/dist/riskgate.d.ts.map +1 -0
  73. package/dist/riskgate.js +91 -0
  74. package/dist/riskgate.js.map +1 -0
  75. package/dist/schema.d.ts +6 -0
  76. package/dist/schema.d.ts.map +1 -1
  77. package/dist/schema.js +12 -16
  78. package/dist/schema.js.map +1 -1
  79. package/dist/served.d.ts +1 -17
  80. package/dist/served.d.ts.map +1 -1
  81. package/dist/served.js +47 -0
  82. package/dist/served.js.map +1 -1
  83. package/dist/signer.d.ts +13 -0
  84. package/dist/signer.d.ts.map +1 -1
  85. package/dist/signer.js +42 -19
  86. package/dist/signer.js.map +1 -1
  87. package/dist/update-check.d.ts +27 -0
  88. package/dist/update-check.d.ts.map +1 -1
  89. package/dist/update-check.js +30 -0
  90. package/dist/update-check.js.map +1 -1
  91. package/package.json +6 -6
  92. package/skill/SKILL.md +7 -11
  93. package/skill/reference/code-projects.md +3 -3
  94. package/skill/reference/hosting.md +6 -6
  95. package/skill/reference/operating.md +2 -5
  96. package/skill/reference/setup.md +2 -2
  97. package/skill/reference/troubleshooting.md +1 -1
  98. package/dist/gas.d.ts +0 -63
  99. package/dist/gas.d.ts.map +0 -1
  100. package/dist/gas.js +0 -76
  101. package/dist/gas.js.map +0 -1
  102. package/dist/inspect.d.ts +0 -48
  103. package/dist/inspect.d.ts.map +0 -1
  104. package/dist/inspect.js +0 -290
  105. package/dist/inspect.js.map +0 -1
  106. package/dist/migrate.d.ts +0 -65
  107. package/dist/migrate.d.ts.map +0 -1
  108. package/dist/migrate.js +0 -180
  109. package/dist/migrate.js.map +0 -1
  110. package/dist/onchain-uri.d.ts +0 -81
  111. package/dist/onchain-uri.d.ts.map +0 -1
  112. package/dist/onchain-uri.js +0 -251
  113. package/dist/onchain-uri.js.map +0 -1
  114. package/dist/resume.d.ts +0 -96
  115. package/dist/resume.d.ts.map +0 -1
  116. package/dist/resume.js +0 -95
  117. package/dist/resume.js.map +0 -1
  118. package/dist/upload.d.ts +0 -28
  119. package/dist/upload.d.ts.map +0 -1
  120. package/dist/upload.js +0 -41
  121. package/dist/upload.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,223 @@
1
1
  # @artblocks/abx-cli
2
2
 
3
+ ## 0.1.0-alpha.19
4
+
5
+ ### Minor Changes
6
+
7
+ - d40caf4: `abx remote <name|url> --conformance` — self-certify a resolver from the published CLI
8
+
9
+ The self-verify fixture that used to live only as a repo-local script
10
+ (`scripts/conformance-remote-service.mjs`, `pnpm conformance`) is now a mode on the existing `remote`
11
+ command rather than a new one (command-count discipline): `abx remote <name|url> --conformance
12
+ [--remote-token <t>] [--chain-id <n>] [--address <a>] [--from-block <n>]`.
13
+
14
+ This is what lets a third party self-certify a hosted resolver — or CI-gate on one — with nothing but
15
+ `npm i -g @artblocks/abx-cli` and a base URL: no repo checkout, and a bare URL + `--remote-token`
16
+ needs no `.env` setup. It reuses the same `--remote` name/URL/token resolution as every other remote
17
+ command, prints one ✓/✗/· line per assertion (descriptor shape, unauthenticated writes refused, the
18
+ read-plane's error taxonomy, every declared interface's routes, and — with `--chain-id` + `--address`
19
+ naming a contract you own — the full register → poll-to-live → status → reindex → deregister loop),
20
+ and sets a non-zero exit code on any failure.
21
+
22
+ The assertions themselves moved to `packages/cli/src/conformance.ts`, importable by both the CLI
23
+ command and the (now much thinner) root script, so `pnpm conformance` and
24
+ `scripts/e2e-remote-resolver.sh` keep working unchanged against the same logic.
25
+
26
+ ### Patch Changes
27
+
28
+ - d40caf4: Two first-party consumers adopt the backoff/gateway/data-URI helpers hoisted into `@artblocks/abx-sdk`
29
+ last round, and `mint-page` refuses a 1/1 target instead of scaffolding a page that hangs. Drop-in for
30
+ everyone — no behavior change in the adoption itself, and the mint-page refusal only fires for a
31
+ contract type the page never worked against.
32
+
33
+ **`token-api`'s chain watcher now calls `exponentialBackoffDelay`/`linearBackoffDelay` instead of
34
+ re-deriving them inline.** `dueForRetry`'s failed-project retry and the tick loop's repeated-failure
35
+ delay were the sdk helpers reimplemented by hand; both now call the shared functions, with the exact
36
+ index mapping (`min(attempts, 8) + 1` into the 1-indexed exponential helper) that reproduces identical
37
+ delays for every `attempts`/`failures` value — proved by an old-formula-vs-sdk-helper equality table
38
+ in `packages/token-api/test/watcher-backoff.test.ts` (attempts/failures 0..12, several `baseMs`
39
+ values, and the cap boundary explicitly).
40
+
41
+ **The `mint-page` template's generated app now reads gateway URLs and `data:` URIs through the sdk**
42
+ (`gatewayUrlFor`/`resolveGatewayBase`/`parseDataUri`) instead of a hand-rolled `ipfs://`-slicing
43
+ `toGateway` and a hand-parsed comma-split in `fetchJson`. Same output for every input (plain
44
+ `https://`, empty string, `ipfs://`, `ar://`, base64 and percent-encoded `data:` bodies) — verified
45
+ byte-for-byte before the swap, and pinned by a new mintpage.test.ts assertion that the emitted
46
+ `lib/meta.ts` imports the sdk helpers and no longer contains the old hand-rolled body.
47
+
48
+ **`mint-page` now refuses a non-Series target.** The generated page reads `maxInvocations`/`paused`
49
+ and mints through the shared fixed-price minter — a 1/1 (`OneOfOneImage`) has none of that, so pointing
50
+ `mint-page` at one silently wrote a page that sat on "Loading…" forever with no diagnostic. `cmdMintPage`
51
+ now probes the same ERC-165 `supportsInterface(IAbxSequentialMint)` `sdk/anchors.ts`'s
52
+ `isCurrentSeriesFactory` uses, and refuses with a `CliError` pointing at `abx deploy-series --dir
53
+ <folder> --count 1` (matching the existing guidance in `sales.mdx`). A probe that can't run at all (RPC
54
+ unreachable) is left undecided and does NOT refuse — scaffolding stays usable offline, same tolerance
55
+ the existing best-effort `name()` read already has.
56
+
57
+ Also folded in: `PUBLIC_RPC` (the mint-page template's keyless-RPC table) gains `base` and
58
+ `base-sepolia` — the toolkit's own default chain was missing from it, so every default-chain deploy
59
+ needed a manual `--rpc` just to scaffold its own mint page.
60
+
61
+ - Updated dependencies [d40caf4]
62
+ - Updated dependencies [d40caf4]
63
+ - Updated dependencies [d40caf4]
64
+ - @artblocks/abx-sdk@0.1.0-alpha.11
65
+ - @artblocks/abx-token-api@0.1.0-alpha.14
66
+ - @artblocks/abx-storage@0.1.0-alpha.11
67
+ - @artblocks/abx-indexer@0.1.0-alpha.12
68
+
69
+ ## 0.1.0-alpha.18
70
+
71
+ ### Minor Changes
72
+
73
+ - 11fa933: Phase 5 interface unifications: the self resolver becomes a named remote, doctor absorbs the
74
+ version/install/provenance ladder, deploy previews stop showing addresses they can't keep,
75
+ approvals are counted honestly, render×storage combos are validated once, and storage config gets
76
+ a real probe.
77
+
78
+ - **Self resolver is a named remote (breaking, client-side only)**: the CLIENT credential for the
79
+ local/self resolver moves from `ABX_RESOLVER_ADMIN_TOKEN` to the named-remote grammar
80
+ (`ABX_REMOTE_SELF_URL` / `ABX_REMOTE_SELF_TOKEN` — "self" is just a conventional remote name, zero
81
+ special-casing). The SERVER side (token-api control-plane auth, `provision.ts`, the Fly.io secret)
82
+ keeps its old name — it's the service's own config, not a client credential, so deployed resolvers
83
+ need no change. The old client var, if still set, is now a pointed `CliError` naming both new vars
84
+ (no silent fallback); `abx doctor` flags it too, and the near-miss `_KEY`-vs-`_TOKEN` detector keeps
85
+ working under the unified grammar.
86
+ - **`abx doctor` absorbs the version/install/provenance ladder** the skill used to only teach in
87
+ prose: one new ✓/✗ block for binary provenance (source checkout / npm install / npx — the silent-
88
+ stale-npx-cache trap), npm currency (reuses the existing cached update check), and skill↔CLI
89
+ version match (reuses `abx skill`'s own discovery). Each row names the exact fix.
90
+ - **Deploy previews stop showing addresses they can't keep**: `--dry-run` (`deploy` /
91
+ `deploy-series` / `deploy-code`) **without `--salt`** no longer prints a "deterministic address" —
92
+ that salt was just freshly, randomly reserved, so the address was real for that one preview and
93
+ never reproducible by a plain re-run. It now prints the salt itself, prominently, plus how to pin
94
+ it: re-run with `--salt <shown>` (guaranteed same address), or `abx predict --salt <shown> --for
95
+ <signer>`. **With `--salt`, the address prints exactly as before** (it IS stable) — `abx predict`
96
+ is unchanged. The same rule applies to `--json`: without `--salt`, `address` reports `null` rather
97
+ than a value the real deploy won't land at (`saltPinned` still says why).
98
+ - **`approvals` — a labeled, honest signature count**: every deploy-family `--dry-run` preview and
99
+ `--confirm` summary now carries one uniform `approvals N wallet approval(s)` line/clause — the
100
+ number of **wallet TX signatures** the real run will ask for (a connected-wallet storage upload,
101
+ e.g. Arweave via `--storage-signer eth`, is a message signature, not a transaction, and stays
102
+ listed separately, as it already was). It's derived from the exact same staging/setup-multicall
103
+ math that sizes the wallet-lane session's own `total`, so the two can never disagree — this caught
104
+ (and fixed) `deploy-code`'s wallet-lane session `total` being hardcoded to `2` even on the 1-tx path
105
+ (no chunks/schema/deps/on-chain-uri legs/setup-carried mints), which would have shown "transaction
106
+ 1 of 2" and then silently never asked for a second.
107
+ - **One validator for render×storage combos**: `@artblocks/abx-storage` gains
108
+ `validateRenderStorageCombo()` (`content-plan.ts`) — the single source of truth for two known-bad
109
+ configurations, each checked against the ACTUAL fact that makes it bad (not against an unrelated
110
+ flag): (1) `--image-base` needs a backend that can overwrite a stable per-token key in place; an
111
+ ipfs/arweave-_shaped URL_ is refused regardless of this deploy's own `--backend`, because those are
112
+ content-addressed — a re-upload gets a new address, so no fixed URL can point at it. (2) publishing
113
+ a render to a resolver that doesn't share this machine's disk needs a backend that can hand back a
114
+ public URL at all — `fs` (or `cloud` with no public base) can't. `deploy-code` wires this into BOTH
115
+ its real-run refusal (`--image-base`) and a new `render/storage ✓|✗ <reason>` dry-run row;
116
+ `requirePublishableBackend` (the existing `abx render --remote` / `abx effects` guard) now consults
117
+ the same validator for its ok/not-ok decision, so the two surfaces can't drift apart.
118
+ - **`abx storage show --check`**: a real read/write against the resolved storage config, not just
119
+ "is it configured." `cloud` PUTs a tiny object through the signed API and GETs it back over the
120
+ PUBLIC base with a plain unsigned fetch — the only check that catches the R2/S3
121
+ endpoint-vs-public-base trap (`health()` alone only proves the API credentials work); on failure
122
+ both URLs print, so the mismatch is visible. `ipfs`/`fs` reuse their existing `health()` verbatim
123
+ (gateway/API reachability, dir writability — no upload, no pin — reused, not reimplemented).
124
+ `arweave` adds an identity+balance READ, never a paid upload. Exit code is meaningful (0 ok / 1 any
125
+ ✗) so a script can gate a launch on it. `abx doctor`'s storage row now runs the same fuller probe
126
+ (bounded to 1.5s, matching its other fast network checks) instead of a bare `health()` call.
127
+
128
+ ### Patch Changes
129
+
130
+ - 11fa933: The remaining phases of the simplification refactor that hadn't yet gotten a changeset: the CLI's
131
+ internal module split, the token-api/effects/mint-page convergence on the SDK, the shipped skill's
132
+ rewrite for the simplified surface, and a new SDK README.
133
+
134
+ - **`abx`'s `main.ts` split into domain command modules** (`commands/{deploy,project,reads,service,
135
+ scaffold,storage}.ts`, shared `output.ts`/`errors.ts`), with one exit-discipline rule
136
+ (`process.exitCode` + return, or a typed `CliError`, everywhere — bare `process.exit` only at the
137
+ entry guard, the top-level catch, and the keep-alive SIGINT handler). Purely internal: a 207-fixture
138
+ byte-diff matrix (every help text, dry-run, error path, and exit code) confirmed identical output
139
+ before and after.
140
+ - **token-api / effects / mint-page converge on the SDK**: `@artblocks/abx-storage` gains one
141
+ `resolveGatewayBase` (`readiness.ts`), replacing three near-identical copies (two in token-api, one
142
+ inline in storage itself); token-api exports `buildGeneratorDocument` so the CLI's `abx preview`
143
+ consumes the real generator-document assembler instead of a hand-kept duplicate; the effects runner
144
+ now resolves its config via the SDK's `readEnv` and gets a `makePublicClient` fallback transport, so
145
+ `ABX_RPC_URL` accepts a comma-separated failover list like every other RPC var; the scaffolded
146
+ mint-page app now imports ABIs from `@artblocks/abx-sdk/abi` and a browser-safe `makePublicClient` +
147
+ typed `readSaleConfig` instead of hand-rolled fetch/decode, and pins its generated `package.json` to
148
+ the SDK's _resolved_ version via a new `@artblocks/abx-sdk/package.json` export (alpha version
149
+ counters diverge per package under changesets, so pinning the CLI's own number could produce an
150
+ unsatisfiable range).
151
+ - **The shipped skill (`.claude/skills/abx-self-host/`) is rewritten for the surface phases 0–5
152
+ actually shipped**: every warning made obsolete by an enforcement is deleted rather than softened —
153
+ predict-only deploy-preview addresses, the `approvals N` line, the single `ABX_REMOTE_SELF_*`
154
+ credential grammar, `doctor`'s version/provenance ladder, `storage show --check`, the render/storage
155
+ combo validator's dry-run row, and `ABX_DEPLOYER_PK` as the only key name. Retired names swept from
156
+ `dev-loop-test`, the agent-eval scenarios, and spec prose. The skill ships bundled inside this CLI
157
+ package (co-versioned via `SKILL.md` frontmatter), so it rides this same patch.
158
+ - **New `packages/sdk/README.md`**: what the SDK is, the send-injection model (`PreparedTx` +
159
+ `SendTx`, `makeHotSender` for a hot key, bring-your-own for a wallet/multisig), a complete
160
+ deploy → upload → mint → read walkthrough against real exports, and browser-use notes (explicit
161
+ `rpcUrls`, no env, the `/node` subpath is Node-only). Included in the npm tarball automatically
162
+ (README is one of the files npm always packs, regardless of the `files` allowlist).
163
+
164
+ - 11fa933: Two ripouts, no functional loss: the retired `params.keys` read fallback in `abx state`, and the `abx changelog` command.
165
+
166
+ **`abx state`'s legacy `params.keys` fallback.** On-chain param enumeration (`contractParamKeys` /
167
+ `tokenParamKeys` / `paramSchemaKeys`) shipped a while back and every project deployed since enumerates
168
+ its own param surface — nothing writes the old `params.keys` CSV any more. The only thing still reading
169
+ it was `abx state`, so it could keep describing the handful of pre-enumeration testnet projects that
170
+ predate the switch. That reader (`readLegacyParamsKeys`) and its `legacy`-branching in `cmdStateBody`
171
+ are gone; `abx state` now shows exactly what it reads from on-chain enumeration, an empty PostParams
172
+ list for a pre-enumeration contract included. (The repoint guard that refuses to point a legacy token's
173
+ field renderer at the canonical generator is a separate, still-live safeguard — untouched.)
174
+
175
+ **`abx changelog`.** A `CHANGELOG.md`-reading command that duplicated what any agent or human can do by
176
+ reading the file that already ships with the package (`package.json` `files`) — one more command to
177
+ document and maintain for a read `cat` already covers. `CHANGELOG.md` keeps shipping; the update-nag
178
+ banner and the docs now point at the file and at npm's version list
179
+ (`https://www.npmjs.com/package/@artblocks/abx-cli?activeTab=versions`) instead of a command.
180
+
181
+ - 11fa933: The extraction phase of the simplification refactor: business logic that lived only inside the CLI
182
+ is now importable — the CLI calls the same functions you can.
183
+
184
+ **Into the SDK:** the five trust-anchor bootstraps (`ensureFactory`, `ensureSeriesFactory`,
185
+ `ensureSeriesCodeFactory`, `ensureRenderer`, `ensureSeedSource` — `anchors.ts`, on the same
186
+ injected-`send` + `onEvent` pattern as `ensureChunkStore`, with a typed `AnchorUnavailableError`),
187
+ `detectCanonicalFactory`/`resolveScanFloor`, the on-chain-URI setup composer (`onchain-uri.ts`),
188
+ interrupted-deploy resume planning (`resume.ts`), migration plan/parity reconciliation
189
+ (`migrate.ts`), the `abx.js` static analyzer (`inspect.ts`), dependency setup legs (`deps.ts`),
190
+ content-staging plans (`staging.ts` — `planStagedContent`, `stageFieldContent` with `StagingEvent`),
191
+ `mintedTokenIds`, and a typed `readSaleConfig` for the fixed-price minter.
192
+
193
+ **Into storage:** `uploadAndLocate`, `repinNodeCustody` (the byte-custody half of migration),
194
+ `decideImageContentLane`, `assessStorageReadiness`/`assessTurboFunds` (the Arweave/Turbo funding
195
+ math), and `awaitLocatorReady` (poll a locator until it serves).
196
+
197
+ **CLI hardening that fell out of the dedup:** one risk gate (`gatedSend`) now guards every write —
198
+ `--dry-run` and `--confirm` mean the same thing on every command, all owner-ops gain `--confirm`,
199
+ and a write reaching the send lane under `--dry-run` is structurally impossible (grep-enforced by
200
+ test). One `CHAIN` source of truth; one memoized local-indexer accessor.
201
+
202
+ - 11fa933: Phase 1 of the simplification refactor: one transaction shape with one send-injection point, and an SDK that never touches `.env` or a Node-only global on its own. Two related passes, same release.
203
+
204
+ **One transaction shape, one executor.** `StagingTx`/`SendStagingTx` are gone — everything is a `PreparedTx` sent through a single `SendTx`. New `execute.ts` carries `makeHotSender` (pins the nonce once, detects an under-estimated gas limit against a just-deployed target, throws a typed `TxRevertedError` instead of reporting a reverted tx as confirmed) plus `pinGas`/`waitForCodeAt`, moved from the CLI (`gas.ts` is gone) with their design comments intact. Every `deployX` is now `prepareDeployX` (pure) + `deployX(send, ...)`; the CLI's hot lane and `abx deploy-code --resume` both delegate to the same sender instead of hand-rolling their own nonce/gas loop — the class of bug that reported a burned, reverted transaction as a successful deploy can't recur in a second call site because there is no longer a second implementation.
205
+
206
+ **The SDK never loads `.env` implicitly.** `loadDotEnv`/`parseEnvContent` moved to a new `@artblocks/abx-sdk/node` subpath — the only module that touches `node:fs`/`node:path`. The package's main entry is now browser-bundle-safe (a permanent esbuild smoke test guards it); a host calls `loadDotEnv()` once at startup (the CLI's `main()`, the effects runner's `main()`) and the SDK core reads whatever's already in `process.env` through a tiny `readEnv` that no-ops outside Node. `ClientOptions` gained `rpcUrls?: string[]` and `makeWalletClient`/`envSigningKey` gained a `privateKey`/`override` escape — explicit config now wins outright over env resolution, following the same override → env → manifest precedence `deployments.ts` already used for contract addresses.
207
+
208
+ **Single signing-key name.** `ABX_DEPLOYER_PK` is the only env var the SDK reads for a hot key — `SEPOLIA_FUNDED_PK` and `SEPOLIA_WALLET_PK` (earlier-alpha names) are no longer consulted. A caller with one of the old names set now gets a `MissingSigningKeyError` that names the new one explicitly and says the old ones are retired, rather than a plain "no key found" that leaves an upgrader hunting for why a key that's clearly _there_ isn't being read. Sandbox/e2e scripts and test fixtures move to the new name too.
209
+
210
+ **Shared, environment-neutral utilities.** New `sdk/src/util.ts`: `sleep`, a `linearBackoffDelay` helper (service.ts's retry ladder and the effects runner's resolver poll both use it now instead of hand-rolled backoff math), `parseDataUri` (replaces three near-identical `data:` URI regexes across the CLI and the tokenURI probe with one permissive parser), and `tryReadContract` (replaces three near-identical try/read-return-undefined helpers; the CLI's "no contract at this address" diagnostic still wraps it where that mattered). `Buffer` is gone from the SDK core (chunk hex-encoding and param base64-encoding now use viem's `bytesToHex` and a ~12-line dependency-free base64 codec) — nothing in the SDK's main import graph is Node-only any more.
211
+
212
+ - Updated dependencies [11fa933]
213
+ - Updated dependencies [11fa933]
214
+ - Updated dependencies [11fa933]
215
+ - Updated dependencies [11fa933]
216
+ - @artblocks/abx-sdk@0.1.0-alpha.10
217
+ - @artblocks/abx-storage@0.1.0-alpha.10
218
+ - @artblocks/abx-token-api@0.1.0-alpha.13
219
+ - @artblocks/abx-indexer@0.1.0-alpha.11
220
+
3
221
  ## 0.1.0-alpha.17
4
222
 
5
223
  ### Patch Changes
@@ -0,0 +1,181 @@
1
+ import { SelfHostIndexer } from '@artblocks/abx-indexer';
2
+ import { type Address, type OnChainFieldInput, type OpenSeaAttribute, type ProjectState, type PublicClient, type SeriesTokenFieldInput } from '@artblocks/abx-sdk';
3
+ import { type Hex } from 'viem';
4
+ import { type StorageOverrides } from '../config.js';
5
+ import { type Flags } from '../flags.js';
6
+ export declare const DIMENSIONS: Record<string, {
7
+ label: string;
8
+ aliases: string[];
9
+ }>;
10
+ export declare function resolveDimension(type: string): string;
11
+ /**
12
+ * A `--dry-run` computes the deterministic deploy address, which is a pure function of
13
+ * (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve it the
14
+ * same way the preview will (`--for`, else an env key) and fail EARLY with the fix if neither
15
+ * exists, rather than after the preview has printed several steps of work.
16
+ */
17
+ /**
18
+ * A dry run only checks whether a factory address is CONFIGURED, not whether it has code on this
19
+ * chain — and the manifest always has an address, so a chain where the trust anchor isn't deployed
20
+ * (a private/local chain, or a wrong-network RPC) sailed past this and died inside
21
+ * `predictDeterministicAddress` with a raw `returned no data ("0x")` and a list of ABI hypotheses.
22
+ * The real deploy and `abx predict` both explain that case; a preview of the same deploy must too.
23
+ * Returns false when the caller should stop (message already printed).
24
+ */
25
+ export declare function previewFactoryLive(client: PublicClient, factory: Address, label: string): Promise<boolean>;
26
+ /**
27
+ * Placeholder-identity guard, shared by ALL THREE deploy commands. `name`/`symbol` are written
28
+ * on-chain as the public collection identity and are effectively permanent, so a real deploy must
29
+ * never bake a tool default silently: warn in a preview, HARD-STOP a real send unless `--yes`.
30
+ *
31
+ * It was duplicated per command, and `deploy-series` simply never got a copy — its default
32
+ * "ABX Series"/"ABXS" went on-chain with at most a warning, while the skill promises the CLI
33
+ * refuses demo defaults. (deploy-code's copy even said "mirror deploy/deploy-series", which made
34
+ * the gap look closed.) One predicate now, like `loopbackBaseUrl()`, so a fourth command can't drift.
35
+ */
36
+ export declare function assertRealIdentity(flags: Flags, o: {
37
+ name: string;
38
+ symbol: string;
39
+ dryRun: boolean;
40
+ }): void;
41
+ export declare function assertPreviewDeployer(flags: Flags): void;
42
+ export declare function warnUnfunded(publicClient: PublicClient, address: Address): Promise<void>;
43
+ export declare function shArg(v: string): string;
44
+ export declare function deployCommandLine(flags: Flags, salt: string): string;
45
+ export declare function deploySeriesCommandLine(flags: Flags, salt: string): string;
46
+ export declare function deployCodeCommandLine(flags: Flags, salt: string): string;
47
+ export declare const imageKeccakField: (value: Hex) => OnChainFieldInput;
48
+ export declare const imageInlineField: (svg: string) => OnChainFieldInput;
49
+ /** An `image` field pointing at an off-chain URL (the renderer emits it verbatim). */
50
+ export declare const imageUrlField: (url: string) => OnChainFieldInput;
51
+ /** An `image` field as a `url-template` — `{id}` is substituted with the tokenId at render, so ONE
52
+ * (collection-scope) field addresses a whole pinned directory / Arweave manifest. */
53
+ export declare const imageUrlTemplateField: (template: string) => OnChainFieldInput;
54
+ export declare const looksLikeSvg: (s: string) => boolean;
55
+ /**
56
+ * Does the IMAGE itself end up on-chain for this deploy? Two ways it can:
57
+ * • `--onchain-image` — the bytes are staged in the chunk store and read back via a `reader` field.
58
+ * • `--onchain-uri` with an SVG — v1 inlines SVG directly as a data: URI (raster cannot be).
59
+ * Anything else falls through to keccak256 custody, and the on-chain renderer serves its PLACEHOLDER
60
+ * image. This distinction is the difference between a token that is durable and one that only looks
61
+ * durable, so it must be computed from the actual file — never inferred from the flag alone (the
62
+ * success banner used to claim "fully on-chain, no hosting needed" for a keccak-anchored raster).
63
+ */
64
+ /**
65
+ * Will `tokenURI` resolve to the creator's REAL image, with nothing to keep running?
66
+ *
67
+ * Three ways yes, and they are not the same promise: the bytes are on-chain
68
+ * ({@link imageEndsUpOnChain}), or they sit at a durable public URL that the on-chain JSON points at
69
+ * (a direct-URL backend — the "no server" pattern). Only `fs` custody under `--onchain-uri` fails,
70
+ * because the renderer then holds a hash and nothing can serve it. Keep this separate from
71
+ * "fully on-chain": conflating them is what let a keccak-anchored raster ship under a permanence
72
+ * banner it did not earn.
73
+ */
74
+ export declare function imageResolvesWithoutServer(flags: Flags, onchainImage: boolean): boolean;
75
+ export declare function imageEndsUpOnChain(flags: Flags, onchainImage: boolean): boolean;
76
+ /** A browser wallet reached through an open sign session, used as the Turbo (Arweave) upload
77
+ * identity so the wallet's own credits pay — `signMessage` returns the `0x` EIP-191 signature. */
78
+ export type RemoteEthUpload = {
79
+ address: Address;
80
+ signMessage: (message: Uint8Array) => Promise<string>;
81
+ };
82
+ export declare function prepareContent(imagePath: string | undefined, clone: Address, overrides: StorageOverrides, store?: boolean, // false for --dry-run: compute the hash but don't custody bytes
83
+ onChain?: boolean, // true (--onchain-uri): put the image ON-CHAIN (inline SVG) so it self-resolves
84
+ remoteEth?: RemoteEthUpload, // wallet-lane Turbo uploads: sign+pay with the connected browser wallet
85
+ walletAddr?: string): Promise<{
86
+ tokenFields: OnChainFieldInput[];
87
+ contentNote: string;
88
+ }>;
89
+ /**
90
+ * Real OpenSea traits supplied by the creator, from `--attributes <file.json>` (canonical array or
91
+ * `{name: value}` map) and/or `--traits "Background=Blue; Edition=3"` (quick inline form). These are
92
+ * the marketplace trait array — NOT a place for protocol facts. Empty when neither flag is given.
93
+ */
94
+ export declare function parseDeployTraits(flags: Flags): OpenSeaAttribute[];
95
+ /** Encode creator traits as the on-chain `attributes` field (inline JSON bytes) — for `--traits-onchain`. */
96
+ export declare const attributesInlineField: (attrs: OpenSeaAttribute[]) => OnChainFieldInput;
97
+ /** Warn when IPFS/Arweave custody is pointed at a LOCAL gateway: the served image URL
98
+ * (`<gateway>/ipfs/<cid>`) would resolve only on this machine, so marketplaces/wallets can't
99
+ * load it — a pinning service + a PUBLIC gateway is part of operating off-chain custody. */
100
+ export declare function localGatewayWarning(flags: Flags): string | null;
101
+ /** A readout line for an optional creator text field — states exactly what's written (and where),
102
+ * or that NOTHING is, so the deploy never silently invents one. */
103
+ export declare function describeDeployField(label: string, value: string | undefined, onchain: boolean): string;
104
+ /** Readout lines for whichever authorship/rights fields a deploy will write (always on-chain,
105
+ * inline collection fields). Empty when none are set — so the readout stays quiet by default. */
106
+ export declare function authorshipReadout(flags: Flags): string[];
107
+ /** A readout line for creator traits — the exact traits written (and where), or that none are. */
108
+ export declare function describeTraits(traits: OpenSeaAttribute[], onchain: boolean): string;
109
+ export declare function cmdDeploy(flags: Flags, serveAfter: boolean): Promise<void>;
110
+ export declare function cmdDeployBody(flags: Flags, serveAfter: boolean, emit: (p: Record<string, unknown>) => void): Promise<void>;
111
+ export declare const tokenFieldOf: (tokenId: number, f: OnChainFieldInput) => SeriesTokenFieldInput;
112
+ export declare function cmdDeploySeries(flags: Flags): Promise<void>;
113
+ export declare function cmdDeploySeriesBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
114
+ /**
115
+ * `abx deploy-code` — deploy a code project ({SeriesCode}) end to end, hot lane:
116
+ * the canonical factory + seed source from the manifest, fat initialize (the `code`
117
+ * field rides it in directory mode), then ONE post-deploy multicall for the script
118
+ * chunks (template mode) + any PostParam schemas, optional reserve mints, and local
119
+ * register + index. Grown directly from the Sepolia drop rehearsal
120
+ * (`packages/cli/scripts/code-drop-rehearsal.ts`).
121
+ *
122
+ * Modes (exactly one):
123
+ * --script <file> template mode — the program stored on-chain in chunks
124
+ * --code-dir <dir> directory mode — the build uploaded via the storage backend
125
+ * (`putDirectory`; ipfs/arweave), its root as the `code` field
126
+ *
127
+ * Schemas: --schema key:Type:Auth[,key:Type:Auth…] (e.g. palette:HexColor:TokenOwner).
128
+ * Seeds: canonical randomizer by default; --no-seed opts out.
129
+ */
130
+ /**
131
+ * The deterministic part of a projection: everything that is a pure function of the chain.
132
+ * Deliberately EXCLUDES `reconstructedAt`, `rpcUrl` and `toBlock` — a timestamp, the endpoint that
133
+ * happened to answer, and the head at scan time all legitimately differ between two replays, so
134
+ * folding them in would make the rebuild proof fail for reasons that aren't about correctness.
135
+ */
136
+ export declare function projectionFingerprint(s: ProjectState): string;
137
+ /**
138
+ * Print the reconstructed spine — the point being that this list IS the database. Rendered inside
139
+ * the index step (no header of its own: "Index it — replay the event spine" immediately followed by
140
+ * a separate "The event spine" step read as a stutter).
141
+ */
142
+ export declare function walkthroughSpine(state: ProjectState): void;
143
+ /**
144
+ * [4] The claim, demonstrated: delete the local projection and rebuild it from the chain.
145
+ *
146
+ * This is the one step that can't be faked by good output — it drops the projection for real
147
+ * (registration kept), confirms it's gone, replays from the deploy block, and compares a
148
+ * fingerprint of everything chain-derived. If ABX's premise is wrong, this step fails loudly.
149
+ */
150
+ export declare function walkthroughRebuild(indexer: SelfHostIndexer, address: Address, before: ProjectState): Promise<void>;
151
+ /**
152
+ * [5] Read the token back the way a marketplace would.
153
+ *
154
+ * Which is genuinely a different act per lane, so it reads from the real source in each case rather
155
+ * than always going through the local server:
156
+ * • fully on-chain → call `tokenURI(0)` on the contract. That IS what a marketplace does, and on
157
+ * this lane the whole answer (art included) comes back from the chain with nothing else running.
158
+ * • off-chain custody → fetch the resolver, because that's what the baked URI points at.
159
+ * Reading the on-chain lane over HTTP would have quietly implied the local server was load-bearing
160
+ * when it isn't — the opposite of the lesson.
161
+ */
162
+ export declare function walkthroughReadBack(state: ProjectState, baseUrl: string, onChainUri: boolean): Promise<void>;
163
+ /** Every flag `deploy-code` recognizes — so an unsupported/typo'd one warns instead of silently
164
+ * no-opping. Keep in lockstep with the flags read below + the storageOverrides/lane helpers. */
165
+ export declare const DEPLOY_CODE_FLAGS: Set<string>;
166
+ export declare const SHARED_DEPLOY_FLAGS: string[];
167
+ export declare const DEPLOY_FLAGS: Set<string>;
168
+ export declare const DEPLOY_SERIES_FLAGS: Set<string>;
169
+ export declare function cmdDeployCode(flags: Flags): Promise<void>;
170
+ export declare function cmdDeployCodeBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
171
+ /**
172
+ * Resolve `--721c` into the InitParams `transferValidator`. Absent → `zeroAddress`: a plain
173
+ * ERC-721, byte-for-byte the pre-721C deploy — no prompts, no output, no mention of 721C.
174
+ * `--721c` / `--721c recommended` → the per-chain recommended validator (refused, naming the
175
+ * chains that have one, when the manifest has no entry); `--721c 0x…` → checksum-validated AND
176
+ * pre-checked for code on this chain (the factory would revert `InvalidTransferValidator()` —
177
+ * surface it before any upload/staging/gas). When enrolling, prints the one plain statement of
178
+ * what enforcement means — once, adapted to the chosen validator.
179
+ */
180
+ export declare function resolveTransferValidatorFlag(flags: Flags, publicClient: PublicClient, dryRun: boolean): Promise<Address>;
181
+ //# sourceMappingURL=deploy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","s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