@artblocks/abx-cli 0.1.0-alpha.13 → 0.1.0-alpha.14

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.
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EASL,KAAK,OAAO,EACb,MAAM,oBAAoB,CAAC;AAoB5B,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQnD;AAOD,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEhE;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEtE;AAED,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEjE;AAED,mGAAmG;AACnG,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEnE;AAED,iGAAiG;AACjG,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEzE;AAID,yGAAyG;AACzG,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CA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AwF;AACxF,wBAAgB,mBAAmB,CAAC,EAAE,GAAE,gBAAqB,GAAG,SAAS,GAAG,KAAK,CAGhF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAE,gBAAqB,GAAG,qBAAqB,CAgD/E;AAED,wEAAwE;AACxE,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,EAAE,GAAE,gBAAqB,GAAG;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;CAAC,CAIlH;AAaD,6EAA6E;AAC7E,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAOD;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,UAAU,GAAG,SAAS,CAOvD;AAED,gGAAgG;AAChG,wBAAgB,gBAAgB,IAAI;IAAC,GAAG,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAQrG"}
package/dist/config.js CHANGED
@@ -1,6 +1,6 @@
1
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
1
+ import { mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { dirname, resolve } from 'node:path';
3
- import { arweaveAddress, generateArweaveJwk, } from '@artblocks/abx-storage';
3
+ import { arweaveAddress, generateArweaveJwk, resolveArweaveJwk, } from '@artblocks/abx-storage';
4
4
  import { resolveChain, DEFAULT_CHAIN_KEY, resolveFactory, resolveSeriesFactory, resolveRenderer, resolveChunkStore, resolveFixedPriceMinter, envSigningKey, } from '@artblocks/abx-sdk';
5
5
  /**
6
6
  * Runtime resolution for the CLI — deliberately **stateless about decisions**. There is no
@@ -168,12 +168,12 @@ function parseJwk(raw) {
168
168
  * and **never silently replaces** a corrupt key (that would strand its credits) — a bad key throws.
169
169
  */
170
170
  export function loadArweaveJwk() {
171
- if (process.env.ARWEAVE_JWK)
172
- return parseJwk(process.env.ARWEAVE_JWK);
173
- const p = arweaveKeyFile();
174
- if (existsSync(p))
175
- return JSON.parse(readFileSync(p, 'utf8'));
176
- return undefined;
171
+ // Delegate to the storage package's resolver so the CLI and the SDK cannot disagree about where
172
+ // the identity lives — they did, and porting a working CLI flow to the SDK broke every upload with
173
+ // "Arweave via Turbo needs an identity". It also owns the diagnostics: a bare `JSON.parse` here
174
+ // reported an empty key file as "Unexpected end of JSON input", naming a parser instead of the
175
+ // file or the remedy.
176
+ return resolveArweaveJwk();
177
177
  }
178
178
  /** Load or CREATE the managed Turbo identity, persisting a fresh key (0600) to the data dir. */
179
179
  export function ensureArweaveJwk() {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,kBAAkB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;GAaG;AAEH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,iBAAiB,CAAC;AACzD,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAErD,MAAM,UAAU,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,U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H,SAAS,uBAAuB;IAC9B,MAAM,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAC7B,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CACT,+CAA+C,CAAC,CAAC,OAAO,IAAI;YAC1D,OAAO,CAAC,CAAC,IAAI,4FAA4F,CAC5G,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC,GAAG,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEvD,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAA8B,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAAgC,CAAC;AAE9E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAchD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAG9E"}
1
+ {"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEvD,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAuC,CAAC;AAEzF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAAgC,CAAC;AAE9E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAchD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAG9E"}
package/dist/flags.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Flags where every occurrence counts (values comma-join, in argv order). */
2
- export const REPEATABLE_FLAGS = new Set(['dep', 'schema']);
2
+ export const REPEATABLE_FLAGS = new Set(['dep', 'schema', 'param']);
3
3
  /**
4
4
  * Flags valid on ANY command (handled centrally in main, not by a command handler), so
5
5
  * {@link unknownFlags} never flags them as unrecognized regardless of the per-command allowlist.
package/dist/flags.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAaA,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAE9E,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,MAAM,GAAG,GAAU,EAAE,CAAC;IACtB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;QACnC,GAAG,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,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CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,OAAyB;IAClE,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC"}
package/dist/main.js CHANGED
@@ -57,11 +57,11 @@ import { formatEther, toHex, zeroAddress } from 'viem';
57
57
  import { encodeFunctionData } from 'viem';
58
58
  import { DEP_RESOLUTION, deploySeedSource, deploySeriesCodeFactory, prepareCodeSetup, prepareDeploySeriesCode, resolveGenerator, resolveSeedSource, resolveSeriesCodeFactory, seriesCodeAbi, readParamSchema, seriesCodeFactoryAbi, } from '@artblocks/abx-sdk';
59
59
  import { checkRegistryDeps, dependencySetupCalls, parseDepFlag, resolveDepRegistryPointer } from './deps.js';
60
- import { composeParamsKeys, expectedChainComplete, hasOnChainUriLane, onchainUriSetupCalls, onChainUriReport, readParamsKeys } from './onchain-uri.js';
60
+ import { expectedChainComplete, hasOnChainUriLane, onchainUriSetupCalls, onChainUriReport, readLegacyParamsKeys, readParamSchemaKeys, readSetParamKeys, } from './onchain-uri.js';
61
61
  import { parseFlags, unknownFlags } from './flags.js';
62
62
  import { AGENT_SKILL_PARENTS, checkForCliUpdate, compareVersions, installedSkillVersions, readCliVersion, readSkillVersion, SKILL_DIR_NAME, } from './update-check.js';
63
63
  import { analyzeScript, recommendLane } from './inspect.js';
64
- import { previewConfigFromFlags, previewDepTags, shootPreview, startPreviewServer, DEFAULT_PREVIEW_PORT, PREVIEW_FLAGS } from './preview.js';
64
+ import { previewConfigFromFlags, previewDepTags, parsePreviewParams, shootPreview, startPreviewServer, DEFAULT_PREVIEW_PORT, PREVIEW_FLAGS } from './preview.js';
65
65
  import { parseSchemaSpecs, describeSchema } from './schema.js';
66
66
  import { declinesSkillInstall } from './prompt.js';
67
67
  import { pinGas, waitForCodeAt } from './gas.js';
@@ -174,6 +174,22 @@ async function main() {
174
174
  loadDotEnv();
175
175
  const [cmd, ...rest] = process.argv.slice(2);
176
176
  const flags = parseFlags(rest);
177
+ // `--chain` is the flag people reach for, and it does not exist: chain selection is the ABX_CHAIN
178
+ // env var. It used to be swallowed by the generic stray-flag WARNING and the command then acted on
179
+ // the DEFAULT chain — `abx deploy-code … --chain sepolia` deployed to base-sepolia. On a dry run
180
+ // that costs a confused minute; on a funded send it is a wrong-chain deploy with real artifacts at
181
+ // the wrong address. Prose that was ignored once will be ignored again, so this refuses instead,
182
+ // on EVERY command (a read-only command that quietly ignored it would still teach the wrong model).
183
+ if (flags.chain !== undefined) {
184
+ const asked = typeof flags.chain === 'string' && flags.chain !== 'true' ? flags.chain : '';
185
+ process.stderr.write(`\n${c.red}✗${c.reset} there is no ${bold('--chain')} flag — the chain is chosen by the ${bold('ABX_CHAIN')} environment variable.\n` +
186
+ ` active now: ${bold(CHAIN)}${asked && asked !== CHAIN ? ` ${dim(`(you asked for '${asked}')`)}` : ''}\n` +
187
+ ` known chains: ${KNOWN_CHAIN_KEYS.join(', ')}\n\n` +
188
+ ` run it on ${asked && KNOWN_CHAIN_KEYS.includes(asked) ? asked : '<chain>'} like this:\n` +
189
+ ` ${bold(`ABX_CHAIN=${asked && KNOWN_CHAIN_KEYS.includes(asked) ? asked : '<chain>'} abx ${cmd ?? '<command>'} …`)}\n` +
190
+ ` ${dim('(the CLI is deliberately stateless — every run resolves its chain from the environment, so nothing a previous command set can leak into this one.)')}\n\n`);
191
+ process.exit(1);
192
+ }
177
193
  // `version` / --version / -v is a crisp query — print and exit, no update nag around it.
178
194
  if (cmd === 'version' || cmd === '--version' || cmd === '-v') {
179
195
  console.log(readCliVersion());
@@ -688,10 +704,12 @@ async function cmdSetRendererCli(address, flags) {
688
704
  flags.renderer = await ensureRenderer();
689
705
  return cmdSetRenderer(address, flags);
690
706
  }
691
- /** Is the configured renderer the spec version this build expects (v3 — the `artifacts` manifest
692
- * plus the authorship/rights collection fields)? A behind-spec renderer is treated as stale so
693
- * {ensureRenderer} deploys a fresh one (greenfield redeploy-freely: this number is what tells the
694
- * CLI a deployed renderer predates a projection the current build emits). Bump in lockstep with
707
+ /** Is the configured renderer the spec version this build expects (v4 — the computed `abx_params`
708
+ * object, enumerated from chain, plus `animation_url` wrapped as `data:text/html;base64` for the
709
+ * inline/reader representations)? A behind-spec renderer is treated as stale so {ensureRenderer}
710
+ * deploys a fresh one (greenfield redeploy-freely: this number is what tells the CLI a deployed
711
+ * renderer predates a projection the current build emits). A v4 renderer is safe on ANY token —
712
+ * pointed at a legacy implementation it simply emits no params block. Bump in lockstep with
695
713
  * `AbxMetadataRenderer.SPEC_VERSION`. */
696
714
  async function isCurrentRenderer(publicClient, renderer) {
697
715
  try {
@@ -700,7 +718,7 @@ async function isCurrentRenderer(publicClient, renderer) {
700
718
  abi: abxMetadataRendererAbi,
701
719
  functionName: 'specVersion',
702
720
  }));
703
- return v === 3n;
721
+ return v === 4n;
704
722
  }
705
723
  catch {
706
724
  return false;
@@ -1130,7 +1148,7 @@ async function remoteLocators(address, stored, flags) {
1130
1148
  }
1131
1149
  // ── deploy (+ optionally serve) ──────────────────────────────────────────────
1132
1150
  async function cmdDeploy(flags, serveAfter) {
1133
- warnStrayFlags(flags, DEPLOY_FLAGS, 'deploy');
1151
+ refuseStrayFlags(flags, DEPLOY_FLAGS, 'deploy');
1134
1152
  warnSignWithoutFor(flags);
1135
1153
  const dimension = resolveDimension(flags.type ?? '1of1');
1136
1154
  // A multi-token collection is its OWN command; `abx deploy` is the single-token (1/1) path.
@@ -1738,7 +1756,7 @@ const tokenFieldOf = (tokenId, f) => ({
1738
1756
  value: f.value,
1739
1757
  });
1740
1758
  async function cmdDeploySeries(flags) {
1741
- warnStrayFlags(flags, DEPLOY_SERIES_FLAGS, 'deploy-series');
1759
+ refuseStrayFlags(flags, DEPLOY_SERIES_FLAGS, 'deploy-series');
1742
1760
  warnSignWithoutFor(flags);
1743
1761
  const name = flags.name ?? 'ABX Series';
1744
1762
  const symbol = flags.symbol ?? 'ABXS';
@@ -2931,9 +2949,14 @@ async function cmdPreview(flags) {
2931
2949
  if (shootDir) {
2932
2950
  step(`Render ${count} seeds headlessly`);
2933
2951
  try {
2952
+ const shotParams = parsePreviewParams(flags.param);
2953
+ if (Object.keys(shotParams).length) {
2954
+ info(`param overrides applied to every frame: ${Object.entries(shotParams).map(([k, v]) => `${k}=${v || dim('(unset)')}`).join(' · ')}`);
2955
+ }
2934
2956
  const shots = await shootPreview(server.url, shootDir, count, {
2935
2957
  width: Number(flags.width ?? 1000) || 1000,
2936
2958
  timeoutMs: Number(flags['timeout-ms'] ?? 10_000) || 10_000,
2959
+ params: shotParams,
2937
2960
  });
2938
2961
  ok(`${shots.length} frames → ${shootDir}/ ${dim('(traits in traits.json)')}`);
2939
2962
  for (const s of shots) {
@@ -3113,6 +3136,33 @@ const FLAG_HINTS = {
3113
3136
  supply: () => 'did you mean --max <N> (the supply cap)?',
3114
3137
  amount: () => 'a sale price/amount is set post-deploy via `abx minter configure`.',
3115
3138
  };
3139
+ /**
3140
+ * Unknown flags on a command that can SEND: refuse, don't warn.
3141
+ *
3142
+ * This used to warn and carry on, and `--chain sepolia` proved why that isn't enough — the warning was
3143
+ * accurate, it scrolled past, and the deploy ran on the DEFAULT chain. On a dry run that costs a
3144
+ * confused minute; on a funded send it is a wrong-chain deploy. "Prose that was ignored once will be
3145
+ * ignored again" is the standing rule here, so the tx-sending commands stop instead.
3146
+ *
3147
+ * Safe to refuse rather than warn because a flag absent from the allowlist is, by construction, one
3148
+ * the command never reads — verified per command by comparing every `flags.x` read in its body against
3149
+ * its allowlist. So refusal cannot break a working flag; it only makes an already-ignored one loud.
3150
+ *
3151
+ * `--dry-run` refuses identically. A preview that accepts what the real send rejects is its own trap:
3152
+ * you'd validate a command in preview and have it fail at the moment it matters.
3153
+ */
3154
+ function refuseStrayFlags(flags, allowed, cmd) {
3155
+ const stray = unknownFlags(flags, allowed);
3156
+ if (!stray.length)
3157
+ return;
3158
+ const hints = stray.map((f) => FLAG_HINTS[f]?.(cmd)).filter(Boolean);
3159
+ throw new Error(`unrecognized flag(s): ${stray.map((f) => '--' + f).join(', ')} — this command would have ignored them silently, so it is refusing instead.\n` +
3160
+ hints.map((h, i) => ` ↳ --${stray[i]}: ${h}`).join('\n') +
3161
+ (hints.length ? '\n' : '') +
3162
+ ` see \`abx help ${cmd}\` for the flags it accepts.`);
3163
+ }
3164
+ /** Unknown flags on a READ-ONLY command: warn, don't refuse. Nothing can be mis-sent, and a stray
3165
+ * flag on `preview`/`inspect` shouldn't stop a creator mid-iteration. */
3116
3166
  function warnStrayFlags(flags, allowed, cmd) {
3117
3167
  const stray = unknownFlags(flags, allowed);
3118
3168
  if (stray.length) {
@@ -3154,7 +3204,7 @@ async function cmdDeployCode(flags) {
3154
3204
  // Surface unsupported/typo'd flags BEFORE any work — a silent no-op on a write-adjacent value
3155
3205
  // (e.g. --description landing nowhere) is the worst failure mode. Non-fatal (see unknownFlags).
3156
3206
  // Shared path so the "did you mean --max / price is post-deploy" hints fire here too.
3157
- warnStrayFlags(flags, DEPLOY_CODE_FLAGS, 'deploy-code');
3207
+ refuseStrayFlags(flags, DEPLOY_CODE_FLAGS, 'deploy-code');
3158
3208
  warnSignWithoutFor(flags);
3159
3209
  const dryRun = !!flags['dry-run'];
3160
3210
  const name = flags.name ?? 'ABX Code';
@@ -3589,27 +3639,21 @@ async function cmdDeployCode(flags) {
3589
3639
  // gas cap and appear to REVERT. Expected, not a bug — a real session mis-diagnosed it as indexing lag.
3590
3640
  const tokenUriGasRisk = onChainUri && !codeDir && (scriptAnalysis?.doc.estBytes ?? 0) > 30_000;
3591
3641
  // --onchain-uri legs (ride the setup multicall, before the mints): the animation_url field
3592
- // pointing at the generator, the params.keys contract param, and the two URI renderers.
3593
- // params.keys composition rule: EVERY param key this deploy writes ∪ the --schema keys ∪
3594
- // `params.keys` itself deduped, sorted, comma-joined. deploy-code writes no display.*/
3595
- // render.* params today; a future flag that does MUST add its key to `writtenParamKeys` so
3596
- // the generator's on-chain tokenData stays byte-aligned with the resolver's (which carries
3597
- // every evented param — inputsHash parity is load-bearing).
3642
+ // pointing at the generator, and the two URI renderers. The param surface needs NO leg — the
3643
+ // generator enumerates it from the token on-chain (`contractParamKeys`/`tokenParamKeys`, kept in
3644
+ // step by the write paths themselves), so there is nothing for a deploy to declare and nothing to
3645
+ // drift. (The retired `params.keys` CSV convention is gone; a legacy project keeps its old generator.)
3598
3646
  // THE FOLD: on the renderer-only in-chain lane (no program), the on-chain-URI wiring (tokenURI/
3599
3647
  // contractURI renderers) + the reserve mint move INTO the deploy tx's init params — the token is
3600
3648
  // fully configured at deploy (the renderers already exist on-chain), so the setup multicall is
3601
3649
  // needed ONLY for a PostParam schema (and is skipped entirely when there's none → a 1-tx drop).
3602
3650
  // The script/dir lane is UNCHANGED: its chunks always need the multicall, and its mint must ride
3603
3651
  // AFTER the chunks (a mint-before-chunks token would be transiently unresolvable), so its
3604
- // URI-renderers + animation + params.keys + mint stay in the multicall exactly as before.
3652
+ // URI-renderers + animation + mint stay in the multicall exactly as before.
3605
3653
  const foldIntoInit = onChainUri && !hasProgram;
3606
- const writtenParamKeys = [];
3607
- const paramsKeysCsv = onChainUri ? composeParamsKeys(writtenParamKeys, schemas.map((s) => s.key)) : '';
3608
- // params.keys + the URI-renderer/animation legs only ride the multicall for a PROGRAM (the
3609
- // generator consumes params.keys; renderer-only has no generator and folds the renderers to init).
3610
- const onchainUriLegs = onChainUri && hasProgram
3611
- ? onchainUriSetupCalls({ generator, metadataRenderer, paramsKeys: paramsKeysCsv })
3612
- : null;
3654
+ // The URI-renderer/animation legs only ride the multicall for a PROGRAM (renderer-only has no
3655
+ // generator and folds the renderers into init).
3656
+ const onchainUriLegs = onChainUri && hasProgram ? onchainUriSetupCalls({ generator, metadataRenderer }) : null;
3613
3657
  const setupMintCount = foldIntoInit ? 0 : mintCount; // folded mints ride init, not the multicall
3614
3658
  // opt-in --confirm: one y/N before ANY upload or send (no-op without --confirm; never blocks scripts).
3615
3659
  if (!dryRun) {
@@ -3617,7 +3661,7 @@ async function cmdDeployCode(flags) {
3617
3661
  await confirmSend(`About to deploy code project "${name}" (${symbol}) — ${contentSummary}; ` +
3618
3662
  (identityFields.length ? `${identityFields.join(' + ')} on-chain; ` : '') +
3619
3663
  (onChainUri
3620
- ? `tokenURI ON-CHAIN via renderer ${metadataRenderer}${hasProgram ? ` (generator ${generator}; params.keys "${paramsKeysCsv}")` : ' (renderer-only — image + traits from your Solidity renderers, no animation)'}; `
3664
+ ? `tokenURI ON-CHAIN via renderer ${metadataRenderer}${hasProgram ? ` (generator ${generator})` : ' (renderer-only — image + traits from your Solidity renderers, no animation)'}; `
3621
3665
  : `resolver base ${baseUrl}; `) +
3622
3666
  `dependencies: ${deps.length ? deps.map((d) => d.display).join(', ') + (depRegistry ? ` (registry ${depRegistry})` : '') : 'none'}; ` +
3623
3667
  `mint: ${mintCount > 0 ? `${mintCount} at deploy${foldIntoInit ? ' (in the deploy tx)' : ''}` : 'deferred'}; ` +
@@ -3652,7 +3696,7 @@ async function cmdDeployCode(flags) {
3652
3696
  ? (await publicClient.readContract({ address: factory, abi: seriesCodeFactoryAbi, functionName: 'predictDeterministicAddress', args: [salt] }))
3653
3697
  : null;
3654
3698
  const depLegs = deps.length + (depRegistry ? 1 : 0);
3655
- const setupLen = scriptChunks.length + schemas.length + depLegs + (onchainUriLegs?.calls.length ?? 0) + setupMintCount;
3699
+ const setupLen = scriptChunks.length + schemas.length + depLegs + (onchainUriLegs?.length ?? 0) + setupMintCount;
3656
3700
  step(`Deploy plan — a ${max}-token code project to ${CHAIN}`);
3657
3701
  if (deployer)
3658
3702
  info(`deployer ${deployer}`);
@@ -3677,7 +3721,7 @@ async function cmdDeployCode(flags) {
3677
3721
  : `; no animation_url (renderer-only — image + attributes computed on-chain by your Solidity renderer(s))`));
3678
3722
  if (hasProgram) {
3679
3723
  info(` on-chain URI legs (ride the setup multicall): collection animation_url field (renderer rep → ${generator}) · ` +
3680
- `params.keys = "${paramsKeysCsv}" (${onchainUriLegs.paramsKeysEncoding === 'literal' ? 'literal bytes32' : `data-backed, ${paramsKeysCsv.length}B`}) · setTokenURIRenderer · setContractURIRenderer`);
3724
+ `setTokenURIRenderer · setContractURIRenderer ${dim('(the param surface enumerates on-chain no leg, nothing to maintain)')}`);
3681
3725
  }
3682
3726
  else {
3683
3727
  info(` on-chain URI wiring rides the ${bold('deploy tx')} itself (tokenURI/contractURI renderers${mintCount > 0 ? ' + the reserve mint' : ''} in init) — no separate setup tx for it.`);
@@ -3729,7 +3773,7 @@ async function cmdDeployCode(flags) {
3729
3773
  BigInt(storedBytes) * 216n + // ~200 gas/byte code deposit + ~16 gas/byte calldata
3730
3774
  BigInt(schemas.length) * 45000n +
3731
3775
  BigInt(depLegs) * 55000n +
3732
- BigInt(onchainUriLegs?.calls.length ?? 0) * 60000n +
3776
+ BigInt(onchainUriLegs?.length ?? 0) * 60000n +
3733
3777
  BigInt(mintCount) * 65000n;
3734
3778
  const gasPrice = await publicClient.getGasPrice();
3735
3779
  const eth = Number(roughGas * gasPrice) / 1e18;
@@ -3835,7 +3879,7 @@ async function cmdDeployCode(flags) {
3835
3879
  ...scriptChunks.map((chunk, i) => encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setScriptChunk', args: [BigInt(i), chunk] })),
3836
3880
  ...schemas.map(({ key, paramType, auth, authAddress, lockAfter, min, max, selectOptions }) => encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setParamSchema', args: [encodeTag(key), paramType, auth, authAddress, lockAfter, min, max, selectOptions] })),
3837
3881
  ...dependencySetupCalls(deps, depRegistry), // setDependency legs in index order (+ the soft registry pointer)
3838
- ...(onchainUriLegs?.calls ?? []), // program lane only: animation_url field · params.keys · the URI renderers (before the mints)
3882
+ ...(onchainUriLegs ?? []), // program lane only: animation_url field · the URI renderers (before the mints)
3839
3883
  ].concat(Array.from({ length: setupMintCount }, () => encodeFunctionData({ abi: seriesCodeAbi, functionName: 'mint', args: [owner] }))); // folded mints ride init, not here
3840
3884
  const cid = resolveChain(CHAIN).id;
3841
3885
  const preparedFor = async (owner) => {
@@ -3935,7 +3979,7 @@ async function cmdDeployCode(flags) {
3935
3979
  step('On-chain URI');
3936
3980
  ok(`tokenURI/contractURI resolve ON-CHAIN via the renderer ${metadataRenderer} — any RPC returns the metadata, no server in the graph`);
3937
3981
  if (hasProgram)
3938
- info(`animation_url computes on-chain via the generator ${generator} · params.keys = "${paramsKeysCsv}" (auto-managed; keep it in sync when adding param keys)`);
3982
+ info(`animation_url computes on-chain via the generator ${generator} it enumerates this token's params from chain, so there is no key list to maintain`);
3939
3983
  else
3940
3984
  info(`renderer-only — image + attributes computed on-chain by your Solidity renderer(s); no animation_url · ${g('fully on-chain')}, zero dependency outside the EVM`);
3941
3985
  if (hasProgram && !codeDir) {
@@ -4365,6 +4409,18 @@ async function cmdVerify(address, flags) {
4365
4409
  console.log(` ${c.orange}⚠${c.reset} no animation_url in the on-chain JSON — the generator field may be missing or unrenderable`);
4366
4410
  }
4367
4411
  }
4412
+ // The READ-side envelope. Params enumerate on-chain, so the write side is unbounded — but
4413
+ // tokenURI and tokenData assemble EVERY enumerated param per call, and that is what grows.
4414
+ // ~64 keys is the documented design envelope; hard failure only nears at several hundred.
4415
+ // Advisory (never a ✗) — a big surface is a legitimate choice, it just isn't free.
4416
+ const set = await readSetParamKeys(client, state.address, probe ? BigInt(probe.tokenId) : undefined);
4417
+ if (set) {
4418
+ const total = new Set([...set.contract, ...set.token]).size;
4419
+ if (total > 64) {
4420
+ console.log(` ${c.orange}⚠${c.reset} ${total} params enumerate on-chain${probe ? ` for token #${probe.tokenId}` : ''} — tokenURI and tokenData assemble every one of them per call, so both grow with this count. ` +
4421
+ dim('The documented design envelope is ~64; past a few hundred a public eth_call can hit its gas cap.'));
4422
+ }
4423
+ }
4368
4424
  }
4369
4425
  catch (e) {
4370
4426
  console.log(` ${c.orange}⚠${c.reset} on-chain URI check unavailable: ${e.message}`);
@@ -4543,29 +4599,35 @@ async function reportRemoteByteIntegrity(address, remote, base) {
4543
4599
  // Read tokenURI(id) STRAIGHT FROM THE CONTRACT on-chain (no server, no node) and decode
4544
4600
  // the data: URI. For a fully on-chain token (`--onchain-uri`), this is the proof it
4545
4601
  // self-resolves: the renderer assembles the JSON on-chain; any RPC returns it.
4546
- function decodeOnChainJson(uri) {
4602
+ function decodeOnChainJson(uri, verbatim = false) {
4547
4603
  const m = /^data:application\/json(;[^,]*)?,([\s\S]*)$/.exec(uri);
4548
4604
  if (!m)
4549
4605
  return null;
4550
4606
  const raw = (m[1] ?? '').includes('base64') ? Buffer.from(m[2], 'base64').toString('utf8') : decodeURIComponent(m[2]);
4551
4607
  try {
4552
4608
  const obj = JSON.parse(raw);
4609
+ // `verbatim` (--json) returns the document EXACTLY as the chain assembled it. Everything below is
4610
+ // a courtesy for human eyes, and abbreviating for eyes is fine — abbreviating for a PROGRAM is
4611
+ // not. An integrator scraped this output, got a `data:` URI cut to 96 chars that still looked
4612
+ // valid, and stored it; the only way to read their own token was to reimplement `eth_call`.
4613
+ if (verbatim)
4614
+ return JSON.stringify(obj, null, 2);
4553
4615
  for (const k of Object.keys(obj)) {
4554
4616
  const v = obj[k];
4555
4617
  // Truncate only huge inline `data:` blobs (base64 SVGs/images); show plain locator URLs
4556
4618
  // (http/ipfs/ar) IN FULL so the creator can verify where the image actually resolves.
4557
4619
  if (typeof v === 'string' && v.startsWith('data:') && v.length > 96)
4558
- obj[k] = `${v.slice(0, 96)}… (${v.length} chars)`;
4620
+ obj[k] = `${v.slice(0, 96)}… (${v.length} chars) [--json for the full value]`;
4559
4621
  }
4560
4622
  return JSON.stringify(obj, null, 2);
4561
4623
  }
4562
4624
  catch {
4563
- return raw.slice(0, 600);
4625
+ return verbatim ? raw : raw.slice(0, 600);
4564
4626
  }
4565
4627
  }
4566
4628
  async function cmdTokenUri(address, flags) {
4567
4629
  if (!address || address.startsWith('--')) {
4568
- console.error('usage: abx tokenuri <address> [--token <id>]\n');
4630
+ console.error('usage: abx tokenuri <address> [--token <id>] [--json]\n');
4569
4631
  process.exit(1);
4570
4632
  }
4571
4633
  if (!/^0x[0-9a-fA-F]{40}$/.test(address)) {
@@ -4600,6 +4662,12 @@ async function cmdTokenUri(address, flags) {
4600
4662
  }
4601
4663
  process.exit(1);
4602
4664
  }
4665
+ // --json: the verbatim document, nothing else on stdout — no banner, no ANSI, no truncation, so
4666
+ // `abx tokenuri <addr> --json | jq` is a supported read path rather than something to regex.
4667
+ if (flags.json !== undefined) {
4668
+ process.stdout.write((decodeOnChainJson(uri, true) ?? uri) + '\n');
4669
+ return;
4670
+ }
4603
4671
  console.log(`\n ${bold(`tokenURI(${tokenId})`)} ${dim(`— read directly from ${address} on ${CHAIN}, no server`)}`);
4604
4672
  const json = decodeOnChainJson(uri);
4605
4673
  if (json) {
@@ -4844,7 +4912,7 @@ async function cmdStorage(rest) {
4844
4912
  */
4845
4913
  async function cmdStorageUpload(path, flags) {
4846
4914
  if (!path || path.startsWith('--')) {
4847
- console.error('usage: abx storage upload <path> [--backend ipfs|arweave|cloud] [--key <name>]\n uploads one file and prints its locator (the URI `abx attach` wants).\n');
4915
+ console.error('usage: abx storage upload <path> [--backend ipfs|arweave|cloud] [--key <name>] [--json]\n uploads one file and prints its locator (the URI `abx attach` wants); --json emits it as data.\n');
4848
4916
  process.exit(1);
4849
4917
  }
4850
4918
  const abs = resolvePath(path);
@@ -4856,7 +4924,9 @@ async function cmdStorageUpload(path, flags) {
4856
4924
  throw new Error("the 'fs' backend has no public URL — an attached file must be reachable off this machine. " +
4857
4925
  'Upload with `--backend arweave` (pay-once permanent) or `--backend ipfs` (keep it pinned), or `--backend cloud` (your S3/R2).');
4858
4926
  }
4859
- noteArweavePlan(opts, bytes.length); // free-vs-credit readout for the arweave lane
4927
+ const jsonMode = flags.json !== undefined;
4928
+ if (!jsonMode)
4929
+ noteArweavePlan(opts, bytes.length); // free-vs-credit readout for the arweave lane
4860
4930
  const name = (flags.key && flags.key !== 'true' ? flags.key : basename(abs)).replace(/^\/+/, '');
4861
4931
  // --dry-run: an upload is IRREVERSIBLE and can happen even keyless (Arweave's free tier under
4862
4932
  // 100 KB auto-creates an identity), so a "preview" that actually uploaded would surprise. Show
@@ -4866,17 +4936,37 @@ async function cmdStorageUpload(path, flags) {
4866
4936
  console.log(`\n ${bold('◆ storage upload')} ${dim('(dry run — nothing uploaded)')}`);
4867
4937
  console.log(` ${dim('file'.padEnd(10))} ${basename(abs)} ${dim(`(${bytes.length} bytes, ${contentType})`)}`);
4868
4938
  console.log(` ${dim('backend'.padEnd(10))} ${backend.id}`);
4939
+ // Name the IPFS mode, and say what an absent credential actually means. There is no silent
4940
+ // fallback to local `fs` (an earlier skill line wrongly claimed one) — without PINATA_JWT the
4941
+ // backend resolves to kubo against a LOCAL node, so a dry run that looked fine would fail at
4942
+ // upload for anyone not running one. A preview should surface that, not defer it to the failure.
4943
+ if (backend.id === 'ipfs' && !process.env.PINATA_JWT && !process.env.ABX_IPFS_MODE) {
4944
+ warn(`no ${bold('PINATA_JWT')} set → this resolves to a LOCAL IPFS node (kubo at ${process.env.ABX_IPFS_API_URL ?? 'http://127.0.0.1:5001'}). The real upload fails unless that node is running — set PINATA_JWT for the managed lane, or ${bold('--backend arweave')} for no-setup permanent storage.`);
4945
+ }
4869
4946
  console.log(` ${dim('locator'.padEnd(10))} ${shape} ${dim('(filename preserved → declared type survives)')}`);
4870
4947
  console.log(dim(`\n Re-run without --dry-run to upload, then: `) + `${g(`abx attach <address> <key> ${shape}`)}\n`);
4871
4948
  return;
4872
4949
  }
4873
- console.log(` uploading ${bold(basename(abs))} ${dim(`(${bytes.length} bytes, ${contentType})`)} to '${backend.id}' …`);
4950
+ // In --json mode nothing but the JSON may touch stdout; progress still goes out, on stderr.
4951
+ const progress = (line) => (jsonMode ? process.stderr.write(line + '\n') : console.log(line));
4952
+ progress(` uploading ${bold(basename(abs))} ${dim(`(${bytes.length} bytes, ${contentType})`)} to '${backend.id}' …`);
4874
4953
  // The returned locator MUST carry the filename so the declared mimeType survives when attached
4875
4954
  // (the on-chain field has no MIME slot — the URL extension IS the declaration). uploadAndLocate
4876
4955
  // encapsulates the capability-based branch (cloud key / dir-wrap / bare fallback).
4877
4956
  const { locator, filenamePreserved, fallbackReason } = await uploadAndLocate(backend, name, { bytes, contentType });
4878
4957
  if (!filenamePreserved && fallbackReason) {
4879
- warn(`couldn't wrap the file with its name (${fallbackReason}) — the locator has no extension, so its declared type will be application/octet-stream when attached.`);
4958
+ const msg = `couldn't wrap the file with its name (${fallbackReason}) — the locator has no extension, so its declared type will be application/octet-stream when attached.`;
4959
+ if (jsonMode)
4960
+ process.stderr.write(` ⚠ ${msg}\n`);
4961
+ else
4962
+ warn(msg);
4963
+ }
4964
+ // --json: the locator as data, not as prose. An integrator scraped this line, captured the ANSI
4965
+ // colour codes along with the URL, wrote the result into a STORED player URL, and only found out
4966
+ // when it 404'd in production. A value a program needs must be obtainable without parsing output.
4967
+ if (jsonMode) {
4968
+ process.stdout.write(JSON.stringify({ locator, backend: backend.id, name, bytes: bytes.length, contentType, filenamePreserved }) + '\n');
4969
+ return;
4880
4970
  }
4881
4971
  console.log(` ${g('✓')} uploaded → ${bold(locator)}`);
4882
4972
  if (contentType === 'application/octet-stream') {
@@ -5005,31 +5095,46 @@ async function cmdState(address, flags) {
5005
5095
  if (royalty)
5006
5096
  info(`royalty ${Number(royalty[1]) / 100}% → ${royalty[0]}`);
5007
5097
  info(`renderer ${renderer && renderer !== zeroAddress ? `on-chain (${renderer})` : dim('off-chain (stored URI base / override)')}`);
5008
- // The governed PostParam surface. There is no on-chain enumeration of schema keys, so the source
5009
- // is the project's own `params.keys` list which is also what the on-chain generator reads, so
5010
- // anything missing from it is invisible to renders anyway. Read-only, best-effort, and skipped
5011
- // entirely for a project that has none (a 1/1, or a code project with no params).
5098
+ // The PostParam surface, read straight from chain: `paramSchemaKeys()` is the DECLARED (governed)
5099
+ // set append-only, and it includes keys declared but never yet written, which nothing off-chain
5100
+ // could otherwise discover and `contractParamKeys()` is the collection-scope set values. Both
5101
+ // are maintained by the contract's own write paths, so there is no list to drift. Read-only,
5102
+ // best-effort, and skipped entirely for a project that has none (a 1/1, or a code project with
5103
+ // no params). LEGACY projects (deployed before enumeration) expose neither getter: they fall back
5104
+ // to the retired `params.keys` CSV so `abx state` still describes them.
5012
5105
  try {
5013
- const csv = await readParamsKeys(publicClient, address);
5014
- const keys = (csv ?? '').split(',').map((k) => k.trim()).filter((k) => k && k !== 'params.keys');
5015
- if (keys.length) {
5016
- const rows = await Promise.all(keys.map(async (key) => ({ key, s: await readParamSchema(publicClient, address, key) })));
5017
- const governed = rows.filter((r) => r.s.exists);
5018
- const now = Math.floor(Date.now() / 1000);
5019
- if (governed.length) {
5020
- console.log(`\n ${bold('PostParams')} ${dim(`${governed.length} governed · collectors/artist set these; the generator injects them`)}`);
5021
- for (const { key, s } of governed) {
5022
- const retired = s.lockAfter !== 0 && s.lockAfter < now;
5023
- const locks = s.lockAfter !== 0 && !retired ? dim(` locks ${new Date(s.lockAfter * 1000).toISOString().slice(0, 10)}`) : '';
5024
- const tag = retired ? ` ${c.orange}retired${c.reset}${dim(' writes revert')}` : locks;
5025
- console.log(` ${describeSchema({ key, paramType: s.paramType, auth: s.auth, authAddress: s.authAddress, lockAfter: 0, min: s.min, max: s.max, selectOptions: s.selectOptions })}${tag}`);
5026
- }
5106
+ let keys = await readParamSchemaKeys(publicClient, address);
5107
+ let legacy = false;
5108
+ if (keys === null) {
5109
+ // The pre-enumeration lane, READ-ONLY. Nothing writes this CSV any more.
5110
+ keys = (await readLegacyParamsKeys(publicClient, address).catch(() => null)) ?? [];
5111
+ legacy = keys.length > 0;
5112
+ }
5113
+ const rows = keys.length
5114
+ ? await Promise.all(keys.map(async (key) => ({ key, s: await readParamSchema(publicClient, address, key) })))
5115
+ : [];
5116
+ const governed = rows.filter((r) => r.s.exists);
5117
+ const now = Math.floor(Date.now() / 1000);
5118
+ if (governed.length) {
5119
+ console.log(`\n ${bold('PostParams')} ${dim(`${governed.length} governed · collectors/artist set these; the generator injects them`)}` +
5120
+ (legacy ? dim(' (legacy project — read from its params.keys list)') : ''));
5121
+ for (const { key, s } of governed) {
5122
+ const retired = s.lockAfter !== 0 && s.lockAfter < now;
5123
+ const locks = s.lockAfter !== 0 && !retired ? dim(` locks ${new Date(s.lockAfter * 1000).toISOString().slice(0, 10)}`) : '';
5124
+ const tag = retired ? ` ${c.orange}retired${c.reset}${dim(' — writes revert')}` : locks;
5125
+ console.log(` ${describeSchema({ key, paramType: s.paramType, auth: s.auth, authAddress: s.authAddress, lockAfter: 0, min: s.min, max: s.max, selectOptions: s.selectOptions })}${tag}`);
5027
5126
  }
5028
- // Listed but ungoverned: the generator will inject the key with whatever raw value is set (or
5029
- // nothing). Not an error say it plainly rather than leaving a silent discrepancy.
5030
- const ungoverned = rows.filter((r) => !r.s.exists).map((r) => r.key);
5031
- if (ungoverned.length)
5032
- info(`${dim('also in params.keys, no schema:')} ${ungoverned.join(', ')}`);
5127
+ }
5128
+ // Legacy only: a key the old CSV lists with no schema behind it. On an enumerating project the
5129
+ // class doesn't exist schema keys come from the schema list, set values from the value lists.
5130
+ const ungoverned = legacy ? rows.filter((r) => !r.s.exists).map((r) => r.key) : [];
5131
+ if (ungoverned.length)
5132
+ info(`${dim('also in params.keys, no schema:')} ${ungoverned.join(', ')}`);
5133
+ // Collection-scope values (every token sees these). `seed` is per-token and never enumerated —
5134
+ // it is a tokenData coordinate, read directly.
5135
+ const set = legacy ? null : await readSetParamKeys(publicClient, address);
5136
+ if (set?.contract.length) {
5137
+ info(`${dim('contract-scope params set:')} ${[...set.contract].sort().join(', ')} ${dim('(apply to every token)')}`);
5033
5138
  }
5034
5139
  }
5035
5140
  catch {
@@ -6018,8 +6123,8 @@ const COMMAND_HELP = {
6018
6123
  ${g('--onchain-uri')} the CHAIN-COMPLETE lane: tokenURI/contractURI resolve ON-CHAIN via the canonical metadata renderer, and
6019
6124
  animation_url is COMPUTED on-chain by the canonical ${bold('AbxGenerator')} (template: the full HTML document;
6020
6125
  directory: a parameterized gateway URL — 8KB URL budget, gateway liveness applies). No resolver base is baked
6021
- (no --public-base-url needed); the ${g('params.keys')} contract param is written automatically from the schema
6022
- flags. The marketplace still is rendered off-chain by the effect runner ${bold('for a JS program')} (--script/--code-dir) — but with ${g('--image-renderer')} the image is computed ON-CHAIN too (nothing to render). Verify with ${g('abx verify <addr>')}.
6126
+ (no --public-base-url needed); the param surface is enumerated ON-CHAIN, so there is nothing to declare or
6127
+ keep in sync. The marketplace still is rendered off-chain by the effect runner ${bold('for a JS program')} (--script/--code-dir) — but with ${g('--image-renderer')} the image is computed ON-CHAIN too (nothing to render). Verify with ${g('abx verify <addr>')}.
6023
6128
  (--generator 0x.. / --renderer 0x.. override the canonical singletons; ABX_GENERATOR / ABX_RENDERER via env.)
6024
6129
  --schema key:Type:Auth,… governed PostParams (e.g. ${g('palette:HexColor:TokenOwner')}) — set values later with ${g('abx configure-param')},
6025
6130
  change the SCHEMA later with ${g('abx set-schema')}. An Address leg names its writer inline —
@@ -6112,8 +6217,8 @@ const COMMAND_HELP = {
6112
6217
  Select by label, address, bool). Auth is per the schema leg (Artist=owner · TokenOwner — delegate.xyz honored · Address).
6113
6218
  A change ${bold('re-addresses renders')} → the still becomes a placeholder until you re-render (${g('abx render <addr> <id>')} or the runner).
6114
6219
  ${g('<tokenId> "-"')} CONTRACT scope (owner-only raw setter; schema-less keys only) — the write path of well-known params
6115
- like ${g('params.keys')} / ${g('display.gateway')}. ≤31 printable-ASCII chars ride as a literal bytes32; longer takes the data path.
6116
- After a token write, a project whose ${g('params.keys')} doesn't list the key gets a one-line fix suggestion.
6220
+ like ${g('display.gateway')}. ≤31 printable-ASCII chars ride as a literal bytes32; longer takes the data path.
6221
+ A contract-scope param applies to every token, and enumerates on-chain like any other.
6117
6222
  --file <path> read the value from a file (String / Bytes payloads)
6118
6223
  ${g('--remote [name|url]')} nudge a REMOTE resolver to re-index IMMEDIATELY after the change (else ABX_PUBLIC_BASE_URL) — it pings
6119
6224
  the resolver's effect runner, so the thumbnail re-renders without waiting. Usually OPTIONAL now: a
@@ -6215,7 +6320,8 @@ const COMMAND_HELP = {
6215
6320
  ${g('--dry-run')} preview the tx, send nothing · signing: ${g('--send')} (default, needs a hot key) · ${g('--sign')} (browser wallet, no key) · ${g('--unsigned')}
6216
6321
  ${dim('Need the URI first? Upload the file with')} ${g('abx storage upload <path> --backend arweave|ipfs')} ${dim('— it prints the locator to pass here.')}
6217
6322
  ${dim('mimeType is declared from the URL EXTENSION (…/master.tiff → image/tiff) — give the file a real extension.')}
6218
- ${dim('Surfaces in a resolver\'s artifacts listing (/data/<key> fetches it); a bare on-chain tokenURI shows reserved fields only.')}
6323
+ ${dim('Surfaces in a resolver\'s artifacts listing (/data/<key> fetches it); a bare on-chain tokenURI shows reserved fields + abx_params only')}
6324
+ ${dim('configured params DO appear on-chain (as')} ${bold('abx_params')}${dim('); ATTACHMENTS are the surface that needs a resolver.')}
6219
6325
  ${dim('The image/animation are just reserved members of the same manifest. `artifacts` itself is COMPUTED — not settable.')}`,
6220
6326
  'set-field': `
6221
6327
  ${bold('abx set-field')} <address> --field <name> ${dim('— set an on-chain metadata field (the low-level primitive). Sends a tx.')}
@@ -6223,7 +6329,7 @@ const COMMAND_HELP = {
6223
6329
  --field <name> a reserved display field (image · description · animation_url · external_url · attributes ·
6224
6330
  background_color · …), a collection authorship/rights field with ${g('--collection')}
6225
6331
  (artist · display_notes · artist_links · license), OR any custom key (which becomes an
6226
- ${bold('artifacts')} entry). NOT ${g('artifacts')}/${g('abx_provenance')} (computed).
6332
+ ${bold('artifacts')} entry). NOT ${g('artifacts')}/${g('abx_params')}/${g('abx_provenance')} (computed).
6227
6333
  --text "<s>" store literal UTF-8 ON-CHAIN (representation defaults ${g('inline')}) — NOT for an off-chain URL (use ${bold('attach')})
6228
6334
  --file <path> store a FILE on-chain in SSTORE2 chunks behind the shared reader (any size; multi-chunk)
6229
6335
  ${g('--compress')} none|fastlz|gzip for --file (default none): ${g('fastlz')} = on-chain decode, stays renderable, cheaper storage;
@@ -6285,7 +6391,7 @@ const COMMAND_HELP = {
6285
6391
  storage: `
6286
6392
  ${bold('abx storage')} <show|upload|balance|topup|backup-key> ${dim('— inspect / operate byte custody. Mostly read-only.')}
6287
6393
  ${g('show')} the resolved backend (fs | cloud | ipfs | arweave) + where each value came from
6288
- ${g('upload')} <path> upload ONE file → prints its locator (the URI ${g('abx attach')} wants) [--backend …] [--dry-run]
6394
+ ${g('upload')} <path> upload ONE file → prints its locator (the URI ${g('abx attach')} wants) [--backend …] [--dry-run] [${g('--json')}]
6289
6395
  ${g('balance')} · ${g('topup')} --usd <n> Turbo (arweave) upload credits · ${g('backup-key')} --out <path> copy the managed key`,
6290
6396
  demo: `
6291
6397
  ${bold('abx demo')} <${dim('no args')}> ${dim('— deploy a throwaway 1/1 to the testnet, index it, and serve it — a guided first run. Sends a tx.')}