@caatinga/core 3.2.0 → 3.3.1
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/artifact.schema-CIDkTrL3.d.cts +580 -0
- package/dist/artifact.schema-CIDkTrL3.d.ts +580 -0
- package/dist/browser.cjs +4 -0
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +4 -0
- package/dist/index.cjs +708 -171
- package/dist/index.d.cts +210 -9
- package/dist/index.d.ts +210 -9
- package/dist/index.js +670 -147
- package/dist/runtime/requirements.cjs +4 -0
- package/dist/runtime/requirements.js +4 -0
- package/package.json +1 -1
- package/dist/artifact.schema-DZC05uy_.d.cts +0 -186
- package/dist/artifact.schema-DZC05uy_.d.ts +0 -186
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-
|
|
2
|
-
export {
|
|
1
|
+
import { C as CaatingaArtifacts, c as ContractArtifact, A as ArtifactSupersedeReason, d as CaatingaArtifactsV2, e as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-CIDkTrL3.cjs';
|
|
2
|
+
export { g as CURRENT_ARTIFACTS_SCHEMA_VERSION, h as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-CIDkTrL3.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const CAATINGA_CORE_VERSION: string;
|
|
@@ -188,10 +188,106 @@ type CreateInitialArtifactsOptions = {
|
|
|
188
188
|
};
|
|
189
189
|
declare function createInitialArtifacts(project: string, options?: CreateInitialArtifactsOptions): CaatingaArtifacts;
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
type UpdateArtifactOptions = {
|
|
192
192
|
dependencyGraph?: Record<string, string[]>;
|
|
193
|
+
supersedeReason?: ArtifactSupersedeReason;
|
|
194
|
+
};
|
|
195
|
+
declare function updateArtifact(artifacts: CaatingaArtifacts, networkName: string, contractName: string, contractArtifact: ContractArtifact, options?: UpdateArtifactOptions): CaatingaArtifacts;
|
|
196
|
+
declare function restoreArtifactFromHistory(input: {
|
|
197
|
+
artifacts: CaatingaArtifacts;
|
|
198
|
+
networkName: string;
|
|
199
|
+
contractName: string;
|
|
200
|
+
contractId: string;
|
|
193
201
|
}): CaatingaArtifacts;
|
|
194
202
|
|
|
203
|
+
type MigrateArtifactsResult = {
|
|
204
|
+
artifacts: CaatingaArtifactsV2;
|
|
205
|
+
migrated: boolean;
|
|
206
|
+
};
|
|
207
|
+
declare function migrateArtifactsToV2(artifacts: CaatingaArtifacts): MigrateArtifactsResult;
|
|
208
|
+
|
|
209
|
+
declare function migrateArtifactsFile(cwd?: string): Promise<{
|
|
210
|
+
path: string;
|
|
211
|
+
migrated: boolean;
|
|
212
|
+
artifacts: {
|
|
213
|
+
project: string;
|
|
214
|
+
networks: Record<string, {
|
|
215
|
+
contracts: Record<string, {
|
|
216
|
+
contractId: string;
|
|
217
|
+
wasmHash: string;
|
|
218
|
+
deployedAt: string;
|
|
219
|
+
sourcePath: string;
|
|
220
|
+
wasmPath: string;
|
|
221
|
+
dependencies: string[];
|
|
222
|
+
resolvedDeployArgs: Record<string, string | number | boolean>;
|
|
223
|
+
history?: {
|
|
224
|
+
contractId: string;
|
|
225
|
+
wasmHash: string;
|
|
226
|
+
deployedAt: string;
|
|
227
|
+
supersededAt: string;
|
|
228
|
+
reason?: "upgrade" | "rollback" | "force-redeploy" | undefined;
|
|
229
|
+
}[] | undefined;
|
|
230
|
+
}>;
|
|
231
|
+
dependencyGraph: Record<string, string[]>;
|
|
232
|
+
}>;
|
|
233
|
+
version: 2;
|
|
234
|
+
};
|
|
235
|
+
}>;
|
|
236
|
+
|
|
237
|
+
declare function rollbackContractArtifact(input: {
|
|
238
|
+
networkName: string;
|
|
239
|
+
contractName: string;
|
|
240
|
+
contractId: string;
|
|
241
|
+
cwd?: string;
|
|
242
|
+
}): Promise<{
|
|
243
|
+
path: string;
|
|
244
|
+
artifacts: {
|
|
245
|
+
project: string;
|
|
246
|
+
networks: Record<string, {
|
|
247
|
+
contracts: Record<string, {
|
|
248
|
+
contractId: string;
|
|
249
|
+
wasmHash: string;
|
|
250
|
+
deployedAt: string;
|
|
251
|
+
sourcePath: string;
|
|
252
|
+
wasmPath: string;
|
|
253
|
+
dependencies: string[];
|
|
254
|
+
resolvedDeployArgs: Record<string, string | number | boolean>;
|
|
255
|
+
history?: {
|
|
256
|
+
contractId: string;
|
|
257
|
+
wasmHash: string;
|
|
258
|
+
deployedAt: string;
|
|
259
|
+
supersededAt: string;
|
|
260
|
+
reason?: "upgrade" | "rollback" | "force-redeploy" | undefined;
|
|
261
|
+
}[] | undefined;
|
|
262
|
+
}>;
|
|
263
|
+
dependencyGraph: Record<string, string[]>;
|
|
264
|
+
}>;
|
|
265
|
+
version: 1;
|
|
266
|
+
} | {
|
|
267
|
+
project: string;
|
|
268
|
+
networks: Record<string, {
|
|
269
|
+
contracts: Record<string, {
|
|
270
|
+
contractId: string;
|
|
271
|
+
wasmHash: string;
|
|
272
|
+
deployedAt: string;
|
|
273
|
+
sourcePath: string;
|
|
274
|
+
wasmPath: string;
|
|
275
|
+
dependencies: string[];
|
|
276
|
+
resolvedDeployArgs: Record<string, string | number | boolean>;
|
|
277
|
+
history?: {
|
|
278
|
+
contractId: string;
|
|
279
|
+
wasmHash: string;
|
|
280
|
+
deployedAt: string;
|
|
281
|
+
supersededAt: string;
|
|
282
|
+
reason?: "upgrade" | "rollback" | "force-redeploy" | undefined;
|
|
283
|
+
}[] | undefined;
|
|
284
|
+
}>;
|
|
285
|
+
dependencyGraph: Record<string, string[]>;
|
|
286
|
+
}>;
|
|
287
|
+
version: 2;
|
|
288
|
+
};
|
|
289
|
+
}>;
|
|
290
|
+
|
|
195
291
|
declare const BINDING_MARKER_FILENAME = ".caatinga-bindings.json";
|
|
196
292
|
declare const BindingMarkerSchema: z.ZodObject<{
|
|
197
293
|
version: z.ZodLiteral<1>;
|
|
@@ -325,11 +421,59 @@ type CheckStellarCliVersionOptions = {
|
|
|
325
421
|
features?: readonly string[];
|
|
326
422
|
lastTestedVersion?: string;
|
|
327
423
|
onWarning?: (warning: CompatibilityWarning) => void;
|
|
424
|
+
/** When false, skip live capability probes (used in unit tests). Default true. */
|
|
425
|
+
probeFeatures?: boolean;
|
|
328
426
|
};
|
|
329
427
|
declare function checkStellarCliVersion(input?: CheckStellarCliVersionOptions): Promise<CompatibilityReport>;
|
|
330
428
|
|
|
429
|
+
declare const STELLAR_SDK_MIN_VERSION = "16.0.1";
|
|
430
|
+
declare const STELLAR_SDK_LAST_TESTED_VERSION = "16.0.1";
|
|
431
|
+
|
|
432
|
+
type SdkCompatibilityStatus = "supported" | "untested" | "unsupported";
|
|
433
|
+
type SdkCompatibilityWarningCode = "STELLAR_SDK_UNTESTED_VERSION" | "STELLAR_SDK_VERSION_PARSE_FAILED";
|
|
434
|
+
type SdkCompatibilityWarning = {
|
|
435
|
+
code: SdkCompatibilityWarningCode;
|
|
436
|
+
message: string;
|
|
437
|
+
remediation?: string;
|
|
438
|
+
};
|
|
439
|
+
type SdkCompatibilityReport = {
|
|
440
|
+
version: string;
|
|
441
|
+
status: SdkCompatibilityStatus;
|
|
442
|
+
minVersion: string;
|
|
443
|
+
lastTestedVersion: string;
|
|
444
|
+
warnings: SdkCompatibilityWarning[];
|
|
445
|
+
};
|
|
446
|
+
type EvaluateStellarSdkCompatibilityInput = {
|
|
447
|
+
version: string;
|
|
448
|
+
lastTestedVersion?: string;
|
|
449
|
+
};
|
|
450
|
+
declare function evaluateStellarSdkCompatibility(input: EvaluateStellarSdkCompatibilityInput): SdkCompatibilityReport;
|
|
451
|
+
declare function parseStellarSdkVersion(raw: string): string;
|
|
452
|
+
|
|
453
|
+
type CheckStellarSdkVersionOptions = {
|
|
454
|
+
cwd?: string;
|
|
455
|
+
lastTestedVersion?: string;
|
|
456
|
+
onWarning?: (warning: SdkCompatibilityWarning) => void;
|
|
457
|
+
};
|
|
458
|
+
declare function checkStellarSdkVersion(input?: CheckStellarSdkVersionOptions): Promise<SdkCompatibilityReport>;
|
|
459
|
+
|
|
331
460
|
declare function validateSourceShape(source: string): CaatingaError | undefined;
|
|
332
461
|
|
|
462
|
+
/** Identity used when neither --source nor CAATINGA_SOURCE is provided. */
|
|
463
|
+
declare const DEFAULT_CLI_SOURCE = "alice";
|
|
464
|
+
/** Where a resolved CLI source value came from, for honest disclosure to users. */
|
|
465
|
+
type CliSourceOrigin = "explicit" | "env" | "default";
|
|
466
|
+
type ResolvedCliSource = {
|
|
467
|
+
source: string;
|
|
468
|
+
origin: CliSourceOrigin;
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* Resolve the CLI source identity and report where the value came from so the
|
|
472
|
+
* CLI can disclose an implicit fallback instead of silently signing/simulating
|
|
473
|
+
* as `alice`.
|
|
474
|
+
*/
|
|
475
|
+
declare function describeCliSource(explicit?: string): ResolvedCliSource;
|
|
476
|
+
|
|
333
477
|
type ResolvedContract = {
|
|
334
478
|
name: string;
|
|
335
479
|
config: ContractConfig;
|
|
@@ -369,9 +513,17 @@ type DeployContractOptions = {
|
|
|
369
513
|
source?: string;
|
|
370
514
|
cwd?: string;
|
|
371
515
|
force?: boolean;
|
|
516
|
+
upgrade?: boolean;
|
|
372
517
|
checkStaleWasm?: boolean;
|
|
373
518
|
resolvedDeployArgs?: Record<string, DeployArgValue>;
|
|
374
519
|
dependencies?: string[];
|
|
520
|
+
onTransientDeployRetry?: (info: {
|
|
521
|
+
attempt: number;
|
|
522
|
+
maxAttempts: number;
|
|
523
|
+
delayMs: number;
|
|
524
|
+
}) => void;
|
|
525
|
+
/** Override retry backoff delays (primarily for tests). */
|
|
526
|
+
deployRetryDelaysMs?: readonly number[];
|
|
375
527
|
};
|
|
376
528
|
declare function deployContract(options: DeployContractOptions): Promise<{
|
|
377
529
|
contract: {
|
|
@@ -429,8 +581,10 @@ declare function deployContractGraph(options: {
|
|
|
429
581
|
cwd?: string;
|
|
430
582
|
includeDependencies: boolean;
|
|
431
583
|
force: boolean;
|
|
584
|
+
upgrade?: boolean;
|
|
432
585
|
checkStaleWasm?: boolean;
|
|
433
586
|
verifyDeps?: boolean;
|
|
587
|
+
onTransientDeployRetry?: DeployContractOptions["onTransientDeployRetry"];
|
|
434
588
|
}): Promise<DeployContractGraphResult>;
|
|
435
589
|
|
|
436
590
|
declare function buildDependencyGraph(contracts: Record<string, ContractConfig>): Record<string, string[]>;
|
|
@@ -512,6 +666,53 @@ declare function readContract(options: ReadContractOptions): Promise<{
|
|
|
512
666
|
result: string;
|
|
513
667
|
}>;
|
|
514
668
|
|
|
669
|
+
type DeployCostEstimate = {
|
|
670
|
+
contractName: string;
|
|
671
|
+
network: string;
|
|
672
|
+
wasmPath: string;
|
|
673
|
+
inclusionFeeStroops: number;
|
|
674
|
+
resourceFeeStroops?: number;
|
|
675
|
+
totalFeeStroops: number;
|
|
676
|
+
advisory: string;
|
|
677
|
+
rawOutput?: string;
|
|
678
|
+
};
|
|
679
|
+
type EstimateDeployCostOptions = {
|
|
680
|
+
config: CaatingaConfig;
|
|
681
|
+
contractName: string;
|
|
682
|
+
networkName?: string;
|
|
683
|
+
source?: string;
|
|
684
|
+
cwd?: string;
|
|
685
|
+
};
|
|
686
|
+
declare function estimateDeployCost(options: EstimateDeployCostOptions): Promise<DeployCostEstimate>;
|
|
687
|
+
|
|
688
|
+
type ContractInspectResult = {
|
|
689
|
+
contractName: string;
|
|
690
|
+
network: string;
|
|
691
|
+
artifact: {
|
|
692
|
+
contractId: string;
|
|
693
|
+
wasmHash: string;
|
|
694
|
+
deployedAt: string;
|
|
695
|
+
historyCount: number;
|
|
696
|
+
};
|
|
697
|
+
onChain: {
|
|
698
|
+
reachable: boolean;
|
|
699
|
+
detail?: string;
|
|
700
|
+
};
|
|
701
|
+
localWasm: {
|
|
702
|
+
path: string;
|
|
703
|
+
hash?: string;
|
|
704
|
+
matchesArtifact: boolean;
|
|
705
|
+
};
|
|
706
|
+
dependencies: string[];
|
|
707
|
+
};
|
|
708
|
+
type InspectContractOptions = {
|
|
709
|
+
config: CaatingaConfig;
|
|
710
|
+
contractName: string;
|
|
711
|
+
networkName?: string;
|
|
712
|
+
cwd?: string;
|
|
713
|
+
};
|
|
714
|
+
declare function inspectContract(options: InspectContractOptions): Promise<ContractInspectResult>;
|
|
715
|
+
|
|
515
716
|
type CreateProjectFromTemplateOptions = {
|
|
516
717
|
projectName: string;
|
|
517
718
|
targetDir: string;
|
|
@@ -536,8 +737,8 @@ declare function createProjectFromTemplate(options: CreateProjectFromTemplateOpt
|
|
|
536
737
|
templateVersion: number;
|
|
537
738
|
};
|
|
538
739
|
files: {
|
|
539
|
-
config: string;
|
|
540
740
|
artifacts: string;
|
|
741
|
+
config: string;
|
|
541
742
|
};
|
|
542
743
|
description?: string | undefined;
|
|
543
744
|
};
|
|
@@ -600,11 +801,11 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
600
801
|
config: z.ZodDefault<z.ZodString>;
|
|
601
802
|
artifacts: z.ZodDefault<z.ZodString>;
|
|
602
803
|
}, "strip", z.ZodTypeAny, {
|
|
603
|
-
config: string;
|
|
604
804
|
artifacts: string;
|
|
805
|
+
config: string;
|
|
605
806
|
}, {
|
|
606
|
-
config?: string | undefined;
|
|
607
807
|
artifacts?: string | undefined;
|
|
808
|
+
config?: string | undefined;
|
|
608
809
|
}>;
|
|
609
810
|
}, "strip", z.ZodTypeAny, {
|
|
610
811
|
contracts: {
|
|
@@ -622,8 +823,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
622
823
|
templateVersion: number;
|
|
623
824
|
};
|
|
624
825
|
files: {
|
|
625
|
-
config: string;
|
|
626
826
|
artifacts: string;
|
|
827
|
+
config: string;
|
|
627
828
|
};
|
|
628
829
|
description?: string | undefined;
|
|
629
830
|
}, {
|
|
@@ -642,8 +843,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
642
843
|
templateVersion: number;
|
|
643
844
|
};
|
|
644
845
|
files: {
|
|
645
|
-
config?: string | undefined;
|
|
646
846
|
artifacts?: string | undefined;
|
|
847
|
+
config?: string | undefined;
|
|
647
848
|
};
|
|
648
849
|
description?: string | undefined;
|
|
649
850
|
}>;
|
|
@@ -651,4 +852,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
|
|
|
651
852
|
|
|
652
853
|
declare function isTransientTestnetSmokeFailure(logText: string): boolean;
|
|
653
854
|
|
|
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 };
|
|
855
|
+
export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CheckStellarSdkVersionOptions, type CliSourceOrigin, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractInspectResult, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateMinimalProjectOptions, type CreateProjectFromTemplateOptions, type CreateZkProjectOptions, DEFAULT_CLI_SOURCE, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type DeployCostEstimate, type EstimateDeployCostOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type EvaluateStellarSdkCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InspectContractOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, READ_CALL_FAILURE_REGEX, type ReadContractOptions, type ResolvedCliSource, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, STELLAR_SDK_LAST_TESTED_VERSION, STELLAR_SDK_MIN_VERSION, type SdkCompatibilityReport, type SdkCompatibilityStatus, type SdkCompatibilityWarning, type SdkCompatibilityWarningCode, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, buildReadCallHint, checkBinary, checkStellarCliVersion, checkStellarSdkVersion, collectProjectStatus, createInitialArtifacts, createMinimalProject, createProjectFromTemplate, createZkProject, defineConfig, deployContract, deployContractGraph, describeCliSource, estimateDeployCost, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, evaluateStellarSdkCompatibility, generateBindings, generateBindingsGraph, inspectContract, invokeContract, isCargoBinMissingFromPath, isReadCallFailure, isTransientTestnetSmokeFailure, loadConfig, migrateArtifactsFile, migrateArtifactsToV2, parseContractId, parseInvokeTarget, parseStellarCliVersion, parseStellarSdkVersion, readArtifacts, readBindingMarker, readContract, resolveContract, resolveDefaultContractName, resolveDeployArgs, resolveDeployOrder, resolveNetwork, resolveSubprocessEnv, restoreArtifactFromHistory, rollbackContractArtifact, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-
|
|
2
|
-
export {
|
|
1
|
+
import { C as CaatingaArtifacts, c as ContractArtifact, A as ArtifactSupersedeReason, d as CaatingaArtifactsV2, e as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-CIDkTrL3.js';
|
|
2
|
+
export { g as CURRENT_ARTIFACTS_SCHEMA_VERSION, h as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-CIDkTrL3.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const CAATINGA_CORE_VERSION: string;
|
|
@@ -188,10 +188,106 @@ type CreateInitialArtifactsOptions = {
|
|
|
188
188
|
};
|
|
189
189
|
declare function createInitialArtifacts(project: string, options?: CreateInitialArtifactsOptions): CaatingaArtifacts;
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
type UpdateArtifactOptions = {
|
|
192
192
|
dependencyGraph?: Record<string, string[]>;
|
|
193
|
+
supersedeReason?: ArtifactSupersedeReason;
|
|
194
|
+
};
|
|
195
|
+
declare function updateArtifact(artifacts: CaatingaArtifacts, networkName: string, contractName: string, contractArtifact: ContractArtifact, options?: UpdateArtifactOptions): CaatingaArtifacts;
|
|
196
|
+
declare function restoreArtifactFromHistory(input: {
|
|
197
|
+
artifacts: CaatingaArtifacts;
|
|
198
|
+
networkName: string;
|
|
199
|
+
contractName: string;
|
|
200
|
+
contractId: string;
|
|
193
201
|
}): CaatingaArtifacts;
|
|
194
202
|
|
|
203
|
+
type MigrateArtifactsResult = {
|
|
204
|
+
artifacts: CaatingaArtifactsV2;
|
|
205
|
+
migrated: boolean;
|
|
206
|
+
};
|
|
207
|
+
declare function migrateArtifactsToV2(artifacts: CaatingaArtifacts): MigrateArtifactsResult;
|
|
208
|
+
|
|
209
|
+
declare function migrateArtifactsFile(cwd?: string): Promise<{
|
|
210
|
+
path: string;
|
|
211
|
+
migrated: boolean;
|
|
212
|
+
artifacts: {
|
|
213
|
+
project: string;
|
|
214
|
+
networks: Record<string, {
|
|
215
|
+
contracts: Record<string, {
|
|
216
|
+
contractId: string;
|
|
217
|
+
wasmHash: string;
|
|
218
|
+
deployedAt: string;
|
|
219
|
+
sourcePath: string;
|
|
220
|
+
wasmPath: string;
|
|
221
|
+
dependencies: string[];
|
|
222
|
+
resolvedDeployArgs: Record<string, string | number | boolean>;
|
|
223
|
+
history?: {
|
|
224
|
+
contractId: string;
|
|
225
|
+
wasmHash: string;
|
|
226
|
+
deployedAt: string;
|
|
227
|
+
supersededAt: string;
|
|
228
|
+
reason?: "upgrade" | "rollback" | "force-redeploy" | undefined;
|
|
229
|
+
}[] | undefined;
|
|
230
|
+
}>;
|
|
231
|
+
dependencyGraph: Record<string, string[]>;
|
|
232
|
+
}>;
|
|
233
|
+
version: 2;
|
|
234
|
+
};
|
|
235
|
+
}>;
|
|
236
|
+
|
|
237
|
+
declare function rollbackContractArtifact(input: {
|
|
238
|
+
networkName: string;
|
|
239
|
+
contractName: string;
|
|
240
|
+
contractId: string;
|
|
241
|
+
cwd?: string;
|
|
242
|
+
}): Promise<{
|
|
243
|
+
path: string;
|
|
244
|
+
artifacts: {
|
|
245
|
+
project: string;
|
|
246
|
+
networks: Record<string, {
|
|
247
|
+
contracts: Record<string, {
|
|
248
|
+
contractId: string;
|
|
249
|
+
wasmHash: string;
|
|
250
|
+
deployedAt: string;
|
|
251
|
+
sourcePath: string;
|
|
252
|
+
wasmPath: string;
|
|
253
|
+
dependencies: string[];
|
|
254
|
+
resolvedDeployArgs: Record<string, string | number | boolean>;
|
|
255
|
+
history?: {
|
|
256
|
+
contractId: string;
|
|
257
|
+
wasmHash: string;
|
|
258
|
+
deployedAt: string;
|
|
259
|
+
supersededAt: string;
|
|
260
|
+
reason?: "upgrade" | "rollback" | "force-redeploy" | undefined;
|
|
261
|
+
}[] | undefined;
|
|
262
|
+
}>;
|
|
263
|
+
dependencyGraph: Record<string, string[]>;
|
|
264
|
+
}>;
|
|
265
|
+
version: 1;
|
|
266
|
+
} | {
|
|
267
|
+
project: string;
|
|
268
|
+
networks: Record<string, {
|
|
269
|
+
contracts: Record<string, {
|
|
270
|
+
contractId: string;
|
|
271
|
+
wasmHash: string;
|
|
272
|
+
deployedAt: string;
|
|
273
|
+
sourcePath: string;
|
|
274
|
+
wasmPath: string;
|
|
275
|
+
dependencies: string[];
|
|
276
|
+
resolvedDeployArgs: Record<string, string | number | boolean>;
|
|
277
|
+
history?: {
|
|
278
|
+
contractId: string;
|
|
279
|
+
wasmHash: string;
|
|
280
|
+
deployedAt: string;
|
|
281
|
+
supersededAt: string;
|
|
282
|
+
reason?: "upgrade" | "rollback" | "force-redeploy" | undefined;
|
|
283
|
+
}[] | undefined;
|
|
284
|
+
}>;
|
|
285
|
+
dependencyGraph: Record<string, string[]>;
|
|
286
|
+
}>;
|
|
287
|
+
version: 2;
|
|
288
|
+
};
|
|
289
|
+
}>;
|
|
290
|
+
|
|
195
291
|
declare const BINDING_MARKER_FILENAME = ".caatinga-bindings.json";
|
|
196
292
|
declare const BindingMarkerSchema: z.ZodObject<{
|
|
197
293
|
version: z.ZodLiteral<1>;
|
|
@@ -325,11 +421,59 @@ type CheckStellarCliVersionOptions = {
|
|
|
325
421
|
features?: readonly string[];
|
|
326
422
|
lastTestedVersion?: string;
|
|
327
423
|
onWarning?: (warning: CompatibilityWarning) => void;
|
|
424
|
+
/** When false, skip live capability probes (used in unit tests). Default true. */
|
|
425
|
+
probeFeatures?: boolean;
|
|
328
426
|
};
|
|
329
427
|
declare function checkStellarCliVersion(input?: CheckStellarCliVersionOptions): Promise<CompatibilityReport>;
|
|
330
428
|
|
|
429
|
+
declare const STELLAR_SDK_MIN_VERSION = "16.0.1";
|
|
430
|
+
declare const STELLAR_SDK_LAST_TESTED_VERSION = "16.0.1";
|
|
431
|
+
|
|
432
|
+
type SdkCompatibilityStatus = "supported" | "untested" | "unsupported";
|
|
433
|
+
type SdkCompatibilityWarningCode = "STELLAR_SDK_UNTESTED_VERSION" | "STELLAR_SDK_VERSION_PARSE_FAILED";
|
|
434
|
+
type SdkCompatibilityWarning = {
|
|
435
|
+
code: SdkCompatibilityWarningCode;
|
|
436
|
+
message: string;
|
|
437
|
+
remediation?: string;
|
|
438
|
+
};
|
|
439
|
+
type SdkCompatibilityReport = {
|
|
440
|
+
version: string;
|
|
441
|
+
status: SdkCompatibilityStatus;
|
|
442
|
+
minVersion: string;
|
|
443
|
+
lastTestedVersion: string;
|
|
444
|
+
warnings: SdkCompatibilityWarning[];
|
|
445
|
+
};
|
|
446
|
+
type EvaluateStellarSdkCompatibilityInput = {
|
|
447
|
+
version: string;
|
|
448
|
+
lastTestedVersion?: string;
|
|
449
|
+
};
|
|
450
|
+
declare function evaluateStellarSdkCompatibility(input: EvaluateStellarSdkCompatibilityInput): SdkCompatibilityReport;
|
|
451
|
+
declare function parseStellarSdkVersion(raw: string): string;
|
|
452
|
+
|
|
453
|
+
type CheckStellarSdkVersionOptions = {
|
|
454
|
+
cwd?: string;
|
|
455
|
+
lastTestedVersion?: string;
|
|
456
|
+
onWarning?: (warning: SdkCompatibilityWarning) => void;
|
|
457
|
+
};
|
|
458
|
+
declare function checkStellarSdkVersion(input?: CheckStellarSdkVersionOptions): Promise<SdkCompatibilityReport>;
|
|
459
|
+
|
|
331
460
|
declare function validateSourceShape(source: string): CaatingaError | undefined;
|
|
332
461
|
|
|
462
|
+
/** Identity used when neither --source nor CAATINGA_SOURCE is provided. */
|
|
463
|
+
declare const DEFAULT_CLI_SOURCE = "alice";
|
|
464
|
+
/** Where a resolved CLI source value came from, for honest disclosure to users. */
|
|
465
|
+
type CliSourceOrigin = "explicit" | "env" | "default";
|
|
466
|
+
type ResolvedCliSource = {
|
|
467
|
+
source: string;
|
|
468
|
+
origin: CliSourceOrigin;
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* Resolve the CLI source identity and report where the value came from so the
|
|
472
|
+
* CLI can disclose an implicit fallback instead of silently signing/simulating
|
|
473
|
+
* as `alice`.
|
|
474
|
+
*/
|
|
475
|
+
declare function describeCliSource(explicit?: string): ResolvedCliSource;
|
|
476
|
+
|
|
333
477
|
type ResolvedContract = {
|
|
334
478
|
name: string;
|
|
335
479
|
config: ContractConfig;
|
|
@@ -369,9 +513,17 @@ type DeployContractOptions = {
|
|
|
369
513
|
source?: string;
|
|
370
514
|
cwd?: string;
|
|
371
515
|
force?: boolean;
|
|
516
|
+
upgrade?: boolean;
|
|
372
517
|
checkStaleWasm?: boolean;
|
|
373
518
|
resolvedDeployArgs?: Record<string, DeployArgValue>;
|
|
374
519
|
dependencies?: string[];
|
|
520
|
+
onTransientDeployRetry?: (info: {
|
|
521
|
+
attempt: number;
|
|
522
|
+
maxAttempts: number;
|
|
523
|
+
delayMs: number;
|
|
524
|
+
}) => void;
|
|
525
|
+
/** Override retry backoff delays (primarily for tests). */
|
|
526
|
+
deployRetryDelaysMs?: readonly number[];
|
|
375
527
|
};
|
|
376
528
|
declare function deployContract(options: DeployContractOptions): Promise<{
|
|
377
529
|
contract: {
|
|
@@ -429,8 +581,10 @@ declare function deployContractGraph(options: {
|
|
|
429
581
|
cwd?: string;
|
|
430
582
|
includeDependencies: boolean;
|
|
431
583
|
force: boolean;
|
|
584
|
+
upgrade?: boolean;
|
|
432
585
|
checkStaleWasm?: boolean;
|
|
433
586
|
verifyDeps?: boolean;
|
|
587
|
+
onTransientDeployRetry?: DeployContractOptions["onTransientDeployRetry"];
|
|
434
588
|
}): Promise<DeployContractGraphResult>;
|
|
435
589
|
|
|
436
590
|
declare function buildDependencyGraph(contracts: Record<string, ContractConfig>): Record<string, string[]>;
|
|
@@ -512,6 +666,53 @@ declare function readContract(options: ReadContractOptions): Promise<{
|
|
|
512
666
|
result: string;
|
|
513
667
|
}>;
|
|
514
668
|
|
|
669
|
+
type DeployCostEstimate = {
|
|
670
|
+
contractName: string;
|
|
671
|
+
network: string;
|
|
672
|
+
wasmPath: string;
|
|
673
|
+
inclusionFeeStroops: number;
|
|
674
|
+
resourceFeeStroops?: number;
|
|
675
|
+
totalFeeStroops: number;
|
|
676
|
+
advisory: string;
|
|
677
|
+
rawOutput?: string;
|
|
678
|
+
};
|
|
679
|
+
type EstimateDeployCostOptions = {
|
|
680
|
+
config: CaatingaConfig;
|
|
681
|
+
contractName: string;
|
|
682
|
+
networkName?: string;
|
|
683
|
+
source?: string;
|
|
684
|
+
cwd?: string;
|
|
685
|
+
};
|
|
686
|
+
declare function estimateDeployCost(options: EstimateDeployCostOptions): Promise<DeployCostEstimate>;
|
|
687
|
+
|
|
688
|
+
type ContractInspectResult = {
|
|
689
|
+
contractName: string;
|
|
690
|
+
network: string;
|
|
691
|
+
artifact: {
|
|
692
|
+
contractId: string;
|
|
693
|
+
wasmHash: string;
|
|
694
|
+
deployedAt: string;
|
|
695
|
+
historyCount: number;
|
|
696
|
+
};
|
|
697
|
+
onChain: {
|
|
698
|
+
reachable: boolean;
|
|
699
|
+
detail?: string;
|
|
700
|
+
};
|
|
701
|
+
localWasm: {
|
|
702
|
+
path: string;
|
|
703
|
+
hash?: string;
|
|
704
|
+
matchesArtifact: boolean;
|
|
705
|
+
};
|
|
706
|
+
dependencies: string[];
|
|
707
|
+
};
|
|
708
|
+
type InspectContractOptions = {
|
|
709
|
+
config: CaatingaConfig;
|
|
710
|
+
contractName: string;
|
|
711
|
+
networkName?: string;
|
|
712
|
+
cwd?: string;
|
|
713
|
+
};
|
|
714
|
+
declare function inspectContract(options: InspectContractOptions): Promise<ContractInspectResult>;
|
|
715
|
+
|
|
515
716
|
type CreateProjectFromTemplateOptions = {
|
|
516
717
|
projectName: string;
|
|
517
718
|
targetDir: string;
|
|
@@ -536,8 +737,8 @@ declare function createProjectFromTemplate(options: CreateProjectFromTemplateOpt
|
|
|
536
737
|
templateVersion: number;
|
|
537
738
|
};
|
|
538
739
|
files: {
|
|
539
|
-
config: string;
|
|
540
740
|
artifacts: string;
|
|
741
|
+
config: string;
|
|
541
742
|
};
|
|
542
743
|
description?: string | undefined;
|
|
543
744
|
};
|
|
@@ -600,11 +801,11 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
600
801
|
config: z.ZodDefault<z.ZodString>;
|
|
601
802
|
artifacts: z.ZodDefault<z.ZodString>;
|
|
602
803
|
}, "strip", z.ZodTypeAny, {
|
|
603
|
-
config: string;
|
|
604
804
|
artifacts: string;
|
|
805
|
+
config: string;
|
|
605
806
|
}, {
|
|
606
|
-
config?: string | undefined;
|
|
607
807
|
artifacts?: string | undefined;
|
|
808
|
+
config?: string | undefined;
|
|
608
809
|
}>;
|
|
609
810
|
}, "strip", z.ZodTypeAny, {
|
|
610
811
|
contracts: {
|
|
@@ -622,8 +823,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
622
823
|
templateVersion: number;
|
|
623
824
|
};
|
|
624
825
|
files: {
|
|
625
|
-
config: string;
|
|
626
826
|
artifacts: string;
|
|
827
|
+
config: string;
|
|
627
828
|
};
|
|
628
829
|
description?: string | undefined;
|
|
629
830
|
}, {
|
|
@@ -642,8 +843,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
642
843
|
templateVersion: number;
|
|
643
844
|
};
|
|
644
845
|
files: {
|
|
645
|
-
config?: string | undefined;
|
|
646
846
|
artifacts?: string | undefined;
|
|
847
|
+
config?: string | undefined;
|
|
647
848
|
};
|
|
648
849
|
description?: string | undefined;
|
|
649
850
|
}>;
|
|
@@ -651,4 +852,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
|
|
|
651
852
|
|
|
652
853
|
declare function isTransientTestnetSmokeFailure(logText: string): boolean;
|
|
653
854
|
|
|
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 };
|
|
855
|
+
export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CheckStellarSdkVersionOptions, type CliSourceOrigin, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractInspectResult, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateMinimalProjectOptions, type CreateProjectFromTemplateOptions, type CreateZkProjectOptions, DEFAULT_CLI_SOURCE, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type DeployCostEstimate, type EstimateDeployCostOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type EvaluateStellarSdkCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InspectContractOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, READ_CALL_FAILURE_REGEX, type ReadContractOptions, type ResolvedCliSource, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, STELLAR_SDK_LAST_TESTED_VERSION, STELLAR_SDK_MIN_VERSION, type SdkCompatibilityReport, type SdkCompatibilityStatus, type SdkCompatibilityWarning, type SdkCompatibilityWarningCode, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, buildReadCallHint, checkBinary, checkStellarCliVersion, checkStellarSdkVersion, collectProjectStatus, createInitialArtifacts, createMinimalProject, createProjectFromTemplate, createZkProject, defineConfig, deployContract, deployContractGraph, describeCliSource, estimateDeployCost, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, evaluateStellarSdkCompatibility, generateBindings, generateBindingsGraph, inspectContract, invokeContract, isCargoBinMissingFromPath, isReadCallFailure, isTransientTestnetSmokeFailure, loadConfig, migrateArtifactsFile, migrateArtifactsToV2, parseContractId, parseInvokeTarget, parseStellarCliVersion, parseStellarSdkVersion, readArtifacts, readBindingMarker, readContract, resolveContract, resolveDefaultContractName, resolveDeployArgs, resolveDeployOrder, resolveNetwork, resolveSubprocessEnv, restoreArtifactFromHistory, rollbackContractArtifact, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };
|