@caatinga/core 0.2.1 → 0.2.2

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,58 +1,8 @@
1
+ import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-DUcSR5D3.cjs';
2
+ export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, t as toCaatingaError } from './browser-DUcSR5D3.cjs';
1
3
  import { z } from 'zod';
2
4
 
3
- declare const CaatingaErrorCode: {
4
- readonly CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND";
5
- readonly INVALID_CONFIG: "CAATINGA_INVALID_CONFIG";
6
- readonly COMMAND_FAILED: "CAATINGA_COMMAND_FAILED";
7
- readonly UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR";
8
- readonly STELLAR_CLI_NOT_FOUND: "CAATINGA_STELLAR_CLI_NOT_FOUND";
9
- readonly STELLAR_CLI_VERSION_PARSE_FAILED: "CAATINGA_STELLAR_CLI_VERSION_PARSE_FAILED";
10
- readonly UNSUPPORTED_CLI_VERSION: "CAATINGA_UNSUPPORTED_CLI_VERSION";
11
- readonly UNTESTED_CLI_VERSION: "CAATINGA_UNTESTED_CLI_VERSION";
12
- readonly RUST_NOT_FOUND: "CAATINGA_RUST_NOT_FOUND";
13
- readonly RUST_TARGET_NOT_FOUND: "CAATINGA_RUST_TARGET_NOT_FOUND";
14
- readonly DEPLOY_FAILED: "CAATINGA_DEPLOY_FAILED";
15
- readonly BUILD_FAILED: "CAATINGA_BUILD_FAILED";
16
- readonly BINDINGS_FAILED: "CAATINGA_BINDINGS_FAILED";
17
- readonly INVOKE_FAILED: "CAATINGA_INVOKE_FAILED";
18
- readonly CONTRACT_NOT_FOUND: "CAATINGA_CONTRACT_NOT_FOUND";
19
- readonly NETWORK_NOT_FOUND: "CAATINGA_NETWORK_NOT_FOUND";
20
- readonly ARTIFACT_NOT_FOUND: "CAATINGA_ARTIFACT_NOT_FOUND";
21
- readonly ARTIFACT_INVALID: "CAATINGA_ARTIFACT_INVALID";
22
- readonly CONTRACT_ID_NOT_FOUND: "CAATINGA_CONTRACT_ID_NOT_FOUND";
23
- readonly CONTRACT_ARTIFACT_NOT_FOUND: "CAATINGA_CONTRACT_ARTIFACT_NOT_FOUND";
24
- readonly CONTRACT_DEPENDENCY_NOT_FOUND: "CAATINGA_CONTRACT_DEPENDENCY_NOT_FOUND";
25
- readonly CONTRACT_DEPENDENCY_CYCLE: "CAATINGA_CONTRACT_DEPENDENCY_CYCLE";
26
- readonly CONTRACT_DEPENDENCY_ARTIFACT_NOT_FOUND: "CAATINGA_CONTRACT_DEPENDENCY_ARTIFACT_NOT_FOUND";
27
- readonly DEPLOY_ARG_PLACEHOLDER_INVALID: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_INVALID";
28
- readonly DEPLOY_ARG_PLACEHOLDER_UNRESOLVED: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_UNRESOLVED";
29
- readonly BINDING_CLIENT_NOT_FOUND: "CAATINGA_BINDING_CLIENT_NOT_FOUND";
30
- readonly BINDING_METHOD_NOT_FOUND: "CAATINGA_BINDING_METHOD_NOT_FOUND";
31
- readonly XDR_BUILD_FAILED: "CAATINGA_XDR_BUILD_FAILED";
32
- readonly XDR_PREPARE_FAILED: "CAATINGA_XDR_PREPARE_FAILED";
33
- readonly XDR_SIGN_FAILED: "CAATINGA_XDR_SIGN_FAILED";
34
- readonly XDR_SUBMIT_FAILED: "CAATINGA_XDR_SUBMIT_FAILED";
35
- readonly XDR_RESULT_FAILED: "CAATINGA_XDR_RESULT_FAILED";
36
- readonly WALLET_NOT_CONNECTED: "CAATINGA_WALLET_NOT_CONNECTED";
37
- readonly SOURCE_ACCOUNT_REQUIRED: "CAATINGA_SOURCE_ACCOUNT_REQUIRED";
38
- readonly UNSAFE_SOURCE_ACCOUNT: "CAATINGA_UNSAFE_SOURCE_ACCOUNT";
39
- readonly INVOKE_TARGET_INVALID: "CAATINGA_INVOKE_TARGET_INVALID";
40
- readonly TEMPLATE_NOT_FOUND: "CAATINGA_TEMPLATE_NOT_FOUND";
41
- readonly INVALID_TEMPLATE_MANIFEST: "CAATINGA_INVALID_TEMPLATE_MANIFEST";
42
- readonly TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND";
43
- readonly TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE";
44
- };
45
- type CaatingaErrorCodeValue = typeof CaatingaErrorCode[keyof typeof CaatingaErrorCode];
46
-
47
- declare class CaatingaError extends Error {
48
- readonly code: CaatingaErrorCodeValue;
49
- readonly hint?: string | undefined;
50
- readonly cause?: unknown | undefined;
51
- constructor(message: string, code: CaatingaErrorCodeValue, hint?: string | undefined, cause?: unknown | undefined);
52
- }
53
- declare function toCaatingaError(error: unknown): CaatingaError;
54
-
55
- declare const CAATINGA_CORE_VERSION = "0.2.1";
5
+ declare const CAATINGA_CORE_VERSION = "0.2.2";
56
6
 
57
7
  declare const ContractConfigSchema: z.ZodObject<{
58
8
  path: z.ZodString;
@@ -182,118 +132,6 @@ type LoadConfigOptions = {
182
132
  };
183
133
  declare function loadConfig(options?: LoadConfigOptions): Promise<CaatingaConfig>;
184
134
 
185
- declare const ContractArtifactSchema: z.ZodObject<{
186
- contractId: z.ZodString;
187
- wasmHash: z.ZodString;
188
- deployedAt: z.ZodString;
189
- sourcePath: z.ZodString;
190
- wasmPath: z.ZodString;
191
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
192
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
193
- }, "strip", z.ZodTypeAny, {
194
- contractId: string;
195
- wasmHash: string;
196
- deployedAt: string;
197
- sourcePath: string;
198
- wasmPath: string;
199
- dependencies: string[];
200
- resolvedDeployArgs: Record<string, string | number | boolean>;
201
- }, {
202
- contractId: string;
203
- wasmHash: string;
204
- deployedAt: string;
205
- sourcePath: string;
206
- wasmPath: string;
207
- dependencies?: string[] | undefined;
208
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
209
- }>;
210
- declare const CaatingaArtifactsSchema: z.ZodObject<{
211
- project: z.ZodString;
212
- version: z.ZodLiteral<1>;
213
- networks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
214
- contracts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
215
- contractId: z.ZodString;
216
- wasmHash: z.ZodString;
217
- deployedAt: z.ZodString;
218
- sourcePath: z.ZodString;
219
- wasmPath: z.ZodString;
220
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
221
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
222
- }, "strip", z.ZodTypeAny, {
223
- contractId: string;
224
- wasmHash: string;
225
- deployedAt: string;
226
- sourcePath: string;
227
- wasmPath: string;
228
- dependencies: string[];
229
- resolvedDeployArgs: Record<string, string | number | boolean>;
230
- }, {
231
- contractId: string;
232
- wasmHash: string;
233
- deployedAt: string;
234
- sourcePath: string;
235
- wasmPath: string;
236
- dependencies?: string[] | undefined;
237
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
238
- }>>>;
239
- dependencyGraph: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
240
- }, "strip", z.ZodTypeAny, {
241
- contracts: Record<string, {
242
- contractId: string;
243
- wasmHash: string;
244
- deployedAt: string;
245
- sourcePath: string;
246
- wasmPath: string;
247
- dependencies: string[];
248
- resolvedDeployArgs: Record<string, string | number | boolean>;
249
- }>;
250
- dependencyGraph: Record<string, string[]>;
251
- }, {
252
- contracts?: Record<string, {
253
- contractId: string;
254
- wasmHash: string;
255
- deployedAt: string;
256
- sourcePath: string;
257
- wasmPath: string;
258
- dependencies?: string[] | undefined;
259
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
260
- }> | undefined;
261
- dependencyGraph?: Record<string, string[]> | undefined;
262
- }>>>;
263
- }, "strip", z.ZodTypeAny, {
264
- project: string;
265
- networks: Record<string, {
266
- contracts: Record<string, {
267
- contractId: string;
268
- wasmHash: string;
269
- deployedAt: string;
270
- sourcePath: string;
271
- wasmPath: string;
272
- dependencies: string[];
273
- resolvedDeployArgs: Record<string, string | number | boolean>;
274
- }>;
275
- dependencyGraph: Record<string, string[]>;
276
- }>;
277
- version: 1;
278
- }, {
279
- project: string;
280
- version: 1;
281
- networks?: Record<string, {
282
- contracts?: Record<string, {
283
- contractId: string;
284
- wasmHash: string;
285
- deployedAt: string;
286
- sourcePath: string;
287
- wasmPath: string;
288
- dependencies?: string[] | undefined;
289
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
290
- }> | undefined;
291
- dependencyGraph?: Record<string, string[]> | undefined;
292
- }> | undefined;
293
- }>;
294
- type ContractArtifact = z.infer<typeof ContractArtifactSchema>;
295
- type CaatingaArtifacts = z.infer<typeof CaatingaArtifactsSchema>;
296
-
297
135
  declare function readArtifacts(cwd?: string): Promise<CaatingaArtifacts>;
298
136
 
299
137
  declare function writeArtifacts(artifacts: CaatingaArtifacts, cwd?: string): Promise<string>;
@@ -333,7 +171,7 @@ declare function checkBinary(binary: string, hint: string, options?: CheckBinary
333
171
 
334
172
  declare function parseContractId(output: string): string;
335
173
 
336
- declare const STELLAR_CLI_MIN_VERSION = "22.0.0";
174
+ declare const STELLAR_CLI_MIN_VERSION = "23.0.0";
337
175
  declare const STELLAR_CLI_TESTED_MAX_VERSION = "25.2.0";
338
176
  declare function parseStellarCliVersion(output: string): string;
339
177
  declare function assertSupportedStellarCliVersion(input: {
@@ -341,6 +179,8 @@ declare function assertSupportedStellarCliVersion(input: {
341
179
  allowUntested: boolean;
342
180
  }): string;
343
181
 
182
+ declare function validateSourceShape(source: string): CaatingaError | undefined;
183
+
344
184
  type ResolvedContract = {
345
185
  name: string;
346
186
  config: ContractConfig;
@@ -356,7 +196,12 @@ type BuildContractOptions = {
356
196
  allowUntestedStellarCli?: boolean;
357
197
  };
358
198
  declare function buildContract(options: BuildContractOptions): Promise<{
359
- contract: ResolvedContract;
199
+ contract: {
200
+ wasmPath: string;
201
+ name: string;
202
+ config: ContractConfig;
203
+ sourcePath: string;
204
+ };
360
205
  output: string;
361
206
  }>;
362
207
 
@@ -375,25 +220,57 @@ type DeployContractOptions = {
375
220
  cwd?: string;
376
221
  allowUntestedStellarCli?: boolean;
377
222
  force?: boolean;
223
+ checkStaleWasm?: boolean;
378
224
  resolvedDeployArgs?: Record<string, DeployArgValue>;
379
225
  dependencies?: string[];
380
226
  };
381
227
  declare function deployContract(options: DeployContractOptions): Promise<{
382
- contract: ResolvedContract;
228
+ contract: {
229
+ wasmPath: string;
230
+ name: string;
231
+ config: ContractConfig;
232
+ sourcePath: string;
233
+ };
383
234
  network: ResolvedNetwork;
384
235
  contractId: string;
385
236
  artifactsPath: string;
386
237
  output: string;
387
238
  skipped: true;
239
+ staleWasmWarning: string | undefined;
388
240
  } | {
389
- contract: ResolvedContract;
241
+ contract: {
242
+ wasmPath: string;
243
+ name: string;
244
+ config: ContractConfig;
245
+ sourcePath: string;
246
+ };
390
247
  network: ResolvedNetwork;
391
248
  contractId: string;
392
249
  artifactsPath: string;
393
250
  output: string;
394
251
  skipped: false;
252
+ staleWasmWarning: string | undefined;
395
253
  }>;
396
254
 
255
+ type SkippedContract = {
256
+ name: string;
257
+ contractId: string;
258
+ network: string;
259
+ reason: "already-deployed";
260
+ };
261
+ type StaleWasmWarning = {
262
+ contract: string;
263
+ message: string;
264
+ };
265
+ type DeployContractGraphResult = {
266
+ network: ResolvedNetwork;
267
+ deployedContracts: Array<{
268
+ name: string;
269
+ contractId: string;
270
+ }>;
271
+ skippedContracts: SkippedContract[];
272
+ staleWasmWarnings: StaleWasmWarning[];
273
+ };
397
274
  declare function deployContractGraph(options: {
398
275
  config: CaatingaConfig;
399
276
  contractName?: string;
@@ -403,13 +280,9 @@ declare function deployContractGraph(options: {
403
280
  includeDependencies: boolean;
404
281
  force: boolean;
405
282
  allowUntestedStellarCli?: boolean;
406
- }): Promise<{
407
- network: ResolvedNetwork;
408
- deployedContracts: {
409
- name: string;
410
- contractId: string;
411
- }[];
412
- }>;
283
+ checkStaleWasm?: boolean;
284
+ verifyDeps?: boolean;
285
+ }): Promise<DeployContractGraphResult>;
413
286
 
414
287
  declare function buildDependencyGraph(contracts: Record<string, ContractConfig>): Record<string, string[]>;
415
288
 
@@ -572,4 +445,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
572
445
 
573
446
  declare function isTransientTestnetSmokeFailure(logText: string): boolean;
574
447
 
575
- export { type BuildContractOptions, CAATINGA_CORE_VERSION, type CaatingaArtifacts, CaatingaArtifactsSchema, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, CaatingaErrorCode, type ContractArtifact, type ContractConfig, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractOptions, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_MIN_VERSION, STELLAR_CLI_TESTED_MAX_VERSION, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, assertSupportedStellarCliVersion, buildContract, buildDependencyGraph, checkBinary, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, generateBindings, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, toCaatingaError, updateArtifact, writeArtifacts };
448
+ export { type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, ContractArtifact, type ContractConfig, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_MIN_VERSION, STELLAR_CLI_TESTED_MAX_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, assertSupportedStellarCliVersion, buildContract, buildDependencyGraph, checkBinary, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, generateBindings, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts };
package/dist/index.d.ts CHANGED
@@ -1,58 +1,8 @@
1
+ import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-DUcSR5D3.js';
2
+ export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, t as toCaatingaError } from './browser-DUcSR5D3.js';
1
3
  import { z } from 'zod';
2
4
 
3
- declare const CaatingaErrorCode: {
4
- readonly CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND";
5
- readonly INVALID_CONFIG: "CAATINGA_INVALID_CONFIG";
6
- readonly COMMAND_FAILED: "CAATINGA_COMMAND_FAILED";
7
- readonly UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR";
8
- readonly STELLAR_CLI_NOT_FOUND: "CAATINGA_STELLAR_CLI_NOT_FOUND";
9
- readonly STELLAR_CLI_VERSION_PARSE_FAILED: "CAATINGA_STELLAR_CLI_VERSION_PARSE_FAILED";
10
- readonly UNSUPPORTED_CLI_VERSION: "CAATINGA_UNSUPPORTED_CLI_VERSION";
11
- readonly UNTESTED_CLI_VERSION: "CAATINGA_UNTESTED_CLI_VERSION";
12
- readonly RUST_NOT_FOUND: "CAATINGA_RUST_NOT_FOUND";
13
- readonly RUST_TARGET_NOT_FOUND: "CAATINGA_RUST_TARGET_NOT_FOUND";
14
- readonly DEPLOY_FAILED: "CAATINGA_DEPLOY_FAILED";
15
- readonly BUILD_FAILED: "CAATINGA_BUILD_FAILED";
16
- readonly BINDINGS_FAILED: "CAATINGA_BINDINGS_FAILED";
17
- readonly INVOKE_FAILED: "CAATINGA_INVOKE_FAILED";
18
- readonly CONTRACT_NOT_FOUND: "CAATINGA_CONTRACT_NOT_FOUND";
19
- readonly NETWORK_NOT_FOUND: "CAATINGA_NETWORK_NOT_FOUND";
20
- readonly ARTIFACT_NOT_FOUND: "CAATINGA_ARTIFACT_NOT_FOUND";
21
- readonly ARTIFACT_INVALID: "CAATINGA_ARTIFACT_INVALID";
22
- readonly CONTRACT_ID_NOT_FOUND: "CAATINGA_CONTRACT_ID_NOT_FOUND";
23
- readonly CONTRACT_ARTIFACT_NOT_FOUND: "CAATINGA_CONTRACT_ARTIFACT_NOT_FOUND";
24
- readonly CONTRACT_DEPENDENCY_NOT_FOUND: "CAATINGA_CONTRACT_DEPENDENCY_NOT_FOUND";
25
- readonly CONTRACT_DEPENDENCY_CYCLE: "CAATINGA_CONTRACT_DEPENDENCY_CYCLE";
26
- readonly CONTRACT_DEPENDENCY_ARTIFACT_NOT_FOUND: "CAATINGA_CONTRACT_DEPENDENCY_ARTIFACT_NOT_FOUND";
27
- readonly DEPLOY_ARG_PLACEHOLDER_INVALID: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_INVALID";
28
- readonly DEPLOY_ARG_PLACEHOLDER_UNRESOLVED: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_UNRESOLVED";
29
- readonly BINDING_CLIENT_NOT_FOUND: "CAATINGA_BINDING_CLIENT_NOT_FOUND";
30
- readonly BINDING_METHOD_NOT_FOUND: "CAATINGA_BINDING_METHOD_NOT_FOUND";
31
- readonly XDR_BUILD_FAILED: "CAATINGA_XDR_BUILD_FAILED";
32
- readonly XDR_PREPARE_FAILED: "CAATINGA_XDR_PREPARE_FAILED";
33
- readonly XDR_SIGN_FAILED: "CAATINGA_XDR_SIGN_FAILED";
34
- readonly XDR_SUBMIT_FAILED: "CAATINGA_XDR_SUBMIT_FAILED";
35
- readonly XDR_RESULT_FAILED: "CAATINGA_XDR_RESULT_FAILED";
36
- readonly WALLET_NOT_CONNECTED: "CAATINGA_WALLET_NOT_CONNECTED";
37
- readonly SOURCE_ACCOUNT_REQUIRED: "CAATINGA_SOURCE_ACCOUNT_REQUIRED";
38
- readonly UNSAFE_SOURCE_ACCOUNT: "CAATINGA_UNSAFE_SOURCE_ACCOUNT";
39
- readonly INVOKE_TARGET_INVALID: "CAATINGA_INVOKE_TARGET_INVALID";
40
- readonly TEMPLATE_NOT_FOUND: "CAATINGA_TEMPLATE_NOT_FOUND";
41
- readonly INVALID_TEMPLATE_MANIFEST: "CAATINGA_INVALID_TEMPLATE_MANIFEST";
42
- readonly TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND";
43
- readonly TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE";
44
- };
45
- type CaatingaErrorCodeValue = typeof CaatingaErrorCode[keyof typeof CaatingaErrorCode];
46
-
47
- declare class CaatingaError extends Error {
48
- readonly code: CaatingaErrorCodeValue;
49
- readonly hint?: string | undefined;
50
- readonly cause?: unknown | undefined;
51
- constructor(message: string, code: CaatingaErrorCodeValue, hint?: string | undefined, cause?: unknown | undefined);
52
- }
53
- declare function toCaatingaError(error: unknown): CaatingaError;
54
-
55
- declare const CAATINGA_CORE_VERSION = "0.2.1";
5
+ declare const CAATINGA_CORE_VERSION = "0.2.2";
56
6
 
57
7
  declare const ContractConfigSchema: z.ZodObject<{
58
8
  path: z.ZodString;
@@ -182,118 +132,6 @@ type LoadConfigOptions = {
182
132
  };
183
133
  declare function loadConfig(options?: LoadConfigOptions): Promise<CaatingaConfig>;
184
134
 
185
- declare const ContractArtifactSchema: z.ZodObject<{
186
- contractId: z.ZodString;
187
- wasmHash: z.ZodString;
188
- deployedAt: z.ZodString;
189
- sourcePath: z.ZodString;
190
- wasmPath: z.ZodString;
191
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
192
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
193
- }, "strip", z.ZodTypeAny, {
194
- contractId: string;
195
- wasmHash: string;
196
- deployedAt: string;
197
- sourcePath: string;
198
- wasmPath: string;
199
- dependencies: string[];
200
- resolvedDeployArgs: Record<string, string | number | boolean>;
201
- }, {
202
- contractId: string;
203
- wasmHash: string;
204
- deployedAt: string;
205
- sourcePath: string;
206
- wasmPath: string;
207
- dependencies?: string[] | undefined;
208
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
209
- }>;
210
- declare const CaatingaArtifactsSchema: z.ZodObject<{
211
- project: z.ZodString;
212
- version: z.ZodLiteral<1>;
213
- networks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
214
- contracts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
215
- contractId: z.ZodString;
216
- wasmHash: z.ZodString;
217
- deployedAt: z.ZodString;
218
- sourcePath: z.ZodString;
219
- wasmPath: z.ZodString;
220
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
221
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
222
- }, "strip", z.ZodTypeAny, {
223
- contractId: string;
224
- wasmHash: string;
225
- deployedAt: string;
226
- sourcePath: string;
227
- wasmPath: string;
228
- dependencies: string[];
229
- resolvedDeployArgs: Record<string, string | number | boolean>;
230
- }, {
231
- contractId: string;
232
- wasmHash: string;
233
- deployedAt: string;
234
- sourcePath: string;
235
- wasmPath: string;
236
- dependencies?: string[] | undefined;
237
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
238
- }>>>;
239
- dependencyGraph: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
240
- }, "strip", z.ZodTypeAny, {
241
- contracts: Record<string, {
242
- contractId: string;
243
- wasmHash: string;
244
- deployedAt: string;
245
- sourcePath: string;
246
- wasmPath: string;
247
- dependencies: string[];
248
- resolvedDeployArgs: Record<string, string | number | boolean>;
249
- }>;
250
- dependencyGraph: Record<string, string[]>;
251
- }, {
252
- contracts?: Record<string, {
253
- contractId: string;
254
- wasmHash: string;
255
- deployedAt: string;
256
- sourcePath: string;
257
- wasmPath: string;
258
- dependencies?: string[] | undefined;
259
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
260
- }> | undefined;
261
- dependencyGraph?: Record<string, string[]> | undefined;
262
- }>>>;
263
- }, "strip", z.ZodTypeAny, {
264
- project: string;
265
- networks: Record<string, {
266
- contracts: Record<string, {
267
- contractId: string;
268
- wasmHash: string;
269
- deployedAt: string;
270
- sourcePath: string;
271
- wasmPath: string;
272
- dependencies: string[];
273
- resolvedDeployArgs: Record<string, string | number | boolean>;
274
- }>;
275
- dependencyGraph: Record<string, string[]>;
276
- }>;
277
- version: 1;
278
- }, {
279
- project: string;
280
- version: 1;
281
- networks?: Record<string, {
282
- contracts?: Record<string, {
283
- contractId: string;
284
- wasmHash: string;
285
- deployedAt: string;
286
- sourcePath: string;
287
- wasmPath: string;
288
- dependencies?: string[] | undefined;
289
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
290
- }> | undefined;
291
- dependencyGraph?: Record<string, string[]> | undefined;
292
- }> | undefined;
293
- }>;
294
- type ContractArtifact = z.infer<typeof ContractArtifactSchema>;
295
- type CaatingaArtifacts = z.infer<typeof CaatingaArtifactsSchema>;
296
-
297
135
  declare function readArtifacts(cwd?: string): Promise<CaatingaArtifacts>;
298
136
 
299
137
  declare function writeArtifacts(artifacts: CaatingaArtifacts, cwd?: string): Promise<string>;
@@ -333,7 +171,7 @@ declare function checkBinary(binary: string, hint: string, options?: CheckBinary
333
171
 
334
172
  declare function parseContractId(output: string): string;
335
173
 
336
- declare const STELLAR_CLI_MIN_VERSION = "22.0.0";
174
+ declare const STELLAR_CLI_MIN_VERSION = "23.0.0";
337
175
  declare const STELLAR_CLI_TESTED_MAX_VERSION = "25.2.0";
338
176
  declare function parseStellarCliVersion(output: string): string;
339
177
  declare function assertSupportedStellarCliVersion(input: {
@@ -341,6 +179,8 @@ declare function assertSupportedStellarCliVersion(input: {
341
179
  allowUntested: boolean;
342
180
  }): string;
343
181
 
182
+ declare function validateSourceShape(source: string): CaatingaError | undefined;
183
+
344
184
  type ResolvedContract = {
345
185
  name: string;
346
186
  config: ContractConfig;
@@ -356,7 +196,12 @@ type BuildContractOptions = {
356
196
  allowUntestedStellarCli?: boolean;
357
197
  };
358
198
  declare function buildContract(options: BuildContractOptions): Promise<{
359
- contract: ResolvedContract;
199
+ contract: {
200
+ wasmPath: string;
201
+ name: string;
202
+ config: ContractConfig;
203
+ sourcePath: string;
204
+ };
360
205
  output: string;
361
206
  }>;
362
207
 
@@ -375,25 +220,57 @@ type DeployContractOptions = {
375
220
  cwd?: string;
376
221
  allowUntestedStellarCli?: boolean;
377
222
  force?: boolean;
223
+ checkStaleWasm?: boolean;
378
224
  resolvedDeployArgs?: Record<string, DeployArgValue>;
379
225
  dependencies?: string[];
380
226
  };
381
227
  declare function deployContract(options: DeployContractOptions): Promise<{
382
- contract: ResolvedContract;
228
+ contract: {
229
+ wasmPath: string;
230
+ name: string;
231
+ config: ContractConfig;
232
+ sourcePath: string;
233
+ };
383
234
  network: ResolvedNetwork;
384
235
  contractId: string;
385
236
  artifactsPath: string;
386
237
  output: string;
387
238
  skipped: true;
239
+ staleWasmWarning: string | undefined;
388
240
  } | {
389
- contract: ResolvedContract;
241
+ contract: {
242
+ wasmPath: string;
243
+ name: string;
244
+ config: ContractConfig;
245
+ sourcePath: string;
246
+ };
390
247
  network: ResolvedNetwork;
391
248
  contractId: string;
392
249
  artifactsPath: string;
393
250
  output: string;
394
251
  skipped: false;
252
+ staleWasmWarning: string | undefined;
395
253
  }>;
396
254
 
255
+ type SkippedContract = {
256
+ name: string;
257
+ contractId: string;
258
+ network: string;
259
+ reason: "already-deployed";
260
+ };
261
+ type StaleWasmWarning = {
262
+ contract: string;
263
+ message: string;
264
+ };
265
+ type DeployContractGraphResult = {
266
+ network: ResolvedNetwork;
267
+ deployedContracts: Array<{
268
+ name: string;
269
+ contractId: string;
270
+ }>;
271
+ skippedContracts: SkippedContract[];
272
+ staleWasmWarnings: StaleWasmWarning[];
273
+ };
397
274
  declare function deployContractGraph(options: {
398
275
  config: CaatingaConfig;
399
276
  contractName?: string;
@@ -403,13 +280,9 @@ declare function deployContractGraph(options: {
403
280
  includeDependencies: boolean;
404
281
  force: boolean;
405
282
  allowUntestedStellarCli?: boolean;
406
- }): Promise<{
407
- network: ResolvedNetwork;
408
- deployedContracts: {
409
- name: string;
410
- contractId: string;
411
- }[];
412
- }>;
283
+ checkStaleWasm?: boolean;
284
+ verifyDeps?: boolean;
285
+ }): Promise<DeployContractGraphResult>;
413
286
 
414
287
  declare function buildDependencyGraph(contracts: Record<string, ContractConfig>): Record<string, string[]>;
415
288
 
@@ -572,4 +445,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
572
445
 
573
446
  declare function isTransientTestnetSmokeFailure(logText: string): boolean;
574
447
 
575
- export { type BuildContractOptions, CAATINGA_CORE_VERSION, type CaatingaArtifacts, CaatingaArtifactsSchema, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, CaatingaErrorCode, type ContractArtifact, type ContractConfig, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractOptions, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_MIN_VERSION, STELLAR_CLI_TESTED_MAX_VERSION, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, assertSupportedStellarCliVersion, buildContract, buildDependencyGraph, checkBinary, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, generateBindings, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, toCaatingaError, updateArtifact, writeArtifacts };
448
+ export { type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, ContractArtifact, type ContractConfig, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_MIN_VERSION, STELLAR_CLI_TESTED_MAX_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, assertSupportedStellarCliVersion, buildContract, buildDependencyGraph, checkBinary, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, generateBindings, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts };