@artblocks/abx-sdk 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.
- package/CHANGELOG.md +11 -0
- package/README.md +130 -0
- package/dist/abi/generated.d.ts +8502 -129
- package/dist/abi/generated.d.ts.map +1 -1
- package/dist/abi/generated.js +40 -22
- package/dist/abi/generated.js.map +1 -1
- package/dist/abi/index.d.ts +2645 -168
- package/dist/abi/index.d.ts.map +1 -1
- package/dist/abi/index.js +34 -7
- package/dist/abi/index.js.map +1 -1
- package/dist/anchors.d.ts +318 -0
- package/dist/anchors.d.ts.map +1 -0
- package/dist/anchors.js +701 -0
- package/dist/anchors.js.map +1 -0
- package/dist/chains.d.ts +19 -9
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +31 -15
- package/dist/chains.js.map +1 -1
- package/dist/chunks.d.ts +67 -26
- package/dist/chunks.d.ts.map +1 -1
- package/dist/chunks.js +82 -9
- package/dist/chunks.js.map +1 -1
- package/dist/clients.d.ts +23 -11
- package/dist/clients.d.ts.map +1 -1
- package/dist/clients.js +17 -18
- package/dist/clients.js.map +1 -1
- package/dist/create2.d.ts +84 -1
- package/dist/create2.d.ts.map +1 -1
- package/dist/create2.js +158 -2
- package/dist/create2.js.map +1 -1
- package/dist/creator-token.d.ts +132 -0
- package/dist/creator-token.d.ts.map +1 -0
- package/dist/creator-token.js +183 -0
- package/dist/creator-token.js.map +1 -0
- package/dist/deploy.d.ts +234 -14
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +289 -111
- package/dist/deploy.js.map +1 -1
- package/dist/deployments.d.ts +70 -5
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +139 -30
- package/dist/deployments.js.map +1 -1
- package/dist/deps.d.ts +123 -6
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +249 -7
- package/dist/deps.js.map +1 -1
- package/dist/env.d.ts +5 -4
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +20 -5
- package/dist/env.js.map +1 -1
- package/dist/errors.d.ts +94 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +126 -0
- package/dist/errors.js.map +1 -0
- package/dist/execute.d.ts +118 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +159 -0
- package/dist/execute.js.map +1 -0
- package/dist/gateways.d.ts +79 -0
- package/dist/gateways.d.ts.map +1 -0
- package/dist/gateways.js +156 -0
- package/dist/gateways.js.map +1 -0
- package/dist/generator-document.d.ts +57 -0
- package/dist/generator-document.d.ts.map +1 -0
- package/dist/generator-document.js +123 -0
- package/dist/generator-document.js.map +1 -0
- package/dist/generator.d.ts +44 -2
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +29 -0
- package/dist/generator.js.map +1 -1
- package/dist/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +48 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +295 -0
- package/dist/inspect.js.map +1 -0
- package/dist/migrate.d.ts +41 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +142 -0
- package/dist/migrate.js.map +1 -0
- package/dist/mime.d.ts +11 -0
- package/dist/mime.d.ts.map +1 -0
- package/dist/mime.js +40 -0
- package/dist/mime.js.map +1 -0
- package/dist/node.d.ts +10 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +24 -0
- package/dist/node.js.map +1 -0
- package/dist/onchain-uri.d.ts +110 -0
- package/dist/onchain-uri.d.ts.map +1 -0
- package/dist/onchain-uri.js +276 -0
- package/dist/onchain-uri.js.map +1 -0
- package/dist/ops.d.ts +507 -14
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +850 -34
- package/dist/ops.js.map +1 -1
- package/dist/policy.d.ts +57 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +35 -0
- package/dist/policy.js.map +1 -0
- package/dist/probe.d.ts +58 -0
- package/dist/probe.d.ts.map +1 -1
- package/dist/probe.js +190 -9
- package/dist/probe.js.map +1 -1
- package/dist/reconstruct.d.ts +114 -2
- package/dist/reconstruct.d.ts.map +1 -1
- package/dist/reconstruct.js +443 -98
- package/dist/reconstruct.js.map +1 -1
- package/dist/resume.d.ts +96 -0
- package/dist/resume.d.ts.map +1 -0
- package/dist/resume.js +95 -0
- package/dist/resume.js.map +1 -0
- package/dist/script-chunks.d.ts +24 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +63 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/service.d.ts +151 -9
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +103 -11
- package/dist/service.js.map +1 -1
- package/dist/spine.d.ts +47 -4
- package/dist/spine.d.ts.map +1 -1
- package/dist/spine.js +0 -0
- package/dist/spine.js.map +1 -1
- package/dist/staging.d.ts +139 -0
- package/dist/staging.d.ts.map +1 -0
- package/dist/staging.js +139 -0
- package/dist/staging.js.map +1 -0
- package/dist/token.d.ts +1 -1
- package/dist/token.js +1 -1
- package/dist/tokendata.d.ts +63 -3
- package/dist/tokendata.d.ts.map +1 -1
- package/dist/tokendata.js +81 -19
- package/dist/tokendata.js.map +1 -1
- package/dist/tokens.d.ts +119 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +317 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +107 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/util.d.ts +74 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +106 -0
- package/dist/util.js.map +1 -0
- package/package.json +15 -6
package/dist/gateways.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gateway resolution for content-addressed locators (`ipfs://…`, `ar://…`) is split into a pure
|
|
3
|
+
* resolver and a
|
|
4
|
+
* separate env-reading piece so a host with its own gateway config never has to touch
|
|
5
|
+
* `process.env` through this module at all, and so this stays reachable from a browser bundle
|
|
6
|
+
* (see `test/browser-bundle.test.ts` — no `process.env` read outside {@link gatewayConfigFromEnv},
|
|
7
|
+
* which itself goes through {@link readEnv} and degrades to "no override" rather than throwing
|
|
8
|
+
* where `process` doesn't exist).
|
|
9
|
+
*/
|
|
10
|
+
import { readEnv } from './util.js';
|
|
11
|
+
import { GATEWAY_FIELD, GATEWAY_FLOOR, METADATA_REPRESENTATION as R } from './spine.js';
|
|
12
|
+
import { inlineText } from './token.js';
|
|
13
|
+
/**
|
|
14
|
+
* The gateway BASE for a locator network, given already-resolved `overrides` — PURE, no env
|
|
15
|
+
* read. Defaults to the generic public gateways (`ipfs.io` / `arweave.net`) when `overrides`
|
|
16
|
+
* doesn't name one; any other `network` (e.g. `http`, which carries its own base) resolves to
|
|
17
|
+
* `''`. Callers that want override → env → default precedence compose this with
|
|
18
|
+
* {@link gatewayConfigFromEnv} themselves (see `@artblocks/abx-storage`'s `resolveGatewayBase`
|
|
19
|
+
* for the reference compose) — kept separate so a host with its own config source never has this
|
|
20
|
+
* function reach into `process.env` on its behalf.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveGatewayBase(network, overrides) {
|
|
23
|
+
if (network === 'ipfs')
|
|
24
|
+
return overrides?.ipfs || 'https://ipfs.io';
|
|
25
|
+
if (network === 'arweave')
|
|
26
|
+
return overrides?.arweave || 'https://arweave.net';
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The ONLY env-reading piece of this module: `ABX_IPFS_GATEWAY` / `ABX_ARWEAVE_GATEWAY`, read via
|
|
31
|
+
* {@link readEnv} (safe where `process` doesn't exist). Exported separately from
|
|
32
|
+
* {@link resolveGatewayBase} so a host with its own gateway configuration (a database row, a
|
|
33
|
+
* remote config service) never has to touch `process.env` through this package at all — it just
|
|
34
|
+
* never calls this function and passes its own overrides straight to the pure resolver instead.
|
|
35
|
+
*/
|
|
36
|
+
export function gatewayConfigFromEnv() {
|
|
37
|
+
const ipfs = readEnv('ABX_IPFS_GATEWAY');
|
|
38
|
+
const arweave = readEnv('ABX_ARWEAVE_GATEWAY');
|
|
39
|
+
const out = {};
|
|
40
|
+
if (ipfs)
|
|
41
|
+
out.ipfs = ipfs;
|
|
42
|
+
if (arweave)
|
|
43
|
+
out.arweave = arweave;
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
/** Build the URL that asks `gateway` for `id`. A locator that is already an absolute URL is asked
|
|
47
|
+
* verbatim — rewriting someone's URL would answer a question they didn't ask. */
|
|
48
|
+
export function gatewayUrlFor(network, id, gateway) {
|
|
49
|
+
if (/^https?:\/\//i.test(id))
|
|
50
|
+
return id;
|
|
51
|
+
const base = gateway.replace(/\/+$/, '');
|
|
52
|
+
// A path suffix (a directory manifest entry, e.g. `<txid>/index.html`) rides along untouched.
|
|
53
|
+
return network === 'ipfs' ? `${base}/ipfs/${id}` : `${base}/${id}`;
|
|
54
|
+
}
|
|
55
|
+
const SCHEME = { ipfs: 'ipfs://', arweave: 'ar://' };
|
|
56
|
+
/**
|
|
57
|
+
* Normalize a gateway HOST (the `ABX_IPFS_GATEWAY` / `ABX_ARWEAVE_GATEWAY` shape, and what
|
|
58
|
+
* {@link resolveGatewayBase} returns) into the on-chain PREFIX shape — trailing path included, so
|
|
59
|
+
* projection is a raw concat. A value that already ends in the scheme's path segment is left
|
|
60
|
+
* alone, so an operator may configure either form.
|
|
61
|
+
*/
|
|
62
|
+
export function gatewayPrefixFrom(network, base) {
|
|
63
|
+
const trimmed = base.replace(/\/+$/, '');
|
|
64
|
+
if (!trimmed)
|
|
65
|
+
return GATEWAY_FLOOR[network];
|
|
66
|
+
if (network === 'arweave')
|
|
67
|
+
return `${trimmed}/`;
|
|
68
|
+
return trimmed.endsWith('/ipfs') ? `${trimmed}/` : `${trimmed}/ipfs/`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The gateway prefix this project prefers for a scheme: the collection's reserved
|
|
72
|
+
* `abx_gateway_*` field, else the host's env/override default, else the public floor.
|
|
73
|
+
*
|
|
74
|
+
* The env read is a FLOOR, never an override. When a project has stated a preference on chain,
|
|
75
|
+
* every conforming resolver must serve that one — otherwise the same token renders differently
|
|
76
|
+
* depending on who is serving it, which is the property `abx_provenance` exists to make checkable.
|
|
77
|
+
* When a project has stated nothing, a host with its own gateway is strictly better than
|
|
78
|
+
* `ipfs.io`, and a managed provider serving a token it does not own has no other way to say so.
|
|
79
|
+
*/
|
|
80
|
+
export function projectGatewayPrefix(state, network, overrides) {
|
|
81
|
+
const onChain = state.collectionFields.find(
|
|
82
|
+
// Only `inline` counts. A prefix is a short UTF-8 string, and accepting exactly one
|
|
83
|
+
// representation keeps this rule identical on the renderer, the generator and here.
|
|
84
|
+
(f) => f.field === GATEWAY_FIELD[network] && f.representation === R.inline);
|
|
85
|
+
if (onChain) {
|
|
86
|
+
// No `.trim()`: the on-chain `_gatewayPrefix` returns the stored bytes verbatim (any non-empty
|
|
87
|
+
// `inline` value wins), so trimming here would make the two serving planes disagree on a
|
|
88
|
+
// whitespace-padded prefix — the same byte-parity class this projection exists to hold. The field
|
|
89
|
+
// store rejects an empty value, so a set field is always non-empty.
|
|
90
|
+
const stated = inlineText(onChain);
|
|
91
|
+
if (stated)
|
|
92
|
+
return stated;
|
|
93
|
+
}
|
|
94
|
+
const host = overrides?.[network];
|
|
95
|
+
return host ? gatewayPrefixFrom(network, host) : GATEWAY_FLOOR[network];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Project a content-addressed field value into its https URL, byte-identically to the deployed
|
|
99
|
+
* renderer. `null` when the value locates nothing (`ipfs://` with no CID) — the caller omits an
|
|
100
|
+
* optional field or falls back on a required one, rather than emitting a bare prefix that 404s.
|
|
101
|
+
*
|
|
102
|
+
* Order is load-bearing and mirrors the Solidity exactly: strip the scheme, THEN substitute
|
|
103
|
+
* `{id}`, THEN check for an absolute URL. That last check is what stops a value which already
|
|
104
|
+
* names its own host — precisely what a `backend.locator()` return looks like — from coming back
|
|
105
|
+
* as `https://arweave.net/https://arweave.net/<txid>`.
|
|
106
|
+
*/
|
|
107
|
+
export function projectGatewayUrl(network, value, prefix, tokenId) {
|
|
108
|
+
let id = value;
|
|
109
|
+
const scheme = SCHEME[network];
|
|
110
|
+
if (id.startsWith(scheme))
|
|
111
|
+
id = id.slice(scheme.length);
|
|
112
|
+
if (!id)
|
|
113
|
+
return null;
|
|
114
|
+
// One collection-scope `ipfs` field addresses a whole pinned directory. Skipped on the
|
|
115
|
+
// collection surface, which has no tokenId — the same reason `url-template` is omitted there.
|
|
116
|
+
if (tokenId !== undefined)
|
|
117
|
+
id = id.split('{id}').join(tokenId);
|
|
118
|
+
if (/^https?:\/\//i.test(id))
|
|
119
|
+
return id;
|
|
120
|
+
return prefix + id;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The inverse of {@link gatewayUrlFor} / {@link projectGatewayUrl}: recover the bare content id
|
|
124
|
+
* (CID or txid, plus any path suffix) from whatever form a locator arrived in.
|
|
125
|
+
*
|
|
126
|
+
* This exists because a storage backend's `locator()` returns a **gateway HTTPS URL** — the form an
|
|
127
|
+
* operator can click — while an `ipfs` / `arweave` metadata field must hold IDENTITY, with the
|
|
128
|
+
* gateway supplied at read time. Baking the operator's gateway host into the field is exactly the
|
|
129
|
+
* weld this projection was built to remove: it makes a CID unmigratable and makes the chain report
|
|
130
|
+
* `source: url` for bytes that live on IPFS.
|
|
131
|
+
*
|
|
132
|
+
* `null` when no id can be recovered — notably a subdomain-style gateway
|
|
133
|
+
* (`https://<cid>.ipfs.dweb.link`), which ABX's own backends never produce. A caller that gets
|
|
134
|
+
* `null` should keep the URL as a plain `url` field and SAY so, rather than guess.
|
|
135
|
+
*/
|
|
136
|
+
export function contentIdFromLocator(network, locator) {
|
|
137
|
+
const trimmed = locator.trim();
|
|
138
|
+
if (!trimmed)
|
|
139
|
+
return null;
|
|
140
|
+
const scheme = SCHEME[network];
|
|
141
|
+
if (trimmed.startsWith(scheme))
|
|
142
|
+
return trimmed.slice(scheme.length) || null;
|
|
143
|
+
if (!/^https?:\/\//i.test(trimmed))
|
|
144
|
+
return trimmed; // already bare
|
|
145
|
+
if (network === 'ipfs') {
|
|
146
|
+
const at = trimmed.lastIndexOf('/ipfs/');
|
|
147
|
+
return at === -1 ? null : trimmed.slice(at + '/ipfs/'.length) || null;
|
|
148
|
+
}
|
|
149
|
+
// Strip the origin by hand rather than via `new URL().pathname`, which percent-encodes: an Arweave
|
|
150
|
+
// directory template `https://arweave.net/TXDIR/{id}.png` came back as `TXDIR/%7Bid%7D.png`, and
|
|
151
|
+
// that value would have been COMMITTED ON CHAIN — where nothing substitutes `%7Bid%7D`, so every
|
|
152
|
+
// token in the collection would resolve to the same missing file.
|
|
153
|
+
const afterOrigin = trimmed.replace(/^https?:\/\/[^/]*\/?/i, '');
|
|
154
|
+
return afterOrigin || null;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=gateways.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateways.js","sourceRoot":"","sources":["../src/gateways.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,uBAAuB,IAAI,CAAC,EAAC,MAAM,YAAY,CAAC;AACtF,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAetC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAoC,EAAE,SAA4B;IACnG,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,SAAS,EAAE,IAAI,IAAI,iBAAiB,CAAC;IACpE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,EAAE,OAAO,IAAI,qBAAqB,CAAC;IAC9E,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,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,EAAE,CAAC;IACxC,OAAO,MAAM,GAAG,EAAE,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgC,EAAE,OAAe;IACpF,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;IAC5E,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC,CAAC,eAAe;IACnE,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;IACxE,CAAC;IACD,mGAAmG;IACnG,iGAAiG;IACjG,iGAAiG;IACjG,kEAAkE;IAClE,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IACjE,OAAO,WAAW,IAAI,IAAI,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generator-document family — the template-mode runtime companion, the inline-safety
|
|
3
|
+
* escapes, and the pure document-shape builders. Every piece here is a pure string operation with no chain
|
|
4
|
+
* access and no Node dependency, so it belongs in the neutral layer a resolver, a CLI preview,
|
|
5
|
+
* and any third-party provider all consume identically — one definition of the runtime surface
|
|
6
|
+
* and the document shape, so none of them can quietly drift from what the others emit.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* `abx.js` — the runtime companion (the hl-gen.js analog), served at `/abx.js` and
|
|
10
|
+
* inlined into template-mode documents. Convention, not protocol: a directory build
|
|
11
|
+
* includes it; the generator injects the same surface.
|
|
12
|
+
*
|
|
13
|
+
* tokenData resolution order (the durability chain): the injected `window.abxTokenData`
|
|
14
|
+
* global (template mode) → the `?abx=` query param (base64url canonical JSON — the
|
|
15
|
+
* live-view route) → the `?chainId&contract&tokenId` coordinate floor (a build opened
|
|
16
|
+
* bare from a gateway still knows which token it is; full param reads from RPC are the
|
|
17
|
+
* render-node's job, not this shim's).
|
|
18
|
+
*/
|
|
19
|
+
export declare const ABX_JS = "(function () {\n var abx = (window.abx = window.abx || {});\n function fromQuery() {\n try {\n var q = new URLSearchParams(location.search);\n var packed = q.get('abx');\n if (packed) {\n var b64 = packed.replace(/-/g, '+').replace(/_/g, '/');\n return JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(b64), function (c) { return c.charCodeAt(0); })));\n }\n // coordinate floor: enough for a deterministic piece opened bare from a gateway\n if (q.get('contract') && q.get('tokenId')) {\n return {\n chainId: Number(q.get('chainId') || 1),\n contractAddress: String(q.get('contract')).toLowerCase(),\n tokenId: String(q.get('tokenId')),\n };\n }\n } catch (e) {}\n return null;\n }\n abx.tokenData = window.abxTokenData || fromQuery();\n abx.__traits = null;\n abx.__done = false;\n /** The script reports its computed traits (script-defined features; captured at render). */\n abx.traits = function (t) {\n abx.__traits = t;\n try { document.dispatchEvent(new CustomEvent('abx:traits', {detail: t})); } catch (e) {}\n return t;\n };\n /** Output-complete \u2014 the capture point for the render effect. Optional (timeout fallback). */\n abx.done = function () {\n abx.__done = true;\n try { document.dispatchEvent(new CustomEvent('abx:done')); } catch (e) {}\n };\n})();\n";
|
|
20
|
+
/**
|
|
21
|
+
* Inline-document safety — the one HTML parsing rule that matters when embedding
|
|
22
|
+
* content inside <script> elements: the parser ends the element at the first
|
|
23
|
+
* `</script`, regardless of JS string/comment context. Two content shapes, two
|
|
24
|
+
* semantics-preserving escapes:
|
|
25
|
+
*
|
|
26
|
+
* - JS source (libraries, creator scripts): `</script` → `<\/script`. In valid JS the
|
|
27
|
+
* sequence can only occur inside a string, template, regex, or comment — contexts
|
|
28
|
+
* where `\/` is identical to `/` — so the transform never changes behavior.
|
|
29
|
+
* - JSON (the injected `window.abxTokenData`): every `<` → `\u003c`. `<` only occurs
|
|
30
|
+
* inside JSON strings (never in the syntax), and `\u003c` parses to the same
|
|
31
|
+
* character — the canonical (hashed) serialization is untouched; only the delivery
|
|
32
|
+
* form differs.
|
|
33
|
+
*/
|
|
34
|
+
/** JS source safe to inline inside a <script> element. Case-insensitive because HTML end tags
|
|
35
|
+
* are; the on-chain generator matches this (see `AbxGenerator._escapedScript`). */
|
|
36
|
+
export declare function escapeInlineScript(src: string): string;
|
|
37
|
+
/** A JSON payload safe to inline inside a <script> element (parse-identical). */
|
|
38
|
+
export declare function escapeInlineJson(json: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* Inject `window.abxTokenData` (and, when the document doesn't already carry one, a
|
|
41
|
+
* `<base href="{code root}/">` so relative asset paths keep riding the gateway) at the
|
|
42
|
+
* very top of `<head>` — before any build script can execute; abx.js resolves the global
|
|
43
|
+
* first. String-level and deliberately robust rather than a full HTML parse: no `<head>`
|
|
44
|
+
* → inject right after `<html …>`; neither → prepend. First `<base>` wins in HTML, so an
|
|
45
|
+
* existing one is never doubled.
|
|
46
|
+
*/
|
|
47
|
+
export declare function injectTokenDataIntoHtml(html: string, tokenDataJson: string, codeRoot: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* The template-mode document shape, pure — no chain access, so a caller that already has a
|
|
50
|
+
* script + dep tags in hand (the resolver's own chain-fetched assembly; `abx preview`'s offline
|
|
51
|
+
* studio, local-file + CDN-resolved) can build the byte-identical document. Exported for exactly
|
|
52
|
+
* that reason: **one** definition of the shape, so a caller can never quietly drift from what the
|
|
53
|
+
* generator actually serves — the failure mode a hand-maintained duplicate (with a "keep these in
|
|
54
|
+
* sync" comment and nothing enforcing it) invites.
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildGeneratorDocument(script: string, tokenDataJson: string, depTags: string[]): string;
|
|
57
|
+
//# sourceMappingURL=generator-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-document.d.ts","sourceRoot":"","sources":["../src/generator-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,o4CAoClB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AAEH;oFACoF;AACpF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAcrG;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAYvG"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generator-document family — the template-mode runtime companion, the inline-safety
|
|
3
|
+
* escapes, and the pure document-shape builders. Every piece here is a pure string operation with no chain
|
|
4
|
+
* access and no Node dependency, so it belongs in the neutral layer a resolver, a CLI preview,
|
|
5
|
+
* and any third-party provider all consume identically — one definition of the runtime surface
|
|
6
|
+
* and the document shape, so none of them can quietly drift from what the others emit.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* `abx.js` — the runtime companion (the hl-gen.js analog), served at `/abx.js` and
|
|
10
|
+
* inlined into template-mode documents. Convention, not protocol: a directory build
|
|
11
|
+
* includes it; the generator injects the same surface.
|
|
12
|
+
*
|
|
13
|
+
* tokenData resolution order (the durability chain): the injected `window.abxTokenData`
|
|
14
|
+
* global (template mode) → the `?abx=` query param (base64url canonical JSON — the
|
|
15
|
+
* live-view route) → the `?chainId&contract&tokenId` coordinate floor (a build opened
|
|
16
|
+
* bare from a gateway still knows which token it is; full param reads from RPC are the
|
|
17
|
+
* render-node's job, not this shim's).
|
|
18
|
+
*/
|
|
19
|
+
export const ABX_JS = `(function () {
|
|
20
|
+
var abx = (window.abx = window.abx || {});
|
|
21
|
+
function fromQuery() {
|
|
22
|
+
try {
|
|
23
|
+
var q = new URLSearchParams(location.search);
|
|
24
|
+
var packed = q.get('abx');
|
|
25
|
+
if (packed) {
|
|
26
|
+
var b64 = packed.replace(/-/g, '+').replace(/_/g, '/');
|
|
27
|
+
return JSON.parse(new TextDecoder().decode(Uint8Array.from(atob(b64), function (c) { return c.charCodeAt(0); })));
|
|
28
|
+
}
|
|
29
|
+
// coordinate floor: enough for a deterministic piece opened bare from a gateway
|
|
30
|
+
if (q.get('contract') && q.get('tokenId')) {
|
|
31
|
+
return {
|
|
32
|
+
chainId: Number(q.get('chainId') || 1),
|
|
33
|
+
contractAddress: String(q.get('contract')).toLowerCase(),
|
|
34
|
+
tokenId: String(q.get('tokenId')),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
abx.tokenData = window.abxTokenData || fromQuery();
|
|
41
|
+
abx.__traits = null;
|
|
42
|
+
abx.__done = false;
|
|
43
|
+
/** The script reports its computed traits (script-defined features; captured at render). */
|
|
44
|
+
abx.traits = function (t) {
|
|
45
|
+
abx.__traits = t;
|
|
46
|
+
try { document.dispatchEvent(new CustomEvent('abx:traits', {detail: t})); } catch (e) {}
|
|
47
|
+
return t;
|
|
48
|
+
};
|
|
49
|
+
/** Output-complete — the capture point for the render effect. Optional (timeout fallback). */
|
|
50
|
+
abx.done = function () {
|
|
51
|
+
abx.__done = true;
|
|
52
|
+
try { document.dispatchEvent(new CustomEvent('abx:done')); } catch (e) {}
|
|
53
|
+
};
|
|
54
|
+
})();
|
|
55
|
+
`;
|
|
56
|
+
/**
|
|
57
|
+
* Inline-document safety — the one HTML parsing rule that matters when embedding
|
|
58
|
+
* content inside <script> elements: the parser ends the element at the first
|
|
59
|
+
* `</script`, regardless of JS string/comment context. Two content shapes, two
|
|
60
|
+
* semantics-preserving escapes:
|
|
61
|
+
*
|
|
62
|
+
* - JS source (libraries, creator scripts): `</script` → `<\/script`. In valid JS the
|
|
63
|
+
* sequence can only occur inside a string, template, regex, or comment — contexts
|
|
64
|
+
* where `\/` is identical to `/` — so the transform never changes behavior.
|
|
65
|
+
* - JSON (the injected `window.abxTokenData`): every `<` → `\u003c`. `<` only occurs
|
|
66
|
+
* inside JSON strings (never in the syntax), and `\u003c` parses to the same
|
|
67
|
+
* character — the canonical (hashed) serialization is untouched; only the delivery
|
|
68
|
+
* form differs.
|
|
69
|
+
*/
|
|
70
|
+
/** JS source safe to inline inside a <script> element. Case-insensitive because HTML end tags
|
|
71
|
+
* are; the on-chain generator matches this (see `AbxGenerator._escapedScript`). */
|
|
72
|
+
export function escapeInlineScript(src) {
|
|
73
|
+
return src.replace(/<\/(script)/gi, '<\\/$1');
|
|
74
|
+
}
|
|
75
|
+
/** A JSON payload safe to inline inside a <script> element (parse-identical). */
|
|
76
|
+
export function escapeInlineJson(json) {
|
|
77
|
+
return json.replace(/</g, '\\u003c');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Inject `window.abxTokenData` (and, when the document doesn't already carry one, a
|
|
81
|
+
* `<base href="{code root}/">` so relative asset paths keep riding the gateway) at the
|
|
82
|
+
* very top of `<head>` — before any build script can execute; abx.js resolves the global
|
|
83
|
+
* first. String-level and deliberately robust rather than a full HTML parse: no `<head>`
|
|
84
|
+
* → inject right after `<html …>`; neither → prepend. First `<base>` wins in HTML, so an
|
|
85
|
+
* existing one is never doubled.
|
|
86
|
+
*/
|
|
87
|
+
export function injectTokenDataIntoHtml(html, tokenDataJson, codeRoot) {
|
|
88
|
+
const baseTag = /<base[\s/>]/i.test(html) ? '' : `<base href="${codeRoot}">`;
|
|
89
|
+
const injection = `${baseTag}<script>window.abxTokenData=${escapeInlineJson(tokenDataJson)};</script>`;
|
|
90
|
+
const head = /<head(\s[^>]*)?>/i.exec(html);
|
|
91
|
+
if (head) {
|
|
92
|
+
const at = head.index + head[0].length;
|
|
93
|
+
return html.slice(0, at) + injection + html.slice(at);
|
|
94
|
+
}
|
|
95
|
+
const htmlTag = /<html(\s[^>]*)?>/i.exec(html);
|
|
96
|
+
if (htmlTag) {
|
|
97
|
+
const at = htmlTag.index + htmlTag[0].length;
|
|
98
|
+
return html.slice(0, at) + injection + html.slice(at);
|
|
99
|
+
}
|
|
100
|
+
return injection + html;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The template-mode document shape, pure — no chain access, so a caller that already has a
|
|
104
|
+
* script + dep tags in hand (the resolver's own chain-fetched assembly; `abx preview`'s offline
|
|
105
|
+
* studio, local-file + CDN-resolved) can build the byte-identical document. Exported for exactly
|
|
106
|
+
* that reason: **one** definition of the shape, so a caller can never quietly drift from what the
|
|
107
|
+
* generator actually serves — the failure mode a hand-maintained duplicate (with a "keep these in
|
|
108
|
+
* sync" comment and nothing enforcing it) invites.
|
|
109
|
+
*/
|
|
110
|
+
export function buildGeneratorDocument(script, tokenDataJson, depTags) {
|
|
111
|
+
return [
|
|
112
|
+
'<!doctype html>',
|
|
113
|
+
'<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">',
|
|
114
|
+
'<style>html,body{margin:0;padding:0;overflow:hidden}canvas{display:block}</style>',
|
|
115
|
+
`<script>window.abxTokenData=${escapeInlineJson(tokenDataJson)};</script>`,
|
|
116
|
+
`<script>${ABX_JS}</script>`,
|
|
117
|
+
...depTags,
|
|
118
|
+
'</head><body>',
|
|
119
|
+
`<script>\n${escapeInlineScript(script)}\n</script>`,
|
|
120
|
+
'</body></html>',
|
|
121
|
+
].join('\n');
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=generator-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-document.js","sourceRoot":"","sources":["../src/generator-document.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCrB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AAEH;oFACoF;AACpF,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,aAAqB,EAAE,QAAgB;IAC3F,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,QAAQ,IAAI,CAAC;IAC7E,MAAM,SAAS,GAAG,GAAG,OAAO,+BAA+B,gBAAgB,CAAC,aAAa,CAAC,YAAY,CAAC;IACvG,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,SAAS,GAAG,IAAI,CAAC;AAC1B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,aAAqB,EAAE,OAAiB;IAC7F,OAAO;QACL,iBAAiB;QACjB,uGAAuG;QACvG,mFAAmF;QACnF,+BAA+B,gBAAgB,CAAC,aAAa,CAAC,YAAY;QAC1E,WAAW,MAAM,WAAW;QAC5B,GAAG,OAAO;QACV,eAAe;QACf,aAAa,kBAAkB,CAAC,MAAM,CAAC,aAAa;QACpD,gBAAgB;KACjB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/generator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The canonical on-chain generator — `AbxGenerator` (
|
|
2
|
+
* The canonical on-chain generator — `AbxGenerator` (site/content/docs/protocol/code-projects.mdx →
|
|
3
3
|
* "The canonical generator"). One field renderer for the `animation_url` field serving both
|
|
4
4
|
* code custody modes: **template** (script chunks → the full HTML document, chain-complete
|
|
5
5
|
* when every dependency resolves to on-chain bytes) and **directory** (`code` field → a
|
|
@@ -98,6 +98,42 @@ export declare const abxGeneratorAbi: readonly [{
|
|
|
98
98
|
readonly name: "";
|
|
99
99
|
readonly type: "string";
|
|
100
100
|
}];
|
|
101
|
+
}, {
|
|
102
|
+
readonly type: "function";
|
|
103
|
+
readonly name: "abxJs";
|
|
104
|
+
readonly stateMutability: "view";
|
|
105
|
+
readonly inputs: readonly [];
|
|
106
|
+
readonly outputs: readonly [{
|
|
107
|
+
readonly name: "";
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
}];
|
|
110
|
+
}, {
|
|
111
|
+
readonly type: "function";
|
|
112
|
+
readonly name: "gunzipScript";
|
|
113
|
+
readonly stateMutability: "view";
|
|
114
|
+
readonly inputs: readonly [];
|
|
115
|
+
readonly outputs: readonly [{
|
|
116
|
+
readonly name: "";
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
}];
|
|
119
|
+
}, {
|
|
120
|
+
readonly type: "function";
|
|
121
|
+
readonly name: "registryScriptChunk";
|
|
122
|
+
readonly stateMutability: "view";
|
|
123
|
+
readonly inputs: readonly [{
|
|
124
|
+
readonly name: "registry";
|
|
125
|
+
readonly type: "address";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "ref";
|
|
128
|
+
readonly type: "bytes32";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "index";
|
|
131
|
+
readonly type: "uint256";
|
|
132
|
+
}];
|
|
133
|
+
readonly outputs: readonly [{
|
|
134
|
+
readonly name: "";
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
}];
|
|
101
137
|
}];
|
|
102
138
|
/** `AbxGenerator`'s branch constants, by index: 0 = none, 1 = template, 2 = directory. */
|
|
103
139
|
export declare const GENERATOR_BRANCHES: readonly ["none", "template", "directory"];
|
|
@@ -108,7 +144,13 @@ export declare const GENERATOR_URL_BUDGET_BYTES = 8192;
|
|
|
108
144
|
export interface GeneratorStatus {
|
|
109
145
|
branch: number;
|
|
110
146
|
branchName: GeneratorBranch;
|
|
111
|
-
/** Template branch with EVERY dependency resolved to
|
|
147
|
+
/** Template branch with EVERY dependency resolved to on-chain bytes — no server, gateway, or CDN
|
|
148
|
+
* in the graph. Always false off it.
|
|
149
|
+
*
|
|
150
|
+
* A claim about WHERE the bytes come from, never about whether they are frozen: a `Registry`
|
|
151
|
+
* dependency is re-fetched from the registry contract on every read, so its bytes can change while
|
|
152
|
+
* this stays `true` — including after `lockDependencies` (which freezes the ref and the registry
|
|
153
|
+
* pointer, not another contract's storage). Don't render this as "immutable" in a UI. */
|
|
112
154
|
chainComplete: boolean;
|
|
113
155
|
/** Refs that emit `<!-- abx:unresolved … -->` markers, decoded to their readable tags. */
|
|
114
156
|
unresolvedRefs: string[];
|
package/dist/generator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAC,OAAO,EAAM,MAAM,MAAM,CAAC;AAGvC,sFAAsF;AACtF,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAC,OAAO,EAAM,MAAM,MAAM,CAAC;AAGvC,sFAAsF;AACtF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsFlB,CAAC;AAEX,0FAA0F;AAC1F,eAAO,MAAM,kBAAkB,4CAA6C,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,eAAe,CAAC;IAC5B;;;;;;8FAM0F;IAC1F,aAAa,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,qFAAqF;IACrF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,uGAAuG;AACvG,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,IAAI,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,EAAE,SAAS,OAAO,EAAE,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;KAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtB;AAED,6FAA6F;AAC7F,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,eAAe,CAAC,CAc1B"}
|
package/dist/generator.js
CHANGED
|
@@ -57,6 +57,35 @@ export const abxGeneratorAbi = [
|
|
|
57
57
|
],
|
|
58
58
|
outputs: [{ name: '', type: 'string' }],
|
|
59
59
|
},
|
|
60
|
+
// The rest of the piecewise set. `document` on a large project can exceed a node's eth_call gas cap
|
|
61
|
+
// (tokenURI assembly measures ~360-405k gas per KB, climbing with size), and these are how a client assembles the same
|
|
62
|
+
// document from pieces instead: the two baked runtime blobs, plus a registry dependency's chunks
|
|
63
|
+
// one at a time. Every read here is an OFF-CHAIN view call by design — no contract calls them.
|
|
64
|
+
{
|
|
65
|
+
type: 'function',
|
|
66
|
+
name: 'abxJs',
|
|
67
|
+
stateMutability: 'view',
|
|
68
|
+
inputs: [],
|
|
69
|
+
outputs: [{ name: '', type: 'string' }],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
type: 'function',
|
|
73
|
+
name: 'gunzipScript',
|
|
74
|
+
stateMutability: 'view',
|
|
75
|
+
inputs: [],
|
|
76
|
+
outputs: [{ name: '', type: 'string' }],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'function',
|
|
80
|
+
name: 'registryScriptChunk',
|
|
81
|
+
stateMutability: 'view',
|
|
82
|
+
inputs: [
|
|
83
|
+
{ name: 'registry', type: 'address' },
|
|
84
|
+
{ name: 'ref', type: 'bytes32' },
|
|
85
|
+
{ name: 'index', type: 'uint256' },
|
|
86
|
+
],
|
|
87
|
+
outputs: [{ name: '', type: 'string' }],
|
|
88
|
+
},
|
|
60
89
|
];
|
|
61
90
|
/** `AbxGenerator`'s branch constants, by index: 0 = none, 1 = template, 2 = directory. */
|
|
62
91
|
export const GENERATOR_BRANCHES = ['none', 'template', 'directory'];
|
package/dist/generator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAErC,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE;YACN,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAC;YAChC,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;YAClC,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAC;SACjC;QACD,OAAO,EAAE;YACP,EAAC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAC;YACrC,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC;SAC9B;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,eAAe;QACrB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC;QAC1C,OAAO,EAAE;YACP,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAC;YAC/B,E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
|
|
13
13
|
export * from './spine.js';
|
|
14
14
|
export * from './chains.js';
|
|
15
15
|
export * from './clients.js';
|
|
16
|
-
export * from './deploy.js';
|
|
17
16
|
export * from './ops.js';
|
|
17
|
+
export * from './execute.js';
|
|
18
|
+
export * from './errors.js';
|
|
19
|
+
export * from './deploy.js';
|
|
20
|
+
export * from './anchors.js';
|
|
18
21
|
export * from './reconstruct.js';
|
|
22
|
+
export * from './resume.js';
|
|
19
23
|
export * from './tokendata.js';
|
|
20
24
|
export * from './probe.js';
|
|
21
25
|
export * from './token.js';
|
|
26
|
+
export * from './tokens.js';
|
|
22
27
|
export * from './traits.js';
|
|
23
28
|
export * from './fastlz.js';
|
|
24
29
|
export * from './chunks.js';
|
|
25
30
|
export * from './create2.js';
|
|
31
|
+
export * from './creator-token.js';
|
|
26
32
|
export * from './deployments.js';
|
|
27
33
|
export * from './deps.js';
|
|
34
|
+
export * from './gateways.js';
|
|
28
35
|
export * from './generator.js';
|
|
36
|
+
export * from './generator-document.js';
|
|
37
|
+
export * from './inspect.js';
|
|
38
|
+
export * from './script-chunks.js';
|
|
39
|
+
export * from './migrate.js';
|
|
40
|
+
export * from './mime.js';
|
|
41
|
+
export * from './onchain-uri.js';
|
|
42
|
+
export * from './policy.js';
|
|
29
43
|
export * from './service.js';
|
|
30
|
-
export
|
|
31
|
-
export
|
|
44
|
+
export * from './staging.js';
|
|
45
|
+
export * from './util.js';
|
|
46
|
+
export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, editionCodeAbi, editionCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, abxFixedPriceMinter1155Abi, spineEventAbi, } from './abi/index.js';
|
|
32
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAE5E,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,YAAY,EAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,MAAM,CAAC;AAE5E,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,20 +2,35 @@ export * from './types.js';
|
|
|
2
2
|
export * from './spine.js';
|
|
3
3
|
export * from './chains.js';
|
|
4
4
|
export * from './clients.js';
|
|
5
|
-
export * from './deploy.js';
|
|
6
5
|
export * from './ops.js';
|
|
6
|
+
export * from './execute.js';
|
|
7
|
+
export * from './errors.js';
|
|
8
|
+
export * from './deploy.js';
|
|
9
|
+
export * from './anchors.js';
|
|
7
10
|
export * from './reconstruct.js';
|
|
11
|
+
export * from './resume.js';
|
|
8
12
|
export * from './tokendata.js';
|
|
9
13
|
export * from './probe.js';
|
|
10
14
|
export * from './token.js';
|
|
15
|
+
export * from './tokens.js';
|
|
11
16
|
export * from './traits.js';
|
|
12
17
|
export * from './fastlz.js';
|
|
13
18
|
export * from './chunks.js';
|
|
14
19
|
export * from './create2.js';
|
|
20
|
+
export * from './creator-token.js';
|
|
15
21
|
export * from './deployments.js';
|
|
16
22
|
export * from './deps.js';
|
|
23
|
+
export * from './gateways.js';
|
|
17
24
|
export * from './generator.js';
|
|
25
|
+
export * from './generator-document.js';
|
|
26
|
+
export * from './inspect.js';
|
|
27
|
+
export * from './script-chunks.js';
|
|
28
|
+
export * from './migrate.js';
|
|
29
|
+
export * from './mime.js';
|
|
30
|
+
export * from './onchain-uri.js';
|
|
31
|
+
export * from './policy.js';
|
|
18
32
|
export * from './service.js';
|
|
19
|
-
export
|
|
20
|
-
export
|
|
33
|
+
export * from './staging.js';
|
|
34
|
+
export * from './util.js';
|
|
35
|
+
export { oneOfOneImageAbi, oneOfOneImageFactoryAbi, seriesImageAbi, seriesImageFactoryAbi, seriesCodeAbi, seriesCodeFactoryAbi, oneOfOneEditionAbi, oneOfOneEditionFactoryAbi, editionImageAbi, editionImageFactoryAbi, editionCodeAbi, editionCodeFactoryAbi, abxSeedSourceAbi, abxMetadataRendererAbi, abxChunkStoreAbi, abxFixedPriceMinterAbi, abxFixedPriceMinter1155Abi, spineEventAbi, } from './abi/index.js';
|
|
21
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 code in the CLI would be a footgun). Everything here is regex/heuristic over the source.
|
|
11
|
+
*/
|
|
12
|
+
export type TraitFeasibility = 'none' | 'exact-likely' | 'careful' | 'infeasible' | 'unknown';
|
|
13
|
+
export interface ScriptAnalysis {
|
|
14
|
+
bytes: number;
|
|
15
|
+
estChunks: number;
|
|
16
|
+
traits: {
|
|
17
|
+
present: boolean;
|
|
18
|
+
keys: string[];
|
|
19
|
+
};
|
|
20
|
+
paramHints: string[];
|
|
21
|
+
prng: {
|
|
22
|
+
seeded: boolean;
|
|
23
|
+
usesBareRandom: boolean;
|
|
24
|
+
usesMathRandom: boolean;
|
|
25
|
+
usesNoise: boolean;
|
|
26
|
+
};
|
|
27
|
+
depHints: string[];
|
|
28
|
+
looksP5: boolean;
|
|
29
|
+
feasibility: {
|
|
30
|
+
verdict: TraitFeasibility;
|
|
31
|
+
reason: string;
|
|
32
|
+
};
|
|
33
|
+
doc: {
|
|
34
|
+
estBytes: number;
|
|
35
|
+
deps: string[];
|
|
36
|
+
fitsSingleCall: boolean;
|
|
37
|
+
unknownDepSizes: boolean;
|
|
38
|
+
};
|
|
39
|
+
runtime: {
|
|
40
|
+
readsTokenData: boolean;
|
|
41
|
+
reportsTraits: boolean;
|
|
42
|
+
wrongGlobal: string | null;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare function analyzeScript(source: string, declaredDeps?: string[]): ScriptAnalysis;
|
|
46
|
+
/** A one-line lane recommendation derived from the analysis (the decision-tree output). */
|
|
47
|
+
export declare function recommendLane(a: ScriptAnalysis): string;
|
|
48
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../src/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9F,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QAAC,OAAO,E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