@artblocks/abx-cli 0.1.0-alpha.2 → 0.1.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1762 -0
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +17 -0
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +51 -2
- package/dist/commands/deploy.d.ts +206 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +4004 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/project.d.ts +241 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1044 -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 +667 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +71 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +544 -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 +37 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +335 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/config.d.ts +91 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +244 -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 +371 -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/flags.d.ts +41 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +94 -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 +48 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +69 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +509 -4708
- 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 +214 -52
- package/dist/mintpage.js.map +1 -1
- package/dist/output.d.ts +148 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +634 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +132 -44
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +1067 -327
- 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 +10 -7
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +134 -53
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +352 -46
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +29 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +91 -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 +18 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +74 -23
- package/dist/schema.js.map +1 -1
- 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 +80 -14
- package/dist/signer.js.map +1 -1
- package/dist/update-check.d.ts +58 -4
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +92 -11
- package/dist/update-check.js.map +1 -1
- package/package.json +10 -6
- package/skill/SKILL.md +104 -60
- package/skill/reference/code-projects.md +87 -13
- package/skill/reference/creator-token.md +86 -0
- package/skill/reference/decisions.md +61 -0
- package/skill/reference/hosting.md +48 -15
- package/skill/reference/operating.md +29 -8
- package/skill/reference/setup.md +10 -3
- package/skill/reference/troubleshooting.md +31 -4
- 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/dist/mintpage.d.ts
CHANGED
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
export interface MintPageOptions {
|
|
23
23
|
/** The ABX token (collection) contract to sell. */
|
|
24
24
|
token: string;
|
|
25
|
-
/** The shared fixed-price minter for the chain
|
|
25
|
+
/** The shared fixed-price minter for the chain — the 721 `AbxFixedPriceMinter`, or (when
|
|
26
|
+
* {@link isEdition}) its 1155 sibling `AbxFixedPriceMinter1155`. */
|
|
26
27
|
minter: string;
|
|
27
28
|
chainId: number;
|
|
28
29
|
chainName: string;
|
|
@@ -32,6 +33,18 @@ export interface MintPageOptions {
|
|
|
32
33
|
collectionName: string;
|
|
33
34
|
/** Block explorer base (e.g. https://sepolia.etherscan.io), for a "view contract" link. */
|
|
34
35
|
explorer?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The target is an ERC-1155 edition (OneOfOneEdition/EditionImage/EditionCode) rather than a 721
|
|
38
|
+
* Series/SeriesCode — sales are keyed `(token, id)`, so the generated page takes a token-id +
|
|
39
|
+
* quantity input and pays `price × quantity`, instead of the 721 page's one project-wide sale.
|
|
40
|
+
*
|
|
41
|
+
* v1 scope (deliberately minimal — the 721 page's gallery/pagination is NOT ported): a purchase
|
|
42
|
+
* of "copies" of one id doesn't have the 721 page's "one owner per token" gallery to show, and
|
|
43
|
+
* building a per-id browsing UI is real design work this pass didn't take on. The purchase
|
|
44
|
+
* controls (price, sold/allocation, per-id supply/cap, paused) are fully live from chain either
|
|
45
|
+
* way — just without a tile grid underneath them.
|
|
46
|
+
*/
|
|
47
|
+
isEdition?: boolean;
|
|
35
48
|
}
|
|
36
49
|
export interface MintPageArtifact {
|
|
37
50
|
files: Array<{
|
|
@@ -40,7 +53,9 @@ export interface MintPageArtifact {
|
|
|
40
53
|
}>;
|
|
41
54
|
steps: string[];
|
|
42
55
|
}
|
|
43
|
-
/** Public, keyless RPCs safe to embed in a public site. Extend as chains are added.
|
|
56
|
+
/** Public, keyless RPCs safe to embed in a public site. Extend as chains are added.
|
|
57
|
+
* base-sepolia is the toolkit's DEFAULT chain — its absence here meant every default-chain
|
|
58
|
+
* deploy needed a manual --rpc just to scaffold its own mint page (integrator-reported). */
|
|
44
59
|
export declare const PUBLIC_RPC: Record<number, string>;
|
|
45
60
|
export declare function mintPageArtifact(o: MintPageOptions): MintPageArtifact;
|
|
46
61
|
//# sourceMappingURL=mintpage.d.ts.map
|
package/dist/mintpage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintpage.d.ts","sourceRoot":"","sources":["../src/mintpage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"mintpage.d.ts","sourceRoot":"","sources":["../src/mintpage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd;yEACqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,6FAA6F;IAC7F,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC9C,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;6FAE6F;AAC7F,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK7C,CAAC;AAqlBF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,eAAe,GAAG,gBAAgB,CA2BrE"}
|
package/dist/mintpage.js
CHANGED
|
@@ -19,10 +19,15 @@
|
|
|
19
19
|
* Pure module: returns the artifact files + the exact next-step commands. The CLI writes the files and
|
|
20
20
|
* prints the steps; `vercel` / `next dev` run in the creator's own account/machine — they own that step.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
import { readSdkVersion } from './update-check.js';
|
|
23
|
+
/** Public, keyless RPCs safe to embed in a public site. Extend as chains are added.
|
|
24
|
+
* base-sepolia is the toolkit's DEFAULT chain — its absence here meant every default-chain
|
|
25
|
+
* deploy needed a manual --rpc just to scaffold its own mint page (integrator-reported). */
|
|
23
26
|
export const PUBLIC_RPC = {
|
|
24
27
|
1: 'https://ethereum-rpc.publicnode.com',
|
|
25
28
|
11155111: 'https://ethereum-sepolia-rpc.publicnode.com',
|
|
29
|
+
8453: 'https://mainnet.base.org',
|
|
30
|
+
84532: 'https://sepolia.base.org',
|
|
26
31
|
};
|
|
27
32
|
const slug = (s) => s
|
|
28
33
|
.toLowerCase()
|
|
@@ -43,6 +48,11 @@ function packageJson(o) {
|
|
|
43
48
|
react: '^19.0.0',
|
|
44
49
|
'react-dom': '^19.0.0',
|
|
45
50
|
viem: '^2.21.0',
|
|
51
|
+
// Pinned to THIS CLI's own version, caret-ranged — the CLI and sdk version-bump together in
|
|
52
|
+
// this repo's changesets flow, so "the version that scaffolded this app" is exactly the
|
|
53
|
+
// floor that's guaranteed to have makePublicClient/readSaleConfig/the `/abi` subpath (this
|
|
54
|
+
// refactor). INVARIANT: an sdk older than that will be missing one of those exports.
|
|
55
|
+
'@artblocks/abx-sdk': '^' + readSdkVersion(),
|
|
46
56
|
},
|
|
47
57
|
devDependencies: {
|
|
48
58
|
typescript: '^5.6.0',
|
|
@@ -130,55 +140,63 @@ export const chain = defineChain({
|
|
|
130
140
|
rpcUrls: {default: {http: [RPC_URL]}},
|
|
131
141
|
});
|
|
132
142
|
`;
|
|
133
|
-
const LIB_ABI = `//
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
{name: 'allocation', type: 'uint256'},
|
|
145
|
-
{name: 'sold', type: 'uint256'},
|
|
146
|
-
],
|
|
147
|
-
},
|
|
148
|
-
{type: 'function', name: 'purchase', stateMutability: 'payable', inputs: [{name: 'token', type: 'address'}], outputs: [{name: 'tokenId', type: 'uint256'}]},
|
|
149
|
-
{type: 'function', name: 'purchaseTo', stateMutability: 'payable', inputs: [{name: 'token', type: 'address'}, {name: 'to', type: 'address'}], outputs: [{name: 'tokenId', type: 'uint256'}]},
|
|
150
|
-
] as const;
|
|
143
|
+
const LIB_ABI = `// Minter + token ABIs, sourced from the shared SDK instead of hand-typed here — one definition
|
|
144
|
+
// that tracks the deployed contracts (the ABX repo's 'pnpm sync-abis' regenerates it from the
|
|
145
|
+
// contracts themselves), so this file can never drift the way a hand-copied fragment can.
|
|
146
|
+
//
|
|
147
|
+
// name / totalSupply / maxInvocations / paused / tokenURI are identical fragments on every ABX
|
|
148
|
+
// Series contract type (Image or Code) — importing both and spreading is harmless (duplicate
|
|
149
|
+
// fragments, byte-identical shape) and keeps this working whichever Series type backs your
|
|
150
|
+
// collection, without this app needing to know which one it is.
|
|
151
|
+
// (A rename re-export — 'export {x as y} from …' — of a subpath import tripped up Next's bundler
|
|
152
|
+
// here; a plain import + local const assignment is the form that survives the production build.)
|
|
153
|
+
import {abxFixedPriceMinterAbi, seriesImageAbi, seriesCodeAbi} from '@artblocks/abx-sdk/abi';
|
|
151
154
|
|
|
152
|
-
export const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
export const minterAbi = abxFixedPriceMinterAbi;
|
|
156
|
+
export const tokenAbi = [...seriesImageAbi, ...seriesCodeAbi] as const;
|
|
157
|
+
`;
|
|
158
|
+
// The edition twin of LIB_ABI — same reasoning (one SDK-sourced definition, never hand-typed), the
|
|
159
|
+
// 1155 sale singleton + the narrowest-common-superset edition token ABI (covers OneOfOneEdition/
|
|
160
|
+
// EditionImage/EditionCode — see the SDK's ops.ts for why one ABI serves the whole family).
|
|
161
|
+
const LIB_ABI_EDITION = `// Minter + token ABIs for an EDITION target (ERC-1155 copies) — see the non-edition lib/abi.ts's
|
|
162
|
+
// twin for the "why sourced from the SDK, never hand-typed" note.
|
|
163
|
+
import {abxFixedPriceMinter1155Abi, oneOfOneEditionAbi} from '@artblocks/abx-sdk/abi';
|
|
164
|
+
|
|
165
|
+
export const minterAbi = abxFixedPriceMinter1155Abi;
|
|
166
|
+
export const tokenAbi = oneOfOneEditionAbi;
|
|
159
167
|
`;
|
|
160
168
|
const LIB_META = `// Read a token's image + name from tokenURI(id), directly from chain. Handles data: URIs
|
|
161
169
|
// (on-chain tokens) and http/ipfs/ar locators (off-chain custody). No backend.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
//
|
|
171
|
+
// The read client is the SDK's browser-safe makePublicClient, given an EXPLICIT rpcUrls list —
|
|
172
|
+
// never env resolution (there is no server .env in a static site, and the SDK's own
|
|
173
|
+
// ABX_RPC_URLS/ABX_CHAIN conventions would silently no-op in a browser bundle anyway; an explicit
|
|
174
|
+
// override short-circuits that lookup entirely). One URL behaves exactly like a plain http()
|
|
175
|
+
// transport; paste a comma-separated NEXT_PUBLIC_RPC_URL to get the same fallback-transport
|
|
176
|
+
// failover the CLI/indexer get. Its attached chain metadata is the SDK's own default and is
|
|
177
|
+
// informational only for these plain reads — the WALLET's chain (used for the mint tx) is the one
|
|
178
|
+
// built in ./chain from your real NEXT_PUBLIC_CHAIN_ID/NAME, unaffected by this.
|
|
179
|
+
//
|
|
180
|
+
// Gateway + data: URI parsing go through the SAME sdk helpers the CLI/indexer use
|
|
181
|
+
// (gatewayUrlFor/resolveGatewayBase, parseDataUri) instead of a hand-rolled 'ipfs://'-slicing body —
|
|
182
|
+
// one implementation of "how to read a locator" instead of this app quietly re-deriving its own.
|
|
183
|
+
import {makePublicClient, gatewayUrlFor, resolveGatewayBase, parseDataUri} from '@artblocks/abx-sdk';
|
|
184
|
+
import {RPC_URL, TOKEN} from './config';
|
|
165
185
|
import {tokenAbi} from './abi';
|
|
166
186
|
|
|
167
|
-
export const publicClient =
|
|
187
|
+
export const publicClient = makePublicClient({rpcUrls: RPC_URL.split(',').map((u) => u.trim()).filter(Boolean)});
|
|
168
188
|
|
|
169
189
|
export function toGateway(u: string): string {
|
|
170
190
|
if (!u) return '';
|
|
171
|
-
if (u.startsWith('ipfs://')) return '
|
|
172
|
-
if (u.startsWith('ar://')) return '
|
|
191
|
+
if (u.startsWith('ipfs://')) return gatewayUrlFor('ipfs', u.slice(7), resolveGatewayBase('ipfs'));
|
|
192
|
+
if (u.startsWith('ar://')) return gatewayUrlFor('arweave', u.slice(5), resolveGatewayBase('arweave'));
|
|
173
193
|
return u;
|
|
174
194
|
}
|
|
175
195
|
|
|
176
196
|
async function fetchJson(uri: string): Promise<any> {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
const body = uri.slice(comma + 1);
|
|
181
|
-
const text = header.includes('base64') ? atob(body) : decodeURIComponent(body);
|
|
197
|
+
const parsed = parseDataUri(uri);
|
|
198
|
+
if (parsed) {
|
|
199
|
+
const text = parsed.base64 ? atob(parsed.body) : decodeURIComponent(parsed.body);
|
|
182
200
|
return JSON.parse(text);
|
|
183
201
|
}
|
|
184
202
|
const res = await fetch(toGateway(uri));
|
|
@@ -252,22 +270,15 @@ const APP_MINT_CLIENT = `'use client';
|
|
|
252
270
|
import {useCallback, useEffect, useState} from 'react';
|
|
253
271
|
import {createWalletClient, custom, formatEther} from 'viem';
|
|
254
272
|
import {chain} from '../lib/chain';
|
|
273
|
+
import {readSaleConfig, type SaleConfig} from '@artblocks/abx-sdk';
|
|
255
274
|
import {CHAIN_ID, CHAIN_NAME, COLLECTION_NAME, EXPLORER, MINTER, PAGE_SIZE, TOKEN} from '../lib/config';
|
|
256
275
|
import {minterAbi, tokenAbi} from '../lib/abi';
|
|
257
276
|
import {publicClient, readTokenMeta, type TokenMeta} from '../lib/meta';
|
|
258
277
|
|
|
259
278
|
const ZERO = '0x0000000000000000000000000000000000000000';
|
|
260
279
|
|
|
261
|
-
interface Sale {
|
|
262
|
-
configured: boolean;
|
|
263
|
-
paymentToken: string;
|
|
264
|
-
price: bigint;
|
|
265
|
-
allocation: bigint;
|
|
266
|
-
sold: bigint;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
280
|
export default function Mint() {
|
|
270
|
-
const [sale, setSale] = useState<
|
|
281
|
+
const [sale, setSale] = useState<SaleConfig | null>(null);
|
|
271
282
|
const [supply, setSupply] = useState(0);
|
|
272
283
|
const [maxInv, setMaxInv] = useState(0);
|
|
273
284
|
const [paused, setPaused] = useState(false);
|
|
@@ -278,8 +289,7 @@ export default function Mint() {
|
|
|
278
289
|
const [msg, setMsg] = useState('');
|
|
279
290
|
|
|
280
291
|
const refresh = useCallback(async () => {
|
|
281
|
-
|
|
282
|
-
setSale({configured: s[0], paymentToken: s[1], price: s[2], allocation: s[3], sold: s[4]});
|
|
292
|
+
setSale(await readSaleConfig(publicClient, MINTER, TOKEN));
|
|
283
293
|
const [ts, mx, pz] = await Promise.all([
|
|
284
294
|
publicClient.readContract({address: TOKEN, abi: tokenAbi, functionName: 'totalSupply'}),
|
|
285
295
|
publicClient.readContract({address: TOKEN, abi: tokenAbi, functionName: 'maxInvocations'}),
|
|
@@ -406,6 +416,156 @@ export default function Mint() {
|
|
|
406
416
|
);
|
|
407
417
|
}
|
|
408
418
|
`;
|
|
419
|
+
// The edition twin of APP_MINT_CLIENT — a token-id + quantity purchase against the shared 1155
|
|
420
|
+
// minter (sales are keyed (token, id)), price × quantity computed live. No gallery/pagination (see
|
|
421
|
+
// MintPageOptions.isEdition's own scope note) — the purchase controls are the whole page.
|
|
422
|
+
const APP_MINT_CLIENT_EDITION = `'use client';
|
|
423
|
+
import {useCallback, useEffect, useState} from 'react';
|
|
424
|
+
import {createWalletClient, custom, formatEther} from 'viem';
|
|
425
|
+
import {chain} from '../lib/chain';
|
|
426
|
+
import {readSaleConfig1155, type SaleConfig1155} from '@artblocks/abx-sdk';
|
|
427
|
+
import {CHAIN_ID, CHAIN_NAME, COLLECTION_NAME, EXPLORER, MINTER, TOKEN} from '../lib/config';
|
|
428
|
+
import {minterAbi, tokenAbi} from '../lib/abi';
|
|
429
|
+
import {publicClient} from '../lib/meta';
|
|
430
|
+
|
|
431
|
+
const ZERO = '0x0000000000000000000000000000000000000000';
|
|
432
|
+
|
|
433
|
+
export default function Mint() {
|
|
434
|
+
const [tokenId, setTokenId] = useState(0);
|
|
435
|
+
const [quantity, setQuantity] = useState(1);
|
|
436
|
+
const [sale, setSale] = useState<SaleConfig1155 | null>(null);
|
|
437
|
+
const [supply, setSupply] = useState(0);
|
|
438
|
+
const [maxSupply, setMaxSupply] = useState(0);
|
|
439
|
+
const [paused, setPaused] = useState(false);
|
|
440
|
+
const [account, setAccount] = useState<string>('');
|
|
441
|
+
const [busy, setBusy] = useState(false);
|
|
442
|
+
const [msg, setMsg] = useState('');
|
|
443
|
+
|
|
444
|
+
const refresh = useCallback(async (id: number) => {
|
|
445
|
+
const [s, ts, ms, pz] = await Promise.all([
|
|
446
|
+
readSaleConfig1155(publicClient, MINTER, TOKEN, BigInt(id)),
|
|
447
|
+
publicClient.readContract({address: TOKEN, abi: tokenAbi, functionName: 'totalSupply', args: [BigInt(id)]}),
|
|
448
|
+
publicClient.readContract({address: TOKEN, abi: tokenAbi, functionName: 'maxSupply', args: [BigInt(id)]}),
|
|
449
|
+
publicClient.readContract({address: TOKEN, abi: tokenAbi, functionName: 'paused'}),
|
|
450
|
+
]);
|
|
451
|
+
setSale(s);
|
|
452
|
+
setSupply(Number(ts));
|
|
453
|
+
setMaxSupply(Number(ms));
|
|
454
|
+
setPaused(Boolean(pz));
|
|
455
|
+
}, []);
|
|
456
|
+
|
|
457
|
+
useEffect(() => {
|
|
458
|
+
refresh(tokenId).catch((e) => setMsg(String(e)));
|
|
459
|
+
}, [tokenId, refresh]);
|
|
460
|
+
|
|
461
|
+
async function connect() {
|
|
462
|
+
const eth = (window as any).ethereum;
|
|
463
|
+
if (!eth) {
|
|
464
|
+
setMsg('No injected wallet found — install MetaMask (or another browser wallet).');
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const accts = (await eth.request({method: 'eth_requestAccounts'})) as string[];
|
|
468
|
+
setAccount(accts[0] || '');
|
|
469
|
+
try {
|
|
470
|
+
await eth.request({method: 'wallet_switchEthereumChain', params: [{chainId: '0x' + CHAIN_ID.toString(16)}]});
|
|
471
|
+
} catch (e) {
|
|
472
|
+
/* user can switch manually; the mint call will surface a wrong-network error */
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
async function mint() {
|
|
477
|
+
if (!sale) return;
|
|
478
|
+
const eth = (window as any).ethereum;
|
|
479
|
+
if (!eth || !account) return connect();
|
|
480
|
+
setBusy(true);
|
|
481
|
+
setMsg('');
|
|
482
|
+
try {
|
|
483
|
+
const wallet = createWalletClient({account: account as any, chain, transport: custom(eth)});
|
|
484
|
+
const value = sale.price * BigInt(quantity);
|
|
485
|
+
const hash = await wallet.writeContract({
|
|
486
|
+
address: MINTER,
|
|
487
|
+
abi: minterAbi,
|
|
488
|
+
functionName: 'purchase',
|
|
489
|
+
args: [TOKEN, BigInt(tokenId), BigInt(quantity)],
|
|
490
|
+
value,
|
|
491
|
+
account: account as any,
|
|
492
|
+
chain,
|
|
493
|
+
});
|
|
494
|
+
setMsg('Minting… tx ' + hash.slice(0, 10) + '…');
|
|
495
|
+
await publicClient.waitForTransactionReceipt({hash});
|
|
496
|
+
setMsg('Minted! ✦');
|
|
497
|
+
await refresh(tokenId);
|
|
498
|
+
} catch (e: any) {
|
|
499
|
+
setMsg(e && e.shortMessage ? e.shortMessage : String(e && e.message ? e.message : e));
|
|
500
|
+
} finally {
|
|
501
|
+
setBusy(false);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
const isEth = !sale || sale.paymentToken === ZERO;
|
|
506
|
+
const remaining = maxSupply > 0 ? Math.max(0, maxSupply - supply) : null;
|
|
507
|
+
const soldOut = !!sale && (sale.sold >= sale.allocation || (remaining !== null && remaining <= 0));
|
|
508
|
+
const canMint = !!sale && sale.configured && !paused && !soldOut && isEth && !busy && quantity > 0;
|
|
509
|
+
const totalPrice = sale ? sale.price * BigInt(quantity) : 0n;
|
|
510
|
+
|
|
511
|
+
return (
|
|
512
|
+
<main className="wrap">
|
|
513
|
+
<div className="row" style={{marginBottom: 20}}>
|
|
514
|
+
<div>
|
|
515
|
+
<h1>{COLLECTION_NAME}</h1>
|
|
516
|
+
<div className="muted">
|
|
517
|
+
{EXPLORER ? <a href={EXPLORER + '/address/' + TOKEN} target="_blank" rel="noreferrer">contract ↗</a> : TOKEN}
|
|
518
|
+
{' · '}
|
|
519
|
+
{CHAIN_NAME}
|
|
520
|
+
{' · edition (ERC-1155)'}
|
|
521
|
+
</div>
|
|
522
|
+
</div>
|
|
523
|
+
{account ? <span className="muted">{account.slice(0, 6) + '…' + account.slice(-4)}</span> : <button className="ghost" onClick={connect}>Connect wallet</button>}
|
|
524
|
+
</div>
|
|
525
|
+
|
|
526
|
+
<div className="card">
|
|
527
|
+
<div className="row" style={{marginBottom: 14}}>
|
|
528
|
+
<label className="muted">
|
|
529
|
+
Token ID
|
|
530
|
+
<input
|
|
531
|
+
type="number"
|
|
532
|
+
min={0}
|
|
533
|
+
value={tokenId}
|
|
534
|
+
onChange={(e) => setTokenId(Math.max(0, Number(e.target.value) || 0))}
|
|
535
|
+
style={{marginLeft: 8, width: 90}}
|
|
536
|
+
/>
|
|
537
|
+
</label>
|
|
538
|
+
<label className="muted">
|
|
539
|
+
Quantity
|
|
540
|
+
<input
|
|
541
|
+
type="number"
|
|
542
|
+
min={1}
|
|
543
|
+
value={quantity}
|
|
544
|
+
onChange={(e) => setQuantity(Math.max(1, Number(e.target.value) || 1))}
|
|
545
|
+
style={{marginLeft: 8, width: 90}}
|
|
546
|
+
/>
|
|
547
|
+
</label>
|
|
548
|
+
</div>
|
|
549
|
+
<div className="row">
|
|
550
|
+
<div className="stat">
|
|
551
|
+
{sale ? <>Price <b>{isEth ? formatEther(sale.price) + ' ETH' : sale.price.toString() + ' units'}</b> / copy</> : 'Loading…'}
|
|
552
|
+
{sale ? <> · Total <b>{isEth ? formatEther(totalPrice) + ' ETH' : totalPrice.toString() + ' units'}</b></> : null}
|
|
553
|
+
{sale ? <> · Sold <b>{sale.sold.toString()}/{sale.allocation.toString()}</b></> : null}
|
|
554
|
+
{maxSupply > 0 ? <> · Copies <b>{supply}/{maxSupply}</b></> : <> · Copies <b>{supply}</b> (open)</>}
|
|
555
|
+
{' '}
|
|
556
|
+
<span className={'pill ' + (paused || soldOut ? 'closed' : 'open')}>{soldOut ? 'sold out' : paused ? 'paused' : 'open'}</span>
|
|
557
|
+
</div>
|
|
558
|
+
<button onClick={mint} disabled={!canMint}>
|
|
559
|
+
{busy ? 'Minting…' : soldOut ? 'Sold out' : paused ? 'Paused' : !isEth ? 'ERC-20 — see README' : account ? 'Mint' : 'Connect & mint'}
|
|
560
|
+
</button>
|
|
561
|
+
</div>
|
|
562
|
+
{msg ? <div className="muted" style={{marginTop: 12}}>{msg}</div> : null}
|
|
563
|
+
{sale && !sale.configured ? <div className="muted" style={{marginTop: 12}}>No sale configured yet for id #{tokenId}.</div> : null}
|
|
564
|
+
</div>
|
|
565
|
+
</main>
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
`;
|
|
409
569
|
function readme(o) {
|
|
410
570
|
return ('# ' +
|
|
411
571
|
o.collectionName +
|
|
@@ -428,10 +588,12 @@ function readme(o) {
|
|
|
428
588
|
'- **Multi-wallet** — V1 uses the injected wallet (`window.ethereum`) with zero config. For WalletConnect/Coinbase/etc., swap in [RainbowKit](https://rainbowkit.com) + wagmi (needs a WalletConnect projectId).\n' +
|
|
429
589
|
'- **ERC-20 sales** — the mint button handles ETH. For an ERC-20-priced sale, add an `approve(minter, price)` step before `purchase` (see `lib/abi.ts`).\n' +
|
|
430
590
|
'- **RPC** — `NEXT_PUBLIC_RPC_URL` is a public endpoint (may rate-limit). Use your own **keyless** endpoint if you like; never put a secret-keyed URL in a `NEXT_PUBLIC_` var — it ships to the browser.\n' +
|
|
431
|
-
|
|
432
|
-
|
|
591
|
+
(o.isEdition
|
|
592
|
+
? '- **Gallery** — NOT included for an edition (v1 scope). Sales are keyed `(token, id)` — a "copies of one id" page has no single "minted tokens" list the way a 721 Series does; the purchase card (price, sold/allocation, per-id supply/cap, paused) is fully live from chain. Add a gallery yourself (or ask your agent) if you want one — e.g. loop `uri(id)` over the id range you care about.\n'
|
|
593
|
+
: '- **Gallery** — shows minted tokens newest-first, paginated. It reads `tokenURI(id)`; on-chain collections resolve with no backend, off-chain ones need their resolver/gateway reachable.\n'));
|
|
433
594
|
}
|
|
434
595
|
export function mintPageArtifact(o) {
|
|
596
|
+
const isEdition = !!o.isEdition;
|
|
435
597
|
return {
|
|
436
598
|
files: [
|
|
437
599
|
{ path: 'package.json', content: packageJson(o) },
|
|
@@ -443,12 +605,12 @@ export function mintPageArtifact(o) {
|
|
|
443
605
|
{ path: '.env.example', content: envFile({ ...o, token: '0xYourCollection', minter: o.minter }) },
|
|
444
606
|
{ path: 'lib/config.ts', content: LIB_CONFIG },
|
|
445
607
|
{ path: 'lib/chain.ts', content: LIB_CHAIN },
|
|
446
|
-
{ path: 'lib/abi.ts', content: LIB_ABI },
|
|
608
|
+
{ path: 'lib/abi.ts', content: isEdition ? LIB_ABI_EDITION : LIB_ABI },
|
|
447
609
|
{ path: 'lib/meta.ts', content: LIB_META },
|
|
448
610
|
{ path: 'app/globals.css', content: APP_GLOBALS },
|
|
449
611
|
{ path: 'app/layout.tsx', content: APP_LAYOUT },
|
|
450
612
|
{ path: 'app/page.tsx', content: APP_PAGE },
|
|
451
|
-
{ path: 'app/mint-client.tsx', content: APP_MINT_CLIENT },
|
|
613
|
+
{ path: 'app/mint-client.tsx', content: isEdition ? APP_MINT_CLIENT_EDITION : APP_MINT_CLIENT },
|
|
452
614
|
{ path: 'README.md', content: readme(o) },
|
|
453
615
|
],
|
|
454
616
|
steps: [
|
package/dist/mintpage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintpage.js","sourceRoot":"","sources":["../src/mintpage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"mintpage.js","source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,OAAO,EAAE,WAAW,EAAC;YAC/C,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAC;YAC7C,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAC;YACzC,EAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,eAAe,EAAC;YAC7F,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAC;SACxC;QACD,KAAK,EAAE;YACL,aAAa;YACb,2DAA2D;YAC3D,kGAAkG;SACnG;KACF,CAAC;AACJ,CAAC"}
|
package/dist/output.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { SelfHostIndexer } from '@artblocks/abx-indexer';
|
|
2
|
+
import { type Address, type ProjectState, type PublicClient, type SendTx } from '@artblocks/abx-sdk';
|
|
3
|
+
import { type Flags } from './flags.js';
|
|
4
|
+
export declare const c: {
|
|
5
|
+
reset: string;
|
|
6
|
+
dim: string;
|
|
7
|
+
bold: string;
|
|
8
|
+
green: string;
|
|
9
|
+
purple: string;
|
|
10
|
+
orange: string;
|
|
11
|
+
red: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const g: (s: string) => string;
|
|
14
|
+
export declare const p: (s: string) => string;
|
|
15
|
+
export declare const dim: (s: string) => string;
|
|
16
|
+
export declare const bold: (s: string) => string;
|
|
17
|
+
export declare let stepN: number;
|
|
18
|
+
export declare const step: (s: string) => void;
|
|
19
|
+
export declare const ok: (s: string) => void;
|
|
20
|
+
export declare const info: (s: string) => void;
|
|
21
|
+
export declare const warn: (s: string) => void;
|
|
22
|
+
export declare function allowLargeScan(flags: Flags): void;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the scan floor (fromBlock) for an add/index — the CLI-side shell around the SDK's
|
|
25
|
+
* {@link sdkResolveScanFloor}: builds the client, forwards `--from-block`, and narrates its two
|
|
26
|
+
* possible events (the SDK never prints). See the SDK function's doc comment for the "why" (never
|
|
27
|
+
* a silent genesis default).
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveScanFloor(address: Address, localFromBlock: string | undefined, flags: Flags): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* The trust-anchor gate: a factory is THE address platforms allowlist by, so a missing
|
|
32
|
+
* manifest entry must NEVER silently mint a new "canonical" — that fragments trust (and
|
|
33
|
+
* a stale SDK would duplicate factories on real chains). Degrade to guidance; deploying
|
|
34
|
+
* a private trust anchor is an explicit choice (`--bootstrap-factory`).
|
|
35
|
+
*/
|
|
36
|
+
export declare function refuseMissingFactory(kind: string, envVar: string, reason: string): never;
|
|
37
|
+
/** A `SendTx` that defers `makeWalletClient`/`makeHotSender` construction until the first actual
|
|
38
|
+
* send — trust-anchor bootstrap is rare (an existing, current anchor is the common case), so the
|
|
39
|
+
* happy path must never require a signing key. Memoized so a multi-tx bootstrap (the SeriesCode
|
|
40
|
+
* factory: 2 libraries + the linked factory itself) reuses ONE sender — and its nonce tracking —
|
|
41
|
+
* rather than a fresh one per send. */
|
|
42
|
+
export declare function lazyBootstrapSender(publicClient: PublicClient): SendTx;
|
|
43
|
+
/** Get (or deploy) the chain's canonical 1/1 clone factory — narrates the SDK's `ensureFactory`
|
|
44
|
+
* (anchors.ts), which owns the resolve/verify/bootstrap logic; this keeps only the exact console
|
|
45
|
+
* output plus the exit-messaging refusal (`refuseMissingFactory`), which stays CLI-side since the
|
|
46
|
+
* SDK doesn't know a UX's flag names. `quiet` suppresses only the happy-path reuse line (the demo
|
|
47
|
+
* resolves the factory without making a teaching moment of it) — everything else always prints. */
|
|
48
|
+
export declare function ensureFactory(override?: string, allowBootstrap?: boolean, quiet?: boolean): Promise<Address>;
|
|
49
|
+
/** Get (or deploy) the chain's `SeriesImageFactory` — the sibling of {@link ensureFactory}.
|
|
50
|
+
* Narrates the SDK's `ensureSeriesFactory` (anchors.ts), which owns the resolve/verify/bootstrap
|
|
51
|
+
* logic. */
|
|
52
|
+
export declare function ensureSeriesFactory(override?: string, allowBootstrap?: boolean): Promise<Address>;
|
|
53
|
+
/** Get (or deploy) the chain's shared `AbxMetadataRenderer` — narrates the SDK's `ensureRenderer`
|
|
54
|
+
* (anchors.ts), which also self-heals to the CREATE2-deterministic address before deploying. No
|
|
55
|
+
* `allowBootstrap` gate here (unlike the three clone factories) — the renderer isn't a platform
|
|
56
|
+
* allowlist entry, so there's nothing to refuse; a stale/missing one always just gets redeployed. */
|
|
57
|
+
export declare function ensureRenderer(override?: string): Promise<Address>;
|
|
58
|
+
/** The code-project trust anchor — narrates the SDK's `ensureSeriesCodeFactory` (anchors.ts),
|
|
59
|
+
* which owns the resolve/bootstrap logic (a sandbox / fresh chain links + deploys the two
|
|
60
|
+
* write-path libraries then the factory in-flight; see {@link deploySeriesCodeFactory}). */
|
|
61
|
+
export declare function ensureSeriesCodeFactory(publicClient: PublicClient, override?: string, allowBootstrap?: boolean): Promise<Address>;
|
|
62
|
+
/** Get (or deploy) the chain's canonical 1/1-edition clone factory — narrates the SDK's
|
|
63
|
+
* `ensureOneOfOneEditionFactory` (anchors.ts), the edition twin of {@link ensureFactory}. */
|
|
64
|
+
export declare function ensureOneOfOneEditionFactory(override?: string, allowBootstrap?: boolean): Promise<Address>;
|
|
65
|
+
/** Get (or deploy) the chain's `EditionImageFactory` — narrates the SDK's `ensureEditionFactory`
|
|
66
|
+
* (anchors.ts), the edition twin of {@link ensureSeriesFactory}. */
|
|
67
|
+
export declare function ensureEditionFactory(override?: string, allowBootstrap?: boolean): Promise<Address>;
|
|
68
|
+
/** The code-project EDITION trust anchor — narrates the SDK's `ensureEditionCodeFactory`
|
|
69
|
+
* (anchors.ts), the edition twin of {@link ensureSeriesCodeFactory} (three linked libraries
|
|
70
|
+
* instead of two — see `deployEditionCodeFactory`'s doc note). */
|
|
71
|
+
export declare function ensureEditionCodeFactory(publicClient: PublicClient, override?: string, allowBootstrap?: boolean): Promise<Address>;
|
|
72
|
+
/** The canonical seed source — narrates the SDK's `ensureSeedSource` (anchors.ts): a clean keyless
|
|
73
|
+
* singleton (like the renderer / chunk store / minter), so CREATE2 lands at THE canonical address
|
|
74
|
+
* on any chain. Resolves from the manifest, self-heals to the predicted address (deployed but not
|
|
75
|
+
* yet repointed), else auto-deploys via CREATE2. */
|
|
76
|
+
export declare function ensureSeedSource(publicClient: PublicClient): Promise<Address>;
|
|
77
|
+
/**
|
|
78
|
+
* Refuse a port that's already bound, with a formatted one-liner naming the port and the fix.
|
|
79
|
+
*
|
|
80
|
+
* Without this, `listen()` has no `'error'` handler and EADDRINUSE reaches Node's default handler:
|
|
81
|
+
* the creator gets a raw stack trace through `node:net` and our own `dist/` paths, which reads as a
|
|
82
|
+
* crash inside abx rather than "something else is on this port" — and it's the one unformatted error
|
|
83
|
+
* surface in a CLI where every other error is formatted. `preview`'s default port colliding with a
|
|
84
|
+
* studio left running in another terminal was reported as especially hard to diagnose.
|
|
85
|
+
*/
|
|
86
|
+
export declare function assertPortFree(port: number, cmd: string): Promise<void>;
|
|
87
|
+
/** Is a TCP port already bound on localhost? Used to preflight a serve BEFORE spending a tx. */
|
|
88
|
+
export declare function portInUse(port: number): Promise<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Index a project we *just* deployed — and don't believe a zero.
|
|
91
|
+
*
|
|
92
|
+
* `eth_getLogs` is read-after-write inconsistent on load-balanced RPCs: `waitForTransactionReceipt`
|
|
93
|
+
* resolves against a node that has the block, then the log query lands on one that doesn't yet, and
|
|
94
|
+
* returns an empty set for a block we KNOW contains our deploy. The old code took that single read at
|
|
95
|
+
* face value, printed `✓ reconstructed 0 events`, stored the empty projection, and served an empty
|
|
96
|
+
* dashboard — a first-run that looks like the toolkit simply doesn't work. It reproduced 100% of the
|
|
97
|
+
* time on `https://sepolia.base.org`, which is the DEFAULT endpoint when there's no `.env`, i.e. the
|
|
98
|
+
* documented first run was the broken path. The same block returned all 9 logs seconds later.
|
|
99
|
+
*
|
|
100
|
+
* We have the one thing that makes this checkable: we just minted, so the spine cannot be empty.
|
|
101
|
+
* So verify instead of trusting — re-scan at a constant delay until events appear, and if they
|
|
102
|
+
* never do, say so as a FAILURE with the recovery command rather than dressing a zero up as a ✓.
|
|
103
|
+
*/
|
|
104
|
+
export declare function reindexAfterDeploy(indexer: SelfHostIndexer, address: Address, opts?: {
|
|
105
|
+
attempts?: number;
|
|
106
|
+
delayMs?: number;
|
|
107
|
+
readUriDocuments?: boolean;
|
|
108
|
+
}): Promise<{
|
|
109
|
+
state: ProjectState;
|
|
110
|
+
elapsedMs: number;
|
|
111
|
+
}>;
|
|
112
|
+
export declare function loadEffects(): Promise<typeof import('@artblocks/abx-effects')>;
|
|
113
|
+
/**
|
|
114
|
+
* The publish topology's one hard prerequisite, checked BEFORE any capture.
|
|
115
|
+
*
|
|
116
|
+
* A resolver that doesn't share this machine's disk serves referenced output (the still, a video, a
|
|
117
|
+
* model) by **redirect** — so it needs a URL, and it refuses the bytes (`specs/protocol/effects.md →
|
|
118
|
+
* Bound vs referenced`). A backend that can't name a locator therefore has no publish lane at all,
|
|
119
|
+
* and every render against one would be work spent to earn a 400.
|
|
120
|
+
*
|
|
121
|
+
* So this refuses up front and names the ways out, rather than warning and letting the render run.
|
|
122
|
+
* It deliberately does NOT pick a backend for the operator: which store holds their art — and which
|
|
123
|
+
* gateway serves it — is theirs to decide. The three that work are peers, not a ranking: `https://`
|
|
124
|
+
* from S3/R2, an IPFS gateway, and Arweave are all fine, because derived output is re-creatable and
|
|
125
|
+
* the only real requirement is that a third party can fetch it.
|
|
126
|
+
*/
|
|
127
|
+
export declare function requirePublishableBackend(flags: Flags, what: string): void;
|
|
128
|
+
export declare function printServing(url: string, address?: Address): void;
|
|
129
|
+
/** Walk up from the CLI source to the workspace root (the dir with pnpm-workspace.yaml). Returns
|
|
130
|
+
* null when running from a published install (no workspace) — where --from-source doesn't apply. */
|
|
131
|
+
export declare function findRepoRoot(): string | null;
|
|
132
|
+
export declare function keepAlive(): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Pick the canonical factory for a clone being added — the CLI-side shell around the SDK's
|
|
135
|
+
* {@link sdkDetectCanonicalFactory} (which does the actual multicall probe; see its doc comment).
|
|
136
|
+
* Shared by `add`'s local + remote paths (project.ts) and the deploy family's post-setup local
|
|
137
|
+
* register (deploy.ts, via {@link registerAndIndexLocally}).
|
|
138
|
+
*/
|
|
139
|
+
export declare function detectCanonicalFactory(address: Address, override?: string, stored?: string | null): Promise<Address | undefined>;
|
|
140
|
+
/**
|
|
141
|
+
* Register + index a project LOCALLY (this node's own SQLite-backed projection) — the core of
|
|
142
|
+
* `abx add`'s non-`--remote` path, factored out here because it's ALSO how `deploy` / `deploy-series`
|
|
143
|
+
* / `deploy-code` register the project they just deployed (see cmdAdd in commands/project.ts, whose
|
|
144
|
+
* local branch is a thin call to this). Kept self-sufficient (recomputes any `--attributes`/`--traits`
|
|
145
|
+
* edit from `flags` itself) so it never depends on a caller's local variables.
|
|
146
|
+
*/
|
|
147
|
+
export declare function registerAndIndexLocally(address: Address, flags: Flags): Promise<void>;
|
|
148
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,KAAK,OAAO,EAIZ,KAAK,YAAY,EACjB,KAAK,YAAY,EAEjB,KAAK,MAAM,EAkBZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAC,KAAK,KAAK,EAAC,MAAM,YAAY,CAAC;AAItC,eAAO,MAAM,CAAC;;;;;;;;CAGb,CAAC;AACF,eAAO,MAAM,CAAC,GAAI,GAAG,MAAM,WAA+B,CAAC;AAC3D,eAAO,MAAM,CAAC,GAAI,GAAG,MAAM,WAAgC,CAAC;AAC5D,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM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