@artblocks/abx-cli 0.1.0-alpha.3 → 0.1.0-alpha.31
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 +3694 -0
- package/assets/renderer-scaffold/README.md +2 -2
- package/assets/renderer-scaffold/src/MyRenderer.sol +2 -2
- package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +1 -1
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +17 -0
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +51 -2
- package/dist/bin.d.ts +27 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +64 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/deploy.d.ts +242 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +4764 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/project.d.ts +257 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1299 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/reads.d.ts +64 -0
- package/dist/commands/reads.d.ts.map +1 -0
- package/dist/commands/reads.js +701 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +73 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +679 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/service.d.ts +41 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +618 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/storage.d.ts +51 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +370 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/submit-app.d.ts +58 -0
- package/dist/commands/submit-app.d.ts.map +1 -0
- package/dist/commands/submit-app.js +512 -0
- package/dist/commands/submit-app.js.map +1 -0
- package/dist/config.d.ts +90 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +285 -11
- package/dist/config.js.map +1 -1
- package/dist/conformance.d.ts +31 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +393 -0
- package/dist/conformance.js.map +1 -0
- package/dist/deps.d.ts +6 -39
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +4 -68
- package/dist/deps.js.map +1 -1
- package/dist/errors.d.ts +20 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/flag-allowlists.d.ts +53 -0
- package/dist/flag-allowlists.d.ts.map +1 -0
- package/dist/flag-allowlists.js +157 -0
- package/dist/flag-allowlists.js.map +1 -0
- package/dist/flags.d.ts +45 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +117 -1
- package/dist/flags.js.map +1 -1
- package/dist/jsonout.d.ts +37 -0
- package/dist/jsonout.d.ts.map +1 -0
- package/dist/jsonout.js +68 -0
- package/dist/jsonout.js.map +1 -0
- package/dist/kind.d.ts +61 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +111 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +699 -4736
- package/dist/main.js.map +1 -1
- package/dist/mintpage.d.ts +17 -2
- package/dist/mintpage.d.ts.map +1 -1
- package/dist/mintpage.js +241 -54
- package/dist/mintpage.js.map +1 -1
- package/dist/output.d.ts +179 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +756 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +302 -51
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +1780 -357
- package/dist/ownerops.js.map +1 -1
- package/dist/preview.d.ts +81 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +535 -0
- package/dist/preview.js.map +1 -0
- package/dist/prompt.d.ts +17 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +19 -0
- package/dist/prompt.js.map +1 -0
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +16 -8
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +153 -52
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +406 -46
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +58 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +212 -0
- package/dist/riskgate.js.map +1 -0
- package/dist/scaffold.d.ts +10 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +52 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/schema.d.ts +36 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +121 -26
- package/dist/schema.js.map +1 -1
- package/dist/script-chunks.d.ts +8 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +35 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/served.d.ts +30 -0
- package/dist/served.d.ts.map +1 -0
- package/dist/served.js +112 -0
- package/dist/served.js.map +1 -0
- package/dist/signer.d.ts +13 -0
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +84 -15
- package/dist/signer.js.map +1 -1
- package/dist/update-check.d.ts +83 -4
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +140 -19
- package/dist/update-check.js.map +1 -1
- package/package.json +12 -8
- package/skill/SKILL.md +351 -151
- package/skill/reference/code-projects.md +183 -26
- package/skill/reference/creator-token.md +99 -0
- package/skill/reference/decisions.md +174 -0
- package/skill/reference/hosting.md +63 -19
- package/skill/reference/operating.md +116 -12
- package/skill/reference/setup.md +57 -6
- package/skill/reference/troubleshooting.md +42 -5
- package/dist/inspect.d.ts +0 -48
- package/dist/inspect.d.ts.map +0 -1
- package/dist/inspect.js +0 -184
- package/dist/inspect.js.map +0 -1
- package/dist/migrate.d.ts +0 -65
- package/dist/migrate.d.ts.map +0 -1
- package/dist/migrate.js +0 -180
- package/dist/migrate.js.map +0 -1
- package/dist/onchain-uri.d.ts +0 -97
- package/dist/onchain-uri.d.ts.map +0 -1
- package/dist/onchain-uri.js +0 -243
- package/dist/onchain-uri.js.map +0 -1
- package/dist/upload.d.ts +0 -28
- package/dist/upload.d.ts.map +0 -1
- package/dist/upload.js +0 -41
- package/dist/upload.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ABX in-chain renderer scaffold
|
|
2
2
|
|
|
3
|
-
A ready-to-build Foundry project for the **fully on-chain Solidity
|
|
3
|
+
A ready-to-build Foundry project for the **fully on-chain Solidity renderer lane** — the work is a
|
|
4
4
|
smart contract that computes an SVG (and traits) from the token's `seed` and collector-set
|
|
5
5
|
PostParams. No JavaScript, no browser, no bucket, no resolver, no effect runner: once the renderer
|
|
6
6
|
is deployed and wired, `tokenURI` — name, image, traits — resolves from chain forever.
|
|
@@ -11,7 +11,7 @@ Foundry, then hand the deployed address(es) to `abx deploy-code`, which verifies
|
|
|
11
11
|
## What's here
|
|
12
12
|
|
|
13
13
|
- `src/MyRenderer.sol` — the **image** renderer: seed → geometry, a `palette` HexColor PostParam →
|
|
14
|
-
tint. **Fork the geometry/palette math for your own
|
|
14
|
+
tint. **Fork the geometry/palette math for your own work.**
|
|
15
15
|
- `src/MyTraits.sol` — the **attributes** renderer: reads the *same* seed math so traits agree with
|
|
16
16
|
the image by construction.
|
|
17
17
|
- `src/interfaces/` — the two ABX interfaces you implement/read (`IAbxFieldRenderer`, `IAbxParams`).
|
|
@@ -19,7 +19,7 @@ import {IAbxParams} from "abx/IAbxParams.sol";
|
|
|
19
19
|
/// (declare the `palette` schema, or the param is fixed at the default and collectors
|
|
20
20
|
/// can't set it.) Pair with MyTraits.sol so image AND traits read the SAME seed math.
|
|
21
21
|
///
|
|
22
|
-
/// Swap the geometry/palette math below for your own
|
|
22
|
+
/// Swap the geometry/palette math below for your own work. Keep the FIVE INVARIANTS in
|
|
23
23
|
/// IAbxFieldRenderer — above all, NEVER revert (a revert bricks the whole tokenURI).
|
|
24
24
|
contract MyRenderer is IAbxFieldRenderer {
|
|
25
25
|
using LibString for uint256;
|
|
@@ -53,7 +53,7 @@ contract MyRenderer is IAbxFieldRenderer {
|
|
|
53
53
|
return (CONTENT_TYPE, bytes(_svg(seed, palette)));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// ── the
|
|
56
|
+
// ── the work: seed → geometry, palette → tint (replace with your own) ─────────
|
|
57
57
|
|
|
58
58
|
function _svg(bytes32 seed, string memory palette) private pure returns (string memory) {
|
|
59
59
|
uint256 rings = 3 + (uint8(seed[0]) % 6); // 3..8 rings (MUST match MyTraits' math)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.20;
|
|
3
3
|
|
|
4
|
-
/// @title IAbxFieldRenderer — the contract your in-chain
|
|
4
|
+
/// @title IAbxFieldRenderer — the contract your in-chain work implements
|
|
5
5
|
/// @notice A field renderer returns ONE metadata field's value, COMPUTED from chain state
|
|
6
6
|
/// (the token's seed + PostParams, its owner, anything readable on-chain). The ABX
|
|
7
7
|
/// metadata renderer staticcalls it to build `tokenURI` — e.g. an `image` renderer's
|
|
@@ -10,6 +10,13 @@ pragma solidity ^0.8.20;
|
|
|
10
10
|
/// The tokenData merge rule: a token-scope value overrides the contract-scope one. The
|
|
11
11
|
/// common pattern is `tokenParam` first, then `contractParam` as a fallback (see the
|
|
12
12
|
/// `_param` helper in MyRenderer.sol).
|
|
13
|
+
///
|
|
14
|
+
/// TWO READERS, PICK BY TYPE. Scalar types (`Bool`, `Select`, the ranges, `HexColor`,
|
|
15
|
+
/// `Timestamp`) live entirely in the `bytes32` — read them with `tokenParam` /
|
|
16
|
+
/// `contractParam`. The two payload types, **`Bytes` and `String`**, do NOT: their
|
|
17
|
+
/// `bytes32` is a keccak COMMITMENT (`valueIsHash == true`) and the content is fetched with
|
|
18
|
+
/// `tokenParamData` / `contractParamData` below. Reading a `Bytes` param with `tokenParam`
|
|
19
|
+
/// hands you a hash, not the work — that is the tell you want the data reader.
|
|
13
20
|
interface IAbxParams {
|
|
14
21
|
/// Returns the token-scope param: its bytes32 `value`, `valueIsHash` (true if it commits to
|
|
15
22
|
/// off-chain bytes — a literal scalar like a seed/HexColor is false), and `isSet` (does it exist).
|
|
@@ -23,4 +30,14 @@ interface IAbxParams {
|
|
|
23
30
|
external
|
|
24
31
|
view
|
|
25
32
|
returns (bytes32 value, bool valueIsHash, bool isSet);
|
|
33
|
+
|
|
34
|
+
/// @notice A `Bytes`/`String` token param's FULL content — the payload types' real reader.
|
|
35
|
+
/// Returns empty bytes for a literal scalar or an unset key, so an empty return is your
|
|
36
|
+
/// "fall back to a default" signal. When non-empty, `keccak256(returned bytes)` equals
|
|
37
|
+
/// the `value` that `tokenParam` reports — verify it if you want the commitment proof.
|
|
38
|
+
/// Up to ~24KB per key: enough to carry an actual work payload on-chain.
|
|
39
|
+
function tokenParamData(uint256 tokenId, bytes32 key) external view returns (bytes memory);
|
|
40
|
+
|
|
41
|
+
/// @notice The contract-scope (collection-wide) blob — the fallback when a token has none.
|
|
42
|
+
function contractParamData(bytes32 key) external view returns (bytes memory);
|
|
26
43
|
}
|
|
@@ -13,15 +13,38 @@ contract MockParams is IAbxParams {
|
|
|
13
13
|
mapping(uint256 => mapping(bytes32 => bool)) private ts;
|
|
14
14
|
mapping(bytes32 => bytes32) private cv;
|
|
15
15
|
mapping(bytes32 => bool) private cs;
|
|
16
|
+
// `Bytes`/`String` params: the bytes32 holds keccak(content), the content lives here.
|
|
17
|
+
mapping(uint256 => mapping(bytes32 => bytes)) private td;
|
|
18
|
+
mapping(bytes32 => bytes) private cd;
|
|
16
19
|
|
|
17
20
|
function setToken(uint256 id, bytes32 key, bytes32 val) external { tv[id][key] = val; ts[id][key] = true; }
|
|
18
21
|
function setContract(bytes32 key, bytes32 val) external { cv[key] = val; cs[key] = true; }
|
|
19
22
|
|
|
23
|
+
/// Set a payload-typed (`Bytes`/`String`) param the way the real contract does: the scalar slot
|
|
24
|
+
/// carries the keccak COMMITMENT and `valueIsHash` is true, so a renderer that reads the bytes32
|
|
25
|
+
/// gets a hash — the data reader is the only way to the content.
|
|
26
|
+
function setTokenData(uint256 id, bytes32 key, bytes memory content) external {
|
|
27
|
+
td[id][key] = content;
|
|
28
|
+
tv[id][key] = keccak256(content);
|
|
29
|
+
ts[id][key] = true;
|
|
30
|
+
}
|
|
31
|
+
function setContractData(bytes32 key, bytes memory content) external {
|
|
32
|
+
cd[key] = content;
|
|
33
|
+
cv[key] = keccak256(content);
|
|
34
|
+
cs[key] = true;
|
|
35
|
+
}
|
|
36
|
+
|
|
20
37
|
function tokenParam(uint256 id, bytes32 key) external view returns (bytes32, bool, bool) {
|
|
21
|
-
return (tv[id][key],
|
|
38
|
+
return (tv[id][key], td[id][key].length > 0, ts[id][key]);
|
|
22
39
|
}
|
|
23
40
|
function contractParam(bytes32 key) external view returns (bytes32, bool, bool) {
|
|
24
|
-
return (cv[key],
|
|
41
|
+
return (cv[key], cd[key].length > 0, cs[key]);
|
|
42
|
+
}
|
|
43
|
+
function tokenParamData(uint256 id, bytes32 key) external view returns (bytes memory) {
|
|
44
|
+
return td[id][key];
|
|
45
|
+
}
|
|
46
|
+
function contractParamData(bytes32 key) external view returns (bytes memory) {
|
|
47
|
+
return cd[key];
|
|
25
48
|
}
|
|
26
49
|
}
|
|
27
50
|
|
|
@@ -107,4 +130,30 @@ contract MyRendererTest is Test {
|
|
|
107
130
|
(, bytes memory data) = img.render(address(params), tokenId, IMAGE);
|
|
108
131
|
assertTrue(data.length > 0);
|
|
109
132
|
}
|
|
133
|
+
|
|
134
|
+
/// READING A PAYLOAD PARAM (`Bytes`/`String`) — the pattern for carrying an actual work
|
|
135
|
+
/// payload on-chain. The scalar reader hands you a keccak COMMITMENT with `valueIsHash == true`;
|
|
136
|
+
/// the content only comes from `tokenParamData`. If your renderer reads a `Bytes` param through
|
|
137
|
+
/// `tokenParam` it will draw from a hash and produce garbage, silently — hence this test.
|
|
138
|
+
function test_bytesParam_readViaDataReader() public {
|
|
139
|
+
bytes memory grid = hex"00112233445566778899aabbccddeeff";
|
|
140
|
+
params.setTokenData(0, "grid", grid);
|
|
141
|
+
|
|
142
|
+
// The scalar surface: a commitment, explicitly flagged as one — NOT the content.
|
|
143
|
+
(bytes32 value, bool valueIsHash, bool isSet) = IAbxParams(address(params)).tokenParam(0, "grid");
|
|
144
|
+
assertTrue(isSet);
|
|
145
|
+
assertTrue(valueIsHash, "a Bytes param reports valueIsHash: read the data instead");
|
|
146
|
+
assertEq(value, keccak256(grid));
|
|
147
|
+
|
|
148
|
+
// The data surface: the real bytes, verifiable against that commitment.
|
|
149
|
+
bytes memory got = IAbxParams(address(params)).tokenParamData(0, "grid");
|
|
150
|
+
assertEq(got, grid);
|
|
151
|
+
assertEq(keccak256(got), value, "content must match the on-chain commitment");
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/// An unset payload param returns empty bytes — your "use a default" signal, never a revert.
|
|
155
|
+
function test_bytesParam_unsetIsEmpty() public view {
|
|
156
|
+
assertEq(IAbxParams(address(params)).tokenParamData(0, "grid").length, 0);
|
|
157
|
+
assertEq(IAbxParams(address(params)).contractParamData("grid").length, 0);
|
|
158
|
+
}
|
|
110
159
|
}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* abx — the published binary's entry point, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* This file exists for one reason: **ESM links the entire static import graph before any module
|
|
6
|
+
* body runs.** `main.ts` reaches `@artblocks/abx-indexer` → `node:sqlite` through `output.ts` and
|
|
7
|
+
* `config.ts`, so on a Node that cannot load `node:sqlite` the process dies during *linking* —
|
|
8
|
+
* before a single line of our code executes. A guard at the top of `main.ts` could never fire. The
|
|
9
|
+
* only place a check can run first is a module that imports nothing statically and reaches the rest
|
|
10
|
+
* of the CLI through a dynamic `import()`.
|
|
11
|
+
*
|
|
12
|
+
* What that bought before this file existed: `npm i -g @artblocks/abx-cli && abx doctor` on Node
|
|
13
|
+
* 22.5 printed a raw `ERR_UNKNOWN_BUILTIN_MODULE: No such built-in module: node:sqlite` stack trace.
|
|
14
|
+
* No mention of abx, of Node versions, or of what to do — on the very first command we tell every
|
|
15
|
+
* user to run. (Reported 2026-08-24; `engines` also claimed `>=22.5.0`, which is the bug underneath.)
|
|
16
|
+
*
|
|
17
|
+
* We probe the *capability*, not the version number. `node:sqlite` shipped in v22.5.0 behind
|
|
18
|
+
* `--experimental-sqlite` and lost the flag in v22.13.0 / v23.4.0, so an old Node run with
|
|
19
|
+
* `NODE_OPTIONS=--experimental-sqlite` genuinely works — refusing it on a version comparison would
|
|
20
|
+
* be a false negative on a setup the reporter proved out. `engines` states what we *support*; this
|
|
21
|
+
* guard blocks only what is actually broken.
|
|
22
|
+
*
|
|
23
|
+
* KEEP THIS FILE IMPORT-FREE. A single static `import` of anything in the CLI reintroduces the
|
|
24
|
+
* crash it exists to prevent.
|
|
25
|
+
*/
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=bin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* abx — the published binary's entry point, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* This file exists for one reason: **ESM links the entire static import graph before any module
|
|
6
|
+
* body runs.** `main.ts` reaches `@artblocks/abx-indexer` → `node:sqlite` through `output.ts` and
|
|
7
|
+
* `config.ts`, so on a Node that cannot load `node:sqlite` the process dies during *linking* —
|
|
8
|
+
* before a single line of our code executes. A guard at the top of `main.ts` could never fire. The
|
|
9
|
+
* only place a check can run first is a module that imports nothing statically and reaches the rest
|
|
10
|
+
* of the CLI through a dynamic `import()`.
|
|
11
|
+
*
|
|
12
|
+
* What that bought before this file existed: `npm i -g @artblocks/abx-cli && abx doctor` on Node
|
|
13
|
+
* 22.5 printed a raw `ERR_UNKNOWN_BUILTIN_MODULE: No such built-in module: node:sqlite` stack trace.
|
|
14
|
+
* No mention of abx, of Node versions, or of what to do — on the very first command we tell every
|
|
15
|
+
* user to run. (Reported 2026-08-24; `engines` also claimed `>=22.5.0`, which is the bug underneath.)
|
|
16
|
+
*
|
|
17
|
+
* We probe the *capability*, not the version number. `node:sqlite` shipped in v22.5.0 behind
|
|
18
|
+
* `--experimental-sqlite` and lost the flag in v22.13.0 / v23.4.0, so an old Node run with
|
|
19
|
+
* `NODE_OPTIONS=--experimental-sqlite` genuinely works — refusing it on a version comparison would
|
|
20
|
+
* be a false negative on a setup the reporter proved out. `engines` states what we *support*; this
|
|
21
|
+
* guard blocks only what is actually broken.
|
|
22
|
+
*
|
|
23
|
+
* KEEP THIS FILE IMPORT-FREE. A single static `import` of anything in the CLI reintroduces the
|
|
24
|
+
* crash it exists to prevent.
|
|
25
|
+
*/
|
|
26
|
+
/** Unflagged `node:sqlite`: v22.13.0 on the 22.x line, v23.4.0 on 23.x (nodejs/node#55890). */
|
|
27
|
+
const NODE_FLOOR = '22.13.0';
|
|
28
|
+
const color = !process.env.NO_COLOR && process.stderr.isTTY;
|
|
29
|
+
const red = (s) => (color ? `\x1b[31m${s}\x1b[0m` : s);
|
|
30
|
+
const dim = (s) => (color ? `\x1b[2m${s}\x1b[0m` : s);
|
|
31
|
+
const green = (s) => (color ? `\x1b[32m${s}\x1b[0m` : s);
|
|
32
|
+
/**
|
|
33
|
+
* True when this Node has `node:sqlite` but only behind `--experimental-sqlite` — i.e. the
|
|
34
|
+
* v22.5.0–v22.12.x window (and v23.0–v23.3, which is EOL and not worth naming). Only then is the
|
|
35
|
+
* NODE_OPTIONS escape hatch real; below v22.5.0 the module does not exist at any flag.
|
|
36
|
+
*/
|
|
37
|
+
function flagWouldWork(version) {
|
|
38
|
+
const [major, minor] = version.split('.').map(Number);
|
|
39
|
+
if (major === 22)
|
|
40
|
+
return minor >= 5 && minor < 13;
|
|
41
|
+
return major === 23;
|
|
42
|
+
}
|
|
43
|
+
function nodeSqliteMessage(version) {
|
|
44
|
+
const escape = flagWouldWork(version)
|
|
45
|
+
? `\n Need to stay on this Node? It has SQLite, just flag-gated — but abx is untested there:\n ${green(`NODE_OPTIONS=--experimental-sqlite abx ${process.argv[2] ?? 'doctor'}`)}\n`
|
|
46
|
+
: '';
|
|
47
|
+
return (`\n${red('✗')} abx needs Node's built-in SQLite (${dim('node:sqlite')}), and this Node can't load it.\n\n` +
|
|
48
|
+
` you have ${red(`v${version}`)}\n` +
|
|
49
|
+
` abx needs ${green(`v${NODE_FLOOR}`)} or newer\n\n` +
|
|
50
|
+
` Upgrade Node, then re-run:\n` +
|
|
51
|
+
` ${green('nvm install 22 && nvm use 22')} ${dim('# or: brew upgrade node')}\n` +
|
|
52
|
+
` ${green('abx doctor')}\n` +
|
|
53
|
+
escape);
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
await import('node:sqlite');
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
process.stderr.write(nodeSqliteMessage(process.versions.node));
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
await import('./main.js');
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,+FAA+F;AAC/F,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5D,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CA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AAM,CACP,CAAC;AACJ,CAAC;AAED,IAAI,CAAC;IACH,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;AAC9B,CAAC;AAAC,MAAM,CAAC;IACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { SelfHostIndexer } from '@artblocks/abx-indexer';
|
|
2
|
+
import { type Address, type OnChainFieldInput, type OpenSeaAttribute, type ProjectState, type PublicClient, type SeriesTokenFieldInput } from '@artblocks/abx-sdk';
|
|
3
|
+
import { type Hex } from 'viem';
|
|
4
|
+
import { type StorageOverrides } from '../config.js';
|
|
5
|
+
import { type Flags } from '../flags.js';
|
|
6
|
+
export declare const DIMENSIONS: Record<string, {
|
|
7
|
+
label: string;
|
|
8
|
+
aliases: string[];
|
|
9
|
+
}>;
|
|
10
|
+
export declare function resolveDimension(type: string): string;
|
|
11
|
+
/** Parse `--copies <N|open>` into the `editionSize` InitParams field (`0n` = open/uncapped). Throws
|
|
12
|
+
* with a pointed message on anything else — a bare `--copies` (no value), a non-integer, or the
|
|
13
|
+
* literal `0` (which already has an on-chain meaning — "open" says the same thing without the
|
|
14
|
+
* ambiguity of "did they mean zero copies, or unlimited?"). */
|
|
15
|
+
export declare function parseCopies(raw: string | undefined): bigint;
|
|
16
|
+
/** `--copies 1` is legal — a single-copy ERC-1155 edition — but it is almost never what a creator
|
|
17
|
+
* actually wants (the plain 721 lane makes a simpler, more marketplace-familiar token for exactly
|
|
18
|
+
* one copy). Advisory only; never refused — `--copies` exists precisely so nobody has to reach for
|
|
19
|
+
* a different flag to get an edition. */
|
|
20
|
+
export declare function copiesOneNote(cmd: string): string;
|
|
21
|
+
/** A non-negative-integer flag (`--mint-amount`, …) — the shared parse + bound-check so every
|
|
22
|
+
* edition flag that takes "a count" reports the same, plain-language rejection. */
|
|
23
|
+
export declare function parseNonNegativeIntFlag(raw: string, flag: string): bigint;
|
|
24
|
+
/**
|
|
25
|
+
* A `--dry-run` computes the deterministic deploy address, which is a pure function of
|
|
26
|
+
* (factory, salt, deployer) — so it needs a deployer even though it signs nothing. Resolve it the
|
|
27
|
+
* same way the preview will (`--for`, else an env key) and fail EARLY with the fix if neither
|
|
28
|
+
* exists, rather than after the preview has printed several steps of work.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* A dry run only checks whether a factory address is CONFIGURED, not whether it has code on this
|
|
32
|
+
* chain — and the manifest always has an address, so a chain where the trust anchor isn't deployed
|
|
33
|
+
* (a private/local chain, or a wrong-network RPC) sailed past this and died inside
|
|
34
|
+
* `predictDeterministicAddress` with a raw `returned no data ("0x")` and a list of ABI hypotheses.
|
|
35
|
+
* The real deploy and `abx predict` both explain that case; a preview of the same deploy must too.
|
|
36
|
+
* Returns false when the caller should stop (message already printed).
|
|
37
|
+
*/
|
|
38
|
+
export declare function previewFactoryLive(client: PublicClient, factory: Address, label: string): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Placeholder-identity guard, shared by ALL THREE deploy commands. `name`/`symbol` are written
|
|
41
|
+
* on-chain as the public collection identity and are effectively permanent, so a real deploy must
|
|
42
|
+
* never bake a tool default silently: warn in a preview, HARD-STOP a real send unless `--yes`.
|
|
43
|
+
*
|
|
44
|
+
* It was duplicated per command, and `deploy-series` simply never got a copy — its default
|
|
45
|
+
* "ABX Series"/"ABXS" went on-chain with at most a warning, while the skill promises the CLI
|
|
46
|
+
* refuses demo defaults. (deploy-code's copy even said "mirror deploy/deploy-series", which made
|
|
47
|
+
* the gap look closed.) One predicate now, like `loopbackBaseUrl()`, so a fourth command can't drift.
|
|
48
|
+
*/
|
|
49
|
+
export declare function assertRealIdentity(flags: Flags, o: {
|
|
50
|
+
name: string;
|
|
51
|
+
symbol: string;
|
|
52
|
+
dryRun: boolean;
|
|
53
|
+
}): void;
|
|
54
|
+
export declare function assertPreviewDeployer(flags: Flags): void;
|
|
55
|
+
export declare function warnUnfunded(publicClient: PublicClient, address: Address): Promise<void>;
|
|
56
|
+
export declare function shArg(v: string): string;
|
|
57
|
+
export declare function deployCommandLine(flags: Flags, salt: string): string;
|
|
58
|
+
export declare function deploySeriesCommandLine(flags: Flags, salt: string): string;
|
|
59
|
+
export declare function deployCodeCommandLine(flags: Flags, salt: string): string;
|
|
60
|
+
export declare const imageKeccakField: (value: Hex) => OnChainFieldInput;
|
|
61
|
+
export declare const imageInlineField: (svg: string) => OnChainFieldInput;
|
|
62
|
+
/** An `image` field pointing at an off-chain URL (the renderer emits it verbatim). */
|
|
63
|
+
export declare const imageUrlField: (url: string) => OnChainFieldInput;
|
|
64
|
+
/** An `image` field as a `url-template` — `{id}` is substituted with the tokenId at render, so ONE
|
|
65
|
+
* (collection-scope) field addresses a whole pinned directory / Arweave manifest. */
|
|
66
|
+
export declare const imageUrlTemplateField: (template: string) => OnChainFieldInput;
|
|
67
|
+
/**
|
|
68
|
+
* An `image` field carrying a CONTENT-ADDRESSED identity — the bare CID / txid, with the serving
|
|
69
|
+
* gateway supplied at read time from the collection's `abx_gateway_*` preference (renderer spec v11).
|
|
70
|
+
*
|
|
71
|
+
* This replaces what `--onchain-uri --backend ipfs|arweave` used to write. That path stored the
|
|
72
|
+
* backend's gateway HTTPS URL as a `url` field, which looked identical in a marketplace and was
|
|
73
|
+
* wrong in two ways that only showed up later: the creator's chosen gateway host was welded into a
|
|
74
|
+
* value they might have locked, so a dead gateway became a dead token rather than a repoint; and
|
|
75
|
+
* `abx_provenance` reported `source: url` for bytes that live on IPFS, so the chain stopped saying
|
|
76
|
+
* where the work actually was. The CID is identity and the gateway is a preference — one field each.
|
|
77
|
+
*
|
|
78
|
+
* `{id}` in the value still substitutes at read (the O(1) directory pattern), so a collection-scope
|
|
79
|
+
* `ipfs` field addresses a whole pinned folder exactly as `url-template` does for a plain CDN.
|
|
80
|
+
*/
|
|
81
|
+
export declare const imageContentAddressedField: (network: "ipfs" | "arweave", contentId: string) => OnChainFieldInput;
|
|
82
|
+
export declare const looksLikeSvg: (s: string) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Does the IMAGE itself end up on-chain for this deploy? Two ways it can:
|
|
85
|
+
* • `--onchain-image` — the bytes are staged in the chunk store and read back via a `reader` field.
|
|
86
|
+
* • `--onchain-uri` with an SVG — v1 inlines SVG directly as a data: URI (raster cannot be).
|
|
87
|
+
* Anything else falls through to keccak256 custody, and the on-chain renderer serves its PLACEHOLDER
|
|
88
|
+
* image. This distinction is the difference between a token that is durable and one that only looks
|
|
89
|
+
* durable, so it must be computed from the actual file — never inferred from the flag alone (the
|
|
90
|
+
* success banner used to claim "fully on-chain, no hosting needed" for a keccak-anchored raster).
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* Will `tokenURI` resolve to the creator's REAL image, with nothing to keep running?
|
|
94
|
+
*
|
|
95
|
+
* Three ways yes, and they are not the same promise: the bytes are on-chain
|
|
96
|
+
* ({@link imageEndsUpOnChain}), or they sit at a durable public URL that the on-chain JSON points at
|
|
97
|
+
* (a direct-URL backend — the "no server" pattern). Only `fs` custody under `--onchain-uri` fails,
|
|
98
|
+
* because the renderer then holds a hash and nothing can serve it. Keep this separate from
|
|
99
|
+
* "fully on-chain": conflating them is what let a keccak-anchored raster ship under a permanence
|
|
100
|
+
* banner it did not earn.
|
|
101
|
+
*/
|
|
102
|
+
export declare function imageResolvesWithoutServer(flags: Flags, onchainImage: boolean): boolean;
|
|
103
|
+
export declare function imageEndsUpOnChain(flags: Flags, onchainImage: boolean): boolean;
|
|
104
|
+
/** A browser wallet reached through an open sign session, used as the Turbo (Arweave) upload
|
|
105
|
+
* identity so the wallet's own credits pay — `signMessage` returns the `0x` EIP-191 signature. */
|
|
106
|
+
export type RemoteEthUpload = {
|
|
107
|
+
address: Address;
|
|
108
|
+
signMessage: (message: Uint8Array) => Promise<string>;
|
|
109
|
+
};
|
|
110
|
+
export declare function prepareContent(imagePath: string | undefined, clone: Address, overrides: StorageOverrides, store?: boolean, // false for --dry-run: compute the hash but don't custody bytes
|
|
111
|
+
onChain?: boolean, // true (--onchain-uri): put the image ON-CHAIN (inline SVG) so it self-resolves
|
|
112
|
+
remoteEth?: RemoteEthUpload, // wallet-lane Turbo uploads: sign+pay with the connected browser wallet
|
|
113
|
+
walletAddr?: string, // the deployer wallet — checked for existing Turbo credits if the managed key is short
|
|
114
|
+
gatewayFlags?: Flags): Promise<{
|
|
115
|
+
tokenFields: OnChainFieldInput[];
|
|
116
|
+
contentNote: string;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Real OpenSea traits supplied by the creator, from `--attributes <file.json>` (canonical array or
|
|
120
|
+
* `{name: value}` map) and/or `--traits "Background=Blue; Edition=3"` (quick inline form). These are
|
|
121
|
+
* the marketplace trait array — NOT a place for protocol facts. Empty when neither flag is given.
|
|
122
|
+
*/
|
|
123
|
+
export declare function parseDeployTraits(flags: Flags): OpenSeaAttribute[];
|
|
124
|
+
/** Encode creator traits as the on-chain `attributes` field (inline JSON bytes) — for `--traits-onchain`. */
|
|
125
|
+
export declare const attributesInlineField: (attrs: OpenSeaAttribute[]) => OnChainFieldInput;
|
|
126
|
+
/**
|
|
127
|
+
* Warn when IPFS/Arweave custody is pointed at a LOCAL gateway.
|
|
128
|
+
*
|
|
129
|
+
* Two distinct problems ride on one flag, and the warning names the one that actually applies. The
|
|
130
|
+
* bytes are pinned only to a node on this machine, so nothing off it can retrieve them — that is the
|
|
131
|
+
* real damage and it survives any later `set-gateway`. It ALSO used to weld that localhost host into
|
|
132
|
+
* the on-chain value; since the field holds a bare CID it no longer does (the serving prefix is the
|
|
133
|
+
* collection's preference), so promising "the served URL resolves only on THIS machine" would now be
|
|
134
|
+
* false and would point the creator at the wrong repair.
|
|
135
|
+
*/
|
|
136
|
+
export declare function localGatewayWarning(flags: Flags): string | null;
|
|
137
|
+
/** A readout line for an optional creator text field — states exactly what's written (and where),
|
|
138
|
+
* or that NOTHING is, so the deploy never silently invents one. */
|
|
139
|
+
export declare function describeDeployField(label: string, value: string | undefined, onchain: boolean): string;
|
|
140
|
+
/** Readout lines for whichever authorship/rights fields a deploy will write (always on-chain,
|
|
141
|
+
* inline collection fields). Empty when none are set — so the readout stays quiet by default. */
|
|
142
|
+
export declare function authorshipReadout(flags: Flags): string[];
|
|
143
|
+
/** A readout line for creator traits — the exact traits written (and where), or that none are. */
|
|
144
|
+
export declare function describeTraits(traits: OpenSeaAttribute[], onchain: boolean): string;
|
|
145
|
+
export declare function cmdDeploy(flags: Flags, serveAfter: boolean): Promise<void>;
|
|
146
|
+
export declare function cmdDeployBody(flags: Flags, serveAfter: boolean, emit: (p: Record<string, unknown>) => void): Promise<void>;
|
|
147
|
+
export declare function cmdDeployOneOfOneEditionBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
|
|
148
|
+
export declare const tokenFieldOf: (tokenId: number, f: OnChainFieldInput) => SeriesTokenFieldInput;
|
|
149
|
+
export declare function cmdDeploySeries(flags: Flags): Promise<void>;
|
|
150
|
+
export declare function cmdDeploySeriesBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
|
|
151
|
+
export declare function cmdDeployEditionImageBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* The deterministic part of a projection: everything that is a pure function of the chain.
|
|
154
|
+
* Deliberately EXCLUDES `reconstructedAt`, `rpcUrl` and `toBlock` — a timestamp, the endpoint that
|
|
155
|
+
* happened to answer, and the head at scan time all legitimately differ between two replays, so
|
|
156
|
+
* folding them in would make the rebuild proof fail for reasons that aren't about correctness.
|
|
157
|
+
*/
|
|
158
|
+
export declare function projectionFingerprint(s: ProjectState): string;
|
|
159
|
+
/**
|
|
160
|
+
* Print the reconstructed spine — the point being that this list IS the database. Rendered inside
|
|
161
|
+
* the index step (no header of its own: "Index it — replay the event spine" immediately followed by
|
|
162
|
+
* a separate "The event spine" step read as a stutter).
|
|
163
|
+
*/
|
|
164
|
+
export declare function walkthroughSpine(state: ProjectState): void;
|
|
165
|
+
/**
|
|
166
|
+
* [4] The claim, demonstrated: delete the local projection and rebuild it from the chain.
|
|
167
|
+
*
|
|
168
|
+
* This is the one step that can't be faked by good output — it drops the projection for real
|
|
169
|
+
* (registration kept), confirms it's gone, replays from the deploy block, and compares a
|
|
170
|
+
* fingerprint of everything chain-derived. If ABX's premise is wrong, this step fails loudly.
|
|
171
|
+
*/
|
|
172
|
+
export declare function walkthroughRebuild(indexer: SelfHostIndexer, address: Address, before: ProjectState): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* [5] Read the token back the way a marketplace would.
|
|
175
|
+
*
|
|
176
|
+
* Which is genuinely a different act per lane, so it reads from the real source in each case rather
|
|
177
|
+
* than always going through the local server:
|
|
178
|
+
* • fully on-chain → call `tokenURI(0)` on the contract. That IS what a marketplace does, and on
|
|
179
|
+
* this lane the whole answer (content included) comes back from the chain with nothing else running.
|
|
180
|
+
* • off-chain custody → fetch the resolver, because that's what the baked URI points at.
|
|
181
|
+
* Reading the on-chain lane over HTTP would have quietly implied the local server was load-bearing
|
|
182
|
+
* when it isn't — the opposite of the lesson.
|
|
183
|
+
*/
|
|
184
|
+
export declare function walkthroughReadBack(state: ProjectState, baseUrl: string, onChainUri: boolean): Promise<void>;
|
|
185
|
+
/** Every flag `deploy-code` recognizes — so an unsupported/typo'd one warns instead of silently
|
|
186
|
+
* no-opping. Keep in lockstep with the flags read below + the storageOverrides/lane helpers. */
|
|
187
|
+
export declare const DEPLOY_CODE_FLAGS: Set<string>;
|
|
188
|
+
export declare const SHARED_DEPLOY_FLAGS: string[];
|
|
189
|
+
export declare const DEPLOY_FLAGS: Set<string>;
|
|
190
|
+
export declare const DEPLOY_SERIES_FLAGS: Set<string>;
|
|
191
|
+
export declare const DEPLOY_EDITION_FLAGS: Set<string>;
|
|
192
|
+
export declare const DEPLOY_SERIES_EDITION_FLAGS: Set<string>;
|
|
193
|
+
export declare function cmdDeployCode(flags: Flags): Promise<void>;
|
|
194
|
+
export declare function cmdDeployCodeBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
|
|
195
|
+
export declare const DEPLOY_CODE_EDITION_FLAGS: Set<string>;
|
|
196
|
+
export declare function cmdDeployEditionCodeBody(flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Resolve `--721c` into the InitParams `transferValidator`. Absent → `zeroAddress`: a plain
|
|
199
|
+
* ERC-721 (or, on an edition deploy, a plain ERC-1155), byte-for-byte the pre-721C deploy — no
|
|
200
|
+
* prompts, no output, no mention of 721C. `--721c` / `--721c recommended` → the per-chain
|
|
201
|
+
* recommended validator (refused, naming the chains that have one, when the manifest has no
|
|
202
|
+
* entry); `--721c 0x…` → checksum-validated AND pre-checked for code on this chain (the factory
|
|
203
|
+
* would revert `InvalidTransferValidator()` — surface it before any upload/staging/gas). When
|
|
204
|
+
* enrolling, prints the one plain statement of what enforcement means — once, adapted to the
|
|
205
|
+
* chosen validator.
|
|
206
|
+
*
|
|
207
|
+
* `standard` picks only the WORDING (`ERC-721C` vs `ERC-1155C`) — the flag, the value grammar, and
|
|
208
|
+
* the resolved validator address are identical either way (the SAME `InitParams.transferValidator`
|
|
209
|
+
* opt-in per the parity plan's locked decision 3: 1155C ships with the same UX as 721C). Editions
|
|
210
|
+
* pass `'1155C'`; every 721 call site keeps the default, so their output is unchanged.
|
|
211
|
+
*/
|
|
212
|
+
export declare function resolveTransferValidatorFlag(flags: Flags, publicClient: PublicClient, dryRun: boolean, standard?: '721C' | '1155C'): Promise<Address>;
|
|
213
|
+
/**
|
|
214
|
+
* Resolve the three-way seed decision into the InitParams `seedSource`, for both code lanes:
|
|
215
|
+
*
|
|
216
|
+
* - `--no-seed` → `zeroAddress`. No mint-time seed at all.
|
|
217
|
+
* - nothing, or `canonical` → the canonical `AbxSeedSource` via `ensureSeedSource` (manifest →
|
|
218
|
+
* self-heal to the deterministic address → CREATE2-deploy it). This
|
|
219
|
+
* is today's behaviour, byte-for-byte, and stays the default.
|
|
220
|
+
* - `--seed-source 0x…` → the creator's own `IAbxSeedSource`, **probed first**.
|
|
221
|
+
*
|
|
222
|
+
* The flag exists because we tell creators, in the docs and in this command's own help, that the fix
|
|
223
|
+
* for "the canonical seed isn't strong enough for my raffle" is to point `seedSource` at a
|
|
224
|
+
* commit-reveal / VRF-backed source of their own. Until now the only route was an `ABX_SEED_SOURCE`
|
|
225
|
+
* env var checked for nothing but code length, which made a first-class promise out of a
|
|
226
|
+
* side entrance.
|
|
227
|
+
*
|
|
228
|
+
* **Everything that isn't the canonical singleton gets probed**, including an address that arrived
|
|
229
|
+
* via `ABX_SEED_SOURCE` — so the env lane keeps working and stops being the unchecked one. The
|
|
230
|
+
* comparison is against the deterministic canonical address rather than "did a flag say so", because
|
|
231
|
+
* that is the actual question (is this our audited bytecode, or someone's contract we know nothing
|
|
232
|
+
* about?). A dry run tolerates an unreachable RPC and says the check is deferred; a real deploy
|
|
233
|
+
* refuses to bake a seed source it couldn't verify.
|
|
234
|
+
*
|
|
235
|
+
* The probe here runs with **no `from`**, unlike the owner op's (which calls as the token). That is
|
|
236
|
+
* not an oversight: the clone's address is a function of the CREATE2 salt, which isn't reserved yet
|
|
237
|
+
* at this point, so a source that gates on `msg.sender` could not have been told about this token in
|
|
238
|
+
* the first place. A gated/commit-reveal source is a deploy-then-`abx set-seed-source` flow by
|
|
239
|
+
* construction, and the `reverted` refusal says exactly that.
|
|
240
|
+
*/
|
|
241
|
+
export declare function resolveSeedSourceFlag(flags: Flags, publicClient: PublicClient, dryRun: boolean, chainId: number): Promise<Address>;
|
|
242
|
+
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../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