@clarigen/cli 2.1.1 → 2.1.3
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/dist/index.cjs +196 -163
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +456 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +187 -165
- package/dist/index.js.map +1 -1
- package/dist/run-cli.cjs +252 -211
- package/dist/run-cli.cjs.map +1 -1
- package/dist/run-cli.d.cts +1 -0
- package/dist/run-cli.js +243 -212
- package/dist/run-cli.js.map +1 -1
- package/package.json +5 -6
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { ClarityAbi, ClarityAbiFunction, ClarityAbiMap, ClarityAbiVariable, ClarityAbiArg, ClarityAbiType } from '@clarigen/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Simnet } from '@hirosystems/clarinet-sdk';
|
|
4
|
+
import { inspect, InspectOptions } from 'util';
|
|
5
|
+
|
|
6
|
+
interface SessionContract {
|
|
7
|
+
contract_id: string;
|
|
8
|
+
contract_interface: ClarityAbi;
|
|
9
|
+
source: string;
|
|
10
|
+
}
|
|
11
|
+
type EpochType = ClarityAbi;
|
|
12
|
+
type SessionAccount = {
|
|
13
|
+
address: string;
|
|
14
|
+
balance: string;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
interface Session {
|
|
18
|
+
session_id: number;
|
|
19
|
+
accounts: SessionAccount[];
|
|
20
|
+
contracts: SessionContract[];
|
|
21
|
+
}
|
|
22
|
+
interface SessionWithVariables extends Session {
|
|
23
|
+
variables: string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const ClarinetConfigSchema: z.ZodObject<{
|
|
27
|
+
project: z.ZodObject<{
|
|
28
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
29
|
+
contract_id: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
contract_id: string;
|
|
32
|
+
}, {
|
|
33
|
+
contract_id: string;
|
|
34
|
+
}>, "many">>;
|
|
35
|
+
cache_location: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
path: z.ZodString;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
path: string;
|
|
39
|
+
}, {
|
|
40
|
+
path: string;
|
|
41
|
+
}>>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
requirements?: {
|
|
44
|
+
contract_id: string;
|
|
45
|
+
}[] | undefined;
|
|
46
|
+
cache_location?: {
|
|
47
|
+
path: string;
|
|
48
|
+
} | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
requirements?: {
|
|
51
|
+
contract_id: string;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
cache_location?: {
|
|
54
|
+
path: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
contracts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
58
|
+
path: z.ZodString;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
path: string;
|
|
61
|
+
}, {
|
|
62
|
+
path: string;
|
|
63
|
+
}>>>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
project: {
|
|
66
|
+
requirements?: {
|
|
67
|
+
contract_id: string;
|
|
68
|
+
}[] | undefined;
|
|
69
|
+
cache_location?: {
|
|
70
|
+
path: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
};
|
|
73
|
+
contracts?: Record<string, {
|
|
74
|
+
path: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
project: {
|
|
78
|
+
requirements?: {
|
|
79
|
+
contract_id: string;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
cache_location?: {
|
|
82
|
+
path: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
};
|
|
85
|
+
contracts?: Record<string, {
|
|
86
|
+
path: string;
|
|
87
|
+
}> | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
type ClarinetConfig = z.infer<typeof ClarinetConfigSchema>;
|
|
90
|
+
declare function getClarinetConfig(path: string): Promise<ClarinetConfig>;
|
|
91
|
+
|
|
92
|
+
declare const CONFIG_FILE: "Clarigen.toml";
|
|
93
|
+
declare enum OutputType {
|
|
94
|
+
ESM = "types",
|
|
95
|
+
ESM_OLD = "esm",
|
|
96
|
+
Docs = "docs"
|
|
97
|
+
}
|
|
98
|
+
declare const ConfigFileSchema: z.ZodObject<{
|
|
99
|
+
clarinet: z.ZodString;
|
|
100
|
+
types: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
output: z.ZodOptional<z.ZodString>;
|
|
102
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
103
|
+
include_accounts: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
after: z.ZodOptional<z.ZodString>;
|
|
105
|
+
include_boot_contracts: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
watch_folders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
output?: string | undefined;
|
|
109
|
+
outputs?: string[] | undefined;
|
|
110
|
+
include_accounts?: boolean | undefined;
|
|
111
|
+
after?: string | undefined;
|
|
112
|
+
include_boot_contracts?: boolean | undefined;
|
|
113
|
+
watch_folders?: string[] | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
output?: string | undefined;
|
|
116
|
+
outputs?: string[] | undefined;
|
|
117
|
+
include_accounts?: boolean | undefined;
|
|
118
|
+
after?: string | undefined;
|
|
119
|
+
include_boot_contracts?: boolean | undefined;
|
|
120
|
+
watch_folders?: string[] | undefined;
|
|
121
|
+
}>>;
|
|
122
|
+
esm: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
output: z.ZodOptional<z.ZodString>;
|
|
124
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
125
|
+
include_accounts: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
after: z.ZodOptional<z.ZodString>;
|
|
127
|
+
include_boot_contracts: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
watch_folders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
output?: string | undefined;
|
|
131
|
+
outputs?: string[] | undefined;
|
|
132
|
+
include_accounts?: boolean | undefined;
|
|
133
|
+
after?: string | undefined;
|
|
134
|
+
include_boot_contracts?: boolean | undefined;
|
|
135
|
+
watch_folders?: string[] | undefined;
|
|
136
|
+
}, {
|
|
137
|
+
output?: string | undefined;
|
|
138
|
+
outputs?: string[] | undefined;
|
|
139
|
+
include_accounts?: boolean | undefined;
|
|
140
|
+
after?: string | undefined;
|
|
141
|
+
include_boot_contracts?: boolean | undefined;
|
|
142
|
+
watch_folders?: string[] | undefined;
|
|
143
|
+
}>>;
|
|
144
|
+
docs: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
output: z.ZodOptional<z.ZodString>;
|
|
146
|
+
outputs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
147
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
148
|
+
after: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
output?: string | undefined;
|
|
151
|
+
outputs?: string[] | undefined;
|
|
152
|
+
exclude?: string[] | undefined;
|
|
153
|
+
after?: string | undefined;
|
|
154
|
+
}, {
|
|
155
|
+
output?: string | undefined;
|
|
156
|
+
outputs?: string[] | undefined;
|
|
157
|
+
exclude?: string[] | undefined;
|
|
158
|
+
after?: string | undefined;
|
|
159
|
+
}>>;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
clarinet: string;
|
|
162
|
+
types?: {
|
|
163
|
+
output?: string | undefined;
|
|
164
|
+
outputs?: string[] | undefined;
|
|
165
|
+
include_accounts?: boolean | undefined;
|
|
166
|
+
after?: string | undefined;
|
|
167
|
+
include_boot_contracts?: boolean | undefined;
|
|
168
|
+
watch_folders?: string[] | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
esm?: {
|
|
171
|
+
output?: string | undefined;
|
|
172
|
+
outputs?: string[] | undefined;
|
|
173
|
+
include_accounts?: boolean | undefined;
|
|
174
|
+
after?: string | undefined;
|
|
175
|
+
include_boot_contracts?: boolean | undefined;
|
|
176
|
+
watch_folders?: string[] | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
docs?: {
|
|
179
|
+
output?: string | undefined;
|
|
180
|
+
outputs?: string[] | undefined;
|
|
181
|
+
exclude?: string[] | undefined;
|
|
182
|
+
after?: string | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
}, {
|
|
185
|
+
clarinet: string;
|
|
186
|
+
types?: {
|
|
187
|
+
output?: string | undefined;
|
|
188
|
+
outputs?: string[] | undefined;
|
|
189
|
+
include_accounts?: boolean | undefined;
|
|
190
|
+
after?: string | undefined;
|
|
191
|
+
include_boot_contracts?: boolean | undefined;
|
|
192
|
+
watch_folders?: string[] | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
esm?: {
|
|
195
|
+
output?: string | undefined;
|
|
196
|
+
outputs?: string[] | undefined;
|
|
197
|
+
include_accounts?: boolean | undefined;
|
|
198
|
+
after?: string | undefined;
|
|
199
|
+
include_boot_contracts?: boolean | undefined;
|
|
200
|
+
watch_folders?: string[] | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
docs?: {
|
|
203
|
+
output?: string | undefined;
|
|
204
|
+
outputs?: string[] | undefined;
|
|
205
|
+
exclude?: string[] | undefined;
|
|
206
|
+
after?: string | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
type ConfigFile = z.infer<typeof ConfigFileSchema>;
|
|
210
|
+
declare const defaultConfigFile: ConfigFile;
|
|
211
|
+
declare class Config {
|
|
212
|
+
configFile: ConfigFile;
|
|
213
|
+
clarinet: ClarinetConfig;
|
|
214
|
+
cwd: string;
|
|
215
|
+
constructor(config: ConfigFile, clarinet: ClarinetConfig, cwd?: string);
|
|
216
|
+
static load(cwd?: string): Promise<Config>;
|
|
217
|
+
getOutputs(type: OutputType): string[];
|
|
218
|
+
outputResolve(type: OutputType, filePath?: string): string[] | null;
|
|
219
|
+
writeOutput(type: OutputType, contents: string, filePath?: string): Promise<string[] | null>;
|
|
220
|
+
supports(type: OutputType): boolean;
|
|
221
|
+
type(type: OutputType): {
|
|
222
|
+
output?: string | undefined;
|
|
223
|
+
outputs?: string[] | undefined;
|
|
224
|
+
include_accounts?: boolean | undefined;
|
|
225
|
+
after?: string | undefined;
|
|
226
|
+
include_boot_contracts?: boolean | undefined;
|
|
227
|
+
watch_folders?: string[] | undefined;
|
|
228
|
+
} | {
|
|
229
|
+
output?: string | undefined;
|
|
230
|
+
outputs?: string[] | undefined;
|
|
231
|
+
exclude?: string[] | undefined;
|
|
232
|
+
after?: string | undefined;
|
|
233
|
+
} | undefined;
|
|
234
|
+
get esm(): {
|
|
235
|
+
output?: string | undefined;
|
|
236
|
+
outputs?: string[] | undefined;
|
|
237
|
+
include_accounts?: boolean | undefined;
|
|
238
|
+
after?: string | undefined;
|
|
239
|
+
include_boot_contracts?: boolean | undefined;
|
|
240
|
+
watch_folders?: string[] | undefined;
|
|
241
|
+
} | undefined;
|
|
242
|
+
get docs(): {
|
|
243
|
+
output?: string | undefined;
|
|
244
|
+
outputs?: string[] | undefined;
|
|
245
|
+
exclude?: string[] | undefined;
|
|
246
|
+
after?: string | undefined;
|
|
247
|
+
} | undefined;
|
|
248
|
+
clarinetFile(): string;
|
|
249
|
+
joinFromClarinet(filePath: string): string;
|
|
250
|
+
}
|
|
251
|
+
declare function configFilePath(cwd?: string): string;
|
|
252
|
+
declare function saveConfig(config: ConfigFile): Promise<void>;
|
|
253
|
+
declare function getConfig(cwd?: string): Promise<ConfigFile>;
|
|
254
|
+
|
|
255
|
+
declare const FN_TYPES: readonly ["read-only", "public", "private"];
|
|
256
|
+
declare const VAR_TYPES: readonly ["map", "data-var", "constant"];
|
|
257
|
+
type ClarityAbiItem = ClarityAbiFunction | ClarityAbiMap | ClarityAbiVariable;
|
|
258
|
+
type ClaridocItemType<T extends ClarityAbiItem> = {
|
|
259
|
+
abi: T;
|
|
260
|
+
comments: Comments;
|
|
261
|
+
startLine: number;
|
|
262
|
+
source: string[];
|
|
263
|
+
};
|
|
264
|
+
type ClaridocFunction = ClaridocItemType<ClarityAbiFunction>;
|
|
265
|
+
type ClaridocMap = ClaridocItemType<ClarityAbiMap>;
|
|
266
|
+
type ClaridocVariable = ClaridocItemType<ClarityAbiVariable>;
|
|
267
|
+
interface ClaridocItem {
|
|
268
|
+
abi: ClarityAbiItem;
|
|
269
|
+
comments: Comments;
|
|
270
|
+
startLine: number;
|
|
271
|
+
source: string[];
|
|
272
|
+
}
|
|
273
|
+
interface Comments {
|
|
274
|
+
params: Record<string, ClaridocParam>;
|
|
275
|
+
text: string[];
|
|
276
|
+
}
|
|
277
|
+
interface ClaridocContract {
|
|
278
|
+
functions: ClaridocFunction[];
|
|
279
|
+
maps: ClaridocMap[];
|
|
280
|
+
variables: ClaridocVariable[];
|
|
281
|
+
comments: string[];
|
|
282
|
+
}
|
|
283
|
+
interface ClaridocParam {
|
|
284
|
+
abi: ClarityAbiArg;
|
|
285
|
+
comments: string[];
|
|
286
|
+
}
|
|
287
|
+
declare function createContractDocInfo({ contractSrc, abi, }: {
|
|
288
|
+
contractSrc: string;
|
|
289
|
+
abi: ClarityAbi;
|
|
290
|
+
}): ClaridocContract;
|
|
291
|
+
declare function isComment(line: string): boolean;
|
|
292
|
+
declare function getFnName(line: string): string | undefined;
|
|
293
|
+
declare function traceParens(line: string, count: number): number;
|
|
294
|
+
declare function parseComments(comments: string[], abi: ClarityAbiItem): Comments;
|
|
295
|
+
declare function afterDocs(config: Config): Promise<void>;
|
|
296
|
+
|
|
297
|
+
declare function generateMarkdown({ contract, contractFile, withToc, }: {
|
|
298
|
+
contract: SessionContract;
|
|
299
|
+
contractFile?: string;
|
|
300
|
+
withToc?: boolean;
|
|
301
|
+
}): string;
|
|
302
|
+
declare function markdownFunction(fn: ClaridocFunction, contractFile?: string): string;
|
|
303
|
+
declare function generateReadme(session: Session, excluded: Record<string, boolean>): string;
|
|
304
|
+
|
|
305
|
+
declare function generateDocs({ session, config, }: {
|
|
306
|
+
session: SessionWithVariables;
|
|
307
|
+
config: Config;
|
|
308
|
+
}): Promise<void>;
|
|
309
|
+
|
|
310
|
+
declare function getVariablesV2(contract: SessionContract, simnet: Simnet, verbose?: boolean): any;
|
|
311
|
+
declare function mapVariables(session: Session, simnet: Simnet): string[];
|
|
312
|
+
|
|
313
|
+
declare function generateContractMeta(contract: SessionContract, constants: string): string;
|
|
314
|
+
declare const TYPE_IMPORTS = "import type { TypedAbiArg, TypedAbiFunction, TypedAbiMap, TypedAbiVariable, Response } from '@clarigen/core';";
|
|
315
|
+
declare function generateBaseFile(session: SessionWithVariables): string;
|
|
316
|
+
declare function encodeVariables(variables: ClarityAbiVariable[]): string[];
|
|
317
|
+
declare global {
|
|
318
|
+
interface Uint8Array {
|
|
319
|
+
[inspect.custom](depth: number, options: InspectOptions): string;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
declare function serialize(obj: any): string;
|
|
323
|
+
|
|
324
|
+
interface EmulatedContractPublishTransaction {
|
|
325
|
+
'emulated-contract-publish': {
|
|
326
|
+
'contract-name': string;
|
|
327
|
+
'emulated-sender': string;
|
|
328
|
+
path: string;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
interface RequirementPublishTransaction {
|
|
332
|
+
'requirement-publish': {
|
|
333
|
+
'contract-id': string;
|
|
334
|
+
'remap-sender': string;
|
|
335
|
+
'remap-principals': Record<string, string>;
|
|
336
|
+
path: string;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
interface ContractPublishTransaction {
|
|
340
|
+
'contract-publish': {
|
|
341
|
+
'contract-name': string;
|
|
342
|
+
'expected-sender': string;
|
|
343
|
+
path: string;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
interface ContractCallTransaction {
|
|
347
|
+
'contract-call': {
|
|
348
|
+
'contract-id': string;
|
|
349
|
+
'expected-sender': string;
|
|
350
|
+
parameters: Readonly<string[]>;
|
|
351
|
+
method: string;
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
interface EmulatedContractCallTransaction {
|
|
355
|
+
'emulated-contract-call': {
|
|
356
|
+
'contract-id': string;
|
|
357
|
+
'emulated-sender': string;
|
|
358
|
+
parameters: Readonly<string[]>;
|
|
359
|
+
method: string;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
interface BtcTransferTransaction {
|
|
363
|
+
'btc-transfer': {
|
|
364
|
+
'expected-sender': string;
|
|
365
|
+
recipient: string;
|
|
366
|
+
'sats-per-byte': string;
|
|
367
|
+
'sats-amount': string;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
type Transaction = EmulatedContractPublishTransaction | RequirementPublishTransaction | ContractPublishTransaction | EmulatedContractCallTransaction | BtcTransferTransaction | ContractCallTransaction;
|
|
371
|
+
type ContractTransaction = EmulatedContractPublishTransaction | RequirementPublishTransaction | ContractPublishTransaction;
|
|
372
|
+
interface Batch<T extends Transaction> {
|
|
373
|
+
id: number;
|
|
374
|
+
transactions: Readonly<T[]>;
|
|
375
|
+
}
|
|
376
|
+
interface SimnetAccount {
|
|
377
|
+
address: string;
|
|
378
|
+
name: string;
|
|
379
|
+
balance: string;
|
|
380
|
+
}
|
|
381
|
+
interface SimnetAccountDeployer extends SimnetAccount {
|
|
382
|
+
name: 'deployer';
|
|
383
|
+
}
|
|
384
|
+
interface SimnetDeploymentPlan {
|
|
385
|
+
network: 'simnet';
|
|
386
|
+
genesis: {
|
|
387
|
+
wallets: Readonly<[SimnetAccountDeployer, ...SimnetAccount[]]>;
|
|
388
|
+
contracts: Readonly<string[]>;
|
|
389
|
+
};
|
|
390
|
+
plan: {
|
|
391
|
+
batches: Readonly<Batch<EmulatedContractPublishTransaction | EmulatedContractCallTransaction>[]>;
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
interface DevnetDeploymentPlan {
|
|
395
|
+
network: 'devnet';
|
|
396
|
+
plan: {
|
|
397
|
+
batches: Readonly<Batch<RequirementPublishTransaction | ContractPublishTransaction | ContractCallTransaction | BtcTransferTransaction>[]>;
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
type TestnetDeploymentPlan = Omit<DevnetDeploymentPlan, 'network'> & {
|
|
401
|
+
network: 'testnet';
|
|
402
|
+
};
|
|
403
|
+
interface MainnetDeploymentPlan {
|
|
404
|
+
network: 'mainnet';
|
|
405
|
+
plan: {
|
|
406
|
+
batches: Readonly<Batch<ContractPublishTransaction | ContractCallTransaction | BtcTransferTransaction>[]>;
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
type DeploymentPlan = SimnetDeploymentPlan | DevnetDeploymentPlan | TestnetDeploymentPlan | MainnetDeploymentPlan;
|
|
410
|
+
declare function flatBatch<T extends Transaction>(batches: Batch<T>[]): T[];
|
|
411
|
+
declare function getContractTxs(batches: Batch<Transaction>[]): ContractTransaction[];
|
|
412
|
+
declare function getDeploymentContract(contractName: string, deployment: DeploymentPlan): ContractTransaction;
|
|
413
|
+
declare function getDeploymentTxPath(tx: ContractTransaction): string;
|
|
414
|
+
declare function getIdentifier(tx: ContractTransaction): string;
|
|
415
|
+
declare function isContractTx(tx: Transaction): tx is ContractTransaction;
|
|
416
|
+
|
|
417
|
+
declare function parseDeployment(path: string): Promise<Plan>;
|
|
418
|
+
declare const DEPLOYMENT_NETWORKS: readonly ["devnet", "simnet", "testnet", "mainnet"];
|
|
419
|
+
type DeploymentNetwork = (typeof DEPLOYMENT_NETWORKS)[number];
|
|
420
|
+
type Plan = DeploymentPlan | undefined;
|
|
421
|
+
type DeploymentsMap = {
|
|
422
|
+
[key in DeploymentNetwork]: Plan;
|
|
423
|
+
};
|
|
424
|
+
declare function getDeployments(config: Config): Promise<DeploymentsMap>;
|
|
425
|
+
declare function generateESMFile({ baseFile, session, config, }: {
|
|
426
|
+
baseFile: string;
|
|
427
|
+
session: Session;
|
|
428
|
+
config: Config;
|
|
429
|
+
}): Promise<string>;
|
|
430
|
+
type ContractDeployments = {
|
|
431
|
+
[key in DeploymentNetwork]: string | null;
|
|
432
|
+
};
|
|
433
|
+
type FullContractDeployments = {
|
|
434
|
+
[contractName: string]: ContractDeployments;
|
|
435
|
+
};
|
|
436
|
+
declare function collectContractDeployments(session: Session, deployments: DeploymentsMap, config: Config): FullContractDeployments;
|
|
437
|
+
declare function collectDeploymentFiles(deployments: DeploymentsMap, clarinetFolder: string, cwd: string): {
|
|
438
|
+
identifier: string;
|
|
439
|
+
file: string;
|
|
440
|
+
}[];
|
|
441
|
+
declare function afterESM(config: Config): Promise<void>;
|
|
442
|
+
|
|
443
|
+
declare const jsTypeFromAbiType: (val: ClarityAbiType, isArgument?: boolean) => string;
|
|
444
|
+
declare function abiArgType(arg: ClarityAbiArg): string;
|
|
445
|
+
declare function abiFunctionType(abiFunction: ClarityAbiFunction): string;
|
|
446
|
+
declare function getArgName(name: string): string;
|
|
447
|
+
|
|
448
|
+
declare function encodeVariableName(name: string): string;
|
|
449
|
+
declare function fileExists(filename: string): Promise<boolean>;
|
|
450
|
+
declare function writeFile(path: string, contents: string): Promise<string>;
|
|
451
|
+
declare function cwdRelative(path: string): string;
|
|
452
|
+
declare function sortContracts<T extends {
|
|
453
|
+
contract_id: string;
|
|
454
|
+
}>(contracts: T[]): T[];
|
|
455
|
+
|
|
456
|
+
export { type Batch, CONFIG_FILE, type ClaridocContract, type ClaridocFunction, type ClaridocItem, type ClaridocMap, type ClaridocParam, type ClaridocVariable, type ClarinetConfig, ClarinetConfigSchema, type Comments, Config, type ConfigFile, ConfigFileSchema, type ContractDeployments, type ContractTransaction, DEPLOYMENT_NETWORKS, type DeploymentNetwork, type DeploymentPlan, type DevnetDeploymentPlan, type EpochType, FN_TYPES, type FullContractDeployments, type MainnetDeploymentPlan, OutputType, type Session, type SessionAccount, type SessionContract, type SessionWithVariables, type SimnetAccountDeployer, type SimnetDeploymentPlan, TYPE_IMPORTS, type TestnetDeploymentPlan, type Transaction, VAR_TYPES, abiArgType, abiFunctionType, afterDocs, afterESM, collectContractDeployments, collectDeploymentFiles, configFilePath, createContractDocInfo, cwdRelative, defaultConfigFile, encodeVariableName, encodeVariables, fileExists, flatBatch, generateBaseFile, generateContractMeta, generateDocs, generateESMFile, generateMarkdown, generateReadme, getArgName, getClarinetConfig, getConfig, getContractTxs, getDeploymentContract, getDeploymentTxPath, getDeployments, getFnName, getIdentifier, getVariablesV2, isComment, isContractTx, jsTypeFromAbiType, mapVariables, markdownFunction, parseComments, parseDeployment, saveConfig, serialize, sortContracts, traceParens, writeFile };
|
package/dist/index.d.ts
CHANGED
|
@@ -103,18 +103,21 @@ declare const ConfigFileSchema: z.ZodObject<{
|
|
|
103
103
|
include_accounts: z.ZodOptional<z.ZodBoolean>;
|
|
104
104
|
after: z.ZodOptional<z.ZodString>;
|
|
105
105
|
include_boot_contracts: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
watch_folders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
106
107
|
}, "strip", z.ZodTypeAny, {
|
|
107
108
|
output?: string | undefined;
|
|
108
109
|
outputs?: string[] | undefined;
|
|
109
110
|
include_accounts?: boolean | undefined;
|
|
110
111
|
after?: string | undefined;
|
|
111
112
|
include_boot_contracts?: boolean | undefined;
|
|
113
|
+
watch_folders?: string[] | undefined;
|
|
112
114
|
}, {
|
|
113
115
|
output?: string | undefined;
|
|
114
116
|
outputs?: string[] | undefined;
|
|
115
117
|
include_accounts?: boolean | undefined;
|
|
116
118
|
after?: string | undefined;
|
|
117
119
|
include_boot_contracts?: boolean | undefined;
|
|
120
|
+
watch_folders?: string[] | undefined;
|
|
118
121
|
}>>;
|
|
119
122
|
esm: z.ZodOptional<z.ZodObject<{
|
|
120
123
|
output: z.ZodOptional<z.ZodString>;
|
|
@@ -122,18 +125,21 @@ declare const ConfigFileSchema: z.ZodObject<{
|
|
|
122
125
|
include_accounts: z.ZodOptional<z.ZodBoolean>;
|
|
123
126
|
after: z.ZodOptional<z.ZodString>;
|
|
124
127
|
include_boot_contracts: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
watch_folders: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
125
129
|
}, "strip", z.ZodTypeAny, {
|
|
126
130
|
output?: string | undefined;
|
|
127
131
|
outputs?: string[] | undefined;
|
|
128
132
|
include_accounts?: boolean | undefined;
|
|
129
133
|
after?: string | undefined;
|
|
130
134
|
include_boot_contracts?: boolean | undefined;
|
|
135
|
+
watch_folders?: string[] | undefined;
|
|
131
136
|
}, {
|
|
132
137
|
output?: string | undefined;
|
|
133
138
|
outputs?: string[] | undefined;
|
|
134
139
|
include_accounts?: boolean | undefined;
|
|
135
140
|
after?: string | undefined;
|
|
136
141
|
include_boot_contracts?: boolean | undefined;
|
|
142
|
+
watch_folders?: string[] | undefined;
|
|
137
143
|
}>>;
|
|
138
144
|
docs: z.ZodOptional<z.ZodObject<{
|
|
139
145
|
output: z.ZodOptional<z.ZodString>;
|
|
@@ -159,6 +165,7 @@ declare const ConfigFileSchema: z.ZodObject<{
|
|
|
159
165
|
include_accounts?: boolean | undefined;
|
|
160
166
|
after?: string | undefined;
|
|
161
167
|
include_boot_contracts?: boolean | undefined;
|
|
168
|
+
watch_folders?: string[] | undefined;
|
|
162
169
|
} | undefined;
|
|
163
170
|
esm?: {
|
|
164
171
|
output?: string | undefined;
|
|
@@ -166,6 +173,7 @@ declare const ConfigFileSchema: z.ZodObject<{
|
|
|
166
173
|
include_accounts?: boolean | undefined;
|
|
167
174
|
after?: string | undefined;
|
|
168
175
|
include_boot_contracts?: boolean | undefined;
|
|
176
|
+
watch_folders?: string[] | undefined;
|
|
169
177
|
} | undefined;
|
|
170
178
|
docs?: {
|
|
171
179
|
output?: string | undefined;
|
|
@@ -181,6 +189,7 @@ declare const ConfigFileSchema: z.ZodObject<{
|
|
|
181
189
|
include_accounts?: boolean | undefined;
|
|
182
190
|
after?: string | undefined;
|
|
183
191
|
include_boot_contracts?: boolean | undefined;
|
|
192
|
+
watch_folders?: string[] | undefined;
|
|
184
193
|
} | undefined;
|
|
185
194
|
esm?: {
|
|
186
195
|
output?: string | undefined;
|
|
@@ -188,6 +197,7 @@ declare const ConfigFileSchema: z.ZodObject<{
|
|
|
188
197
|
include_accounts?: boolean | undefined;
|
|
189
198
|
after?: string | undefined;
|
|
190
199
|
include_boot_contracts?: boolean | undefined;
|
|
200
|
+
watch_folders?: string[] | undefined;
|
|
191
201
|
} | undefined;
|
|
192
202
|
docs?: {
|
|
193
203
|
output?: string | undefined;
|
|
@@ -214,6 +224,7 @@ declare class Config {
|
|
|
214
224
|
include_accounts?: boolean | undefined;
|
|
215
225
|
after?: string | undefined;
|
|
216
226
|
include_boot_contracts?: boolean | undefined;
|
|
227
|
+
watch_folders?: string[] | undefined;
|
|
217
228
|
} | {
|
|
218
229
|
output?: string | undefined;
|
|
219
230
|
outputs?: string[] | undefined;
|
|
@@ -226,6 +237,7 @@ declare class Config {
|
|
|
226
237
|
include_accounts?: boolean | undefined;
|
|
227
238
|
after?: string | undefined;
|
|
228
239
|
include_boot_contracts?: boolean | undefined;
|
|
240
|
+
watch_folders?: string[] | undefined;
|
|
229
241
|
} | undefined;
|
|
230
242
|
get docs(): {
|
|
231
243
|
output?: string | undefined;
|
|
@@ -441,4 +453,4 @@ declare function sortContracts<T extends {
|
|
|
441
453
|
contract_id: string;
|
|
442
454
|
}>(contracts: T[]): T[];
|
|
443
455
|
|
|
444
|
-
export { Batch, CONFIG_FILE, ClaridocContract, ClaridocFunction, ClaridocItem, ClaridocMap, ClaridocParam, ClaridocVariable, ClarinetConfig, ClarinetConfigSchema, Comments, Config, ConfigFile, ConfigFileSchema, ContractDeployments, ContractTransaction, DEPLOYMENT_NETWORKS, DeploymentNetwork, DeploymentPlan, DevnetDeploymentPlan, EpochType, FN_TYPES, FullContractDeployments, MainnetDeploymentPlan, OutputType, Session, SessionAccount, SessionContract, SessionWithVariables, SimnetAccountDeployer, SimnetDeploymentPlan, TYPE_IMPORTS, TestnetDeploymentPlan, Transaction, VAR_TYPES, abiArgType, abiFunctionType, afterDocs, afterESM, collectContractDeployments, collectDeploymentFiles, configFilePath, createContractDocInfo, cwdRelative, defaultConfigFile, encodeVariableName, encodeVariables, fileExists, flatBatch, generateBaseFile, generateContractMeta, generateDocs, generateESMFile, generateMarkdown, generateReadme, getArgName, getClarinetConfig, getConfig, getContractTxs, getDeploymentContract, getDeploymentTxPath, getDeployments, getFnName, getIdentifier, getVariablesV2, isComment, isContractTx, jsTypeFromAbiType, mapVariables, markdownFunction, parseComments, parseDeployment, saveConfig, serialize, sortContracts, traceParens, writeFile };
|
|
456
|
+
export { type Batch, CONFIG_FILE, type ClaridocContract, type ClaridocFunction, type ClaridocItem, type ClaridocMap, type ClaridocParam, type ClaridocVariable, type ClarinetConfig, ClarinetConfigSchema, type Comments, Config, type ConfigFile, ConfigFileSchema, type ContractDeployments, type ContractTransaction, DEPLOYMENT_NETWORKS, type DeploymentNetwork, type DeploymentPlan, type DevnetDeploymentPlan, type EpochType, FN_TYPES, type FullContractDeployments, type MainnetDeploymentPlan, OutputType, type Session, type SessionAccount, type SessionContract, type SessionWithVariables, type SimnetAccountDeployer, type SimnetDeploymentPlan, TYPE_IMPORTS, type TestnetDeploymentPlan, type Transaction, VAR_TYPES, abiArgType, abiFunctionType, afterDocs, afterESM, collectContractDeployments, collectDeploymentFiles, configFilePath, createContractDocInfo, cwdRelative, defaultConfigFile, encodeVariableName, encodeVariables, fileExists, flatBatch, generateBaseFile, generateContractMeta, generateDocs, generateESMFile, generateMarkdown, generateReadme, getArgName, getClarinetConfig, getConfig, getContractTxs, getDeploymentContract, getDeploymentTxPath, getDeployments, getFnName, getIdentifier, getVariablesV2, isComment, isContractTx, jsTypeFromAbiType, mapVariables, markdownFunction, parseComments, parseDeployment, saveConfig, serialize, sortContracts, traceParens, writeFile };
|