@artblocks/abx-sdk 0.1.0-alpha.4 → 0.1.0-alpha.41

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 (159) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +130 -0
  3. package/dist/abi/generated.d.ts +8502 -129
  4. package/dist/abi/generated.d.ts.map +1 -1
  5. package/dist/abi/generated.js +40 -22
  6. package/dist/abi/generated.js.map +1 -1
  7. package/dist/abi/index.d.ts +2645 -168
  8. package/dist/abi/index.d.ts.map +1 -1
  9. package/dist/abi/index.js +34 -7
  10. package/dist/abi/index.js.map +1 -1
  11. package/dist/anchors.d.ts +325 -0
  12. package/dist/anchors.d.ts.map +1 -0
  13. package/dist/anchors.js +740 -0
  14. package/dist/anchors.js.map +1 -0
  15. package/dist/chain-support.d.ts +28 -0
  16. package/dist/chain-support.d.ts.map +1 -0
  17. package/dist/chain-support.js +65 -0
  18. package/dist/chain-support.js.map +1 -0
  19. package/dist/chain-support.json +60 -0
  20. package/dist/chains.d.ts +24 -10
  21. package/dist/chains.d.ts.map +1 -1
  22. package/dist/chains.js +51 -17
  23. package/dist/chains.js.map +1 -1
  24. package/dist/chunks.d.ts +162 -31
  25. package/dist/chunks.d.ts.map +1 -1
  26. package/dist/chunks.js +179 -14
  27. package/dist/chunks.js.map +1 -1
  28. package/dist/clients.d.ts +23 -11
  29. package/dist/clients.d.ts.map +1 -1
  30. package/dist/clients.js +17 -18
  31. package/dist/clients.js.map +1 -1
  32. package/dist/contract-generations.d.ts +58 -0
  33. package/dist/contract-generations.d.ts.map +1 -0
  34. package/dist/contract-generations.js +109 -0
  35. package/dist/contract-generations.js.map +1 -0
  36. package/dist/contract-generations.json +48 -0
  37. package/dist/create2.d.ts +84 -1
  38. package/dist/create2.d.ts.map +1 -1
  39. package/dist/create2.js +158 -2
  40. package/dist/create2.js.map +1 -1
  41. package/dist/creator-token.d.ts +132 -0
  42. package/dist/creator-token.d.ts.map +1 -0
  43. package/dist/creator-token.js +183 -0
  44. package/dist/creator-token.js.map +1 -0
  45. package/dist/deploy.d.ts +234 -14
  46. package/dist/deploy.d.ts.map +1 -1
  47. package/dist/deploy.js +289 -111
  48. package/dist/deploy.js.map +1 -1
  49. package/dist/deployments.d.ts +38 -5
  50. package/dist/deployments.d.ts.map +1 -1
  51. package/dist/deployments.js +157 -30
  52. package/dist/deployments.js.map +1 -1
  53. package/dist/deps.d.ts +123 -6
  54. package/dist/deps.d.ts.map +1 -1
  55. package/dist/deps.js +249 -7
  56. package/dist/deps.js.map +1 -1
  57. package/dist/env.d.ts +5 -4
  58. package/dist/env.d.ts.map +1 -1
  59. package/dist/env.js +20 -5
  60. package/dist/env.js.map +1 -1
  61. package/dist/errors.d.ts +109 -0
  62. package/dist/errors.d.ts.map +1 -0
  63. package/dist/errors.js +148 -0
  64. package/dist/errors.js.map +1 -0
  65. package/dist/execute.d.ts +118 -0
  66. package/dist/execute.d.ts.map +1 -0
  67. package/dist/execute.js +159 -0
  68. package/dist/execute.js.map +1 -0
  69. package/dist/gateways.d.ts +79 -0
  70. package/dist/gateways.d.ts.map +1 -0
  71. package/dist/gateways.js +156 -0
  72. package/dist/gateways.js.map +1 -0
  73. package/dist/generator-document.d.ts +57 -0
  74. package/dist/generator-document.d.ts.map +1 -0
  75. package/dist/generator-document.js +123 -0
  76. package/dist/generator-document.js.map +1 -0
  77. package/dist/generator.d.ts +44 -2
  78. package/dist/generator.d.ts.map +1 -1
  79. package/dist/generator.js +29 -0
  80. package/dist/generator.js.map +1 -1
  81. package/dist/index.d.ts +19 -3
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +19 -3
  84. package/dist/index.js.map +1 -1
  85. package/dist/inspect.d.ts +48 -0
  86. package/dist/inspect.d.ts.map +1 -0
  87. package/dist/inspect.js +295 -0
  88. package/dist/inspect.js.map +1 -0
  89. package/dist/migrate.d.ts +41 -0
  90. package/dist/migrate.d.ts.map +1 -0
  91. package/dist/migrate.js +142 -0
  92. package/dist/migrate.js.map +1 -0
  93. package/dist/mime.d.ts +11 -0
  94. package/dist/mime.d.ts.map +1 -0
  95. package/dist/mime.js +40 -0
  96. package/dist/mime.js.map +1 -0
  97. package/dist/node.d.ts +69 -0
  98. package/dist/node.d.ts.map +1 -0
  99. package/dist/node.js +92 -0
  100. package/dist/node.js.map +1 -0
  101. package/dist/onchain-uri.d.ts +110 -0
  102. package/dist/onchain-uri.d.ts.map +1 -0
  103. package/dist/onchain-uri.js +276 -0
  104. package/dist/onchain-uri.js.map +1 -0
  105. package/dist/ops.d.ts +507 -14
  106. package/dist/ops.d.ts.map +1 -1
  107. package/dist/ops.js +850 -34
  108. package/dist/ops.js.map +1 -1
  109. package/dist/policy.d.ts +57 -0
  110. package/dist/policy.d.ts.map +1 -0
  111. package/dist/policy.js +35 -0
  112. package/dist/policy.js.map +1 -0
  113. package/dist/probe.d.ts +58 -0
  114. package/dist/probe.d.ts.map +1 -1
  115. package/dist/probe.js +190 -9
  116. package/dist/probe.js.map +1 -1
  117. package/dist/reconstruct.d.ts +141 -3
  118. package/dist/reconstruct.d.ts.map +1 -1
  119. package/dist/reconstruct.js +479 -100
  120. package/dist/reconstruct.js.map +1 -1
  121. package/dist/resume.d.ts +147 -0
  122. package/dist/resume.d.ts.map +1 -0
  123. package/dist/resume.js +146 -0
  124. package/dist/resume.js.map +1 -0
  125. package/dist/script-chunks.d.ts +105 -0
  126. package/dist/script-chunks.d.ts.map +1 -0
  127. package/dist/script-chunks.js +158 -0
  128. package/dist/script-chunks.js.map +1 -0
  129. package/dist/service.d.ts +155 -9
  130. package/dist/service.d.ts.map +1 -1
  131. package/dist/service.js +103 -11
  132. package/dist/service.js.map +1 -1
  133. package/dist/spine.d.ts +47 -4
  134. package/dist/spine.d.ts.map +1 -1
  135. package/dist/spine.js +0 -0
  136. package/dist/spine.js.map +1 -1
  137. package/dist/staging.d.ts +139 -0
  138. package/dist/staging.d.ts.map +1 -0
  139. package/dist/staging.js +139 -0
  140. package/dist/staging.js.map +1 -0
  141. package/dist/token.d.ts +11 -1
  142. package/dist/token.d.ts.map +1 -1
  143. package/dist/token.js +32 -1
  144. package/dist/token.js.map +1 -1
  145. package/dist/tokendata.d.ts +63 -3
  146. package/dist/tokendata.d.ts.map +1 -1
  147. package/dist/tokendata.js +81 -19
  148. package/dist/tokendata.js.map +1 -1
  149. package/dist/tokens.d.ts +119 -0
  150. package/dist/tokens.d.ts.map +1 -0
  151. package/dist/tokens.js +317 -0
  152. package/dist/tokens.js.map +1 -0
  153. package/dist/types.d.ts +107 -5
  154. package/dist/types.d.ts.map +1 -1
  155. package/dist/util.d.ts +74 -0
  156. package/dist/util.d.ts.map +1 -0
  157. package/dist/util.js +106 -0
  158. package/dist/util.js.map +1 -0
  159. package/package.json +15 -6
package/dist/clients.d.ts CHANGED
@@ -1,7 +1,12 @@
1
- import { type PublicClient, type WalletClient, type Account } from 'viem';
1
+ import { type PublicClient, type WalletClient, type Account, type Hex } from 'viem';
2
2
  export interface ClientOptions {
3
3
  chainKey?: string;
4
+ /** A single RPC endpoint — wins outright over everything else (env included). */
4
5
  rpcUrl?: string;
6
+ /** Several RPC endpoints, in preference order (a viem `fallback` transport failing over
7
+ * across them). Loses to `rpcUrl` when both are set; otherwise takes precedence over env
8
+ * resolution — see {@link resolveRpcUrls}'s override → env → manifest precedence. */
9
+ rpcUrls?: string[];
5
10
  }
6
11
  /** A read-only client — all the indexer and token API ever need. */
7
12
  export declare function makePublicClient(opts?: ClientOptions): PublicClient;
@@ -21,22 +26,29 @@ export declare function makePublicClient(opts?: ClientOptions): PublicClient;
21
26
  export declare function assertChainId(chainKey?: string, opts?: {
22
27
  allowUnreachable?: boolean;
23
28
  }): Promise<void>;
29
+ export interface WalletClientOptions extends ClientOptions {
30
+ /** An explicit key — bypasses `ABX_DEPLOYER_PK` (and any `.env`) entirely. For a caller that
31
+ * already resolved a key itself (a browser-wallet bridge is the OTHER signing lane — this is
32
+ * for a host embedding the SDK with its own key management, not that lane). */
33
+ privateKey?: Hex;
34
+ }
24
35
  /**
25
- * A signing client, backed by a private key from the environment. The SDK never
26
- * takes custody of keys beyond reading them from the operator's own env — there
27
- * is no key storage, no prompt, no remote signer here.
36
+ * A signing client, backed by a private key. The SDK never takes custody of keys beyond
37
+ * reading them from the operator's own env (or an explicit override) — there is no key
38
+ * storage, no prompt, no remote signer here.
28
39
  *
29
- * Key precedence: `ABX_DEPLOYER_PK` → `SEPOLIA_FUNDED_PK` → `SEPOLIA_WALLET_PK`.
40
+ * Key resolution: `opts.privateKey` → `ABX_DEPLOYER_PK`. That is the ONLY env name read —
41
+ * `SEPOLIA_FUNDED_PK` / `SEPOLIA_WALLET_PK` (earlier alphas) are no longer consulted.
30
42
  */
31
- export declare function makeWalletClient(opts?: ClientOptions): {
43
+ export declare function makeWalletClient(opts?: WalletClientOptions): {
32
44
  wallet: WalletClient;
33
45
  account: Account;
34
46
  };
35
47
  /**
36
- * The env signing key (0x-normalized), same precedence as {@link makeWalletClient}
37
- * (`ABX_DEPLOYER_PK` → `SEPOLIA_FUNDED_PK` → `SEPOLIA_WALLET_PK`), or `undefined` if none is set.
38
- * For reusing the hot key as a *storage* signing identity (an Ethereum Turbo identity) without
39
- * constructing a wallet client. Never throws.
48
+ * The signing key (0x-normalized), same resolution as {@link makeWalletClient}
49
+ * (`override` → `ABX_DEPLOYER_PK`), or `undefined` if none is set. For reusing the hot key as
50
+ * a *storage* signing identity (an Ethereum Turbo identity) without constructing a wallet
51
+ * client. Never throws.
40
52
  */
41
- export declare function envSigningKey(): `0x${string}` | undefined;
53
+ export declare function envSigningKey(override?: Hex): `0x${string}` | undefined;
42
54
  //# sourceMappingURL=clients.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,MAAM,CAAC;AAKd,MAAM,WAA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AU,CAAC,EAAE,GAAG,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,mBAAwB,GAAG;IAChE,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB,CAOA;AAOD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,KAAK,MAAM,EAAE,GAAG,SAAS,CAGvE"}
package/dist/clients.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { createPublicClient, createWalletClient, fallback, http, } from 'viem';
2
2
  import { privateKeyToAccount } from 'viem/accounts';
3
3
  import { DEFAULT_CHAIN_KEY, resolveChain, resolveRpcUrls, rpcEnvVar } from './chains.js';
4
- import { loadDotEnv } from './env.js';
4
+ import { readEnv } from './util.js';
5
+ import { MissingSigningKeyError } from './errors.js';
5
6
  /**
6
7
  * A transport over one or more endpoints. With several, a viem `fallback` fails
7
8
  * over on error — so a request one endpoint rejects (e.g. a too-wide `eth_getLogs`)
@@ -11,7 +12,7 @@ import { loadDotEnv } from './env.js';
11
12
  function makeTransport(opts) {
12
13
  if (opts.rpcUrl)
13
14
  return http(opts.rpcUrl);
14
- const urls = resolveRpcUrls(opts.chainKey);
15
+ const urls = resolveRpcUrls(opts.chainKey, opts.rpcUrls);
15
16
  if (urls.length <= 1)
16
17
  return http(urls[0]);
17
18
  return fallback(urls.map((u) => http(u, { retryCount: 0 })));
@@ -55,18 +56,17 @@ export async function assertChainId(chainKey = DEFAULT_CHAIN_KEY, opts = {}) {
55
56
  verifiedChains.add(chainKey);
56
57
  }
57
58
  /**
58
- * A signing client, backed by a private key from the environment. The SDK never
59
- * takes custody of keys beyond reading them from the operator's own env — there
60
- * is no key storage, no prompt, no remote signer here.
59
+ * A signing client, backed by a private key. The SDK never takes custody of keys beyond
60
+ * reading them from the operator's own env (or an explicit override) — there is no key
61
+ * storage, no prompt, no remote signer here.
61
62
  *
62
- * Key precedence: `ABX_DEPLOYER_PK` → `SEPOLIA_FUNDED_PK` → `SEPOLIA_WALLET_PK`.
63
+ * Key resolution: `opts.privateKey` → `ABX_DEPLOYER_PK`. That is the ONLY env name read —
64
+ * `SEPOLIA_FUNDED_PK` / `SEPOLIA_WALLET_PK` (earlier alphas) are no longer consulted.
63
65
  */
64
66
  export function makeWalletClient(opts = {}) {
65
- loadDotEnv();
66
- const pk = process.env.ABX_DEPLOYER_PK ?? process.env.SEPOLIA_FUNDED_PK ?? process.env.SEPOLIA_WALLET_PK;
67
- if (!pk) {
68
- throw new Error('No signing key found. Set ABX_DEPLOYER_PK, SEPOLIA_FUNDED_PK, or SEPOLIA_WALLET_PK in your .env.');
69
- }
67
+ const pk = opts.privateKey ?? readEnv('ABX_DEPLOYER_PK');
68
+ if (!pk)
69
+ throw new MissingSigningKeyError();
70
70
  const account = privateKeyToAccount(normalizePk(pk));
71
71
  const chain = resolveChain(opts.chainKey);
72
72
  const wallet = createWalletClient({ account, chain, transport: makeTransport(opts) });
@@ -77,14 +77,13 @@ function normalizePk(pk) {
77
77
  return (trimmed.startsWith('0x') ? trimmed : `0x${trimmed}`);
78
78
  }
79
79
  /**
80
- * The env signing key (0x-normalized), same precedence as {@link makeWalletClient}
81
- * (`ABX_DEPLOYER_PK` → `SEPOLIA_FUNDED_PK` → `SEPOLIA_WALLET_PK`), or `undefined` if none is set.
82
- * For reusing the hot key as a *storage* signing identity (an Ethereum Turbo identity) without
83
- * constructing a wallet client. Never throws.
80
+ * The signing key (0x-normalized), same resolution as {@link makeWalletClient}
81
+ * (`override` → `ABX_DEPLOYER_PK`), or `undefined` if none is set. For reusing the hot key as
82
+ * a *storage* signing identity (an Ethereum Turbo identity) without constructing a wallet
83
+ * client. Never throws.
84
84
  */
85
- export function envSigningKey() {
86
- loadDotEnv();
87
- const pk = process.env.ABX_DEPLOYER_PK ?? process.env.SEPOLIA_FUNDED_PK ?? process.env.SEPOLIA_WALLET_PK;
85
+ export function envSigningKey(override) {
86
+ const pk = override ?? readEnv('ABX_DEPLOYER_PK');
88
87
  return pk ? normalizePk(pk) : undefined;
89
88
  }
90
89
  //# sourceMappingURL=clients.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clients.js","sourceRoot":"","sources":["../src/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,IAAI,GAKL,MAAM,MAAM,CAAC;AACd,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AACvF,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAOpC;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAAmB;IACxC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,UAAU,EAAE,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,gBAAgB,CAAC,OAAsB,EAAE;IACvD,OAAO,kBAAkB,CAAC,EAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,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AAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { type Address } from 'viem';
2
+ /** Human-facing lifecycle. Code should dispatch on `support`, not this label. */
3
+ export type GenerationLifecycle = 'current' | 'supported' | 'deprecated' | 'quarantined';
4
+ /** Operations that ABX software may allow for a known contract generation. */
5
+ export interface GenerationSupport {
6
+ readonly newDeployments: boolean;
7
+ readonly reads: boolean;
8
+ readonly writes: boolean;
9
+ readonly serving: boolean;
10
+ }
11
+ export type GenerationOperation = keyof GenerationSupport;
12
+ /** One immutable generation of the six clone factories. */
13
+ export interface AnchorGeneration {
14
+ /** Stable registry identifier. Never reuse or rename after publication. */
15
+ readonly id: string;
16
+ /** The value clones report from `abxVersion()`. */
17
+ readonly coreVersion: number;
18
+ readonly lifecycle: GenerationLifecycle;
19
+ /** ISO date the generation first went live. */
20
+ readonly deployed: string;
21
+ /** ISO date it was superseded, when applicable. */
22
+ readonly retired?: string;
23
+ /** Explicit compatibility policy for SDKs, indexers, and resolvers. */
24
+ readonly support: GenerationSupport;
25
+ /** The six trust anchors. Shared singletons and libraries do not belong here. */
26
+ readonly factories: {
27
+ readonly factory: Address;
28
+ readonly seriesFactory: Address;
29
+ readonly seriesCodeFactory: Address;
30
+ readonly oneOfOneEditionFactory: Address;
31
+ readonly editionFactory: Address;
32
+ readonly editionCodeFactory: Address;
33
+ };
34
+ readonly note?: string;
35
+ }
36
+ /** Compact generation facts suitable for service responses and logs. */
37
+ export interface ContractGenerationSummary {
38
+ readonly id: string;
39
+ readonly coreVersion: number;
40
+ readonly lifecycle: GenerationLifecycle;
41
+ readonly support: GenerationSupport;
42
+ }
43
+ /** Append-only, newest-first registry of published ABX contract generations. */
44
+ export declare const ANCHOR_GENERATIONS: readonly AnchorGeneration[];
45
+ export declare function currentAnchorGeneration(): AnchorGeneration;
46
+ export declare function findAnchorGenerationById(id: string): AnchorGeneration | undefined;
47
+ export declare function findAnchorGenerationByCoreVersion(coreVersion: number): AnchorGeneration | undefined;
48
+ export declare function findAnchorGenerationByFactory(factory: Address): AnchorGeneration | undefined;
49
+ /** Resolve official generation provenance from reconstructed project facts.
50
+ * A self-reported core version or caller-supplied factory alone is not enough. */
51
+ export declare function findAnchorGenerationForProject(project: {
52
+ readonly abxVersion: number | null;
53
+ readonly factory: Address | null;
54
+ readonly isCanonical: boolean | null;
55
+ }): AnchorGeneration | undefined;
56
+ export declare function summarizeAnchorGeneration(generation: AnchorGeneration): ContractGenerationSummary;
57
+ export declare function supportsGenerationOperation(generation: AnchorGeneration, operation: GenerationOperation): boolean;
58
+ //# sourceMappingURL=contract-generations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-generations.d.ts","sourceRoot":"","sources":["../src/contract-generations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,MAAM,CAAC;AAG7C,iFAAiF;AACjF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,CAAC;AAEzF,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,iBAAiB,CAAC;AAE1D,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,m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QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;CACtC,GAAG,gBAAgB,GAAG,SAAS,CAI/B;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,GAAG,yBAAyB,CAOjG;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,mBAAmB,GAC7B,OAAO,CAET"}
@@ -0,0 +1,109 @@
1
+ import { isAddress } from 'viem';
2
+ import registryJson from './contract-generations.json' with { type: 'json' };
3
+ const FACTORY_KEYS = [
4
+ 'factory',
5
+ 'seriesFactory',
6
+ 'seriesCodeFactory',
7
+ 'oneOfOneEditionFactory',
8
+ 'editionFactory',
9
+ 'editionCodeFactory',
10
+ ];
11
+ const LIFECYCLES = new Set(['current', 'supported', 'deprecated', 'quarantined']);
12
+ const OPERATIONS = ['newDeployments', 'reads', 'writes', 'serving'];
13
+ function loadRegistry(input) {
14
+ if (!input || typeof input !== 'object')
15
+ throw new Error('Invalid contract-generation registry');
16
+ const registry = input;
17
+ if (registry.schemaVersion !== 1)
18
+ throw new Error(`Unsupported contract-generation schema: ${registry.schemaVersion}`);
19
+ if (!Array.isArray(registry.generations) || registry.generations.length === 0) {
20
+ throw new Error('Contract-generation registry must contain at least one generation');
21
+ }
22
+ const generations = registry.generations;
23
+ const ids = new Set();
24
+ const versions = new Set();
25
+ for (const generation of generations) {
26
+ if (!generation || typeof generation !== 'object')
27
+ throw new Error('Invalid contract generation');
28
+ if (!generation.id || ids.has(generation.id))
29
+ throw new Error(`Duplicate or missing generation id: ${generation.id}`);
30
+ if (!Number.isSafeInteger(generation.coreVersion) || versions.has(generation.coreVersion)) {
31
+ throw new Error(`Duplicate or invalid core version: ${generation.coreVersion}`);
32
+ }
33
+ if (!LIFECYCLES.has(generation.lifecycle))
34
+ throw new Error(`Invalid lifecycle for ${generation.id}`);
35
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(generation.deployed))
36
+ throw new Error(`Invalid deployed date for ${generation.id}`);
37
+ if (generation.retired && !/^\d{4}-\d{2}-\d{2}$/.test(generation.retired)) {
38
+ throw new Error(`Invalid retired date for ${generation.id}`);
39
+ }
40
+ for (const operation of OPERATIONS) {
41
+ if (typeof generation.support?.[operation] !== 'boolean') {
42
+ throw new Error(`Missing ${operation} support policy for ${generation.id}`);
43
+ }
44
+ }
45
+ for (const key of FACTORY_KEYS) {
46
+ if (!isAddress(generation.factories?.[key]))
47
+ throw new Error(`Invalid ${key} for ${generation.id}`);
48
+ }
49
+ if (Object.keys(generation.factories).length !== FACTORY_KEYS.length) {
50
+ throw new Error(`Generation ${generation.id} must contain exactly six factories`);
51
+ }
52
+ ids.add(generation.id);
53
+ versions.add(generation.coreVersion);
54
+ }
55
+ const current = generations.filter((generation) => generation.lifecycle === 'current');
56
+ if (current.length !== 1 || generations[0] !== current[0]) {
57
+ throw new Error('Exactly one current contract generation must appear first');
58
+ }
59
+ if (!current[0].support.newDeployments || current[0].retired) {
60
+ throw new Error('The current contract generation must allow new deployments and cannot be retired');
61
+ }
62
+ if (generations.some((generation) => generation.lifecycle !== 'current' && generation.support.newDeployments)) {
63
+ throw new Error('Only the current contract generation may allow new deployments');
64
+ }
65
+ if (generations.some((generation) => generation.lifecycle !== 'current' && !generation.retired)) {
66
+ throw new Error('Every prior contract generation must record when it was retired');
67
+ }
68
+ for (let index = 1; index < generations.length; index += 1) {
69
+ if (generations[index - 1].coreVersion <= generations[index].coreVersion) {
70
+ throw new Error('Contract generations must be newest-first by core version');
71
+ }
72
+ }
73
+ return generations;
74
+ }
75
+ /** Append-only, newest-first registry of published ABX contract generations. */
76
+ export const ANCHOR_GENERATIONS = loadRegistry(registryJson);
77
+ export function currentAnchorGeneration() {
78
+ return ANCHOR_GENERATIONS[0];
79
+ }
80
+ export function findAnchorGenerationById(id) {
81
+ return ANCHOR_GENERATIONS.find((generation) => generation.id === id);
82
+ }
83
+ export function findAnchorGenerationByCoreVersion(coreVersion) {
84
+ return ANCHOR_GENERATIONS.find((generation) => generation.coreVersion === coreVersion);
85
+ }
86
+ export function findAnchorGenerationByFactory(factory) {
87
+ const needle = factory.toLowerCase();
88
+ return ANCHOR_GENERATIONS.find((generation) => Object.values(generation.factories).some((candidate) => candidate.toLowerCase() === needle));
89
+ }
90
+ /** Resolve official generation provenance from reconstructed project facts.
91
+ * A self-reported core version or caller-supplied factory alone is not enough. */
92
+ export function findAnchorGenerationForProject(project) {
93
+ if (project.isCanonical !== true || !project.factory || project.abxVersion === null)
94
+ return undefined;
95
+ const generation = findAnchorGenerationByFactory(project.factory);
96
+ return generation?.coreVersion === project.abxVersion ? generation : undefined;
97
+ }
98
+ export function summarizeAnchorGeneration(generation) {
99
+ return {
100
+ id: generation.id,
101
+ coreVersion: generation.coreVersion,
102
+ lifecycle: generation.lifecycle,
103
+ support: generation.support,
104
+ };
105
+ }
106
+ export function supportsGenerationOperation(generation, operation) {
107
+ return generation.support[operation];
108
+ }
109
+ //# sourceMappingURL=contract-generations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-generations.js","sourceRoot":"","sources":["../src/contract-generations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAe,MAAM,MAAM,CAAC;AAC7C,OAAO,YAAY,MAAM,6BAA6B,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAgD3E,MAAM,YAAY,GAAG;IACnB,SAAS;IACT,eAAe;IACf,mBAAmB;IACnB,wBAAwB;IACxB,gBAAgB;IAChB,oBAAoB;CACZ,CAAC;AAEX,MAAM,UAAU,GAAG,IAAI,GAAG,CAAsB,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AACvG,MAAM,UAAU,GAAmC,CAAC,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAEpG,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QA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AC,SAAS;QAC/B,OAAO,EAAE,UAAU,CAAC,OAAO;KAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,UAA4B,EAC5B,SAA8B;IAE9B,OAAO,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,48 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "generations": [
4
+ {
5
+ "id": "abx-core-v3",
6
+ "coreVersion": 3,
7
+ "lifecycle": "current",
8
+ "deployed": "2026-09-10",
9
+ "support": {
10
+ "newDeployments": true,
11
+ "reads": true,
12
+ "writes": true,
13
+ "serving": true
14
+ },
15
+ "factories": {
16
+ "factory": "0x2ff8828a9150401225bB217CAA8b9b5e666a1c97",
17
+ "seriesFactory": "0x83222f791cA243FEb0c1Fef93a8732eCe3001b4b",
18
+ "seriesCodeFactory": "0xEAB8a19fEada0DDba2FDE324715eBbB6234B5616",
19
+ "oneOfOneEditionFactory": "0x4e9dFcC70dCC02FA5bad113Bc2CF0A2218358B1E",
20
+ "editionFactory": "0xCC29eD68f26693dc9Aa5f090B21F37985206cc19",
21
+ "editionCodeFactory": "0x86f9CFe597ab145452f4A66ac102291d54e8EB46"
22
+ },
23
+ "note": "Current production-candidate factory generation. Runtime behavior matches the final v2 generation apart from its reported core version."
24
+ },
25
+ {
26
+ "id": "abx-core-v2",
27
+ "coreVersion": 2,
28
+ "lifecycle": "supported",
29
+ "deployed": "2026-08-20",
30
+ "retired": "2026-09-10",
31
+ "support": {
32
+ "newDeployments": false,
33
+ "reads": true,
34
+ "writes": true,
35
+ "serving": true
36
+ },
37
+ "factories": {
38
+ "factory": "0x2824F4b4b4301dB2FcA10b2D80D45b4d463Ba57E",
39
+ "seriesFactory": "0x685B4DfC835b6854590B5437C79D62BB7D52698b",
40
+ "seriesCodeFactory": "0xdDA5174A868A8e099E159E67569900a4F936CFFe",
41
+ "oneOfOneEditionFactory": "0x6ecc7fAd2186965BaECD0Aa215b00239a3459ddF",
42
+ "editionFactory": "0xB6a8f051B08A8d6Fb0B6DA53BD23006CE2da31b7",
43
+ "editionCodeFactory": "0x9441Cc75318E20Ae6237EDb213b4C3019d756Bf0"
44
+ },
45
+ "note": "Prior supported testnet generation. Existing collections remain readable, writable, indexable, and serveable."
46
+ }
47
+ ]
48
+ }
package/dist/create2.d.ts CHANGED
@@ -11,7 +11,9 @@ import { type Address, type Hex } from 'viem';
11
11
  /** The keyless CREATE2 proxy (Arachnid deterministic-deployment-proxy). Same address on every chain. */
12
12
  export declare const CREATE2_PROXY: Address;
13
13
  /** Canonical salt strings — MUST stay byte-identical to `contracts/script/AbxSalts.sol`, since the
14
- * deterministic address is `keccak256(0xff ++ proxy ++ keccak256(salt) ++ keccak256(initcode))`. */
14
+ * deterministic address is `keccak256(0xff ++ proxy ++ keccak256(salt) ++ keccak256(initcode))`.
15
+ * `test/create2-salts.test.ts` diffs this table against that file, both ways, so drift can't be
16
+ * quiet: the two halves have to be one fact. */
15
17
  export declare const ABX_SALT: {
16
18
  readonly oneOfOneFactory: "abx.factory.one-of-one.v1";
17
19
  readonly seriesFactory: "abx.factory.series.v1";
@@ -21,6 +23,14 @@ export declare const ABX_SALT: {
21
23
  readonly fixedPriceMinter: "abx.minter.fixed-price.v1";
22
24
  readonly seedSource: "abx.seed-source.v1";
23
25
  readonly generator: "abx.generator.v1";
26
+ readonly oneOfOneEditionFactory: "abx.one-of-one-edition-factory.v1";
27
+ readonly editionFactory: "abx.edition-factory.v1";
28
+ readonly editionCodeFactory: "abx.edition-code-factory.v1";
29
+ readonly fixedPriceMinter1155: "abx.fixed-price-minter-1155.v1";
30
+ readonly paramsLib: "abx.lib.params.v1";
31
+ readonly codeLib: "abx.lib.code.v1";
32
+ readonly editionLib: "abx.lib.edition.v1";
33
+ readonly metadataLib: "abx.lib.metadata.v1";
24
34
  };
25
35
  /** The 32-byte salt a CREATE2 deploy uses (`keccak256` of the canonical string). */
26
36
  export declare const saltHash: (salt: string) => Hex;
@@ -39,4 +49,77 @@ export declare const predictFixedPriceMinter: () => Address;
39
49
  * (`DeploySeedSource.s.sol`) so it compiles at the default profile — bundling it with the
40
50
  * SeriesCode factory's `clone-impl` unit yields a different, non-canonical bytecode + address. */
41
51
  export declare const predictSeedSource: () => Address;
52
+ /** The canonical (cross-chain-identical) `OneOfOneImageFactory` address for the current bytecode —
53
+ * the 721 1/1 trust anchor. */
54
+ export declare const predictFactory: () => Address;
55
+ /** The canonical (cross-chain-identical) `SeriesImageFactory` address for the current bytecode —
56
+ * the 721 multi-token trust anchor. */
57
+ export declare const predictSeriesFactory: () => Address;
58
+ /** The canonical (cross-chain-identical) `AbxFixedPriceMinter1155` address for the current
59
+ * bytecode — the shared, ownerless edition sale singleton. */
60
+ export declare const predictFixedPriceMinter1155: () => Address;
61
+ /** Fully-qualified library names (solc's link keys — path-sensitive, so they must match how the
62
+ * contracts are compiled: `src/libraries/…` as `foundry.toml` sees them). */
63
+ export declare const LIB_FQN: {
64
+ readonly paramsLib: "src/libraries/AbxParamsLib.sol:AbxParamsLib";
65
+ readonly codeLib: "src/libraries/AbxCodeLib.sol:AbxCodeLib";
66
+ readonly editionLib: "src/libraries/AbxEditionLib.sol:AbxEditionLib";
67
+ readonly metadataLib: "src/libraries/AbxMetadataLib.sol:AbxMetadataLib";
68
+ };
69
+ /** The solc link placeholder for a fully-qualified library name: `__$<keccak(fqn)[0:34]>$__`. */
70
+ export declare const libPlaceholder: (fullyQualified: string) => string;
71
+ /**
72
+ * Link `bytecode` against deployed libraries — the post-compile placeholder substitution `forge`
73
+ * does at build time, done here so a sandbox / fresh chain needs no forge. Throws if any
74
+ * placeholder is left over, since an unlinked `__$…$__` is not valid hex and the RPC would reject
75
+ * the transaction with an opaque `Invalid byte sequence`.
76
+ */
77
+ export declare function linkLibraries(bytecode: Hex, links: ReadonlyArray<readonly [fqn: string, address: Address]>): Hex;
78
+ /** The canonical (cross-chain-identical) `AbxParamsLib` address — the params write path both code
79
+ * token types delegatecall. */
80
+ export declare const predictParamsLib: () => Address;
81
+ /** The canonical (cross-chain-identical) `AbxCodeLib` address — the script/code write path. */
82
+ export declare const predictCodeLib: () => Address;
83
+ /** The canonical (cross-chain-identical) `AbxEditionLib` address — the 1155 uri / creator-token /
84
+ * edition-supply write path that **all three** edition token types (`OneOfOneEdition`,
85
+ * `EditionImage`, `EditionCode`) delegatecall.
86
+ * `AbxEditionLib` itself delegatecalls `AbxParamsLib`, so it is linked before it is deployed: the
87
+ * one library here whose own initcode depends on another library's address. */
88
+ export declare const predictEditionLib: () => Address;
89
+ /** The canonical `AbxMetadataLib` address. Linked by ALL SIX token types to preserve EIP-170
90
+ * headroom; externalizing the metadata field store makes even the plainest 721 factory
91
+ * library-linked. It links nothing itself, so it is deployed first. */
92
+ export declare const predictMetadataLib: () => Address;
93
+ /** `AbxEditionLib`'s canonical initcode: its shipped bytecode linked against `AbxParamsLib`. */
94
+ export declare const linkEditionLib: () => Hex;
95
+ /** `OneOfOneEditionFactory`'s canonical initcode: linked against `AbxEditionLib` (the only library
96
+ * its embedded `OneOfOneEdition` implementation delegates into). `AbxEditionLib`'s own address
97
+ * already accounts for its `AbxParamsLib` link — see {@link predictEditionLib}. */
98
+ export declare const linkOneOfOneEditionFactory: () => Hex;
99
+ /** `EditionImageFactory`'s canonical initcode: linked against `AbxEditionLib`, the sibling of
100
+ * {@link linkOneOfOneEditionFactory}. */
101
+ export declare const linkEditionFactory: () => Hex;
102
+ /** `SeriesCodeFactory`'s canonical initcode: linked against the two write-path libraries. */
103
+ export declare const linkSeriesCodeFactory: () => Hex;
104
+ /** `EditionCodeFactory`'s canonical initcode: linked against all three write-path libraries. */
105
+ export declare const linkEditionCodeFactory: () => Hex;
106
+ /** The two ERC-721 image factories' canonical initcode. They linked NOTHING until the metadata
107
+ * field store was externalized; now every token type is library-linked. */
108
+ export declare const linkFactory: () => Hex;
109
+ export declare const linkSeriesFactory: () => Hex;
110
+ /** The canonical (cross-chain-identical) `SeriesCodeFactory` address — the code-project trust
111
+ * anchor. Predictable because its libraries are (see the section note above). */
112
+ export declare const predictSeriesCodeFactory: () => Address;
113
+ /** The canonical (cross-chain-identical) `EditionCodeFactory` address — the code-project EDITION
114
+ * trust anchor. */
115
+ export declare const predictEditionCodeFactory: () => Address;
116
+ /** The canonical (cross-chain-identical) `OneOfOneEditionFactory` address — the 1/1-edition trust
117
+ * anchor. Predicted from LINKED initcode: `OneOfOneEdition` delegates its uri / creator-token /
118
+ * edition-supply bodies into `AbxEditionLib`, so the shipped factory bytecode carries a link
119
+ * placeholder (hashing it unlinked yields a plausible-looking address for a trust anchor that
120
+ * nothing can ever be deployed to — see the section note). */
121
+ export declare const predictOneOfOneEditionFactory: () => Address;
122
+ /** The canonical (cross-chain-identical) `EditionImageFactory` address — the multi-work edition
123
+ * trust anchor, the sibling of {@link predictOneOfOneEditionFactory} (same single library link). */
124
+ export declare const predictEditionFactory: () => Address;
42
125
  //# sourceMappingURL=create2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create2.d.ts","sourceRoot":"","sources":["../src/create2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,OAAO,EAAE,KAAK,GAAG,EAAC,MAAM,MAAM,CAAC;AAQ5F;;;;;;;;GAQG;AAEH,wGAAwG;AACxG,eAAO,MAAM,aAAa,EAAE,OAAsD,CAAC;AAEnF;qGACqG;AACrG,eAAO,MAAM,QAAQ;;;;;;;;;CASX,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,GAA+B,CAAC;AAExE;6CAC6C;AAC7C,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAE1E;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG,CAEhE;AAED,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,QAAO,OAA4E,CAAC;A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