@artblocks/abx-cli 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.
- package/CHANGELOG.md +161 -0
- package/assets/renderer-scaffold/README.md +41 -11
- package/assets/renderer-scaffold/foundry.toml +5 -0
- package/assets/renderer-scaffold/remappings.txt +1 -1
- package/assets/renderer-scaffold/script/DeployHooks.s.sol +24 -0
- package/assets/renderer-scaffold/script/Preview.s.sol +99 -0
- package/assets/renderer-scaffold/src/MyHooks.sol +20 -0
- package/assets/renderer-scaffold/src/MyRenderer.sol +4 -4
- package/assets/renderer-scaffold/src/MyTraits.sol +2 -2
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +60 -3
- package/dist/bin.d.ts +26 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +63 -0
- package/dist/bin.js.map +1 -0
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +144 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/commands/auth.d.ts +54 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +447 -0
- package/dist/commands/auth.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 +5429 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/feedback.d.ts +7 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +147 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/maintenance.d.ts +4 -0
- package/dist/commands/maintenance.d.ts.map +1 -0
- package/dist/commands/maintenance.js +114 -0
- package/dist/commands/maintenance.js.map +1 -0
- package/dist/commands/project.d.ts +429 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1720 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/reads.d.ts +85 -0
- package/dist/commands/reads.d.ts.map +1 -0
- package/dist/commands/reads.js +868 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +89 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +738 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/service.d.ts +67 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +748 -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 +399 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/submit-app.d.ts +102 -0
- package/dist/commands/submit-app.d.ts.map +1 -0
- package/dist/commands/submit-app.js +622 -0
- package/dist/commands/submit-app.js.map +1 -0
- package/dist/config.d.ts +105 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +351 -12
- 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 +390 -0
- package/dist/conformance.js.map +1 -0
- package/dist/contract-read-error.d.ts +5 -0
- package/dist/contract-read-error.d.ts.map +1 -0
- package/dist/contract-read-error.js +37 -0
- package/dist/contract-read-error.js.map +1 -0
- package/dist/deploy-plan.d.ts +150 -0
- package/dist/deploy-plan.d.ts.map +1 -0
- package/dist/deploy-plan.js +31 -0
- package/dist/deploy-plan.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 +184 -0
- package/dist/flag-allowlists.js.map +1 -0
- package/dist/flags.d.ts +47 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +125 -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 +79 -0
- package/dist/jsonout.js.map +1 -0
- package/dist/kind.d.ts +57 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +122 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +786 -4838
- 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 +780 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +381 -57
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +2014 -359
- package/dist/ownerops.js.map +1 -1
- package/dist/preview.d.ts +23 -5
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +95 -43
- package/dist/preview.js.map +1 -1
- 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 +3 -13
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +19 -21
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +157 -52
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +435 -46
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +62 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +234 -0
- package/dist/riskgate.js.map +1 -0
- package/dist/scaffold.d.ts +12 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +56 -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 +86 -5
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +161 -20
- package/dist/update-check.js.map +1 -1
- package/package.json +13 -12
- package/skill/SKILL.md +181 -347
- package/skill/agents/openai.yaml +4 -0
- package/skill/reference/capabilities.md +188 -0
- package/skill/reference/code.md +220 -0
- package/skill/reference/creator-token.md +94 -0
- package/skill/reference/deploy.md +174 -0
- package/skill/reference/diagnose.md +178 -0
- package/skill/reference/hosting.md +186 -93
- package/skill/reference/operate.md +220 -0
- package/skill/reference/services.md +121 -0
- package/skill/reference/setup.md +154 -36
- package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
- 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
- package/skill/reference/code-projects.md +0 -246
- package/skill/reference/operating.md +0 -116
- package/skill/reference/troubleshooting.md +0 -28
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
|
-
import { type ArweaveJwk, type ResolveStorageOptions } from '@artblocks/abx-storage';
|
|
2
|
-
import { type Address } from '@artblocks/abx-sdk';
|
|
1
|
+
import { type ArweaveJwk, type ResolveStorageOptions, type StorageBackend } from '@artblocks/abx-storage';
|
|
2
|
+
import { type Address, type ProjectState } from '@artblocks/abx-sdk';
|
|
3
|
+
import { SelfHostIndexer } from '@artblocks/abx-indexer';
|
|
4
|
+
import { type Flags } from './flags.js';
|
|
5
|
+
/**
|
|
6
|
+
* The active chain key — the ONE place it's derived (`ABX_CHAIN` → the shipped default). main.ts
|
|
7
|
+
* and ownerops.ts each used to carry their own identical `process.env.ABX_CHAIN ?? DEFAULT_CHAIN_KEY`
|
|
8
|
+
* (one flagged "MUST match main.ts/config.ts" in its own comment) — two copies whose only job was
|
|
9
|
+
* to agree with each other, which is exactly the setup a future edit drifts out of. Both import it
|
|
10
|
+
* from here now.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CHAIN: string;
|
|
13
|
+
export declare const chainId: () => number;
|
|
14
|
+
export declare const explorerBase: () => string;
|
|
15
|
+
/**
|
|
16
|
+
* The ONE place the CLI resolves its data directory — every other function in this file that
|
|
17
|
+
* touches disk (`localIndexer`, `storageOptions`, `arweaveKeyFile`, `loadArweaveJwk`) calls this
|
|
18
|
+
* rather than deriving its own path, so a single invocation always agrees with itself about which
|
|
19
|
+
* node it's operating on (issue #121's "keep managed Arweave key location and projection location
|
|
20
|
+
* coherent" criterion — the two used to be independently resolved and could silently diverge).
|
|
21
|
+
*
|
|
22
|
+
* Memoized per process (like `CHAIN` above): resolved once, so a "found in a parent directory"
|
|
23
|
+
* notice prints exactly once no matter how many call sites ask, and a discovery decision made at
|
|
24
|
+
* the top of a run can't flip partway through it.
|
|
25
|
+
*/
|
|
3
26
|
export declare function dataDir(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Make the data dir ignore itself, before anything sensitive lands in it.
|
|
29
|
+
*
|
|
30
|
+
* `.abx-self-host/` holds this node's projection AND the managed Arweave key — a real, signing-capable
|
|
31
|
+
* credential that also holds prepaid upload credits. The toolkit's own repo gitignores the directory,
|
|
32
|
+
* and the skill said so; a *creator's* repo does not, so a first `--backend arweave` run could leave a
|
|
33
|
+
* key staged for commit with nothing having said a word. A `.gitignore` containing `*` INSIDE the
|
|
34
|
+
* directory ignores the whole tree regardless of the enclosing repo's config, needs no edit to a file
|
|
35
|
+
* we don't own, and is inert outside git.
|
|
36
|
+
*
|
|
37
|
+
* Never overwrites an existing one — a creator who tightened or loosened it made a decision.
|
|
38
|
+
*/
|
|
39
|
+
export declare function guardDataDirFromGit(): void;
|
|
40
|
+
/** The process-lifetime local indexer (this node's own SQLite-backed projection). Never pass a
|
|
41
|
+
* chain-varying argument through here — it's a bare singleton, constructed once on first use.
|
|
42
|
+
* Passes `dataDir()` explicitly rather than letting `SqliteStore` fall back on its own — that
|
|
43
|
+
* fallback exists for a caller with no data-dir context of its own, and this call site has one:
|
|
44
|
+
* passing it is what keeps a discovered parent directory (see `dataDir` above) actually reaching
|
|
45
|
+
* the projection, instead of the store quietly reopening at plain cwd behind its back. */
|
|
46
|
+
export declare function localIndexer(): SelfHostIndexer;
|
|
4
47
|
/**
|
|
5
48
|
* Whether `baseUrl` is a localhost/loopback address — a URL that, once baked into an on-chain
|
|
6
49
|
* `tokenURI`/`contractURI`, resolves for NO ONE off this machine. The single source of truth for
|
|
@@ -8,6 +51,17 @@ export declare function dataDir(): string;
|
|
|
8
51
|
* duplicated inline — that drift is exactly how `deploy-code` shipped without the guard).
|
|
9
52
|
*/
|
|
10
53
|
export declare function loopbackBaseUrl(baseUrl: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A short faucet pointer for a testnet — a 0-balance signer's #1 next step. A known URL plus a
|
|
56
|
+
* search hint (URLs rot; the search always works), so "fund it" is never a dead end.
|
|
57
|
+
*
|
|
58
|
+
* Lives here rather than in main.ts because the browser-wallet signing prompt needs it too, and
|
|
59
|
+
* importing main.ts would execute the CLI. That prompt is the one funding surface `warnUnfunded`
|
|
60
|
+
* can't cover: on the `--sign` lane without `--for` we don't learn the address until the wallet
|
|
61
|
+
* connects, so the up-front balance check never runs and the only warning a creator would get is
|
|
62
|
+
* a failed transaction.
|
|
63
|
+
*/
|
|
64
|
+
export declare function faucetHint(chainKey: string): string;
|
|
11
65
|
/** Canonical clone factory for the active chain — flag override → `ABX_FACTORY` → manifest. */
|
|
12
66
|
export declare function factoryAddress(override?: string): Address | null;
|
|
13
67
|
/** Canonical Series clone factory — flag override → `ABX_SERIES_FACTORY` → manifest. */
|
|
@@ -18,6 +72,14 @@ export declare function rendererAddress(override?: string): Address | null;
|
|
|
18
72
|
export declare function chunkStoreAddress(override?: string): Address | null;
|
|
19
73
|
/** Canonical shared fixed-price minter — flag override → `ABX_FIXED_PRICE_MINTER` → manifest. */
|
|
20
74
|
export declare function fixedPriceMinterAddress(override?: string): Address | null;
|
|
75
|
+
/** Canonical 1/1-edition clone factory — flag override → `ABX_ONE_OF_ONE_EDITION_FACTORY` → manifest. */
|
|
76
|
+
export declare function oneOfOneEditionFactoryAddress(override?: string): Address | null;
|
|
77
|
+
/** Canonical multi-work edition clone factory — flag override → `ABX_EDITION_FACTORY` → manifest. */
|
|
78
|
+
export declare function editionFactoryAddress(override?: string): Address | null;
|
|
79
|
+
/** Canonical code-project edition clone factory — flag override → `ABX_EDITION_CODE_FACTORY` → manifest. */
|
|
80
|
+
export declare function editionCodeFactoryAddress(override?: string): Address | null;
|
|
81
|
+
/** Canonical shared fixed-price EDITION minter — flag override → `ABX_FIXED_PRICE_MINTER_1155` → manifest. */
|
|
82
|
+
export declare function fixedPriceMinter1155Address(override?: string): Address | null;
|
|
21
83
|
/** Per-invocation storage overrides parsed from flags (e.g. `abx deploy --backend cloud --bucket …`). */
|
|
22
84
|
export interface StorageOverrides {
|
|
23
85
|
backend?: string;
|
|
@@ -66,4 +128,45 @@ export declare function ensureArweaveJwk(): {
|
|
|
66
128
|
created: boolean;
|
|
67
129
|
path: string;
|
|
68
130
|
};
|
|
131
|
+
/** Per-invocation storage overrides parsed from deploy flags (the hybrid: config, overridable). */
|
|
132
|
+
export declare function storageOverrides(flags: Flags): StorageOverrides;
|
|
133
|
+
/** Surface the free-vs-credit decision for a Turbo upload from the LOCAL byte size — no network,
|
|
134
|
+
* so it works in `--dry-run` too. Under 100 KiB is free; above, it draws on prepaid credits. The
|
|
135
|
+
* decision itself (`isTurboArweave` + the size threshold) is the storage package's
|
|
136
|
+
* {@link planTurboUpload}; this is just its narration. */
|
|
137
|
+
export declare function noteArweavePlan(opts: ResolveStorageOptions, size: number): void;
|
|
138
|
+
/**
|
|
139
|
+
* Dry-run storage-readiness: surface what a REAL off-chain deploy needs, from local info only, so
|
|
140
|
+
* "dry-run passes → deploy fails at upload" can't happen. Covers Arweave credit needs, a missing
|
|
141
|
+
* Pinata JWT, and a missing cloud public base. `sizes` are the per-file byte sizes. The readiness
|
|
142
|
+
* FACTS (chargeable-bytes accounting, the USD estimate, the missing-JWT/public-base checks) are the
|
|
143
|
+
* storage package's {@link assessStorageReadiness}; this is just its narration.
|
|
144
|
+
*/
|
|
145
|
+
export declare function noteStorageReadiness(opts: ResolveStorageOptions, sizes: number[]): Promise<void>;
|
|
146
|
+
/** Create + announce the managed Turbo identity right before the first upload that needs it.
|
|
147
|
+
* Mutates `opts.arweave.jwk` so the resolved backend can sign. No-op for non-Turbo custody, or
|
|
148
|
+
* when an ETH identity (`.env` key or a wallet-session remote signer) is already selected — that
|
|
149
|
+
* identity pays, so we don't mint an unused managed key. */
|
|
150
|
+
export declare function ensureArweaveIdentityForUpload(opts: ResolveStorageOptions): void;
|
|
151
|
+
/**
|
|
152
|
+
* Pre-upload FUNDS guard for Turbo (arweave). Runs before a real off-chain deploy so a credit
|
|
153
|
+
* shortfall stops *here* — with the exact address + fund options — instead of failing mid-deploy
|
|
154
|
+
* after some txs already landed. Only fires for chargeable files (≥100 KB); free-tier uploads skip
|
|
155
|
+
* it. Best-effort: if the price/balance APIs are unreachable it degrades to a warning, never a false
|
|
156
|
+
* block. `sizes` are per-file byte sizes. The funds decision itself is the storage package's
|
|
157
|
+
* {@link assessTurboFunds}; this is the narration + the throw messages built from its report.
|
|
158
|
+
*/
|
|
159
|
+
export declare function assertTurboFundsForUpload(opts: ResolveStorageOptions, sizes: number[], walletAddr?: string): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Resolve durable locators (`ipfs://<cid>` / `ar://<txid>`) for a project's off-chain-by-hash
|
|
162
|
+
* fields, from THIS machine's content index via the backend. This is the bridge a remote resolver
|
|
163
|
+
* needs: the on-chain commitment is a keccak256, but the CID/txid that addresses the bytes lives in
|
|
164
|
+
* the deployer's local index — ship it so the resolver can point `image` at IPFS without the bytes.
|
|
165
|
+
* Returns `{ "0x<hash>": "ipfs://<cid>" }` (lowercased), empty when nothing is locatable here.
|
|
166
|
+
*/
|
|
167
|
+
export declare function collectContentLocators(state: ProjectState, backend: StorageBackend): Promise<Record<string, string>>;
|
|
168
|
+
/** Locators to bridge to a remote resolver: the ones the local deploy already stored, else freshly
|
|
169
|
+
* resolved from this machine's local projection + content index (e.g. `abx add <addr> --remote`
|
|
170
|
+
* for a contract deployed elsewhere on this same machine). */
|
|
171
|
+
export declare function remoteLocators(address: Address, stored: string | undefined, flags: Flags): Promise<Record<string, string>>;
|
|
69
172
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAeL,KAAK,OAAO,EACZ,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,eAAe,EAAc,MAAM,wBAAwB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ync } from 'node:fs';
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { loadDotEnv, resolveDataDir } from '@artblocks/abx-sdk/node';
|
|
4
|
+
import { arweaveAddress, generateArweaveJwk, resolveArweaveJwk, assessStorageReadiness, assessTurboFunds, isTurboArweave, planTurboUpload, resolveBackend, } from '@artblocks/abx-storage';
|
|
5
|
+
import { resolveChain, DEFAULT_CHAIN_KEY, resolveFactory, resolveSeriesFactory, resolveRenderer, resolveChunkStore, resolveFixedPriceMinter, resolveOneOfOneEditionFactory, resolveEditionFactory, resolveEditionCodeFactory, resolveFixedPriceMinter1155, envSigningKey, explorerUrl, METADATA_REPRESENTATION as R, } from '@artblocks/abx-sdk';
|
|
6
|
+
import { SelfHostIndexer, SqliteStore } from '@artblocks/abx-indexer';
|
|
7
|
+
import { bold, dim, g, info, warn } from './output.js';
|
|
5
8
|
/**
|
|
6
9
|
* Runtime resolution for the CLI — deliberately **stateless about decisions**. There is no
|
|
7
10
|
* tool-written config file: every choice is resolved fresh per invocation from explicit flags,
|
|
@@ -16,10 +19,141 @@ import { resolveChain, DEFAULT_CHAIN_KEY, resolveFactory, resolveSeriesFactory,
|
|
|
16
19
|
* The only thing that persists on disk is the project-local, chain-rebuildable projection
|
|
17
20
|
* (the indexer's SQLite store under the data dir) — that's DATA, not config.
|
|
18
21
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
// `.env` MUST be loaded before the line below, and this is the only place that can guarantee it.
|
|
23
|
+
//
|
|
24
|
+
// `CHAIN` is a module-level const, so it evaluates when this module is first imported — which
|
|
25
|
+
// happens while the import graph loads, BEFORE `main()` runs and calls `loadDotEnv()`. So
|
|
26
|
+
// `ABX_CHAIN=sepolia` in a `.env` was read too late and silently lost: the CLI announced
|
|
27
|
+
// `base-sepolia` and acted on it. Every other setting escaped this because it is read lazily inside
|
|
28
|
+
// a function (`storageOptions()`, the signing key at send time), by which point `.env` is loaded —
|
|
29
|
+
// `ABX_CHAIN` was the one eager read, and the highest-stakes one to get wrong. On a funded send, an
|
|
30
|
+
// ignored value can cause a wrong-chain deploy with real artifacts at an
|
|
31
|
+
// address nobody meant — the same consequence that made the swallowed `--chain` flag a bug worth
|
|
32
|
+
// fixing (see main.ts), reached by a different route.
|
|
33
|
+
//
|
|
34
|
+
// `loadDotEnv` is idempotent, so main.ts's call stays as the entry-point safety net for any path
|
|
35
|
+
// that does not import this module first.
|
|
36
|
+
loadDotEnv();
|
|
37
|
+
/**
|
|
38
|
+
* The active chain key — the ONE place it's derived (`ABX_CHAIN` → the shipped default). main.ts
|
|
39
|
+
* and ownerops.ts each used to carry their own identical `process.env.ABX_CHAIN ?? DEFAULT_CHAIN_KEY`
|
|
40
|
+
* (one flagged "MUST match main.ts/config.ts" in its own comment) — two copies whose only job was
|
|
41
|
+
* to agree with each other, which is exactly the setup a future edit drifts out of. Both import it
|
|
42
|
+
* from here now.
|
|
43
|
+
*/
|
|
44
|
+
export const CHAIN = process.env.ABX_CHAIN ?? DEFAULT_CHAIN_KEY;
|
|
45
|
+
export const chainId = () => resolveChain(CHAIN).id;
|
|
46
|
+
// Block explorer base for the tx/address links the CLI prints. Derived from viem's chain metadata via
|
|
47
|
+
// the SDK (see explorerUrl) rather than a local table — this used to be a hand-maintained map, which is
|
|
48
|
+
// the same shape of bug that had the token-api dashboard sending every Base Sepolia link to Etherscan.
|
|
49
|
+
//
|
|
50
|
+
// LAZY (a function, not a top-level const): main.ts's `assertKnownChainEnv` has to run BEFORE any
|
|
51
|
+
// chain-derived value is computed, so an unknown ABX_CHAIN gets its graceful "not a chain this
|
|
52
|
+
// toolkit ships" message instead of a raw `resolveChain` stack trace. That guard runs at module
|
|
53
|
+
// load, before main.ts's own body — but config.ts is imported (and fully evaluated) even earlier,
|
|
54
|
+
// as part of loading main.ts's imports. An eager `const EXPLORER = explorerUrl(resolveChain(CHAIN).id)`
|
|
55
|
+
// here would evaluate on a bad ABX_CHAIN before the guard ever gets a turn, exactly the crash it
|
|
56
|
+
// exists to prevent (see that function's doc comment) — so this is a getter, resolved lazily on
|
|
57
|
+
// each read, the same pattern `chainId()` above already uses.
|
|
58
|
+
export const explorerBase = () => explorerUrl(resolveChain(CHAIN).id);
|
|
59
|
+
/**
|
|
60
|
+
* Commands where finding an ALREADY-EXISTING `.abx-self-host` in an ancestor directory is worth
|
|
61
|
+
* the search: pure reads/reports where opening the wrong (empty) node produces a *silently wrong*
|
|
62
|
+
* answer rather than a refusal — issue #121's motivating case, `abx status` run one directory off
|
|
63
|
+
* from where a project was deployed reporting an empty node instead of the real one.
|
|
64
|
+
*
|
|
65
|
+
* Deliberately narrow, and every write command (deploy, mint, add, index, set-…) is deliberately
|
|
66
|
+
* ABSENT: a write must never land in a directory the operator didn't `cd` into, so those always
|
|
67
|
+
* resolve strictly to cwd (see {@link dataDir}'s call to {@link resolveDataDir} below). Growing
|
|
68
|
+
* this set is a real decision (it changes which commands can print the "found in a parent
|
|
69
|
+
* directory" notice), not a place to reflexively add a new read command.
|
|
70
|
+
*/
|
|
71
|
+
const DATA_DIR_DISCOVERY_COMMANDS = new Set([
|
|
72
|
+
'status',
|
|
73
|
+
'state',
|
|
74
|
+
'verify',
|
|
75
|
+
'doctor',
|
|
76
|
+
'capabilities',
|
|
77
|
+
'tokens',
|
|
78
|
+
'tokenuri',
|
|
79
|
+
'contracturi',
|
|
80
|
+
'inspect',
|
|
81
|
+
]);
|
|
82
|
+
/** Whether the ACTIVE command (this process's `abx <cmd>`) is one of the read paths that may
|
|
83
|
+
* discover a parent directory's data dir — see {@link DATA_DIR_DISCOVERY_COMMANDS}. Reads
|
|
84
|
+
* `process.argv` directly (matching main.ts's own `const [cmd, ...rest] = process.argv.slice(2)`)
|
|
85
|
+
* rather than taking a parameter, so every call site (`dataDir`, `localIndexer`, `loadArweaveJwk`,
|
|
86
|
+
* …) agrees on the SAME answer for the lifetime of one invocation without threading a flag through
|
|
87
|
+
* each of them. `abx minter show <token>` is the one two-word exception: `minter`'s other
|
|
88
|
+
* subcommands (`configure`, `buy`) sign transactions and must not discover. */
|
|
89
|
+
function allowUpwardDataDirDiscovery() {
|
|
90
|
+
const [cmd, sub] = process.argv.slice(2);
|
|
91
|
+
if (cmd === 'minter')
|
|
92
|
+
return sub === 'show';
|
|
93
|
+
return cmd !== undefined && DATA_DIR_DISCOVERY_COMMANDS.has(cmd);
|
|
94
|
+
}
|
|
95
|
+
let _dataDirResolution;
|
|
96
|
+
/**
|
|
97
|
+
* The ONE place the CLI resolves its data directory — every other function in this file that
|
|
98
|
+
* touches disk (`localIndexer`, `storageOptions`, `arweaveKeyFile`, `loadArweaveJwk`) calls this
|
|
99
|
+
* rather than deriving its own path, so a single invocation always agrees with itself about which
|
|
100
|
+
* node it's operating on (issue #121's "keep managed Arweave key location and projection location
|
|
101
|
+
* coherent" criterion — the two used to be independently resolved and could silently diverge).
|
|
102
|
+
*
|
|
103
|
+
* Memoized per process (like `CHAIN` above): resolved once, so a "found in a parent directory"
|
|
104
|
+
* notice prints exactly once no matter how many call sites ask, and a discovery decision made at
|
|
105
|
+
* the top of a run can't flip partway through it.
|
|
106
|
+
*/
|
|
21
107
|
export function dataDir() {
|
|
22
|
-
|
|
108
|
+
if (!_dataDirResolution) {
|
|
109
|
+
_dataDirResolution = resolveDataDir({ allowUpwardDiscovery: allowUpwardDataDirDiscovery() });
|
|
110
|
+
// NEVER silently merge two data directories (issue #121) — when a read answers from a
|
|
111
|
+
// discovered parent instead of cwd, say so, so a user two directories deep is never confused
|
|
112
|
+
// about which node just answered.
|
|
113
|
+
if (_dataDirResolution.source === 'discovered') {
|
|
114
|
+
info(`using the data directory found in a parent directory — ${bold(_dataDirResolution.dir)} ${dim('(set ABX_DATA_DIR to pin one explicitly)')}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return _dataDirResolution.dir;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Make the data dir ignore itself, before anything sensitive lands in it.
|
|
121
|
+
*
|
|
122
|
+
* `.abx-self-host/` holds this node's projection AND the managed Arweave key — a real, signing-capable
|
|
123
|
+
* credential that also holds prepaid upload credits. The toolkit's own repo gitignores the directory,
|
|
124
|
+
* and the skill said so; a *creator's* repo does not, so a first `--backend arweave` run could leave a
|
|
125
|
+
* key staged for commit with nothing having said a word. A `.gitignore` containing `*` INSIDE the
|
|
126
|
+
* directory ignores the whole tree regardless of the enclosing repo's config, needs no edit to a file
|
|
127
|
+
* we don't own, and is inert outside git.
|
|
128
|
+
*
|
|
129
|
+
* Never overwrites an existing one — a creator who tightened or loosened it made a decision.
|
|
130
|
+
*/
|
|
131
|
+
export function guardDataDirFromGit() {
|
|
132
|
+
const dir = dataDir();
|
|
133
|
+
const marker = resolve(dir, '.gitignore');
|
|
134
|
+
if (existsSync(marker))
|
|
135
|
+
return;
|
|
136
|
+
mkdirSync(dir, { recursive: true });
|
|
137
|
+
writeFileSync(marker, '# Written by abx. Local node state, and (for the arweave backend) a signing-capable key that\n' +
|
|
138
|
+
'# holds your prepaid upload credits. Do not commit any of it.\n*\n');
|
|
139
|
+
}
|
|
140
|
+
// ── the local indexer: one instance per process ───────────────────────────────
|
|
141
|
+
// `new SelfHostIndexer()` opens (and premigrate/schema-execs) the SAME on-disk SQLite db every
|
|
142
|
+
// time — a dozen call sites across main.ts/ownerops.ts each constructed their own, so a single CLI
|
|
143
|
+
// invocation that touches several of them (e.g. a deploy that also registers + reindexes) paid that
|
|
144
|
+
// open/migrate cost repeatedly for what is, within one process, always the same store. Memoized here
|
|
145
|
+
// so every call site shares one instance instead.
|
|
146
|
+
let _localIndexer;
|
|
147
|
+
/** The process-lifetime local indexer (this node's own SQLite-backed projection). Never pass a
|
|
148
|
+
* chain-varying argument through here — it's a bare singleton, constructed once on first use.
|
|
149
|
+
* Passes `dataDir()` explicitly rather than letting `SqliteStore` fall back on its own — that
|
|
150
|
+
* fallback exists for a caller with no data-dir context of its own, and this call site has one:
|
|
151
|
+
* passing it is what keeps a discovered parent directory (see `dataDir` above) actually reaching
|
|
152
|
+
* the projection, instead of the store quietly reopening at plain cwd behind its back. */
|
|
153
|
+
export function localIndexer() {
|
|
154
|
+
if (!_localIndexer)
|
|
155
|
+
guardDataDirFromGit(); // the projection is about to be created (or already lives) at dataDir()
|
|
156
|
+
return (_localIndexer ??= new SelfHostIndexer(new SqliteStore(dataDir())));
|
|
23
157
|
}
|
|
24
158
|
/**
|
|
25
159
|
* Whether `baseUrl` is a localhost/loopback address — a URL that, once baked into an on-chain
|
|
@@ -30,6 +164,25 @@ export function dataDir() {
|
|
|
30
164
|
export function loopbackBaseUrl(baseUrl) {
|
|
31
165
|
return /^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?:[:/]|$)/i.test(baseUrl);
|
|
32
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* A short faucet pointer for a testnet — a 0-balance signer's #1 next step. A known URL plus a
|
|
169
|
+
* search hint (URLs rot; the search always works), so "fund it" is never a dead end.
|
|
170
|
+
*
|
|
171
|
+
* Lives here rather than in main.ts because the browser-wallet signing prompt needs it too, and
|
|
172
|
+
* importing main.ts would execute the CLI. That prompt is the one funding surface `warnUnfunded`
|
|
173
|
+
* can't cover: on the `--sign` lane without `--for` we don't learn the address until the wallet
|
|
174
|
+
* connects, so the up-front balance check never runs and the only warning a creator would get is
|
|
175
|
+
* a failed transaction.
|
|
176
|
+
*/
|
|
177
|
+
export function faucetHint(chainKey) {
|
|
178
|
+
const url = {
|
|
179
|
+
'base-sepolia': 'https://portal.cdp.coinbase.com/products/faucet',
|
|
180
|
+
sepolia: 'https://www.alchemy.com/faucets/ethereum-sepolia',
|
|
181
|
+
};
|
|
182
|
+
return url[chainKey]
|
|
183
|
+
? `get free test ETH from a ${chainKey} faucet (${url[chainKey]} — or search "${chainKey} faucet"), usually ≤1 min`
|
|
184
|
+
: `get test ETH from a "${chainKey}" faucet`;
|
|
185
|
+
}
|
|
33
186
|
// ── canonical infrastructure (shipped manifest → env → flag) ─────────────────
|
|
34
187
|
// Thin CLI wrappers over the SDK resolvers, pinned to the active chain. Return null (not
|
|
35
188
|
// undefined) to read cleanly at call sites (`factoryAddress() ?? 'none'`). `null` means the
|
|
@@ -54,6 +207,23 @@ export function chunkStoreAddress(override) {
|
|
|
54
207
|
export function fixedPriceMinterAddress(override) {
|
|
55
208
|
return resolveFixedPriceMinter(chainId(), override) ?? null;
|
|
56
209
|
}
|
|
210
|
+
// ── ERC-1155 editions — the same override → env → manifest resolution, one rung finer ────────────
|
|
211
|
+
/** Canonical 1/1-edition clone factory — flag override → `ABX_ONE_OF_ONE_EDITION_FACTORY` → manifest. */
|
|
212
|
+
export function oneOfOneEditionFactoryAddress(override) {
|
|
213
|
+
return resolveOneOfOneEditionFactory(chainId(), override) ?? null;
|
|
214
|
+
}
|
|
215
|
+
/** Canonical multi-work edition clone factory — flag override → `ABX_EDITION_FACTORY` → manifest. */
|
|
216
|
+
export function editionFactoryAddress(override) {
|
|
217
|
+
return resolveEditionFactory(chainId(), override) ?? null;
|
|
218
|
+
}
|
|
219
|
+
/** Canonical code-project edition clone factory — flag override → `ABX_EDITION_CODE_FACTORY` → manifest. */
|
|
220
|
+
export function editionCodeFactoryAddress(override) {
|
|
221
|
+
return resolveEditionCodeFactory(chainId(), override) ?? null;
|
|
222
|
+
}
|
|
223
|
+
/** Canonical shared fixed-price EDITION minter — flag override → `ABX_FIXED_PRICE_MINTER_1155` → manifest. */
|
|
224
|
+
export function fixedPriceMinter1155Address(override) {
|
|
225
|
+
return resolveFixedPriceMinter1155(chainId(), override) ?? null;
|
|
226
|
+
}
|
|
57
227
|
/** Resolve the storage-signer lane: flag → `ABX_STORAGE_SIGNER` → default `arweave`. */
|
|
58
228
|
export function storageSignerChoice(ov = {}) {
|
|
59
229
|
const v = ov.storageSigner ?? process.env.ABX_STORAGE_SIGNER;
|
|
@@ -149,12 +319,17 @@ function parseJwk(raw) {
|
|
|
149
319
|
* and **never silently replaces** a corrupt key (that would strand its credits) — a bad key throws.
|
|
150
320
|
*/
|
|
151
321
|
export function loadArweaveJwk() {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
322
|
+
// Delegate to the storage package's resolver so the CLI and the SDK cannot disagree about where
|
|
323
|
+
// the identity lives — they did, and porting a working CLI flow to the SDK broke every upload with
|
|
324
|
+
// "Arweave via Turbo needs an identity". It also owns the diagnostics: a bare `JSON.parse` here
|
|
325
|
+
// reported an empty key file as "Unexpected end of JSON input", naming a parser instead of the
|
|
326
|
+
// file or the remedy.
|
|
327
|
+
//
|
|
328
|
+
// Pass THIS process's `dataDir()` explicitly (issue #121) — without it, `resolveArweaveJwk`
|
|
329
|
+
// falls back to its own unparameterized `resolveDataDir()` (always strict cwd), which could
|
|
330
|
+
// read from a different directory than `ensureArweaveJwk` below writes to, or than this
|
|
331
|
+
// invocation's SQLite projection lives in — exactly the split #121 requires stay coherent.
|
|
332
|
+
return resolveArweaveJwk(dataDir());
|
|
158
333
|
}
|
|
159
334
|
/** Load or CREATE the managed Turbo identity, persisting a fresh key (0600) to the data dir. */
|
|
160
335
|
export function ensureArweaveJwk() {
|
|
@@ -164,6 +339,7 @@ export function ensureArweaveJwk() {
|
|
|
164
339
|
return { jwk: existing, address: arweaveAddress(existing), created: false, path: p };
|
|
165
340
|
const jwk = generateArweaveJwk();
|
|
166
341
|
mkdirSync(dirname(p), { recursive: true });
|
|
342
|
+
guardDataDirFromGit(); // a key is about to land here — make the directory self-ignoring first
|
|
167
343
|
writeFileSync(p, JSON.stringify(jwk), { mode: 0o600 });
|
|
168
344
|
return { jwk, address: arweaveAddress(jwk), created: true, path: p };
|
|
169
345
|
}
|
|
@@ -181,4 +357,167 @@ function ensureManagedArweaveJwk() {
|
|
|
181
357
|
}
|
|
182
358
|
return r.jwk;
|
|
183
359
|
}
|
|
360
|
+
/** Per-invocation storage overrides parsed from deploy flags (the hybrid: config, overridable). */
|
|
361
|
+
export function storageOverrides(flags) {
|
|
362
|
+
return {
|
|
363
|
+
backend: flags.backend,
|
|
364
|
+
endpoint: flags.endpoint,
|
|
365
|
+
bucket: flags.bucket,
|
|
366
|
+
region: flags.region,
|
|
367
|
+
prefix: flags.prefix,
|
|
368
|
+
publicBase: flags['public-base'],
|
|
369
|
+
gateway: flags.gateway,
|
|
370
|
+
mode: flags.mode,
|
|
371
|
+
apiUrl: flags['api-url'],
|
|
372
|
+
uploadUrl: flags['upload-url'],
|
|
373
|
+
provider: flags.provider,
|
|
374
|
+
storageSigner: flags['storage-signer'],
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/** Surface the free-vs-credit decision for a Turbo upload from the LOCAL byte size — no network,
|
|
378
|
+
* so it works in `--dry-run` too. Under 100 KiB is free; above, it draws on prepaid credits. The
|
|
379
|
+
* decision itself (`isTurboArweave` + the size threshold) is the storage package's
|
|
380
|
+
* {@link planTurboUpload}; this is just its narration. */
|
|
381
|
+
export function noteArweavePlan(opts, size) {
|
|
382
|
+
const plan = planTurboUpload(opts, size);
|
|
383
|
+
if (!plan)
|
|
384
|
+
return;
|
|
385
|
+
if (!plan.chargeable) {
|
|
386
|
+
info(`Turbo: ${plan.sizeKb} KB is under the 100 KB free tier → permanent upload is FREE — no credits, no setup.`);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
info(`Turbo: ${plan.sizeKb} KB exceeds the 100 KB free tier → draws on prepaid credits. Check \`abx storage balance\`; top up with \`abx storage topup --usd <n>\` if short.`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Dry-run storage-readiness: surface what a REAL off-chain deploy needs, from local info only, so
|
|
394
|
+
* "dry-run passes → deploy fails at upload" can't happen. Covers Arweave credit needs, a missing
|
|
395
|
+
* Pinata JWT, and a missing cloud public base. `sizes` are the per-file byte sizes. The readiness
|
|
396
|
+
* FACTS (chargeable-bytes accounting, the USD estimate, the missing-JWT/public-base checks) are the
|
|
397
|
+
* storage package's {@link assessStorageReadiness}; this is just its narration.
|
|
398
|
+
*/
|
|
399
|
+
export async function noteStorageReadiness(opts, sizes) {
|
|
400
|
+
const report = await assessStorageReadiness(opts, sizes);
|
|
401
|
+
if (report.backend === 'arweave') {
|
|
402
|
+
if (report.overCount === 0) {
|
|
403
|
+
info(`Turbo: all ${report.totalCount} file(s) under the 100 KB free tier → FREE permanent upload, no setup.`);
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
// Best-effort real-rate USD estimate; silently omitted if the price API isn't reachable.
|
|
407
|
+
const cost = report.usd === null ? '' : ` ≈ ${report.usd < 0.01 ? '<$0.01' : '$' + report.usd.toFixed(2)} at current Turbo rates`;
|
|
408
|
+
info(`Turbo: ${report.overCount}/${report.totalCount} file(s) exceed the 100 KB free tier (~${report.totalKb} KB total)${cost} → draw on prepaid credits. Check \`abx storage balance --backend arweave\`; top up with \`abx storage topup --usd <n> --backend arweave\` if short.`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else if (report.backend === 'ipfs' && report.pinataMissingJwt) {
|
|
412
|
+
warn('IPFS pinata mode but PINATA_JWT is not set — a real deploy will FAIL at upload. Set PINATA_JWT in .env (or --mode kubo with a local node).');
|
|
413
|
+
}
|
|
414
|
+
else if (report.backend === 'cloud' && report.missingPublicBase) {
|
|
415
|
+
warn('cloud/S3 has no public read base — a real deploy will FAIL. Set ABX_S3_PUBLIC_BASE or pass --public-base <bucket-or-cdn-url> (it is baked on-chain).');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
/** Create + announce the managed Turbo identity right before the first upload that needs it.
|
|
419
|
+
* Mutates `opts.arweave.jwk` so the resolved backend can sign. No-op for non-Turbo custody, or
|
|
420
|
+
* when an ETH identity (`.env` key or a wallet-session remote signer) is already selected — that
|
|
421
|
+
* identity pays, so we don't mint an unused managed key. */
|
|
422
|
+
export function ensureArweaveIdentityForUpload(opts) {
|
|
423
|
+
if (!isTurboArweave(opts))
|
|
424
|
+
return;
|
|
425
|
+
if (opts.arweave?.jwk || opts.arweave?.ethSignerKey || opts.arweave?.remoteEth)
|
|
426
|
+
return; // identity already chosen
|
|
427
|
+
const { jwk, address, created, path } = ensureArweaveJwk();
|
|
428
|
+
opts.arweave.jwk = jwk;
|
|
429
|
+
if (created) {
|
|
430
|
+
warn(`created an Arweave identity for Turbo uploads → ${dim(path)}`);
|
|
431
|
+
info(` address ${g(address)} — BACK THIS UP (\`abx storage backup-key --out <path>\`). It signs uploads and holds any credits you buy; lose it and leftover credits are stranded.`);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Pre-upload FUNDS guard for Turbo (arweave). Runs before a real off-chain deploy so a credit
|
|
436
|
+
* shortfall stops *here* — with the exact address + fund options — instead of failing mid-deploy
|
|
437
|
+
* after some txs already landed. Only fires for chargeable files (≥100 KB); free-tier uploads skip
|
|
438
|
+
* it. Best-effort: if the price/balance APIs are unreachable it degrades to a warning, never a false
|
|
439
|
+
* block. `sizes` are per-file byte sizes. The funds decision itself is the storage package's
|
|
440
|
+
* {@link assessTurboFunds}; this is the narration + the throw messages built from its report.
|
|
441
|
+
*/
|
|
442
|
+
export async function assertTurboFundsForUpload(opts, sizes, walletAddr) {
|
|
443
|
+
if (!isTurboArweave(opts))
|
|
444
|
+
return;
|
|
445
|
+
ensureArweaveIdentityForUpload(opts); // so there's an address to check
|
|
446
|
+
const check = await assessTurboFunds(opts.arweave, sizes, walletAddr);
|
|
447
|
+
if (!check || !check.short)
|
|
448
|
+
return;
|
|
449
|
+
const { address, isEth, haveWinc, needWinc, walletCredits } = check;
|
|
450
|
+
// Managed-key lane is short → BEFORE proposing a top-up, check whether the creator's OWN wallet
|
|
451
|
+
// already holds Turbo credits (public balance-by-address, no key). If so, spending those via
|
|
452
|
+
// `--storage-signer eth` beats paying again. This is the "check my wallet too" the flow needs.
|
|
453
|
+
if (!isEth && walletAddr && walletCredits && walletCredits.winc > 0 && (needWinc ? walletCredits.winc >= needWinc : true)) {
|
|
454
|
+
throw new Error([
|
|
455
|
+
`The managed Arweave key has no credits — but your wallet ${g(walletAddr)} already holds ${bold(walletCredits.credits)} Turbo credits.`,
|
|
456
|
+
` Use those instead of paying again — re-run with:`,
|
|
457
|
+
` • ${bold('--storage-signer eth --sign')} ${dim('(your browser wallet signs the uploads; its credits pay — no key in .env)')}`,
|
|
458
|
+
` • or ${bold('--storage-signer eth')} ${dim('(if that wallet’s key is already in .env)')}`,
|
|
459
|
+
` ${dim('No top-up needed.')}`,
|
|
460
|
+
].join('\n'));
|
|
461
|
+
}
|
|
462
|
+
const lines = [
|
|
463
|
+
`Turbo credits look insufficient for this upload (${check.chargeableCount} file(s) over the 100 KB free tier).`,
|
|
464
|
+
` identity ${g(address)} ${dim(isEth ? '(your EVM wallet — an ETH Turbo identity)' : '(the CLI-managed Arweave key, NOT your ETH wallet)')}`,
|
|
465
|
+
` balance ${(haveWinc / 1e12).toFixed(4)} credits${needWinc ? dim(` · need ~${(needWinc / 1e12).toFixed(4)}`) : ''}`,
|
|
466
|
+
...(walletAddr && !isEth ? [` ${dim(`(checked your wallet ${walletAddr} too — no Turbo credits there either.)`)}`] : []),
|
|
467
|
+
...(isEth ? [] : [` ${dim('First back up the managed key — `abx storage backup-key --out <path>` — it will hold the credits you buy.')}`]),
|
|
468
|
+
` Then fund + re-run:`,
|
|
469
|
+
` • ${bold('abx storage topup --usd <n> --backend arweave')} ${dim('(card checkout, credits the address above)')}`,
|
|
470
|
+
` • or paste ${g(address)} at ${bold('https://turbo-topup.com')} ${dim('— fund THIS address; do NOT connect a different wallet')}`,
|
|
471
|
+
isEth
|
|
472
|
+
? ` • already funded a different identity? that's a different address — fund the one above`
|
|
473
|
+
: ` • funded your ETH wallet's Turbo balance instead? re-run with ${bold('--storage-signer eth')} (key in .env) or ${bold('--storage-signer eth --sign')} (browser wallet)`,
|
|
474
|
+
];
|
|
475
|
+
throw new Error(lines.join('\n'));
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Resolve durable locators (`ipfs://<cid>` / `ar://<txid>`) for a project's off-chain-by-hash
|
|
479
|
+
* fields, from THIS machine's content index via the backend. This is the bridge a remote resolver
|
|
480
|
+
* needs: the on-chain commitment is a keccak256, but the CID/txid that addresses the bytes lives in
|
|
481
|
+
* the deployer's local index — ship it so the resolver can point `image` at IPFS without the bytes.
|
|
482
|
+
* Returns `{ "0x<hash>": "ipfs://<cid>" }` (lowercased), empty when nothing is locatable here.
|
|
483
|
+
*/
|
|
484
|
+
export async function collectContentLocators(state, backend) {
|
|
485
|
+
if (!backend.locator)
|
|
486
|
+
return {};
|
|
487
|
+
const out = {};
|
|
488
|
+
const hashFields = [...state.tokens.flatMap((t) => t.fields), ...state.collectionFields].filter((f) => f.representation === R.keccak256 || f.representation === R.sha256);
|
|
489
|
+
for (const f of hashFields) {
|
|
490
|
+
const key = f.value.toLowerCase();
|
|
491
|
+
if (out[key])
|
|
492
|
+
continue;
|
|
493
|
+
try {
|
|
494
|
+
const loc = await backend.locator(f.value);
|
|
495
|
+
if (loc)
|
|
496
|
+
out[key] = loc;
|
|
497
|
+
}
|
|
498
|
+
catch {
|
|
499
|
+
/* backend can't locate this hash — skip; the resolver falls back to its own image route */
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return out;
|
|
503
|
+
}
|
|
504
|
+
/** Locators to bridge to a remote resolver: the ones the local deploy already stored, else freshly
|
|
505
|
+
* resolved from this machine's local projection + content index (e.g. `abx add <addr> --remote`
|
|
506
|
+
* for a contract deployed elsewhere on this same machine). */
|
|
507
|
+
export async function remoteLocators(address, stored, flags) {
|
|
508
|
+
if (stored) {
|
|
509
|
+
try {
|
|
510
|
+
const obj = JSON.parse(stored);
|
|
511
|
+
if (Object.keys(obj).length)
|
|
512
|
+
return obj;
|
|
513
|
+
}
|
|
514
|
+
catch {
|
|
515
|
+
/* fall through to recompute */
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
const local = localIndexer().getProject(address);
|
|
519
|
+
if (!local)
|
|
520
|
+
return {};
|
|
521
|
+
return collectContentLocators(local, resolveBackend(storageOptions(storageOverrides(flags))));
|
|
522
|
+
}
|
|
184
523
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,kBAAkB,GAGnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;GAaG;AAEH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,iBAAiB,CAAC;AACzD,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;AAErD,MAAM,UAAU,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,OAAO,oEAAoE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC5F,CAAC;AAED,gFAAgF;AAChF,yFAAyF;AACzF,4FAA4F;AAC5F,iGAAiG;AAEjG,+FAA+F;AAC/F,MAAM,UAAU,cAAc,CAAC,QAAiB;IAC9C,OAAO,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC;AACrD,C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AAC,KAAK,UAAU,cAAc,CAAC,OAAgB,EAAE,MAA0B,EAAE,KAAY;IAC7F,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAA2B,CAAC;YACzD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM;gBAAE,OAAO,GAAG,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,sBAAsB,CAAC,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAChG,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type AssertionStatus = 'pass' | 'fail' | 'note';
|
|
2
|
+
export interface Assertion {
|
|
3
|
+
status: AssertionStatus;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ConformanceOptions {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
/** Omit to run only the unauthenticated (always) tier. */
|
|
9
|
+
token?: string;
|
|
10
|
+
/** Which chain to probe when the descriptor doesn't pin one down. Required (with `address`) to
|
|
11
|
+
* unlock the register→deregister loop. */
|
|
12
|
+
chainId?: number;
|
|
13
|
+
/** A contract THIS token may register/deregister — unlocks the full write loop. Needs `chainId` too. */
|
|
14
|
+
address?: string;
|
|
15
|
+
fromBlock?: string;
|
|
16
|
+
/** The register-loop's poll-to-`live` budget (default 120s/2s) — tests shrink both. */
|
|
17
|
+
awaitTimeoutMs?: number;
|
|
18
|
+
awaitIntervalMs?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ConformanceReport {
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
assertions: Assertion[];
|
|
23
|
+
failures: number;
|
|
24
|
+
}
|
|
25
|
+
/** One ✓/✗/· line. Nested sub-bullets carry their own leading spaces in `message` (unchanged from
|
|
26
|
+
* the original script), so the indentation is intentional, not a formatting bug. */
|
|
27
|
+
export declare function formatAssertion(a: Assertion): string;
|
|
28
|
+
/** The final line — kept byte-stable: `scripts/e2e-remote-resolver.sh` greps for '✓ conformant'. */
|
|
29
|
+
export declare function verdictLine(report: ConformanceReport): string;
|
|
30
|
+
export declare function runConformance(opts: ConformanceOptions): Promise<ConformanceReport>;
|
|
31
|
+
//# sourceMappingURL=conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;+CAC2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAYD;qFACqF;AACrF,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAGpD;AAED,oGAAoG;AACpG,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAE7D;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAsUzF"}
|