@artblocks/abx-cli 0.1.0-alpha.0

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 (77) hide show
  1. package/LICENSE +21 -0
  2. package/assets/renderer-scaffold/README.md +59 -0
  3. package/assets/renderer-scaffold/foundry.toml +15 -0
  4. package/assets/renderer-scaffold/remappings.txt +3 -0
  5. package/assets/renderer-scaffold/script/Deploy.s.sol +23 -0
  6. package/assets/renderer-scaffold/src/MyRenderer.sol +123 -0
  7. package/assets/renderer-scaffold/src/MyTraits.sol +75 -0
  8. package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +32 -0
  9. package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +26 -0
  10. package/assets/renderer-scaffold/test/MyRenderer.t.sol +110 -0
  11. package/dist/config.d.ts +69 -0
  12. package/dist/config.d.ts.map +1 -0
  13. package/dist/config.js +184 -0
  14. package/dist/config.js.map +1 -0
  15. package/dist/deps.d.ts +46 -0
  16. package/dist/deps.d.ts.map +1 -0
  17. package/dist/deps.js +90 -0
  18. package/dist/deps.js.map +1 -0
  19. package/dist/flags.d.ts +25 -0
  20. package/dist/flags.d.ts.map +1 -0
  21. package/dist/flags.js +34 -0
  22. package/dist/flags.js.map +1 -0
  23. package/dist/inspect.d.ts +48 -0
  24. package/dist/inspect.d.ts.map +1 -0
  25. package/dist/inspect.js +184 -0
  26. package/dist/inspect.js.map +1 -0
  27. package/dist/main.d.ts +3 -0
  28. package/dist/main.d.ts.map +1 -0
  29. package/dist/main.js +5102 -0
  30. package/dist/main.js.map +1 -0
  31. package/dist/migrate.d.ts +65 -0
  32. package/dist/migrate.d.ts.map +1 -0
  33. package/dist/migrate.js +180 -0
  34. package/dist/migrate.js.map +1 -0
  35. package/dist/mintpage.d.ts +46 -0
  36. package/dist/mintpage.d.ts.map +1 -0
  37. package/dist/mintpage.js +461 -0
  38. package/dist/mintpage.js.map +1 -0
  39. package/dist/onchain-uri.d.ts +97 -0
  40. package/dist/onchain-uri.d.ts.map +1 -0
  41. package/dist/onchain-uri.js +243 -0
  42. package/dist/onchain-uri.js.map +1 -0
  43. package/dist/ownerops.d.ts +195 -0
  44. package/dist/ownerops.d.ts.map +1 -0
  45. package/dist/ownerops.js +1270 -0
  46. package/dist/ownerops.js.map +1 -0
  47. package/dist/provision.d.ts +86 -0
  48. package/dist/provision.d.ts.map +1 -0
  49. package/dist/provision.js +372 -0
  50. package/dist/provision.js.map +1 -0
  51. package/dist/remote.d.ts +58 -0
  52. package/dist/remote.d.ts.map +1 -0
  53. package/dist/remote.js +54 -0
  54. package/dist/remote.js.map +1 -0
  55. package/dist/schema.d.ts +15 -0
  56. package/dist/schema.d.ts.map +1 -0
  57. package/dist/schema.js +125 -0
  58. package/dist/schema.js.map +1 -0
  59. package/dist/series-traits.d.ts +30 -0
  60. package/dist/series-traits.d.ts.map +1 -0
  61. package/dist/series-traits.js +103 -0
  62. package/dist/series-traits.js.map +1 -0
  63. package/dist/signer.d.ts +80 -0
  64. package/dist/signer.d.ts.map +1 -0
  65. package/dist/signer.js +520 -0
  66. package/dist/signer.js.map +1 -0
  67. package/dist/upload.d.ts +28 -0
  68. package/dist/upload.d.ts.map +1 -0
  69. package/dist/upload.js +41 -0
  70. package/dist/upload.js.map +1 -0
  71. package/package.json +55 -0
  72. package/skill/SKILL.md +304 -0
  73. package/skill/reference/code-projects.md +211 -0
  74. package/skill/reference/hosting.md +138 -0
  75. package/skill/reference/operating.md +116 -0
  76. package/skill/reference/setup.md +36 -0
  77. package/skill/reference/troubleshooting.md +28 -0
@@ -0,0 +1,243 @@
1
+ /**
2
+ * The on-chain tokenURI lane for code projects (`abx deploy-code --onchain-uri`) — pure leg
3
+ * composition + the verify-time honesty reads, all unit-testable with a mocked client.
4
+ *
5
+ * The lane (specs/protocol/code-projects.md → "The canonical generator — AbxGenerator" +
6
+ * specs/protocol/onchain-metadata.md → "URI resolution"): the collection-scope `animation_url`
7
+ * field points at the canonical generator via the `renderer` representation
8
+ * (`abi.encode(address)`), the `params.keys` contract param enumerates the declared param
9
+ * surface (the params store is unenumerable by design — the generator reads this CSV to build
10
+ * on-chain tokenData), and the token's `tokenURIRenderer` toggles tokenURI to the canonical
11
+ * on-chain metadata renderer. All three ride the EXISTING setup multicall, before the mints.
12
+ */
13
+ import { encodeFunctionData, toHex, zeroAddress } from 'viem';
14
+ import { decodeFieldRenderer, decodeTag, encodeFieldRenderer, encodeTag, readGeneratorStatus, resolveGenerator, seriesCodeAbi, METADATA_FIELD as F, METADATA_REPRESENTATION as R, DEP_RESOLUTION, } from '@artblocks/abx-sdk';
15
+ /** The self-referential key: the CSV lists it too (the resolver's tokenData carries every
16
+ * evented param — including `params.keys` itself — so the generator must list it to stay
17
+ * byte-aligned; inputsHash parity is load-bearing). */
18
+ export const PARAMS_KEYS = 'params.keys';
19
+ /** ≤ this many chars rides as a literal readable-ASCII bytes32; longer takes the data path. */
20
+ export const PARAMS_KEYS_LITERAL_MAX = 31;
21
+ /**
22
+ * Compose the `params.keys` CSV: every param key the deploy writes ∪ the `--schema` keys ∪
23
+ * `params.keys` itself — deduped, sorted lexicographically, comma-joined. Sorted because the
24
+ * canonical tokenData serialization sorts keys; deterministic composition keeps the value
25
+ * reproducible from the same flags.
26
+ */
27
+ export function composeParamsKeys(writtenParamKeys, schemaKeys) {
28
+ const keys = new Set([...writtenParamKeys, ...schemaKeys, PARAMS_KEYS]);
29
+ return [...keys]
30
+ .map((k) => k.trim())
31
+ .filter(Boolean)
32
+ .sort()
33
+ .filter((k, i, all) => i === 0 || k !== all[i - 1])
34
+ .join(',');
35
+ }
36
+ /** Whether a CSV fits the literal bytes32 lane (printable ASCII, ≤ 31 bytes). */
37
+ export function paramsKeysIsLiteral(csv) {
38
+ return csv.length <= PARAMS_KEYS_LITERAL_MAX && /^[\x20-\x7e]+$/.test(csv);
39
+ }
40
+ /** The `params.keys` write leg: `setContractParam` (literal bytes32) when the CSV fits,
41
+ * else `setContractParamData` (one blob; hash evented — the generator reads it back whole). */
42
+ export function paramsKeysCall(csv) {
43
+ if (paramsKeysIsLiteral(csv)) {
44
+ return {
45
+ call: encodeFunctionData({
46
+ abi: seriesCodeAbi,
47
+ functionName: 'setContractParam',
48
+ args: [encodeTag(PARAMS_KEYS), encodeTag(csv)],
49
+ }),
50
+ encoding: 'literal',
51
+ };
52
+ }
53
+ return {
54
+ call: encodeFunctionData({
55
+ abi: seriesCodeAbi,
56
+ functionName: 'setContractParamData',
57
+ args: [encodeTag(PARAMS_KEYS), toHex(csv)],
58
+ }),
59
+ encoding: 'data',
60
+ };
61
+ }
62
+ /**
63
+ * The `--onchain-uri` legs of the setup multicall, in order:
64
+ * 1. collection-scope `animation_url` field → representation `renderer`,
65
+ * value `abi.encode(generator)` (the canonical generator computes the live view on-chain);
66
+ * 2. the `params.keys` contract param (the generator's tokenData enumeration seam);
67
+ * 3. `setTokenURIRenderer(metadataRenderer)` — tokenURI resolves ON-CHAIN from here on;
68
+ * 4. `setContractURIRenderer(metadataRenderer)` — contractURI too (parity with the 1/1 lane).
69
+ * Placed BEFORE the mint legs so every token is born with the on-chain lane fully configured.
70
+ */
71
+ export function onchainUriSetupCalls(args) {
72
+ const { call: paramsLeg, encoding } = paramsKeysCall(args.paramsKeys);
73
+ const calls = [];
74
+ // The `animation_url` leg points at the generator (which computes the doc from a PROGRAM). A
75
+ // renderer-only drop (in-chain SVG, no program) has no generator — and baking this leg at a ZERO
76
+ // generator would make the metadata renderer staticcall a codeless address and REVERT every
77
+ // tokenURI. So emit it only when there's a real generator; otherwise there's simply no animation_url
78
+ // (optional by spec — the metadata renderer omits an unset field).
79
+ if (args.generator !== zeroAddress) {
80
+ calls.push(encodeFunctionData({
81
+ abi: seriesCodeAbi,
82
+ functionName: 'setContractField',
83
+ args: [encodeTag(F.animationUrl), encodeTag(R.renderer), encodeFieldRenderer(args.generator)],
84
+ }));
85
+ }
86
+ calls.push(paramsLeg, encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setTokenURIRenderer', args: [args.metadataRenderer] }), encodeFunctionData({ abi: seriesCodeAbi, functionName: 'setContractURIRenderer', args: [args.metadataRenderer] }));
87
+ return { calls, paramsKeysEncoding: encoding };
88
+ }
89
+ // ── the chain-complete expectation (deploy-time, from the P1 dependency report) ──
90
+ /** What the deploy can honestly promise about the generator's template branch, derived from
91
+ * the selection-time dependency report (never a new RPC): chain-complete iff every registry
92
+ * dep has proven ON-CHAIN bytes (OnChain refs read their data contract directly, so they
93
+ * count as on-chain; `abx verify` is the from-chain confirmation either way). */
94
+ export function expectedChainComplete(deps, checks) {
95
+ if (deps.length === 0)
96
+ return { expected: true, detail: 'no dependencies — the document assembles from the script chunks alone' };
97
+ const registryDeps = deps.filter((d) => d.resolution === DEP_RESOLUTION.registry);
98
+ if (registryDeps.length === 0) {
99
+ return { expected: true, detail: 'all dependencies are on-chain data contracts (read directly)' };
100
+ }
101
+ const byDep = new Map(checks.map((c) => [c.dep, c]));
102
+ const cdnOnly = [];
103
+ const missing = [];
104
+ let unknown = false;
105
+ for (const d of registryDeps) {
106
+ const chk = byDep.get(d.display);
107
+ if (!chk || chk.status === 'skipped')
108
+ unknown = true;
109
+ else if (chk.status === 'not-found')
110
+ missing.push(d.display);
111
+ else if (!chk.details.availableOnChain)
112
+ cdnOnly.push(d.display);
113
+ }
114
+ if (missing.length)
115
+ return { expected: false, detail: `${missing.join(', ')} not on the registry — the generator will emit an unresolved marker` };
116
+ if (cdnOnly.length)
117
+ return { expected: false, detail: `${cdnOnly.join(', ')} CDN-served (the normal production path) — serves fine, NOT chain-complete` };
118
+ if (unknown)
119
+ return { expected: null, detail: 'registry check was skipped (RPC unreachable) — `abx verify` reads the truth from chain' };
120
+ return { expected: true, detail: 'every dependency has ON-CHAIN bytes — no server, gateway, or CDN in the graph' };
121
+ }
122
+ // ── verify: the honesty reads (`onChainStatus` + a tokenURI probe) ─────────────
123
+ /** The generator this project's on-chain lane actually uses: the collection `animation_url`
124
+ * field's `renderer` value when set (that address is what the metadata renderer staticcalls),
125
+ * else the chain's canonical generator. Null when neither exists. */
126
+ export function generatorFor(state, override) {
127
+ const field = state.collectionFields.find((f) => f.field === F.animationUrl && f.representation === R.renderer);
128
+ if (field) {
129
+ try {
130
+ return decodeFieldRenderer(field.value);
131
+ }
132
+ catch {
133
+ /* malformed value — fall through to the manifest */
134
+ }
135
+ }
136
+ return resolveGenerator(state.chainId, override) ?? null;
137
+ }
138
+ /** Whether verify should run the on-chain-URI report: the tokenURIRenderer toggle is on, or
139
+ * the collection `animation` field points at a field renderer (the generator). */
140
+ export function hasOnChainUriLane(state) {
141
+ const rendererSet = !!state.tokenURIRenderer && state.tokenURIRenderer !== zeroAddress;
142
+ const animationRenderer = state.collectionFields.some((f) => f.field === F.animationUrl && f.representation === R.renderer);
143
+ return rendererSet || animationRenderer;
144
+ }
145
+ const erc721TokenUriAbi = [
146
+ {
147
+ type: 'function',
148
+ name: 'tokenURI',
149
+ stateMutability: 'view',
150
+ inputs: [{ name: 'id', type: 'uint256' }],
151
+ outputs: [{ name: '', type: 'string' }],
152
+ },
153
+ ];
154
+ /** An HTML comment marker the generator emits on degradation (`<!-- abx:… -->`), or null. */
155
+ function degradationMarker(html) {
156
+ const m = /<!--\s*abx:[^>]*-->/.exec(html);
157
+ return m ? m[0] : null;
158
+ }
159
+ function probeAnimation(animationUrl) {
160
+ if (!animationUrl)
161
+ return { form: 'missing' };
162
+ const dataHtml = /^data:text\/html;base64,(.*)$/.exec(animationUrl);
163
+ if (dataHtml) {
164
+ const html = Buffer.from(dataHtml[1], 'base64').toString('utf8');
165
+ return { form: 'data-html', bytes: Buffer.byteLength(html), marker: degradationMarker(html) };
166
+ }
167
+ if (animationUrl.startsWith('data:'))
168
+ return { form: 'data-other', prefix: animationUrl.slice(0, 40) };
169
+ return { form: 'url', url: animationUrl };
170
+ }
171
+ /**
172
+ * The verify-time on-chain-URI report: `generator.onChainStatus(token)` (branch ·
173
+ * chain-completeness · unresolved refs · URL budget) plus a `tokenURI` probe of the lowest
174
+ * minted token — decoded, with the `animation_url` form checked against the branch.
175
+ */
176
+ export async function onChainUriReport(client, state, generatorOverride) {
177
+ const generator = generatorFor(state, generatorOverride);
178
+ if (!generator) {
179
+ throw new Error(`no AbxGenerator known for chain ${state.chainId} — set ABX_GENERATOR=0x… (or update @artblocks/abx-sdk's deployments manifest)`);
180
+ }
181
+ const status = await readGeneratorStatus(client, generator, state.address);
182
+ const minted = state.tokens.filter((t) => t.minted).map((t) => BigInt(t.tokenId));
183
+ let probe = null;
184
+ if (minted.length) {
185
+ const tokenId = minted.reduce((a, b) => (b < a ? b : a));
186
+ const uri = (await client.readContract({
187
+ address: state.address,
188
+ abi: erc721TokenUriAbi,
189
+ functionName: 'tokenURI',
190
+ args: [tokenId],
191
+ }));
192
+ const m = /^data:application\/json;base64,(.*)$/.exec(uri);
193
+ let animation = { form: 'missing' };
194
+ if (m) {
195
+ try {
196
+ const json = JSON.parse(Buffer.from(m[1], 'base64').toString('utf8'));
197
+ animation = probeAnimation(typeof json.animation_url === 'string' ? json.animation_url : undefined);
198
+ }
199
+ catch {
200
+ /* undecodable JSON — reported as onChainJson with a missing animation */
201
+ }
202
+ }
203
+ probe = { tokenId: tokenId.toString(), onChainJson: !!m, uriPrefix: uri.slice(0, 48), animation };
204
+ }
205
+ return { generator, status, probe };
206
+ }
207
+ // ── the configure-param nudge (params.keys drift) ──────────────────────────────
208
+ /**
209
+ * After a param write: if the project's `params.keys` CSV exists but doesn't list the
210
+ * configured key, the on-chain generator's tokenData will silently omit it (breaking byte
211
+ * parity with the resolver's). Returns the fixed CSV to suggest, or null when no nudge is
212
+ * warranted (no CSV = not on the on-chain lane; already listed = fine).
213
+ */
214
+ export function paramsKeysNudge(existingCsv, configuredKey) {
215
+ if (existingCsv === null || configuredKey === PARAMS_KEYS)
216
+ return null;
217
+ const listed = existingCsv.split(',').map((k) => k.trim()).filter(Boolean);
218
+ if (listed.includes(configuredKey))
219
+ return null;
220
+ return composeParamsKeys([...listed, configuredKey], []);
221
+ }
222
+ /** Read the project's `params.keys` contract param from chain (literal or data-backed);
223
+ * null when unset. Best-effort — callers must treat a throw as "no nudge". */
224
+ export async function readParamsKeys(client, contract) {
225
+ const [value, valueIsHash, isSet] = (await client.readContract({
226
+ address: contract,
227
+ abi: seriesCodeAbi,
228
+ functionName: 'contractParam',
229
+ args: [encodeTag(PARAMS_KEYS)],
230
+ }));
231
+ if (!isSet)
232
+ return null;
233
+ if (!valueIsHash)
234
+ return decodeTag(value);
235
+ const data = (await client.readContract({
236
+ address: contract,
237
+ abi: seriesCodeAbi,
238
+ functionName: 'contractParamData',
239
+ args: [encodeTag(PARAMS_KEYS)],
240
+ }));
241
+ return Buffer.from(data.slice(2), 'hex').toString('utf8');
242
+ }
243
+ //# sourceMappingURL=onchain-uri.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onchain-uri.js","sourceRoot":"","sources":["../src/onchain-uri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAC,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAC,MAAM,MAAM,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,cAAc,IAAI,CAAC,EACnB,uBAAuB,IAAI,CAAC,EAO5B,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B;;wDAEwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,gBAA0B,EAAE,UAAoB;IAChF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,CAAC,GAAG,gBAAgB,EAAE,GAAG,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;IAChF,OAAO,CAAC,GAAG,IAAI,CAAC;SACb,GAA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C;IAC/B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC;QACtC,OAAO,EAAE,QAAQ;QACjB,GAAG,EAAE,aAAa;QAClB,YAAY,EAAE,mBAAmB;QACjC,IAAI,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;KAC/B,CAAC,CAAQ,CAAC;IACX,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Owner operations — the writes that *operate* a project after it's born:
3
+ * sell/transfer, re-point its resolver, change royalties, update or freeze
4
+ * content, hand over admin. Each builds an unsigned tx with the SDK and runs it
5
+ * through the signing harness (hot / wallet / cold lane), then re-indexes so the
6
+ * served state reflects the change. The agent picks the lane; the human only
7
+ * approves (wallet lane) or it's the env key (hot lane).
8
+ */
9
+ import { planContentTxs, type SendStagingTx, type Address, type OnChainFieldInput } from '@artblocks/abx-sdk';
10
+ import { type Lane, type WalletSession } from './signer.js';
11
+ type Flags = Record<string, string | undefined>;
12
+ export declare function assertSettableField(field: string): void;
13
+ /** Auto-detect the on-chain representation for an off-chain locator by its URI scheme. Returns null
14
+ * for anything that isn't a recognized durable/http locator (so `attach` can refuse it loudly
15
+ * rather than silently storing a bad value — the round-1 `--representation` guessing trap). */
16
+ export declare function representationForLocator(uri: string): string | null;
17
+ /** Resolve the signing lane from flags: --unsigned (cold) · --sign (wallet) · default hot. */
18
+ export declare function laneFromFlags(flags: Flags): Lane;
19
+ /** Throw a clear, actionable error when `address` has no contract on the active chain — the common
20
+ * cause of an owner-op's raw `returned no data ("0x")`. No-op when code is present or unknowable. */
21
+ export declare function assertContractExists(address: Address): Promise<void>;
22
+ export declare function cmdConfigureParam(address: string | undefined, rest: string[], flags: Flags): Promise<void>;
23
+ declare const HOOK_ROLES: readonly ["configure", "augment", "transfer"];
24
+ type HookRole = (typeof HOOK_ROLES)[number];
25
+ /** Parse a hook-address flag: a 0x address, or `none`/`zero`/`0`/`0x0` to clear that role. */
26
+ export declare function parseHookAddress(role: HookRole, v: string): Address;
27
+ /**
28
+ * `abx set-param-hooks <address> [--configure 0x|none] [--augment 0x|none] [--transfer 0x|none] [--clear]`
29
+ * — wire (or clear) a SeriesCode project's three param-lifecycle hooks. The contract has NO per-hook
30
+ * setter (`setParamHooks` writes all three at once), so this READS the current trio (`paramHooks()`)
31
+ * and re-sends it with your changes applied: omit a role to KEEP it, pass an address to set it, or
32
+ * `none` to clear it (`--clear` clears all three). Owner-only, any lane, guards `--dry-run`. SeriesCode
33
+ * only — a 1/1 or plain Series has no configurable params to hook. Bare (no flags) prints the current
34
+ * hooks and does nothing.
35
+ */
36
+ export declare function cmdSetParamHooks(address: string | undefined, flags: Flags): Promise<void>;
37
+ /**
38
+ * `abx set-dependency <address> <index> <ref>` — declare/replace the dependency at an
39
+ * index. The ref auto-detects: `name@version` (e.g. `p5@1.0.0` — resolves through the
40
+ * collection's soft registry pointer) or `0x…` (an on-chain data contract, read directly).
41
+ * The chain enforces density (index ≤ dependencyCount) and the lock.
42
+ */
43
+ export declare function cmdSetDependency(address: string | undefined, rest: string[], flags: Flags): Promise<void>;
44
+ /** `abx remove-last-dependency <address>` — pop the LAST dependency (the list stays dense;
45
+ * to replace one in place, `set-dependency` at its index instead). */
46
+ export declare function cmdRemoveLastDependency(address: string | undefined, flags: Flags): Promise<void>;
47
+ /** `abx set-dependency-registry <address> <registry>` — point (or clear, with `none`) the
48
+ * soft, non-validating registry pointer the project's `name@version` refs resolve through. */
49
+ export declare function cmdSetDependencyRegistry(address: string | undefined, rest: string[], flags: Flags): Promise<void>;
50
+ /** `abx lock-dependencies <address>` — freeze the dependency set (list + registry pointer) forever. */
51
+ export declare function cmdLockDependencies(address: string | undefined, flags: Flags): Promise<void>;
52
+ export declare function cmdMint(address: string | undefined, flags: Flags): Promise<void>;
53
+ /** Set (or clear, with `--minter none`) the single authorized minter — a drop/auction/router
54
+ * contract. Setting a new one atomically replaces any previous minter. */
55
+ export declare function cmdSetMinter(address: string | undefined, flags: Flags): Promise<void>;
56
+ /** Lower the supply cap (monotonic — e.g. close an open edition early at `--max <totalSupply>`). */
57
+ export declare function cmdSetMaxInvocations(address: string | undefined, flags: Flags): Promise<void>;
58
+ /** Pause minting — restrict it to the owner (config/reserves) until unpaused. */
59
+ export declare function cmdPause(address: string | undefined, flags: Flags): Promise<void>;
60
+ /** Unpause minting — open it to the authorized minter (go live). */
61
+ export declare function cmdUnpause(address: string | undefined, flags: Flags): Promise<void>;
62
+ /** The optional authorship + rights deploy flags, each paired with the reserved collection-field
63
+ * key it writes. Set at deploy → baked as on-chain **inline collection** fields (same slot the
64
+ * `--description` / `--external-url` identity writes use); unset → nothing written. Collection
65
+ * scope, so one value covers the whole project — they project into `contractURI` on the resolver
66
+ * AND the on-chain renderer. Works for every token type (1/1 · Series · code). */
67
+ export declare const AUTHORSHIP_DEPLOY_FIELDS: ReadonlyArray<readonly [flag: string, field: string]>;
68
+ /** Build the on-chain (inline) collection fields for whichever authorship/rights deploy flags are
69
+ * set — pure, so a deploy path just spreads the result into its `contractFields`. */
70
+ export declare function authorshipContractFields(flags: Flags): OnChainFieldInput[];
71
+ /** Set (or clear, with `--payee none`) the primary-sale payout destination. */
72
+ export declare function cmdSetPrimaryPayee(address: string | undefined, flags: Flags): Promise<void>;
73
+ export declare function cmdRefresh(address: string | undefined, flags: Flags): Promise<void>;
74
+ export declare function cmdTransfer(address: string | undefined, flags: Flags): Promise<void>;
75
+ export declare function cmdSetTokenUri(address: string | undefined, flags: Flags): Promise<void>;
76
+ export declare function cmdSetContractUri(address: string | undefined, flags: Flags): Promise<void>;
77
+ /** Parse + bound-check a royalty `--bps` (basis points, 0–10000 = 0–100%). Throws a plain-language
78
+ * error on a non-integer or out-of-range value instead of letting it hit the chain (or a cryptic
79
+ * ABI read). Exported for the regression test. */
80
+ export declare function parseRoyaltyBps(raw: string): number;
81
+ export declare function cmdSetRoyalty(address: string | undefined, flags: Flags): Promise<void>;
82
+ export type Compress = 'none' | 'fastlz' | 'gzip';
83
+ export declare function parseCompress(v: string | undefined): Compress;
84
+ /**
85
+ * The hot-lane staging signer: the env key signs + broadcasts each chunk-store write. Built
86
+ * lazily so commands that never stage on-chain don't require a key. The wallet lane passes a
87
+ * session-backed sender instead (see {@link openWalletSession}); the cold lane can't stage
88
+ * interactively, so it's rejected up front by the deploy/set-field commands.
89
+ */
90
+ export declare function envStagingSender(): SendStagingTx;
91
+ /** Wallet-lane staging signer: each chunk-store write is approved in the human's browser
92
+ * wallet through the open {@link WalletSession}, sharing one connection with the final tx. */
93
+ export declare function sessionStagingSender(session: WalletSession): SendStagingTx;
94
+ /**
95
+ * Put `content` on-chain as SSTORE2 chunks behind the shared reader, and return the field's
96
+ * `(representation, value)`. `fastlz` compresses per chunk (reader decodes on read → stays
97
+ * on-chain renderable); `gzip` compresses the whole content (off-chain decode → the
98
+ * `reader-gzip` representation, not on-chain renderable).
99
+ *
100
+ * Staging is one atomic `writeContent` when the content fits a single tx's gas, else
101
+ * gas-bounded chunk-write `multicall`s plus a final manifest write — {@link stageContent}
102
+ * picks, and we print the tx plan up front so the human knows the count before signing.
103
+ * These store writes use the env key (the data contracts are ownerless); the owner only
104
+ * signs the field set that references the manifest.
105
+ */
106
+ /**
107
+ * Pure staging plan for a piece of content — chunk count + transaction shape — with NO
108
+ * chain writes, no signer, no `ensureChunkStore`. Shared by {@link putContentOnChain}
109
+ * (which then actually stages) and the deploy dry-run preview, so the count the human is
110
+ * told up front is the same one the real staging will produce. `chunkSize` defaults to the
111
+ * SDK's {@link planChunks} default (currently 22 KB), so e.g. a 2.8 KB SVG is 1 chunk.
112
+ */
113
+ export declare const ONCHAIN_IMAGE_SOFT_LIMIT: number;
114
+ export declare const ONCHAIN_PROJECT_SOFT_LIMIT: number;
115
+ /** Warn (loudly) when content is too big for on-chain to be the cost-sane choice. Returns true if it warned. */
116
+ export declare function warnIfLargeForOnChain(bytesLen: number, label: string): boolean;
117
+ export declare function computeContentPlan(bytes: Buffer, compress: Compress): {
118
+ content: Uint8Array;
119
+ fastlz: boolean;
120
+ chunks: number;
121
+ stagedBytes: number;
122
+ plan: ReturnType<typeof planContentTxs>;
123
+ representation: string;
124
+ };
125
+ /**
126
+ * Dry-run preview of staging an image fully on-chain — the REAL chunk + transaction plan,
127
+ * computed without writing anything (so `abx deploy --dry-run --onchain-image` reports the
128
+ * true count instead of leaving the agent to guess). The final tx here is the deploy that
129
+ * bakes in the reader field, so the count is staging tx(s) + the deploy.
130
+ */
131
+ export declare function previewImageStaging(imagePath: string, compress: Compress): string;
132
+ /**
133
+ * Stage an image file fully on-chain (chunk store) and return the `reader`-backed
134
+ * `image` field to bake into a deploy's `InitParams.tokenFields`. The staging writes
135
+ * are ownerless (env key) and happen before the deploy, so "deploy a 50 kB on-chain
136
+ * image" is just those staging tx(s) + the single deploy — no post-deploy `set-field`.
137
+ * The manifest is deployer-independent, so this is computed once and reused for any signer.
138
+ */
139
+ export declare function stageImageField(imagePath: string, compress: Compress, send: SendStagingTx): Promise<{
140
+ field: OnChainFieldInput;
141
+ note: string;
142
+ }>;
143
+ /**
144
+ * Stage MANY images on-chain against a **single, shared** chunk store — the batch form of
145
+ * {@link stageImageField} for a Series. The store is resolved/deployed **once** (not per token),
146
+ * then every file is staged against it and returned as its own `reader`-backed `image` field.
147
+ * Each field still points at its own manifest, so each token's artwork is independent; they just
148
+ * share the store contract. Returns the fields in input order (token order).
149
+ */
150
+ export declare function stageImageFieldsBatch(imagePaths: string[], compress: Compress, send: SendStagingTx, storeOverride?: string): Promise<{
151
+ fields: OnChainFieldInput[];
152
+ store: Address;
153
+ }>;
154
+ export declare function cmdSetField(address: string | undefined, flags: Flags): Promise<void>;
155
+ /**
156
+ * `abx attach <address> <key> <uri>` — attach a named, typed file to a token (or the collection),
157
+ * so it appears in the token's served `artifacts` manifest as `{key, mimeType, uri}`. This is the
158
+ * creator-facing verb for the token data plane (specs/protocol/data-plane.md); it's a thin,
159
+ * correct-by-construction wrapper over `set-field`:
160
+ * - the on-chain representation is AUTO-DETECTED from the URI scheme (ipfs:// · ar:// · https://)
161
+ * — no `--representation` to guess wrong;
162
+ * - `--file <path>` instead of a URI stores tiny bytes ON-CHAIN (SSTORE2), for a small file with
163
+ * no external host (≈200 gas/byte — locators are the norm for anything non-trivial);
164
+ * - the declared `mimeType` comes from the file EXTENSION in the URI (`…/master.tiff` → image/tiff),
165
+ * so give the file a real extension or it lands as `application/octet-stream`;
166
+ * - computed keys (`artifacts`, `abx_provenance`) are refused — they're the manifest, not inputs.
167
+ * Scope: token (`--token`, default 0) or `--collection`. Any signing lane. Owner-only.
168
+ */
169
+ export declare function cmdAttach(rest: string[], flags: Flags): Promise<void>;
170
+ export declare function cmdLockField(address: string | undefined, flags: Flags): Promise<void>;
171
+ /** Point a token's URI resolution at an on-chain renderer (or clear it with `--off`).
172
+ * `flags.renderer` is the resolved address (main.ts defaults it to the canonical
173
+ * renderer). With it set, `tokenURI`/`contractURI` are assembled on-chain from the
174
+ * fields — no resolver needed. Scope: token (default) or `--collection`. */
175
+ export declare function cmdSetRenderer(address: string | undefined, flags: Flags): Promise<void>;
176
+ /** Freeze a scope's URI config (pointer + renderer) forever. With the fields also
177
+ * locked, the resolved metadata is provably immutable — the on-chain twin of a
178
+ * frozen `tokenURI`. Scope: token (default) or `--collection`. */
179
+ export declare function cmdLockUri(address: string | undefined, flags: Flags): Promise<void>;
180
+ export declare function cmdSetAdmin(address: string | undefined, flags: Flags): Promise<void>;
181
+ /**
182
+ * `abx minter configure <token> --price <eth> --allocation <n> [--erc20 0x…]` — set the fixed-price
183
+ * sale for a project on the shared minter. Defers to the token owner. Resolves (or deploys) the
184
+ * shared minter, then reports the two remaining grants the owner still needs (assign the minter on
185
+ * the token, set a primary payee) and whether the token is paused.
186
+ */
187
+ export declare function cmdMinterConfigure(address: string | undefined, flags: Flags): Promise<void>;
188
+ /** `abx minter show <token>` — the sale terms + the token's readiness (assigned? payee? paused?).
189
+ * Read-only; the agent runs it to see exactly what's configured before/after a sale. */
190
+ export declare function cmdMinterShow(address: string | undefined, flags: Flags): Promise<void>;
191
+ /** `abx minter buy <token> [--to 0x…]` — buy one token through the shared minter (public; any
192
+ * funded signer). ETH sales attach the price; ERC-20 sales need a prior approval to the minter. */
193
+ export declare function cmdMinterBuy(address: string | undefined, flags: Flags): Promise<void>;
194
+ export {};
195
+ //# sourceMappingURL=ownerops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownerops.d.ts","sourceRoot":"","sources":["../src/ownerops.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAeL,cAAc,EA2Bd,KAAK,aAAa,EAIlB,KAAK,OAAO,EAEZ,KAAK,iBAAiB,EAEvB,MAAM,oBAAoB,CAAC;AA4B5B,OAAO,EAA4B,KAAK,IAAI,EAAmB,KAAK,aAAa,EAAC,MAAM,aAAa,CAAC;AAatG,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAShD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAWvD;AAKD;;gGAEgG;AAChG,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMnE;AAMD,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAIhD;AA4GD;sGACsG;AACtG,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAe1E;AA8BD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,E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