@artblocks/abx-cli 0.1.0-alpha.3 → 0.1.0-alpha.30

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 (148) hide show
  1. package/CHANGELOG.md +3663 -0
  2. package/assets/renderer-scaffold/README.md +2 -2
  3. package/assets/renderer-scaffold/src/MyRenderer.sol +2 -2
  4. package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +1 -1
  5. package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +17 -0
  6. package/assets/renderer-scaffold/test/MyRenderer.t.sol +51 -2
  7. package/dist/commands/deploy.d.ts +242 -0
  8. package/dist/commands/deploy.d.ts.map +1 -0
  9. package/dist/commands/deploy.js +4764 -0
  10. package/dist/commands/deploy.js.map +1 -0
  11. package/dist/commands/project.d.ts +257 -0
  12. package/dist/commands/project.d.ts.map +1 -0
  13. package/dist/commands/project.js +1299 -0
  14. package/dist/commands/project.js.map +1 -0
  15. package/dist/commands/reads.d.ts +64 -0
  16. package/dist/commands/reads.d.ts.map +1 -0
  17. package/dist/commands/reads.js +701 -0
  18. package/dist/commands/reads.js.map +1 -0
  19. package/dist/commands/scaffold.d.ts +73 -0
  20. package/dist/commands/scaffold.d.ts.map +1 -0
  21. package/dist/commands/scaffold.js +674 -0
  22. package/dist/commands/scaffold.js.map +1 -0
  23. package/dist/commands/service.d.ts +41 -0
  24. package/dist/commands/service.d.ts.map +1 -0
  25. package/dist/commands/service.js +618 -0
  26. package/dist/commands/service.js.map +1 -0
  27. package/dist/commands/storage.d.ts +51 -0
  28. package/dist/commands/storage.d.ts.map +1 -0
  29. package/dist/commands/storage.js +370 -0
  30. package/dist/commands/storage.js.map +1 -0
  31. package/dist/commands/submit-app.d.ts +58 -0
  32. package/dist/commands/submit-app.d.ts.map +1 -0
  33. package/dist/commands/submit-app.js +512 -0
  34. package/dist/commands/submit-app.js.map +1 -0
  35. package/dist/config.d.ts +90 -2
  36. package/dist/config.d.ts.map +1 -1
  37. package/dist/config.js +285 -11
  38. package/dist/config.js.map +1 -1
  39. package/dist/conformance.d.ts +31 -0
  40. package/dist/conformance.d.ts.map +1 -0
  41. package/dist/conformance.js +393 -0
  42. package/dist/conformance.js.map +1 -0
  43. package/dist/deps.d.ts +6 -39
  44. package/dist/deps.d.ts.map +1 -1
  45. package/dist/deps.js +4 -68
  46. package/dist/deps.js.map +1 -1
  47. package/dist/errors.d.ts +20 -0
  48. package/dist/errors.d.ts.map +1 -0
  49. package/dist/errors.js +25 -0
  50. package/dist/errors.js.map +1 -0
  51. package/dist/flag-allowlists.d.ts +53 -0
  52. package/dist/flag-allowlists.d.ts.map +1 -0
  53. package/dist/flag-allowlists.js +157 -0
  54. package/dist/flag-allowlists.js.map +1 -0
  55. package/dist/flags.d.ts +45 -0
  56. package/dist/flags.d.ts.map +1 -1
  57. package/dist/flags.js +117 -1
  58. package/dist/flags.js.map +1 -1
  59. package/dist/jsonout.d.ts +37 -0
  60. package/dist/jsonout.d.ts.map +1 -0
  61. package/dist/jsonout.js +68 -0
  62. package/dist/jsonout.js.map +1 -0
  63. package/dist/kind.d.ts +61 -0
  64. package/dist/kind.d.ts.map +1 -0
  65. package/dist/kind.js +111 -0
  66. package/dist/kind.js.map +1 -0
  67. package/dist/main.js +699 -4736
  68. package/dist/main.js.map +1 -1
  69. package/dist/mintpage.d.ts +17 -2
  70. package/dist/mintpage.d.ts.map +1 -1
  71. package/dist/mintpage.js +241 -54
  72. package/dist/mintpage.js.map +1 -1
  73. package/dist/output.d.ts +179 -0
  74. package/dist/output.d.ts.map +1 -0
  75. package/dist/output.js +756 -0
  76. package/dist/output.js.map +1 -0
  77. package/dist/ownerops.d.ts +302 -51
  78. package/dist/ownerops.d.ts.map +1 -1
  79. package/dist/ownerops.js +1780 -357
  80. package/dist/ownerops.js.map +1 -1
  81. package/dist/preview.d.ts +81 -0
  82. package/dist/preview.d.ts.map +1 -0
  83. package/dist/preview.js +535 -0
  84. package/dist/preview.js.map +1 -0
  85. package/dist/prompt.d.ts +17 -0
  86. package/dist/prompt.d.ts.map +1 -0
  87. package/dist/prompt.js +19 -0
  88. package/dist/prompt.js.map +1 -0
  89. package/dist/provision.d.ts.map +1 -1
  90. package/dist/provision.js +16 -8
  91. package/dist/provision.js.map +1 -1
  92. package/dist/remote.d.ts +153 -52
  93. package/dist/remote.d.ts.map +1 -1
  94. package/dist/remote.js +406 -46
  95. package/dist/remote.js.map +1 -1
  96. package/dist/riskgate.d.ts +58 -0
  97. package/dist/riskgate.d.ts.map +1 -0
  98. package/dist/riskgate.js +212 -0
  99. package/dist/riskgate.js.map +1 -0
  100. package/dist/scaffold.d.ts +10 -0
  101. package/dist/scaffold.d.ts.map +1 -0
  102. package/dist/scaffold.js +52 -0
  103. package/dist/scaffold.js.map +1 -0
  104. package/dist/schema.d.ts +36 -1
  105. package/dist/schema.d.ts.map +1 -1
  106. package/dist/schema.js +121 -26
  107. package/dist/schema.js.map +1 -1
  108. package/dist/script-chunks.d.ts +8 -0
  109. package/dist/script-chunks.d.ts.map +1 -0
  110. package/dist/script-chunks.js +35 -0
  111. package/dist/script-chunks.js.map +1 -0
  112. package/dist/served.d.ts +30 -0
  113. package/dist/served.d.ts.map +1 -0
  114. package/dist/served.js +112 -0
  115. package/dist/served.js.map +1 -0
  116. package/dist/signer.d.ts +13 -0
  117. package/dist/signer.d.ts.map +1 -1
  118. package/dist/signer.js +84 -15
  119. package/dist/signer.js.map +1 -1
  120. package/dist/update-check.d.ts +83 -4
  121. package/dist/update-check.d.ts.map +1 -1
  122. package/dist/update-check.js +140 -19
  123. package/dist/update-check.js.map +1 -1
  124. package/package.json +10 -6
  125. package/skill/SKILL.md +350 -150
  126. package/skill/reference/code-projects.md +183 -26
  127. package/skill/reference/creator-token.md +99 -0
  128. package/skill/reference/decisions.md +174 -0
  129. package/skill/reference/hosting.md +63 -19
  130. package/skill/reference/operating.md +116 -12
  131. package/skill/reference/setup.md +55 -6
  132. package/skill/reference/troubleshooting.md +42 -5
  133. package/dist/inspect.d.ts +0 -48
  134. package/dist/inspect.d.ts.map +0 -1
  135. package/dist/inspect.js +0 -184
  136. package/dist/inspect.js.map +0 -1
  137. package/dist/migrate.d.ts +0 -65
  138. package/dist/migrate.d.ts.map +0 -1
  139. package/dist/migrate.js +0 -180
  140. package/dist/migrate.js.map +0 -1
  141. package/dist/onchain-uri.d.ts +0 -97
  142. package/dist/onchain-uri.d.ts.map +0 -1
  143. package/dist/onchain-uri.js +0 -243
  144. package/dist/onchain-uri.js.map +0 -1
  145. package/dist/upload.d.ts +0 -28
  146. package/dist/upload.d.ts.map +0 -1
  147. package/dist/upload.js +0 -41
  148. package/dist/upload.js.map +0 -1
package/dist/inspect.js DELETED
@@ -1,184 +0,0 @@
1
- /**
2
- * `abx inspect <script.js>` — static analysis of a generative script, BEFORE picking a lane.
3
- *
4
- * The membrane fix behind this: an agent (or creator) should DERIVE the deployment lane from what
5
- * the script actually needs — are there traits? are they reproducible on-chain? how big is the
6
- * assembled document (does a single `tokenURI` eth_call even fit)? — instead of guessing "fully
7
- * on-chain!" and walking it back. This module is the pure analysis; `cmdInspect` formats it.
8
- *
9
- * Static only — it never executes the script (that's the resolver/runner's job, and executing
10
- * untrusted art in the CLI would be a footgun). Everything here is regex/heuristic over the source.
11
- */
12
- /** Approx bytes a known on-chain dependency adds to the ASSEMBLED document (gzip'd + base64'd, as it
13
- * rides in the inline data-URI). Measured from real drops; used only for the RPC-size estimate. */
14
- const KNOWN_DEP_DOC_BYTES = {
15
- 'p5@1.0.0': 200_000, // p5 1.0.0 (~623KB raw) rides ~200KB gzip+base64 in the document
16
- };
17
- /** The on-chain runtime the generator always inlines (abx.js + the gunzip bootstrap), base64'd. */
18
- const RUNTIME_DOC_BYTES = 13_000;
19
- /** A single `eth_call` returning `tokenURI` comfortably carries this much document on a default node
20
- * (geth's 50M gas cap; memory expansion is ~quadratic). Past it, marketplaces that call `tokenURI`
21
- * once may time out — prefer the generator's piecewise getters, directory mode, or a CDN dep. */
22
- const SINGLE_CALL_DOC_CEILING = 1_500_000;
23
- /** PostParam keys the script READS from tokenData — the palette-style customization inputs. A deploy
24
- * that omits these from `--schema` silently drops them (the render sees `undefined` → its default),
25
- * which is exactly how a real session "forgot" the palette it had itself identified. Heuristic (the
26
- * script isn't executed): find identifiers aliased to `abx.tokenData`, then their property reads;
27
- * plus direct `abx.tokenData.key`, destructuring, and `tokenData['key']`. `seed` is intrinsic, not a
28
- * PostParam, so it's excluded. Advisory — over- or under-detection is a hint, never a hard gate. */
29
- function paramKeys(source) {
30
- const keys = new Set();
31
- const add = (k) => { if (k && k !== 'seed')
32
- keys.add(k); };
33
- // Identifiers aliased to the token-data object — either `abx.tokenData` (via abx.js) or the raw
34
- // injected global `window.abxTokenData` (e.g. `var td = (window.abx && abx.tokenData) || {}`).
35
- const aliases = new Set();
36
- // The `(?!…\.[A-Za-z_$])` guard: only alias when the RHS is the tokenData OBJECT, not a PROPERTY of
37
- // it — `const seed = abx.tokenData.seed` aliases `seed` to a scalar, so its method calls
38
- // (`seed.startsWith(…)`) must NOT be read as params (the false-positive that flagged startsWith/slice).
39
- const aliasRe = /\b([A-Za-z_$][\w$]*)\s*=\s*[^;\n]*(?:abx\s*\??\s*\.\s*tokenData|window\s*\??\s*\.\s*abxTokenData)(?!\s*\??\s*\.\s*[A-Za-z_$])/g;
40
- let m;
41
- while ((m = aliasRe.exec(source)) !== null)
42
- aliases.add(m[1]);
43
- for (const a of aliases) {
44
- // `(?!\s*\()` excludes method CALLS (`td.slice(…)`) — a param read is a bare property, never a call.
45
- const dotRe = new RegExp(`\\b${a.replace(/[$]/g, '\\$')}\\s*\\??\\s*\\.\\s*([A-Za-z_$][\\w$]*)(?!\\s*\\()`, 'g');
46
- let d;
47
- while ((d = dotRe.exec(source)) !== null)
48
- add(d[1]);
49
- }
50
- // Direct `abx.tokenData.key` and `abx.tokenData['key']`.
51
- const directRe = /abx\s*\??\s*\.\s*tokenData\s*\??\s*(?:\.\s*([A-Za-z_$][\w$]*)|\[\s*['"]([^'"]+)['"]\s*\])/g;
52
- while ((m = directRe.exec(source)) !== null)
53
- add(m[1] ?? m[2]);
54
- // Destructuring: `const { palette, foo } = abx.tokenData` (or an alias).
55
- const destrRe = /(?:const|let|var)\s*\{([^}]*)\}\s*=\s*[^;\n]*(?:abx\s*\.\s*tokenData|\b(?:tokenData|td)\b)/g;
56
- while ((m = destrRe.exec(source)) !== null) {
57
- for (const part of m[1].split(','))
58
- add(part.split(':')[0].trim().replace(/\.\.\./, '') || undefined);
59
- }
60
- return [...keys];
61
- }
62
- /** Extract the key names from the first `abx.traits({ ... })` object literal (flat objects only). */
63
- function traitKeys(source) {
64
- const m = source.match(/abx\s*\??\s*\.\s*traits\s*\(\s*\{([^}]*)\}/);
65
- if (!m)
66
- return [];
67
- const keys = [];
68
- // A key sits at the start of the object or right after a comma (so a ternary VALUE like
69
- // `? 'Sparse' : 'Dense'` — a `:` not preceded by `,`/`{` — is never mistaken for a key). Allow
70
- // leading whitespace after `^` so the FIRST key (preceded only by the newline after `{`) is caught.
71
- // A key is EITHER a quoted string (arbitrary content — `'Plant Count'`, a spaced trait_type a
72
- // marketplace shows) OR a bare identifier; a bare-identifier-only match silently dropped quoted
73
- // keys, and "believe inspect" then sent authors chasing a phantom missing trait.
74
- const re = /(?:^\s*|[,{]\s*)(?:(['"])([^'"]+)\1|([A-Za-z_$][\w$]*))\s*:/g;
75
- let k;
76
- while ((k = re.exec(m[1])) !== null)
77
- keys.push(k[2] ?? k[3]);
78
- return [...new Set(keys)];
79
- }
80
- export function analyzeScript(source, declaredDeps = []) {
81
- const bytes = new TextEncoder().encode(source).length;
82
- const keys = traitKeys(source);
83
- const usesMathRandom = /Math\s*\.\s*random\s*\(/.test(source);
84
- // p5's bare random(...) — a `random(` NOT preceded by `.` or a word char (so not Math.random / obj.random)
85
- const usesBareRandom = /(^|[^.\w])random\s*\(/.test(source);
86
- const seeded = /\brandomSeed\s*\(/.test(source);
87
- const usesNoise = /\bnoise\s*\(/.test(source);
88
- const looksP5 = /\bcreateCanvas\s*\(|function\s+setup\s*\(|function\s+draw\s*\(|\bp5\b/.test(source);
89
- const depHints = [];
90
- if (looksP5)
91
- depHints.push('p5');
92
- if (/\bTHREE\b/.test(source))
93
- depHints.push('three');
94
- if (/\bTone\b/.test(source))
95
- depHints.push('tone');
96
- // The abx.js runtime data contract — does the script read state + report traits the ONE way the
97
- // toolkit injects/captures them? A near-miss global deploys fine but is silently broken.
98
- // `\??\s*\.` tolerates optional chaining (`abx?.tokenData`) — a common, correct way to read it.
99
- const readsTokenData = /abx\s*\??\s*\.\s*tokenData\b/.test(source) || /window\s*\??\s*\.\s*abxTokenData\b/.test(source);
100
- const reportsTraits = /abx\s*\??\s*\.\s*traits\s*\(/.test(source);
101
- let wrongGlobal = null;
102
- if (!readsTokenData) {
103
- if (/window\s*\.\s*tokenTraits\b/.test(source))
104
- wrongGlobal = 'window.tokenTraits — traits are reported by CALLING abx.traits({…}), never by writing a global';
105
- else if (/window\s*\.\s*tokenData\b/.test(source))
106
- wrongGlobal = 'window.tokenData — abx injects window.abxTokenData (read it via abx.tokenData), not window.tokenData';
107
- else if (/\btokenData\b/.test(source))
108
- wrongGlobal = 'a bare `tokenData` — read abx.tokenData (via abx.js) or the raw window.abxTokenData global';
109
- }
110
- // Trait-reproducibility rubric (see docs/research/onchain-traits-feasibility.md).
111
- let verdict;
112
- let reason;
113
- if (keys.length === 0) {
114
- verdict = 'none';
115
- reason = 'no abx.traits({…}) call → NO marketplace traits on ANY lane. A resolver captures the keys you pass to abx.traits(); it does not invent traits from internal variables or a global. Call abx.traits({…}) in the sketch if you want filterable traits.';
116
- }
117
- else if (usesMathRandom && !seeded) {
118
- verdict = 'infeasible';
119
- reason = 'traits derive from Math.random() (unseeded) — non-deterministic, reproducible nowhere. Serve attributes via a resolver, or ship without marketplace traits.';
120
- }
121
- else if (seeded && looksP5) {
122
- verdict = 'exact-likely';
123
- reason = 'seeded p5 random() is a documented LCG — integer floor/threshold/select traits port EXACTLY to Solidity. Confirm no trait keys off a raw float value. Wire with --attributes-renderer (see docs/research/onchain-traits-feasibility.md).';
124
- }
125
- else if (seeded) {
126
- verdict = 'careful';
127
- reason = "seeded, but the PRNG isn't identified as p5 — reproducible on-chain if you port that generator + the exact call order.";
128
- }
129
- else if (usesBareRandom) {
130
- verdict = 'unknown';
131
- reason = 'traits present and random() is used, but no randomSeed() was found — check the art is deterministic before attempting on-chain traits.';
132
- }
133
- else {
134
- verdict = 'exact-likely';
135
- reason = 'traits look derived from the seed/params directly (no PRNG) — reproducible on-chain via an attributes field-renderer.';
136
- }
137
- const deps = declaredDeps;
138
- let unknownDepSizes = false;
139
- let depDocBytes = 0;
140
- for (const d of deps) {
141
- if (d in KNOWN_DEP_DOC_BYTES)
142
- depDocBytes += KNOWN_DEP_DOC_BYTES[d];
143
- else
144
- unknownDepSizes = true;
145
- }
146
- const estBytes = bytes + RUNTIME_DOC_BYTES + depDocBytes;
147
- return {
148
- bytes,
149
- estChunks: Math.max(1, Math.ceil(bytes / 22_000)),
150
- traits: { present: keys.length > 0, keys },
151
- paramHints: paramKeys(source),
152
- prng: { seeded, usesBareRandom, usesMathRandom, usesNoise },
153
- depHints,
154
- looksP5,
155
- feasibility: { verdict, reason },
156
- doc: { estBytes, deps, fitsSingleCall: estBytes <= SINGLE_CALL_DOC_CEILING && !unknownDepSizes, unknownDepSizes },
157
- runtime: { readsTokenData, reportsTraits, wrongGlobal },
158
- };
159
- }
160
- /** A one-line lane recommendation derived from the analysis (the decision-tree output). */
161
- export function recommendLane(a) {
162
- const bigDoc = !a.doc.fitsSingleCall && !a.doc.unknownDepSizes;
163
- if (bigDoc) {
164
- return 'DIRECTORY mode (--code-dir) or a CDN dependency — the assembled document is too large for a single tokenURI eth_call to be reliable.';
165
- }
166
- if (a.feasibility.verdict === 'infeasible') {
167
- return 'RESOLVER lane (--public-base-url) if marketplace traits matter (a server serves the JS-derived attributes), OR --onchain-uri and accept no marketplace traits (the tokenURI + animation are still fully on-chain).';
168
- }
169
- if (a.feasibility.verdict === 'exact-likely' || a.feasibility.verdict === 'none') {
170
- const dep = a.depHints.length ? ` --dep ${a.depHints[0]}@<version>` : '';
171
- const docKb = Math.round(a.doc.estBytes / 1000);
172
- // Owner call (real-world experience): for a generative drop meant to sell, LEAD with the off-chain
173
- // resolver — maneuverable over time + marketplaces fetch a SMALL tokenURI reliably. Fully-on-chain
174
- // is the durability-max alternative, but its ~docKb tokenURI (whole doc per call) strains some
175
- // marketplace/indexer reads. Traits are NOT a free flag on the on-chain lane (deployed renderer).
176
- const traits = a.traits.present
177
- ? ` Traits (${a.traits.keys.join(', ')}): the resolver serves them from the render with no Solidity; on the on-chain lane they need a DEPLOYED --attributes-renderer (fork SeedTraitsRenderer.sol) or they're omitted.`
178
- : ``;
179
- return (`RECOMMENDED for a drop you'll sell — OFF-CHAIN RESOLVER (--public-base-url + an effects runner): maneuverable (metadata/serving can evolve without on-chain surgery) and marketplaces fetch a SMALL tokenURI reliably.${traits}\n` +
180
- ` ALTERNATIVE — FULLY ON-CHAIN (--onchain-uri${dep} --image-base <bucket>): maximal durability / no server, but the tokenURI carries the whole ~${docKb}KB document per call (some marketplace + indexer reads choke on a doc this big), stills are MANUAL, and later changes are on-chain re-points. Pick it when permanence + zero-infra outweigh maneuverability.`);
181
- }
182
- return (`RECOMMENDED — an OFF-CHAIN RESOLVER (--public-base-url): maneuverable, and it serves traits from the render regardless of the PRNG. --onchain-uri also works for tokenURI + animation, but first verify the script is deterministic (see the feasibility note), and note the large-tokenURI marketplace-read tradeoff; on that lane traits need a DEPLOYED --attributes-renderer or are omitted.`);
183
- }
184
- //# sourceMappingURL=inspect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspect.js","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;oGACoG;AACpG,MAAM,mBAAmB,GAA2B;IAClD,UAAU,EAAE,OAAO,EAAE,iEAAiE;CACvF,CAAC;AAEF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AAG,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;QAChD,mGAAmG;QACnG,mGAAmG;QACnG,+FAA+F;QAC/F,kGAAkG;QAClG,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO;YAC7B,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,iLAAiL;YACvN,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,CACL,yNAAyN,MAAM,IAAI;YACnO,gDAAgD,GAAG,gGAAgG,KAAK,8MAA8M,CACvW,CAAC;IACJ,CAAC;IACD,OAAO,CACL,kYAAkY,CACnY,CAAC;AACJ,CAAC"}
package/dist/migrate.d.ts DELETED
@@ -1,65 +0,0 @@
1
- import type { OpenSeaAttribute, ProjectState } from '@artblocks/abx-sdk';
2
- import { type StorageBackend } from '@artblocks/abx-storage';
3
- /** An image that lives ONLY on the source host (committed by hash, never pinned to a durable
4
- * backend) — there's no portable URL to copy, so its bytes must be re-pinned before cutover. */
5
- export interface NodeCustodyImage {
6
- tokenId: string;
7
- /** On-chain content hash (the `keccak256`/`sha256` commitment) — what we verify re-pinned bytes against. */
8
- hash: string;
9
- /** The source's served image URL — the old host's own `/…/image` route; where we fetch the bytes. */
10
- imageUrl: string;
11
- }
12
- /** The off-chain state to bridge to the destination resolver + what couldn't be carried cleanly. */
13
- export interface MigrationPlan {
14
- description?: string;
15
- externalUrl?: string;
16
- attributes?: OpenSeaAttribute[];
17
- /** `{ "0x<keccak>": "https://gw/ipfs/<cid>" }` — durable image locators recovered from the source. */
18
- contentLocators: Record<string, string>;
19
- /** Images served only by the source host (no durable locator) — re-pin before cutover. */
20
- nodeCustody: NodeCustodyImage[];
21
- /** Tokens whose served JSON we read to build this plan. */
22
- tokensRead: number;
23
- }
24
- export declare const tokenApiUrl: (base: string, chainId: number, addr: string, id: string) => string;
25
- export declare const contractApiUrl: (base: string, chainId: number, addr: string) => string;
26
- /**
27
- * Build the migration plan by reading the SOURCE resolver's public API, using the locally
28
- * reconstructed on-chain state (`local`) for the hash KEYS the served JSON doesn't expose.
29
- */
30
- export declare function buildMigrationPlan(sourceBase: string, chainId: number, local: ProjectState): Promise<MigrationPlan>;
31
- /**
32
- * Re-pin node-custody images to a DURABLE backend so the destination never depends on the
33
- * (soon-to-be-decommissioned) source host. For each image: fetch the bytes from the source,
34
- * **verify** them against the on-chain hash (trustless — we trust the chain, not the old node),
35
- * then `put` them to the destination operator's own backend and read back a portable locator.
36
- *
37
- * If the configured backend isn't durable (no `locator` — fs/cloud serve only through their own
38
- * node, so re-pinning there just moves the single-host dependency), we re-pin NOTHING and report
39
- * every image as `needsDurableBackend`: the right move is to configure IPFS/Arweave and re-run,
40
- * never to bridge a URL that points back at the dying host.
41
- */
42
- export interface RepinResult {
43
- /** hash → new durable locator, ready to bridge to the destination. */
44
- repinned: Record<string, string>;
45
- /** Re-pinned token ids (for reporting). */
46
- repinnedTokens: string[];
47
- /** Bytes fetched but their hash didn't match the on-chain commitment — NOT trusted, NOT pinned. */
48
- mismatched: NodeCustodyImage[];
49
- /** Couldn't fetch the bytes from the source (host down, 404). */
50
- unreachable: NodeCustodyImage[];
51
- /** Skipped because no durable backend is configured — these need IPFS/Arweave + a re-run. */
52
- needsDurableBackend: NodeCustodyImage[];
53
- }
54
- export declare function repinNodeCustody(images: NodeCustodyImage[], backend: StorageBackend): Promise<RepinResult>;
55
- /** A parity check after bridging: does the destination now serve the same image/description/traits? */
56
- export interface ParityResult {
57
- tokenId: string;
58
- imageMatch: boolean;
59
- descriptionMatch: boolean;
60
- attributesMatch: boolean;
61
- sourceImage?: string;
62
- destImage?: string;
63
- }
64
- export declare function verifyParity(sourceBase: string, destBase: string, chainId: number, addr: string, tokenId: string): Promise<ParityResult>;
65
- //# sourceMappingURL=migrate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AA4BA,OAAO,KA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AW,EAAE,gBAAgB,EAAE,CAAC;IAChC,6FAA6F;IAC7F,mBAAmB,EAAE,gBAAgB,EAAE,CAAC;CACzC;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAyChH;AAED,uGAAuG;AACvG,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,CAAC,CAavB"}
package/dist/migrate.js DELETED
@@ -1,180 +0,0 @@
1
- /**
2
- * Migrate a contract's OFF-CHAIN operator state from one resolver to another — the
3
- * toolkit's portability guarantee, made operational.
4
- *
5
- * Everything on-chain a new resolver gets for free: it replays the event spine from any
6
- * RPC (that's what the admin control plane's `POST /admin/projects` already does). The only
7
- * thing it can't reconstruct from chain is the operator's off-chain state — the four fields
8
- * on the registration row: `description`, `externalUrl`, off-chain `attributes`, and the
9
- * `keccak → gateway-URL` content locators.
10
- *
11
- * The key property: each resolver's served JSON is **self-describing** via `abx_provenance`,
12
- * which makes it self-MIGRATING. By reading the SOURCE resolver's public token/contract API
13
- * (plus the chain, for the locator KEYS — the on-chain hashes, which aren't in any served
14
- * JSON), we reconstruct exactly that off-chain state and bridge it to the destination through
15
- * the same control plane. The two resolvers never talk to each other; the operator's CLI
16
- * orchestrates from public endpoints alone — no shared database, no private channel.
17
- *
18
- * Two cases this can't paper over, both surfaced honestly:
19
- * - **Stitched attributes** — an off-chain trait shadowed by an on-chain one of the same
20
- * `trait_type` was never *served*, so it can't be recovered. We migrate the off-chain
21
- * remainder (served traits whose `trait_type` has no on-chain entry), which is byte-exact
22
- * for everything that was ever visible.
23
- * - **Node-custody images** — an image committed by hash but never pinned to a durable
24
- * backend is served from the source node's own `/image` route. There's no portable URL to
25
- * copy; the bytes live only on the old host. We list these so the operator re-pins them
26
- * (fetch → verify against the on-chain hash → re-upload) BEFORE tearing the old host down.
27
- */
28
- import { fieldOf, inlineText, normalizeAttributes, METADATA_REPRESENTATION as R } from '@artblocks/abx-sdk';
29
- import { hashContent } from '@artblocks/abx-storage';
30
- const trim = (base) => base.replace(/\/+$/, '');
31
- export const tokenApiUrl = (base, chainId, addr, id) => `${trim(base)}/t/${chainId}/${addr.toLowerCase()}/${id}`;
32
- export const contractApiUrl = (base, chainId, addr) => `${trim(base)}/c/${chainId}/${addr.toLowerCase()}`;
33
- async function getJson(url) {
34
- let resp;
35
- try {
36
- resp = await fetch(url);
37
- }
38
- catch (err) {
39
- throw new Error(`couldn't reach the source resolver at ${url}: ${err.message}`);
40
- }
41
- if (resp.status === 404)
42
- return null; // unknown project / unminted token — not fatal per-token
43
- if (!resp.ok)
44
- throw new Error(`source resolver ${url} → ${resp.status} ${resp.statusText}`);
45
- return (await resp.json());
46
- }
47
- const provOf = (json, field) => json?.abx_provenance?.find((p) => p.field === field);
48
- /** Off-chain attribute trait_types present on-chain (case-insensitive) — these are NOT migrated as
49
- * off-chain (the destination re-derives them from chain and they win the stitch). */
50
- function onChainTraitTypes(fields) {
51
- const entry = fieldOf(fields, 'attributes');
52
- if (!entry || entry.representation !== R.inline)
53
- return new Set();
54
- try {
55
- const parsed = JSON.parse(inlineText(entry));
56
- if (!Array.isArray(parsed))
57
- return new Set();
58
- return new Set(parsed.map((a) => String(a.trait_type).toLowerCase()));
59
- }
60
- catch {
61
- return new Set();
62
- }
63
- }
64
- /**
65
- * Build the migration plan by reading the SOURCE resolver's public API, using the locally
66
- * reconstructed on-chain state (`local`) for the hash KEYS the served JSON doesn't expose.
67
- */
68
- export async function buildMigrationPlan(sourceBase, chainId, local) {
69
- const addr = local.address;
70
- const plan = { contentLocators: {}, nodeCustody: [], tokensRead: 0 };
71
- // ── operator-level fields (one registration row applies across the collection) ──
72
- // Prefer the contract API; fall back to token #0. Take a value only when its provenance
73
- // says it's off-chain (a plain operator value) — on-chain values are re-derived by replay.
74
- const contractJson = await getJson(contractApiUrl(sourceBase, chainId, addr));
75
- const firstToken = local.tokens.find((t) => t.minted) ?? local.tokens[0];
76
- const tokenZeroJson = firstToken
77
- ? await getJson(tokenApiUrl(sourceBase, chainId, addr, firstToken.tokenId))
78
- : null;
79
- const offChainText = (json, field, value) => (value != null && provOf(json, field)?.status === 'off-chain' ? value : undefined);
80
- plan.description =
81
- offChainText(tokenZeroJson, 'description', tokenZeroJson?.description) ??
82
- offChainText(contractJson, 'description', contractJson?.description);
83
- plan.externalUrl =
84
- offChainText(tokenZeroJson, 'external_url', tokenZeroJson?.external_url) ??
85
- offChainText(contractJson, 'external_link', contractJson?.external_link);
86
- // attributes: the off-chain remainder = served traits whose trait_type has NO on-chain entry.
87
- if (tokenZeroJson?.attributes?.length && provOf(tokenZeroJson, 'attributes')?.status !== 'on-chain') {
88
- const onChain = onChainTraitTypes(firstToken?.fields ?? []);
89
- const offChain = tokenZeroJson.attributes.filter((a) => !onChain.has(String(a.trait_type).toLowerCase()));
90
- if (offChain.length)
91
- plan.attributes = normalizeAttributes(offChain);
92
- }
93
- // ── per-token content locators (image bytes that live off-chain by hash) ──
94
- for (const token of local.tokens) {
95
- const image = fieldOf(token.fields, 'image');
96
- if (!image || (image.representation !== R.keccak256 && image.representation !== R.sha256)) {
97
- continue; // on-chain content or an on-chain locator — the destination derives it from chain
98
- }
99
- const json = await getJson(tokenApiUrl(sourceBase, chainId, addr, token.tokenId));
100
- if (!json)
101
- continue; // unminted / not served
102
- plan.tokensRead++;
103
- const prov = provOf(json, 'image');
104
- const hash = image.value.toLowerCase();
105
- // A durable locator: the resolver served a portable URL (ipfs/arweave/url source). Node-custody:
106
- // the source served the bytes from its own host (source === the hash kind), so there's nothing to copy.
107
- if (json.image && prov && prov.onChain === false && (prov.source === 'ipfs' || prov.source === 'arweave' || prov.source === 'url')) {
108
- plan.contentLocators[hash] = json.image;
109
- }
110
- else if (json.image) {
111
- plan.nodeCustody.push({ tokenId: token.tokenId, hash, imageUrl: json.image });
112
- }
113
- }
114
- return plan;
115
- }
116
- export async function repinNodeCustody(images, backend) {
117
- const result = { repinned: {}, repinnedTokens: [], mismatched: [], unreachable: [], needsDurableBackend: [] };
118
- if (!images.length)
119
- return result;
120
- // A backend is "durable" for migration iff it can hand back a node-independent locator.
121
- if (!backend.locator) {
122
- result.needsDurableBackend = [...images];
123
- return result;
124
- }
125
- for (const img of images) {
126
- let bytes;
127
- let contentType;
128
- try {
129
- const resp = await fetch(img.imageUrl);
130
- if (!resp.ok) {
131
- result.unreachable.push(img);
132
- continue;
133
- }
134
- bytes = new Uint8Array(await resp.arrayBuffer());
135
- contentType = resp.headers.get('content-type') ?? 'application/octet-stream';
136
- }
137
- catch {
138
- result.unreachable.push(img);
139
- continue;
140
- }
141
- // Trustless: re-hash the fetched bytes and compare to the ON-CHAIN commitment.
142
- if (hashContent(bytes).toLowerCase() !== img.hash.toLowerCase()) {
143
- result.mismatched.push(img);
144
- continue;
145
- }
146
- await backend.put(img.hash, { bytes, contentType });
147
- const loc = await backend.locator(img.hash);
148
- if (loc) {
149
- result.repinned[img.hash.toLowerCase()] = loc;
150
- result.repinnedTokens.push(img.tokenId);
151
- }
152
- else {
153
- // Stored, but the backend still can't produce a portable locator — treat as not durable.
154
- result.needsDurableBackend.push(img);
155
- }
156
- }
157
- return result;
158
- }
159
- const sameAttrs = (a = [], b = []) => {
160
- const key = (xs) => xs
161
- .map((x) => `${String(x.trait_type).toLowerCase()}=${String(x.value)}`)
162
- .sort()
163
- .join('|');
164
- return key(a) === key(b);
165
- };
166
- export async function verifyParity(sourceBase, destBase, chainId, addr, tokenId) {
167
- const [src, dst] = await Promise.all([
168
- getJson(tokenApiUrl(sourceBase, chainId, addr, tokenId)),
169
- getJson(tokenApiUrl(destBase, chainId, addr, tokenId)),
170
- ]);
171
- return {
172
- tokenId,
173
- imageMatch: !!src && !!dst && src.image === dst.image,
174
- descriptionMatch: (src?.description ?? null) === (dst?.description ?? null),
175
- attributesMatch: sameAttrs(src?.attributes, dst?.attributes),
176
- sourceImage: src?.image,
177
- destImage: dst?.image,
178
- };
179
- }
180
- //# sourceMappingURL=migrate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,uBAAuB,IAAI,CAAC,EAAC,MAAM,oBAAoB,CAAC;AAE1G,OAAO,EAAC,WAAW,EAAsB,MAAM,wBAAwB,CAAC;AAmDxE,MAAM,IAAI,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,IAAY,EAAE,EAAU,EAAU,EAAE,CAC7F,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,IAAY,EAAU,EAAE,CACpF,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;AAErD,KAAK,UAAU,OAAO,CAAI,GAAW;IACnC,IAAI,IAAc,CAAC;IACnB,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,KAAK,CAAC,GAA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0,0 @@
1
- import { type Address, type GeneratorReadClient, type GeneratorStatus, type Hex, type ParsedDependencyRef, type ProjectState } from '@artblocks/abx-sdk';
2
- import type { DepCheck } from './deps.js';
3
- /** The self-referential key: the CSV lists it too (the resolver's tokenData carries every
4
- * evented param — including `params.keys` itself — so the generator must list it to stay
5
- * byte-aligned; inputsHash parity is load-bearing). */
6
- export declare const PARAMS_KEYS = "params.keys";
7
- /** ≤ this many chars rides as a literal readable-ASCII bytes32; longer takes the data path. */
8
- export declare const PARAMS_KEYS_LITERAL_MAX = 31;
9
- /**
10
- * Compose the `params.keys` CSV: every param key the deploy writes ∪ the `--schema` keys ∪
11
- * `params.keys` itself — deduped, sorted lexicographically, comma-joined. Sorted because the
12
- * canonical tokenData serialization sorts keys; deterministic composition keeps the value
13
- * reproducible from the same flags.
14
- */
15
- export declare function composeParamsKeys(writtenParamKeys: string[], schemaKeys: string[]): string;
16
- /** Whether a CSV fits the literal bytes32 lane (printable ASCII, ≤ 31 bytes). */
17
- export declare function paramsKeysIsLiteral(csv: string): boolean;
18
- /** The `params.keys` write leg: `setContractParam` (literal bytes32) when the CSV fits,
19
- * else `setContractParamData` (one blob; hash evented — the generator reads it back whole). */
20
- export declare function paramsKeysCall(csv: string): {
21
- call: Hex;
22
- encoding: 'literal' | 'data';
23
- };
24
- /**
25
- * The `--onchain-uri` legs of the setup multicall, in order:
26
- * 1. collection-scope `animation_url` field → representation `renderer`,
27
- * value `abi.encode(generator)` (the canonical generator computes the live view on-chain);
28
- * 2. the `params.keys` contract param (the generator's tokenData enumeration seam);
29
- * 3. `setTokenURIRenderer(metadataRenderer)` — tokenURI resolves ON-CHAIN from here on;
30
- * 4. `setContractURIRenderer(metadataRenderer)` — contractURI too (parity with the 1/1 lane).
31
- * Placed BEFORE the mint legs so every token is born with the on-chain lane fully configured.
32
- */
33
- export declare function onchainUriSetupCalls(args: {
34
- generator: Address;
35
- metadataRenderer: Address;
36
- paramsKeys: string;
37
- }): {
38
- calls: Hex[];
39
- paramsKeysEncoding: 'literal' | 'data';
40
- };
41
- /** What the deploy can honestly promise about the generator's template branch, derived from
42
- * the selection-time dependency report (never a new RPC): chain-complete iff every registry
43
- * dep has proven ON-CHAIN bytes (OnChain refs read their data contract directly, so they
44
- * count as on-chain; `abx verify` is the from-chain confirmation either way). */
45
- export declare function expectedChainComplete(deps: ParsedDependencyRef[], checks: DepCheck[]): {
46
- expected: boolean | null;
47
- detail: string;
48
- };
49
- /** The generator this project's on-chain lane actually uses: the collection `animation_url`
50
- * field's `renderer` value when set (that address is what the metadata renderer staticcalls),
51
- * else the chain's canonical generator. Null when neither exists. */
52
- export declare function generatorFor(state: ProjectState, override?: string): Address | null;
53
- /** Whether verify should run the on-chain-URI report: the tokenURIRenderer toggle is on, or
54
- * the collection `animation` field points at a field renderer (the generator). */
55
- export declare function hasOnChainUriLane(state: ProjectState): boolean;
56
- export interface TokenUriProbe {
57
- tokenId: string;
58
- /** tokenURI(id) is a `data:application/json;base64,` URI (resolves on-chain, any RPC). */
59
- onChainJson: boolean;
60
- uriPrefix: string;
61
- animation: {
62
- form: 'data-html';
63
- bytes: number;
64
- marker: string | null;
65
- } | {
66
- form: 'url';
67
- url: string;
68
- } | {
69
- form: 'data-other';
70
- prefix: string;
71
- } | {
72
- form: 'missing';
73
- };
74
- }
75
- export interface OnChainUriReport {
76
- generator: Address;
77
- status: GeneratorStatus;
78
- /** Null when no token is minted yet (tokenURI would revert). */
79
- probe: TokenUriProbe | null;
80
- }
81
- /**
82
- * The verify-time on-chain-URI report: `generator.onChainStatus(token)` (branch ·
83
- * chain-completeness · unresolved refs · URL budget) plus a `tokenURI` probe of the lowest
84
- * minted token — decoded, with the `animation_url` form checked against the branch.
85
- */
86
- export declare function onChainUriReport(client: GeneratorReadClient, state: ProjectState, generatorOverride?: string): Promise<OnChainUriReport>;
87
- /**
88
- * After a param write: if the project's `params.keys` CSV exists but doesn't list the
89
- * configured key, the on-chain generator's tokenData will silently omit it (breaking byte
90
- * parity with the resolver's). Returns the fixed CSV to suggest, or null when no nudge is
91
- * warranted (no CSV = not on the on-chain lane; already listed = fine).
92
- */
93
- export declare function paramsKeysNudge(existingCsv: string | null, configuredKey: string): string | null;
94
- /** Read the project's `params.keys` contract param from chain (literal or data-backed);
95
- * null when unset. Best-effort — callers must treat a throw as "no nudge". */
96
- export declare function readParamsKeys(client: GeneratorReadClient, contract: Address): Promise<string | null>;
97
- //# sourceMappingURL=onchain-uri.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onchain-uri.d.ts","sourceRoot":"","sources":["../src/onchain-uri.ts"],"names":[],"mappings":"AAaA,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,GAAG,EACR,KAAK,mBAAmB,EACxB,KAAK,YAAY,EAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAC;AAExC;;wDAEwD;AACxD,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,+FAA+F;AAC/F,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAQ1F;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;gGACgG;AAChG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAC,IAAI,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAA;CAAC,CAmBrF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG;IAAC,KAAK,EAAE,GAAG,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