@caatinga/core 3.2.0 → 3.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.
- 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 +667 -151
- package/dist/index.d.cts +195 -9
- package/dist/index.d.ts +195 -9
- package/dist/index.js +630 -126
- 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,9 +421,42 @@ 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
|
|
|
333
462
|
type ResolvedContract = {
|
|
@@ -369,9 +498,17 @@ type DeployContractOptions = {
|
|
|
369
498
|
source?: string;
|
|
370
499
|
cwd?: string;
|
|
371
500
|
force?: boolean;
|
|
501
|
+
upgrade?: boolean;
|
|
372
502
|
checkStaleWasm?: boolean;
|
|
373
503
|
resolvedDeployArgs?: Record<string, DeployArgValue>;
|
|
374
504
|
dependencies?: string[];
|
|
505
|
+
onTransientDeployRetry?: (info: {
|
|
506
|
+
attempt: number;
|
|
507
|
+
maxAttempts: number;
|
|
508
|
+
delayMs: number;
|
|
509
|
+
}) => void;
|
|
510
|
+
/** Override retry backoff delays (primarily for tests). */
|
|
511
|
+
deployRetryDelaysMs?: readonly number[];
|
|
375
512
|
};
|
|
376
513
|
declare function deployContract(options: DeployContractOptions): Promise<{
|
|
377
514
|
contract: {
|
|
@@ -429,8 +566,10 @@ declare function deployContractGraph(options: {
|
|
|
429
566
|
cwd?: string;
|
|
430
567
|
includeDependencies: boolean;
|
|
431
568
|
force: boolean;
|
|
569
|
+
upgrade?: boolean;
|
|
432
570
|
checkStaleWasm?: boolean;
|
|
433
571
|
verifyDeps?: boolean;
|
|
572
|
+
onTransientDeployRetry?: DeployContractOptions["onTransientDeployRetry"];
|
|
434
573
|
}): Promise<DeployContractGraphResult>;
|
|
435
574
|
|
|
436
575
|
declare function buildDependencyGraph(contracts: Record<string, ContractConfig>): Record<string, string[]>;
|
|
@@ -512,6 +651,53 @@ declare function readContract(options: ReadContractOptions): Promise<{
|
|
|
512
651
|
result: string;
|
|
513
652
|
}>;
|
|
514
653
|
|
|
654
|
+
type DeployCostEstimate = {
|
|
655
|
+
contractName: string;
|
|
656
|
+
network: string;
|
|
657
|
+
wasmPath: string;
|
|
658
|
+
inclusionFeeStroops: number;
|
|
659
|
+
resourceFeeStroops?: number;
|
|
660
|
+
totalFeeStroops: number;
|
|
661
|
+
advisory: string;
|
|
662
|
+
rawOutput?: string;
|
|
663
|
+
};
|
|
664
|
+
type EstimateDeployCostOptions = {
|
|
665
|
+
config: CaatingaConfig;
|
|
666
|
+
contractName: string;
|
|
667
|
+
networkName?: string;
|
|
668
|
+
source?: string;
|
|
669
|
+
cwd?: string;
|
|
670
|
+
};
|
|
671
|
+
declare function estimateDeployCost(options: EstimateDeployCostOptions): Promise<DeployCostEstimate>;
|
|
672
|
+
|
|
673
|
+
type ContractInspectResult = {
|
|
674
|
+
contractName: string;
|
|
675
|
+
network: string;
|
|
676
|
+
artifact: {
|
|
677
|
+
contractId: string;
|
|
678
|
+
wasmHash: string;
|
|
679
|
+
deployedAt: string;
|
|
680
|
+
historyCount: number;
|
|
681
|
+
};
|
|
682
|
+
onChain: {
|
|
683
|
+
reachable: boolean;
|
|
684
|
+
detail?: string;
|
|
685
|
+
};
|
|
686
|
+
localWasm: {
|
|
687
|
+
path: string;
|
|
688
|
+
hash?: string;
|
|
689
|
+
matchesArtifact: boolean;
|
|
690
|
+
};
|
|
691
|
+
dependencies: string[];
|
|
692
|
+
};
|
|
693
|
+
type InspectContractOptions = {
|
|
694
|
+
config: CaatingaConfig;
|
|
695
|
+
contractName: string;
|
|
696
|
+
networkName?: string;
|
|
697
|
+
cwd?: string;
|
|
698
|
+
};
|
|
699
|
+
declare function inspectContract(options: InspectContractOptions): Promise<ContractInspectResult>;
|
|
700
|
+
|
|
515
701
|
type CreateProjectFromTemplateOptions = {
|
|
516
702
|
projectName: string;
|
|
517
703
|
targetDir: string;
|
|
@@ -536,8 +722,8 @@ declare function createProjectFromTemplate(options: CreateProjectFromTemplateOpt
|
|
|
536
722
|
templateVersion: number;
|
|
537
723
|
};
|
|
538
724
|
files: {
|
|
539
|
-
config: string;
|
|
540
725
|
artifacts: string;
|
|
726
|
+
config: string;
|
|
541
727
|
};
|
|
542
728
|
description?: string | undefined;
|
|
543
729
|
};
|
|
@@ -600,11 +786,11 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
600
786
|
config: z.ZodDefault<z.ZodString>;
|
|
601
787
|
artifacts: z.ZodDefault<z.ZodString>;
|
|
602
788
|
}, "strip", z.ZodTypeAny, {
|
|
603
|
-
config: string;
|
|
604
789
|
artifacts: string;
|
|
790
|
+
config: string;
|
|
605
791
|
}, {
|
|
606
|
-
config?: string | undefined;
|
|
607
792
|
artifacts?: string | undefined;
|
|
793
|
+
config?: string | undefined;
|
|
608
794
|
}>;
|
|
609
795
|
}, "strip", z.ZodTypeAny, {
|
|
610
796
|
contracts: {
|
|
@@ -622,8 +808,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
622
808
|
templateVersion: number;
|
|
623
809
|
};
|
|
624
810
|
files: {
|
|
625
|
-
config: string;
|
|
626
811
|
artifacts: string;
|
|
812
|
+
config: string;
|
|
627
813
|
};
|
|
628
814
|
description?: string | undefined;
|
|
629
815
|
}, {
|
|
@@ -642,8 +828,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
642
828
|
templateVersion: number;
|
|
643
829
|
};
|
|
644
830
|
files: {
|
|
645
|
-
config?: string | undefined;
|
|
646
831
|
artifacts?: string | undefined;
|
|
832
|
+
config?: string | undefined;
|
|
647
833
|
};
|
|
648
834
|
description?: string | undefined;
|
|
649
835
|
}>;
|
|
@@ -651,4 +837,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
|
|
|
651
837
|
|
|
652
838
|
declare function isTransientTestnetSmokeFailure(logText: string): boolean;
|
|
653
839
|
|
|
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 };
|
|
840
|
+
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 CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractInspectResult, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateMinimalProjectOptions, type CreateProjectFromTemplateOptions, type CreateZkProjectOptions, 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 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, 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,9 +421,42 @@ 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
|
|
|
333
462
|
type ResolvedContract = {
|
|
@@ -369,9 +498,17 @@ type DeployContractOptions = {
|
|
|
369
498
|
source?: string;
|
|
370
499
|
cwd?: string;
|
|
371
500
|
force?: boolean;
|
|
501
|
+
upgrade?: boolean;
|
|
372
502
|
checkStaleWasm?: boolean;
|
|
373
503
|
resolvedDeployArgs?: Record<string, DeployArgValue>;
|
|
374
504
|
dependencies?: string[];
|
|
505
|
+
onTransientDeployRetry?: (info: {
|
|
506
|
+
attempt: number;
|
|
507
|
+
maxAttempts: number;
|
|
508
|
+
delayMs: number;
|
|
509
|
+
}) => void;
|
|
510
|
+
/** Override retry backoff delays (primarily for tests). */
|
|
511
|
+
deployRetryDelaysMs?: readonly number[];
|
|
375
512
|
};
|
|
376
513
|
declare function deployContract(options: DeployContractOptions): Promise<{
|
|
377
514
|
contract: {
|
|
@@ -429,8 +566,10 @@ declare function deployContractGraph(options: {
|
|
|
429
566
|
cwd?: string;
|
|
430
567
|
includeDependencies: boolean;
|
|
431
568
|
force: boolean;
|
|
569
|
+
upgrade?: boolean;
|
|
432
570
|
checkStaleWasm?: boolean;
|
|
433
571
|
verifyDeps?: boolean;
|
|
572
|
+
onTransientDeployRetry?: DeployContractOptions["onTransientDeployRetry"];
|
|
434
573
|
}): Promise<DeployContractGraphResult>;
|
|
435
574
|
|
|
436
575
|
declare function buildDependencyGraph(contracts: Record<string, ContractConfig>): Record<string, string[]>;
|
|
@@ -512,6 +651,53 @@ declare function readContract(options: ReadContractOptions): Promise<{
|
|
|
512
651
|
result: string;
|
|
513
652
|
}>;
|
|
514
653
|
|
|
654
|
+
type DeployCostEstimate = {
|
|
655
|
+
contractName: string;
|
|
656
|
+
network: string;
|
|
657
|
+
wasmPath: string;
|
|
658
|
+
inclusionFeeStroops: number;
|
|
659
|
+
resourceFeeStroops?: number;
|
|
660
|
+
totalFeeStroops: number;
|
|
661
|
+
advisory: string;
|
|
662
|
+
rawOutput?: string;
|
|
663
|
+
};
|
|
664
|
+
type EstimateDeployCostOptions = {
|
|
665
|
+
config: CaatingaConfig;
|
|
666
|
+
contractName: string;
|
|
667
|
+
networkName?: string;
|
|
668
|
+
source?: string;
|
|
669
|
+
cwd?: string;
|
|
670
|
+
};
|
|
671
|
+
declare function estimateDeployCost(options: EstimateDeployCostOptions): Promise<DeployCostEstimate>;
|
|
672
|
+
|
|
673
|
+
type ContractInspectResult = {
|
|
674
|
+
contractName: string;
|
|
675
|
+
network: string;
|
|
676
|
+
artifact: {
|
|
677
|
+
contractId: string;
|
|
678
|
+
wasmHash: string;
|
|
679
|
+
deployedAt: string;
|
|
680
|
+
historyCount: number;
|
|
681
|
+
};
|
|
682
|
+
onChain: {
|
|
683
|
+
reachable: boolean;
|
|
684
|
+
detail?: string;
|
|
685
|
+
};
|
|
686
|
+
localWasm: {
|
|
687
|
+
path: string;
|
|
688
|
+
hash?: string;
|
|
689
|
+
matchesArtifact: boolean;
|
|
690
|
+
};
|
|
691
|
+
dependencies: string[];
|
|
692
|
+
};
|
|
693
|
+
type InspectContractOptions = {
|
|
694
|
+
config: CaatingaConfig;
|
|
695
|
+
contractName: string;
|
|
696
|
+
networkName?: string;
|
|
697
|
+
cwd?: string;
|
|
698
|
+
};
|
|
699
|
+
declare function inspectContract(options: InspectContractOptions): Promise<ContractInspectResult>;
|
|
700
|
+
|
|
515
701
|
type CreateProjectFromTemplateOptions = {
|
|
516
702
|
projectName: string;
|
|
517
703
|
targetDir: string;
|
|
@@ -536,8 +722,8 @@ declare function createProjectFromTemplate(options: CreateProjectFromTemplateOpt
|
|
|
536
722
|
templateVersion: number;
|
|
537
723
|
};
|
|
538
724
|
files: {
|
|
539
|
-
config: string;
|
|
540
725
|
artifacts: string;
|
|
726
|
+
config: string;
|
|
541
727
|
};
|
|
542
728
|
description?: string | undefined;
|
|
543
729
|
};
|
|
@@ -600,11 +786,11 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
600
786
|
config: z.ZodDefault<z.ZodString>;
|
|
601
787
|
artifacts: z.ZodDefault<z.ZodString>;
|
|
602
788
|
}, "strip", z.ZodTypeAny, {
|
|
603
|
-
config: string;
|
|
604
789
|
artifacts: string;
|
|
790
|
+
config: string;
|
|
605
791
|
}, {
|
|
606
|
-
config?: string | undefined;
|
|
607
792
|
artifacts?: string | undefined;
|
|
793
|
+
config?: string | undefined;
|
|
608
794
|
}>;
|
|
609
795
|
}, "strip", z.ZodTypeAny, {
|
|
610
796
|
contracts: {
|
|
@@ -622,8 +808,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
622
808
|
templateVersion: number;
|
|
623
809
|
};
|
|
624
810
|
files: {
|
|
625
|
-
config: string;
|
|
626
811
|
artifacts: string;
|
|
812
|
+
config: string;
|
|
627
813
|
};
|
|
628
814
|
description?: string | undefined;
|
|
629
815
|
}, {
|
|
@@ -642,8 +828,8 @@ declare const TemplateManifestSchema: z.ZodObject<{
|
|
|
642
828
|
templateVersion: number;
|
|
643
829
|
};
|
|
644
830
|
files: {
|
|
645
|
-
config?: string | undefined;
|
|
646
831
|
artifacts?: string | undefined;
|
|
832
|
+
config?: string | undefined;
|
|
647
833
|
};
|
|
648
834
|
description?: string | undefined;
|
|
649
835
|
}>;
|
|
@@ -651,4 +837,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
|
|
|
651
837
|
|
|
652
838
|
declare function isTransientTestnetSmokeFailure(logText: string): boolean;
|
|
653
839
|
|
|
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 };
|
|
840
|
+
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 CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractInspectResult, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateMinimalProjectOptions, type CreateProjectFromTemplateOptions, type CreateZkProjectOptions, 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 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, 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 };
|