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

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 (116) hide show
  1. package/CHANGELOG.md +152 -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 +55 -0
  15. package/dist/commands/scaffold.d.ts.map +1 -0
  16. package/dist/commands/scaffold.js +470 -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 +572 -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/deps.d.ts +6 -39
  31. package/dist/deps.d.ts.map +1 -1
  32. package/dist/deps.js +4 -68
  33. package/dist/deps.js.map +1 -1
  34. package/dist/errors.d.ts +20 -0
  35. package/dist/errors.d.ts.map +1 -0
  36. package/dist/errors.js +25 -0
  37. package/dist/errors.js.map +1 -0
  38. package/dist/flags.d.ts +34 -0
  39. package/dist/flags.d.ts.map +1 -1
  40. package/dist/flags.js +74 -0
  41. package/dist/flags.js.map +1 -1
  42. package/dist/main.js +57 -6751
  43. package/dist/main.js.map +1 -1
  44. package/dist/mintpage.d.ts.map +1 -1
  45. package/dist/mintpage.js +34 -40
  46. package/dist/mintpage.js.map +1 -1
  47. package/dist/output.d.ts +137 -0
  48. package/dist/output.d.ts.map +1 -0
  49. package/dist/output.js +504 -0
  50. package/dist/output.js.map +1 -0
  51. package/dist/ownerops.d.ts +23 -44
  52. package/dist/ownerops.d.ts.map +1 -1
  53. package/dist/ownerops.js +151 -233
  54. package/dist/ownerops.js.map +1 -1
  55. package/dist/preview.d.ts +8 -4
  56. package/dist/preview.d.ts.map +1 -1
  57. package/dist/preview.js +8 -17
  58. package/dist/preview.js.map +1 -1
  59. package/dist/provision.d.ts.map +1 -1
  60. package/dist/provision.js +10 -7
  61. package/dist/provision.js.map +1 -1
  62. package/dist/remote.d.ts +72 -7
  63. package/dist/remote.d.ts.map +1 -1
  64. package/dist/remote.js +211 -9
  65. package/dist/remote.js.map +1 -1
  66. package/dist/riskgate.d.ts +29 -0
  67. package/dist/riskgate.d.ts.map +1 -0
  68. package/dist/riskgate.js +91 -0
  69. package/dist/riskgate.js.map +1 -0
  70. package/dist/schema.d.ts +6 -0
  71. package/dist/schema.d.ts.map +1 -1
  72. package/dist/schema.js +12 -16
  73. package/dist/schema.js.map +1 -1
  74. package/dist/served.d.ts +1 -17
  75. package/dist/served.d.ts.map +1 -1
  76. package/dist/served.js +47 -0
  77. package/dist/served.js.map +1 -1
  78. package/dist/signer.d.ts +13 -0
  79. package/dist/signer.d.ts.map +1 -1
  80. package/dist/signer.js +42 -19
  81. package/dist/signer.js.map +1 -1
  82. package/dist/update-check.d.ts +27 -0
  83. package/dist/update-check.d.ts.map +1 -1
  84. package/dist/update-check.js +30 -0
  85. package/dist/update-check.js.map +1 -1
  86. package/package.json +6 -6
  87. package/skill/SKILL.md +7 -11
  88. package/skill/reference/code-projects.md +3 -3
  89. package/skill/reference/hosting.md +6 -6
  90. package/skill/reference/operating.md +2 -5
  91. package/skill/reference/setup.md +2 -2
  92. package/skill/reference/troubleshooting.md +1 -1
  93. package/dist/gas.d.ts +0 -63
  94. package/dist/gas.d.ts.map +0 -1
  95. package/dist/gas.js +0 -76
  96. package/dist/gas.js.map +0 -1
  97. package/dist/inspect.d.ts +0 -48
  98. package/dist/inspect.d.ts.map +0 -1
  99. package/dist/inspect.js +0 -290
  100. package/dist/inspect.js.map +0 -1
  101. package/dist/migrate.d.ts +0 -65
  102. package/dist/migrate.d.ts.map +0 -1
  103. package/dist/migrate.js +0 -180
  104. package/dist/migrate.js.map +0 -1
  105. package/dist/onchain-uri.d.ts +0 -81
  106. package/dist/onchain-uri.d.ts.map +0 -1
  107. package/dist/onchain-uri.js +0 -251
  108. package/dist/onchain-uri.js.map +0 -1
  109. package/dist/resume.d.ts +0 -96
  110. package/dist/resume.d.ts.map +0 -1
  111. package/dist/resume.js +0 -95
  112. package/dist/resume.js.map +0 -1
  113. package/dist/upload.d.ts +0 -28
  114. package/dist/upload.d.ts.map +0 -1
  115. package/dist/upload.js +0 -41
  116. package/dist/upload.js.map +0 -1
package/dist/config.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import { mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { dirname, resolve } from 'node:path';
3
- import { arweaveAddress, generateArweaveJwk, resolveArweaveJwk, } from '@artblocks/abx-storage';
4
- import { resolveChain, DEFAULT_CHAIN_KEY, resolveFactory, resolveSeriesFactory, resolveRenderer, resolveChunkStore, resolveFixedPriceMinter, envSigningKey, } from '@artblocks/abx-sdk';
3
+ import { arweaveAddress, generateArweaveJwk, resolveArweaveJwk, assessStorageReadiness, assessTurboFunds, isTurboArweave, planTurboUpload, resolveBackend, } from '@artblocks/abx-storage';
4
+ import { resolveChain, DEFAULT_CHAIN_KEY, resolveFactory, resolveSeriesFactory, resolveRenderer, resolveChunkStore, resolveFixedPriceMinter, envSigningKey, explorerUrl, METADATA_REPRESENTATION as R, } from '@artblocks/abx-sdk';
5
+ import { SelfHostIndexer } from '@artblocks/abx-indexer';
6
+ import { bold, dim, g, info, warn } from './output.js';
5
7
  /**
6
8
  * Runtime resolution for the CLI — deliberately **stateless about decisions**. There is no
7
9
  * tool-written config file: every choice is resolved fresh per invocation from explicit flags,
@@ -16,11 +18,43 @@ import { resolveChain, DEFAULT_CHAIN_KEY, resolveFactory, resolveSeriesFactory,
16
18
  * The only thing that persists on disk is the project-local, chain-rebuildable projection
17
19
  * (the indexer's SQLite store under the data dir) — that's DATA, not config.
18
20
  */
19
- const CHAIN = process.env.ABX_CHAIN ?? DEFAULT_CHAIN_KEY;
20
- const chainId = () => resolveChain(CHAIN).id;
21
+ /**
22
+ * The active chain key — the ONE place it's derived (`ABX_CHAIN` the shipped default). main.ts
23
+ * and ownerops.ts each used to carry their own identical `process.env.ABX_CHAIN ?? DEFAULT_CHAIN_KEY`
24
+ * (one flagged "MUST match main.ts/config.ts" in its own comment) — two copies whose only job was
25
+ * to agree with each other, which is exactly the setup a future edit drifts out of. Both import it
26
+ * from here now.
27
+ */
28
+ export const CHAIN = process.env.ABX_CHAIN ?? DEFAULT_CHAIN_KEY;
29
+ export const chainId = () => resolveChain(CHAIN).id;
30
+ // Block explorer base for the tx/address links the CLI prints. Derived from viem's chain metadata via
31
+ // the SDK (see explorerUrl) rather than a local table — this used to be a hand-maintained map, which is
32
+ // the same shape of bug that had the token-api dashboard sending every Base Sepolia link to Etherscan.
33
+ //
34
+ // LAZY (a function, not a top-level const): main.ts's `assertKnownChainEnv` has to run BEFORE any
35
+ // chain-derived value is computed, so an unknown ABX_CHAIN gets its graceful "not a chain this
36
+ // toolkit ships" message instead of a raw `resolveChain` stack trace. That guard runs at module
37
+ // load, before main.ts's own body — but config.ts is imported (and fully evaluated) even earlier,
38
+ // as part of loading main.ts's imports. An eager `const EXPLORER = explorerUrl(resolveChain(CHAIN).id)`
39
+ // here would evaluate on a bad ABX_CHAIN before the guard ever gets a turn, exactly the crash it
40
+ // exists to prevent (see that function's doc comment) — so this is a getter, resolved lazily on
41
+ // each read, the same pattern `chainId()` above already uses.
42
+ export const explorerBase = () => explorerUrl(resolveChain(CHAIN).id);
21
43
  export function dataDir() {
22
44
  return process.env.ABX_DATA_DIR ?? resolve(process.cwd(), '.abx-self-host');
23
45
  }
46
+ // ── the local indexer: one instance per process ───────────────────────────────
47
+ // `new SelfHostIndexer()` opens (and premigrate/schema-execs) the SAME on-disk SQLite db every
48
+ // time — a dozen call sites across main.ts/ownerops.ts each constructed their own, so a single CLI
49
+ // invocation that touches several of them (e.g. a deploy that also registers + reindexes) paid that
50
+ // open/migrate cost repeatedly for what is, within one process, always the same store. Memoized here
51
+ // so every call site shares one instance instead.
52
+ let _localIndexer;
53
+ /** The process-lifetime local indexer (this node's own SQLite-backed projection). Never pass a
54
+ * chain-varying argument through here — it's a bare singleton, constructed once on first use. */
55
+ export function localIndexer() {
56
+ return (_localIndexer ??= new SelfHostIndexer());
57
+ }
24
58
  /**
25
59
  * Whether `baseUrl` is a localhost/loopback address — a URL that, once baked into an on-chain
26
60
  * `tokenURI`/`contractURI`, resolves for NO ONE off this machine. The single source of truth for
@@ -200,4 +234,167 @@ function ensureManagedArweaveJwk() {
200
234
  }
201
235
  return r.jwk;
202
236
  }
237
+ /** Per-invocation storage overrides parsed from deploy flags (the hybrid: config, overridable). */
238
+ export function storageOverrides(flags) {
239
+ return {
240
+ backend: flags.backend,
241
+ endpoint: flags.endpoint,
242
+ bucket: flags.bucket,
243
+ region: flags.region,
244
+ prefix: flags.prefix,
245
+ publicBase: flags['public-base'],
246
+ gateway: flags.gateway,
247
+ mode: flags.mode,
248
+ apiUrl: flags['api-url'],
249
+ uploadUrl: flags['upload-url'],
250
+ provider: flags.provider,
251
+ storageSigner: flags['storage-signer'],
252
+ };
253
+ }
254
+ /** Surface the free-vs-credit decision for a Turbo upload from the LOCAL byte size — no network,
255
+ * so it works in `--dry-run` too. Under 100 KiB is free; above, it draws on prepaid credits. The
256
+ * decision itself (`isTurboArweave` + the size threshold) is the storage package's
257
+ * {@link planTurboUpload}; this is just its narration. */
258
+ export function noteArweavePlan(opts, size) {
259
+ const plan = planTurboUpload(opts, size);
260
+ if (!plan)
261
+ return;
262
+ if (!plan.chargeable) {
263
+ info(`Turbo: ${plan.sizeKb} KB is under the 100 KB free tier → permanent upload is FREE — no credits, no setup.`);
264
+ }
265
+ else {
266
+ info(`Turbo: ${plan.sizeKb} KB exceeds the 100 KB free tier → draws on prepaid credits. Check \`abx storage balance\`; top up with \`abx storage topup --usd <n>\` if short.`);
267
+ }
268
+ }
269
+ /**
270
+ * Dry-run storage-readiness: surface what a REAL off-chain deploy needs, from local info only, so
271
+ * "dry-run passes → deploy fails at upload" can't happen. Covers Arweave credit needs, a missing
272
+ * Pinata JWT, and a missing cloud public base. `sizes` are the per-file byte sizes. The readiness
273
+ * FACTS (chargeable-bytes accounting, the USD estimate, the missing-JWT/public-base checks) are the
274
+ * storage package's {@link assessStorageReadiness}; this is just its narration.
275
+ */
276
+ export async function noteStorageReadiness(opts, sizes) {
277
+ const report = await assessStorageReadiness(opts, sizes);
278
+ if (report.backend === 'arweave') {
279
+ if (report.overCount === 0) {
280
+ info(`Turbo: all ${report.totalCount} file(s) under the 100 KB free tier → FREE permanent upload, no setup.`);
281
+ }
282
+ else {
283
+ // Best-effort real-rate USD estimate; silently omitted if the price API isn't reachable.
284
+ const cost = report.usd === null ? '' : ` ≈ ${report.usd < 0.01 ? '<$0.01' : '$' + report.usd.toFixed(2)} at current Turbo rates`;
285
+ info(`Turbo: ${report.overCount}/${report.totalCount} file(s) exceed the 100 KB free tier (~${report.totalKb} KB total)${cost} → draw on prepaid credits. Check \`abx storage balance --backend arweave\`; top up with \`abx storage topup --usd <n> --backend arweave\` if short.`);
286
+ }
287
+ }
288
+ else if (report.backend === 'ipfs' && report.pinataMissingJwt) {
289
+ warn('IPFS pinata mode but PINATA_JWT is not set — a real deploy will FAIL at upload. Set PINATA_JWT in .env (or --mode kubo with a local node).');
290
+ }
291
+ else if (report.backend === 'cloud' && report.missingPublicBase) {
292
+ warn('cloud/S3 has no public read base — a real deploy will FAIL. Set ABX_S3_PUBLIC_BASE or pass --public-base <bucket-or-cdn-url> (it is baked on-chain).');
293
+ }
294
+ }
295
+ /** Create + announce the managed Turbo identity right before the first upload that needs it.
296
+ * Mutates `opts.arweave.jwk` so the resolved backend can sign. No-op for non-Turbo custody, or
297
+ * when an ETH identity (`.env` key or a wallet-session remote signer) is already selected — that
298
+ * identity pays, so we don't mint an unused managed key. */
299
+ export function ensureArweaveIdentityForUpload(opts) {
300
+ if (!isTurboArweave(opts))
301
+ return;
302
+ if (opts.arweave?.jwk || opts.arweave?.ethSignerKey || opts.arweave?.remoteEth)
303
+ return; // identity already chosen
304
+ const { jwk, address, created, path } = ensureArweaveJwk();
305
+ opts.arweave.jwk = jwk;
306
+ if (created) {
307
+ warn(`created an Arweave identity for Turbo uploads → ${dim(path)}`);
308
+ info(` address ${g(address)} — BACK THIS UP (\`abx storage backup-key --out <path>\`). It signs uploads and holds any credits you buy; lose it and leftover credits are stranded.`);
309
+ }
310
+ }
311
+ /**
312
+ * Pre-upload FUNDS guard for Turbo (arweave). Runs before a real off-chain deploy so a credit
313
+ * shortfall stops *here* — with the exact address + fund options — instead of failing mid-deploy
314
+ * after some txs already landed. Only fires for chargeable files (≥100 KB); free-tier uploads skip
315
+ * it. Best-effort: if the price/balance APIs are unreachable it degrades to a warning, never a false
316
+ * block. `sizes` are per-file byte sizes. The funds decision itself is the storage package's
317
+ * {@link assessTurboFunds}; this is the narration + the throw messages built from its report.
318
+ */
319
+ export async function assertTurboFundsForUpload(opts, sizes, walletAddr) {
320
+ if (!isTurboArweave(opts))
321
+ return;
322
+ ensureArweaveIdentityForUpload(opts); // so there's an address to check
323
+ const check = await assessTurboFunds(opts.arweave, sizes, walletAddr);
324
+ if (!check || !check.short)
325
+ return;
326
+ const { address, isEth, haveWinc, needWinc, walletCredits } = check;
327
+ // Managed-key lane is short → BEFORE proposing a top-up, check whether the creator's OWN wallet
328
+ // already holds Turbo credits (public balance-by-address, no key). If so, spending those via
329
+ // `--storage-signer eth` beats paying again. This is the "check my wallet too" the flow needs.
330
+ if (!isEth && walletAddr && walletCredits && walletCredits.winc > 0 && (needWinc ? walletCredits.winc >= needWinc : true)) {
331
+ throw new Error([
332
+ `The managed Arweave key has no credits — but your wallet ${g(walletAddr)} already holds ${bold(walletCredits.credits)} Turbo credits.`,
333
+ ` Use those instead of paying again — re-run with:`,
334
+ ` • ${bold('--storage-signer eth --sign')} ${dim('(your browser wallet signs the uploads; its credits pay — no key in .env)')}`,
335
+ ` • or ${bold('--storage-signer eth')} ${dim('(if that wallet’s key is already in .env)')}`,
336
+ ` ${dim('No top-up needed.')}`,
337
+ ].join('\n'));
338
+ }
339
+ const lines = [
340
+ `Turbo credits look insufficient for this upload (${check.chargeableCount} file(s) over the 100 KB free tier).`,
341
+ ` identity ${g(address)} ${dim(isEth ? '(your EVM wallet — an ETH Turbo identity)' : '(the CLI-managed Arweave key, NOT your ETH wallet)')}`,
342
+ ` balance ${(haveWinc / 1e12).toFixed(4)} credits${needWinc ? dim(` · need ~${(needWinc / 1e12).toFixed(4)}`) : ''}`,
343
+ ...(walletAddr && !isEth ? [` ${dim(`(checked your wallet ${walletAddr} too — no Turbo credits there either.)`)}`] : []),
344
+ ...(isEth ? [] : [` ${dim('First back up the managed key — `abx storage backup-key --out <path>` — it will hold the credits you buy.')}`]),
345
+ ` Then fund + re-run:`,
346
+ ` • ${bold('abx storage topup --usd <n> --backend arweave')} ${dim('(card checkout, credits the address above)')}`,
347
+ ` • or paste ${g(address)} at ${bold('https://turbo-topup.com')} ${dim('— fund THIS address; do NOT connect a different wallet')}`,
348
+ isEth
349
+ ? ` • already funded a different identity? that's a different address — fund the one above`
350
+ : ` • funded your ETH wallet's Turbo balance instead? re-run with ${bold('--storage-signer eth')} (key in .env) or ${bold('--storage-signer eth --sign')} (browser wallet)`,
351
+ ];
352
+ throw new Error(lines.join('\n'));
353
+ }
354
+ /**
355
+ * Resolve durable locators (`ipfs://<cid>` / `ar://<txid>`) for a project's off-chain-by-hash
356
+ * fields, from THIS machine's content index via the backend. This is the bridge a remote resolver
357
+ * needs: the on-chain commitment is a keccak256, but the CID/txid that addresses the bytes lives in
358
+ * the deployer's local index — ship it so the resolver can point `image` at IPFS without the bytes.
359
+ * Returns `{ "0x<hash>": "ipfs://<cid>" }` (lowercased), empty when nothing is locatable here.
360
+ */
361
+ export async function collectContentLocators(state, backend) {
362
+ if (!backend.locator)
363
+ return {};
364
+ const out = {};
365
+ const hashFields = [...state.tokens.flatMap((t) => t.fields), ...state.collectionFields].filter((f) => f.representation === R.keccak256 || f.representation === R.sha256);
366
+ for (const f of hashFields) {
367
+ const key = f.value.toLowerCase();
368
+ if (out[key])
369
+ continue;
370
+ try {
371
+ const loc = await backend.locator(f.value);
372
+ if (loc)
373
+ out[key] = loc;
374
+ }
375
+ catch {
376
+ /* backend can't locate this hash — skip; the resolver falls back to its own image route */
377
+ }
378
+ }
379
+ return out;
380
+ }
381
+ /** Locators to bridge to a remote resolver: the ones the local deploy already stored, else freshly
382
+ * resolved from this machine's local projection + content index (e.g. `abx add <addr> --remote`
383
+ * for a contract deployed elsewhere on this same machine). */
384
+ export async function remoteLocators(address, stored, flags) {
385
+ if (stored) {
386
+ try {
387
+ const obj = JSON.parse(stored);
388
+ if (Object.keys(obj).length)
389
+ return obj;
390
+ }
391
+ catch {
392
+ /* fall through to recompute */
393
+ }
394
+ }
395
+ const local = localIndexer().getProject(address);
396
+ if (!local)
397
+ return {};
398
+ return collectContentLocators(local, resolveBackend(storageOptions(storageOverrides(flags))));
399
+ }
203
400
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAgB,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EAC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;YACzD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM;gBAAE,OAAO,GAAG,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,sBAAsB,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC"}
package/dist/deps.d.ts CHANGED
@@ -1,46 +1,13 @@
1
- import { type Address, type DependencyReadClient, type Hex, type ParsedDependencyRef, type RegistryDependencyDetails } from '@artblocks/abx-sdk';
1
+ /**
2
+ * The `--dep` flag grammar for `abx deploy-code` — the one CLI-local piece of the dependency
3
+ * lane. Everything downstream of a parsed ref (registry-pointer resolution, setup-multicall leg
4
+ * composition, the selection-time registry check) lives in `@artblocks/abx-sdk`'s `deps.ts`.
5
+ */
6
+ import { type ParsedDependencyRef } from '@artblocks/abx-sdk';
2
7
  /**
3
8
  * Parse the accumulated `--dep` flag value (repeats comma-join — see flags.ts — and each
4
9
  * value may itself be comma-separated) into ordered refs. Order is load-bearing: the first
5
10
  * ref becomes dependency index 0 — the runtime, by convention.
6
11
  */
7
12
  export declare function parseDepFlag(value: string | undefined): ParsedDependencyRef[];
8
- /**
9
- * The registry pointer a deploy with ≥1 Registry-resolution dep should set: an explicit
10
- * `--dep-registry` wins (validated), else the chain's known AB registry (env-overridable),
11
- * else none — the caller WARNS and skips the leg (soft pointer; the resolver falls back to
12
- * its built-in CDN map). Never a blocker.
13
- */
14
- export declare function resolveDepRegistryPointer(flagValue: string | undefined, chainId: number): {
15
- registry: Address | null;
16
- source: 'flag' | 'default' | 'none';
17
- };
18
- /**
19
- * The dependency legs of the setup multicall: one `setDependency(i, resolution, ref)` per
20
- * dep in index order, plus the `setDependencyRegistry` leg when a pointer resolved. These
21
- * ride the SAME atomic setup multicall as script chunks/schemas/mints, in every signing lane.
22
- */
23
- export declare function dependencySetupCalls(deps: ParsedDependencyRef[], registry: Address | null): Hex[];
24
- /** One dep's selection-time verdict (Registry-resolution deps only — OnChain refs never touch a registry). */
25
- export type DepCheck = {
26
- dep: string;
27
- status: 'found';
28
- details: RegistryDependencyDetails;
29
- } | {
30
- dep: string;
31
- status: 'not-found';
32
- } | {
33
- dep: string;
34
- status: 'skipped';
35
- };
36
- /**
37
- * Best-effort existence/on-chain-ness check of every Registry-resolution dep against the
38
- * pointer registry. A revert or an empty record ⇒ `not-found` (a warning — the owner may
39
- * intend a custom registry). A transport failure ⇒ the remaining checks are `skipped` and
40
- * `rpcOk: false` — one info line, never an error: the deploy proceeds regardless.
41
- */
42
- export declare function checkRegistryDeps(client: DependencyReadClient, registry: Address, deps: ParsedDependencyRef[]): Promise<{
43
- checks: DepCheck[];
44
- rpcOk: boolean;
45
- }>;
46
13
  //# sourceMappingURL=deps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,GAAG,EACR,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAW7E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,MAAM,GACd;IAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;CAAC,CASjE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,mBAAmB,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,GAAG,EAAE,CAQjG;AAED,8GAA8G;AAC9G,MAAM,MAAM,QAAQ,GAChB;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAC,GAClE;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAC,GAClC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAC,CAAC;AAErC;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,mBAAmB,EAAE,GAC1B,OAAO,CAAC;IAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAC,CAAC,CAyB/C"}
1
+ {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAqB,KAAK,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,mBAAmB,EAAE,CAW7E"}
package/dist/deps.js CHANGED
@@ -1,11 +1,9 @@
1
1
  /**
2
- * The deploy-time dependency lane for `abx deploy-code` — pure flag parsing, registry-pointer
3
- * defaulting, and setup-multicall leg composition (all unit-testable, no network), plus the
4
- * BEST-EFFORT selection-time registry check (an eth_call per Registry dep; never blocks a
5
- * deploy). See specs/protocol/dependency-registry.md — the pointer is soft and non-validating.
2
+ * The `--dep` flag grammar for `abx deploy-code` — the one CLI-local piece of the dependency
3
+ * lane. Everything downstream of a parsed ref (registry-pointer resolution, setup-multicall leg
4
+ * composition, the selection-time registry check) lives in `@artblocks/abx-sdk`'s `deps.ts`.
6
5
  */
7
- import { encodeFunctionData } from 'viem';
8
- import { DEP_RESOLUTION, parseDependencyRef, readRegistryDependency, resolveDependencyRegistry, seriesCodeAbi, } from '@artblocks/abx-sdk';
6
+ import { parseDependencyRef } from '@artblocks/abx-sdk';
9
7
  /**
10
8
  * Parse the accumulated `--dep` flag value (repeats comma-join — see flags.ts — and each
11
9
  * value may itself be comma-separated) into ordered refs. Order is load-bearing: the first
@@ -25,66 +23,4 @@ export function parseDepFlag(value) {
25
23
  .filter((s) => s && s.toLowerCase() !== 'none')
26
24
  .map(parseDependencyRef);
27
25
  }
28
- /**
29
- * The registry pointer a deploy with ≥1 Registry-resolution dep should set: an explicit
30
- * `--dep-registry` wins (validated), else the chain's known AB registry (env-overridable),
31
- * else none — the caller WARNS and skips the leg (soft pointer; the resolver falls back to
32
- * its built-in CDN map). Never a blocker.
33
- */
34
- export function resolveDepRegistryPointer(flagValue, chainId) {
35
- if (flagValue !== undefined) {
36
- if (flagValue === 'true' || !/^0x[0-9a-fA-F]{40}$/.test(flagValue)) {
37
- throw new Error(`--dep-registry must be an address (0x + 40 hex); got '${flagValue}'`);
38
- }
39
- return { registry: flagValue, source: 'flag' };
40
- }
41
- const known = resolveDependencyRegistry(chainId);
42
- return known ? { registry: known, source: 'default' } : { registry: null, source: 'none' };
43
- }
44
- /**
45
- * The dependency legs of the setup multicall: one `setDependency(i, resolution, ref)` per
46
- * dep in index order, plus the `setDependencyRegistry` leg when a pointer resolved. These
47
- * ride the SAME atomic setup multicall as script chunks/schemas/mints, in every signing lane.
48
- */
49
- export function dependencySetupCalls(deps, registry) {
50
- const calls = deps.map((d, i) => encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setDependency', args: [BigInt(i), d.resolution, d.ref] }));
51
- if (deps.length && registry) {
52
- calls.push(encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setDependencyRegistry', args: [registry] }));
53
- }
54
- return calls;
55
- }
56
- /**
57
- * Best-effort existence/on-chain-ness check of every Registry-resolution dep against the
58
- * pointer registry. A revert or an empty record ⇒ `not-found` (a warning — the owner may
59
- * intend a custom registry). A transport failure ⇒ the remaining checks are `skipped` and
60
- * `rpcOk: false` — one info line, never an error: the deploy proceeds regardless.
61
- */
62
- export async function checkRegistryDeps(client, registry, deps) {
63
- const registryDeps = deps.filter((d) => d.resolution === DEP_RESOLUTION.registry);
64
- const checks = [];
65
- let rpcOk = true;
66
- for (const d of registryDeps) {
67
- if (!rpcOk) {
68
- checks.push({ dep: d.display, status: 'skipped' });
69
- continue;
70
- }
71
- try {
72
- const details = await readRegistryDependency(client, registry, d.ref);
73
- checks.push(details ? { dep: d.display, status: 'found', details } : { dep: d.display, status: 'not-found' });
74
- }
75
- catch (e) {
76
- // A contract revert means the registry answered "no such dependency"; anything else
77
- // (DNS, timeout, HTTP) means we couldn't ask — degrade to skipped, not failed.
78
- const msg = `${e.name ?? ''} ${e.message ?? ''}`;
79
- if (/ContractFunction|revert|returned no data/i.test(msg)) {
80
- checks.push({ dep: d.display, status: 'not-found' });
81
- }
82
- else {
83
- rpcOk = false;
84
- checks.push({ dep: d.display, status: 'skipped' });
85
- }
86
- }
87
- }
88
- return { checks, rpcOk };
89
- }
90
26
  //# sourceMappingURL=deps.js.map
package/dist/deps.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAC,kBAAkB,EAAC,MAAM,MAAM,CAAC;AACxC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,GAMd,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IAC5H,4FAA4F;IAC5F,mGAAmG;IACnG,8FAA8F;IAC9F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AC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The one error type a command throws when it needs to abort with a specific exit code (phase 3's
3
+ * one-exit-discipline: no command body calls `process.exit()` mid-flow — a LOCAL failure sets
4
+ * `process.exitCode` and returns; a DEEP failure that needs to unwind through several calls throws).
5
+ *
6
+ * A plain `Error` still works everywhere (the top-level catch in main.ts prints `.message` with the
7
+ * same `✗` prefix either way) — `CliError` adds two opt-ins:
8
+ * - `exitCode`, for the rare case that isn't 1.
9
+ * - `alreadyPrinted`, for a validation helper (e.g. ownerops.ts's `requireAddress`/`requireFlag`)
10
+ * that has a non-`void` return type and so can't just set `exitCode` and `return` — it has to
11
+ * `throw` to make the "unreachable after this" true to the type checker, but it already printed
12
+ * its own usage text via `console.error` BEFORE this existed and that text doesn't have (and must
13
+ * not gain) the generic catch's `✗` prefix. The top-level catch skips its own printing for these.
14
+ */
15
+ export declare class CliError extends Error {
16
+ readonly exitCode: number;
17
+ readonly alreadyPrinted: boolean;
18
+ constructor(message: string, exitCode?: number, alreadyPrinted?: boolean);
19
+ }
20
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;gBAErB,OAAO,EAAE,MAAM,EAAE,QAAQ,SAAI,EAAE,cAAc,UAAQ;CAMlE"}
package/dist/errors.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The one error type a command throws when it needs to abort with a specific exit code (phase 3's
3
+ * one-exit-discipline: no command body calls `process.exit()` mid-flow — a LOCAL failure sets
4
+ * `process.exitCode` and returns; a DEEP failure that needs to unwind through several calls throws).
5
+ *
6
+ * A plain `Error` still works everywhere (the top-level catch in main.ts prints `.message` with the
7
+ * same `✗` prefix either way) — `CliError` adds two opt-ins:
8
+ * - `exitCode`, for the rare case that isn't 1.
9
+ * - `alreadyPrinted`, for a validation helper (e.g. ownerops.ts's `requireAddress`/`requireFlag`)
10
+ * that has a non-`void` return type and so can't just set `exitCode` and `return` — it has to
11
+ * `throw` to make the "unreachable after this" true to the type checker, but it already printed
12
+ * its own usage text via `console.error` BEFORE this existed and that text doesn't have (and must
13
+ * not gain) the generic catch's `✗` prefix. The top-level catch skips its own printing for these.
14
+ */
15
+ export class CliError extends Error {
16
+ exitCode;
17
+ alreadyPrinted;
18
+ constructor(message, exitCode = 1, alreadyPrinted = false) {
19
+ super(message);
20
+ this.name = 'CliError';
21
+ this.exitCode = exitCode;
22
+ this.alreadyPrinted = alreadyPrinted;
23
+ }
24
+ }
25
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,QAAQ,CAAS;IACjB,cAAc,CAAU;IAEjC,YAAY,OAAe,EAAE,QAAQ,GAAG,CAAC,EAAE,cAAc,GAAG,KAAK;QAC/D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;CACF"}
package/dist/flags.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  * the first (a real footgun on a multi-param drop; a Select's options use `|` not `,`, so the
10
10
  * comma-join never collides with an option list).
11
11
  */
12
+ import { type Hex } from 'viem';
12
13
  export type Flags = Record<string, string | undefined>;
13
14
  /** Flags where every occurrence counts (values comma-join, in argv order). */
14
15
  export declare const REPEATABLE_FLAGS: ReadonlySet<string>;
@@ -18,6 +19,10 @@ export declare const REPEATABLE_FLAGS: ReadonlySet<string>;
18
19
  * `no-update-check` opts out of the startup update nudge (see update-check.ts).
19
20
  */
20
21
  export declare const GLOBAL_FLAGS: ReadonlySet<string>;
22
+ /** Whether `--dry-run` was passed. The one place that truthiness is decided — every write command
23
+ * (owner-op or deploy) reads it through here rather than hand-rolling `!!flags['dry-run']`, so a
24
+ * fresh command can't ship with a *slightly* different spelling of the same check (or skip it). */
25
+ export declare function isDryRun(flags: Flags): boolean;
21
26
  export declare function parseFlags(args: string[]): Flags;
22
27
  /**
23
28
  * The bare (non-flag) arguments, with flag VALUES removed — the mirror of {@link parseFlags}, and
@@ -35,4 +40,33 @@ export declare function positionalArgs(args: string[]): string[];
35
40
  * scripted deploy (owner's stateless/scriptable line — see cli-ux-decisions).
36
41
  */
37
42
  export declare function unknownFlags(flags: Flags, allowed: Iterable<string>): string[];
43
+ /** Warn (never throw) on a flag the command doesn't recognize — a typo'd or unsupported flag
44
+ * otherwise no-ops INVISIBLY (the worst failure mode for a write-adjacent value like a mistyped
45
+ * --royalty-bps). Non-fatal, per the owner's scriptability line ([[cli-ux-decisions]]). */
46
+ export declare const FLAG_HINTS: Record<string, (cmd: string) => string | undefined>;
47
+ /**
48
+ * Unknown flags on a command that can SEND: refuse, don't warn.
49
+ *
50
+ * This used to warn and carry on, and `--chain sepolia` proved why that isn't enough — the warning was
51
+ * accurate, it scrolled past, and the deploy ran on the DEFAULT chain. On a dry run that costs a
52
+ * confused minute; on a funded send it is a wrong-chain deploy. "Prose that was ignored once will be
53
+ * ignored again" is the standing rule here, so the tx-sending commands stop instead.
54
+ *
55
+ * Safe to refuse rather than warn because a flag absent from the allowlist is, by construction, one
56
+ * the command never reads — verified per command by comparing every `flags.x` read in its body against
57
+ * its allowlist. So refusal cannot break a working flag; it only makes an already-ignored one loud.
58
+ *
59
+ * `--dry-run` refuses identically. A preview that accepts what the real send rejects is its own trap:
60
+ * you'd validate a command in preview and have it fail at the moment it matters.
61
+ */
62
+ export declare function refuseStrayFlags(flags: Flags, allowed: Set<string>, cmd: string): void;
63
+ /** Unknown flags on a READ-ONLY command: warn, don't refuse. Nothing can be mis-sent, and a stray
64
+ * flag on `preview`/`inspect` shouldn't stop a creator mid-iteration. */
65
+ export declare function warnStrayFlags(flags: Flags, allowed: Set<string>, cmd: string): void;
66
+ /** The wallet-lane owner-pinning guard: on `--sign` with no `--for`, whichever wallet connects
67
+ * becomes owner + royalty receiver + mint recipient (the launch-readiness "random wallet owns the
68
+ * collection" trap). Fires uniformly on deploy / deploy-series / deploy-code. */
69
+ export declare function warnSignWithoutFor(flags: Flags): void;
70
+ /** Validate an explicit --salt (a 32-byte hex). Undefined when absent. */
71
+ export declare function parseSaltFlag(raw: string | undefined): Hex | undefined;
38
72
  //# sourceMappingURL=flags.d.ts.map
@@ -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,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;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAWvD;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,O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GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,CAMtE"}
package/dist/flags.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { bold, info, warn } from './output.js';
1
2
  /** Flags where every occurrence counts (values comma-join, in argv order). */
2
3
  export const REPEATABLE_FLAGS = new Set(['dep', 'schema', 'param']);
3
4
  /**
@@ -6,6 +7,12 @@ export const REPEATABLE_FLAGS = new Set(['dep', 'schema', 'param']);
6
7
  * `no-update-check` opts out of the startup update nudge (see update-check.ts).
7
8
  */
8
9
  export const GLOBAL_FLAGS = new Set(['no-update-check']);
10
+ /** Whether `--dry-run` was passed. The one place that truthiness is decided — every write command
11
+ * (owner-op or deploy) reads it through here rather than hand-rolling `!!flags['dry-run']`, so a
12
+ * fresh command can't ship with a *slightly* different spelling of the same check (or skip it). */
13
+ export function isDryRun(flags) {
14
+ return !!flags['dry-run'];
15
+ }
9
16
  export function parseFlags(args) {
10
17
  const out = {};
11
18
  const set = (k, v) => {
@@ -56,4 +63,71 @@ export function unknownFlags(flags, allowed) {
56
63
  const ok = new Set(allowed);
57
64
  return Object.keys(flags).filter((k) => !ok.has(k) && !GLOBAL_FLAGS.has(k));
58
65
  }
66
+ /** Warn (never throw) on a flag the command doesn't recognize — a typo'd or unsupported flag
67
+ * otherwise no-ops INVISIBLY (the worst failure mode for a write-adjacent value like a mistyped
68
+ * --royalty-bps). Non-fatal, per the owner's scriptability line ([[cli-ux-decisions]]). */
69
+ // Targeted "did you mean" hints for the flags creators most often invent (seen across agent sessions).
70
+ // A stray flag is otherwise silently ignored, so a wrong-but-plausible one (a price/supply flag that
71
+ // doesn't exist) reads as "it worked." Command-aware so a flag valid elsewhere isn't mis-hinted.
72
+ export const FLAG_HINTS = {
73
+ count: (cmd) => (cmd === 'deploy-code' ? 'did you mean --max <N> (the supply cap)?' : undefined),
74
+ price: () => 'a sale price is NOT set at deploy — configure it after with `abx minter configure <addr> --price <eth>`.',
75
+ supply: () => 'did you mean --max <N> (the supply cap)?',
76
+ amount: () => 'a sale price/amount is set post-deploy via `abx minter configure`.',
77
+ };
78
+ /**
79
+ * Unknown flags on a command that can SEND: refuse, don't warn.
80
+ *
81
+ * This used to warn and carry on, and `--chain sepolia` proved why that isn't enough — the warning was
82
+ * accurate, it scrolled past, and the deploy ran on the DEFAULT chain. On a dry run that costs a
83
+ * confused minute; on a funded send it is a wrong-chain deploy. "Prose that was ignored once will be
84
+ * ignored again" is the standing rule here, so the tx-sending commands stop instead.
85
+ *
86
+ * Safe to refuse rather than warn because a flag absent from the allowlist is, by construction, one
87
+ * the command never reads — verified per command by comparing every `flags.x` read in its body against
88
+ * its allowlist. So refusal cannot break a working flag; it only makes an already-ignored one loud.
89
+ *
90
+ * `--dry-run` refuses identically. A preview that accepts what the real send rejects is its own trap:
91
+ * you'd validate a command in preview and have it fail at the moment it matters.
92
+ */
93
+ export function refuseStrayFlags(flags, allowed, cmd) {
94
+ const stray = unknownFlags(flags, allowed);
95
+ if (!stray.length)
96
+ return;
97
+ const hints = stray.map((f) => FLAG_HINTS[f]?.(cmd)).filter(Boolean);
98
+ throw new Error(`unrecognized flag(s): ${stray.map((f) => '--' + f).join(', ')} — this command would have ignored them silently, so it is refusing instead.\n` +
99
+ hints.map((h, i) => ` ↳ --${stray[i]}: ${h}`).join('\n') +
100
+ (hints.length ? '\n' : '') +
101
+ ` see \`abx help ${cmd}\` for the flags it accepts.`);
102
+ }
103
+ /** Unknown flags on a READ-ONLY command: warn, don't refuse. Nothing can be mis-sent, and a stray
104
+ * flag on `preview`/`inspect` shouldn't stop a creator mid-iteration. */
105
+ export function warnStrayFlags(flags, allowed, cmd) {
106
+ const stray = unknownFlags(flags, allowed);
107
+ if (stray.length) {
108
+ warn(`unrecognized flag(s), ignored: ${stray.map((f) => bold('--' + f)).join(', ')} — see \`abx help ${cmd}\`. (A misspelled or unsupported flag silently does nothing.)`);
109
+ for (const f of stray) {
110
+ const hint = FLAG_HINTS[f]?.(cmd);
111
+ if (hint)
112
+ info(` ↳ --${f}: ${hint}`);
113
+ }
114
+ }
115
+ }
116
+ /** The wallet-lane owner-pinning guard: on `--sign` with no `--for`, whichever wallet connects
117
+ * becomes owner + royalty receiver + mint recipient (the launch-readiness "random wallet owns the
118
+ * collection" trap). Fires uniformly on deploy / deploy-series / deploy-code. */
119
+ export function warnSignWithoutFor(flags) {
120
+ if (flags.sign !== undefined && !flags.for) {
121
+ warn(`--sign without --for: whichever wallet connects becomes ${bold('owner + royalty receiver + mint recipient')}. Pass ${bold('--for <your address>')} to PIN it — the sign page then refuses a mismatched wallet (the intended safety on the wallet lane).`);
122
+ }
123
+ }
124
+ /** Validate an explicit --salt (a 32-byte hex). Undefined when absent. */
125
+ export function parseSaltFlag(raw) {
126
+ if (!raw || raw === 'true')
127
+ return undefined;
128
+ if (!/^0x[0-9a-fA-F]{64}$/.test(raw)) {
129
+ throw new Error(`--salt must be a 32-byte hex (0x + 64 hex chars); got '${raw}'`);
130
+ }
131
+ return raw;
132
+ }
59
133
  //# sourceMappingURL=flags.js.map