@artblocks/abx-cli 0.1.0-alpha.23 → 0.1.0-alpha.26

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 (65) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/dist/commands/deploy.d.ts +27 -4
  3. package/dist/commands/deploy.d.ts.map +1 -1
  4. package/dist/commands/deploy.js +220 -70
  5. package/dist/commands/deploy.js.map +1 -1
  6. package/dist/commands/project.d.ts.map +1 -1
  7. package/dist/commands/project.js +15 -0
  8. package/dist/commands/project.js.map +1 -1
  9. package/dist/commands/scaffold.d.ts.map +1 -1
  10. package/dist/commands/scaffold.js +27 -4
  11. package/dist/commands/scaffold.js.map +1 -1
  12. package/dist/commands/storage.d.ts +14 -0
  13. package/dist/commands/storage.d.ts.map +1 -1
  14. package/dist/commands/storage.js +31 -4
  15. package/dist/commands/storage.js.map +1 -1
  16. package/dist/config.d.ts +13 -0
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/config.js +25 -1
  19. package/dist/config.js.map +1 -1
  20. package/dist/conformance.d.ts.map +1 -1
  21. package/dist/conformance.js +20 -1
  22. package/dist/conformance.js.map +1 -1
  23. package/dist/flag-allowlists.d.ts.map +1 -1
  24. package/dist/flag-allowlists.js +4 -0
  25. package/dist/flag-allowlists.js.map +1 -1
  26. package/dist/kind.d.ts +8 -0
  27. package/dist/kind.d.ts.map +1 -1
  28. package/dist/kind.js +17 -0
  29. package/dist/kind.js.map +1 -1
  30. package/dist/main.js +38 -8
  31. package/dist/main.js.map +1 -1
  32. package/dist/output.d.ts.map +1 -1
  33. package/dist/output.js +59 -2
  34. package/dist/output.js.map +1 -1
  35. package/dist/ownerops.d.ts +51 -0
  36. package/dist/ownerops.d.ts.map +1 -1
  37. package/dist/ownerops.js +152 -5
  38. package/dist/ownerops.js.map +1 -1
  39. package/dist/provision.d.ts.map +1 -1
  40. package/dist/provision.js +6 -1
  41. package/dist/provision.js.map +1 -1
  42. package/dist/remote.d.ts +20 -0
  43. package/dist/remote.d.ts.map +1 -1
  44. package/dist/remote.js +38 -0
  45. package/dist/remote.js.map +1 -1
  46. package/dist/riskgate.d.ts +19 -0
  47. package/dist/riskgate.d.ts.map +1 -1
  48. package/dist/riskgate.js +31 -1
  49. package/dist/riskgate.js.map +1 -1
  50. package/dist/schema.js +4 -4
  51. package/dist/schema.js.map +1 -1
  52. package/dist/script-chunks.d.ts +8 -0
  53. package/dist/script-chunks.d.ts.map +1 -0
  54. package/dist/script-chunks.js +35 -0
  55. package/dist/script-chunks.js.map +1 -0
  56. package/dist/signer.d.ts.map +1 -1
  57. package/dist/signer.js +4 -1
  58. package/dist/signer.js.map +1 -1
  59. package/package.json +6 -6
  60. package/skill/SKILL.md +18 -8
  61. package/skill/reference/code-projects.md +3 -3
  62. package/skill/reference/decisions.md +3 -3
  63. package/skill/reference/hosting.md +15 -4
  64. package/skill/reference/operating.md +27 -1
  65. package/skill/reference/setup.md +2 -1
@@ -132,6 +132,56 @@ export declare const AUTHORSHIP_DEPLOY_FIELDS: ReadonlyArray<readonly [flag: str
132
132
  /** Build the on-chain (inline) collection fields for whichever authorship/rights deploy flags are
133
133
  * set — pure, so a deploy path just spreads the result into its `contractFields`. */
134
134
  export declare function authorshipContractFields(flags: Flags): OnChainFieldInput[];
135
+ /** Refuse a prefix that cannot serve. Two rules only — a URL parser here would be a liability, but
136
+ * a value that is not http(s) simply cannot be concatenated into a working URL by any consumer. */
137
+ export declare function assertGatewayPrefix(network: 'ipfs' | 'arweave', prefix: string): string;
138
+ /**
139
+ * The gateway fields a deploy should write.
140
+ *
141
+ * Precedence, per scheme: `--ipfs-gateway` / `--arweave-gateway` → `--gateway` (only for the backend
142
+ * actually in use) → `ABX_IPFS_GATEWAY` / `ABX_ARWEAVE_GATEWAY` → nothing.
143
+ *
144
+ * `--gateway` counts because it has to. It is the STORAGE gateway — where the CLI uploads, probes,
145
+ * and builds `locator()` — and before this it was also, accidentally, the serving gateway, because
146
+ * deploy baked `locator()` straight into a `url` field. Now that the field holds a bare CID, a
147
+ * creator who passed `--gateway https://mine.mypinata.cloud` and nothing else would have had their
148
+ * gateway stripped out and their tokens served from `ipfs.io`: strictly worse than before, for a
149
+ * flag they did pass. Someone who genuinely wants to upload through one gateway and serve through
150
+ * another says so with the scheme-specific flag.
151
+ *
152
+ * Deliberately writes NOTHING when no source names one. Persisting the public floor would make a
153
+ * project that simply took the default look like it chose `ipfs.io` — and would freeze it there,
154
+ * since a floor only improves for collections that stayed silent. Silence is a live default; an
155
+ * explicit value is a decision.
156
+ */
157
+ export declare function gatewayContractFields(flags: Flags): OnChainFieldInput[];
158
+ /**
159
+ * The prefix this run will actually be SERVED from for one scheme — the same precedence
160
+ * `gatewayContractFields` writes, but resolved all the way down to the public floor so a caller can
161
+ * *show* the creator the URL their token will really carry.
162
+ *
163
+ * Split out because a deploy used to narrate the backend's UPLOAD locator (`gateway.pinata.cloud/…`)
164
+ * while committing a bare CID served from somewhere else entirely — a progress line that contradicted
165
+ * the chain. `chosen` distinguishes "the project picked this" (written on chain) from "the floor is
166
+ * filling a silence" (nothing written, and a later floor change moves the project with it).
167
+ *
168
+ * `--gateway` and the env vars are HOST-shaped (`https://my.gw`); the on-chain/served form is a full
169
+ * prefix including the trailing path, so normalize once, here.
170
+ */
171
+ export declare function servingGateway(network: 'ipfs' | 'arweave', flags: Flags): {
172
+ prefix: string;
173
+ chosen: boolean;
174
+ };
175
+ /**
176
+ * `abx set-gateway <address> [--ipfs <prefix>] [--arweave <prefix>]` — repoint where this
177
+ * collection's content-addressed fields are served from. The CID never moves.
178
+ *
179
+ * A separate command rather than two `set-field` invocations because the failure modes are all
180
+ * silent: a token-scope write (ignored — a gateway is one answer per project), a non-`inline`
181
+ * representation (ignored), a prefix missing its trailing path (`https://ipfs.io` + `<cid>` is a
182
+ * 404). `set-field` refuses these keys and points here instead.
183
+ */
184
+ export declare function cmdSetGateway(address: string | undefined, flags: Flags): Promise<void>;
135
185
  /** Set (or clear, with `--payee none`) the primary-sale payout destination. */
136
186
  export declare function cmdSetPrimaryPayee(address: string | undefined, flags: Flags): Promise<void>;
137
187
  export declare function cmdRefresh(address: string | undefined, flags: Flags): Promise<void>;
@@ -266,6 +316,7 @@ export declare function guardOnChainSize(bytesLen: number, label: string, allowU
266
316
  * so the count the human is told up front is the same one the real staging will produce.
267
317
  */
268
318
  export declare function computeContentPlan(bytes: Buffer, compress: Compress): ContentPlan;
319
+ export declare function refusePrewrappedImage(bytes: Uint8Array | string, label: string): void;
269
320
  /**
270
321
  * Dry-run preview of staging an image fully on-chain — the REAL chunk + transaction plan,
271
322
  * computed without writing anything (so `abx deploy --dry-run --onchain-image` reports the
@@ -1 +1 @@
1
- {"version":3,"file":"ownerops.d.ts","sourceRoot":"","sources":["../src/ownerops.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EA2CL,KAAK,kBAAkB,EAYvB,KAAK,eAAe,EAapB,KAAK,MAAM,EAIX,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,iBAAiB,EAMtB,mBAAmB,EAEnB,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,oBAAoB,CAAC;AAmC5B,OAAO,EAAsD,KAAK,aAAa,EAAC,MAAM,aAAa,CAAC;AAKpG,OAAO,EAAmC,KAAK,YAAY,EAAC,MAAM,aAAa,CAAC;AAKhF,OAAO,EAAC,0BAA0B,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,KAAK,QAAQ,EAAC,CAAC;AAS5H,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAYhD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAevD;AAmCD;;gGAEgG;AAChG,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnE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AAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAazF;AAGD,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1F;AAoHD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAyHjG;AAED;;sGAEsG;AACtG,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CA2F5F;AAED;;;oEAGoE;AACpE,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAqD3F;AAUD;+FAC+F;AAC/F,wBAAgB,cAAc,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAiBxF;AAED;iEACiE;AACjE,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAkE3F;AAgBD,2FAA2F;AAC3F,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB7G"}
package/dist/ownerops.js CHANGED
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import { assertChainId, ensureChunkStore as sdkEnsureChunkStore, predictFixedPriceMinter, predictFixedPriceMinter1155, makeHotSender, makePublicClient, makeWalletClient, oneOfOneImageAbi, oneOfOneEditionAbi, seriesImageAbi, deployFixedPriceMinter, deployFixedPriceMinter1155, prepareConfigureSale, prepareConfigureSale1155, preparePurchase, preparePurchase1155, readSaleConfig, readSaleConfig1155, prepareEditionMint, prepareEditionTransfer, prepareSetMaxSupply, preparePingURI, prepareLockContractField, prepareLockContractURI, prepareLockTokenField, prepareLockTokenURI, prepareMint, mintedTokenIds, prepareSeriesMintMany, prepareSetMinter, prepareSetMaxInvocations, prepareSetPrimaryPayee, prepareSetPaused, prepareSetContractField, prepareSetContractURIBase, prepareSetContractURIOverride, prepareSetContractURIRenderer, prepareSetParamHooks, prepareSetParamSchema, prepareRetireParam, readParamSchema, PARAM_TYPES, prepareSetRoyalty, prepareSetTokenField, batchOps, prepareSetTokenURIBase, prepareSetTokenURIOverride, prepareSetTokenURIRenderer, prepareSetTransferValidator, prepareSetSeedSource, probeSeedSource, readSeedSource, predictSeedSource, getDeployment, prepareTransfer, prepareTransferOwnership, probeTransferValidator, readCreatorTokenStatus, resolveRecommendedTransferValidator, RECOMMENDED_TRANSFER_VALIDATOR, KNOWN_CHAIN_KEYS, resolveChain, resolveRpcUrl, redactRpcUrl, encodeTag, METADATA_FIELD as F, METADATA_REPRESENTATION as R, stageFieldContent, planStagedContent, exceedsOnchainSoftLimit, classifyOnchainReadSize, tokenUriGasEstimate, ONCHAIN_IMAGE_SOFT_LIMIT, ONCHAIN_PROJECT_SOFT_LIMIT, ONCHAIN_READ_WARN_BYTES, ONCHAIN_READ_REFUSE_BYTES, } from '@artblocks/abx-sdk';
10
10
  import { encodeScalarParam, encodeTag as encodeTagSdk, isAccepted, prepareConfigureTokenParam, prepareConfigureTokenParamData, prepareSetContractParam, prepareSetContractParamData, seriesCodeAbi, tryReadContract, } from '@artblocks/abx-sdk';
11
- import { hasParamEnumeration } from '@artblocks/abx-sdk';
11
+ import { hasParamEnumeration, GATEWAY_FIELD, GATEWAY_FLOOR, gatewayPrefixFrom, readEnv } from '@artblocks/abx-sdk';
12
12
  import { decodeFieldRenderer, resolveGenerator, DEP_RESOLUTION, parseDependencyRef, prepareLockDependencies, prepareLockParamHooks, prepareLockScript, prepareRemoveLastDependency, prepareSetDependency, prepareSetDependencyRegistry, } from '@artblocks/abx-sdk';
13
13
  import { contentTypeFromPath } from '@artblocks/abx-storage';
14
14
  import { toHex as toHexSdk } from 'viem';
@@ -16,9 +16,9 @@ import { readFileSync } from 'node:fs';
16
16
  import { basename, resolve as resolvePath } from 'node:path';
17
17
  import { gzipSync } from 'node:zlib';
18
18
  import { formatEther, getAddress, isAddress, parseEther, toHex, zeroAddress } from 'viem';
19
- import { CHAIN, chainId, fixedPriceMinterAddress, fixedPriceMinter1155Address, localIndexer } from './config.js';
19
+ import { backendResolution, CHAIN, chainId, fixedPriceMinterAddress, fixedPriceMinter1155Address, localIndexer } from './config.js';
20
20
  import { CliError } from './errors.js';
21
- import { detectTokenKind } from './kind.js';
21
+ import { detectTokenKind, assertHasParamsSurface } from './kind.js';
22
22
  import { openWalletSession } from './signer.js';
23
23
  import { gatedSend, laneFromFlags } from './riskgate.js';
24
24
  import { withJson } from './jsonout.js';
@@ -46,6 +46,17 @@ const bold = (s) => `${C.bold}${s}${C.reset}`;
46
46
  // hand-set impostor of a read that lives on the contract. See specs/protocol/data-plane.md + specs/protocol/onchain-metadata.md.
47
47
  const COMPUTED_FIELD_KEYS = new Set(['artifacts', 'abx_params', 'abx_provenance']);
48
48
  export function assertSettableField(field) {
49
+ // The gateway keys ARE stored in the field store, but every way to get them wrong is silent: a
50
+ // token-scope write (a gateway is one answer per project, so nothing reads it), a representation
51
+ // other than `inline` (ignored), or a prefix missing its trailing path (`https://ipfs.io` + a CID
52
+ // is a 404 nobody attributes to this command). So the generic verb refuses and names the one that
53
+ // enforces all three, rather than warning and letting the write land.
54
+ if (field === GATEWAY_FIELD.ipfs || field === GATEWAY_FIELD.arweave) {
55
+ const network = field === GATEWAY_FIELD.ipfs ? 'ipfs' : 'arweave';
56
+ throw new Error(`"${field}" is a serving preference, not a metadata field — set it with the command that validates it:\n` +
57
+ ` abx set-gateway <address> --${network} ${GATEWAY_FLOOR[network]}\n` +
58
+ ` (collection scope, \`inline\`, and a prefix that ends in its path — set-field would let you get all three wrong silently.)`);
59
+ }
49
60
  if (COMPUTED_FIELD_KEYS.has(field)) {
50
61
  const what = field === 'artifacts'
51
62
  ? "the COMPUTED manifest (the complete list of this token's files), assembled by the resolver/renderer from your fields"
@@ -267,6 +278,7 @@ export async function cmdConfigureParam(address, rest, flags) {
267
278
  return;
268
279
  }
269
280
  const publicClient = makePublicClient({ chainKey: CHAIN });
281
+ await assertHasParamsSurface(publicClient, contract, 'abx configure-param');
270
282
  const schema = (await publicClient.readContract({
271
283
  address: contract,
272
284
  abi: seriesCodeAbi,
@@ -275,7 +287,7 @@ export async function cmdConfigureParam(address, rest, flags) {
275
287
  }));
276
288
  const [exists, paramTypeIdx, , , , , , selectOptions] = schema;
277
289
  // Contract scope (`-`): the raw owner setters (`setContractParam[Data]`) — the write path of
278
- // well-known contract params like `display.gateway`. Schema-less keys only: a schema'd key closes
290
+ // well-known contract params like `display.animation`. Schema-less keys only: a schema'd key closes
279
291
  // the raw path on-chain (`SchemaGoverned`) and is per-token by design. No key is special here: a
280
292
  // contract param is enumerated on-chain like any other and lands in tokenData for every token.
281
293
  if (tokenIdRaw === '-') {
@@ -815,6 +827,125 @@ export const AUTHORSHIP_DEPLOY_FIELDS = [
815
827
  export function authorshipContractFields(flags) {
816
828
  return AUTHORSHIP_DEPLOY_FIELDS.flatMap(([flag, field]) => flags[flag] ? [{ field: encodeTag(field), representation: encodeTag(R.inline), value: toHex(String(flags[flag])) }] : []);
817
829
  }
830
+ // ── preferred gateways ───────────────────────────────────────────────────────
831
+ // The two reserved COLLECTION-scope fields that turn a content-addressed `ipfs`/`arweave` value
832
+ // into the `https://` a marketplace can render. Identity (the CID) stays in the field; the serving
833
+ // prefix lives here, project-wide, so a dead or slow gateway is a REPOINT and never a rewrite.
834
+ /** Refuse a prefix that cannot serve. Two rules only — a URL parser here would be a liability, but
835
+ * a value that is not http(s) simply cannot be concatenated into a working URL by any consumer. */
836
+ export function assertGatewayPrefix(network, prefix) {
837
+ const value = prefix.trim();
838
+ if (!value)
839
+ throw new Error(`--${network} needs a gateway prefix (e.g. ${GATEWAY_FLOOR[network]}), or 'none' to clear it`);
840
+ if (!/^https?:\/\//i.test(value)) {
841
+ throw new Error(`gateway prefix "${value}" must start with https:// (or http://) — it is concatenated directly ` +
842
+ `onto the CID, so it has to be the whole serving prefix INCLUDING the trailing path.\n` +
843
+ ` e.g. ${GATEWAY_FLOOR[network]}` +
844
+ (network === 'ipfs' ? ' or https://<your>.mypinata.cloud/ipfs/' : ''));
845
+ }
846
+ return value;
847
+ }
848
+ /**
849
+ * The gateway fields a deploy should write.
850
+ *
851
+ * Precedence, per scheme: `--ipfs-gateway` / `--arweave-gateway` → `--gateway` (only for the backend
852
+ * actually in use) → `ABX_IPFS_GATEWAY` / `ABX_ARWEAVE_GATEWAY` → nothing.
853
+ *
854
+ * `--gateway` counts because it has to. It is the STORAGE gateway — where the CLI uploads, probes,
855
+ * and builds `locator()` — and before this it was also, accidentally, the serving gateway, because
856
+ * deploy baked `locator()` straight into a `url` field. Now that the field holds a bare CID, a
857
+ * creator who passed `--gateway https://mine.mypinata.cloud` and nothing else would have had their
858
+ * gateway stripped out and their tokens served from `ipfs.io`: strictly worse than before, for a
859
+ * flag they did pass. Someone who genuinely wants to upload through one gateway and serve through
860
+ * another says so with the scheme-specific flag.
861
+ *
862
+ * Deliberately writes NOTHING when no source names one. Persisting the public floor would make a
863
+ * project that simply took the default look like it chose `ipfs.io` — and would freeze it there,
864
+ * since a floor only improves for collections that stayed silent. Silence is a live default; an
865
+ * explicit value is a decision.
866
+ */
867
+ export function gatewayContractFields(flags) {
868
+ const out = [];
869
+ for (const network of ['ipfs', 'arweave']) {
870
+ const { prefix, chosen } = servingGateway(network, flags);
871
+ if (!chosen)
872
+ continue;
873
+ out.push({
874
+ field: encodeTag(GATEWAY_FIELD[network]),
875
+ representation: encodeTag(R.inline),
876
+ value: toHex(prefix),
877
+ });
878
+ }
879
+ return out;
880
+ }
881
+ /**
882
+ * The prefix this run will actually be SERVED from for one scheme — the same precedence
883
+ * `gatewayContractFields` writes, but resolved all the way down to the public floor so a caller can
884
+ * *show* the creator the URL their token will really carry.
885
+ *
886
+ * Split out because a deploy used to narrate the backend's UPLOAD locator (`gateway.pinata.cloud/…`)
887
+ * while committing a bare CID served from somewhere else entirely — a progress line that contradicted
888
+ * the chain. `chosen` distinguishes "the project picked this" (written on chain) from "the floor is
889
+ * filling a silence" (nothing written, and a later floor change moves the project with it).
890
+ *
891
+ * `--gateway` and the env vars are HOST-shaped (`https://my.gw`); the on-chain/served form is a full
892
+ * prefix including the trailing path, so normalize once, here.
893
+ */
894
+ export function servingGateway(network, flags) {
895
+ const activeBackend = backendResolution({ backend: flags.backend }).backend;
896
+ const named = flags[`${network}-gateway`] ??
897
+ (activeBackend === network ? flags.gateway : undefined) ??
898
+ readEnv(network === 'ipfs' ? 'ABX_IPFS_GATEWAY' : 'ABX_ARWEAVE_GATEWAY');
899
+ if (!named || named === 'true')
900
+ return { prefix: GATEWAY_FLOOR[network], chosen: false };
901
+ return { prefix: gatewayPrefixFrom(network, assertGatewayPrefix(network, String(named))), chosen: true };
902
+ }
903
+ /**
904
+ * `abx set-gateway <address> [--ipfs <prefix>] [--arweave <prefix>]` — repoint where this
905
+ * collection's content-addressed fields are served from. The CID never moves.
906
+ *
907
+ * A separate command rather than two `set-field` invocations because the failure modes are all
908
+ * silent: a token-scope write (ignored — a gateway is one answer per project), a non-`inline`
909
+ * representation (ignored), a prefix missing its trailing path (`https://ipfs.io` + `<cid>` is a
910
+ * 404). `set-field` refuses these keys and points here instead.
911
+ */
912
+ export async function cmdSetGateway(address, flags) {
913
+ const usage = 'abx set-gateway <address> [--ipfs <prefix>|none] [--arweave <prefix>|none] [--sign|--unsigned]';
914
+ const contract = requireAddress(address, usage);
915
+ const writes = [];
916
+ for (const network of ['ipfs', 'arweave']) {
917
+ const raw = flags[network];
918
+ if (raw === undefined)
919
+ continue;
920
+ if (raw === 'true')
921
+ throw new Error(`--${network} needs a value: a prefix like ${GATEWAY_FLOOR[network]}, or 'none' to fall back to the public default`);
922
+ // Clearing is a real operation: it returns the collection to the floor, which is what a project
923
+ // wants after a dedicated gateway subscription lapses.
924
+ writes.push({ network, value: raw === 'none' ? '' : gatewayPrefixFrom(network, assertGatewayPrefix(network, String(raw))) });
925
+ }
926
+ if (!writes.length)
927
+ throw new Error(`${usage}\n Pass at least one of --ipfs / --arweave. They are separate so a project can pay for a dedicated IPFS gateway and leave Arweave on the public one.`);
928
+ const owner = await read(contract, 'owner');
929
+ for (const { network, value } of writes) {
930
+ console.log(value
931
+ ? ` ${bold(network)} → ${value}`
932
+ : ` ${bold(network)} → ${dim(`cleared (falls back to ${GATEWAY_FLOOR[network]})`)}`);
933
+ await runWrite(contract, prepareSetContractField({
934
+ contract,
935
+ field: GATEWAY_FIELD[network],
936
+ representation: R.inline,
937
+ // An empty value clears the field, so the read falls through to the floor. The store refuses
938
+ // an empty write (`EmptyFieldValue`), so clearing writes a single space — which
939
+ // `projectGatewayPrefix` trims to nothing and treats as "no preference stated".
940
+ value: toHex(value || ' '),
941
+ chainId: chainId(),
942
+ }), flags, owner);
943
+ }
944
+ if (!isDryRun(flags)) {
945
+ console.log(dim('\n Every token whose image is a content-addressed field now resolves through the new prefix.'));
946
+ console.log(dim(' ERC-4906 fired, so 4906-aware marketplaces refresh on their own; `abx refresh <address>` nudges the rest.\n'));
947
+ }
948
+ }
818
949
  /** Set (or clear, with `--payee none`) the primary-sale payout destination. */
819
950
  export async function cmdSetPrimaryPayee(address, flags) {
820
951
  const usage = 'abx set-primary-payee <address> --payee 0x…|none [--sign|--unsigned]';
@@ -1438,6 +1569,13 @@ allowUnreadable = false) {
1438
1569
  },
1439
1570
  });
1440
1571
  }
1572
+ export function refusePrewrappedImage(bytes, label) {
1573
+ const head = typeof bytes === 'string' ? bytes.slice(0, 40) : new TextDecoder().decode(bytes.subarray(0, 40));
1574
+ if (/^\s*data:/i.test(head)) {
1575
+ throw new Error(`${label} is already a data URI. The on-chain renderer wraps inline image bytes as a data URI ` +
1576
+ 'itself — storing one produces a blank (double-wrapped) token. Pass the raw SVG, starting with <svg or <?xml.');
1577
+ }
1578
+ }
1441
1579
  /**
1442
1580
  * Dry-run preview of staging an image fully on-chain — the REAL chunk + transaction plan,
1443
1581
  * computed without writing anything (so `abx deploy --dry-run --onchain-image` reports the
@@ -1446,6 +1584,7 @@ allowUnreadable = false) {
1446
1584
  */
1447
1585
  export function previewImageStaging(imagePath, compress, allowUnreadable = false) {
1448
1586
  const bytes = readFileSync(resolvePath(imagePath));
1587
+ refusePrewrappedImage(bytes, basename(resolvePath(imagePath)));
1449
1588
  const p = computeContentPlan(bytes, compress);
1450
1589
  // The gate runs on the dry-run too: a refusal a creator only meets after the first staging tx has
1451
1590
  // landed is a refusal that already cost them gas.
@@ -1463,6 +1602,7 @@ export function previewImageStaging(imagePath, compress, allowUnreadable = false
1463
1602
  */
1464
1603
  export async function stageImageField(imagePath, compress, send, allowUnreadable = false) {
1465
1604
  const bytes = readFileSync(resolvePath(imagePath));
1605
+ refusePrewrappedImage(bytes, basename(resolvePath(imagePath)));
1466
1606
  const { value, representation } = await putContentOnChain(bytes, compress, 'image', send, '1 deploy (bakes the reader field + mints)', undefined, allowUnreadable);
1467
1607
  return {
1468
1608
  field: { field: encodeTag(F.image), representation: encodeTag(representation), value },
@@ -1551,6 +1691,9 @@ export async function cmdSetField(address, flags) {
1551
1691
  const owner = await read(contract, 'owner');
1552
1692
  await assertGeneratorRepointable(contract, field, flags); // legacy impl + the current generator = params silently invisible
1553
1693
  const staging = !!(flags.file && flags.file !== 'true'); // large content ON-CHAIN via chunk store/reader
1694
+ if (staging && field === 'image') {
1695
+ refusePrewrappedImage(readFileSync(resolvePath(flags.file)), `--file`);
1696
+ }
1554
1697
  // --file + --dry-run: preview the on-chain staging plan and store/send NOTHING. (The locator/text
1555
1698
  // path flows through runWrite, which previews there; staging must short-circuit before any upload.)
1556
1699
  if (staging && isDryRun(flags)) {
@@ -1606,6 +1749,8 @@ export async function cmdSetField(address, flags) {
1606
1749
  ({ value, representation } = await putContentOnChain(readFileSync(resolvePath(flags.file)), compress, field, envStagingSender(), undefined, undefined, allowUnreadableOnchain(flags)));
1607
1750
  }
1608
1751
  else if (flags.text && flags.text !== 'true') {
1752
+ if (field === 'image')
1753
+ refusePrewrappedImage(flags.text, `--text`);
1609
1754
  value = toHex(flags.text);
1610
1755
  representation = flags.representation ?? R.inline;
1611
1756
  console.log(dim(` inline on-chain '${field}'${collection ? ' (collection)' : ` on token #${flags.token ?? '0'}`}: ${JSON.stringify(flags.text.slice(0, 60))}${flags.text.length > 60 ? '…' : ''}`));
@@ -2006,7 +2151,7 @@ export async function cmdMinterConfigure(address, flags) {
2006
2151
  if (remaining !== null && allocation > remaining) {
2007
2152
  console.log(yellow(` ⚠ allocation ${allocation} exceeds the ${remaining} #${tokenId} can still mint `) +
2008
2153
  dim(`(cap ${maxSupply} − ${supplyNow} minted). Only ${remaining} will actually sell.`));
2009
- console.log(dim(` To sell ${allocation}, raise this id's cap is not possible (caps only decrease) — set --allocation ${remaining} (or less, to hold reserves).`));
2154
+ console.log(dim(` Selling ${allocation} isn't reachable: this id's cap can only ever DECREASE — set --allocation ${remaining} (or less, to hold reserves).`));
2010
2155
  }
2011
2156
  console.log(dim(` configuring sale on ${minter}`));
2012
2157
  console.log(dim(` token ${token} · id #${tokenId}`));
@@ -2270,6 +2415,7 @@ export async function cmdSetSchema(address, flags) {
2270
2415
  }
2271
2416
  const next = specs[0];
2272
2417
  const publicClient = makePublicClient({ chainKey: CHAIN });
2418
+ await assertHasParamsSurface(publicClient, contract, 'abx set-schema');
2273
2419
  const owner = await read(contract, 'owner');
2274
2420
  const before = await readParamSchema(publicClient, contract, next.key);
2275
2421
  if (!before.exists) {
@@ -2342,6 +2488,7 @@ export async function cmdRetireParam(address, rest, flags) {
2342
2488
  return;
2343
2489
  }
2344
2490
  const publicClient = makePublicClient({ chainKey: CHAIN });
2491
+ await assertHasParamsSurface(publicClient, contract, 'abx retire-param');
2345
2492
  const owner = await read(contract, 'owner');
2346
2493
  const current = await readParamSchema(publicClient, contract, key);
2347
2494
  if (!current.exists)