@caatinga/core 2.3.0 → 2.4.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.
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-Cq4ZofIq.cjs';
2
- export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './browser-Cq4ZofIq.cjs';
1
+ import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-BH5K-IiZ.cjs';
2
+ export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-BH5K-IiZ.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const CAATINGA_CORE_VERSION = "2.3.0";
5
+ declare const CAATINGA_CORE_VERSION = "2.4.0";
6
6
 
7
7
  declare const ContractConfigSchema: z.ZodObject<{
8
8
  path: z.ZodString;
@@ -75,7 +75,7 @@ declare const CaatingaConfigSchema: z.ZodObject<{
75
75
  rpcUrl: string;
76
76
  networkPassphrase: string;
77
77
  }>>;
78
- frontend: z.ZodObject<{
78
+ frontend: z.ZodOptional<z.ZodObject<{
79
79
  framework: z.ZodDefault<z.ZodEnum<["vite-react", "next", "astro"]>>;
80
80
  bindingsOutput: z.ZodString;
81
81
  }, "strip", z.ZodTypeAny, {
@@ -84,7 +84,7 @@ declare const CaatingaConfigSchema: z.ZodObject<{
84
84
  }, {
85
85
  bindingsOutput: string;
86
86
  framework?: "vite-react" | "next" | "astro" | undefined;
87
- }>;
87
+ }>>;
88
88
  zk: z.ZodOptional<z.ZodObject<{
89
89
  circuits: z.ZodRecord<z.ZodString, z.ZodObject<{
90
90
  path: z.ZodString;
@@ -130,10 +130,10 @@ declare const CaatingaConfigSchema: z.ZodObject<{
130
130
  rpcUrl: string;
131
131
  networkPassphrase: string;
132
132
  }>;
133
- frontend: {
133
+ frontend?: {
134
134
  framework: "vite-react" | "next" | "astro";
135
135
  bindingsOutput: string;
136
- };
136
+ } | undefined;
137
137
  zk?: {
138
138
  circuits: Record<string, {
139
139
  path: string;
@@ -154,11 +154,11 @@ declare const CaatingaConfigSchema: z.ZodObject<{
154
154
  rpcUrl: string;
155
155
  networkPassphrase: string;
156
156
  }>;
157
- frontend: {
157
+ defaultNetwork?: string | undefined;
158
+ frontend?: {
158
159
  bindingsOutput: string;
159
160
  framework?: "vite-react" | "next" | "astro" | undefined;
160
- };
161
- defaultNetwork?: string | undefined;
161
+ } | undefined;
162
162
  zk?: {
163
163
  circuits: Record<string, {
164
164
  path: string;
@@ -286,6 +286,9 @@ type RunCommandOptions = {
286
286
  };
287
287
  declare function runCommand(command: string, args: string[], options?: RunCommandOptions): Promise<RunCommandResult>;
288
288
 
289
+ declare function resolveSubprocessEnv(overrides?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
290
+ declare function isCargoBinMissingFromPath(baseEnv?: NodeJS.ProcessEnv): boolean;
291
+
289
292
  type CheckBinaryOptions = {
290
293
  skipStellarVersionCheck?: boolean;
291
294
  };
@@ -476,6 +479,11 @@ type InvokeTarget = {
476
479
  contractName: string;
477
480
  method: string;
478
481
  };
482
+ declare const READ_CALL_FAILURE_REGEX: RegExp;
483
+ declare function parseInvokeTarget(target: string): InvokeTarget;
484
+ declare function buildReadCallHint(target: InvokeTarget, networkName: string): string;
485
+ declare function isReadCallFailure(error: unknown): boolean;
486
+
479
487
  type InvokeContractOptions = {
480
488
  config: CaatingaConfig;
481
489
  target: string;
@@ -484,13 +492,26 @@ type InvokeContractOptions = {
484
492
  source?: string;
485
493
  cwd?: string;
486
494
  };
487
- declare function parseInvokeTarget(target: string): InvokeTarget;
488
495
  declare function invokeContract(options: InvokeContractOptions): Promise<{
489
496
  target: InvokeTarget;
490
497
  network: ResolvedNetwork;
491
498
  result: string;
492
499
  }>;
493
500
 
501
+ type ReadContractOptions = {
502
+ config: CaatingaConfig;
503
+ target: string;
504
+ args?: string[];
505
+ networkName?: string;
506
+ source?: string;
507
+ cwd?: string;
508
+ };
509
+ declare function readContract(options: ReadContractOptions): Promise<{
510
+ target: InvokeTarget;
511
+ network: ResolvedNetwork;
512
+ result: string;
513
+ }>;
514
+
494
515
  type CreateProjectFromTemplateOptions = {
495
516
  projectName: string;
496
517
  targetDir: string;
@@ -522,6 +543,25 @@ declare function createProjectFromTemplate(options: CreateProjectFromTemplateOpt
522
543
  };
523
544
  }>;
524
545
 
546
+ type CreateZkProjectOptions = {
547
+ projectName: string;
548
+ targetDir: string;
549
+ force?: boolean;
550
+ projectFiles?: boolean;
551
+ };
552
+ declare function createZkProject(options: CreateZkProjectOptions): Promise<{
553
+ targetDir: string;
554
+ }>;
555
+
556
+ type CreateMinimalProjectOptions = {
557
+ projectName: string;
558
+ targetDir: string;
559
+ force?: boolean;
560
+ };
561
+ declare function createMinimalProject(options: CreateMinimalProjectOptions): Promise<{
562
+ targetDir: string;
563
+ }>;
564
+
525
565
  declare const TemplateManifestSchema: z.ZodObject<{
526
566
  name: z.ZodString;
527
567
  version: z.ZodString;
@@ -611,4 +651,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
611
651
 
612
652
  declare function isTransientTestnetSmokeFailure(logText: string): boolean;
613
653
 
614
- export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, checkBinary, checkStellarCliVersion, collectProjectStatus, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, generateBindings, generateBindingsGraph, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, readBindingMarker, resolveContract, resolveDefaultContractName, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };
654
+ export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateMinimalProjectOptions, type CreateProjectFromTemplateOptions, type CreateZkProjectOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, READ_CALL_FAILURE_REGEX, type ReadContractOptions, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, buildReadCallHint, checkBinary, checkStellarCliVersion, collectProjectStatus, createInitialArtifacts, createMinimalProject, createProjectFromTemplate, createZkProject, defineConfig, deployContract, deployContractGraph, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, generateBindings, generateBindingsGraph, invokeContract, isCargoBinMissingFromPath, isReadCallFailure, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, readBindingMarker, readContract, resolveContract, resolveDefaultContractName, resolveDeployArgs, resolveDeployOrder, resolveNetwork, resolveSubprocessEnv, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-Cq4ZofIq.js';
2
- export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './browser-Cq4ZofIq.js';
1
+ import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-BH5K-IiZ.js';
2
+ export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-BH5K-IiZ.js';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const CAATINGA_CORE_VERSION = "2.3.0";
5
+ declare const CAATINGA_CORE_VERSION = "2.4.0";
6
6
 
7
7
  declare const ContractConfigSchema: z.ZodObject<{
8
8
  path: z.ZodString;
@@ -75,7 +75,7 @@ declare const CaatingaConfigSchema: z.ZodObject<{
75
75
  rpcUrl: string;
76
76
  networkPassphrase: string;
77
77
  }>>;
78
- frontend: z.ZodObject<{
78
+ frontend: z.ZodOptional<z.ZodObject<{
79
79
  framework: z.ZodDefault<z.ZodEnum<["vite-react", "next", "astro"]>>;
80
80
  bindingsOutput: z.ZodString;
81
81
  }, "strip", z.ZodTypeAny, {
@@ -84,7 +84,7 @@ declare const CaatingaConfigSchema: z.ZodObject<{
84
84
  }, {
85
85
  bindingsOutput: string;
86
86
  framework?: "vite-react" | "next" | "astro" | undefined;
87
- }>;
87
+ }>>;
88
88
  zk: z.ZodOptional<z.ZodObject<{
89
89
  circuits: z.ZodRecord<z.ZodString, z.ZodObject<{
90
90
  path: z.ZodString;
@@ -130,10 +130,10 @@ declare const CaatingaConfigSchema: z.ZodObject<{
130
130
  rpcUrl: string;
131
131
  networkPassphrase: string;
132
132
  }>;
133
- frontend: {
133
+ frontend?: {
134
134
  framework: "vite-react" | "next" | "astro";
135
135
  bindingsOutput: string;
136
- };
136
+ } | undefined;
137
137
  zk?: {
138
138
  circuits: Record<string, {
139
139
  path: string;
@@ -154,11 +154,11 @@ declare const CaatingaConfigSchema: z.ZodObject<{
154
154
  rpcUrl: string;
155
155
  networkPassphrase: string;
156
156
  }>;
157
- frontend: {
157
+ defaultNetwork?: string | undefined;
158
+ frontend?: {
158
159
  bindingsOutput: string;
159
160
  framework?: "vite-react" | "next" | "astro" | undefined;
160
- };
161
- defaultNetwork?: string | undefined;
161
+ } | undefined;
162
162
  zk?: {
163
163
  circuits: Record<string, {
164
164
  path: string;
@@ -286,6 +286,9 @@ type RunCommandOptions = {
286
286
  };
287
287
  declare function runCommand(command: string, args: string[], options?: RunCommandOptions): Promise<RunCommandResult>;
288
288
 
289
+ declare function resolveSubprocessEnv(overrides?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
290
+ declare function isCargoBinMissingFromPath(baseEnv?: NodeJS.ProcessEnv): boolean;
291
+
289
292
  type CheckBinaryOptions = {
290
293
  skipStellarVersionCheck?: boolean;
291
294
  };
@@ -476,6 +479,11 @@ type InvokeTarget = {
476
479
  contractName: string;
477
480
  method: string;
478
481
  };
482
+ declare const READ_CALL_FAILURE_REGEX: RegExp;
483
+ declare function parseInvokeTarget(target: string): InvokeTarget;
484
+ declare function buildReadCallHint(target: InvokeTarget, networkName: string): string;
485
+ declare function isReadCallFailure(error: unknown): boolean;
486
+
479
487
  type InvokeContractOptions = {
480
488
  config: CaatingaConfig;
481
489
  target: string;
@@ -484,13 +492,26 @@ type InvokeContractOptions = {
484
492
  source?: string;
485
493
  cwd?: string;
486
494
  };
487
- declare function parseInvokeTarget(target: string): InvokeTarget;
488
495
  declare function invokeContract(options: InvokeContractOptions): Promise<{
489
496
  target: InvokeTarget;
490
497
  network: ResolvedNetwork;
491
498
  result: string;
492
499
  }>;
493
500
 
501
+ type ReadContractOptions = {
502
+ config: CaatingaConfig;
503
+ target: string;
504
+ args?: string[];
505
+ networkName?: string;
506
+ source?: string;
507
+ cwd?: string;
508
+ };
509
+ declare function readContract(options: ReadContractOptions): Promise<{
510
+ target: InvokeTarget;
511
+ network: ResolvedNetwork;
512
+ result: string;
513
+ }>;
514
+
494
515
  type CreateProjectFromTemplateOptions = {
495
516
  projectName: string;
496
517
  targetDir: string;
@@ -522,6 +543,25 @@ declare function createProjectFromTemplate(options: CreateProjectFromTemplateOpt
522
543
  };
523
544
  }>;
524
545
 
546
+ type CreateZkProjectOptions = {
547
+ projectName: string;
548
+ targetDir: string;
549
+ force?: boolean;
550
+ projectFiles?: boolean;
551
+ };
552
+ declare function createZkProject(options: CreateZkProjectOptions): Promise<{
553
+ targetDir: string;
554
+ }>;
555
+
556
+ type CreateMinimalProjectOptions = {
557
+ projectName: string;
558
+ targetDir: string;
559
+ force?: boolean;
560
+ };
561
+ declare function createMinimalProject(options: CreateMinimalProjectOptions): Promise<{
562
+ targetDir: string;
563
+ }>;
564
+
525
565
  declare const TemplateManifestSchema: z.ZodObject<{
526
566
  name: z.ZodString;
527
567
  version: z.ZodString;
@@ -611,4 +651,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
611
651
 
612
652
  declare function isTransientTestnetSmokeFailure(logText: string): boolean;
613
653
 
614
- export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, checkBinary, checkStellarCliVersion, collectProjectStatus, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, generateBindings, generateBindingsGraph, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, readBindingMarker, resolveContract, resolveDefaultContractName, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };
654
+ export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateMinimalProjectOptions, type CreateProjectFromTemplateOptions, type CreateZkProjectOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, READ_CALL_FAILURE_REGEX, type ReadContractOptions, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, buildReadCallHint, checkBinary, checkStellarCliVersion, collectProjectStatus, createInitialArtifacts, createMinimalProject, createProjectFromTemplate, createZkProject, defineConfig, deployContract, deployContractGraph, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, generateBindings, generateBindingsGraph, invokeContract, isCargoBinMissingFromPath, isReadCallFailure, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, readBindingMarker, readContract, resolveContract, resolveDefaultContractName, resolveDeployArgs, resolveDeployOrder, resolveNetwork, resolveSubprocessEnv, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };