@openzeppelin/compact-deployer 0.2.0 → 0.3.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +25 -6
  2. package/README.md +116 -81
  3. package/dist/config/compact-config.d.ts +5 -0
  4. package/dist/config/compact-config.js +65 -19
  5. package/dist/config/compact-config.js.map +1 -1
  6. package/dist/config/patterns.d.ts +20 -0
  7. package/dist/config/patterns.js +68 -0
  8. package/dist/config/patterns.js.map +1 -0
  9. package/dist/config/schema.d.ts +314 -46
  10. package/dist/config/schema.js +44 -11
  11. package/dist/config/schema.js.map +1 -1
  12. package/dist/deployer.d.ts +11 -1
  13. package/dist/deployer.js +106 -29
  14. package/dist/deployer.js.map +1 -1
  15. package/dist/errors.d.ts +9 -1
  16. package/dist/errors.js +11 -3
  17. package/dist/errors.js.map +1 -1
  18. package/dist/loaders/artifact.d.ts +2 -0
  19. package/dist/loaders/artifact.js +4 -3
  20. package/dist/loaders/artifact.js.map +1 -1
  21. package/dist/loaders/contract-resolve.d.ts +3 -2
  22. package/dist/loaders/contract-resolve.js +8 -3
  23. package/dist/loaders/contract-resolve.js.map +1 -1
  24. package/dist/loaders/init-state.d.ts +7 -3
  25. package/dist/loaders/init-state.js +9 -3
  26. package/dist/loaders/init-state.js.map +1 -1
  27. package/dist/loaders/signing-key.d.ts +3 -0
  28. package/dist/loaders/signing-key.js +6 -0
  29. package/dist/loaders/signing-key.js.map +1 -1
  30. package/dist/runDeploy.d.ts +7 -1
  31. package/dist/runDeploy.js +7 -2
  32. package/dist/runDeploy.js.map +1 -1
  33. package/dist/services/chain-state.d.ts +7 -4
  34. package/dist/services/chain-state.js +14 -5
  35. package/dist/services/chain-state.js.map +1 -1
  36. package/dist/services/contract-state.d.ts +2 -2
  37. package/dist/services/contract-state.js +2 -2
  38. package/dist/services/contract-state.js.map +1 -1
  39. package/dist/services/deploy-tx.d.ts +16 -5
  40. package/dist/services/deploy-tx.js +17 -7
  41. package/dist/services/deploy-tx.js.map +1 -1
  42. package/dist/services/fragment-size.d.ts +8 -0
  43. package/dist/services/fragment-size.js +19 -0
  44. package/dist/services/fragment-size.js.map +1 -0
  45. package/dist/services/maintenance-tx.d.ts +12 -5
  46. package/dist/services/maintenance-tx.js +13 -2
  47. package/dist/services/maintenance-tx.js.map +1 -1
  48. package/dist/services/wallet-cache.d.ts +3 -3
  49. package/dist/services/wallet-cache.js +2 -2
  50. package/dist/services/wallet-cache.js.map +1 -1
  51. package/dist/services/wallet-sync.js +3 -3
  52. package/dist/services/wallet-sync.js.map +1 -1
  53. package/dist/wallet/handler.d.ts +1 -1
  54. package/dist/wallet/handler.js +5 -3
  55. package/dist/wallet/handler.js.map +1 -1
  56. package/package.json +19 -19
  57. package/proof-server.yml +1 -1
@@ -0,0 +1,68 @@
1
+ import { glob, stat } from 'node:fs/promises';
2
+ import { posix, sep } from 'node:path';
3
+ import { ConfigError } from "../errors.js";
4
+ /** A key holding `/` is a directory pattern, one holding `*`, `?`, `[` or `{` a name pattern. */
5
+ export function keyKind(key) {
6
+ if (key.includes('/'))
7
+ return 'directory';
8
+ return /[*?[{]/.test(key) ? 'name' : 'exact';
9
+ }
10
+ /** Merges matching patterns in file order, then the exact key; a later key wins field by field. */
11
+ export function resolveEntry(name, contracts, source) {
12
+ const all = Object.keys(contracts);
13
+ const patterns = all.filter((key) => {
14
+ switch (keyKind(key)) {
15
+ case 'name':
16
+ return posix.matchesGlob(name, key);
17
+ case 'directory':
18
+ return (source !== undefined &&
19
+ posix.matchesGlob(source, key.replace(/^(\.\/)+/, '')));
20
+ default:
21
+ return false;
22
+ }
23
+ });
24
+ const exact = all.filter((key) => key === name && keyKind(key) === 'exact');
25
+ const keys = [...patterns, ...exact];
26
+ if (keys.length === 0)
27
+ return undefined;
28
+ const merged = Object.assign({ artifact: name }, ...keys.map((key) => contracts[key]));
29
+ return { keys, entry: expandName(merged, name) };
30
+ }
31
+ /** Indexes the `.compact` sources under `dir`, skipping `node_modules` and dot-directories. */
32
+ export async function indexSources(dir) {
33
+ const isDir = await stat(dir).then((s) => s.isDirectory(), () => false);
34
+ if (!isDir) {
35
+ throw new ConfigError(`[profile].src_dir is not a directory: ${dir}`);
36
+ }
37
+ const byName = new Map();
38
+ for await (const file of glob('**/*.compact', {
39
+ cwd: dir,
40
+ exclude: ['**/node_modules'],
41
+ })) {
42
+ const path = file.split(sep).join('/');
43
+ const name = posix.basename(path, '.compact');
44
+ byName.set(name, [...(byName.get(name) ?? []), path]);
45
+ }
46
+ return { dir, byName };
47
+ }
48
+ /** The unique source of `name`, if any; several throw a {@link ConfigError}. */
49
+ export function sourceOf(name, index) {
50
+ const paths = index.byName.get(name) ?? [];
51
+ if (paths.length > 1) {
52
+ throw new ConfigError(`Contract "${name}" matches ${paths.length} sources under ${index.dir}: ${[...paths].sort().join(', ')}`);
53
+ }
54
+ return paths[0];
55
+ }
56
+ function expandName(value, name) {
57
+ if (typeof value === 'string')
58
+ return value.replaceAll('{name}', name);
59
+ if (Array.isArray(value))
60
+ return value.map((v) => expandName(v, name));
61
+ if (typeof value === 'object' &&
62
+ value !== null &&
63
+ Object.getPrototypeOf(value) === Object.prototype) {
64
+ return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, expandName(v, name)]));
65
+ }
66
+ return value;
67
+ }
68
+ //# sourceMappingURL=patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../src/config/patterns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAiB3C,iGAAiG;AACjG,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,WAAW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,IAAI,aAAa,KAAK,CAAC,MAAM,kBAAkB,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,UAAU,CAAC,KAAc,EAAE,IAAY;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACvE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACvE,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,SAAS,EACjD,CAAC;QACD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAChE,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,21 +1,24 @@
1
1
  /**
2
2
  * Zod schema for `compact.toml`. Cross-field rules: `profile.default_network`
3
- * must name a defined `[networks.X]`; `private_state_id` and
4
- * `init_private_state` are both-or-neither.
3
+ * must name a defined `[networks.X]`; `init_private_state` needs
4
+ * `private_state_id`; a directory pattern needs `profile.src_dir`.
5
5
  */
6
6
  import { z } from 'zod';
7
7
  declare const profileSchema: z.ZodDefault<z.ZodObject<{
8
8
  default_network: z.ZodOptional<z.ZodString>;
9
9
  artifacts_dir: z.ZodDefault<z.ZodString>;
10
10
  deployments_dir: z.ZodDefault<z.ZodString>;
11
+ src_dir: z.ZodOptional<z.ZodString>;
11
12
  }, "strip", z.ZodTypeAny, {
12
13
  artifacts_dir: string;
13
14
  deployments_dir: string;
14
15
  default_network?: string | undefined;
16
+ src_dir?: string | undefined;
15
17
  }, {
16
18
  default_network?: string | undefined;
17
19
  artifacts_dir?: string | undefined;
18
20
  deployments_dir?: string | undefined;
21
+ src_dir?: string | undefined;
19
22
  }>>;
20
23
  declare const networkSchema: z.ZodObject<{
21
24
  network_id: z.ZodString;
@@ -106,7 +109,112 @@ declare const fileOrModuleRefSchema: z.ZodUnion<[z.ZodObject<{
106
109
  module: string;
107
110
  export?: string | undefined;
108
111
  }>]>;
109
- declare const contractSchema: z.ZodEffects<z.ZodObject<{
112
+ /** One `[contracts]` table; the keys matching a contract merge before validation. */
113
+ declare const contractEntrySchema: z.ZodObject<{
114
+ artifact: z.ZodOptional<z.ZodString>;
115
+ private_state_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
116
+ init_private_state: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
117
+ file: z.ZodString;
118
+ }, "strict", z.ZodTypeAny, {
119
+ file: string;
120
+ }, {
121
+ file: string;
122
+ }>, z.ZodObject<{
123
+ module: z.ZodString;
124
+ export: z.ZodDefault<z.ZodString>;
125
+ }, "strict", z.ZodTypeAny, {
126
+ module: string;
127
+ export: string;
128
+ }, {
129
+ module: string;
130
+ export?: string | undefined;
131
+ }>]>>>;
132
+ private_state_store_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
133
+ args: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnknown, "many">, z.ZodUnion<[z.ZodObject<{
134
+ file: z.ZodString;
135
+ }, "strict", z.ZodTypeAny, {
136
+ file: string;
137
+ }, {
138
+ file: string;
139
+ }>, z.ZodObject<{
140
+ module: z.ZodString;
141
+ export: z.ZodDefault<z.ZodString>;
142
+ }, "strict", z.ZodTypeAny, {
143
+ module: string;
144
+ export: string;
145
+ }, {
146
+ module: string;
147
+ export?: string | undefined;
148
+ }>]>]>>>;
149
+ witnesses: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
150
+ file: z.ZodString;
151
+ }, "strict", z.ZodTypeAny, {
152
+ file: string;
153
+ }, {
154
+ file: string;
155
+ }>, z.ZodObject<{
156
+ module: z.ZodString;
157
+ export: z.ZodDefault<z.ZodString>;
158
+ }, "strict", z.ZodTypeAny, {
159
+ module: string;
160
+ export: string;
161
+ }, {
162
+ module: string;
163
+ export?: string | undefined;
164
+ }>]>>>;
165
+ signing_key_file: z.ZodOptional<z.ZodString>;
166
+ circuits_per_tx: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
167
+ }, "strip", z.ZodTypeAny, {
168
+ artifact?: string | undefined;
169
+ private_state_id?: string | undefined;
170
+ init_private_state?: {
171
+ file: string;
172
+ } | {
173
+ module: string;
174
+ export: string;
175
+ } | undefined;
176
+ private_state_store_name?: string | undefined;
177
+ args?: unknown[] | {
178
+ file: string;
179
+ } | {
180
+ module: string;
181
+ export: string;
182
+ } | undefined;
183
+ witnesses?: {
184
+ file: string;
185
+ } | {
186
+ module: string;
187
+ export: string;
188
+ } | undefined;
189
+ signing_key_file?: string | undefined;
190
+ circuits_per_tx?: number | undefined;
191
+ }, {
192
+ artifact?: string | undefined;
193
+ private_state_id?: string | undefined;
194
+ init_private_state?: {
195
+ file: string;
196
+ } | {
197
+ module: string;
198
+ export?: string | undefined;
199
+ } | undefined;
200
+ private_state_store_name?: string | undefined;
201
+ args?: unknown[] | {
202
+ file: string;
203
+ } | {
204
+ module: string;
205
+ export?: string | undefined;
206
+ } | undefined;
207
+ witnesses?: {
208
+ file: string;
209
+ } | {
210
+ module: string;
211
+ export?: string | undefined;
212
+ } | undefined;
213
+ signing_key_file?: string | undefined;
214
+ circuits_per_tx?: number | undefined;
215
+ }>;
216
+ /** A contract once its matching `[contracts]` tables merge. */
217
+ export declare const contractSchema: z.ZodEffects<z.ZodObject<{
110
218
  artifact: z.ZodString;
111
219
  private_state_id: z.ZodOptional<z.ZodString>;
112
220
  init_private_state: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -257,19 +365,22 @@ declare const contractSchema: z.ZodEffects<z.ZodObject<{
257
365
  } | undefined;
258
366
  circuits_per_tx?: number | undefined;
259
367
  }>;
260
- export declare const configSchema: z.ZodEffects<z.ZodObject<{
368
+ export declare const configSchema: z.ZodPipeline<z.ZodEffects<z.ZodObject<{
261
369
  profile: z.ZodDefault<z.ZodObject<{
262
370
  default_network: z.ZodOptional<z.ZodString>;
263
371
  artifacts_dir: z.ZodDefault<z.ZodString>;
264
372
  deployments_dir: z.ZodDefault<z.ZodString>;
373
+ src_dir: z.ZodOptional<z.ZodString>;
265
374
  }, "strip", z.ZodTypeAny, {
266
375
  artifacts_dir: string;
267
376
  deployments_dir: string;
268
377
  default_network?: string | undefined;
378
+ src_dir?: string | undefined;
269
379
  }, {
270
380
  default_network?: string | undefined;
271
381
  artifacts_dir?: string | undefined;
272
382
  deployments_dir?: string | undefined;
383
+ src_dir?: string | undefined;
273
384
  }>>;
274
385
  networks: z.ZodRecord<z.ZodString, z.ZodObject<{
275
386
  network_id: z.ZodString;
@@ -327,10 +438,10 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
327
438
  }, {
328
439
  keystore?: string | undefined;
329
440
  }>>;
330
- contracts: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
331
- artifact: z.ZodString;
332
- private_state_id: z.ZodOptional<z.ZodString>;
333
- init_private_state: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
441
+ contracts: z.ZodRecord<z.ZodString, z.ZodObject<{
442
+ artifact: z.ZodOptional<z.ZodString>;
443
+ private_state_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
444
+ init_private_state: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
334
445
  file: z.ZodString;
335
446
  }, "strict", z.ZodTypeAny, {
336
447
  file: string;
@@ -345,9 +456,9 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
345
456
  }, {
346
457
  module: string;
347
458
  export?: string | undefined;
348
- }>]>>;
349
- private_state_store_name: z.ZodOptional<z.ZodString>;
350
- args: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnknown, "many">, z.ZodUnion<[z.ZodObject<{
459
+ }>]>>>;
460
+ private_state_store_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
461
+ args: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodUnknown, "many">, z.ZodUnion<[z.ZodObject<{
351
462
  file: z.ZodString;
352
463
  }, "strict", z.ZodTypeAny, {
353
464
  file: string;
@@ -362,8 +473,8 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
362
473
  }, {
363
474
  module: string;
364
475
  export?: string | undefined;
365
- }>]>]>>;
366
- witnesses: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
476
+ }>]>]>>>;
477
+ witnesses: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
367
478
  file: z.ZodString;
368
479
  }, "strict", z.ZodTypeAny, {
369
480
  file: string;
@@ -378,12 +489,11 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
378
489
  }, {
379
490
  module: string;
380
491
  export?: string | undefined;
381
- }>]>>;
382
- signing_key_file: z.ZodString;
383
- circuits_per_tx: z.ZodOptional<z.ZodNumber>;
492
+ }>]>>>;
493
+ signing_key_file: z.ZodOptional<z.ZodString>;
494
+ circuits_per_tx: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
384
495
  }, "strip", z.ZodTypeAny, {
385
- artifact: string;
386
- signing_key_file: string;
496
+ artifact?: string | undefined;
387
497
  private_state_id?: string | undefined;
388
498
  init_private_state?: {
389
499
  file: string;
@@ -404,10 +514,10 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
404
514
  module: string;
405
515
  export: string;
406
516
  } | undefined;
517
+ signing_key_file?: string | undefined;
407
518
  circuits_per_tx?: number | undefined;
408
519
  }, {
409
- artifact: string;
410
- signing_key_file: string;
520
+ artifact?: string | undefined;
411
521
  private_state_id?: string | undefined;
412
522
  init_private_state?: {
413
523
  file: string;
@@ -428,10 +538,33 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
428
538
  module: string;
429
539
  export?: string | undefined;
430
540
  } | undefined;
541
+ signing_key_file?: string | undefined;
431
542
  circuits_per_tx?: number | undefined;
432
- }>, {
433
- artifact: string;
434
- signing_key_file: string;
543
+ }>>;
544
+ }, "strip", z.ZodTypeAny, {
545
+ profile: {
546
+ artifacts_dir: string;
547
+ deployments_dir: string;
548
+ default_network?: string | undefined;
549
+ src_dir?: string | undefined;
550
+ };
551
+ networks: Record<string, {
552
+ network_id: string;
553
+ indexer: string;
554
+ indexer_ws: string;
555
+ node: string;
556
+ node_ws: string;
557
+ proof_server?: string | undefined;
558
+ wallet?: {
559
+ source: "local";
560
+ index: number;
561
+ } | undefined;
562
+ explorer?: string | undefined;
563
+ sync_timeout?: number | undefined;
564
+ sync_batch_size?: number | undefined;
565
+ }>;
566
+ contracts: Record<string, {
567
+ artifact?: string | undefined;
435
568
  private_state_id?: string | undefined;
436
569
  init_private_state?: {
437
570
  file: string;
@@ -452,10 +585,30 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
452
585
  module: string;
453
586
  export: string;
454
587
  } | undefined;
588
+ signing_key_file?: string | undefined;
455
589
  circuits_per_tx?: number | undefined;
456
- }, {
457
- artifact: string;
458
- signing_key_file: string;
590
+ }>;
591
+ wallet?: {
592
+ keystore?: string | undefined;
593
+ } | undefined;
594
+ }, {
595
+ networks: Record<string, {
596
+ network_id: string;
597
+ indexer: string;
598
+ indexer_ws: string;
599
+ node: string;
600
+ node_ws: string;
601
+ proof_server?: string | undefined;
602
+ wallet?: {
603
+ source: "local";
604
+ index?: number | undefined;
605
+ } | undefined;
606
+ explorer?: string | undefined;
607
+ sync_timeout?: number | undefined;
608
+ sync_batch_size?: number | undefined;
609
+ }>;
610
+ contracts: Record<string, {
611
+ artifact?: string | undefined;
459
612
  private_state_id?: string | undefined;
460
613
  init_private_state?: {
461
614
  file: string;
@@ -476,13 +629,24 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
476
629
  module: string;
477
630
  export?: string | undefined;
478
631
  } | undefined;
632
+ signing_key_file?: string | undefined;
479
633
  circuits_per_tx?: number | undefined;
480
- }>>;
481
- }, "strip", z.ZodTypeAny, {
634
+ }>;
635
+ wallet?: {
636
+ keystore?: string | undefined;
637
+ } | undefined;
638
+ profile?: {
639
+ default_network?: string | undefined;
640
+ artifacts_dir?: string | undefined;
641
+ deployments_dir?: string | undefined;
642
+ src_dir?: string | undefined;
643
+ } | undefined;
644
+ }>, {
482
645
  profile: {
483
646
  artifacts_dir: string;
484
647
  deployments_dir: string;
485
648
  default_network?: string | undefined;
649
+ src_dir?: string | undefined;
486
650
  };
487
651
  networks: Record<string, {
488
652
  network_id: string;
@@ -500,8 +664,7 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
500
664
  sync_batch_size?: number | undefined;
501
665
  }>;
502
666
  contracts: Record<string, {
503
- artifact: string;
504
- signing_key_file: string;
667
+ artifact?: string | undefined;
505
668
  private_state_id?: string | undefined;
506
669
  init_private_state?: {
507
670
  file: string;
@@ -522,6 +685,7 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
522
685
  module: string;
523
686
  export: string;
524
687
  } | undefined;
688
+ signing_key_file?: string | undefined;
525
689
  circuits_per_tx?: number | undefined;
526
690
  }>;
527
691
  wallet?: {
@@ -544,8 +708,7 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
544
708
  sync_batch_size?: number | undefined;
545
709
  }>;
546
710
  contracts: Record<string, {
547
- artifact: string;
548
- signing_key_file: string;
711
+ artifact?: string | undefined;
549
712
  private_state_id?: string | undefined;
550
713
  init_private_state?: {
551
714
  file: string;
@@ -566,6 +729,7 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
566
729
  module: string;
567
730
  export?: string | undefined;
568
731
  } | undefined;
732
+ signing_key_file?: string | undefined;
569
733
  circuits_per_tx?: number | undefined;
570
734
  }>;
571
735
  wallet?: {
@@ -575,12 +739,14 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
575
739
  default_network?: string | undefined;
576
740
  artifacts_dir?: string | undefined;
577
741
  deployments_dir?: string | undefined;
742
+ src_dir?: string | undefined;
578
743
  } | undefined;
579
- }>, {
744
+ }>, z.ZodEffects<z.ZodType<{
580
745
  profile: {
581
746
  artifacts_dir: string;
582
747
  deployments_dir: string;
583
748
  default_network?: string | undefined;
749
+ src_dir?: string | undefined;
584
750
  };
585
751
  networks: Record<string, {
586
752
  network_id: string;
@@ -598,8 +764,7 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
598
764
  sync_batch_size?: number | undefined;
599
765
  }>;
600
766
  contracts: Record<string, {
601
- artifact: string;
602
- signing_key_file: string;
767
+ artifact?: string | undefined;
603
768
  private_state_id?: string | undefined;
604
769
  init_private_state?: {
605
770
  file: string;
@@ -620,12 +785,19 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
620
785
  module: string;
621
786
  export: string;
622
787
  } | undefined;
788
+ signing_key_file?: string | undefined;
623
789
  circuits_per_tx?: number | undefined;
624
790
  }>;
625
791
  wallet?: {
626
792
  keystore?: string | undefined;
627
793
  } | undefined;
628
- }, {
794
+ }, z.ZodTypeDef, {
795
+ profile: {
796
+ artifacts_dir: string;
797
+ deployments_dir: string;
798
+ default_network?: string | undefined;
799
+ src_dir?: string | undefined;
800
+ };
629
801
  networks: Record<string, {
630
802
  network_id: string;
631
803
  indexer: string;
@@ -635,48 +807,144 @@ export declare const configSchema: z.ZodEffects<z.ZodObject<{
635
807
  proof_server?: string | undefined;
636
808
  wallet?: {
637
809
  source: "local";
638
- index?: number | undefined;
810
+ index: number;
639
811
  } | undefined;
640
812
  explorer?: string | undefined;
641
813
  sync_timeout?: number | undefined;
642
814
  sync_batch_size?: number | undefined;
643
815
  }>;
644
816
  contracts: Record<string, {
645
- artifact: string;
646
- signing_key_file: string;
817
+ artifact?: string | undefined;
647
818
  private_state_id?: string | undefined;
648
819
  init_private_state?: {
649
820
  file: string;
650
821
  } | {
651
822
  module: string;
652
- export?: string | undefined;
823
+ export: string;
653
824
  } | undefined;
654
825
  private_state_store_name?: string | undefined;
655
826
  args?: unknown[] | {
656
827
  file: string;
657
828
  } | {
658
829
  module: string;
659
- export?: string | undefined;
830
+ export: string;
660
831
  } | undefined;
661
832
  witnesses?: {
662
833
  file: string;
663
834
  } | {
664
835
  module: string;
665
- export?: string | undefined;
836
+ export: string;
666
837
  } | undefined;
838
+ signing_key_file?: string | undefined;
667
839
  circuits_per_tx?: number | undefined;
668
840
  }>;
669
841
  wallet?: {
670
842
  keystore?: string | undefined;
671
843
  } | undefined;
672
- profile?: {
844
+ }>, {
845
+ profile: {
846
+ artifacts_dir: string;
847
+ deployments_dir: string;
673
848
  default_network?: string | undefined;
674
- artifacts_dir?: string | undefined;
675
- deployments_dir?: string | undefined;
849
+ src_dir?: string | undefined;
850
+ };
851
+ networks: Record<string, {
852
+ network_id: string;
853
+ indexer: string;
854
+ indexer_ws: string;
855
+ node: string;
856
+ node_ws: string;
857
+ proof_server?: string | undefined;
858
+ wallet?: {
859
+ source: "local";
860
+ index: number;
861
+ } | undefined;
862
+ explorer?: string | undefined;
863
+ sync_timeout?: number | undefined;
864
+ sync_batch_size?: number | undefined;
865
+ }>;
866
+ contracts: Record<string, {
867
+ artifact?: string | undefined;
868
+ private_state_id?: string | undefined;
869
+ init_private_state?: {
870
+ file: string;
871
+ } | {
872
+ module: string;
873
+ export: string;
874
+ } | undefined;
875
+ private_state_store_name?: string | undefined;
876
+ args?: unknown[] | {
877
+ file: string;
878
+ } | {
879
+ module: string;
880
+ export: string;
881
+ } | undefined;
882
+ witnesses?: {
883
+ file: string;
884
+ } | {
885
+ module: string;
886
+ export: string;
887
+ } | undefined;
888
+ signing_key_file?: string | undefined;
889
+ circuits_per_tx?: number | undefined;
890
+ }>;
891
+ wallet?: {
892
+ keystore?: string | undefined;
676
893
  } | undefined;
677
- }>;
894
+ }, {
895
+ profile: {
896
+ artifacts_dir: string;
897
+ deployments_dir: string;
898
+ default_network?: string | undefined;
899
+ src_dir?: string | undefined;
900
+ };
901
+ networks: Record<string, {
902
+ network_id: string;
903
+ indexer: string;
904
+ indexer_ws: string;
905
+ node: string;
906
+ node_ws: string;
907
+ proof_server?: string | undefined;
908
+ wallet?: {
909
+ source: "local";
910
+ index: number;
911
+ } | undefined;
912
+ explorer?: string | undefined;
913
+ sync_timeout?: number | undefined;
914
+ sync_batch_size?: number | undefined;
915
+ }>;
916
+ contracts: Record<string, {
917
+ artifact?: string | undefined;
918
+ private_state_id?: string | undefined;
919
+ init_private_state?: {
920
+ file: string;
921
+ } | {
922
+ module: string;
923
+ export: string;
924
+ } | undefined;
925
+ private_state_store_name?: string | undefined;
926
+ args?: unknown[] | {
927
+ file: string;
928
+ } | {
929
+ module: string;
930
+ export: string;
931
+ } | undefined;
932
+ witnesses?: {
933
+ file: string;
934
+ } | {
935
+ module: string;
936
+ export: string;
937
+ } | undefined;
938
+ signing_key_file?: string | undefined;
939
+ circuits_per_tx?: number | undefined;
940
+ }>;
941
+ wallet?: {
942
+ keystore?: string | undefined;
943
+ } | undefined;
944
+ }>>;
678
945
  export type CompactConfigData = z.infer<typeof configSchema>;
679
946
  export type NetworkConfig = z.infer<typeof networkSchema>;
947
+ export type ContractEntry = z.infer<typeof contractEntrySchema>;
680
948
  export type ContractConfig = z.infer<typeof contractSchema>;
681
949
  export type Profile = z.infer<typeof profileSchema>;
682
950
  export type WalletConfig = z.infer<typeof walletObjectSchema>;