@artblocks/abx-sdk 0.1.0-alpha.2 → 0.1.0-alpha.20

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 (139) hide show
  1. package/README.md +131 -0
  2. package/dist/abi/generated.d.ts +8502 -129
  3. package/dist/abi/generated.d.ts.map +1 -1
  4. package/dist/abi/generated.js +40 -22
  5. package/dist/abi/generated.js.map +1 -1
  6. package/dist/abi/index.d.ts +2645 -168
  7. package/dist/abi/index.d.ts.map +1 -1
  8. package/dist/abi/index.js +34 -7
  9. package/dist/abi/index.js.map +1 -1
  10. package/dist/anchors.d.ts +266 -0
  11. package/dist/anchors.d.ts.map +1 -0
  12. package/dist/anchors.js +653 -0
  13. package/dist/anchors.js.map +1 -0
  14. package/dist/chains.d.ts +15 -9
  15. package/dist/chains.d.ts.map +1 -1
  16. package/dist/chains.js +19 -15
  17. package/dist/chains.js.map +1 -1
  18. package/dist/chunks.d.ts +53 -23
  19. package/dist/chunks.d.ts.map +1 -1
  20. package/dist/chunks.js +68 -6
  21. package/dist/chunks.js.map +1 -1
  22. package/dist/clients.d.ts +23 -11
  23. package/dist/clients.d.ts.map +1 -1
  24. package/dist/clients.js +17 -18
  25. package/dist/clients.js.map +1 -1
  26. package/dist/create2.d.ts +85 -1
  27. package/dist/create2.d.ts.map +1 -1
  28. package/dist/create2.js +159 -2
  29. package/dist/create2.js.map +1 -1
  30. package/dist/creator-token.d.ts +132 -0
  31. package/dist/creator-token.d.ts.map +1 -0
  32. package/dist/creator-token.js +183 -0
  33. package/dist/creator-token.js.map +1 -0
  34. package/dist/deploy.d.ts +234 -14
  35. package/dist/deploy.d.ts.map +1 -1
  36. package/dist/deploy.js +289 -111
  37. package/dist/deploy.js.map +1 -1
  38. package/dist/deployments.d.ts +12 -0
  39. package/dist/deployments.d.ts.map +1 -1
  40. package/dist/deployments.js +155 -28
  41. package/dist/deployments.js.map +1 -1
  42. package/dist/deps.d.ts +122 -5
  43. package/dist/deps.d.ts.map +1 -1
  44. package/dist/deps.js +248 -6
  45. package/dist/deps.js.map +1 -1
  46. package/dist/env.d.ts.map +1 -1
  47. package/dist/env.js +8 -0
  48. package/dist/env.js.map +1 -1
  49. package/dist/errors.d.ts +94 -0
  50. package/dist/errors.d.ts.map +1 -0
  51. package/dist/errors.js +126 -0
  52. package/dist/errors.js.map +1 -0
  53. package/dist/execute.d.ts +115 -0
  54. package/dist/execute.d.ts.map +1 -0
  55. package/dist/execute.js +142 -0
  56. package/dist/execute.js.map +1 -0
  57. package/dist/gateways.d.ts +79 -0
  58. package/dist/gateways.d.ts.map +1 -0
  59. package/dist/gateways.js +156 -0
  60. package/dist/gateways.js.map +1 -0
  61. package/dist/generator-document.d.ts +58 -0
  62. package/dist/generator-document.d.ts.map +1 -0
  63. package/dist/generator-document.js +124 -0
  64. package/dist/generator-document.js.map +1 -0
  65. package/dist/generator.d.ts +43 -1
  66. package/dist/generator.d.ts.map +1 -1
  67. package/dist/generator.js +29 -0
  68. package/dist/generator.js.map +1 -1
  69. package/dist/index.d.ts +17 -3
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +17 -3
  72. package/dist/index.js.map +1 -1
  73. package/dist/inspect.d.ts +48 -0
  74. package/dist/inspect.d.ts.map +1 -0
  75. package/dist/inspect.js +295 -0
  76. package/dist/inspect.js.map +1 -0
  77. package/dist/migrate.d.ts +41 -0
  78. package/dist/migrate.d.ts.map +1 -0
  79. package/dist/migrate.js +140 -0
  80. package/dist/migrate.js.map +1 -0
  81. package/dist/mime.d.ts +11 -0
  82. package/dist/mime.d.ts.map +1 -0
  83. package/dist/mime.js +40 -0
  84. package/dist/mime.js.map +1 -0
  85. package/dist/node.d.ts +10 -0
  86. package/dist/node.d.ts.map +1 -0
  87. package/dist/node.js +24 -0
  88. package/dist/node.js.map +1 -0
  89. package/dist/onchain-uri.d.ts +110 -0
  90. package/dist/onchain-uri.d.ts.map +1 -0
  91. package/dist/onchain-uri.js +273 -0
  92. package/dist/onchain-uri.js.map +1 -0
  93. package/dist/ops.d.ts +507 -14
  94. package/dist/ops.d.ts.map +1 -1
  95. package/dist/ops.js +848 -32
  96. package/dist/ops.js.map +1 -1
  97. package/dist/probe.d.ts +29 -0
  98. package/dist/probe.d.ts.map +1 -1
  99. package/dist/probe.js +104 -9
  100. package/dist/probe.js.map +1 -1
  101. package/dist/reconstruct.d.ts +92 -2
  102. package/dist/reconstruct.d.ts.map +1 -1
  103. package/dist/reconstruct.js +378 -93
  104. package/dist/reconstruct.js.map +1 -1
  105. package/dist/resume.d.ts +96 -0
  106. package/dist/resume.d.ts.map +1 -0
  107. package/dist/resume.js +95 -0
  108. package/dist/resume.js.map +1 -0
  109. package/dist/script-chunks.d.ts +24 -0
  110. package/dist/script-chunks.d.ts.map +1 -0
  111. package/dist/script-chunks.js +63 -0
  112. package/dist/script-chunks.js.map +1 -0
  113. package/dist/service.d.ts +188 -9
  114. package/dist/service.d.ts.map +1 -1
  115. package/dist/service.js +228 -18
  116. package/dist/service.js.map +1 -1
  117. package/dist/spine.d.ts +31 -4
  118. package/dist/spine.d.ts.map +1 -1
  119. package/dist/spine.js +0 -0
  120. package/dist/spine.js.map +1 -1
  121. package/dist/staging.d.ts +124 -0
  122. package/dist/staging.d.ts.map +1 -0
  123. package/dist/staging.js +134 -0
  124. package/dist/staging.js.map +1 -0
  125. package/dist/tokendata.d.ts +62 -2
  126. package/dist/tokendata.d.ts.map +1 -1
  127. package/dist/tokendata.js +79 -17
  128. package/dist/tokendata.js.map +1 -1
  129. package/dist/tokens.d.ts +94 -0
  130. package/dist/tokens.d.ts.map +1 -0
  131. package/dist/tokens.js +296 -0
  132. package/dist/tokens.js.map +1 -0
  133. package/dist/types.d.ts +60 -3
  134. package/dist/types.d.ts.map +1 -1
  135. package/dist/util.d.ts +74 -0
  136. package/dist/util.d.ts.map +1 -0
  137. package/dist/util.js +106 -0
  138. package/dist/util.js.map +1 -0
  139. package/package.json +10 -2
@@ -1,35 +1,149 @@
1
+ import { readEnv } from './util.js';
1
2
  /**
2
3
  * The cross-chain-identical set — CREATE2 (keyless proxy + `AbxSalts`), so these addresses are the
3
4
  * SAME on every chain. Factory addresses list their EIP-1167 implementation; the implementations are
4
5
  * identical cross-chain too (a factory does exactly one CREATE at nonce 1 from its own — identical —
5
- * address). The renderer is spec v3 (artifacts manifest + authorship/rights contractURI fields).
6
- * SeriesCode's delegatecalled write-path libraries are also CREATE2-deterministic and identical
7
- * everywhere: AbxParamsLib 0x7DAa26bADD99812a77384B461b6375e0c04F2865,
8
- * AbxCodeLib 0xCd12078E81A3BDEACdcd57AE390f4D59F832766B.
6
+ * address). The renderer is **spec v11** — the version `isCurrentRenderer` gates on, and the reason a
7
+ * behind-spec renderer is treated as stale rather than merely older: each bump changed what the
8
+ * document actually contains (v5 escaped the provenance note, v6 changed rendered output for hostile
9
+ * input, v7 renamed the `artist` collection field to `creator`, v8 retired the `abx_params` block and
10
+ * narrowed provenance to the route a field took rather than a claim about its destination, v9 stopped
11
+ * duplicating a computed image into `artifacts`, which changes what the document contains, v10 added
12
+ * four reserved keys neither plane emitted, and v11 moved `ipfs`/`arweave` out of the fallback set:
13
+ * a v10 renderer serves the placeholder SVG for chain state a v11 renderer resolves).
14
+ *
15
+ * The delegatecalled write-path libraries are CREATE2-deterministic and identical everywhere too —
16
+ * that is a property of CREATE2, not a lucky accident, and linking a library does not cost the
17
+ * linking factory its own deterministic address (see `create2.ts`'s write-path-library note, which
18
+ * explains what IS a real trap here). They are deployed EXPLICITLY at `AbxSalts.METADATA_LIB` /
19
+ * `.PARAMS_LIB` / `.CODE_LIB` / `.EDITION_LIB` (`abx.lib.metadata.v1` / `abx.lib.params.v1` /
20
+ * `abx.lib.code.v1` / `abx.lib.edition.v1`) by
21
+ * `DeployLibraries.s.sol` and by the SDK's own bootstrap — not by forge's automatic linking, which
22
+ * routes through the same proxy but at its own salt of zero. So every library address below is
23
+ * recomputable from (proxy, salt, creation bytecode) alone: `predictMetadataLib()` /
24
+ * `predictParamsLib()` / `predictCodeLib()` / `predictEditionLib()`.
25
+ *
26
+ * NO SUPERSEDED ADDRESS APPEARS IN THIS FILE, deliberately. Earlier revisions kept a lineage of
27
+ * replaced deployments in these comments; several of those contracts still have code on chain, so a
28
+ * stale address sitting next to a live one is one careless copy-paste away from binding a factory to
29
+ * an un-manifested library — the exact failure this file exists to prevent. Git has the history.
9
30
  */
10
31
  const CANONICAL = {
11
- factory: '0xB9eEE39DB7D03E0b94CE403F69E928e2a5F134Ca', // impl 0xf1F0893897CC19e75d829fa550a5228c5119cA39
12
- seriesFactory: '0x9d97C00100351682e6625961e033b6F43E60639A', // impl 0x58D8b9F7ABa3043734cBeBfaa9c46875070E16ed
13
- seriesCodeFactory: '0x77f61Ead461f368dbF3788EeFe9693bA5a73Bd87', // impl 0xfd2034B6af517AD019f0dD7b007F07eF358D4053
14
- renderer: '0x837A5cF907E7a6727B08acfE2A865F2bD5C50b1D', // spec v3
15
- chunkStore: '0x03d3a962602093a937B96ee9C0b5C54cec3e701E',
16
- fixedPriceMinter: '0xd970A2c936FFbb2130c2e4Ddf4245FF92465fEA5',
17
- seedSource: '0x53eDFD2047e00C133378DEb430183DEE285E652e',
32
+ // ── The 2026-08-14 greenfield redeploy ──────────────────────────────────────────────────────
33
+ //
34
+ // Every address below was cut from one source tree, after four internal rounds of security audit,
35
+ // an independent external audit, a post-deploy verification review, and the `artist` → `creator`
36
+ // rename. Nothing here descends from an earlier generation: the prior addresses are gone from this
37
+ // file on purpose, because keeping a lineage of superseded deployments in the manifest is how a
38
+ // stale address gets copied forward by mistake. Git has the history; this file records what is live.
39
+ //
40
+ // It took two passes on the same day, and the second one is worth knowing about because it is the
41
+ // shape a redeploy usually has. The first moved everything: externalizing the metadata field store
42
+ // into `AbxMetadataLib` changed all six token implementations, and the renderer's `abx_params`
43
+ // removal took it to spec v8. The second closed the two findings of the post-deploy review
44
+ // (`reviews/2026-08/`) — both source-only, with runtime bodies measured byte-identical before and
45
+ // after — so it moved exactly the five factories whose implementations compose the two mixins that
46
+ // changed. The third moved ONE address: the renderer, to spec v9, for the audit's A-03 (a computed
47
+ // image was being emitted twice in the same document). Nothing links the renderer — tokens hold its
48
+ // address as init state — so no factory or implementation moved with it.
49
+ //
50
+ // The fourth widened `IAbxConfigureHook.onParamConfigured` with `dataLength` + `dataBlobAddress`
51
+ // (so a creator's own hook can police blob size instead of the protocol capping every project) and
52
+ // took `ConfigurableParams` to extension v3. That reaches further than the renderer bump did but
53
+ // still not everywhere: `AbxParamsLib` changed, `AbxEditionLib` moved because it LINKS it, the four
54
+ // token types composing `ConfigurableParams` moved with their factories, and the generator moved on
55
+ // a metadata-only change (its pointers were pinned this time, so it reused them rather than writing
56
+ // fresh ones).
57
+ //
58
+ // The sixth is the smallest yet, and its shape is the point. Renderer spec v11 finished the
59
+ // `ipfs` / `arweave` projection — the two representations that are content-addressed, the two the
60
+ // protocol tells creators to prefer, and the two the renderer could not serve, so
61
+ // `--onchain-uri --backend ipfs` had to bake a gateway HOST into a `url` field and report
62
+ // `source: url` for bytes that live on IPFS. The generator moved with it, because the collection's
63
+ // gateway preference now lives in two reserved metadata fields (`abx_gateway_ipfs` /
64
+ // `abx_gateway_arweave`) that both singletons read, superseding the code-only `display.gateway`
65
+ // param. NOTHING ELSE MOVED: the preference is stored in the field store, which already has an
66
+ // owner-gated setter, an event, the ERC-4906 ping and a per-field freeze on all six token kinds,
67
+ // so no token implementation, factory, or `initialize` ABI changed. The design first called for
68
+ // `preferredIPFSGateway()` getters on every token (the Art Blocks V3 Flex shape); that measured
69
+ // 909 bytes of runtime code against `SeriesCode`'s 862 bytes of EIP-170 headroom, so it would have
70
+ // cost a twelve-address redeploy AND not fit.
71
+ //
72
+ // The fifth closed the audit-hygiene brief: the last V-01-shaped duplicate (the edition mint-cap
73
+ // check, live in TWO copies — the mixin's for the two image editions, the library's for
74
+ // `EditionCode`), plus the `uri()` ladder and creator-token enrollment whose mixin bodies were dead
75
+ // while each token carried its own copy of the passthrough. And renderer spec v10, which finally
76
+ // projects four reserved keys the spec had always listed and nothing on chain emitted. So the three
77
+ // edition factories and the renderer moved. `AbxEditionLib` did NOT — the brief predicted it would,
78
+ // but the pass only DELETED duplicates and added nothing to the library, so its bytecode is
79
+ // unchanged.
80
+ //
81
+ // Across all five passes the two ERC-721 image types and their factory, `AbxMetadataLib`,
82
+ // `AbxCodeLib`, `AbxEditionLib`, the chunk store, the seed source and both minters never moved,
83
+ // because their compile inputs never changed. That asymmetry is the system working: a CREATE2
84
+ // address is a function of the initcode, so "what moved" is a precise answer, not a judgement call.
85
+ //
86
+ // Two properties hold for every entry, and both are checked rather than assumed:
87
+ // 1. Identical on Sepolia and Base Sepolia — CREATE2 through the keyless proxy at the canonical
88
+ // salts in `AbxSalts.sol` / `ABX_SALT`. Only `generator` differs per chain (its constructor
89
+ // bakes chain-specific immutables), which is why it lives in the per-chain blocks below.
90
+ // 2. Recomputable from this build alone — `predictFactory()`, `predictRenderer()`,
91
+ // `predictSeriesCodeFactory()` and friends reproduce every one of them, and the write-path
92
+ // libraries are now deployed EXPLICITLY by `DeployLibraries.s.sol` at named salts rather
93
+ // than by forge's automatic linking at salt zero.
94
+ //
95
+ // Implementations are noted inline because a factory's implementation is the code a clone runs;
96
+ // `abxVersion()` reads 2 on all six, and `specVersion()` reads 11 on the renderer.
97
+ factory: '0x2824F4b4b4301dB2FcA10b2D80D45b4d463Ba57E', // impl 0x58b5CA27C76c0a1FA00b6ebe28d55d3A98eB1425 — 2026-08-20 batch (burn + royalty cap); replaces 0x0dC57f8E8C4BC3CceBAE30871a556D305d468Ccb
98
+ seriesFactory: '0x685B4DfC835b6854590B5437C79D62BB7D52698b', // impl 0x1A8d16407247E801bf15e3c6Dbf2000673Ff474d — 2026-08-20 batch; replaces 0x2Fd169820442E717256680e4492a372a2b979cdf
99
+ seriesCodeFactory: '0xdDA5174A868A8e099E159E67569900a4F936CFFe', // impl 0xdaEF4B7068c07E380068895aCb48a210cdA30297 — 2026-08-20 batch (+ params write-shell extraction); replaces 0xD12274482B114Cce6E90C85207678fAEF3f40667
100
+ oneOfOneEditionFactory: '0x6ecc7fAd2186965BaECD0Aa215b00239a3459ddF', // impl 0xCbD54eb6781F7A430C974fcbe125B48d4dF1f415 — 2026-08-20 batch; replaces 0x41e0203DA7f88b376602D9ce6D7833fD223b3a64
101
+ editionFactory: '0xB6a8f051B08A8d6Fb0B6DA53BD23006CE2da31b7', // impl 0x90A674bce7540eBae92CAa3Ea77ccE1b7eb15f61 — 2026-08-20 batch; replaces 0x1ef75Fc5421d46b8c2609f8CE303B9C662DdDfAe
102
+ editionCodeFactory: '0x9441Cc75318E20Ae6237EDb213b4C3019d756Bf0', // impl 0x68E57D289288dcAf31256d91c64583254bBb6601 — 2026-08-20 batch (+ params write-shell extraction); replaces 0x07389a7eB3F876D87661630512b3Ac87C65266a4
103
+ renderer: '0x85C1aE1F076d808fF7c1729F21B85038Fa16105E', // spec v11 (ipfs/arweave projected through the collection's preferred gateway) — replaces the v10 0xF194c6826f33eB7a4b46356A176e1eF78c81dA2c
104
+ chunkStore: '0x1Ca63a4ADEeF5e722ADA25b892BA40E3b2bcB905', // moved: `read()` is now allocate-once (L-02)
105
+ seedSource: '0xD01d4eDc17F8b4493A43A5e70DCD9813FB1b9A0A',
106
+ fixedPriceMinter: '0x1E321A12386cF6BEe49d1270A5EC54DecA88db48',
107
+ fixedPriceMinter1155: '0x8FcC37dCb00A02367838Fa5B37347dCEec060981',
108
+ // The delegatecalled write-path libraries. Every one of the six token implementations links
109
+ // `AbxMetadataLib` — the on-chain metadata field store is external as of this generation, which is
110
+ // what bought the two code types their EIP-170 headroom (and is why the two ERC-721 image
111
+ // factories, which linked NOTHING before, link one now). On top of that: `AbxParamsLib` +
112
+ // `AbxCodeLib` for the two code types, `AbxEditionLib` for all three ERC-1155 types (and
113
+ // `AbxEditionLib` itself links `AbxParamsLib`, which is why it is deployed after it).
114
+ // Recomputable via `predictMetadataLib()` / `predictParamsLib()` / `predictCodeLib()` /
115
+ // `predictEditionLib()`.
116
+ metadataLib: '0x02b819Bb9065cAf0c598A5CB2f5D37A4eb07460f',
117
+ paramsLib: '0x396848cD90aDAbE1F463Cb825ed6507A026dC833', // 2026-08-20 batch (write-shell extraction + burn/cap front doors); replaces 0x69e068EB4F82b53c5548BdF6548c797ea9428496
118
+ codeLib: '0x8dF597246C851E2DF264C8a322c07657395415fc', // unchanged bytecode ⇒ same address as the prior generation
119
+ editionLib: '0x7c7D213383D6FC3F1e26A0cB3Ad554c1Aa0011dA', // 2026-08-20 batch (links the new AbxParamsLib); replaces 0x3F159245beB9f226175Fa9Bf522acaD6300C9e63
18
120
  };
19
121
  export const DEPLOYMENTS = {
20
- // Sepolia (testnet) — CANONICAL infra + its own generator. Generator wired to AB's Sepolia
21
- // dependency registry; default gateways ipfs.io / arweave.net.
122
+ // Sepolia (testnet). Generator wired to Art Blocks' Sepolia DependencyRegistryV0
123
+ // (0x5Fcc415BCFb164C5F826B5305274749BeB684e9b); SSTORE2 asset pointers
124
+ // abxJsPointer 0xe34D9e7054c85E5dCfAFBD0c1E8ff48E206ebBf7,
125
+ // gunzipScriptPointer 0xC8739F87eDE0278532ACE0f51936b4A3fA8d5C55.
22
126
  11155111: {
23
127
  ...CANONICAL,
24
- generator: '0x819D26830E1FbD1a3b383EcA1C24bc2770000910',
128
+ // Replaces 0xf099C8fc301340dE2C4D1D2b76fcA05D852dF14A: the directory branch reads the
129
+ // collection's `abx_gateway_*` field instead of the `display.gateway` param. Redeployed with the
130
+ // pointers above PINNED, so only the generator moved — the assets did not have to be rewritten.
131
+ generator: '0xb7104ADfa6fb5615E46e2a681A2Ff043B08fADB5',
25
132
  },
26
- // Base Sepolia (testnet) — same CANONICAL infra; its own generator (no AB DependencyRegistry on
27
- // this chain, so deployed with defaultDependencyRegistry = address(0); collections point at
28
- // their own). Runtime asset pointers (SSTORE2): abxJsPointer 0x4525c352EFaeb3F3124399706Ec33B95f2230410,
29
- // gunzipScriptPointer 0xa8Bc1339781deEbeb1eC949cD0641eb53D1044a6.
133
+ // Base Sepolia (testnet). No Art Blocks DependencyRegistry on this chain, so the generator is
134
+ // deployed with defaultDependencyRegistry = address(0) — collections point at their own. SSTORE2
135
+ // asset pointers: abxJsPointer 0xF5c9CE4486574c962fA61EdB297845085B6736Ab,
136
+ // gunzipScriptPointer 0xB162Fa1B55b9Ad6e1c211c02f4c3f60c87036f03. Recorded here because they are
137
+ // the ONLY way to re-run `DeployAbxGenerator` idempotently — without them the script writes fresh
138
+ // pointers, which moves the generator's CREATE2 address and quietly deploys a second one. (That is
139
+ // exactly what happened in the 2026-08-14 pass: the pointers were not pinned, so this generation's
140
+ // generator is a fresh deploy at a fresh address rather than a reuse of the prior one.)
30
141
  84532: {
31
142
  ...CANONICAL,
32
- generator: '0x229337CA6A442b266BD43B7C70F0f24A2E378cB2',
143
+ // Replaces 0x05bd052dAf464bda2d21c48F8f228Ec435cB89Ab — same v11 gateway-field change as Sepolia,
144
+ // and this time the pointers WERE pinned (see the 2026-08-14 note above for what happens when
145
+ // they are not).
146
+ generator: '0x2C1B7Cf6c54E4ACbcB54FCC395f7Af88eb4fc8CE',
33
147
  },
34
148
  };
35
149
  /** The canonical deployment record for a chain (empty if the chain isn't shipped yet). */
@@ -41,28 +155,41 @@ function pick(override, env, manifest) {
41
155
  return (override ?? env ?? manifest);
42
156
  }
43
157
  export function resolveFactory(chainId, override) {
44
- return pick(override, process.env.ABX_FACTORY, getDeployment(chainId).factory);
158
+ return pick(override, readEnv('ABX_FACTORY'), getDeployment(chainId).factory);
45
159
  }
46
160
  export function resolveSeriesFactory(chainId, override) {
47
- return pick(override, process.env.ABX_SERIES_FACTORY, getDeployment(chainId).seriesFactory);
161
+ return pick(override, readEnv('ABX_SERIES_FACTORY'), getDeployment(chainId).seriesFactory);
48
162
  }
49
163
  export function resolveRenderer(chainId, override) {
50
- return pick(override, process.env.ABX_RENDERER, getDeployment(chainId).renderer);
164
+ return pick(override, readEnv('ABX_RENDERER'), getDeployment(chainId).renderer);
51
165
  }
52
166
  export function resolveChunkStore(chainId, override) {
53
- return pick(override, process.env.ABX_CHUNK_STORE, getDeployment(chainId).chunkStore);
167
+ return pick(override, readEnv('ABX_CHUNK_STORE'), getDeployment(chainId).chunkStore);
54
168
  }
55
169
  export function resolveFixedPriceMinter(chainId, override) {
56
- return pick(override, process.env.ABX_FIXED_PRICE_MINTER, getDeployment(chainId).fixedPriceMinter);
170
+ return pick(override, readEnv('ABX_FIXED_PRICE_MINTER'), getDeployment(chainId).fixedPriceMinter);
57
171
  }
58
172
  export function resolveSeriesCodeFactory(chainId, override) {
59
- return pick(override, process.env.ABX_SERIES_CODE_FACTORY, getDeployment(chainId).seriesCodeFactory);
173
+ return pick(override, readEnv('ABX_SERIES_CODE_FACTORY'), getDeployment(chainId).seriesCodeFactory);
60
174
  }
61
175
  export function resolveSeedSource(chainId, override) {
62
- return pick(override, process.env.ABX_SEED_SOURCE, getDeployment(chainId).seedSource);
176
+ return pick(override, readEnv('ABX_SEED_SOURCE'), getDeployment(chainId).seedSource);
177
+ }
178
+ // ERC-1155 editions — same override → env → manifest precedence as every resolver above.
179
+ export function resolveOneOfOneEditionFactory(chainId, override) {
180
+ return pick(override, readEnv('ABX_ONE_OF_ONE_EDITION_FACTORY'), getDeployment(chainId).oneOfOneEditionFactory);
181
+ }
182
+ export function resolveEditionFactory(chainId, override) {
183
+ return pick(override, readEnv('ABX_EDITION_FACTORY'), getDeployment(chainId).editionFactory);
184
+ }
185
+ export function resolveEditionCodeFactory(chainId, override) {
186
+ return pick(override, readEnv('ABX_EDITION_CODE_FACTORY'), getDeployment(chainId).editionCodeFactory);
187
+ }
188
+ export function resolveFixedPriceMinter1155(chainId, override) {
189
+ return pick(override, readEnv('ABX_FIXED_PRICE_MINTER_1155'), getDeployment(chainId).fixedPriceMinter1155);
63
190
  }
64
191
  export function resolveGenerator(chainId, override) {
65
- return pick(override, process.env.ABX_GENERATOR, getDeployment(chainId).generator);
192
+ return pick(override, readEnv('ABX_GENERATOR'), getDeployment(chainId).generator);
66
193
  }
67
194
  /**
68
195
  * The known `name@version` resolution roots per chain — Art Blocks' DependencyRegistryV0
@@ -76,6 +203,6 @@ export const AB_DEPENDENCY_REGISTRY = {
76
203
  11155111: '0x5Fcc415BCFb164C5F826B5305274749BeB684e9b', // Sepolia
77
204
  };
78
205
  export function resolveDependencyRegistry(chainId, override) {
79
- return pick(override, process.env.ABX_DEPENDENCY_REGISTRY, AB_DEPENDENCY_REGISTRY[chainId]);
206
+ return pick(override, readEnv('ABX_DEPENDENCY_REGISTRY'), AB_DEPENDENCY_REGISTRY[chainId]);
80
207
  }
81
208
  //# sourceMappingURL=deployments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAyCA;;;;;;;;GAQG;AACH,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,4CAA4C,EAAE,kDAAkD;IACzG,aAAa,EAAE,4CAA4C,EAAE,kDAAkD;IAC/G,iBAAiB,EAAE,4CAA4C,EAAE,kDAAkD;IACnH,QAAQ,EAAE,4CAA4C,EAAE,UAAU;IAClE,UAAU,EAAE,4CAA4C;IACxD,gBAAgB,EAAE,4CAA4C;IAC9D,UAAU,EAAE,4CAA4C;CACH,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAoC;IAC1D,2FAA2F;IAC3F,+DAA+D;IAC/D,QAAQ,EAAE;QACR,GAAG,SAAS;QACZ,SAAS,EAAE,4CAA4C;KACxD;IACD,gGAAgG;IAChG,4FAA4F;IAC5F,yGAAyG;IACzG,kEAAkE;IAClE,KAAK,EAAE;QACL,GAAG,SAAS;QACZ,SAAS,EAAE,4CAA4C;KACxD;CACF,CAAC;AAEF,0FAA0F;AAC1F,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,mFAAmF;AACnF,SAAS,IAAI,CAAC,QAA4B,E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QAAQ,EAAE,OAAO,CAAC,0BAA0B,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC;AACxG,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,OAAe,EAAE,QAAiB;IAC5E,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,6BAA6B,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC7G,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,QAAiB;IACjE,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;AACpF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,CAAC,EAAE,4CAA4C,EAAE,UAAU;IAC3D,QAAQ,EAAE,4CAA4C,EAAE,UAAU;CACnE,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,OAAe,EAAE,QAAiB;IAC1E,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,yBAAyB,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC"}
package/dist/deps.d.ts CHANGED
@@ -12,9 +12,14 @@
12
12
  *
13
13
  * Also speaks the AB-compatible registry READ interface (`IDependencyRegistryV0`,
14
14
  * specs/protocol/dependency-registry.md): `getDependencyDetails(bytes32)` is the
15
- * load-bearing read behind the CLI's best-effort selection-time check.
15
+ * load-bearing read behind the CLI's best-effort selection-time check, and
16
+ * `getDependencyScript(bytes32, index)` is the resolver's own read for on-chain bytes (see the
17
+ * "resolver's registry-aware serving lane" section below — hoisted from
18
+ * `@artblocks/abx-token-api` in the abx-services integrator ask, because it shares this exact
19
+ * vocabulary end to end).
16
20
  */
17
- import { type Address, type Hex } from 'viem';
21
+ import { type Address, type Hex, type PublicClient } from 'viem';
22
+ import type { DependencyInfo, ProjectState } from './types.js';
18
23
  /** `IAbxDependencies.Resolution` — index-aligned with the Solidity enum. */
19
24
  export declare const DEP_RESOLUTION: {
20
25
  readonly registry: 0;
@@ -40,9 +45,16 @@ export declare function parseDependencyRef(input: string): ParsedDependencyRef;
40
45
  /** The reverse read: an evented `(resolution, bytes32)` back to its human form (the twin of
41
46
  * the reconstruction fold's decode — registry ⇒ the tag, onchain ⇒ the address). */
42
47
  export declare function decodeDependencyRef(resolution: DepResolution, ref: Hex): string;
43
- /** The load-bearing read of AB's `IDependencyRegistryV0` — the exact upstream signature
44
- * (any registry ABX consumers read from speaks this shape; see the dependency-registry spec). */
45
- export declare const dependencyRegistryReadAbi: readonly [{
48
+ /**
49
+ * The load-bearing reads of AB's `IDependencyRegistryV0` — the exact upstream signatures (any
50
+ * registry ABX consumers read from speaks this shape; see the dependency-registry spec).
51
+ * `getDependencyDetails` backs both the CLI's best-effort selection-time check and the
52
+ * resolver's own resolution; `getDependencyScript` is the resolver-only per-chunk read for a
53
+ * dep whose bytes live on chain. (Merging this hoist: token-api's `DEPENDENCY_REGISTRY_ABI` and
54
+ * this module's prior `dependencyRegistryReadAbi` declared the identical `getDependencyDetails`
55
+ * entry twice — one array now backs both callers.)
56
+ */
57
+ export declare const DEPENDENCY_REGISTRY_ABI: readonly [{
46
58
  readonly type: "function";
47
59
  readonly name: "getDependencyDetails";
48
60
  readonly stateMutability: "view";
@@ -78,6 +90,20 @@ export declare const dependencyRegistryReadAbi: readonly [{
78
90
  readonly name: "scriptCount";
79
91
  readonly type: "uint24";
80
92
  }];
93
+ }, {
94
+ readonly type: "function";
95
+ readonly name: "getDependencyScript";
96
+ readonly stateMutability: "view";
97
+ readonly inputs: readonly [{
98
+ readonly name: "dependencyNameAndVersion";
99
+ readonly type: "bytes32";
100
+ }, {
101
+ readonly name: "index";
102
+ readonly type: "uint256";
103
+ }];
104
+ readonly outputs: readonly [{
105
+ readonly type: "string";
106
+ }];
81
107
  }];
82
108
  /** What the selection-time check cares about from a registry record. */
83
109
  export interface RegistryDependencyDetails {
@@ -106,4 +132,95 @@ export interface DependencyReadClient {
106
132
  * (a revert) or "check unavailable" (RPC down); this stays a pure read.
107
133
  */
108
134
  export declare function readRegistryDependency(client: DependencyReadClient, registry: Address, ref: Hex): Promise<RegistryDependencyDetails | null>;
135
+ /**
136
+ * The registry pointer a deploy with ≥1 Registry-resolution dep should set: an explicit
137
+ * `--dep-registry` wins (validated), else the chain's known AB registry (env-overridable),
138
+ * else none — the caller WARNS and skips the leg (soft pointer; the resolver falls back to
139
+ * its built-in CDN map). Never a blocker.
140
+ */
141
+ export declare function resolveDepRegistryPointer(flagValue: string | undefined, chainId: number): {
142
+ registry: Address | null;
143
+ source: 'flag' | 'default' | 'none';
144
+ };
145
+ /**
146
+ * The dependency legs of the setup multicall: one `setDependency(i, resolution, ref)` per
147
+ * dep in index order, plus the `setDependencyRegistry` leg when a pointer resolved. These
148
+ * ride the SAME atomic setup multicall as script chunks/schemas/mints, in every signing lane.
149
+ */
150
+ export declare function dependencySetupCalls(deps: ParsedDependencyRef[], registry: Address | null): Hex[];
151
+ /** One dep's selection-time verdict (Registry-resolution deps only — OnChain refs never touch a registry). */
152
+ export type DepCheck = {
153
+ dep: string;
154
+ status: 'found';
155
+ details: RegistryDependencyDetails;
156
+ } | {
157
+ dep: string;
158
+ status: 'not-found';
159
+ } | {
160
+ dep: string;
161
+ status: 'skipped';
162
+ };
163
+ /**
164
+ * Best-effort existence/on-chain-ness check of every Registry-resolution dep against the
165
+ * pointer registry. A revert or an empty record ⇒ `not-found` (a warning — the owner may
166
+ * intend a custom registry). A transport failure ⇒ the remaining checks are `skipped` and
167
+ * `rpcOk: false` — one info line, never an error: the deploy proceeds regardless.
168
+ */
169
+ export declare function checkRegistryDeps(client: DependencyReadClient, registry: Address, deps: ParsedDependencyRef[]): Promise<{
170
+ checks: DepCheck[];
171
+ rpcOk: boolean;
172
+ }>;
173
+ /** What a registry ref resolved to: on-chain bytes (decompressed, inline-ready JS) or a CDN URL. */
174
+ export type RegistryResolution = {
175
+ kind: 'onchain';
176
+ script: string;
177
+ } | {
178
+ kind: 'cdn';
179
+ url: string;
180
+ };
181
+ export interface RegistryResolveOptions {
182
+ /** Decompress gzip bytes — required only when the resolved dependency is on-chain bytes
183
+ * (`availableOnChain` with `scriptCount > 0`); a CDN-resolved or unresolved dep never needs
184
+ * it. Omitting it in that case throws {@link InflateRequiredError} naming the fix. */
185
+ inflate?: (bytes: Uint8Array) => Uint8Array;
186
+ }
187
+ /** Reset the in-process registry-resolution cache — for tests. */
188
+ export declare function resetRegistryDependencyCache(): void;
189
+ /** The collection's registry pointer, if set to a real address (zero/undefined ⇒ none). */
190
+ export declare function activeRegistry(state: ProjectState): Address | null;
191
+ /**
192
+ * Resolve one `name@version` ref through the collection's registry. Returns the resolution
193
+ * (or null when the registry couldn't answer — caller falls back to the built-in map) plus
194
+ * whether it was served from cache. Never throws for a resolution failure; a fresh one logs ONE
195
+ * warn (the negative cache rate-limits it) naming the dep and why. DOES throw
196
+ * {@link InflateRequiredError} when the resolution needs decompression and `opts.inflate` is
197
+ * absent — that is a caller-configuration bug, not a resolution outcome.
198
+ */
199
+ export declare function resolveRegistryDep(client: PublicClient, registry: Address, dep: DependencyInfo, opts?: RegistryResolveOptions): Promise<{
200
+ resolution: RegistryResolution | null;
201
+ cached: boolean;
202
+ error?: string;
203
+ }>;
204
+ /**
205
+ * Resolve a `name@version` registry ref to a CDN URL — the built-in reference convention,
206
+ * the LAST-resort rung of the resolution order (the soft registry pointer stays
207
+ * non-validating). Known runtimes get their real dist paths; anything else is best-effort npm.
208
+ */
209
+ export declare function registryDepUrl(ref: string): string | null;
210
+ /**
211
+ * The ordered dependency `<script>` tags for the generator document, each dep resolved per
212
+ * the Consumers table: registry on-chain bytes → registry preferredCDN → built-in map;
213
+ * `onchain`-resolution refs read their SSTORE2 data contract directly (never a registry).
214
+ * Never throws for a resolution failure — an unresolvable dep is skipped (after the warn) and
215
+ * the document assembles. DOES propagate {@link InflateRequiredError} (see
216
+ * {@link resolveRegistryDep}) — a missing `inflate` is a host wiring bug, not a bad dep.
217
+ */
218
+ export declare function dependencyScriptTags(client: PublicClient, state: ProjectState, opts?: RegistryResolveOptions): Promise<string[]>;
219
+ /** The spec's URL-carried tokenData size budget: gateway front-ends commonly cap request lines
220
+ * near 8KB. Applies to URL-carried `?abx=` payloads (a resolver's directory-mode 302 fallback);
221
+ * inline document serving is unaffected. Hoisted alongside the rest of this lane — the
222
+ * budget-tracking/observability surface built on it (`checkUrlBudget`, `urlBudgetStatus`) stays
223
+ * resolver-local (token-api/src/deps.ts), since it's a serving-observability concern rather than
224
+ * a resolution rule. */
225
+ export declare const URL_BUDGET_BYTES = 8192;
109
226
  //# sourceMappingURL=deps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAgB,KAAK,OAAO,EAAE,KAAK,GAAG,EAAC,MAAM,MAAM,CAAC;AAG3D,4EAA4E;AAC5E,eAAO,MAAM,cAAc;;;CAAqC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEjF,oGAAoG;AACpG,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,aAAa,CAAC;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;sFAEsF;AACtF,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,GAAG,CAahE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAOrE;AAED;qFACqF;AACrF,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,CAE/E;AAID;kG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